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.

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