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.

475 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. precomp.h
  5. Abstract:
  6. This is the main header file.
  7. Author:
  8. Wesley Witt [wesw] 1-March-2000
  9. Revision History:
  10. --*/
  11. #ifndef _FSCUTL_
  12. #define _FSCUTL_
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <stddef.h>
  17. #include <stdlib.h>
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include <tchar.h>
  21. #include <malloc.h>
  22. #include <time.h>
  23. #include <errno.h>
  24. #include <limits.h>
  25. #include <windows.h>
  26. #include <winioctl.h>
  27. #include <objbase.h>
  28. #include <locale.h>
  29. #include "msg.h"
  30. #ifdef _cplusplus
  31. extern "C" {
  32. #endif
  33. #define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
  34. #define QuadAlign(P) (((((ULONG)(P)) + 7) & 0xfffffff8))
  35. #define STRUCT_COUNT(n, type, name_length) \
  36. ((((n) * QuadAlign(sizeof(type)) + ((name_length) * sizeof(WCHAR))) + \
  37. sizeof(type) - 1) / \
  38. sizeof(type))
  39. #define UnsignedI64NumberCheck(v,p) ((*p) != L'\0' || ((v) == _UI64_MAX && errno == ERANGE))
  40. #define UnsignedNumberCheck(v,p) ((*p) != L'\0' || ((v) == ULONG_MAX && errno == ERANGE))
  41. #define SHIFT(c,v) ((c)--,(v)++)
  42. extern BOOL RunningOnWin2K;
  43. //
  44. // Exit codes. Note that we will treat asking for usage information as a success
  45. //
  46. #define EXIT_CODE_SUCCESS 0
  47. #define EXIT_CODE_FAILURE 1
  48. //
  49. // Function Prototypes
  50. //
  51. INT
  52. Help (
  53. IN INT argc,
  54. IN PWSTR argv[]
  55. );
  56. INT
  57. ListDrives (
  58. IN INT argc,
  59. IN PWSTR argv[]
  60. );
  61. INT
  62. DriveType (
  63. IN INT argc,
  64. IN PWSTR argv[]
  65. );
  66. INT
  67. VolumeInfo (
  68. IN INT argc,
  69. IN PWSTR argv[]
  70. );
  71. INT
  72. DiskFreeSpace (
  73. IN INT argc,
  74. IN PWSTR argv[]
  75. );
  76. INT
  77. DismountVolume(
  78. IN INT argc,
  79. IN PWSTR argv[]
  80. );
  81. INT
  82. MarkVolumeDirty(
  83. IN INT argc,
  84. IN PWSTR argv[]
  85. );
  86. INT
  87. GetFileSystemStatistics(
  88. IN INT argc,
  89. IN PWSTR argv[]
  90. );
  91. INT
  92. GetNtfsVolumeData(
  93. IN INT argc,
  94. IN PWSTR argv[]
  95. );
  96. INT
  97. IsVolumeDirty(
  98. IN INT argc,
  99. IN PWSTR argv[]
  100. );
  101. INT
  102. GetReparsePoint(
  103. IN INT argc,
  104. IN PWSTR argv[]
  105. );
  106. INT
  107. DeleteReparsePoint(
  108. IN INT argc,
  109. IN PWSTR argv[]
  110. );
  111. INT
  112. SetObjectId(
  113. IN INT argc,
  114. IN PWSTR argv[]
  115. );
  116. INT
  117. GetObjectId(
  118. IN INT argc,
  119. IN PWSTR argv[]
  120. );
  121. INT
  122. DeleteObjectId(
  123. IN INT argc,
  124. IN PWSTR argv[]
  125. );
  126. INT
  127. CreateOrGetObjectId(
  128. IN INT argc,
  129. IN PWSTR argv[]
  130. );
  131. INT
  132. CreateUsnJournal(
  133. IN INT argc,
  134. IN PWSTR argv[]
  135. );
  136. INT
  137. QueryUsnJournal(
  138. IN INT argc,
  139. IN PWSTR argv[]
  140. );
  141. INT
  142. DeleteUsnJournal(
  143. IN INT argc,
  144. IN PWSTR argv[]
  145. );
  146. INT
  147. EnumUsnData(
  148. IN INT argc,
  149. IN PWSTR argv[]
  150. );
  151. INT
  152. ReadFileUsnData(
  153. IN INT argc,
  154. IN PWSTR argv[]
  155. );
  156. INT
  157. CreateHardLinkFile(
  158. IN INT argc,
  159. IN PWSTR argv[]
  160. );
  161. INT
  162. FindFilesBySid(
  163. IN INT argc,
  164. IN PWSTR argv[]
  165. );
  166. INT
  167. SetSparse(
  168. IN INT argc,
  169. IN PWSTR argv[]
  170. );
  171. INT
  172. QuerySparse(
  173. IN INT argc,
  174. IN PWSTR argv[]
  175. );
  176. INT
  177. SetSparseRange(
  178. IN INT argc,
  179. IN PWSTR argv[]
  180. );
  181. INT
  182. QuerySparseRange(
  183. IN INT argc,
  184. IN PWSTR argv[]
  185. );
  186. INT
  187. SetZeroData(
  188. IN INT argc,
  189. IN PWSTR argv[]
  190. );
  191. INT
  192. QueryAllocatedRanges(
  193. IN INT argc,
  194. IN PWSTR argv[]
  195. );
  196. INT
  197. RegistryQueryValueKey(
  198. IN INT argc,
  199. IN PWSTR argv[]
  200. );
  201. INT
  202. RegistrySetValueKey(
  203. IN INT argc,
  204. IN PWSTR argv[]
  205. );
  206. INT
  207. GetDiskQuotaViolation(
  208. IN INT argc,
  209. IN PWSTR argv[]
  210. );
  211. INT
  212. DisableQuota(
  213. IN INT argc,
  214. IN PWSTR argv[]
  215. );
  216. INT
  217. TrackQuota(
  218. IN INT argc,
  219. IN PWSTR argv[]
  220. );
  221. INT
  222. EnforceQuota(
  223. IN INT argc,
  224. IN PWSTR argv[]
  225. );
  226. INT
  227. QuotaControl(
  228. IN PWSTR Drive,
  229. IN ULONG QuotaControBits
  230. );
  231. INT
  232. ChangeDiskQuota(
  233. IN INT argc,
  234. IN PWSTR argv[]
  235. );
  236. INT
  237. QueryDiskQuota(
  238. IN INT argc,
  239. IN PWSTR argv[]
  240. );
  241. INT
  242. SetValidDataLength(
  243. IN INT argc,
  244. IN PWSTR argv[]
  245. );
  246. INT
  247. CreateNewFile(
  248. IN INT argc,
  249. IN PWSTR argv[]
  250. );
  251. INT
  252. SetShortName(
  253. IN INT argc,
  254. IN PWSTR argv[]
  255. );
  256. VOID
  257. DisplayError(
  258. void
  259. );
  260. BOOL
  261. IsUserAdmin(
  262. VOID
  263. );
  264. BOOL
  265. IsVolumeLocalNTFS(
  266. WCHAR DriveLetter
  267. );
  268. BOOL
  269. IsVolumeNTFS(
  270. PWCHAR path
  271. );
  272. BOOL
  273. IsVolumeLocal(
  274. WCHAR DriveLetter
  275. );
  276. PWSTR
  277. GetFullPath(
  278. IN PWSTR FilenameIn
  279. );
  280. VOID
  281. DisplayMsg(
  282. LONG msgId,
  283. ...
  284. );
  285. VOID DisplayErrorMsg(
  286. IN LONG msgId,
  287. ...
  288. );
  289. BOOL
  290. EnablePrivilege(
  291. LPCWSTR SePrivilege
  292. );
  293. __int64 __cdecl My_wcstoi64(
  294. const wchar_t *nptr,
  295. wchar_t **endptr,
  296. int ibase
  297. );
  298. unsigned __int64 __cdecl My_wcstoui64 (
  299. const wchar_t *nptr,
  300. wchar_t **endptr,
  301. int ibase
  302. );
  303. unsigned long __cdecl My_wcstoul (
  304. const wchar_t *nptr,
  305. wchar_t **endptr,
  306. int ibase
  307. );
  308. PWSTR
  309. QuadToDecimalText(
  310. ULONGLONG Value
  311. );
  312. PWSTR
  313. QuadToHexText(
  314. ULONGLONG Value
  315. );
  316. PWSTR
  317. QuadToPaddedHexText(
  318. ULONGLONG Value
  319. );
  320. INT
  321. UsnHelp(
  322. IN INT argc,
  323. IN PWSTR argv[]
  324. );
  325. INT
  326. QuotaHelp(
  327. IN INT argc,
  328. IN PWSTR argv[]
  329. );
  330. INT
  331. DirtyHelp(
  332. IN INT argc,
  333. IN PWSTR argv[]
  334. );
  335. INT
  336. FsInfoHelp(
  337. IN INT argc,
  338. IN PWSTR argv[]
  339. );
  340. INT
  341. ReparseHelp(
  342. IN INT argc,
  343. IN PWSTR argv[]
  344. );
  345. INT
  346. BehaviorHelp(
  347. IN INT argc,
  348. IN PWSTR argv[]
  349. );
  350. INT
  351. FileHelp(
  352. IN INT argc,
  353. IN PWSTR argv[]
  354. );
  355. INT
  356. VolumeHelp(
  357. IN INT argc,
  358. IN PWSTR argv[]
  359. );
  360. INT
  361. ObjectIdHelp(
  362. IN INT argc,
  363. IN PWSTR argv[]
  364. );
  365. INT
  366. SparseHelp(
  367. IN INT argc,
  368. IN PWSTR argv[]
  369. );
  370. INT
  371. HardLinkHelp(
  372. IN INT argc,
  373. IN PWSTR argv[]
  374. );
  375. #ifdef _cplusplus
  376. }
  377. #endif
  378. #endif // _FSCUTL_