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.

322 lines
11 KiB

  1. /*
  2. * PLEASE NOTE: WINDISK is the file "WINDISK.CPL", this means
  3. * you cannot implicit link to these APIs by simply
  4. * linking with WINDISK.LIB. This is because KERNEL
  5. * will only implicit link to module file names with
  6. * the .DLL or .EXE extensions.
  7. *
  8. * To use these APIs you need to LoadLibrary("WINDISK.CPL")
  9. * and then use GetProcAddress.
  10. *
  11. * WDFMTDRVPROC lpfnFmtDrv;
  12. * HINSTANCE wdInst;
  13. *
  14. * wdInst = LoadLibrary("WINDISK.CPL");
  15. * if (wdInst) {
  16. * lpfnFmtDrv = (WDFMTDRVPROC)GetProcAddress(wdInst,"WinDisk_FormatDrive");
  17. * if (HIWORD(lpfnFmtDrv)) {
  18. * switch ((*lpfnFmtDrv)(hwnd, drive, WD_FMTID_DEFAULT, WD_FMT_OPT_FULL)) {
  19. *
  20. * case WD_FMT_ERROR:
  21. *
  22. * ...
  23. *
  24. * }
  25. * FreeLibrary(wdInst);
  26. * } else {
  27. * FreeLibrary(wdInst);
  28. * goto NoLib;
  29. * }
  30. * } else {
  31. * NoLib:
  32. *
  33. * WINDISK.LIB is provided for completeness only (and also
  34. * allows you to figure out the ordinal, note that
  35. * GetProcAddress "by name" is recommended however).
  36. */
  37. /*
  38. * The WinDisk_FormatDrive API provides access to the WINDISK
  39. * format dialog. This allows apps which want to format disks
  40. * to bring up the same dialog that WINDISK does to do it.
  41. *
  42. * This dialog is not sub-classable. You cannot put custom
  43. * controls in it. If you want this ability, you will have
  44. * to write your own front end for the DMaint_FormatDrive
  45. * engine.
  46. *
  47. * NOTE that the user can format as many diskettes in the specified
  48. * drive, or as many times, as he/she wishes to. There is no way to
  49. * force any specififc number of disks to format. If you want this
  50. * ability, you will have to write your own front end for the
  51. * DMaint_FormatDrive engine.
  52. *
  53. * NOTE also that the format will not start till the user pushes the
  54. * start button in the dialog. There is no way to do auto start. If
  55. * you want this ability, you will have to write your own front end
  56. * for the DMaint_FormatDrive engine.
  57. *
  58. * PARAMETERS
  59. *
  60. * hwnd = The window handle of the window which will own the dialog
  61. * drive = The 0 based (A: == 0) drive number of the drive to format
  62. * fmtID = The ID of the physical format to format the disk with
  63. * NOTE: The special value WD_FMTID_DEFAULT means "use the
  64. * default format specified by the DMaint_FormatDrive
  65. * engine". If you want to FORCE a particular format
  66. * ID "up front" you will have to call
  67. * DMaint_GetFormatOptions yourself before calling
  68. * this to obtain the valid list of phys format IDs
  69. * (contents of the PhysFmtIDList array in the
  70. * FMTINFOSTRUCT).
  71. * options = There is currently only one option bit defined
  72. *
  73. * WD_FMT_OPT_FULL
  74. *
  75. * The normal defualt in the WINDISK format dialog is
  76. * "Quick Format", setting this option bit indicates that
  77. * the caller wants to start with FULL format selected
  78. * (this is useful for folks detecting "unformatted" disks
  79. * and wanting to bring up the format dialog).
  80. *
  81. * All other bits are reserved for future expansion and
  82. * must be 0.
  83. *
  84. * Please note that this is a bit field and not a value
  85. * and treat it accordingly.
  86. *
  87. * RETURN
  88. * The return is either one of the WD_FMT_* values, or if the
  89. * returned DWORD value is not == to one of these values, then
  90. * the return is the physical format ID of the last succesful
  91. * format. The LOWORD of this value can be passed on subsequent
  92. * calls as the fmtID parameter to "format the same type you did
  93. * last time".
  94. *
  95. */
  96. DWORD WINAPI WinDisk_FormatDrive(HWND hwnd, WORD drive, WORD fmtID,
  97. WORD options);
  98. typedef DWORD (CALLBACK* WDFMTDRVPROC)(HWND,WORD,WORD,WORD);
  99. //
  100. // Special value of fmtID which means "use the default format"
  101. //
  102. #define WD_FMTID_DEFAULT 0xFFFF
  103. //
  104. // Option bits for options parameter
  105. //
  106. #define WD_FMT_OPT_FULL 0x0001
  107. //
  108. // Special return values. PLEASE NOTE that these are DWORD values.
  109. //
  110. #define WD_FMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  111. #define WD_FMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  112. #define WD_FMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  113. /*
  114. * The WinDisk_CheckDrive API provides access to the WINDISK
  115. * Check Disk dialog. This allows apps which want to check disks
  116. * to bring up the same dialog that WINDISK does to do it.
  117. *
  118. * This dialog is not sub-classable. You cannot put custom
  119. * controls in it. If you want this ability, you will have
  120. * to write your own front end for the DMaint_FixDrive
  121. * engine.
  122. *
  123. * NOTE that the check will not start till the user pushes the
  124. * start button in the dialog unless the CHKOPT_AUTO option is set.
  125. *
  126. * PARAMETERS
  127. *
  128. * hwnd = The window handle of the window which will own the dialog
  129. * options = These options basically coorespond to the check boxes
  130. * in the Advanced Options dialog. See CHKOPT_ defines
  131. * below.
  132. * DrvList = This is a DWORD bit field which indicates the 0 based
  133. * drive numbers to check. Bit 0 = A, Bit 1 = B, ...
  134. * For use on this API at least one bit must be set (if
  135. * this argument is 0, the call will return WD_CHK_NOCHK).
  136. *
  137. * RETURN
  138. * The return is either one of the WD_CHK_* values.
  139. *
  140. */
  141. DWORD WINAPI WinDisk_CheckDrive(HWND hwnd, WORD options, DWORD DrvList);
  142. typedef DWORD (CALLBACK* WDCHKDRVPROC)(HWND,WORD,DWORD);
  143. //
  144. // Special return values. PLEASE NOTE that these are DWORD values.
  145. //
  146. #define WD_CHK_ERROR 0xFFFFFFFFL // Fatal Error on check
  147. #define WD_CHK_CANCEL 0xFFFFFFFEL // Check was canceled
  148. #define WD_CHK_NOCHK 0xFFFFFFFDL // At least one Drive is not "checkable"
  149. #define WD_CHK_SMNOTFIX 0xFFFFFFFCL // Some errors were not fixed
  150. //
  151. // Option bits
  152. //
  153. // IMPORTANT NOTE: These are set up so that the default setting is 0
  154. // for all bits WITH ONE EXCEPTION. Currently the default
  155. // setting has the CHKOPT_XLCPY bit set......
  156. //
  157. // Also note that specification of invalid combonations of bits (for example
  158. // setting both CHKOPT_XLCPY and CHKOPT_XLDEL) will result in very random
  159. // behavior.
  160. //
  161. #define CHKOPT_REP 0x0001 // Generate detail report
  162. #define CHKOPT_RO 0x0002 // Run in preview mode
  163. #define CHKOPT_NOSYS 0x0004 // Surf Anal don't check system area
  164. #define CHKOPT_NODATA 0x0008 // Surf Anal don't check data area
  165. #define CHKOPT_NOBAD 0x0010 // Disable Surface Analysis
  166. #define CHKOPT_LSTMF 0x0020 // Convert lost clusters to files
  167. #define CHKOPT_NOCHKNM 0x0040 // Don't check file names
  168. #define CHKOPT_NOCHKDT 0x0080 // DOn't check date/time fields
  169. #define CHKOPT_INTER 0x0100 // Interactive mode
  170. #define CHKOPT_XLCPY 0x0200 // Def cross link resolution is COPY
  171. #define CHKOPT_XLDEL 0x0400 // Def cross link resolution is DELETE
  172. #define CHKOPT_ALLHIDSYS 0x0800 // All HID SYS files are unmovable
  173. #define CHKOPT_NOWRTTST 0x1000 // Surf Anal no write testing.
  174. #define CHKOPT_DRVLISTONLY 0x4000 // Normaly all drives in the system
  175. // are shown in the drive list box
  176. // and those on the DrvList are selected
  177. // This option says put only the drives
  178. // in DrvList in the list box and
  179. // disable the control
  180. #define CHKOPT_AUTO 0x8000 // Auto push start button
  181. /*
  182. * The WinDisk_GetBigDriveBM API provides access to the drive bitmaps
  183. * WINDISK uses in its main drive dialogs.
  184. *
  185. * These bitmaps are intended for dialogs, and are intended
  186. * to have a "chart" drawn on top of them. WINDISK draws
  187. * the Used/Free chart. This chart is intended to look like
  188. * the disk inside the drive.
  189. *
  190. * These bitmaps are placed on a background of COLOR_DIALOG. There
  191. * is no way to change this mapping color.
  192. *
  193. * The returned HBITMAP belongs to the calling app, it is up to the
  194. * caller to call DeleteObject on it to free it.
  195. *
  196. * PARAMETERS
  197. *
  198. * drive = The 0 based (A: == 0) drive number of the drive to get
  199. * the drive bitmap of.
  200. * lpChrt -> an array of 9 words whose format and meaning
  201. * depends on the returned "chart style" type
  202. * options = There are currently no options defined this param should
  203. * be zero. This field is reserved for future expansion.
  204. *
  205. * RETURN
  206. * The return is 0 if the bitmap could not be loaded (memory or
  207. * invalid drive).
  208. *
  209. * If the return is non-zero, the LOWORD is an HBITMAP,
  210. * and the HIWORD is a "chart style" ID which defines the
  211. * format of the data placed at lpChrt and the style for
  212. * the chart placed on top of the bitmap by WINDISK.
  213. *
  214. * USETYPE_NONE is for never-writable drives (like CD-ROM).
  215. * lpChrt data is not used.
  216. * USETYPE_ELLIPS is for circular type drives (Fixed,Floppy).
  217. * USETYPE_BARH is a horizontal parallelogram (RAMDrive).
  218. * USETYPE_BARV is a verticle parallelogram.
  219. *
  220. * lpChrt[0] word is the "3-D effect" height/width for the parallelogram or
  221. * ellips. NOTE that the 3-D effect is disabled if the height/width
  222. * is 0. Also note that with 3-D effect disabled, the parallelogram
  223. * can be turned into a rectangle.
  224. *
  225. * For USETYPE_ELLIPS, the next four words (lpChrt[1],lpChrt[2],lpChrt[3]
  226. * and lpChrt[4]) form a RECT structure which defines the bounding
  227. * rect for the ellips (including the 3-D effect). This RECT is in
  228. * coordinates of the returned bitmap (0,0 corresponds to the top
  229. * leftmost pixel of the bitmap).
  230. *
  231. * For USETYPE_BARH or USETYPE_BARV the 8 words starting at lpChrt[1]
  232. * are four POINT structures which define a parallelogram for the
  233. * chart (NOT including the 3-D effect).
  234. *
  235. * POINT 0 is at lpChrt[1]
  236. * POINT 1 is at lpChrt[3]
  237. * POINT 2 is at lpChrt[5]
  238. * POINT 3 is at lpChrt[7]
  239. *
  240. * the "3-D->" in the following indicate the sides that the 3-D effect
  241. * is drawn on. And the numbers are the point array
  242. * indexes.
  243. *
  244. * USETYPE_BARH (0.y)==(1.y) and (3.y)==(2.y)
  245. *
  246. * 0 _____________ 1
  247. * \ \
  248. * 3-D-> \ \
  249. * \ \
  250. * 3 ------------- 2
  251. * ^
  252. * 3-D
  253. *
  254. * USETYPE_BARV (0.x)==(3.x) and (1.x)==(2.x)
  255. *
  256. * 1
  257. * /|
  258. * / |
  259. * / |
  260. * 0 | |
  261. * | |
  262. * | | <- 3-D
  263. * | |
  264. * | |
  265. * | |
  266. * | |
  267. * | | 2
  268. * | /
  269. * | / <- 3-D
  270. * |/
  271. *
  272. * 3
  273. *
  274. */
  275. DWORD WINAPI WinDisk_GetBigDriveBM(WORD drive, LPWORD lpChrt, WORD options);
  276. typedef DWORD (CALLBACK* WDGETBDBMPROC)(WORD,LPWORD,WORD);
  277. //
  278. // HIWORD return "chart type" values
  279. //
  280. #define USETYPE_ELLIPS 0
  281. #define USETYPE_BARV 1
  282. #define USETYPE_BARH 2
  283. #define USETYPE_NONE 3
  284. /*
  285. * The WinDisk_PropSheet API provides access to the main drive
  286. * dialog.
  287. *
  288. * This API is intended for the SHELL so it can bring up a
  289. * drive property sheet.
  290. *
  291. * PARAMETERS
  292. *
  293. * drive = The 0 based (A: == 0) drive number of the drive to bring
  294. * up the property dialog for.
  295. * hwnd = The HWND which will own the dialog
  296. * options = There are currently no options defined this param should
  297. * be zero. This field is reserved for future expansion.
  298. *
  299. * RETURN
  300. * The return is -2 if the drive number is invalid.
  301. * Else the return is the return from a DialogBox call to bring
  302. * up the dialog. NOTE that -1 means that the DialogBox failed.
  303. *
  304. */
  305. int WINAPI WinDisk_PropSheet(int drive, HWND hwndpar, WORD options);
  306. typedef int (CALLBACK* WDPROPSHEET)(int,HWND,WORD);