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.

576 lines
19 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winnt32p.h
  5. Abstract:
  6. Header file for winnt32 plug-in down-level-side DLLs.
  7. Author:
  8. Ted Miller (tedm) 6 December 1996
  9. Revision History:
  10. --*/
  11. #ifndef WINNT32P_H
  12. #define WINNT32P_H
  13. #include <prsht.h>
  14. //
  15. // winnt32 dll main exported routine prototype
  16. //
  17. DWORD
  18. WINAPI
  19. winnt32 (
  20. IN PCSTR DefaultSourcePath, OPTIONAL
  21. IN HWND Dlg, OPTIONAL
  22. IN HANDLE WinNT32Stub, OPTIONAL
  23. OUT PCSTR* RestartCmdLine OPTIONAL
  24. );
  25. typedef
  26. DWORD
  27. (WINAPI* PWINNT32) (
  28. IN PCTSTR DefaultSourcePath, OPTIONAL
  29. IN HWND Dlg, OPTIONAL
  30. IN HANDLE WinNT32Stub, OPTIONAL
  31. OUT PCSTR* RestartCmdLine OPTIONAL
  32. );
  33. //
  34. // WMX_ACTIVATEPAGE is sent when a page is being activated or deactivated.
  35. //
  36. // (The plug-in's pages do not receive WM_NOTIFY with PSN_SETACTIVE and
  37. // PSN_KILLACTIVE -- they get a WMX_ACTIVATEPAGE instead.)
  38. //
  39. // wParam non-0: activating
  40. // wParam 0 : deactivating
  41. // lParam : unused.
  42. //
  43. // Return non-0 to accept (de)activation, 0 to not accept it. The semantics
  44. // of not accepting (de)activation are exactly the same as for the
  45. // PSN_SETACTIVE/PSN_KILLACTIVE case.
  46. //
  47. #define WMX_ACTIVATEPAGE (WM_APP+0)
  48. //
  49. // WMX_BBTEXT can be send by a page when is want's to hide and start the billboard
  50. //
  51. // wParam non-0: start billboard, the wizard page will hide itself
  52. // wParam 0 : Stop billboard, The wizard page will call this if it shows again.
  53. // lParam : unused.
  54. //
  55. // If the SendMessage returns TRUE, the billboard is started/stopped
  56. //
  57. #define WMX_BBTEXT (WM_APP+1)
  58. //
  59. // WMX_BBPROGRESSGAUGE send by the page when is wants to show/hide the progress gauge on the billboard
  60. //
  61. // wParam non-0: show the progerss gauge on the billboard
  62. // wParam 0 : hide the progerss gauge on the billboard
  63. // lParam : unused.
  64. //
  65. #define WMX_BBPROGRESSGAUGE (WM_APP+2)
  66. //
  67. // WMX_PBM_* private progress bar messages for the billboard.
  68. #define WMX_PBM_SETRANGE (WM_APP+3)
  69. #define WMX_PBM_SETPOS (WM_APP+4)
  70. #define WMX_PBM_DELTAPOS (WM_APP+5)
  71. #define WMX_PBM_SETSTEP (WM_APP+6)
  72. #define WMX_PBM_STEPIT (WM_APP+7)
  73. //
  74. // WMX_BB_SETINFOTEXT sets the text in the info window on the billboard
  75. //
  76. // wParam not used
  77. // lParam pointer to the text which should be displayed on the billboard info window
  78. //
  79. // This message should only be used with SendMessage. The billboard makes a copy of the text
  80. // passed in.
  81. //
  82. #define WMX_BB_SETINFOTEXT (WM_APP+8)
  83. //
  84. // WMX_BB_ADVANCE_SETUPPHASE lets the wizard/billboard know that a setup phase is finished
  85. // and the time estimate can advance to the next phase.
  86. // In the win9x upgrade, there can be 2 phases. 1. create/update the hardware compatibility
  87. // database. 2. Create the upgrade report.
  88. // Phase 1 does not need to run if the db which comes with the products is still correct.
  89. //
  90. #define WMX_BB_ADVANCE_SETUPPHASE (WM_APP+9)
  91. //
  92. #define WMX_SETPROGRESSTEXT (WM_APP+10)
  93. //
  94. // WMX_QUERYCANCEL is sent to allow a page to do a custom processing of QueryCancel
  95. //
  96. // wParam : unused
  97. // lParam : pointer to a BOOL variable indicating outcome (when return==TRUE)
  98. // *lParam == TRUE means user wants to cancel the wizard
  99. // *lParam == FALSE means user may continue
  100. //
  101. // Return non-0 to specify the QueryCancel was handled by the page and the
  102. // answer to the QueryCancel request is in *lParam (see above)
  103. // Return 0 to specify that the default QueryCancel action must be taken
  104. //
  105. #define WMX_QUERYCANCEL (WM_APP+11)
  106. // More progress message for the billboard
  107. #define WMX_PBM_SETBARCOLOR (WM_APP+12)
  108. //
  109. // First custom window message a plug-in can use.
  110. // Do NOT use any below this value.
  111. //
  112. #define WMX_PLUGIN_FIRST (WM_APP+1000)
  113. //
  114. // IDs the plug-in must use for its title and subtitle text on each
  115. // wizard page.
  116. //
  117. #define ID_TITLE_TEXT 1000
  118. #define ID_SUBTITLE_TEXT 1029
  119. //
  120. // Define types for routines that the plug-in DLL must export.
  121. //
  122. //
  123. // Maximum source count..
  124. //
  125. #define MAX_SOURCE_COUNT 8
  126. /*
  127. This structure contains the information that is passed to a Winnt32 plug-in in
  128. its Init function.
  129. UnattendedFlag - Supplies the address of the global attended flag within
  130. winnt32 itself. A plugin should react accordingly to setup being in
  131. unattended mode.
  132. CancelledFlag - supplies the address of a global variable within
  133. winnt32 itself. If the plug-in encounters a fatal error while
  134. processing later it should inform the user, set the BOOL to which
  135. this parameter points to TRUE, and do the following:
  136. PropSheet_PressButton(WizardDialogBox,PSBTN_CANCEL);
  137. where WizardDialogBox is the window handle of the wizard dialog box
  138. (typically obtained via GetParent(hdlg) where hdlg is the
  139. window handle of a page in the wizard).
  140. AbortedFlag - supplies the address of a global variable within winnt32 itself.
  141. If the plugin would like to exit setup, but not show the unsuccessfull
  142. completion page, it should set both CancelledFlag and AbortedFlag to TRUE.
  143. UpgradeFlag - supplies the address of a global variable that will
  144. indicate whether the user is upgrading or installing a new fresh
  145. copy of NT. The plug-in must sample this value when it is asked to
  146. activate its pages and take appropriate action (ie, not activating
  147. if the user is not upgrading). The value this pointer points to
  148. is NOT valid until after the plug-in's pages are first
  149. activated.
  150. LocalSourceModeFlag - supplies the address of a global variable that will
  151. indicate whether the user is installing via local source mode or not.
  152. This parameter is not valid until after the plug-in's pages are first
  153. activated.
  154. CdRomInstallFlag - supplies the address of a global variable that will
  155. indicate whetherthe user is installing via CdRom or not. This
  156. parameter is not valid until after the plug-in's pages are first
  157. activated.
  158. NotEnoughSpaceBlockFlag - supplies the address of a global variable that will
  159. indicate wether setup should halt setup and exit if it detects that
  160. there is not enough space to complete setup (not enough space for the ~ls dir.)
  161. LocalSourceDrive - supplies the address of a global variable that will indicate
  162. the drive number of the local source directory. (2 = C, 3 = D, etc...) This is
  163. not valid until after winnt32 builds the copy list. 0 indicates an invalid drive.
  164. LocalSourceSpaceRequired - supplies the address of a global variable that indicates the amount
  165. of space on the LocalSourceDrive required by winnt32. This is not valid until after
  166. winnt32 builds the copy list.
  167. UnattendedScriptFile - supplies the address of a global variable that will
  168. contain the unattend script file (such as passed in on the command line.)
  169. This parameter is not valid until after the plug-in's pages are first
  170. activated.
  171. SourcePath - supplies an array of SourcePaths that indicate where the
  172. NT source files exist. This parameter is not valid until after the
  173. plug-in's pages are first activated.
  174. SourceCount - supplies the count of SourcePaths in the above array.
  175. This parameter is not valid until after the plug-in's pages are first
  176. activated.
  177. UpgradeOptions - supplies a multistring of special Upgrade commandline options
  178. to the dll. These options are of the form /#U:[Option] so, for example,
  179. if someone started winnt32 with the commandline winnt32 /#U:FOO /#U:BAR,
  180. this string would eventually contain "FOO\0BAR\0\0" This parameter is not
  181. valid untila after the upgrade plug-in's pages are first activated.
  182. ProductType - Specifies the type of product being installed. The value this pointer
  183. points to is NOT valid until after the plug-in's pages are first activated.
  184. BuildNumber - Specifies the build of NT being installed.
  185. ProductVersion - Specifies the version of NT being installed. The major version is
  186. in the high byte, and the minor version is in the low byte.
  187. Debug - Specifies if WINNT32 is the checked build (TRUE) or the free build (FALSE).
  188. PreRelease - Specifies if the current build is a pre-release (TRUE) or final release (FALSE).
  189. */
  190. typedef enum {
  191. UNKNOWN,
  192. NT_WORKSTATION,
  193. NT_SERVER
  194. } PRODUCTTYPE;
  195. // UPD_FLAGS_* can be set in SetupFlags to let the upgrade DLL know somethings about setup
  196. //
  197. // Setup is run in Typical mode. The upgrade DLL should proceed with defaults
  198. // and not ask the user any question if possible.
  199. #define UPG_FLAG_TYPICAL 0x1
  200. //
  201. // What are the ProductType values in dosnet.inf?
  202. //
  203. #define PROFESSIONAL_PRODUCTTYPE (0)
  204. #define SERVER_PRODUCTTYPE (1)
  205. #define ADVANCEDSERVER_PRODUCTTYPE (2)
  206. #define DATACENTER_PRODUCTTYPE (3)
  207. #define PERSONAL_PRODUCTTYPE (4)
  208. #define BLADESERVER_PRODUCTTYPE (5)
  209. #define SMALLBUSINESS_PRODUCTTYPE (6)
  210. //
  211. // This value is for coding purposes only
  212. //
  213. #define UNKNOWN_PRODUCTTYPE ((UINT)(-1))
  214. typedef struct tagWINNT32_PLUGIN_INIT_INFORMATION_BLOCK {
  215. UINT Size;
  216. BOOL * UnattendedFlag;
  217. BOOL * CancelledFlag;
  218. BOOL * AbortedFlag;
  219. BOOL * UpgradeFlag;
  220. BOOL * LocalSourceModeFlag;
  221. BOOL * CdRomInstallFlag;
  222. BOOL * NotEnoughSpaceBlockFlag;
  223. DWORD * LocalSourceDrive;
  224. LONGLONG * LocalSourceSpaceRequired;
  225. LPCTSTR * UnattendedScriptFile;
  226. LPCTSTR * SourceDirectories;
  227. DWORD * SourceDirectoryCount;
  228. LPCTSTR * UpgradeOptions;
  229. PRODUCTTYPE * ProductType;
  230. DWORD BuildNumber;
  231. WORD ProductVersion; // i.e., MAKEWORD(5,0)
  232. BOOL Debug;
  233. BOOL PreRelease;
  234. BOOL * ForceNTFSConversion;
  235. UINT * Boot16; // Win9x upgrade only
  236. UINT * ProductFlavor; // See *_PRODUCTTYPE above
  237. DWORD * SetupFlags; // See UPD_FLAGS_ above
  238. BOOL * UnattendSwitchSpecified;
  239. BOOL * DUCompletedSuccessfully; // flag SET when DU completes successfully
  240. } WINNT32_PLUGIN_INIT_INFORMATION_BLOCK,*PWINNT32_PLUGIN_INIT_INFORMATION_BLOCK;
  241. typedef BOOL (*READ_DISK_SECTORS_PROC) (TCHAR,UINT,UINT,UINT,PBYTE);
  242. typedef struct tagWINNT32_WIN9XUPG_INIT_INFORMATION_BLOCK {
  243. UINT Size;
  244. PWINNT32_PLUGIN_INIT_INFORMATION_BLOCK BaseInfo;
  245. LPCTSTR UpgradeSourcePath;
  246. PLONGLONG WinDirSpace;
  247. PUINT RequiredMb;
  248. PUINT AvailableMb;
  249. LPCTSTR * OptionalDirectories;
  250. DWORD * OptionalDirectoryCount;
  251. UINT * UpgradeFailureReason;
  252. READ_DISK_SECTORS_PROC ReadDiskSectors;
  253. PCTSTR DynamicUpdateLocalDir;
  254. PCTSTR DynamicUpdateDrivers;
  255. BOOL * UpginfsUpdated;
  256. } WINNT32_WIN9XUPG_INIT_INFORMATION_BLOCK, *PWINNT32_WIN9XUPG_INIT_INFORMATION_BLOCK;
  257. /*++
  258. UPGRADEFAILURES is a list of reasons that an upgrade cannot be performed. This list allows winnt32 to own certain messages
  259. for failures, but for the upgrade dll to do the actual checking for those failures.
  260. If you define a FAILREASON(<x>) you need to add a MSG_<x> to the winnt32 dll message.mc file.
  261. This macro expansion list will create an enumerated type FAILREASON_<x> as well as populate an array of potential
  262. failure messages.
  263. ++*/
  264. #define UPGRADEFAILURES \
  265. FAILREASON(UPGRADE_OK) \
  266. FAILREASON(UPGRADE_OTHER_OS_FOUND) \
  267. #define FAILREASON(x) REASON_##x,
  268. enum {UPGRADEFAILURES /*,*/ REASON_LAST_REASON};
  269. #undef FAILREASON
  270. typedef
  271. DWORD
  272. (CALLBACK WINNT32_PLUGIN_INIT_ROUTINE_PROTOTYPE)(
  273. PWINNT32_PLUGIN_INIT_INFORMATION_BLOCK Info
  274. );
  275. typedef WINNT32_PLUGIN_INIT_ROUTINE_PROTOTYPE * PWINNT32_PLUGIN_INIT_ROUTINE;
  276. /*++
  277. Routine Description:
  278. This routine is called by winnt32 to initialize the plug-in dll.
  279. Arguments:
  280. Info - A WINNT32_PLUGIN_INIT_INFORMATION_BLOCK. See above for details.
  281. Return Value:
  282. Win32 error code indicating outcome. If not NO_ERROR then winnt32 will
  283. put up UI telling the user of the failure.
  284. --*/
  285. typedef
  286. DWORD
  287. (CALLBACK WINNT32_PLUGIN_GETPAGES_ROUTINE_PROTOTYPE)(
  288. PUINT PageCount1,
  289. LPPROPSHEETPAGE *Pages1,
  290. PUINT PageCount2,
  291. LPPROPSHEETPAGE *Pages2,
  292. PUINT PageCount3,
  293. LPPROPSHEETPAGE *Pages3
  294. );
  295. typedef WINNT32_PLUGIN_GETPAGES_ROUTINE_PROTOTYPE * PWINNT32_PLUGIN_GETPAGES_ROUTINE;
  296. /*++
  297. Routine Description:
  298. This routine is called by winnt32 to retrieve wizard pages from the
  299. plug-in dll.
  300. Note that the plug-in does NOT need to worry about drawing watermarks
  301. or background bitmaps, or the separator between a header-area watermark
  302. and the body of its pages. Winnt32 does all this automatically.
  303. The plugin should, however, have regular static text controls in the
  304. header area. Static text controls in that area should use the reserved
  305. IDs (see above) for the title and subtitle, since winnt32 will automatically
  306. change the font and size of that text when the page is displayed.
  307. Arguments:
  308. PageCount1 - receives the number of pages in the first set of contiguous
  309. pages.
  310. Pages1 - receives a pointer to an array of property sheet page structures.
  311. The plug-in is responsible for managing this array but must not free
  312. it at any time since winnt32 may refer to it at any point.
  313. PageCount2 - receives the number of pages in the second set of contiguous
  314. pages.
  315. Pages2 - receives a pointer to an array of property sheet page structures.
  316. The plug-in is responsible for managing this array but must not free
  317. it at any time since winnt32 may refer to it at any point.
  318. PageCount3 - receives the number of pages in the third set of contiguous
  319. pages.
  320. Pages3 - receives a pointer to an array of property sheet page structures.
  321. The plug-in is responsible for managing this array but must not free
  322. it at any time since winnt32 may refer to it at any point.
  323. Return Value:
  324. Win32 error code indicating outcome. If not NO_ERROR then winnt32 will
  325. put up UI telling the user of the failure.
  326. --*/
  327. typedef
  328. DWORD
  329. (CALLBACK WINNT32_PLUGIN_WRITEPARAMS_ROUTINE_PROTOTYPE)(
  330. LPCTSTR FileName
  331. );
  332. typedef WINNT32_PLUGIN_WRITEPARAMS_ROUTINE_PROTOTYPE * PWINNT32_PLUGIN_WRITEPARAMS_ROUTINE;
  333. /*++
  334. Routine Description:
  335. This routine is called by winnt32 to request the plug-in write to the
  336. parameters file that will be passed to text mode setup (ie, winnt.sif).
  337. Arguments:
  338. FileName - supplies the filename of the .ini-style file to be written to.
  339. This file is the parameters file plus any user-specified unattend file.
  340. The plug-in should make whatever modifications are meaningful to it.
  341. Return Value:
  342. Win32 error code indicating outcome. If not NO_ERROR then winnt32 will
  343. put up UI telling the user of the failure.
  344. --*/
  345. typedef
  346. VOID
  347. (CALLBACK WINNT32_PLUGIN_CLEANUP_ROUTINE_PROTOTYPE)(
  348. VOID
  349. );
  350. typedef WINNT32_PLUGIN_CLEANUP_ROUTINE_PROTOTYPE * PWINNT32_PLUGIN_CLEANUP_ROUTINE;
  351. /*++
  352. Routine Description:
  353. This routine is called by winnt32 in the case where installation is
  354. aborted after the wizard has been started.
  355. The plug-in should silently perform whatever cleanup is needs to
  356. to undo any changes it made to the user's system.
  357. Arguments:
  358. None.
  359. Return Value:
  360. None.
  361. --*/
  362. typedef
  363. BOOL
  364. (CALLBACK WINNT32_PLUGIN_VIRUSSCANNER_CHECK_PROTOTYPE)(
  365. VOID
  366. );
  367. typedef WINNT32_PLUGIN_VIRUSSCANNER_CHECK_PROTOTYPE * PWINNT32_PLUGIN_VIRUSSCANNER_CHECK_ROUTINE;
  368. /*++
  369. Routine Description:
  370. This routine is called by winnt32 when running on win9x machines.
  371. The plugin should do a check for any virus scanners on the machine that could cause setup
  372. to be unable to complete installation (locking the MBR, for instance.) The plugin is also
  373. responsible for communicating any problems to the user.
  374. Arguments:
  375. None.
  376. Return Value:
  377. TRUE if there are no virus scanners to worry about, FALSE otherwise.
  378. --*/
  379. typedef
  380. PTSTR
  381. (CALLBACK WINNT32_PLUGIN_OPTIONAL_DIRS_PROTOTYPE)(
  382. VOID
  383. );
  384. typedef WINNT32_PLUGIN_OPTIONAL_DIRS_PROTOTYPE * PWINNT32_PLUGIN_OPTIONAL_DIRS_ROUTINE;
  385. //
  386. // Names of routines that must be exported by the plug-in dll.
  387. //
  388. #define WINNT32_PLUGIN_INIT_NAME "Winnt32PluginInit"
  389. #define WINNT32_PLUGIN_GETPAGES_NAME "Winnt32PluginGetPages"
  390. #define WINNT32_PLUGIN_WRITEPARAMS_NAME "Winnt32WriteParams"
  391. #define WINNT32_PLUGIN_CLEANUP_NAME "Winnt32Cleanup"
  392. #define WINNT32_PLUGIN_VIRUSSCANCHECK_NAME "Winnt32VirusScannerCheck"
  393. #define WINNT32_PLUGIN_GETOPTIONALDIRS_NAME "Winnt32GetOptionalDirectories"
  394. //
  395. // Names of routines that must be exported by the Dynamic Update dll.
  396. //
  397. #define API_DU_ISSUPPORTED "DuIsSupported"
  398. #define API_DU_INITIALIZEA "DuInitializeA"
  399. #define API_DU_INITIALIZEW "DuInitializeW"
  400. #define API_DU_QUERYUNSUPDRVSA "DuQueryUnsupportedDriversA"
  401. #define API_DU_QUERYUNSUPDRVSW "DuQueryUnsupportedDriversW"
  402. #define API_DU_DODETECTION "DuDoDetection"
  403. #define API_DU_BEGINDOWNLOAD "DuBeginDownload"
  404. #define API_DU_ABORTDOWNLOAD "DuAbortDownload"
  405. #define API_DU_UNINITIALIZE "DuUninitialize"
  406. #ifdef UNICODE
  407. #define API_DU_INITIALIZE API_DU_INITIALIZEW
  408. #define API_DU_QUERYUNSUPDRVS API_DU_QUERYUNSUPDRVSW
  409. #else
  410. #define API_DU_INITIALIZE API_DU_INITIALIZEA
  411. #define API_DU_QUERYUNSUPDRVS API_DU_QUERYUNSUPDRVSA
  412. #endif
  413. //
  414. // Messages that must be sent by the Dynamic Update dll.
  415. //
  416. #define WMX_SETUPUPDATE_PROGRESS_NOTIFY WMX_PLUGIN_FIRST+1001
  417. // WPARAM will be the updated Total Size (shouldn't change, but could possibly)
  418. // LPARAM will be the updated downloaded size
  419. // Time remaining after the initial estimate will need to be calculated by setup.
  420. #define WMX_SETUPUPDATE_RESULT WMX_PLUGIN_FIRST+1000
  421. // WPARAM will be the result code of the operation (one of the DU_STATUS_* below)
  422. // LPARAM is meaningful only if wParam==DU_STATUS_FAILED and gives more info about the error
  423. #define DU_STATUS_SUCCESS 1
  424. #define DU_STATUS_ABORT 2
  425. #define DU_STATUS_FAILED 3
  426. #endif