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.

234 lines
6.4 KiB

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