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.

640 lines
16 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. #define TXTSETUP_OEM_DEFAULTS_DRIVERLOADLIST "DriverLoadList"
  208. #define TXTSETUP_OEM_DEFAULTS_DRIVERLOADLIST_U L"DriverLoadList"
  209. //
  210. // Field offsets in txtsetup.oem
  211. //
  212. // in [Disks] section
  213. #define OINDEX_DISKDESCR 0
  214. #define OINDEX_TAGFILE 1
  215. #define OINDEX_DIRECTORY 2
  216. // in [Defaults] section
  217. #define OINDEX_DEFAULT 0
  218. // in [<component_name>] section (ie, [keyboard])
  219. #define OINDEX_DESCRIPTION 0
  220. // in [Files.<compoment_name>.<id>] section (ie, [Files.Keyboard.Oem1])
  221. #define OINDEX_DISKSPEC 0
  222. #define OINDEX_FILENAME 1
  223. #define OINDEX_CONFIGNAME 2
  224. // in [Config.<compoment_name>.<id>] section (ie, [Config.Keyboard.Oem1])
  225. #define OINDEX_KEYNAME 0
  226. #define OINDEX_VALUENAME 1
  227. #define OINDEX_VALUETYPE 2
  228. #define OINDEX_FIRSTVALUE 3
  229. // in [HardwareIds.<compoment_name>.<id>] section (ie, [HardwareIds.Keyboard.Oem1])
  230. #define OINDEX_HW_ID 0
  231. #define OINDEX_DRIVER_NAME 1
  232. #define OINDEX_CLASS_GUID 2
  233. typedef enum {
  234. SetupOperationSetup,
  235. SetupOperationUpgrade,
  236. SetupOperationRepair
  237. } SetupOperation;
  238. typedef struct _SETUP_LOADER_BLOCK_SCALARS {
  239. //
  240. // This value indicates the operation we are performing
  241. // as chosen by the user or discovered by setupldr.
  242. //
  243. unsigned SetupOperation;
  244. union {
  245. struct {
  246. //
  247. // In some cases we will ask the user whether he wants
  248. // a CD-ROM or floppy-based installation. This flag
  249. // indicates whether he chose a CD-ROM setup.
  250. //
  251. unsigned SetupFromCdRom : 1;
  252. //
  253. // If this flag is set, then setupldr loaded scsi miniport drivers
  254. // and the scsi class drivers we may need (scsidisk, scsicdrm, scsiflop).
  255. //
  256. unsigned LoadedScsi : 1;
  257. //
  258. // If this flag is set, then setupldr loaded non-scsi floppy class drivers
  259. // (ie, floppy.sys) and fastfat.sys.
  260. //
  261. unsigned LoadedFloppyDrivers : 1;
  262. //
  263. // If this flag is set, then setupldr loaded non-scsi disk class drivers
  264. // (ie, atdisk, abiosdsk, delldsa, cpqarray) and filesystems (fat, hpfs, ntfs).
  265. //
  266. unsigned LoadedDiskDrivers : 1;
  267. //
  268. // If this flag is set, then setupldr loaded non-scsi cdrom class drivers
  269. // (currently there are none) and cdfs.
  270. //
  271. unsigned LoadedCdRomDrivers : 1;
  272. //
  273. // If this flag is set, then setupldr loaded all filesystems listed
  274. // in [FileSystems], on txtsetup.sif.
  275. //
  276. unsigned LoadedFileSystems : 1;
  277. };
  278. unsigned AsULong;
  279. };
  280. } SETUP_LOADER_BLOCK_SCALARS, *PSETUP_LOADER_BLOCK_SCALARS;
  281. //
  282. // Purely arbitrary, but all net boot components enforce this. The only
  283. // problem is if a detected Hal name is greater than this, things get ugly if
  284. // the first MAX_HAL_NAME_LENGTH characters are identical for two different hals.
  285. // NOTE: If you change this, change the definition in private\sm\server\smsrvp.h
  286. // NOTE: If you change this, change the definition in private\inc\oscpkt.h
  287. //
  288. #define MAX_HAL_NAME_LENGTH 30
  289. //
  290. // This definition must match the OSC_ADMIN_PASSWORD_LEN definition in oscpkt.h
  291. // We just define it here to avoid having to drag in oscpkt.h in every location
  292. // that uses setupblk.h
  293. //
  294. #define NETBOOT_ADMIN_PASSWORD_LEN 64
  295. typedef struct _SETUP_LOADER_BLOCK {
  296. //
  297. // ARC path to the Setup source media.
  298. // The Setup boot media path is given by the
  299. // ArcBootDeviceName field in the loader block itself.
  300. //
  301. PCHAR ArcSetupDeviceName;
  302. //
  303. // Detected/loaded video device.
  304. //
  305. DETECTED_DEVICE VideoDevice;
  306. //
  307. // Detected/loaded keyboard device.
  308. //
  309. PDETECTED_DEVICE KeyboardDevices;
  310. //
  311. // Detected computer type.
  312. //
  313. DETECTED_DEVICE ComputerDevice;
  314. //
  315. // Detected/loaded scsi adapters. This is a linked list
  316. // because there could be multiple adapters.
  317. //
  318. PDETECTED_DEVICE ScsiDevices;
  319. //
  320. // Detected virtual OEM source devices
  321. //
  322. PDETECTED_OEM_SOURCE_DEVICE OemSourceDevices;
  323. //
  324. // Non-pointer values.
  325. //
  326. SETUP_LOADER_BLOCK_SCALARS ScalarValues;
  327. //
  328. // Pointer to the txtsetup.sif file loaded by setupldr
  329. //
  330. PCHAR IniFile;
  331. ULONG IniFileLength;
  332. //
  333. // Pointer to the winnt.sif file loaded by setupldr
  334. //
  335. PCHAR WinntSifFile;
  336. ULONG WinntSifFileLength;
  337. //
  338. // Pointer to the migrate.inf file loaded by setupldr
  339. //
  340. PCHAR MigrateInfFile;
  341. ULONG MigrateInfFileLength;
  342. //
  343. // Pointer to the unsupdrv.inf file loaded by setupldr
  344. //
  345. PCHAR UnsupDriversInfFile;
  346. ULONG UnsupDriversInfFileLength;
  347. //
  348. // Bootfont.bin file image loaded by setupldr
  349. //
  350. PVOID BootFontFile;
  351. ULONG BootFontFileLength;
  352. // On non-vga displays, setupldr looks in the firmware config tree
  353. // for the monitor peripheral that should be a child of the
  354. // display controller for the display being used during installation.
  355. // It copies its monitor configuration data to allow setup to
  356. // set the mode properly later.
  357. //
  358. PMONITOR_CONFIGURATION_DATA Monitor;
  359. PCHAR MonitorId;
  360. #ifdef _ALPHA_
  361. //
  362. // if alpha, then we need to know if the user supplied an OEM PAL disk
  363. //
  364. PDETECTED_DEVICE OemPal;
  365. #endif
  366. //
  367. // Loaded boot bus extenders
  368. //
  369. PDETECTED_DEVICE BootBusExtenders;
  370. //
  371. // Loaded bus extenders
  372. //
  373. PDETECTED_DEVICE BusExtenders;
  374. //
  375. // Loaded support drivers for input devices
  376. //
  377. PDETECTED_DEVICE InputDevicesSupport;
  378. //
  379. // This is a linked list that the contains the hardware id database,
  380. // that will be used during the initialization phase of textmode
  381. // setup (setupdd.sys)
  382. //
  383. PPNP_HARDWARE_ID HardwareIdDatabase;
  384. //
  385. // Remote boot information.
  386. //
  387. WCHAR ComputerName[64];
  388. ULONG IpAddress;
  389. ULONG SubnetMask;
  390. ULONG ServerIpAddress;
  391. ULONG DefaultRouter;
  392. ULONG DnsNameServer;
  393. //
  394. // The PCI hardware ID we got from the ROM of the netboot card
  395. // ("PCI\VEN_xxx...").
  396. //
  397. WCHAR NetbootCardHardwareId[64];
  398. //
  399. // The name of the netboot card driver ("abc.sys").
  400. //
  401. WCHAR NetbootCardDriverName[24];
  402. //
  403. // The name of the netboot card service key in the registry.
  404. //
  405. WCHAR NetbootCardServiceName[24];
  406. #if defined(REMOTE_BOOT)
  407. //
  408. // The inbound SPI, outbound SPI, and session key for the
  409. // IPSEC conversation with the server.
  410. //
  411. ULONG IpsecInboundSpi;
  412. ULONG IpsecOutboundSpi;
  413. ULONG IpsecSessionKey;
  414. #endif // defined(REMOTE_BOOT)
  415. //
  416. // If non-NULL this points to a string containing registry values to
  417. // be added for the netboot card. The string consists of a series of
  418. // name\0type\0value\0, with a final \0 at the end.
  419. //
  420. PCHAR NetbootCardRegistry;
  421. ULONG NetbootCardRegistryLength;
  422. //
  423. // If non-NULL this points to the PCI or ISAPNP information about
  424. // the netboot card.
  425. //
  426. PCHAR NetbootCardInfo;
  427. ULONG NetbootCardInfoLength;
  428. //
  429. // Various flags.
  430. //
  431. ULONG Flags;
  432. #define SETUPBLK_FLAGS_IS_REMOTE_BOOT 0x00000001
  433. #define SETUPBLK_FLAGS_IS_TEXTMODE 0x00000002
  434. #if defined(REMOTE_BOOT)
  435. #define SETUPBLK_FLAGS_REPIN 0x00000004
  436. #define SETUPBLK_FLAGS_DISABLE_CSC 0x00000008
  437. #define SETUPBLK_FLAGS_DISCONNECTED 0x00000010
  438. #define SETUPBLK_FLAGS_FORMAT_NEEDED 0x00000020
  439. #define SETUPBLK_FLAGS_IPSEC_ENABLED 0x00000040
  440. #endif // defined(REMOTE_BOOT)
  441. #define SETUPBLK_FLAGS_CONSOLE 0x00000080
  442. #if defined(REMOTE_BOOT)
  443. #define SETUPBLK_FLAGS_PIN_NET_DRIVER 0x00000100
  444. #endif // defined(REMOTE_BOOT)
  445. #define SETUPBLK_FLAGS_REMOTE_INSTALL 0x00000200
  446. #define SETUPBLK_FLAGS_SYSPREP_INSTALL 0x00000400
  447. #define SETUPBLK_XINT13_SUPPORT 0x00000800
  448. #define SETUPBLK_FLAGS_ROLLBACK 0x00001000
  449. #if defined(REMOTE_BOOT)
  450. //
  451. // HAL file name.
  452. //
  453. CHAR NetBootHalName[MAX_HAL_NAME_LENGTH + 1];
  454. #endif // defined(REMOTE_BOOT)
  455. //
  456. // During remote boot textmode setup, NtBootPath in the loader block points
  457. // to the setup source location. We also need to pass in the path to the
  458. // machine directory. This will be in the format \server\share\path.
  459. //
  460. PCHAR MachineDirectoryPath;
  461. //
  462. // Holds the name of the .sif file used by a remote boot machine
  463. // during textmode setup -- this is a temp file that needs to be
  464. // deleted. This will be in the format \server\share\path.
  465. //
  466. PCHAR NetBootSifPath;
  467. //
  468. // On a remote boot, this is information from the secret used
  469. // when the redirector logs on.
  470. //
  471. PVOID NetBootSecret;
  472. #if defined(REMOTE_BOOT)
  473. //
  474. // This indicates whether TFTP needed to use the second password in
  475. // the secret to log on (as a hint to the redirector).
  476. //
  477. BOOLEAN NetBootUsePassword2;
  478. #endif // defined(REMOTE_BOOT)
  479. //
  480. // This is the UNC path that a SysPrep installation or a machine replacement
  481. // senario is supposed to connect to find IMirror.dat
  482. //
  483. UCHAR NetBootIMirrorFilePath[260];
  484. //
  485. // Pointer to the asrpnp.sif file loaded by setupldr
  486. //
  487. PCHAR ASRPnPSifFile;
  488. ULONG ASRPnPSifFileLength;
  489. //
  490. // This is the administrator password supplied by the user during a
  491. // remote install
  492. UCHAR NetBootAdministratorPassword[NETBOOT_ADMIN_PASSWORD_LEN];
  493. } SETUP_LOADER_BLOCK, *PSETUP_LOADER_BLOCK;
  494. #endif // _SETUPBLK_