test: setupblk.h Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# setupblk.h

Go to the documentation of this file.

    00001 #ifndef _SETUPBLK_
    00002 #define _SETUPBLK_
    00003
    00004 //
    00005 // Filetypes for files in txtsetup.oem.
    00006 //
    00007
    00008 typedef enum {
    00009     HwFileDriver,
    00010     HwFilePort,
    00011     HwFileClass,
    00012     HwFileInf,
    00013     HwFileDll,
    00014     HwFileDetect,
    00015     HwFileHal,
    00016     HwFileCatalog,
    00017     HwFileMax
    00018 } HwFileType;
    00019
    00020 #define FILETYPE(FileType)                      (1 << (FileType))
    00021 #define SET_FILETYPE_PRESENT(BitArray,FileType) ((BitArray) |= FILETYPE(FileType))
    00022 #define IS_FILETYPE_PRESENT(BitArray,FileType)  ((BitArray) & FILETYPE(FileType))
    00023
    00024 //
    00025 // Registry data types for registry data in txtsetup.oem.
    00026 //
    00027 typedef enum {
    00028     HwRegistryDword,
    00029     HwRegistryBinary,
    00030     HwRegistrySz,
    00031     HwRegistryExpandSz,
    00032     HwRegistryMultiSz,
    00033     HwRegistryMax
    00034 } HwRegistryType;
    00035
    00036 //
    00037 // Component types.
    00038 //
    00039
    00040 typedef enum {
    00041     HwComponentComputer,
    00042     HwComponentDisplay,
    00043     HwComponentKeyboard,
    00044     HwComponentLayout,
    00045     HwComponentMouse,
    00046     HwComponentMax
    00047 } HwComponentType;
    00048
    00049
    00050
    00051 typedef struct _DETECTED_DEVICE_REGISTRY {
    00052
    00053     struct _DETECTED_DEVICE_REGISTRY *Next;
    00054
    00055     //
    00056     // The name of the key.  The empty string means the key in the
    00057     // services key itself.
    00058     //
    00059
    00060     PCHAR KeyName;
    00061
    00062     //
    00063     // The name of the value within the registry key
    00064     //
    00065
    00066     PCHAR ValueName;
    00067
    00068     //
    00069     // The data type for the value (ie, REG_DWORD, etc)
    00070     //
    00071
    00072     ULONG ValueType;
    00073
    00074     //
    00075     // The buffer containing the data to be placed into the value.
    00076     // If the ValueType is REG_SZ, then Buffer should point to
    00077     // a nul-terminated ASCII string (ie, not unicode), and BufferSize
    00078     // should be the length in bytes of that string (plus 1 for the nul).
    00079     //
    00080
    00081     PVOID Buffer;
    00082
    00083     //
    00084     // The size of the buffer in bytes
    00085     //
    00086
    00087     ULONG BufferSize;
    00088
    00089
    00090 } DETECTED_DEVICE_REGISTRY, *PDETECTED_DEVICE_REGISTRY;
    00091
    00092
    00093 //
    00094 // One of these will be created for each file to be copied for a
    00095 // third party device.
    00096 //
    00097 typedef struct _DETECTED_DEVICE_FILE {
    00098
    00099     struct _DETECTED_DEVICE_FILE *Next;
    00100
    00101     //
    00102     // Filename of the file.
    00103     //
    00104
    00105     PCHAR Filename;
    00106
    00107     //
    00108     // type of the file (hal, port, class, etc).
    00109     //
    00110
    00111     HwFileType FileType;
    00112
    00113     //
    00114     // Part of name of the section in txtsetup.oem [Config.<ConfigName>]
    00115     // that contains registry options.  If this is NULL, then no registry
    00116     // information is associated with this file.
    00117     //
    00118     PCHAR ConfigName;
    00119
    00120     //
    00121     // Registry values for the node in the services list in the registry.
    00122     //
    00123
    00124     PDETECTED_DEVICE_REGISTRY RegistryValueList;
    00125
    00126     //
    00127     // These two fields are used when prompting for the diskette
    00128     // containing the third-party-supplied driver's files.
    00129     //
    00130
    00131     PCHAR DiskDescription;
    00132     PCHAR DiskTagfile;
    00133
    00134     //
    00135     // Directory where files are to be found on the disk.
    00136     //
    00137
    00138     PCHAR Directory;
    00139
    00140 } DETECTED_DEVICE_FILE, *PDETECTED_DEVICE_FILE;
    00141
    00142
    00143
    00144 //
    00145 // structure for storing information about a driver we have located and
    00146 // will install.
    00147 //
    00148
    00149 typedef struct _DETECTED_DEVICE {
    00150
    00151     struct _DETECTED_DEVICE *Next;
    00152
    00153     //
    00154     // String used as a key into the relevent section (like [Display],
    00155     // [Mouse], etc).
    00156     //
    00157
    00158     PCHAR IdString;
    00159
    00160     //
    00161     // 0-based order that this driver is listed in txtsetup.sif.
    00162     // (ULONG)-1 for unsupported (ie, third party) scsi devices.
    00163     //
    00164     ULONG Ordinal;
    00165
    00166     //
    00167     // String that describes the hardware.
    00168     //
    00169
    00170     PCHAR Description;
    00171
    00172     //
    00173     // If this is TRUE, then there is an OEM option selected for this
    00174     // hardware.
    00175     //
    00176
    00177     BOOLEAN ThirdPartyOptionSelected;
    00178
    00179     //
    00180     // Bits to be set if a third party option is selected, indicating
    00181     // which type of files are specified in the oem inf file.
    00182     //
    00183
    00184     ULONG FileTypeBits;
    00185
    00186     //
    00187     // Files for a third party option.
    00188     //
    00189
    00190     PDETECTED_DEVICE_FILE Files;
    00191
    00192     //
    00193     // For first party files loaded by the boot loader,
    00194     // this value will be the "BaseDllName" -- ie, the filename
    00195     // part only of the file from which the driver was loaded.
    00196     //
    00197     // This field is only filled in in certain cases, so be careful
    00198     // when using it.  See ntos\boot\setup\setup.c. (Always filled in
    00199     // for SCSI devices.)
    00200     //
    00201     PCHAR BaseDllName;
    00202
    00203     //
    00204     // If this is TRUE, then there is a migrated driver for this
    00205     // hardware.
    00206     //
    00207     BOOLEAN MigratedDriver;
    00208
    00209 } DETECTED_DEVICE, *PDETECTED_DEVICE;
    00210
    00211
    00212 //
    00213 // Name of txtsetup.oem
    00214 //
    00215 #define TXTSETUP_OEM_FILENAME    "txtsetup.oem"
    00216 #define TXTSETUP_OEM_FILENAME_U L"txtsetup.oem"
    00217
    00218 //
    00219 // Name of sections in txtsetup.oem.  These are not localized.
    00220 //
    00221 #define TXTSETUP_OEM_DISKS       "Disks"
    00222 #define TXTSETUP_OEM_DISKS_U    L"Disks"
    00223 #define TXTSETUP_OEM_DEFAULTS    "Defaults"
    00224 #define TXTSETUP_OEM_DEFAULTS_U L"Defaults"
    00225
    00226 //
    00227 // Field offsets in txtsetup.oem
    00228 //
    00229
    00230 // in [Disks] section
    00231 #define OINDEX_DISKDESCR        0
    00232 #define OINDEX_TAGFILE          1
    00233 #define OINDEX_DIRECTORY        2
    00234
    00235 // in [Defaults] section
    00236 #define OINDEX_DEFAULT          0
    00237
    00238 // in [<component_name>] section (ie, [keyboard])
    00239 #define OINDEX_DESCRIPTION      0
    00240
    00241 // in [Files.<compoment_name>.<id>] section (ie, [Files.Keyboard.Oem1])
    00242 #define OINDEX_DISKSPEC         0
    00243 #define OINDEX_FILENAME         1
    00244 #define OINDEX_CONFIGNAME       2
    00245
    00246 // in [Config.<compoment_name>.<id>] section (ie, [Config.Keyboard.Oem1])
    00247 #define OINDEX_KEYNAME          0
    00248 #define OINDEX_VALUENAME        1
    00249 #define OINDEX_VALUETYPE        2
    00250 #define OINDEX_FIRSTVALUE       3
    00251
    00252 // in [HardwareIds.<compoment_name>.<id>] section (ie, [HardwareIds.Keyboard.Oem1])
    00253 #define OINDEX_HW_ID         0
    00254 #define OINDEX_DRIVER_NAME   1
    00255 #define OINDEX_CLASS_GUID    2
    00256
    00257
    00258 typedef enum {
    00259     SetupOperationSetup,
    00260     SetupOperationUpgrade,
    00261     SetupOperationRepair
    00262 } SetupOperation;
    00263
    00264
    00265 typedef struct _SETUP_LOADER_BLOCK_SCALARS {
    00266
    00267     //
    00268     // This value indicates the operation we are performing
    00269     // as chosen by the user or discovered by setupldr.
    00270     //
    00271     unsigned    SetupOperation;
    00272
    00273     //
    00274     // In some cases we will ask the user whether he wants
    00275     // a CD-ROM or floppy-based installation.  This flag
    00276     // indicates whether he chose a CD-ROM setup.
    00277     //
    00278     unsigned    SetupFromCdRom      : 1;
    00279
    00280     //
    00281     // If this flag is set, then setupldr loaded scsi miniport drivers
    00282     // and the scsi class drivers we may need (scsidisk, scsicdrm, scsiflop).
    00283     //
    00284     unsigned    LoadedScsi          : 1;
    00285
    00286     //
    00287     // If this flag is set, then setupldr loaded non-scsi floppy class drivers
    00288     // (ie, floppy.sys) and fastfat.sys.
    00289     //
    00290     unsigned    LoadedFloppyDrivers : 1;
    00291
    00292     //
    00293     // If this flag is set, then setupldr loaded non-scsi disk class drivers
    00294     // (ie, atdisk, abiosdsk, delldsa, cpqarray) and filesystems (fat, hpfs, ntfs).
    00295     //
    00296     unsigned    LoadedDiskDrivers   : 1;
    00297
    00298     //
    00299     // If this flag is set, then setupldr loaded non-scsi cdrom class drivers
    00300     // (currently there are none) and cdfs.
    00301     //
    00302     unsigned    LoadedCdRomDrivers  : 1;
    00303
    00304     //
    00305     // If this flag is set, then setupldr loaded all filesystems listed
    00306     // in [FileSystems], on txtsetup.sif.
    00307     //
    00308     unsigned    LoadedFileSystems  : 1;
    00309
    00310 } SETUP_LOADER_BLOCK_SCALARS, *PSETUP_LOADER_BLOCK_SCALARS;
    00311
    00312
    00313 typedef struct _PNP_HARDWARE_ID {
    00314
    00315     struct _PNP_HARDWARE_ID *Next;
    00316
    00317     //
    00318     // String that represents the hardware id of a PNP device.
    00319     //
    00320
    00321     PCHAR Id;
    00322
    00323     //
    00324     // Driver for the device
    00325     //
    00326
    00327     PCHAR DriverName;
    00328
    00329     //
    00330     // GUID for this device, if any
    00331     //
    00332     PCHAR ClassGuid;
    00333
    00334
    00335 } PNP_HARDWARE_ID, *PPNP_HARDWARE_ID;
    00336
    00337
    00338 //
    00339 // Purely arbitrary, but all net boot components enforce this.  The only
    00340 // problem is if a detected Hal name is greater than this, things get ugly if
    00341 // the first MAX_HAL_NAME_LENGTH characters are identical for two different hals.
    00342 // NOTE: If you change this, change the definition in private\sm\server\smsrvp.h
    00343 // NOTE: If you change this, change the definition in private\inc\oscpkt.h
    00344 //
    00345 #define MAX_HAL_NAME_LENGTH 30
    00346
    00347
    00348 typedef struct _SETUP_LOADER_BLOCK {
    00349
    00350     //
    00351     // ARC path to the Setup source media.
    00352     // The Setup boot media path is given by the
    00353     // ArcBootDeviceName field in the loader block itself.
    00354     //
    00355     PCHAR       ArcSetupDeviceName;
    00356
    00357     //
    00358     // Detected/loaded video device.
    00359     //
    00360     DETECTED_DEVICE    VideoDevice;
    00361
    00362     //
    00363     // Detected/loaded keyboard device.
    00364     //
    00365     PDETECTED_DEVICE    KeyboardDevices;
    00366
    00367     //
    00368     // Detected computer type.
    00369     //
    00370     DETECTED_DEVICE    ComputerDevice;
    00371
    00372     //
    00373     // Detected/loaded scsi adapters.  This is a linked list
    00374     // because there could be multiple adapters.
    00375     //
    00376     PDETECTED_DEVICE    ScsiDevices;
    00377
    00378     //
    00379     // Non-pointer values.
    00380     //
    00381     SETUP_LOADER_BLOCK_SCALARS ScalarValues;
    00382
    00383     //
    00384     // Pointer to the txtsetup.sif file loaded by setupldr
    00385     //
    00386     PCHAR IniFile;
    00387     ULONG IniFileLength;
    00388
    00389     //
    00390     // Pointer to the winnt.sif file loaded by setupldr
    00391     //
    00392     PCHAR WinntSifFile;
    00393     ULONG WinntSifFileLength;
    00394
    00395     //
    00396     // Pointer to the migrate.inf file loaded by setupldr
    00397     //
    00398     PCHAR MigrateInfFile;
    00399     ULONG MigrateInfFileLength;
    00400
    00401     //
    00402     // Pointer to the unsupdrv.inf file loaded by setupldr
    00403     //
    00404     PCHAR UnsupDriversInfFile;
    00405     ULONG UnsupDriversInfFileLength;
    00406
    00407     // On non-vga displays, setupldr looks in the firmware config tree
    00408     // for the monitor peripheral that should be a child of the
    00409     // display controller for the display being used during installation.
    00410     // It copies its monitor configuration data to allow setup to
    00411     // set the mode properly later.
    00412     //
    00413     PMONITOR_CONFIGURATION_DATA Monitor;
    00414     PCHAR MonitorId;
    00415
    00416 #ifdef _ALPHA_
    00417     //
    00418     // if alpha, then we need to know if the user supplied an OEM PAL disk
    00419     //
    00420     PDETECTED_DEVICE    OemPal;
    00421 #endif
    00422
    00423     //
    00424     // Loaded boot bus extenders
    00425     //
    00426     PDETECTED_DEVICE    BootBusExtenders;
    00427
    00428     //
    00429     // Loaded bus extenders
    00430     //
    00431     PDETECTED_DEVICE    BusExtenders;
    00432
    00433     //
    00434     // Loaded support drivers for input devices
    00435     //
    00436     PDETECTED_DEVICE    InputDevicesSupport;
    00437
    00438     //
    00439     //  This is a linked list that the contains the hardware id database,
    00440     //  that will be used during the initialization phase of textmode
    00441     //  setup (setupdd.sys)
    00442     //
    00443     PPNP_HARDWARE_ID HardwareIdDatabase;
    00444
    00445     //
    00446     // Remote boot information.
    00447     //
    00448
    00449     WCHAR ComputerName[64];
    00450     ULONG IpAddress;
    00451     ULONG SubnetMask;
    00452     ULONG ServerIpAddress;
    00453     ULONG DefaultRouter;
    00454     ULONG DnsNameServer;
    00455
    00456     //
    00457     // BUGBUG: Check if these next two are long enough.
    00458     //
    00459
    00460     //
    00461     // The PCI hardware ID we got from the ROM of the netboot card
    00462     // ("PCI\VEN_xxx...").
    00463     //
    00464
    00465     WCHAR NetbootCardHardwareId[64];
    00466
    00467     //
    00468     // The name of the netboot card driver ("abc.sys").
    00469     //
    00470
    00471     WCHAR NetbootCardDriverName[24];
    00472
    00473     //
    00474     // The name of the netboot card service key in the registry.
    00475     //
    00476
    00477     WCHAR NetbootCardServiceName[24];
    00478
    00479 #if defined(REMOTE_BOOT)
    00480     //
    00481     // The inbound SPI, outbound SPI, and session key for the
    00482     // IPSEC conversation with the server.
    00483     //
    00484
    00485     ULONG IpsecInboundSpi;
    00486     ULONG IpsecOutboundSpi;
    00487     ULONG IpsecSessionKey;
    00488 #endif // defined(REMOTE_BOOT)
    00489
    00490     //
    00491     // If non-NULL this points to a string containing registry values to
    00492     // be added for the netboot card. The string consists of a series of
    00493     // name\0type\0value\0, with a final \0 at the end.
    00494     //
    00495
    00496     PCHAR NetbootCardRegistry;
    00497     ULONG NetbootCardRegistryLength;
    00498
    00499     //
    00500     // If non-NULL this points to the PCI or ISAPNP information about
    00501     // the netboot card.
    00502     //
    00503
    00504     PCHAR NetbootCardInfo;
    00505     ULONG NetbootCardInfoLength;
    00506
    00507     //
    00508     // Various flags.
    00509     //
    00510
    00511     ULONG Flags;
    00512
    00513 #define SETUPBLK_FLAGS_IS_REMOTE_BOOT   0x00000001
    00514 #define SETUPBLK_FLAGS_IS_TEXTMODE      0x00000002
    00515 #if defined(REMOTE_BOOT)
    00516 #define SETUPBLK_FLAGS_REPIN            0x00000004
    00517 #define SETUPBLK_FLAGS_DISABLE_CSC      0x00000008
    00518 #define SETUPBLK_FLAGS_DISCONNECTED     0x00000010
    00519 #define SETUPBLK_FLAGS_FORMAT_NEEDED    0x00000020
    00520 #define SETUPBLK_FLAGS_IPSEC_ENABLED    0x00000040
    00521 #endif // defined(REMOTE_BOOT)
    00522 #define SETUPBLK_FLAGS_CONSOLE          0x00000080
    00523 #if defined(REMOTE_BOOT)
    00524 #define SETUPBLK_FLAGS_PIN_NET_DRIVER   0x00000100
    00525 #endif // defined(REMOTE_BOOT)
    00526 #define SETUPBLK_FLAGS_REMOTE_INSTALL   0x00000200
    00527 #define SETUPBLK_FLAGS_SYSPREP_INSTALL  0x00000400
    00528 #define SETUPBLK_XINT13_SUPPORT         0x00000800
    00529
    00530 #if defined(REMOTE_BOOT)
    00531     //
    00532     // HAL file name.
    00533     //
    00534
    00535     CHAR NetBootHalName[MAX_HAL_NAME_LENGTH + 1];
    00536 #endif // defined(REMOTE_BOOT)
    00537
    00538     //
    00539     // During remote boot textmode setup, NtBootPath in the loader block points
    00540     // to the setup source location. We also need to pass in the path to the
    00541     // machine directory. This will be in the format \server\share\path.
    00542     //
    00543     PCHAR MachineDirectoryPath;
    00544
    00545     //
    00546     // Holds the name of the .sif file used by a remote boot machine
    00547     // during textmode setup -- this is a temp file that needs to be
    00548     // deleted. This will be in the format \server\share\path.
    00549     //
    00550     PCHAR NetBootSifPath;
    00551
    00552     //
    00553     // On a remote boot, this is information from the secret used
    00554     // when the redirector logs on.
    00555     //
    00556
    00557     PVOID NetBootSecret;
    00558
    00559 #if defined(REMOTE_BOOT)
    00560     //
    00561     // This indicates whether TFTP needed to use the second password in
    00562     // the secret to log on (as a hint to the redirector).
    00563     //
    00564
    00565     BOOLEAN NetBootUsePassword2;
    00566 #endif // defined(REMOTE_BOOT)
    00567
    00568     //
    00569     // This is the UNC path that a SysPrep installation or a machine replacement
    00570     // senario is supposed to connect to find IMirror.dat
    00571     //
    00572     UCHAR NetBootIMirrorFilePath[260];
    00573
    00574 } SETUP_LOADER_BLOCK, *PSETUP_LOADER_BLOCK;
    00575
    00576 #endif // _SETUPBLK_