Leaked source code of windows server 2003
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.

218 lines
7.2 KiB

  1. /*++
  2. Copyright (c) 1990-2001 Microsoft Corporation
  3. Module Name:
  4. ifsentry.hxx
  5. Abstract:
  6. Contains prototypes for entry points to the IFS
  7. utility DLLs.
  8. Author:
  9. Bill McJohn (billmc) 04-June-1991
  10. Environment:
  11. User Mode
  12. --*/
  13. #if !defined ( _IFS_ENTRY_ )
  14. #define _IFS_ENTRY_
  15. #if !defined(_IFS_SERV_)
  16. //
  17. // Definition of DRIVE_TYPE
  18. //
  19. enum DRIVE_TYPE {
  20. UnknownDrive,
  21. RemovableDrive,
  22. FixedDrive,
  23. RemoteDrive,
  24. CdRomDrive,
  25. RamDiskDrive
  26. };
  27. //
  28. // Internal definitions for Flags field in CHKDSKEX_FN_PARAM
  29. //
  30. #define CHKDSK_RECOVER_FREE_SPACE 0x00000002UL
  31. #define CHKDSK_RECOVER_ALLOC_SPACE 0x00000004UL
  32. //
  33. // External definitions for Flags field in CHKDSKEX_FN_PARAM
  34. //
  35. // CHKDSK_VERBOSE
  36. // - For FAT, chkdsk will print every filename being processed
  37. // - For NTFS, chkdsk will print clean up messages
  38. // CHKDSK_RECOVER
  39. // - Perform sector checking on free and allocated space
  40. // CHKDSK_EXTEND
  41. // - For NTFS, chkdsk will extend a volume
  42. // CHKDSK_DOWNGRADE (for NT 5 or later but obsolete anyway)
  43. // - For NTFS, this downgrade a volume from most recent NTFS version
  44. // CHKDSK_ENABLE_UPGRADE (for NT 5 or later but obsolete anyway)
  45. // - For NTFS, this upgrades a volume to most recent NTFS version
  46. // CHKDSK_RESIZE_LOGFILE
  47. // - For NTFS, this changes the size of the logfile
  48. // CHKDSK_CHECK_IF_DIRTY
  49. // - Perform consistency check only if the volume is dirty
  50. // CHKDSK_FORCE
  51. // - Forces the volume to dismount first if necessary (implies /F)
  52. // CHKDSK_SKIP_INDEX_SCAN
  53. // - Skip the scanning of each index entry
  54. // CHKDSK_SKIP_CYCLE_SCAN
  55. // - Skip the checking of cycles within the directory tree
  56. // CHKDSK_ALGORITHM_SPECIFIED
  57. // - For NTFS, this indicates an algorithm value is specified
  58. // This bit cannot be used together with CHKDSK_SKIP_INDEX_SCAN
  59. #define CHKDSK_VERBOSE 0x00000001UL
  60. #define CHKDSK_RECOVER (CHKDSK_RECOVER_FREE_SPACE | \
  61. CHKDSK_RECOVER_ALLOC_SPACE)
  62. #define CHKDSK_EXTEND 0x00000008UL
  63. #define CHKDSK_DOWNGRADE 0x00000010UL
  64. #define CHKDSK_ENABLE_UPGRADE 0x00000020UL
  65. #define CHKDSK_RESIZE_LOGFILE 0x00000040UL
  66. #define CHKDSK_CHECK_IF_DIRTY 0x00000080UL
  67. #define CHKDSK_FORCE 0x00000100UL
  68. #define CHKDSK_SKIP_INDEX_SCAN 0x00000200UL
  69. #define CHKDSK_SKIP_CYCLE_SCAN 0x00000400UL
  70. #define CHKDSK_ALGORITHM_SPECIFIED 0x00000800UL
  71. //
  72. // Values related to the above bits
  73. //
  74. #define CHKDSK_MAX_ALGORITHM_VALUE 50
  75. typedef struct _CHKDSKEX_FN_PARAM {
  76. UCHAR Major; // initial version is 1.0
  77. UCHAR Minor;
  78. ULONG Flags;
  79. ULONG LogFileSize;
  80. PPATH PathToCheck; // path including mount points
  81. PPATH RootPath; // path from the root of the actual drive
  82. USHORT Algorithm; // number of passes to use during stage 2 of NTFS chkdsk
  83. } CHKDSKEX_FN_PARAM, *PCHKDSKEX_FN_PARAM;
  84. //
  85. // External definitions for Flags field in FORMATEX_FN_PARAM
  86. //
  87. #define FORMAT_QUICK 0x00000001UL
  88. #define FORMAT_BACKWARD_COMPATIBLE 0x00000002UL
  89. #define FORMAT_FORCE 0x00000004UL
  90. #define FORMAT_YES 0x80000000UL
  91. // FORMAT_QUICK
  92. // - Performs a quick format
  93. // FORMAT_BACKWARD_COMPATIBLE
  94. // - Formats a volume to be backward compatible to an older version of NTFS volume
  95. // FORMAT_FORCE
  96. // - Forces the volume to dismount first if necessary
  97. // FORMAT_YES
  98. // - Ignore all warnings and safety prompts. Just go ahead and format.
  99. typedef struct _FORMATEX_FN_PARAM {
  100. UCHAR Major; // initial version is 1.0
  101. UCHAR Minor;
  102. ULONG Flags;
  103. PCWSTRING LabelString; // supplies the volume's label
  104. ULONG ClusterSize; // supplies the cluster size for the volume
  105. } FORMATEX_FN_PARAM, *PFORMATEX_FN_PARAM;
  106. #endif // _IFS_SERV_
  107. #if defined( _AUTOCHECK_ ) && !defined( _SETUP_LOADER_ )
  108. #define FAR
  109. #define WINAPI __stdcall
  110. #define APIENTRY WINAPI
  111. #endif // _AUTOCHECK_ || _SETUP_LOADER_
  112. typedef BOOLEAN(FAR APIENTRY * CHKDSK_FN)( PCWSTRING DriveName,
  113. PMESSAGE Message,
  114. BOOLEAN Fix,
  115. BOOLEAN Verbose,
  116. BOOLEAN OnlyIfDirty,
  117. BOOLEAN Recover,
  118. PPATH PathToCheck,
  119. BOOLEAN Extend,
  120. BOOLEAN ResizeLogFile,
  121. ULONG LogFileSize,
  122. PULONG ExitStatus);
  123. typedef BOOLEAN(FAR APIENTRY * CHKDSKEX_FN)( PCWSTRING DriveName,
  124. PMESSAGE Message,
  125. BOOLEAN Fix,
  126. PCHKDSKEX_FN_PARAM Param,
  127. PULONG ExitStatus );
  128. typedef BOOLEAN(FAR APIENTRY * FORMAT_FN)( PCWSTRING,
  129. PMESSAGE,
  130. BOOLEAN,
  131. BOOLEAN,
  132. MEDIA_TYPE,
  133. PCWSTRING,
  134. ULONG );
  135. typedef BOOLEAN(FAR APIENTRY * FORMATEX_FN)( PCWSTRING,
  136. PMESSAGE,
  137. PFORMATEX_FN_PARAM,
  138. MEDIA_TYPE );
  139. typedef BOOLEAN(FAR APIENTRY * RECOVER_FN)( PPATH, PMESSAGE );
  140. typedef BOOLEAN (FAR APIENTRY * EXTEND_FN)(PCWSTRING, PMESSAGE, BOOLEAN Verify);
  141. #if !defined(_IFS_SERV_)
  142. //
  143. // Convert status code
  144. //
  145. typedef enum _CONVERT_STATUS {
  146. CONVERT_STATUS_CONVERTED,
  147. CONVERT_STATUS_INVALID_FILESYSTEM,
  148. CONVERT_STATUS_CONVERSION_NOT_AVAILABLE,
  149. CONVERT_STATUS_CANNOT_LOCK_DRIVE,
  150. CONVERT_STATUS_ERROR,
  151. CONVERT_STATUS_INSUFFICIENT_SPACE,
  152. CONVERT_STATUS_NTFS_RESERVED_NAMES,
  153. CONVERT_STATUS_DRIVE_IS_DIRTY,
  154. CONVERT_STATUS_INSUFFICIENT_FREE_SPACE,
  155. CONVERT_STATUS_WRITE_PROTECTED
  156. } CONVERT_STATUS, *PCONVERT_STATUS;
  157. #endif // _IFS_SERV_
  158. //
  159. // Convert option flags
  160. //
  161. #define CONVERT_VERBOSE_FLAG (0x00000001)
  162. #define CONVERT_NOCHKDSK_FLAG (0x00000002)
  163. #define CONVERT_FORCE_DISMOUNT_FLAG (0x00000004)
  164. #define CONVERT_PAUSE_FLAG (0x00000008)
  165. #define CONVERT_NOSECURITY_FLAG (0x00000010)
  166. typedef LONG(FAR APIENTRY * IS_CONVERSION_AVAIL_FN)( PCWSTRING );
  167. typedef BOOLEAN(FAR APIENTRY * CONVERT_FN)( PCWSTRING,
  168. PCWSTRING,
  169. PCWSTRING,
  170. PMESSAGE,
  171. ULONG,
  172. PCONVERT_STATUS );
  173. #endif // _IFS_ENTRY_