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.

624 lines
12 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. syssetup.h
  5. Abstract:
  6. Header file for internal-use routines exported from
  7. syssetup.dll.
  8. To use this file your code must #include setupapi.h first.
  9. Author:
  10. Ted Miller (tedm) 15-Aug-1995
  11. Revision History:
  12. Dan Elliott (dane) 14-Aug-2000 Added SetupWaitForScmInitialization()
  13. --*/
  14. #ifndef _WINNT_SYSSETUP_
  15. #define _WINNT_SYSSETUP_
  16. #ifndef _NTDEF_
  17. typedef LONG NTSTATUS, *PNTSTATUS;
  18. #endif // _NTDEF_
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. //
  26. // Definitions for OOBE
  27. //
  28. typedef enum _PID3_RESULT
  29. {
  30. PID_VALID,
  31. PID_INVALID,
  32. PID_INVALID_FOR_BATCH
  33. } PID3_RESULT;
  34. typedef struct _OOBE_LOCALE_INFO {
  35. PWSTR Name;
  36. DWORD Id;
  37. BOOL Installed;
  38. } OOBE_LOCALE_INFO, *POOBE_LOCALE_INFO;
  39. DWORD
  40. WINAPI
  41. SetupOobeBnk(
  42. IN LPBYTE lpByte
  43. );
  44. typedef BOOL (WINAPI *PSETUPSETDISPLAY)(
  45. LPCTSTR lpszUnattend,
  46. LPCTSTR lpszSection,
  47. LPCTSTR lpszResolutionKey,
  48. LPCTSTR lpszRefreshKey,
  49. DWORD dwMinWidth,
  50. DWORD dwMinHeight,
  51. DWORD dwMinBits
  52. );
  53. BOOL
  54. WINAPI
  55. SetupSetDisplay(
  56. LPCTSTR lpszUnattend,
  57. LPCTSTR lpszSection,
  58. LPCTSTR lpszResolutionKey,
  59. LPCTSTR lpszRefreshKey,
  60. DWORD dwMinWidth,
  61. DWORD dwMinHeight,
  62. DWORD dwMinBits
  63. );
  64. VOID
  65. WINAPI
  66. SetupOobeInitDebugLog(
  67. );
  68. VOID
  69. WINAPI
  70. SetupOobeInitPreServices(
  71. IN BOOL DoMiniSetupStuff
  72. );
  73. VOID
  74. WINAPI
  75. SetupOobeInitPostServices(
  76. IN BOOL DoMiniSetupStuff
  77. );
  78. VOID
  79. WINAPI
  80. SetupOobeCleanup(
  81. IN BOOL DoMiniSetupStuff
  82. );
  83. BOOL
  84. WINAPI
  85. PrepareForAudit(
  86. );
  87. BOOL
  88. WINAPI
  89. SetupGetProductType(
  90. PWSTR Product,
  91. PDWORD SkuFlags
  92. );
  93. PID3_RESULT
  94. WINAPI
  95. SetupPidGen3(
  96. PWSTR Pid3,
  97. DWORD SkuFlags,
  98. PWSTR OemId,
  99. BOOL Batch,
  100. PWSTR Pid2,
  101. LPBYTE lpPid3,
  102. LPBOOL Compliance
  103. );
  104. BOOL
  105. WINAPI
  106. SetupGetLocaleOptions(
  107. IN DWORD OptionalDefault,
  108. OUT POOBE_LOCALE_INFO *ReturnList,
  109. OUT PDWORD Items,
  110. OUT PDWORD Default
  111. );
  112. BOOL
  113. WINAPI
  114. SetupGetGeoOptions(
  115. IN DWORD OptionalDefault,
  116. OUT POOBE_LOCALE_INFO *ReturnList,
  117. OUT PDWORD Items,
  118. OUT PDWORD Default
  119. );
  120. BOOL
  121. WINAPI
  122. SetupGetKeyboardOptions(
  123. IN DWORD OptionalDefault,
  124. OUT POOBE_LOCALE_INFO *ReturnList,
  125. OUT PDWORD Items,
  126. OUT PDWORD Default
  127. );
  128. VOID
  129. WINAPI
  130. SetupDestroyLanguageList(
  131. IN POOBE_LOCALE_INFO LanguageList,
  132. IN DWORD Count
  133. );
  134. BOOL
  135. WINAPI
  136. SetupSetIntlOptions(
  137. DWORD LocationIndex,
  138. DWORD LanguageIndex,
  139. DWORD KeyboardIndex
  140. );
  141. PTSTR
  142. WINAPI
  143. SetupReadPhoneList(
  144. PWSTR PhoneInfName
  145. );
  146. VOID
  147. WINAPI
  148. SetupDestroyPhoneList(
  149. );
  150. VOID
  151. SetupMapTapiToIso (
  152. IN PWSTR PhoneInfName,
  153. IN DWORD dwCountryID,
  154. OUT PWSTR szIsoCode
  155. );
  156. BOOL
  157. WINAPI
  158. SetupGetSetupInfo(
  159. PWSTR Name, OPTIONAL
  160. DWORD cbName,
  161. PWSTR Org, OPTIONAL
  162. DWORD cbOrg,
  163. PWSTR OemId, OPTIONAL
  164. DWORD cbOemId,
  165. LPBOOL IntlSet OPTIONAL
  166. );
  167. BOOL
  168. WINAPI
  169. SetupSetSetupInfo(
  170. PCWSTR Name,
  171. PCWSTR Org
  172. );
  173. BOOL
  174. WINAPI
  175. SetupSetAdminPassword(
  176. PCWSTR OldPassword,
  177. PCWSTR NewPassword
  178. );
  179. BOOL
  180. CreateLocalUserAccount(
  181. IN PCWSTR UserName,
  182. IN PCWSTR Password,
  183. IN PSID* PointerToUserSid OPTIONAL
  184. );
  185. NTSTATUS
  186. CreateLocalAdminAccount(
  187. IN PCWSTR UserName,
  188. IN PCWSTR Password,
  189. IN PSID* PointerToUserSid OPTIONAL
  190. );
  191. NTSTATUS
  192. CreateLocalAdminAccountEx(
  193. IN PCWSTR UserName,
  194. IN PCWSTR Password,
  195. IN PCWSTR Description,
  196. OUT PSID* UserSid OPTIONAL
  197. );
  198. BOOL
  199. SetAccountsDomainSid(
  200. IN DWORD Seed,
  201. IN PCWSTR DomainName
  202. );
  203. void RunOEMExtraTasks();
  204. BOOL
  205. SystemUpdateUserProfileDirectory(
  206. IN LPTSTR szSrcUser
  207. );
  208. BOOL
  209. InvokeExternalApplicationEx(
  210. IN PCWSTR ApplicationName, OPTIONAL
  211. IN PCWSTR CommandLine,
  212. IN OUT PDWORD ExitCode, OPTIONAL
  213. IN DWORD Timeout,
  214. IN BOOL Hidden
  215. );
  216. VOID
  217. pSetupDebugPrint(
  218. PWSTR FileName,
  219. ULONG LineNumber,
  220. PWSTR TagStr,
  221. PWSTR FormatStr,
  222. ...
  223. );
  224. BOOL
  225. SetupStartService(
  226. IN PCWSTR ServiceName,
  227. IN BOOLEAN Wait
  228. );
  229. DWORD
  230. SetupChangeLocale(
  231. IN HWND Window,
  232. IN LCID NewLocale
  233. );
  234. BOOL
  235. SetupExtendPartition(
  236. IN WCHAR DriveLetter,
  237. IN ULONG SizeMB OPTIONAL
  238. );
  239. DWORD
  240. SetupInstallCatalog(
  241. IN LPCWSTR DecompressedName
  242. );
  243. BOOL
  244. SetupShellSettings(
  245. LPCWSTR lpszUnattend,
  246. LPCWSTR lpszSection
  247. );
  248. BOOL
  249. SetupIEHardeningSettings(
  250. LPCWSTR lpszUnattend,
  251. LPCWSTR lpszSection
  252. );
  253. DWORD
  254. SetupAddOrRemoveTestCertificate(
  255. IN PCWSTR TestCertName, OPTIONAL
  256. IN HINF InfToUse OPTIONAL
  257. );
  258. DWORD
  259. SetupChangeLocaleEx(
  260. IN HWND Window,
  261. IN LCID NewLocale,
  262. IN PCWSTR SourcePath, OPTIONAL
  263. IN DWORD Flags,
  264. IN PVOID Reserved1,
  265. IN DWORD Reserved2
  266. );
  267. //
  268. // Mode values for SetupGetInstallMode... these are unique.
  269. //
  270. typedef enum
  271. {
  272. SETUP_MODE_NONE, // Not in OS Setup
  273. SETUP_MODE_SETUP, // Base OS Setup
  274. SETUP_MODE_MINI, // Mini-Setup (OEM)
  275. SETUP_MODE_OOBE, // Out of Box Experience
  276. SETUP_MODE_AUDIT // Audit mode (OEM)
  277. };
  278. //
  279. // State flags for SetupGetInstallMode... these may be OR'd together.
  280. //
  281. #define SETUP_FLAG_OEM 0x00000001 // OEM installation
  282. #define SETUP_FLAG_UNATTENDED 0x00000002 // Unattended install
  283. #define SETUP_FLAG_DELAYPNP 0x00000004 // Plug and Play has been delayed
  284. //
  285. // API to determine phase and/or behaviors of OS installation...
  286. //
  287. BOOL
  288. SetupGetInstallMode(
  289. OUT LPDWORD lpdwMode,
  290. OUT LPDWORD lpdwFlags
  291. );
  292. #define SP_INSTALL_FILES_QUIETLY 0x00000001
  293. DWORD
  294. SetupChangeFontSize(
  295. IN HWND Window,
  296. IN PCWSTR SizeSpec
  297. );
  298. //
  299. // ACL flags. These may be ORed.
  300. //
  301. // SETUP_APPLYACL_PHASE1 indicates whether the Phase1 of ApplyAcls is to be
  302. // executed. If this flag is set then ApplyAcls() will set ACLs to the
  303. // Default hive only. If this flag is not set (Phase2), then ApplyAcls()
  304. // will set ACLs to system files and to all registry keys other than the
  305. // Default hive.
  306. //
  307. // SETUP_APPLYACL_UPGRADE indicates whether ApplyAcls() was invoked on during
  308. // a clean install or upgrade.
  309. //
  310. #define SETUP_APPLYACL_PHASE1 0x00000001
  311. #define SETUP_APPLYACL_UPGRADE 0x00000002
  312. DWORD
  313. ApplyAcls(
  314. IN HWND OwnerWindow,
  315. IN PCWSTR PermissionsInfFileName,
  316. IN DWORD Flags,
  317. IN PVOID Reserved
  318. );
  319. BOOL
  320. SetupCreateOptionalComponentsPage(
  321. IN LPFNADDPROPSHEETPAGE AddPageCallback,
  322. IN LPARAM Context
  323. );
  324. typedef
  325. HWND
  326. (WINAPI *SETUP_SHOWHIDEWIZARDPAGE)(
  327. IN BOOL bShow
  328. );
  329. typedef
  330. LRESULT
  331. (WINAPI *SETUP_BILLBOARD_PROGRESS_CALLBACK)(
  332. IN UINT Msg,
  333. IN WPARAM wParam,
  334. IN LPARAM lParam
  335. );
  336. typedef
  337. VOID
  338. (WINAPI *SETUP_BILLBOARD_SET_PROGRESS_TEXT)(
  339. IN PCWSTR Text
  340. );
  341. //
  342. // Define structure used by base and net setups to communicate
  343. // with each other.
  344. //
  345. typedef struct _INTERNAL_SETUP_DATA {
  346. //
  347. // Structure validity test
  348. //
  349. DWORD dwSizeOf;
  350. //
  351. // Custom, typical, laptop, minimal
  352. //
  353. DWORD SetupMode;
  354. //
  355. // Workstation, pdc, bdc, standalone
  356. //
  357. DWORD ProductType;
  358. //
  359. // Upgrade, unattended, etc.
  360. //
  361. DWORD OperationFlags;
  362. //
  363. // Title net setup wizard is supposed to use.
  364. //
  365. PCWSTR WizardTitle;
  366. //
  367. // Installation source path.
  368. //
  369. PCWSTR SourcePath;
  370. //
  371. // If SETUPOPER_BATCH is set, this is the fully qualified
  372. // path of the unattend file.
  373. //
  374. PCWSTR UnattendFile;
  375. //
  376. // Installation source path to be used by legacy infs, etc.
  377. // This path has the platform-specific dir stuck on the end
  378. // because that's the way old-style infs and code expected it.
  379. //
  380. PCWSTR LegacySourcePath;
  381. //
  382. // The following generic data fields contain information that is
  383. // specific to the particular callout being made by Windows NT
  384. // Setup.
  385. //
  386. DWORD CallSpecificData1;
  387. DWORD CallSpecificData2;
  388. //
  389. // Routine to tell the wizard to show or hide
  390. // Only has effect if the billboard is shown
  391. //
  392. SETUP_SHOWHIDEWIZARDPAGE ShowHideWizardPage;
  393. //
  394. // Routine to call into to the the progress feedback
  395. // to the billboard.
  396. //
  397. SETUP_BILLBOARD_PROGRESS_CALLBACK BillboardProgressCallback;
  398. //
  399. // Routine which tells setup what string to display for the progress bar.
  400. //
  401. SETUP_BILLBOARD_SET_PROGRESS_TEXT BillBoardSetProgressText;
  402. } INTERNAL_SETUP_DATA, *PINTERNAL_SETUP_DATA;
  403. typedef CONST INTERNAL_SETUP_DATA *PCINTERNAL_SETUP_DATA;
  404. //
  405. // Setup mode (custom, typical, laptop, etc)
  406. // Do not change these values; the bit values are used with infs.
  407. // Used for SetupMode in INTERNAL_SETUP_DATA structure.
  408. //
  409. #define SETUPMODE_MINIMAL 0
  410. #define SETUPMODE_TYPICAL 1
  411. #define SETUPMODE_LAPTOP 2
  412. #define SETUPMODE_CUSTOM 3
  413. //
  414. // Operation flags. These may be or'ed together in some cases.
  415. // Used for OperationFlags in INTERNAL_SETUP_DATA structure.
  416. //
  417. #define SETUPOPER_WIN31UPGRADE 0x00000001
  418. #define SETUPOPER_WIN95UPGRADE 0x00000002
  419. #define SETUPOPER_NTUPGRADE 0x00000004
  420. #define SETUPOPER_BATCH 0x00000008
  421. #define SETUPOPER_POSTSYSINSTALL 0x00000010
  422. #define SETUPOPER_PREINSTALL 0x00000020
  423. #define SETUPOPER_MINISETUP 0x00000040
  424. #define SETUPOPER_ALLPLATFORM_AVAIL 0x00008000
  425. #define SETUPOPER_NETINSTALLED 0x00010000
  426. #define SETUPOPER_INTERNETSERVER 0x00020000
  427. //
  428. // Product type flags.
  429. // Used for ProductType in INTERNAL_SETUP_DATA structure.
  430. //
  431. // Note that the flags are carefully constructed such that
  432. // if bit 0 is set, it's a DC.
  433. //
  434. #define PRODUCT_WORKSTATION 0
  435. #define PRODUCT_SERVER_PRIMARY 1
  436. #define PRODUCT_SERVER_SECONDARY 3
  437. #define PRODUCT_SERVER_STANDALONE 2
  438. #define ISDC(x) ((x) & 1)
  439. //
  440. // Maximum number of net setup wizard pages.
  441. //
  442. #define MAX_NETWIZ_PAGES 100
  443. //
  444. // API exported by net setup to give its wizard pages.
  445. //
  446. BOOL
  447. NetSetupRequestWizardPages(
  448. OUT HPROPSHEETPAGE *Pages,
  449. IN OUT PUINT PageCount,
  450. IN OUT PINTERNAL_SETUP_DATA SetupData
  451. );
  452. #define NETSETUPPAGEREQUESTPROCNAME "NetSetupRequestWizardPages"
  453. typedef
  454. BOOL
  455. (* NETSETUPPAGEREQUESTPROC) (
  456. OUT HPROPSHEETPAGE *Pages,
  457. OUT PUINT PageCount,
  458. IN OUT PINTERNAL_SETUP_DATA SetupData
  459. );
  460. //
  461. // API exported by net setup to allow post wizard software install
  462. //
  463. BOOL
  464. NetSetupInstallSoftware(
  465. IN HWND Window,
  466. IN OUT PINTERNAL_SETUP_DATA SetupData
  467. );
  468. #define NETSETUPINSTALLSOFTWAREPROCNAME "NetSetupInstallSoftware"
  469. typedef
  470. BOOL
  471. (* NETSETUPINSTALLSOFTWAREPROC) (
  472. IN HWND Window,
  473. IN OUT PINTERNAL_SETUP_DATA SetupData
  474. );
  475. //
  476. // API exported by net setup to allow final setup operations (BDC replication)
  477. //
  478. BOOL
  479. NetSetupFinishInstall(
  480. IN HWND Window,
  481. IN OUT PINTERNAL_SETUP_DATA SetupData
  482. );
  483. #define NETSETUPFINISHINSTALLPROCNAME "NetSetupFinishInstall"
  484. typedef
  485. BOOL
  486. (* NETSETUPFINISHINSTALLPROC) (
  487. IN HWND Window,
  488. IN OUT PINTERNAL_SETUP_DATA SetupData
  489. );
  490. //
  491. // API exported by printer setup to upgrade printer drivers
  492. //
  493. DWORD
  494. NtPrintUpgradePrinters(
  495. IN HWND Window,
  496. IN PCINTERNAL_SETUP_DATA SetupData
  497. );
  498. #define UPGRADEPRINTERSPROCNAME ((LPCSTR)1)
  499. typedef
  500. DWORD
  501. (* UPGRADEPRINTERSPROC) (
  502. IN HWND Window,
  503. IN PCINTERNAL_SETUP_DATA SetupData
  504. );
  505. //
  506. // API exported by syspnp.c to update device drivers
  507. //
  508. BOOL
  509. UpdatePnpDeviceDrivers(
  510. );
  511. #ifdef __cplusplus
  512. }
  513. #endif
  514. #endif // def _WINNT_SYSSETUP_