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.

590 lines
11 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. LPWSTR lpszUnattend,
  246. LPWSTR lpszSection
  247. );
  248. DWORD
  249. SetupAddOrRemoveTestCertificate(
  250. IN PCWSTR TestCertName, OPTIONAL
  251. IN HINF InfToUse OPTIONAL
  252. );
  253. DWORD
  254. SetupChangeLocaleEx(
  255. IN HWND Window,
  256. IN LCID NewLocale,
  257. IN PCWSTR SourcePath, OPTIONAL
  258. IN DWORD Flags,
  259. IN PVOID Reserved1,
  260. IN DWORD Reserved2
  261. );
  262. #define SP_INSTALL_FILES_QUIETLY 0x00000001
  263. DWORD
  264. SetupChangeFontSize(
  265. IN HWND Window,
  266. IN PCWSTR SizeSpec
  267. );
  268. //
  269. // ACL flags. These may be ORed.
  270. //
  271. // SETUP_APPLYACL_PHASE1 indicates whether the Phase1 of ApplyAcls is to be
  272. // executed. If this flag is set then ApplyAcls() will set ACLs to the
  273. // Default hive only. If this flag is not set (Phase2), then ApplyAcls()
  274. // will set ACLs to system files and to all registry keys other than the
  275. // Default hive.
  276. //
  277. // SETUP_APPLYACL_UPGRADE indicates whether ApplyAcls() was invoked on during
  278. // a clean install or upgrade.
  279. //
  280. #define SETUP_APPLYACL_PHASE1 0x00000001
  281. #define SETUP_APPLYACL_UPGRADE 0x00000002
  282. DWORD
  283. ApplyAcls(
  284. IN HWND OwnerWindow,
  285. IN PCWSTR PermissionsInfFileName,
  286. IN DWORD Flags,
  287. IN PVOID Reserved
  288. );
  289. BOOL
  290. SetupCreateOptionalComponentsPage(
  291. IN LPFNADDPROPSHEETPAGE AddPageCallback,
  292. IN LPARAM Context
  293. );
  294. typedef
  295. HWND
  296. (WINAPI *SETUP_SHOWHIDEWIZARDPAGE)(
  297. IN BOOL bShow
  298. );
  299. typedef
  300. LRESULT
  301. (WINAPI *SETUP_BILLBOARD_PROGRESS_CALLBACK)(
  302. IN UINT Msg,
  303. IN WPARAM wParam,
  304. IN LPARAM lParam
  305. );
  306. typedef
  307. VOID
  308. (WINAPI *SETUP_BILLBOARD_SET_PROGRESS_TEXT)(
  309. IN PCWSTR Text
  310. );
  311. //
  312. // Define structure used by base and net setups to communicate
  313. // with each other.
  314. //
  315. typedef struct _INTERNAL_SETUP_DATA {
  316. //
  317. // Structure validity test
  318. //
  319. DWORD dwSizeOf;
  320. //
  321. // Custom, typical, laptop, minimal
  322. //
  323. DWORD SetupMode;
  324. //
  325. // Workstation, pdc, bdc, standalone
  326. //
  327. DWORD ProductType;
  328. //
  329. // Upgrade, unattended, etc.
  330. //
  331. DWORD OperationFlags;
  332. //
  333. // Title net setup wizard is supposed to use.
  334. //
  335. PCWSTR WizardTitle;
  336. //
  337. // Installation source path.
  338. //
  339. PCWSTR SourcePath;
  340. //
  341. // If SETUPOPER_BATCH is set, this is the fully qualified
  342. // path of the unattend file.
  343. //
  344. PCWSTR UnattendFile;
  345. //
  346. // Installation source path to be used by legacy infs, etc.
  347. // This path has the platform-specific dir stuck on the end
  348. // because that's the way old-style infs and code expected it.
  349. //
  350. PCWSTR LegacySourcePath;
  351. //
  352. // The following generic data fields contain information that is
  353. // specific to the particular callout being made by Windows NT
  354. // Setup.
  355. //
  356. DWORD CallSpecificData1;
  357. DWORD CallSpecificData2;
  358. //
  359. // Routine to tell the wizard to show or hide
  360. // Only has effect if the billboard is shown
  361. //
  362. SETUP_SHOWHIDEWIZARDPAGE ShowHideWizardPage;
  363. //
  364. // Routine to call into to the the progress feedback
  365. // to the billboard.
  366. //
  367. SETUP_BILLBOARD_PROGRESS_CALLBACK BillboardProgressCallback;
  368. //
  369. // Routine which tells setup what string to display for the progress bar.
  370. //
  371. SETUP_BILLBOARD_SET_PROGRESS_TEXT BillBoardSetProgressText;
  372. } INTERNAL_SETUP_DATA, *PINTERNAL_SETUP_DATA;
  373. typedef CONST INTERNAL_SETUP_DATA *PCINTERNAL_SETUP_DATA;
  374. //
  375. // Setup mode (custom, typical, laptop, etc)
  376. // Do not change these values; the bit values are used with infs.
  377. // Used for SetupMode in INTERNAL_SETUP_DATA structure.
  378. //
  379. #define SETUPMODE_MINIMAL 0
  380. #define SETUPMODE_TYPICAL 1
  381. #define SETUPMODE_LAPTOP 2
  382. #define SETUPMODE_CUSTOM 3
  383. //
  384. // Operation flags. These may be or'ed together in some cases.
  385. // Used for OperationFlags in INTERNAL_SETUP_DATA structure.
  386. //
  387. #define SETUPOPER_WIN31UPGRADE 0x00000001
  388. #define SETUPOPER_WIN95UPGRADE 0x00000002
  389. #define SETUPOPER_NTUPGRADE 0x00000004
  390. #define SETUPOPER_BATCH 0x00000008
  391. #define SETUPOPER_POSTSYSINSTALL 0x00000010
  392. #define SETUPOPER_PREINSTALL 0x00000020
  393. #define SETUPOPER_MINISETUP 0x00000040
  394. #define SETUPOPER_ALLPLATFORM_AVAIL 0x00008000
  395. #define SETUPOPER_NETINSTALLED 0x00010000
  396. #define SETUPOPER_INTERNETSERVER 0x00020000
  397. //
  398. // Product type flags.
  399. // Used for ProductType in INTERNAL_SETUP_DATA structure.
  400. //
  401. // Note that the flags are carefully constructed such that
  402. // if bit 0 is set, it's a DC.
  403. //
  404. #define PRODUCT_WORKSTATION 0
  405. #define PRODUCT_SERVER_PRIMARY 1
  406. #define PRODUCT_SERVER_SECONDARY 3
  407. #define PRODUCT_SERVER_STANDALONE 2
  408. #define ISDC(x) ((x) & 1)
  409. //
  410. // Maximum number of net setup wizard pages.
  411. //
  412. #define MAX_NETWIZ_PAGES 100
  413. //
  414. // API exported by net setup to give its wizard pages.
  415. //
  416. BOOL
  417. NetSetupRequestWizardPages(
  418. OUT HPROPSHEETPAGE *Pages,
  419. IN OUT PUINT PageCount,
  420. IN OUT PINTERNAL_SETUP_DATA SetupData
  421. );
  422. #define NETSETUPPAGEREQUESTPROCNAME "NetSetupRequestWizardPages"
  423. typedef
  424. BOOL
  425. (* NETSETUPPAGEREQUESTPROC) (
  426. OUT HPROPSHEETPAGE *Pages,
  427. OUT PUINT PageCount,
  428. IN OUT PINTERNAL_SETUP_DATA SetupData
  429. );
  430. //
  431. // API exported by net setup to allow post wizard software install
  432. //
  433. BOOL
  434. NetSetupInstallSoftware(
  435. IN HWND Window,
  436. IN OUT PINTERNAL_SETUP_DATA SetupData
  437. );
  438. #define NETSETUPINSTALLSOFTWAREPROCNAME "NetSetupInstallSoftware"
  439. typedef
  440. BOOL
  441. (* NETSETUPINSTALLSOFTWAREPROC) (
  442. IN HWND Window,
  443. IN OUT PINTERNAL_SETUP_DATA SetupData
  444. );
  445. //
  446. // API exported by net setup to allow final setup operations (BDC replication)
  447. //
  448. BOOL
  449. NetSetupFinishInstall(
  450. IN HWND Window,
  451. IN OUT PINTERNAL_SETUP_DATA SetupData
  452. );
  453. #define NETSETUPFINISHINSTALLPROCNAME "NetSetupFinishInstall"
  454. typedef
  455. BOOL
  456. (* NETSETUPFINISHINSTALLPROC) (
  457. IN HWND Window,
  458. IN OUT PINTERNAL_SETUP_DATA SetupData
  459. );
  460. //
  461. // API exported by printer setup to upgrade printer drivers
  462. //
  463. DWORD
  464. NtPrintUpgradePrinters(
  465. IN HWND Window,
  466. IN PCINTERNAL_SETUP_DATA SetupData
  467. );
  468. #define UPGRADEPRINTERSPROCNAME ((LPCSTR)1)
  469. typedef
  470. DWORD
  471. (* UPGRADEPRINTERSPROC) (
  472. IN HWND Window,
  473. IN PCINTERNAL_SETUP_DATA SetupData
  474. );
  475. //
  476. // API exported by syspnp.c to update device drivers
  477. //
  478. BOOL
  479. UpdatePnpDeviceDrivers(
  480. );
  481. #ifdef __cplusplus
  482. }
  483. #endif
  484. #endif // def _WINNT_SYSSETUP_