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.

744 lines
20 KiB

  1. //----------------------------------------------------------------------
  2. //
  3. // .h file for the DSKMAINT DLL
  4. //
  5. //----------------------------------------------------------------------
  6. //
  7. // Prototype for the engine call back function
  8. //
  9. typedef LRESULT (CALLBACK* DSKUTILCBPROC)(UINT,LPARAM,LPARAM,LPARAM,LPARAM,LPARAM,LPARAM);
  10. //
  11. // Drive parameter structures
  12. //
  13. typedef struct tagUNKNOWNFSSTRUCT {
  14. WORD Error; /* If available, error code */
  15. } UNKNOWNFSSTRUCT;
  16. typedef struct tagINVALIDFSSTRUCT {
  17. WORD Error; /* If available, error code */
  18. } INVALIDFSSTRUCT;
  19. typedef struct tagFATFSSTRUCT {
  20. BYTE MediaDesc; /* Media Descriptor byte */
  21. BYTE FATNum; /* Number of FATs */
  22. WORD FSSubType; /* allocation sub type */
  23. DWORD BytPerSec; /* Bytes per sector */
  24. DWORD SecPerClus; /* Sectors per cluster */
  25. DWORD TotSec; /* Total number of sectors on drive */
  26. DWORD TotSizeK; /* (TotSec * BytPerSec) / 1024 */
  27. DWORD TotSizeM; /* (TotSec * BytPerSec) / 1024^2 */
  28. DWORD FATSector; /* Sector number of first sector of first FAT and */
  29. /* number of RESERVED/BOOT sectors */
  30. DWORD FATSize; /* Size of one FAT in sectors */
  31. DWORD DirEntSizeMin; /* Minimum size in bytes of a directory entry */
  32. DWORD DirEntSizeMax; /* Maximum size in bytes of a directory entry */
  33. DWORD RootDirSecCnt; /* number of sectors in root directory */
  34. DWORD RootDirSector; /* Sector number of first root directory sector */
  35. DWORD RootDirEntCntMin; /* Min number of entries in root directory */
  36. DWORD RootDirEntCntMax; /* Max number of entries in root directory */
  37. DWORD TotDataClus; /* total number of data clusters on drive */
  38. DWORD DataSizeK; /* (TotDataClus*SecPerClus*BytePerSec) / 1024 */
  39. DWORD DataSizeM; /* (TotDataClus*SecPerClus*BytePerSec)/1024^2 */
  40. DWORD MaxClusNum; /* Maximum valid cluster number for drive */
  41. DWORD FSStrucSzBytes; /* Buffer size req for ReadFileSysStruc API */
  42. DWORD EOFClusVal; /* Clusters which contain values >= this */
  43. /* value are EndOfFile clusters */
  44. DWORD BadClusVal; /* "Lost" clusters which contain values == this */
  45. /* value are BAD clusters */
  46. DWORD FrstDataSector; /* Sector number of first sector of first data cluster */
  47. DWORD FrstDataCluster; /* Cluster # who's first sector is FrstDataSector */
  48. } FATFSSTRUCT;
  49. //
  50. // FSSubType
  51. //
  52. #define FSS_FAT12 1
  53. #define FSS_FAT16 2
  54. typedef struct tagDRVPARMSTRUCT {
  55. UINT FileSysType;
  56. UINT Drive;
  57. union {
  58. UNKNOWNFSSTRUCT unkFS;
  59. INVALIDFSSTRUCT invFS;
  60. FATFSSTRUCT FatFS;
  61. } drvprm;
  62. BYTE resrvd[80];
  63. } DRVPARMSTRUCT;
  64. typedef DRVPARMSTRUCT* PDRVPARMSTRUCT;
  65. typedef DRVPARMSTRUCT NEAR* NPDRVPARMSTRUCT;
  66. typedef DRVPARMSTRUCT FAR* LPDRVPARMSTRUCT;
  67. //
  68. // File system types
  69. //
  70. #define FS_INVALID 6000
  71. #define FS_UNKNOWN 1
  72. #define FS_ERROR 2
  73. #define FS_FAT 3
  74. #define FS_DDFAT 4
  75. #define FS_LFNFAT 5
  76. #define FS_DDLFNFAT 6
  77. #define FS_SIZEERR 8000
  78. //
  79. // Modifyer flags for GetEngineDriveInfo returns
  80. //
  81. #define FS_CANRDWRTSEC 0x0001
  82. #define FS_CANRDWRTFSS 0x0002
  83. #define FS_CANFORMAT 0x0004
  84. #define FS_ISFIXABLE 0x0008
  85. #define FS_ISOPTIMIZABLE 0x0010
  86. BOOL WINAPI DMaint_GetEngineDriveInfo(LPDWORD lpEngInfArray);
  87. UINT WINAPI DMaint_GetFileSysParameters(UINT Drive, LPDRVPARMSTRUCT lpParmBuf, UINT nSize);
  88. DWORD WINAPI DMaint_ReadSector(LPDRVPARMSTRUCT lpParmBuf, LPVOID lpSectorBuf, DWORD sSector, DWORD nSectors);
  89. DWORD WINAPI DMaint_WriteSector(LPDRVPARMSTRUCT lpParmBuf, LPVOID lpSectorBuf, DWORD sSector, DWORD nSectors);
  90. DWORD WINAPI DMaint_ReadFileSysStruc(LPDRVPARMSTRUCT lpParmBuf, LPVOID lpFSBuf, DWORD nSize);
  91. DWORD WINAPI DMaint_WriteFileSysStruc(LPDRVPARMSTRUCT lpParmBuf, LPVOID lpFSBuf, DWORD FSFlags);
  92. //
  93. // Structures and defines for DMaint_GetFormatOptions DMaint_FormatDrive
  94. // DMaint_UnFormatDrive
  95. //
  96. #define MAXNUMFMTS 16
  97. #define MAXFMTNAMELEN 60
  98. #define MAXFNAMELEN 256 // INCLUDES trailing NUL
  99. #define DRVMAXPATHLEN (260 + 3) // INCLUDES trailing NUL, + 3 for "X:\"
  100. typedef struct tagFMTINFOSTRUCT {
  101. BYTE TotalPcntCmplt;
  102. BYTE CurrOpRegion;
  103. UINT Drive;
  104. WORD FSFmtID;
  105. WORD DefFSFmtID;
  106. WORD PhysFmtID;
  107. WORD DefPhysFmtID;
  108. DWORD Options;
  109. WORD FSFmtCnt;
  110. WORD PhysFmtCnt;
  111. BYTE VolLabel[MAXFNAMELEN];
  112. LPARAM lParam1;
  113. LPARAM lParam2;
  114. BYTE reserved[40];
  115. WORD FSFmtIDList[MAXNUMFMTS];
  116. BYTE FSFmtNmList[MAXNUMFMTS][MAXFMTNAMELEN];
  117. WORD PhysFmtIDList[MAXNUMFMTS];
  118. BYTE PhysFmtNmList[MAXNUMFMTS][MAXFMTNAMELEN];
  119. } FMTINFOSTRUCT;
  120. typedef FMTINFOSTRUCT* PFMTINFOSTRUCT;
  121. typedef FMTINFOSTRUCT NEAR* NPFMTINFOSTRUCT;
  122. typedef FMTINFOSTRUCT FAR* LPFMTINFOSTRUCT;
  123. typedef struct tagFATFMTREPORT {
  124. DWORD TotDiskSzByte;
  125. DWORD TotDiskSzK;
  126. DWORD TotDiskSzM;
  127. DWORD BadSzByte;
  128. DWORD BadSzK;
  129. DWORD BadSzM;
  130. DWORD SysSzByte;
  131. DWORD UsedSzByte;
  132. DWORD UsedSzK;
  133. DWORD UsedSzM;
  134. DWORD AvailSzByte;
  135. DWORD AvailSzK;
  136. DWORD AvailSzM;
  137. DWORD BytesPerClus;
  138. DWORD TotDataClus;
  139. DWORD SerialNumber;
  140. } FATFMTREPORT;
  141. typedef FATFMTREPORT* PFATFMTREPORT;
  142. typedef FATFMTREPORT NEAR* NPFATFMTREPORT;
  143. typedef FATFMTREPORT FAR* LPFATFMTREPORT;
  144. //
  145. // Error values and bits
  146. //
  147. #define NOERROR 0 // This MUST be 0!
  148. #define OPCANCEL 1
  149. #define ERR_NOTSUPPORTED 2
  150. #define ERR_NOTFULLSUPP 3
  151. #define NOFORMAT 0x0001
  152. #define NOUNFORMAT 0x0002
  153. #define MKSYSONLY 0x0004
  154. #define FSONLY 0x0008
  155. #define ERR_ISSYSDRIVE 4
  156. #define ISWINDRV 0x0001
  157. #define ISPAGINGDRV 0x0002
  158. #define ERR_NONFATAL 5
  159. #define ERR_FATAL 6
  160. // RETRY 0x0001
  161. // RECOV 0x0002
  162. #define ERRTOS 0x0004
  163. #define ERRNOOS 0x0008
  164. #define ERRVOLLABEL 0x0010
  165. #define ERRFBOOT 0x0020
  166. #define ERRROOTD 0x0040
  167. #define ERROSAREA 0x0080
  168. #define ERRDATA 0x0100
  169. #define ERRMBR 0x0200
  170. #define ERRFAT 0x0400
  171. #define ERRCVFHD 0x0800
  172. #define ERR_OSNOTFOUND 7
  173. #define ERR_OSERR 8
  174. #define ERR_INSUFMEM 9
  175. #define ERR_LOCKVIOLATION 10
  176. #define ERR_LOCKREQUIRED 11
  177. #define ERR_FSACTIVE 12
  178. #define ERR_BADOPTIONS 13
  179. #define ERR_BADSTART 14
  180. #define ERR_BADEND 15
  181. #define ERR_BADXADDR 16
  182. #define ERR_NOTWRITABLE 17
  183. #define ERR_SZERR 18
  184. #define ERR_FSERR 19
  185. #define FATCLUSINVALID 0x0001
  186. #define FATSECTORSBADS 0x0002
  187. #define ERR_BADFORMAT 20
  188. #define FATCLUSOVERFLOW 0x0004
  189. #define FATSECTORSBADH 0x0008
  190. #define ERR_FSCORRECTED 21
  191. #define ERR_FSUNCORRECTED 22
  192. #define ERR_EXCLVIOLATION 23
  193. // FATERRMXPLEN 29
  194. //
  195. // sub-operation codes
  196. //
  197. #define FOP_INIT 1
  198. #define FOP_LOWFMT 2
  199. #define FOP_VERIFY 3
  200. #define FOP_FSFMT 4
  201. #define FOP_TSYS 5
  202. #define FOP_GETLABEL 6
  203. #define FOP_SEARCH 7
  204. #define FOP_RESTORE 8
  205. #define FOP_SHTDOWN 9
  206. #define FOP_FAT 10
  207. #define FOP_DIR 11
  208. #define FOP_FILDIR 12
  209. #define FOP_LOSTCLUS 13
  210. #define FSOP_INIT 14
  211. #define FSOP_SETUNMOV 15
  212. #define FSOP_SYSTEM 16
  213. #define FSOP_DATA 17
  214. #define FOP_DDHEAD 18
  215. #define FOP_DDSTRUC 19
  216. #define FOP_DDFAT 20
  217. #define FOP_DDSIG 21
  218. #define FOP_DDBOOT 22
  219. //
  220. // WriteFileSysStruc options
  221. //
  222. #define FATNOPACKINPLACE 0x00010000L
  223. #define FATSTOPONERR 0x00020000L
  224. //
  225. // Format options
  226. //
  227. #define FD_LOWLEV 0x00000001L
  228. #define FD_LOWLEVONLY 0x00000002L
  229. #define FD_VERIFY 0x00000004L
  230. #define FD_FSONLY 0x00000008L
  231. #define FD_UNFORMAT 0x00000010L
  232. #define FD_NOUNFORMAT 0x00000020L
  233. #define FD_PHYSONLY 0x00000040L
  234. #define FD_BOOT 0x00000080L
  235. #define FD_BOOTONLY 0x00000100L
  236. #define FD_VOLLABEL 0x00000200L
  237. #define FD_NOVOLLABEL 0x00000400L
  238. #define FD_ISVOLLABEL 0x00000800L
  239. #define FD_GETCONFIRM 0x00001000L
  240. #define FD_ISREM 0x00002000L
  241. #define FDFAT_SETCLUS 0x80000000L
  242. #define FDFAT_SETROOTSZ 0x40000000L
  243. //
  244. // Defines for call back messages
  245. //
  246. #define DU_INITENGINE 0x0401
  247. #define DU_ENGINESTART 0x0402
  248. #define DU_ERRORDETECTED 0x0403
  249. #define DU_ERRORCORRECTED 0x0404
  250. #define DU_OPUPDATE 0x0405
  251. #define DU_READ 0x0406
  252. #define DU_WRITE 0x0407
  253. #define DU_OPCOMPLETE 0x0408
  254. #define DU_YIELD 0x0409
  255. #define DU_ENGINERESTART 0x040A
  256. #define DU_EXTENSION_FIRST 0x2000
  257. #define DU_EXTENSION_LAST 0x2FFF
  258. // Following errors are also Bits, rest are just values
  259. // ERRFAT 0x0400
  260. // ERRTOS 0x0004
  261. // ERRNOOS 0x0008
  262. // ERRVOLLABEL 0x0010
  263. // ERRFBOOT 0x0020
  264. // ERRROOTD 0x0040
  265. // ERROSAREA 0x0080
  266. // ERRDATA 0x0100
  267. // ERRMBR 0x0200
  268. // ERRCVFHD 0x0800
  269. #define ERRNOUFOR 3
  270. // ERRTOS 4
  271. #define ERRBADUFOR 5
  272. #define ERRDSKWRT 6
  273. #define ERRINVFMT 7
  274. // ERRNOOS 8
  275. #define ERRNOQUICK 9
  276. #define READERROR 10
  277. #define WRITEERROR 11
  278. #define FATERRMISMAT 12
  279. #define FATERRLSTCLUS 13
  280. #define FATERRXLNK 14
  281. #define ERRXLNKDIR 0x0001
  282. #define ERRCANTDEL 0x8000
  283. #define FATERRFILE 15
  284. #define ERRINVLFN 0x0001
  285. #define ERRINVNM 0x0002
  286. #define ERRSIZE 0x0004
  287. #define ERRDTTM1 0x0008
  288. #define ERRDTTM2 0x0010
  289. #define ERRDTTM3 0x0020
  290. #define ERRLFNSTR 0x0040
  291. #define ERRDEVNM 0x0080
  292. #define ERRLFNLEN 0x0100
  293. // ERRCANTDEL 0x8000
  294. // ERRVOLLABEL 16
  295. #define FATERRDIR 17
  296. #define DBUFAPP 0x0001
  297. #define ERRBAD 0x0002
  298. #define ERRDOTS 0x0004
  299. #define ERRPNOTD 0x0008
  300. #define ERRLFNSRT 0x0010
  301. #define ERRZRLEN 0x0020
  302. #define ERRLFNLST 0x0040
  303. #define ERRLOSTFILE 0x0080
  304. #define ERRDUPNM 0x0100
  305. // ERRCANTDEL 0x8000
  306. #define FATERRBOOT 18
  307. #define ERRSIG1 0x0004
  308. #define ERRSIG2 0x0008
  309. #define ERROEMVER 0x0010
  310. #define ERRBPB 0x0020
  311. #define ERRINVPRT 0x0040
  312. #define ERRINCPRT 0x0080
  313. // ERRMBR 0x0100
  314. #define FULLCORR 19
  315. #define NOCORR 20
  316. #define PCORROK 21
  317. #define PCORRBAD 22
  318. #define APPFIX 0x0001
  319. #define CANTMARK APPFIX
  320. #define DISKERR 0x0002
  321. #define NOMEM 0x0004
  322. #define FILCRT 0x0008
  323. #define FILCOLL 0x0010
  324. #define CLUSALLO 0x0020
  325. #define UNEXP 0x0040
  326. #define DIRCRT 0x0080
  327. #define CANTFIX 0x0100
  328. #define FATERRRESVAL 23
  329. #define FATERRCIRCC 24
  330. // ERRCANTDEL 0x8000
  331. #define FATERRINVCLUS 25
  332. #define ERRINVC 0x0001
  333. #define ERRINVFC 0x0002
  334. // ERRCANTDEL 0x8000
  335. #define FATERRCDLIMIT 26
  336. #define ERRDLNML 0x0001
  337. #define ERRDSNML 0x0002
  338. // ERRCANTDEL 0x8000
  339. #define FATERRVOLLAB 27
  340. #define ISFRST 0x0001
  341. #define MEMORYERROR 28
  342. // RETRY 0x0001
  343. // RECOV 0x0002
  344. #define GLBMEM 0x0004
  345. #define LOCMEM 0x0008
  346. #define FATERRMXPLEN 29
  347. // ERRINVLFN 0x0001
  348. // ERRCANTDEL 0x8000
  349. #define ERRISBAD 30
  350. #define ERRISNTBAD 31
  351. // ERRFBOOT 32
  352. // RETRY 0x0001
  353. // RECOV 0x0002
  354. // GLBMEM 0x0004
  355. // LOCMEM 0x0008
  356. // ERRFBOOT 0x0020
  357. // ERRROOTD 0x0040
  358. // ERRDATA 0x0100
  359. // ERRFAT 0x0400
  360. #define RDFAIL 0x4000
  361. #define WRTFAIL 0x8000
  362. #define ERRNOFILE 33
  363. #define ERRLOCKV 34
  364. // RETRY 0x0001
  365. #define DDERRSIZE1 35
  366. #define DDERRFRAG 36
  367. #define DDERRALIGN 37
  368. #define DDERRSIG 38
  369. // RETRY 0x0001
  370. // RECOV 0x0002
  371. // ERRSIG1 0x0004
  372. // ERRSIG2 0x0008
  373. #define DDERRBOOT 39
  374. #define DDERRSIZE2 40
  375. #define DDERRCVFNM 41
  376. // RETRY 0x0001
  377. // RECOV 0x0002
  378. #define CHNGTONEW 0x0004
  379. #define DDERRMDBPB 42
  380. #define DDERRMDFAT 43
  381. // RETRY 0x0001
  382. // RECOV 0x0002
  383. #define GTMXCLUS 0x0004
  384. #define INVCHEAP 0x0008
  385. #define DDERRLSTSQZ 44
  386. #define DDERRXLSQZ 45
  387. // RETRY 0x0001
  388. // RECOV 0x0002
  389. #define DUPFILE 0x0004
  390. #define LOSTSQZ 0x0008
  391. // ERRCANTDEL 0x8000
  392. #define DDERRUNSUP 46
  393. #define ISBETA 0x0001
  394. #define ISSUPER 0x0002
  395. // ERRROOTD 64
  396. // ERROSAREA 128
  397. // ERRDATA 256
  398. // ERRMBR 512
  399. // 1024
  400. // ERRCVFHD 2048
  401. #define RETRY 0x0001
  402. #define RECOV 0x0002
  403. #define BADCHRS 0x0004
  404. #define BADSEC 0x0008
  405. #define DISKFULL 0x0010
  406. #define OSFILESPACE 0x0020
  407. #define WRTPROT 0x0040
  408. #define NOTRDY 0x0080
  409. // The following must not conflict with RETRY and RECOV only
  410. #define MBR 0x0010
  411. #define FAT1 0x0020
  412. #define FAT2 0x0040
  413. #define FATN 0x0080
  414. #define FATMIX 0x0100
  415. #define ROOTD 0x0200
  416. #define DIR 0x0400
  417. #define DATA 0x0800
  418. #define ERETCAN2 0
  419. #define ERETAFIX 0
  420. #define ERETIGN2 0
  421. #define ERETIGN 1
  422. #define ERETRETRY 2
  423. #define ERETCAN 3
  424. #define ERETWFAT 4
  425. #define ERETAPPFIX 5
  426. #define ERETFREE 6
  427. #define ERETMKFILS 7
  428. #define ERETDELALL 8
  429. #define ERETMKCPY 9
  430. #define ERETSVONED 10
  431. #define ERETTNCALL 11
  432. #define ERETSVONET 12
  433. #define ERETWRTFIX 13
  434. #define ERETDELDIR 14
  435. #define ERETMVDIR 15
  436. #define ERETMVFIL ERETMVDIR
  437. #define ERETRDDIR 16
  438. #define ERETMRKBAD 17
  439. // Bit defines specific to DU_ENGINERESTART for DMaint_FixDrive
  440. #define OTHERWRT 0x0001
  441. #define LOSTDIR 0x0002
  442. #define XLNKSQZ 0x0004
  443. // LOSTSQZ 0x0008
  444. DWORD WINAPI DMaint_GetFormatOptions(UINT Drive, LPFMTINFOSTRUCT lpFmtInfoBuf, UINT nSize);
  445. DWORD WINAPI DMaint_FormatDrive(LPFMTINFOSTRUCT lpFmtInfoBuf, DWORD Options, DSKUTILCBPROC lpfnCallBack, LPARAM lRefData);
  446. DWORD WINAPI DMaint_UnFormatDrive(LPFMTINFOSTRUCT lpFmtInfoBuf, DWORD Options, DSKUTILCBPROC lpfnCallBack, LPARAM lRefData);
  447. //
  448. // Structures and defines for DMaint_GetFixOptions and DMaint_FixDrive
  449. //
  450. typedef struct tagFIXFATDISP {
  451. BYTE TotalPcntCmplt;
  452. BYTE CurrOpRegion;
  453. WORD Flags;
  454. WORD BitArrSz;
  455. DWORD SysAreaCnt;
  456. LPDRVPARMSTRUCT lpParmBuf;
  457. DWORD Options;
  458. LPDWORD lpVisitBitArray;
  459. LPDWORD lpDirBitArray;
  460. LPDWORD lpAllocedBitArray;
  461. LPDWORD lpBadBitArray;
  462. LPDWORD lpLostBitArray;
  463. LPDWORD lpUnMovBitArray;
  464. DWORD SerialNumber;
  465. BYTE VolLabel[MAXFNAMELEN];
  466. WORD VolLabelDate;
  467. WORD VolLabelTime;
  468. BYTE reserved[40];
  469. } FIXFATDISP;
  470. typedef FIXFATDISP* PFIXFATDISP;
  471. typedef FIXFATDISP NEAR* NPFIXFATDISP;
  472. typedef FIXFATDISP FAR* LPFIXFATDISP;
  473. typedef struct tagFATFIXREPORT {
  474. DWORD TotDiskSzByte;
  475. DWORD TotDiskSzK;
  476. DWORD TotDiskSzM;
  477. DWORD BadDataClusCnt;
  478. DWORD BadSzDataByte;
  479. DWORD BadSzDataK;
  480. DWORD BadSzDataM;
  481. DWORD TotBadSecCntSys;
  482. DWORD BadSecCntResvd;
  483. DWORD BadSecCntFAT;
  484. DWORD BadSecCntRootDir;
  485. DWORD HidFileCnt;
  486. DWORD HidSzByte;
  487. DWORD HidSzK;
  488. DWORD HidSzM;
  489. DWORD DirFileCnt;
  490. DWORD DirSzByte;
  491. DWORD DirSzK;
  492. DWORD DirSzM;
  493. DWORD UserFileCnt;
  494. DWORD UserSzByte;
  495. DWORD UserSzK;
  496. DWORD UserSzM;
  497. DWORD AvailSzByte;
  498. DWORD AvailSzK;
  499. DWORD AvailSzM;
  500. DWORD BytesPerClus;
  501. DWORD TotDataClus;
  502. DWORD AvailDataClus;
  503. DWORD BadClusRelocFailCnt;
  504. DWORD BadClusUnMovFailCnt;
  505. DWORD BadDataClusNew;
  506. DWORD BadDataClusConf;
  507. DWORD BadDataClusRecl;
  508. WORD Flags;
  509. } FATFIXREPORT;
  510. typedef FATFIXREPORT* PFATFIXREPORT;
  511. typedef FATFIXREPORT NEAR* NPFATFIXREPORT;
  512. typedef FATFIXREPORT FAR* LPFATFIXREPORT;
  513. // Defines for Flags
  514. #define REPLACEDISK 0x0001
  515. #define REFORMAT 0x0002
  516. #define HOSTFILE 0x0004
  517. #define SWAPFILE 0x0008
  518. #define OSFILE 0x0010
  519. #define SPCLFILE 0x0020
  520. typedef struct tagFATLOSTCLUSERR {
  521. DWORD LostClusCnt;
  522. DWORD LostClusChainCnt;
  523. DWORD RootDirFreeEntCnt;
  524. WORD FileFirstDigits;
  525. WORD FileLastDigits;
  526. LPSTR LostClusSaveDir;
  527. WORD DirRecvCnt;
  528. WORD LstAsFilesInDirs;
  529. } FATLOSTCLUSERR;
  530. typedef FATLOSTCLUSERR* PFATLOSTCLUSERR;
  531. typedef FATLOSTCLUSERR NEAR* NPFATLOSTCLUSERR;
  532. typedef FATLOSTCLUSERR FAR* LPFATLOSTCLUSERR;
  533. typedef struct tagXLNKFILE {
  534. DWORD FileFirstCluster;
  535. DWORD LastSecNumNotXLnked;
  536. LPSTR FileName;
  537. DWORD reserved;
  538. BYTE FileAttributes;
  539. BYTE Flags;
  540. } XLNKFILE;
  541. typedef XLNKFILE* PXLNKFILE;
  542. typedef XLNKFILE NEAR* NPXLNKFILE;
  543. typedef XLNKFILE FAR* LPXLNKFILE;
  544. //
  545. // Flags bits
  546. //
  547. #define XFF_ISSWAP 0x01
  548. #define XFF_ISCVF 0x02
  549. #define XFF_ISSYSDIR 0x04
  550. #define XFF_ISSYSFILE 0x08
  551. typedef struct tagFATXLNKERR {
  552. DWORD XLnkCluster;
  553. DWORD XLnkFrstSectorNum;
  554. DWORD XLnkClusCnt;
  555. WORD XLnkFileCnt;
  556. XLNKFILE XLnkList[];
  557. } FATXLNKERR;
  558. typedef FATXLNKERR* PFATXLNKERR;
  559. typedef FATXLNKERR NEAR* NPFATXLNKERR;
  560. typedef FATXLNKERR FAR* LPFATXLNKERR;
  561. //
  562. // Following is provided because sizeof(FATXLNKERR) is illegal. This
  563. // define is the size in bytes of FATXLNKERR up to XLnkList (the size
  564. // without the dynamic part).
  565. //
  566. #define BASEFATXLNKERRSZ (4+4+4+2)
  567. typedef struct tagDDXLNKERR {
  568. LPDWORD DDXLnkClusterList;
  569. DWORD DDXLnkClusCnt;
  570. WORD DDXLnkFileCnt;
  571. LPXLNKFILE DDXLnkList;
  572. } DDXLNKERR;
  573. typedef DDXLNKERR* PDDXLNKERR;
  574. typedef DDXLNKERR NEAR* NPDDXLNKERR;
  575. typedef DDXLNKERR FAR* LPDDXLNKERR;
  576. typedef struct tagFATFILEERR {
  577. LPSTR lpDirName;
  578. LPSTR lpLFNFileName;
  579. LPSTR lpShortFileName;
  580. DWORD ClusterFileSize;
  581. DWORD FileFirstCluster;
  582. DWORD DirFirstCluster;
  583. DWORD DirSectorIndex;
  584. DWORD DirEntryIndex;
  585. DWORD DirEntCnt;
  586. LPVOID lpFileDirEnts;
  587. LPARAM lParam1;
  588. LPARAM lParam2;
  589. LPARAM lParam3;
  590. DWORD ExtAtt;
  591. BYTE FileAttribute;
  592. } FATFILEERR;
  593. typedef FATFILEERR* PFATFILEERR;
  594. typedef FATFILEERR NEAR* NPFATFILEERR;
  595. typedef FATFILEERR FAR* LPFATFILEERR;
  596. typedef struct tagFATDIRERR {
  597. LPSTR lpDirName;
  598. DWORD DirFirstCluster;
  599. DWORD DirFirstSectorNum;
  600. DWORD DirReadBufSizeBytes;
  601. LPVOID lpDirReadBuf;
  602. LPARAM lParam1;
  603. LPARAM lParam2;
  604. LPARAM lParam3;
  605. } FATDIRERR;
  606. typedef FATDIRERR* PFATDIRERR;
  607. typedef FATDIRERR NEAR* NPFATDIRERR;
  608. typedef FATDIRERR FAR* LPFATDIRERR;
  609. typedef struct tagFATBOOTERR {
  610. DWORD BootSectorNum;
  611. DWORD BootBufSizeSectors;
  612. LPVOID lpBootBuf;
  613. LPARAM lParam1;
  614. LPARAM lParam2;
  615. LPARAM lParam3;
  616. } FATBOOTERR;
  617. typedef FATBOOTERR* PFATBOOTERR;
  618. typedef FATBOOTERR NEAR* NPFATBOOTERR;
  619. typedef FATBOOTERR FAR* LPFATBOOTERR;
  620. //
  621. // Max number of conflicting files for LFNSORT error
  622. //
  623. #define MAXLFNSORT 8
  624. //
  625. // Max number of LFN directory entry extensions
  626. //
  627. #define MAXLFNEXT 10
  628. typedef struct tagLFNSORT {
  629. DWORD FileCnt;
  630. DWORD Flags;
  631. LPSTR lpShortNames[MAXLFNSORT];
  632. LPSTR lpLFNResolve[MAXLFNEXT][MAXLFNSORT];
  633. LPSTR lpLFNExtName0[MAXLFNSORT];
  634. LPSTR lpLFNExtName1[MAXLFNSORT];
  635. LPSTR lpLFNExtName2[MAXLFNSORT];
  636. LPSTR lpLFNExtName3[MAXLFNSORT];
  637. LPSTR lpLFNExtName4[MAXLFNSORT];
  638. LPSTR lpLFNExtName5[MAXLFNSORT];
  639. LPSTR lpLFNExtName6[MAXLFNSORT];
  640. LPSTR lpLFNExtName7[MAXLFNSORT];
  641. LPSTR lpLFNExtName8[MAXLFNSORT];
  642. LPSTR lpLFNExtName9[MAXLFNSORT];
  643. } LFNSORT;
  644. typedef LFNSORT* PLFNSORT;
  645. typedef LFNSORT NEAR* NPLFNSORT;
  646. typedef LFNSORT FAR* LPLFNSORT;
  647. //
  648. // DMaint_GetFixOptions flags
  649. //
  650. #define FSINVALID 0x00000001L
  651. #define FSDISALLOWED 0x00000002L
  652. #define FSISACTIVE 0x00000004L
  653. #define FSALWAYSACTIVE 0x00000008L
  654. #define FSSFTEXCLUSIVE 0x00000010L
  655. #define FSHRDEXCLUSIVE 0x00000020L
  656. #define FSEXCLUSIVEREQ 0x00000040L
  657. //
  658. // DMaint_FixDrive options
  659. //
  660. #define FDO_AUTOFIX 0x00000001L
  661. #define FDO_NOFIX 0x00000002L
  662. #define FDO_LOWPRIORITY 0x00000004L
  663. #define FDO_HRDEXCLUSIVE 0x00000008L
  664. #define FDO_SFTEXCLUSIVE 0x00000010L
  665. #define FDO_EXCLBLOCK 0x00000020L
  666. #define FDO_ALREADYLOCKED 0x00000040L
  667. #define FDOS_WRTTST 0x00000080L
  668. #define FDOS_NOSRFANAL 0x00000100L
  669. #define FDOFAT_LSTMKFILE 0x00010000L
  670. #define FDOFAT_NOXLNKLIST 0x00020000L
  671. #define FDOFAT_XLNKDEL 0x00040000L
  672. #define FDOFAT_XLNKCPY 0x00080000L
  673. #define FDOFAT_NOCHKDT 0x00100000L
  674. #define FDOFAT_NOCHKNM 0x00200000L
  675. #define FDOFAT_CHKNMMAP 0x00400000L
  676. #define FDOFAT_INVDIRIGN 0x00800000L
  677. #define FDOFAT_INVDIRDEL 0x01000000L
  678. #define FDOFAT_CHKDUPNM 0x02000000L
  679. #define FDOSFAT_NMHISSYS 0x04000000L
  680. #define FDOSFAT_NOSYSTST 0x08000000L
  681. #define FDOSFAT_NODATATST 0x10000000L
  682. #define FDOFAT_MKOLDFS 0x20000000L
  683. DWORD WINAPI DMaint_GetFixOptions(LPDRVPARMSTRUCT lpParmBuf);
  684. DWORD WINAPI DMaint_FixDrive(LPDRVPARMSTRUCT lpParmBuf, DWORD Options, DSKUTILCBPROC lpfnCallBack, LPARAM lRefData);
  685. //
  686. // Structures and defines for DMaint_GetOptimizeOptions and DMaint_OptimizeDrive
  687. //
  688. DWORD WINAPI DMaint_GetOptimizeOptions(LPDRVPARMSTRUCT lpParmBuf);
  689. DWORD WINAPI DMaint_OptimizeDrive(LPDRVPARMSTRUCT lpParmBuf);