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.

631 lines
15 KiB

  1. #ifndef _SETUPBLK_
  2. #define _SETUPBLK_
  3. //
  4. // Filetypes for files in txtsetup.oem.
  5. //
  6. typedef enum {
  7. HwFileDriver,
  8. HwFilePort,
  9. HwFileClass,
  10. HwFileInf,
  11. HwFileDll,
  12. HwFileDetect,
  13. HwFileHal,
  14. HwFileCatalog,
  15. HwFileMax,
  16. HwFileDynUpdt = 31
  17. } HwFileType;
  18. #define FILETYPE(FileType) (1 << (FileType))
  19. #define SET_FILETYPE_PRESENT(BitArray,FileType) ((BitArray) |= FILETYPE(FileType))
  20. #define IS_FILETYPE_PRESENT(BitArray,FileType) ((BitArray) & FILETYPE(FileType))
  21. //
  22. // Registry data types for registry data in txtsetup.oem.
  23. //
  24. typedef enum {
  25. HwRegistryDword,
  26. HwRegistryBinary,
  27. HwRegistrySz,
  28. HwRegistryExpandSz,
  29. HwRegistryMultiSz,
  30. HwRegistryMax
  31. } HwRegistryType;
  32. //
  33. // Component types.
  34. //
  35. typedef enum {
  36. HwComponentComputer,
  37. HwComponentDisplay,
  38. HwComponentKeyboard,
  39. HwComponentLayout,
  40. HwComponentMouse,
  41. HwComponentMax
  42. } HwComponentType;
  43. typedef struct _PNP_HARDWARE_ID {
  44. struct _PNP_HARDWARE_ID *Next;
  45. //
  46. // String that represents the hardware id of a PNP device.
  47. //
  48. PCHAR Id;
  49. //
  50. // Driver for the device
  51. //
  52. PCHAR DriverName;
  53. //
  54. // GUID for this device, if any
  55. //
  56. PCHAR ClassGuid;
  57. } PNP_HARDWARE_ID, *PPNP_HARDWARE_ID;
  58. typedef struct _DETECTED_DEVICE_REGISTRY {
  59. struct _DETECTED_DEVICE_REGISTRY *Next;
  60. //
  61. // The name of the key. The empty string means the key in the
  62. // services key itself.
  63. //
  64. PCHAR KeyName;
  65. //
  66. // The name of the value within the registry key
  67. //
  68. PCHAR ValueName;
  69. //
  70. // The data type for the value (ie, REG_DWORD, etc)
  71. //
  72. ULONG ValueType;
  73. //
  74. // The buffer containing the data to be placed into the value.
  75. // If the ValueType is REG_SZ, then Buffer should point to
  76. // a nul-terminated ASCII string (ie, not unicode), and BufferSize
  77. // should be the length in bytes of that string (plus 1 for the nul).
  78. //
  79. PVOID Buffer;
  80. //
  81. // The size of the buffer in bytes
  82. //
  83. ULONG BufferSize;
  84. } DETECTED_DEVICE_REGISTRY, *PDETECTED_DEVICE_REGISTRY;
  85. //
  86. // One of these will be created for each file to be copied for a
  87. // third party device.
  88. //
  89. typedef struct _DETECTED_DEVICE_FILE {
  90. struct _DETECTED_DEVICE_FILE *Next;
  91. //
  92. // Filename of the file.
  93. //
  94. PCHAR Filename;
  95. //
  96. // type of the file (hal, port, class, etc).
  97. //
  98. HwFileType FileType;
  99. //
  100. // Part of name of the section in txtsetup.oem [Config.<ConfigName>]
  101. // that contains registry options. If this is NULL, then no registry
  102. // information is associated with this file.
  103. //
  104. PCHAR ConfigName;
  105. //
  106. // Registry values for the node in the services list in the registry.
  107. //
  108. PDETECTED_DEVICE_REGISTRY RegistryValueList;
  109. //
  110. // These two fields are used when prompting for the diskette
  111. // containing the third-party-supplied driver's files.
  112. //
  113. PTCHAR DiskDescription;
  114. PCHAR DiskTagfile;
  115. //
  116. // Directory where files are to be found on the disk.
  117. //
  118. PCHAR Directory;
  119. //
  120. // Arc device name from which this file was loaded
  121. //
  122. PCHAR ArcDeviceName;
  123. } DETECTED_DEVICE_FILE, *PDETECTED_DEVICE_FILE;
  124. //
  125. // structure for storing information about a driver we have located and
  126. // will install.
  127. //
  128. typedef struct _DETECTED_DEVICE {
  129. struct _DETECTED_DEVICE *Next;
  130. //
  131. // String used as a key into the relevent section (like [Display],
  132. // [Mouse], etc).
  133. //
  134. PCHAR IdString;
  135. //
  136. // 0-based order that this driver is listed in txtsetup.sif.
  137. // (ULONG)-1 for unsupported (ie, third party) scsi devices.
  138. //
  139. ULONG Ordinal;
  140. //
  141. // String that describes the hardware.
  142. //
  143. PTCHAR Description;
  144. //
  145. // If this is TRUE, then there is an OEM option selected for this
  146. // hardware.
  147. //
  148. BOOLEAN ThirdPartyOptionSelected;
  149. //
  150. // Bits to be set if a third party option is selected, indicating
  151. // which type of files are specified in the oem inf file.
  152. //
  153. ULONG FileTypeBits;
  154. //
  155. // Files for a third party option.
  156. //
  157. PDETECTED_DEVICE_FILE Files;
  158. //
  159. // For first party files loaded by the boot loader,
  160. // this value will be the "BaseDllName" -- ie, the filename
  161. // part only of the file from which the driver was loaded.
  162. //
  163. // This field is only filled in in certain cases, so be careful
  164. // when using it. See ntos\boot\setup\setup.c. (Always filled in
  165. // for SCSI devices.)
  166. //
  167. PCHAR BaseDllName;
  168. //
  169. // If this is TRUE, then there is a migrated driver for this
  170. // hardware.
  171. //
  172. BOOLEAN MigratedDriver;
  173. //
  174. // Device's PNP hardware IDs (if any)
  175. //
  176. PPNP_HARDWARE_ID HardwareIds;
  177. } DETECTED_DEVICE, *PDETECTED_DEVICE;
  178. //
  179. // Virtual OEM source devices (containing F6 drivers)
  180. //
  181. typedef struct _DETECTED_OEM_SOURCE_DEVICE *PDETECTED_OEM_SOURCE_DEVICE;
  182. typedef struct _DETECTED_OEM_SOURCE_DEVICE {
  183. PDETECTED_OEM_SOURCE_DEVICE Next;
  184. PSTR ArcDeviceName;
  185. PVOID ImageBase;
  186. ULONGLONG ImageSize;
  187. } DETECTED_OEM_SOURCE_DEVICE;
  188. //
  189. // Name of txtsetup.oem
  190. //
  191. #define TXTSETUP_OEM_FILENAME "txtsetup.oem"
  192. #define TXTSETUP_OEM_FILENAME_U L"txtsetup.oem"
  193. //
  194. // Name of sections in txtsetup.oem. These are not localized.
  195. //
  196. #define TXTSETUP_OEM_DISKS "Disks"
  197. #define TXTSETUP_OEM_DISKS_U L"Disks"
  198. #define TXTSETUP_OEM_DEFAULTS "Defaults"
  199. #define TXTSETUP_OEM_DEFAULTS_U L"Defaults"
  200. //
  201. // Available names of components in the defaults sections
  202. //
  203. #define TXTSETUP_OEM_DEFAULTS_COMPUTER "computer"
  204. #define TXTSETUP_OEM_DEFAULTS_COMPUTER_U L"computer"
  205. #define TXTSETUP_OEM_DEFAULTS_SCSI "scsi"
  206. #define TXTSETUP_OEM_DEFAULTS_SCSI_U L"scsi"
  207. //
  208. // Field offsets in txtsetup.oem
  209. //
  210. // in [Disks] section
  211. #define OINDEX_DISKDESCR 0
  212. #define OINDEX_TAGFILE 1
  213. #define OINDEX_DIRECTORY 2
  214. // in [Defaults] section
  215. #define OINDEX_DEFAULT 0
  216. // in [<component_name>] section (ie, [keyboard])
  217. #define OINDEX_DESCRIPTION 0
  218. // in [Files.<compoment_name>.<id>] section (ie, [Files.Keyboard.Oem1])
  219. #define OINDEX_DISKSPEC 0
  220. #define OINDEX_FILENAME 1
  221. #define OINDEX_CONFIGNAME 2
  222. // in [Config.<compoment_name>.<id>] section (ie, [Config.Keyboard.Oem1])
  223. #define OINDEX_KEYNAME 0
  224. #define OINDEX_VALUENAME 1
  225. #define OINDEX_VALUETYPE 2
  226. #define OINDEX_FIRSTVALUE 3
  227. // in [HardwareIds.<compoment_name>.<id>] section (ie, [HardwareIds.Keyboard.Oem1])
  228. #define OINDEX_HW_ID 0
  229. #define OINDEX_DRIVER_NAME 1
  230. #define OINDEX_CLASS_GUID 2
  231. typedef enum {
  232. SetupOperationSetup,
  233. SetupOperationUpgrade,
  234. SetupOperationRepair
  235. } SetupOperation;
  236. typedef struct _SETUP_LOADER_BLOCK_SCALARS {
  237. //
  238. // This value indicates the operation we are performing
  239. // as chosen by the user or discovered by setupldr.
  240. //
  241. unsigned SetupOperation;
  242. //
  243. // In some cases we will ask the user whether he wants
  244. // a CD-ROM or floppy-based installation. This flag
  245. // indicates whether he chose a CD-ROM setup.
  246. //
  247. unsigned SetupFromCdRom : 1;
  248. //
  249. // If this flag is set, then setupldr loaded scsi miniport drivers
  250. // and the scsi class drivers we may need (scsidisk, scsicdrm, scsiflop).
  251. //
  252. unsigned LoadedScsi : 1;
  253. //
  254. // If this flag is set, then setupldr loaded non-scsi floppy class drivers
  255. // (ie, floppy.sys) and fastfat.sys.
  256. //
  257. unsigned LoadedFloppyDrivers : 1;
  258. //
  259. // If this flag is set, then setupldr loaded non-scsi disk class drivers
  260. // (ie, atdisk, abiosdsk, delldsa, cpqarray) and filesystems (fat, hpfs, ntfs).
  261. //
  262. unsigned LoadedDiskDrivers : 1;
  263. //
  264. // If this flag is set, then setupldr loaded non-scsi cdrom class drivers
  265. // (currently there are none) and cdfs.
  266. //
  267. unsigned LoadedCdRomDrivers : 1;
  268. //
  269. // If this flag is set, then setupldr loaded all filesystems listed
  270. // in [FileSystems], on txtsetup.sif.
  271. //
  272. unsigned LoadedFileSystems : 1;
  273. } SETUP_LOADER_BLOCK_SCALARS, *PSETUP_LOADER_BLOCK_SCALARS;
  274. //
  275. // Purely arbitrary, but all net boot components enforce this. The only
  276. // problem is if a detected Hal name is greater than this, things get ugly if
  277. // the first MAX_HAL_NAME_LENGTH characters are identical for two different hals.
  278. // NOTE: If you change this, change the definition in private\sm\server\smsrvp.h
  279. // NOTE: If you change this, change the definition in private\inc\oscpkt.h
  280. //
  281. #define MAX_HAL_NAME_LENGTH 30
  282. //
  283. // This definition must match the OSC_ADMIN_PASSWORD_LEN definition in oscpkt.h
  284. // We just define it here to avoid having to drag in oscpkt.h in every location
  285. // that uses setupblk.h
  286. //
  287. #define NETBOOT_ADMIN_PASSWORD_LEN 64
  288. typedef struct _SETUP_LOADER_BLOCK {
  289. //
  290. // ARC path to the Setup source media.
  291. // The Setup boot media path is given by the
  292. // ArcBootDeviceName field in the loader block itself.
  293. //
  294. PCHAR ArcSetupDeviceName;
  295. //
  296. // Detected/loaded video device.
  297. //
  298. DETECTED_DEVICE VideoDevice;
  299. //
  300. // Detected/loaded keyboard device.
  301. //
  302. PDETECTED_DEVICE KeyboardDevices;
  303. //
  304. // Detected computer type.
  305. //
  306. DETECTED_DEVICE ComputerDevice;
  307. //
  308. // Detected/loaded scsi adapters. This is a linked list
  309. // because there could be multiple adapters.
  310. //
  311. PDETECTED_DEVICE ScsiDevices;
  312. //
  313. // Detected virtual OEM source devices
  314. //
  315. PDETECTED_OEM_SOURCE_DEVICE OemSourceDevices;
  316. //
  317. // Non-pointer values.
  318. //
  319. SETUP_LOADER_BLOCK_SCALARS ScalarValues;
  320. //
  321. // Pointer to the txtsetup.sif file loaded by setupldr
  322. //
  323. PCHAR IniFile;
  324. ULONG IniFileLength;
  325. //
  326. // Pointer to the winnt.sif file loaded by setupldr
  327. //
  328. PCHAR WinntSifFile;
  329. ULONG WinntSifFileLength;
  330. //
  331. // Pointer to the migrate.inf file loaded by setupldr
  332. //
  333. PCHAR MigrateInfFile;
  334. ULONG MigrateInfFileLength;
  335. //
  336. // Pointer to the unsupdrv.inf file loaded by setupldr
  337. //
  338. PCHAR UnsupDriversInfFile;
  339. ULONG UnsupDriversInfFileLength;
  340. //
  341. // Bootfont.bin file image loaded by setupldr
  342. //
  343. PVOID BootFontFile;
  344. ULONG BootFontFileLength;
  345. // On non-vga displays, setupldr looks in the firmware config tree
  346. // for the monitor peripheral that should be a child of the
  347. // display controller for the display being used during installation.
  348. // It copies its monitor configuration data to allow setup to
  349. // set the mode properly later.
  350. //
  351. PMONITOR_CONFIGURATION_DATA Monitor;
  352. PCHAR MonitorId;
  353. #ifdef _ALPHA_
  354. //
  355. // if alpha, then we need to know if the user supplied an OEM PAL disk
  356. //
  357. PDETECTED_DEVICE OemPal;
  358. #endif
  359. //
  360. // Loaded boot bus extenders
  361. //
  362. PDETECTED_DEVICE BootBusExtenders;
  363. //
  364. // Loaded bus extenders
  365. //
  366. PDETECTED_DEVICE BusExtenders;
  367. //
  368. // Loaded support drivers for input devices
  369. //
  370. PDETECTED_DEVICE InputDevicesSupport;
  371. //
  372. // This is a linked list that the contains the hardware id database,
  373. // that will be used during the initialization phase of textmode
  374. // setup (setupdd.sys)
  375. //
  376. PPNP_HARDWARE_ID HardwareIdDatabase;
  377. //
  378. // Remote boot information.
  379. //
  380. WCHAR ComputerName[64];
  381. ULONG IpAddress;
  382. ULONG SubnetMask;
  383. ULONG ServerIpAddress;
  384. ULONG DefaultRouter;
  385. ULONG DnsNameServer;
  386. //
  387. // The PCI hardware ID we got from the ROM of the netboot card
  388. // ("PCI\VEN_xxx...").
  389. //
  390. WCHAR NetbootCardHardwareId[64];
  391. //
  392. // The name of the netboot card driver ("abc.sys").
  393. //
  394. WCHAR NetbootCardDriverName[24];
  395. //
  396. // The name of the netboot card service key in the registry.
  397. //
  398. WCHAR NetbootCardServiceName[24];
  399. #if defined(REMOTE_BOOT)
  400. //
  401. // The inbound SPI, outbound SPI, and session key for the
  402. // IPSEC conversation with the server.
  403. //
  404. ULONG IpsecInboundSpi;
  405. ULONG IpsecOutboundSpi;
  406. ULONG IpsecSessionKey;
  407. #endif // defined(REMOTE_BOOT)
  408. //
  409. // If non-NULL this points to a string containing registry values to
  410. // be added for the netboot card. The string consists of a series of
  411. // name\0type\0value\0, with a final \0 at the end.
  412. //
  413. PCHAR NetbootCardRegistry;
  414. ULONG NetbootCardRegistryLength;
  415. //
  416. // If non-NULL this points to the PCI or ISAPNP information about
  417. // the netboot card.
  418. //
  419. PCHAR NetbootCardInfo;
  420. ULONG NetbootCardInfoLength;
  421. //
  422. // Various flags.
  423. //
  424. ULONG Flags;
  425. #define SETUPBLK_FLAGS_IS_REMOTE_BOOT 0x00000001
  426. #define SETUPBLK_FLAGS_IS_TEXTMODE 0x00000002
  427. #if defined(REMOTE_BOOT)
  428. #define SETUPBLK_FLAGS_REPIN 0x00000004
  429. #define SETUPBLK_FLAGS_DISABLE_CSC 0x00000008
  430. #define SETUPBLK_FLAGS_DISCONNECTED 0x00000010
  431. #define SETUPBLK_FLAGS_FORMAT_NEEDED 0x00000020
  432. #define SETUPBLK_FLAGS_IPSEC_ENABLED 0x00000040
  433. #endif // defined(REMOTE_BOOT)
  434. #define SETUPBLK_FLAGS_CONSOLE 0x00000080
  435. #if defined(REMOTE_BOOT)
  436. #define SETUPBLK_FLAGS_PIN_NET_DRIVER 0x00000100
  437. #endif // defined(REMOTE_BOOT)
  438. #define SETUPBLK_FLAGS_REMOTE_INSTALL 0x00000200
  439. #define SETUPBLK_FLAGS_SYSPREP_INSTALL 0x00000400
  440. #define SETUPBLK_XINT13_SUPPORT 0x00000800
  441. #define SETUPBLK_FLAGS_ROLLBACK 0x00001000
  442. #if defined(REMOTE_BOOT)
  443. //
  444. // HAL file name.
  445. //
  446. CHAR NetBootHalName[MAX_HAL_NAME_LENGTH + 1];
  447. #endif // defined(REMOTE_BOOT)
  448. //
  449. // During remote boot textmode setup, NtBootPath in the loader block points
  450. // to the setup source location. We also need to pass in the path to the
  451. // machine directory. This will be in the format \server\share\path.
  452. //
  453. PCHAR MachineDirectoryPath;
  454. //
  455. // Holds the name of the .sif file used by a remote boot machine
  456. // during textmode setup -- this is a temp file that needs to be
  457. // deleted. This will be in the format \server\share\path.
  458. //
  459. PCHAR NetBootSifPath;
  460. //
  461. // On a remote boot, this is information from the secret used
  462. // when the redirector logs on.
  463. //
  464. PVOID NetBootSecret;
  465. #if defined(REMOTE_BOOT)
  466. //
  467. // This indicates whether TFTP needed to use the second password in
  468. // the secret to log on (as a hint to the redirector).
  469. //
  470. BOOLEAN NetBootUsePassword2;
  471. #endif // defined(REMOTE_BOOT)
  472. //
  473. // This is the UNC path that a SysPrep installation or a machine replacement
  474. // senario is supposed to connect to find IMirror.dat
  475. //
  476. UCHAR NetBootIMirrorFilePath[260];
  477. //
  478. // Pointer to the asrpnp.sif file loaded by setupldr
  479. //
  480. PCHAR ASRPnPSifFile;
  481. ULONG ASRPnPSifFileLength;
  482. //
  483. // This is the administrator password supplied by the user during a
  484. // remote install
  485. UCHAR NetBootAdministratorPassword[NETBOOT_ADMIN_PASSWORD_LEN];
  486. } SETUP_LOADER_BLOCK, *PSETUP_LOADER_BLOCK;
  487. #endif // _SETUPBLK_