16.8.1.2 Load-control Sets for NT Drivers

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:

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.

Using Regedt32 to Load a New NT Driver

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.

LastKnownGood Control Set

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.

Using the \Regisry\Machine\System Tree in Higher-Level NT Drivers

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.