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.

138 lines
2.9 KiB

  1. /****************************************************************************************************************
  2. FILENAME: FsSubs.h
  3. COPYRIGHT 2001 Microsoft Corporation and Executive Software International, Inc.
  4. ***************************************************************************************************************/
  5. #ifndef _FSSUBS_H_
  6. #define _FSSUBS_H_
  7. #include "dfrgengn.h"
  8. #include "FraggedFileList.h"
  9. #ifdef OFFLINEDK
  10. BOOL
  11. GetFileSystem(
  12. IN TCHAR DriveLetter,
  13. OUT PULONG pFileSystem
  14. );
  15. #else
  16. BOOL
  17. GetFileSystem(
  18. IN PTCHAR volumeName,
  19. OUT PULONG pFileSystem,
  20. OUT TCHAR* pVolumeLabel
  21. );
  22. #endif
  23. //Reduces an extent list to an actual extent list as can be seen on the disk.
  24. //Sometimes extent lists contain two or more factually contiguous "extents".
  25. BOOL
  26. CollapseExtentList(
  27. EXTENT_LIST_DATA* pExtentData
  28. );
  29. BOOL
  30. CountStreamExtentsAndClusters(
  31. DWORD dwStreamNumber,
  32. LONGLONG* pExcessExtents,
  33. LONGLONG* pClusters
  34. );
  35. //Gets the earliest Lcn of the file on the drive.
  36. BOOL
  37. GetLowestStartingLcn(
  38. OUT LONGLONG* pStartingLcn,
  39. FILE_EXTENT_HEADER* pFileExtentHeader
  40. );
  41. BOOL
  42. FillMostFraggedList(
  43. CFraggedFileList &fraggedFileList,
  44. IN CONST BOOL fAnalyseOnly = FALSE
  45. );
  46. // compresses long paths into 50 character paths
  47. BOOL ESICompressFilePath(
  48. IN PTCHAR infilePath,
  49. OUT PTCHAR outFilePath
  50. );
  51. // compresses long paths into 50 character paths, in place
  52. TCHAR * ESICompressFilePath(
  53. IN PTCHAR inFilePath
  54. );
  55. BOOL
  56. IsVolumeDirty(
  57. void
  58. );
  59. BOOL
  60. IsVolumeRemovable(
  61. PTCHAR volumeName
  62. );
  63. BOOL
  64. IsFAT12Volume(
  65. PTCHAR volumeName
  66. );
  67. void FormatDisplayString(
  68. TCHAR driveLetter,
  69. PTCHAR volumeLabel,
  70. PTCHAR displayLabel
  71. );
  72. //*************************************
  73. //
  74. // These are for NT5 only
  75. //
  76. //*************************************
  77. #define MAX_MOUNT_POINTS 10
  78. #ifndef VER4 // NT5 version
  79. BOOL GetDriveLetterByGUID(
  80. PTCHAR volumeName,
  81. TCHAR &driveLetter
  82. );
  83. BOOL GetMountPointList(
  84. VString Name, // path to a mount point (start with a drive letter)
  85. PWSTR VolumeName, // guid of volume in question
  86. VString mountPointList[MAX_MOUNT_POINTS],
  87. UINT &mountPointCount
  88. );
  89. // gets the mount point list given a guid
  90. void GetVolumeMountPointList(
  91. PWSTR volumeName,
  92. VString mountPointList[MAX_MOUNT_POINTS],
  93. UINT &mountPointCount
  94. );
  95. // overload of NT4 version for use with NT5
  96. void FormatDisplayString(
  97. TCHAR driveLetter,
  98. PTCHAR volumeLabel,
  99. VString mountPointList[MAX_MOUNT_POINTS],
  100. UINT mountPointCount,
  101. PTCHAR displayLabel
  102. );
  103. // check if enough free space exists to defrag
  104. BOOL ValidateFreeSpace(BOOL bCommandLineMode, LONGLONG llFreeSpace, LONGLONG llUsableFreeSpace,
  105. LONGLONG llDiskSize, TCHAR *VolLabel, TCHAR *returnMsg, UINT returnMsgLen);
  106. BOOL IsBootVolume(
  107. IN TCHAR tDrive
  108. );
  109. #endif // #ifndef VER4
  110. #endif //#ifndef _FSSUBS_H_