As shown in Figure 16.6, RegistryPath points to a subkey of \Registry\Machine\System\CurrentControlSet\Services\DriverName.
CurrentControlSet is a symbolic link to a particular ControlSetnnn in the registry. Each ControlSetnnn is a named key with subkeys and value entries that specify the load order for a set of NT drivers.
Every ControlSetnnn has the following two subkeys:
Control : GroupOrderList : SCSI CDROM Class:REG_BINARY:02 00 00 00 01 ... SCSI Class:REG_BINARY:03 00 00 00 01 ... SCSI miniport:REG_BINARY:24 00 00 00 00 ... : : ServiceGroupOrder List:REG_MULTI_SZ:System Bus Extender SCSI miniport port Primary disk SCSI class SCSI CDROM class... :
This ServiceGroupOrder example indicates that HBA-specific SCSI miniport drivers (each linked to the NT SCSI port driver, which is implemented as a dynamic-link library) should be loaded before other drivers in the Primary disk group (such as add-on disk array, “AT” disk, and/or ABIOS disk drivers), followed by the SCSI class drivers, and so on.
The GroupOrderList defines the load order of drivers within each group. The first number in the list defines how many tags are used; in the above example, there are 03 tags for SCSI Class. The rest of the list defines the order in which drivers with those tags are loaded. The tags are not necessarily listed in increasing numerical order. The tag assignment for a driver is defined in its entry in the Services key.
Services : Disk DependOnGroup:REG_MULTI_SZ:SCSI miniport ErrorControl:REG_DWORD:0 // = SERVICE_ERROR_IGNORE Group:REG_SZ:SCSI class Start:REG_DWORD:0 // = SERVICE_BOOT_START Tag:REG_DWORD:0x2 Type:REG_DWORD:0x1 // = SERVICE_KERNEL_DRIVER : Scsiscan DependOnGroup:REG_MULTI_SZ:SCSI miniport ErrorControl:REG_DWORD:0 // = SERVICE_ERROR_IGNORE Group:REG_SZ:SCSI class Start:REG_DWORD:0x1 // = SERVICE_SYSTEM_START Tag:REG_DWORD:0x3 Type:REG_DWORD:0x1 // = SERVICE_KERNEL_DRIVER :
This Services example indicates:
A new driver can be loaded in NT machines by adding appropriate subkeys with value entries for the driver to the CurrentControlSet in the registry.
For example, a new SCSI miniport driver that enables “WD1003 emulation” on its HBA should be loaded before any other SCSI miniport drivers so that it can claim an AtDisk..AddressSpace in the I/O Manager’s configuration information structure, described in Section 16.8.1.1. On the other hand, a SCSI miniport driver for an HBA that does not support a BIOS should be loaded following all miniport drivers of HBAs that do.
To create a driver-specific key in the registry for an under-development driver and to make it loadable, the driver writer can use the Windows NT registry editor, regedt32, to modify and add appropriate keys and their value entries in the registry. For example, the driver writer would modify the CurrentControlSet\Services key to get the under-development driver to load and add driver-specific keys, such as the DriverName\Parameters with appropriate value entries or subkeys with value entries.
However, every NT driver writer must decide whether to rely on a system administrator or end user to “install” the retail driver in the registry with regedt32, to use a setup utility, to have the driver set itself up in the registry, or to use some combination of these methods. For more information about these alternatives, see Sections 16.8.5 and 16.9.1 and the Programmer’s Guide.
Note that the ServiceGroupOrder key is reset to its system-supplied value on a system upgrade. Drivers that modify this key may need to be reinstalled after a system upgrade.
The registry always contains additional load-control specifications, including a backup specification called LastKnownGood, in case modifications to the CurrentControlSet make it impossible to load the system.
Note that the registry has other subkeys under the path \Registry\Machine\System, shown in Figure 16.6, that contain configuration information that is useful to higher-level NT drivers.
For example, the system-supplied ftdisk driver uses the subkey \Registry\Machine\System\Disk to find disk devices and logical partitions so it can set up device objects for its own mirror, stripe, stripe-with-parity, and volume sets, as mentioned in Chapter 5.