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.

472 lines
15 KiB

  1. #pragma warning(disable:4001)
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // File: ACMHOOK.H
  4. // Purpose: Types, data structures, and function definitions for
  5. // hooking out the standard acme ui
  6. // Notes: I - input
  7. // O - output
  8. ////////////////////////////////////////////////////////////////////////////////
  9. #if defined(__cplusplus)
  10. extern "C" {
  11. #endif //__cplusplus
  12. #define cbMaxSz 256 // maximum string buffer size
  13. #define DECL __cdecl // calling convention of hook procedures
  14. typedef enum { // Dialog Hook Return Code
  15. shrcOk, // proceed with setup
  16. shrcCancel, // cancel/quit button was pushed
  17. shrcIgnore, // ignore button was pushed
  18. shrcOption, // "change option" button was pushed
  19. shrcDirectory, // "change directory" button was pushed
  20. shrcRefresh, // activation change - refresh data
  21. shrcFail, // error occurred - cancel setup
  22. shrcNone, // don't remove any shared components
  23. shrcKeep, // don't remove this shared component
  24. shrcRemoveAll, // remove all app/shared components
  25. shrcRemove, // remove this shared component
  26. shrcReinstall, // re install components
  27. shrcFrameRegisterFail, // error registering class
  28. shrcFrameCreateFail // error creating frame window
  29. } SHRC;
  30. typedef struct { // Hook Data
  31. LONG cb; // structure size (I)
  32. CHAR rgchHelpFile[cbMaxSz]; // help file (I)
  33. DWORD dwHelpContext; // help context (I)
  34. } HD, *PHD;
  35. typedef struct { // Welcome Dialog Hook Data
  36. HD hd; // common hook data
  37. BOOL fMaint; // maintenace mode setup (I)
  38. } WDHD, *PWDHD;
  39. typedef
  40. SHRC (DECL *LPFNSHRCWDH)(PWDHD); // Welcome Dialog Hook
  41. typedef struct { // Modules in Use Dialog Hook Data
  42. HD hd; // common hook data
  43. CHAR rgchModuleList[cbMaxSz]; // names of modules in use (I)
  44. } MUDHD, *PMUDHD;
  45. typedef
  46. SHRC (DECL *LPFNSHRCMUDH)(PMUDHD); // Modules in Use Dialog Hook
  47. typedef enum { // Copy Disincentive Dialog Hook Mode
  48. cddhmNameOrg, // allow the name and org to be modified
  49. cddhmName, // allow only the name to be modified
  50. cddhmOrg // allow only the org to be modified
  51. } CDDHM;
  52. typedef struct { // Copy Disincentive Dialog Hook Data
  53. HD hd; // common hook data
  54. CDDHM cddhm; // CD mode (I)
  55. CHAR rgchName[cbMaxSz]; // name string (I/O)
  56. CHAR rgchOrg[cbMaxSz]; // organization string (I/O)
  57. } CDDHD, *PCDDHD;
  58. typedef
  59. SHRC (DECL *LPFNSHRCCDDH)(PCDDHD); // Copy Disincentive Dialog Hook
  60. typedef enum { // Serial Number Dialog Hook Mode
  61. sndhmNormal, // the normal/default functionality
  62. sndhmCDKey, // the cdkey functionality
  63. sndhmOEM // the OEM functionality
  64. } SNDHM;
  65. typedef struct { // Serial Number Dialog Hook Data
  66. HD hd; // common hook data
  67. CHAR rgchSerNum[cbMaxSz]; // serial number string (I/O)
  68. SNDHM sndhm; // serial number dialog hook mode (I)
  69. } SNDHD, *PSNDHD;
  70. typedef
  71. SHRC (DECL *LPFNSHRCSNDH)(PSNDHD); // Serial Number Dialog Hook
  72. typedef enum { // Already Used Dialog Hook Mode
  73. audhmBad, // setup.ini corrupted
  74. audhmOrg, // organization used
  75. audhmName, // name used
  76. audhmBoth // both name and org used
  77. } AUDHM;
  78. typedef struct { // Already Used Dialog Hook Data
  79. HD hd; // common hook data
  80. AUDHM audhm; // mode (I)
  81. CHAR rgchName[cbMaxSz]; // name string (I)
  82. CHAR rgchOrg[cbMaxSz]; // organization string (I)
  83. } AUDHD, *PAUDHD;
  84. typedef
  85. SHRC (DECL *LPFNSHRCAUDH)(PAUDHD); // Already Used Dialog Hook
  86. typedef struct { // Disk Locked Dialog Hook Data
  87. HD hd; // common hook data
  88. CHAR rgchDir[cbMaxSz]; // directory string (I)
  89. } DLDHD, *PDLDHD;
  90. typedef
  91. SHRC (DECL *LPFNSHRCDLDH)(PDLDHD); // Disk Locked Dialog Hook
  92. typedef enum { // Copy Disincentive Dialog Hook Mode
  93. cpdhmRemind, // piracy reminder
  94. cpdhmWarn, // piracy warning
  95. cpdhmWarn2 // nasty ;-) piracy warning
  96. } CPDHM;
  97. typedef struct { // CD Piracy Dialog Hook Data
  98. HD hd; // common hook data
  99. CPDHM cpdhm; // mode (I)
  100. } CPDHD, *PCPDHD;
  101. typedef
  102. SHRC (DECL *LPFNSHRCCPDH)(PCPDHD); // CD Piracy Dialog Hook
  103. typedef enum { // DiRectory Dialog Hook Mode
  104. drdhmNotExistDir, // directory does not exist
  105. drdhmAppExistsOld, // older version in directory
  106. drdhmAppExistsNew // new version in directory
  107. } DRDHM;
  108. typedef struct { // DiRectory Dialog Hook Data
  109. HD hd; // common hook data
  110. DRDHM drdhm; // mode (I)
  111. CHAR rgchComponent[cbMaxSz]; // component name string (I)
  112. CHAR rgchPath[cbMaxSz]; // path (I)
  113. } DRDHD, *PDRDHD;
  114. typedef
  115. SHRC (DECL *LPFNSHRCDRDH)(PDRDHD); // DiRectory Dialog Hook
  116. typedef struct { // Get Path Dialog Hook Data
  117. HD hd; // common hook data
  118. CHAR rgchFilename[cbMaxSz]; // filename string - may be "" (I)
  119. CHAR rgchVersion[cbMaxSz]; // version string - may be "" (I)
  120. CHAR rgchSrcDir[cbMaxSz]; // source distory string - may be "" (I)
  121. LONG cSubNodeMax; // count of maximumum subnodes (I)
  122. BOOL fAllowExtendedChars; // if extended characters allowed (I)
  123. CHAR rgchComponent[cbMaxSz]; // component name string - may be "" (I)
  124. BOOL fNeedNewEmptyDir; // the directory should be empty (I)
  125. CHAR rgchPath[cbMaxSz]; // path to edit (I/O)
  126. } GPDHD, *PGPDHD;
  127. typedef
  128. SHRC (DECL *LPFNSHRCGPDH)(PGPDHD); // Get Path Dialog Hook
  129. typedef struct { // App Main BuTtoN
  130. CHAR rgchLabel[cbMaxSz]; // button label string (I)
  131. CHAR rgchText[cbMaxSz]; // description string (I)
  132. HBITMAP hbm; // bitmap for button (I)
  133. } AMBTN, *PAMBTN;
  134. typedef struct { // App Main Dialog Hook Data
  135. HD hd; // common hook data
  136. LONG iambtnSelected; // which button selected (I/O)
  137. LONG cambtn; // number of buttons (I)
  138. CHAR rgchPath[cbMaxSz]; // directory path (I)
  139. HGLOBAL hrgambtn; // button data (I)
  140. } AMDHD, *PAMDHD;
  141. typedef
  142. SHRC (DECL *LPFNSHRCAMDH)(PAMDHD); // App Main Dialog Hook
  143. typedef struct { // ProgMan Dialog Hook Data
  144. HD hd; // common hook data
  145. CHAR rgchGroup[cbMaxSz]; // suggested group name (I/O)
  146. LONG crgchExisting; // number of existing groups (I)
  147. HGLOBAL hrgrgchExisting; // existing group names (I)
  148. // [crgchExisting][cbMaxSz]
  149. } PMDHD, *PPMDHD;
  150. typedef
  151. SHRC (DECL *LPFNSHRCPMDH)(PPMDHD); // ProgMan Dialog Hook Data
  152. typedef struct { // ReBoot Dialog Hook Data
  153. HD hd; // common hook data
  154. } RBDHD, *PRBDHD;
  155. typedef
  156. SHRC (DECL *LPFNSHRCRBDH)(PRBDHD); // ReBoot Dialog Hook
  157. typedef struct { // Reboot Failed Dialog Hook Data
  158. HD hd; // common hook data
  159. } RFDHD, *PRFDHD;
  160. typedef
  161. SHRC (DECL *LPFNSHRCRFDH)(PRFDHD); // Reboot Failed Dialog Hook
  162. typedef enum { // eXiT Dialog Hook Mode
  163. xtdhmOk, // installation was successful
  164. xtdhmError, // installation failed
  165. xtdhmQuit // installation was cancelled
  166. } XTDHM;
  167. typedef struct { // eXiT Dialog Hook Data
  168. HD hd; // common hook data
  169. XTDHM xtdhm; // mode (I)
  170. } XTDHD, *PXTDHD;
  171. typedef
  172. SHRC (DECL *LPFNSHRCXTDH)(PXTDHD); // eXiT Dialog Hook
  173. typedef struct { // Disk Space iTeMs
  174. CHAR rgchDesc[cbMaxSz]; // description string (I)
  175. CHAR rgchSize[cbMaxSz]; // size (I)
  176. } DSTM, *PDSTM;
  177. typedef struct { // Disk Space iTeMs
  178. LONG cbReq; // bytes required on current drive (I)
  179. LONG cbNeed; // bytes needed on current drive (I)
  180. } DSDRV, *PDSDRV;
  181. typedef struct { // Disk Space Dialog Hook Data
  182. HD hd; // common hook data
  183. BOOL fAdmin; // whether in admin mode or not (I)
  184. LONG idsdrvCur; // the selected drive (I/O)
  185. LONG cdstm; // number of items (I)
  186. HGLOBAL hrgdstm; // the items
  187. LONG cdsdrv; // number of drives (I)
  188. HGLOBAL hrgdsdrv; // the drives
  189. } DSDHD, *PDSDHD;
  190. typedef
  191. SHRC (DECL *LPFNSHRCDSDH)(PDSDHD); // Disk Space Dialog Hook
  192. typedef struct { // OPtions Dialog iTeMs
  193. CHAR rgchTitle[cbMaxSz]; // title string (for listbox) (I)
  194. CHAR rgchDesc[cbMaxSz]; // description string (I)
  195. CHAR rgchDir[cbMaxSz]; // the directory string (I)
  196. LONG cb; // number of bytes item requires (I)
  197. BOOL fChecked; // if the item is chosen (I/O)
  198. BOOL fChangeOption; // enable the "change option" button
  199. BOOL fChangeDirectory; // enable the "change directory" button
  200. BOOL fVital; // the item is vital
  201. } OPTM, *POPTM;
  202. typedef struct { // OPtions Dialog Hook Data
  203. HD hd; // common hook data
  204. BOOL fMaint; // maintenace mode setup (I)
  205. BOOL fTop; // if top level dialog (I)
  206. LONG coptm; // number of option items (I)
  207. LONG ioptmCur; // currently selected item (I/O)
  208. CHAR rgchDrvCur[cbMaxSz]; // drive of currently selected item (I)
  209. LONG cbDrvCurReq; // bytes needed on current drive (I)
  210. LONG cbDrvCurAvail; // bytes available on current drive (I)
  211. LONG cToAdd; // number of items to add (I)
  212. LONG cToRemove; // number of items to remove (I)
  213. HGLOBAL hrgoptm; // the option items (I)
  214. } OPDHD, *POPDHD;
  215. typedef
  216. SHRC (DECL *LPFNSHRCOPDH)(POPDHD); // OPtions Dialog Hook
  217. typedef struct { // Admin Warn Hook Data
  218. HD hd; // common hook data
  219. } AWDHD, *PAWDHD;
  220. typedef
  221. SHRC (DECL *LPFNSHRCAWDH)(PAWDHD); // Admin Warn Hook
  222. typedef struct { // MsApps directory Hook Data
  223. HD hd; // common hook data
  224. CHAR rgchPath[cbMaxSz]; // directory path (I)
  225. } MADHD, *PMADHD;
  226. typedef
  227. SHRC (DECL *LPFNSHRCMADH)(PMADHD); // MsApps directory Hook
  228. typedef enum { // Confirm Server Dialog Hook Mode'
  229. csdhmName, // use server name
  230. csdhmLetter // use drive letter
  231. } CSDHM;
  232. typedef struct { // Confirm Server Dialog Hook Data
  233. HD hd; // common hook data
  234. CHAR rgchName[cbMaxSz]; // component name (I)
  235. CHAR rgchPath[cbMaxSz]; // directory path (I)
  236. CHAR rgchNetPath[cbMaxSz]; // network path (I/O)
  237. CHAR rgchServer[cbMaxSz]; // network server (I/O)
  238. CHAR chDrive; // drive letter (I/O)
  239. CSDHM csdhm; // use name or drive letter (O)
  240. } CSDHD, *PCSDHD;
  241. typedef
  242. SHRC (DECL *LPFNSHRCCSDH)(PCSDHD); // Confirm Server Dialog Hook
  243. typedef enum { // Shared Files Dialog Hook Mode
  244. sfdhmServer, // put shared files on server;
  245. sfdhmLocal, // put shared files on local hard drive
  246. sfdhmChoice // user can choose in network mode
  247. } SFDHM;
  248. typedef struct { // Shared Files Dialog Hook Data
  249. HD hd; // common hook data
  250. BOOL fAdmin; // whether in admin mode or not (I)
  251. SFDHM sfdhm; // shared files mode (O)
  252. } SFDHD, *PSFDHD;
  253. typedef
  254. SHRC (DECL *LPFNSHRCSFDH)(PSFDHD); // Shared Files Dialog Hook
  255. typedef struct { // Remove Shared Dialog Hook Data
  256. HD hd; // common hook data
  257. CHAR rgchComponent[cbMaxSz]; // component name (I)
  258. } RSDHD, *PRSDHD;
  259. typedef
  260. SHRC (DECL *LPFNSHRCRSDH)(PRSDHD); // Remove Shared Dialog Hook
  261. typedef struct { // Ask Quit Dialog Hook Data
  262. HD hd; // common hook data
  263. } AQDHD, *PAQDHD;
  264. typedef
  265. SHRC (DECL *LPFNSHRCAQDH)(PAQDHD); // Ask Quit Dialog Hook
  266. typedef struct { // Invalid Net Path Dialog Hook Data
  267. HD hd; // common hook data
  268. } INDHD, *PINDHD;
  269. typedef
  270. SHRC (DECL *LPFNSHRCINDH)(PINDHD); // Invalid Net Path Dialog Hook
  271. typedef struct { // No Connection Dialog Hook Data
  272. HD hd; // common hook data
  273. } NCDHD, *PNCDHD;
  274. typedef
  275. SHRC (DECL *LPFNSHRCNCDH)(PNCDHD); // No Connection Dialog Hook
  276. typedef enum { // Start Modeless Dialog Hook Mode
  277. smdhmSearching, // searching for components
  278. smdhmCheckingDisk, // checking disk space
  279. smdhmModifyingSys // modifying system
  280. } SMDHM;
  281. typedef struct { // Start Modeless Dialog Hook
  282. HD hd; // common hook data
  283. SMDHM smdhm; // modeless dialog type (I)
  284. HWND hwndParent; // parent for modeless dialog (I)
  285. DWORD dwHook; // value for End Modeless (O)
  286. } SMDHD, *PSMDHD;
  287. typedef
  288. SHRC (DECL *LPFNSHRCSMDH)(PSMDHD); // Start Modeless Dialog Hook
  289. typedef struct { // End Modeless Dialog Hook
  290. HD hd; // common hook data
  291. DWORD dwHook; // value from Start Modeless (I)
  292. } EMDHD, *PEMDHD;
  293. typedef
  294. SHRC (DECL *LPFNSHRCEMDH)(PEMDHD); // End Modeless Dialog Hook
  295. typedef struct { // Create Frame Hook Data
  296. LONG cbCFHD; // structure size (I)
  297. WNDCLASS wc; // default RegisterClass data (I)
  298. CREATESTRUCT cs; // default CreateWindow data (I)
  299. HWND hwndFrame; // new frame window handle (O)
  300. int nCmdShow; // default parm for ShowWindow (I)
  301. } CFHD, *PCFHD;
  302. typedef
  303. SHRC (DECL *LPFNSHRCCFH)(PCFHD); // Create Frame Hook
  304. typedef struct { // Message Box Hook Data
  305. LONG cbMBHD; // structure size (I)
  306. HWND hwndOwner; // handle of owner window (I)
  307. LPCSTR lpszText; // text in message box (I)
  308. LPCSTR lpszTitle; // title of message box (I)
  309. UINT uStyle; // style of message box (I)
  310. int idRet; // return value of message box (O)
  311. } MBHD, *PMBHD;
  312. typedef
  313. SHRC (DECL *LPFNSHRCMBH)(PMBHD); // Message Box Hook
  314. typedef struct { // Gauge Init Hook Data
  315. LONG cbGIHD; // structure size (I)
  316. } GIHD, *PGIHD;
  317. typedef
  318. SHRC (DECL *LPFNSHRCGIH)(PGIHD); // Gauge Init Hook
  319. typedef struct { // Gauge Open Hook Data
  320. LONG cbGOHD; // structure size (I)
  321. HWND hwndParent; // handle of parent (frame) window (I)
  322. BOOL *pfAbort; // flag to set when cancel pushed
  323. } GOHD, *PGOHD;
  324. typedef
  325. SHRC (DECL *LPFNSHRCGOH)(PGOHD); // Gauge Open Hook
  326. typedef struct { // Gauge Close Hook Data
  327. LONG cbGCHD; // structure size (I)
  328. } GCHD, *PGCHD;
  329. typedef
  330. SHRC (DECL *LPFNSHRCGCH)(PGCHD); // Gauge Close Hook
  331. typedef struct { // Gauge Title Hook Data
  332. LONG cbGTHD; // structure size (I)
  333. CHAR rgchTitle[cbMaxSz]; // new title string (I)
  334. } GTHD, *PGTHD;
  335. typedef
  336. SHRC (DECL *LPFNSHRCGTH)(PGTHD); // Gauge Title Hook
  337. typedef struct { // Gauge teXt Hook Data
  338. LONG cbGXHD; // structure size (I)
  339. CHAR rgchSrc[cbMaxSz]; // new source string (I)
  340. CHAR rgchDst[cbMaxSz]; // new destination string (I)
  341. } GXHD, *PGXHD;
  342. typedef
  343. SHRC (DECL *LPFNSHRCGXH)(PGXHD); // Gauge teXt Hook
  344. typedef struct { // Gauge Range Hook Data
  345. LONG cbGRHD; // structure size (I)
  346. LONG iLim; // new range limit (I)
  347. } GRHD, *PGRHD;
  348. typedef
  349. SHRC (DECL *LPFNSHRCGRH)(PGRHD); // Gauge Range Hook
  350. typedef struct { // Gauge Position Hook Data
  351. LONG cbGPHD; // structure size (I)
  352. LONG iCur; // new current position (I)
  353. } GPHD, *PGPHD;
  354. typedef
  355. SHRC (DECL *LPFNSHRCGPH)(PGPHD); // Gauge Position Hook
  356. typedef struct { // Gauge Delta Hook Data
  357. LONG cbGDHD; // structure size (I)
  358. LONG dCur; // delta to current position (I)
  359. } GDHD, *PGDHD;
  360. typedef
  361. SHRC (DECL *LPFNSHRCGDH)(PGDHD); // Gauge Delta Hook
  362. typedef struct { // Gauge Yield Hook Data
  363. LONG cbGYHD; // structure size (I)
  364. } GYHD, *PGYHD;
  365. typedef
  366. SHRC (DECL *LPFNSHRCGYH)(PGYHD); // Gauge Yield Hook
  367. typedef struct { // Filecopy Warning Hook Data
  368. LONG cbFWHD; // structure size (I)
  369. CHAR rgchPath[cbMaxSz]; // path to file being copied
  370. } FWHD, *PFWHD;
  371. typedef
  372. SHRC (DECL *LPFNSHRCFWH)(PFWHD); // Filecopy Warning Hook
  373. #if defined(__cplusplus)
  374. }
  375. #endif //__cplusplus
  376. #pragma warning(default:4001)