Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.5 KiB

  1. /**************************************************************************************************
  2. FILENAME: BootOptimizeFat.h
  3. COPYRIGHT 2001 Microsoft Corporation and Executive Software International, Inc.
  4. DESCRIPTION:
  5. Boot Optimize.
  6. **************************************************************************************************/
  7. //
  8. // Prototype for NtFsControlFile and data structures
  9. // used in its definition
  10. //
  11. //typedef LONG NTSTATUS;
  12. //
  13. // This is the definition for a VCN/LCN (virtual cluster/logical cluster)
  14. // mapping pair that is returned in the buffer passed to
  15. // FSCTL_GET_RETRIEVAL_POINTERS
  16. //
  17. typedef struct {
  18. ULONGLONG Vcn;
  19. ULONGLONG Lcn;
  20. } MAPPING_PAIR, *PMAPPING_PAIR;
  21. //
  22. // This is the definition for the buffer that FSCTL_GET_RETRIEVAL_POINTERS
  23. // returns. It consists of a header followed by mapping pairs
  24. //
  25. typedef struct {
  26. ULONG NumberOfPairs;
  27. ULONGLONG StartVcn;
  28. MAPPING_PAIR Pair[1];
  29. } GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR;
  30. DWORD BootOptimize(
  31. IN HANDLE hVolumeHandle,
  32. IN LONGLONG BitmapSize,
  33. IN LONGLONG BytesPerSector,
  34. IN LONGLONG TotalClusters,
  35. IN BOOL IsNtfs,
  36. IN ULONGLONG MftZoneStart,
  37. IN ULONGLONG MftZoneEnd,
  38. IN TCHAR tDrive
  39. );
  40. BOOL LoadOptimizeFileList(
  41. IN TCHAR* cBootOptimzePath,
  42. IN BOOL IsNtfs,
  43. IN TCHAR tDrive,
  44. IN UINT uNumberofRecords
  45. );
  46. VOID FreeFileList();
  47. LONGLONG GetSizeInformationAboutFiles();
  48. ULONGLONG GetFileSizeInfo(
  49. IN HANDLE hBootOptimizeFileHandle
  50. );
  51. BOOL MoveFilesInOrder(
  52. IN ULONGLONG lFirstAvailableFreeSpace,
  53. IN ULONGLONG lEndOfFreeSpace,
  54. IN HANDLE hBootVolumeHandle
  55. );
  56. BOOL GetBootOptimizeFileStreams(
  57. IN HANDLE hBootOptimizeFileHandle,
  58. IN TCHAR* tBootOptimizeFile,
  59. IN UINT uNumberofRecords
  60. );
  61. static PTCHAR ParseStreamName(
  62. IN PTCHAR StreamName
  63. );
  64. HANDLE GetFileHandle(
  65. IN TCHAR* tBootOptimizeFile
  66. );
  67. BOOL GetRegistryEntires(
  68. OUT TCHAR cBootOptimzePath[MAX_PATH]
  69. );
  70. VOID SetRegistryEntires(
  71. IN LONGLONG lLcnStartLocation,
  72. IN LONGLONG lLcnEndLocation
  73. );
  74. BOOL CloseFileHandle(
  75. IN HANDLE hBootOptimizeFileHandle
  76. );
  77. BOOL OpenReadBootOptimeFileIntoList(
  78. IN TCHAR* cBootOptimzePath,
  79. IN BOOL IsNtfs,
  80. IN TCHAR tDrive
  81. );
  82. UINT CountNumberofRecordsinFile(
  83. IN TCHAR* cBootOptimzePath
  84. );
  85. BOOL IsAValidFile(
  86. IN TCHAR pBootOptimizeFileName[MAX_PATH+1],
  87. IN TCHAR tDrive
  88. );
  89. VOID SaveErrorInRegistry(
  90. TCHAR* tComplete,
  91. TCHAR* tErrorString
  92. );
  93. LONGLONG GetStartingEndLncLocations(
  94. IN PTCHAR pRegKey
  95. );
  96. BOOL CheckDateTimeStampInputFile(
  97. IN TCHAR cBootOptimzePath[MAX_PATH]
  98. );