2.1.2.1 The Driver’s Services Database Key

This is the required part of a driver’s installation in the registry. The complete path of this required key for an installed driver is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DriverName. Refer to the Win32 SDK online documentation to determine the appropriate entries and values for your driver.

After the text mode phase of Windows NT Setup, the Service Controller should be used to create a service of any kind, whether kernel driver or Win32 service. If you alter the registry and treat the result as a service, the system must be restarted for the service to be recognized by the Service Controller. Refer to the Win32 SDK online documentation for more details. The information below is intended for those who must create services during text mode operation.

Creating a Service

To create a service, the following value entries must be made in the registry:

Type
Specifies the type of driver. One of the following is specified:

SERVICE_KERNEL_DRIVER (0x1)

SERVICE_FILE_SYSTEM_DRIVER (0x2)

SERVICE_ADAPTER (0x4)

Start
Specifies when to start the driver. One of the following is specified:
SERVICE_BOOT_START (0x0)
Indicates a driver started by the operating system loader, and should only be used for drivers that are essential to loading the OS (for example, Atdisk).
SERVICE_SYSTEM_START (0x1)
Indicates a driver started during OS initialization.
SERVICE_AUTO_START (0x2)
Indicates a driver started by the Service Control Manager during system startup.
SERVICE_DEMAND_START (0x3)
Indicates a driver started on demand, by the Service Control Manager.
SERVICE_DISABLED (0x4)
Indicates a driver that cannot be started.
Controlling the Load Order of Drivers

For a detailed discussion of controlling the load order of drivers, see Chapter 1.

In addition to the required values under the driver’s Services key, the following optional values can be specified to control the order in which the driver is loaded:

Group
Identifies the load order group of which this driver is a member. The HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\ServiceGroupOrder
key has a list of groups that determines the order in which the system loads drivers. Examples of groups are: SCSI miniport, port, Primary disk, and so forth.
Tag
Determines the order in which this driver is started within its group. The HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\GroupOrderList
 key has values that specify a tag order vector for some groups. Tags are only evaluated for drivers that have start types of SERVICE_BOOT_START or SERVICE_SYSTEM_START.
DependOnGroup
Specifies a load order group on which the driver depends. The driver is started only if at least one member of the specified group has been started.
DependOnService
Specifies another driver or service that must be running before this driver is started.
Optional Keys and Values

You can create the following optional keys and values under a driver’s Services key:

ImagePath
A value entry that specifies the fully qualified path of the driver’s image file. If this value is not specified, the default path is NT_root\system32\Drivers\DriverName.sys, where DriverName is the name of the driver’s Services key.
Parameters
A value entry used to store any device or driver-specific data that you want. For some types of drivers, the system expects to find specific value entries.
Performance
A value entry used to specify needed information if a driver supports performance monitoring. The values under this key specify the name of the driver’s performance DLL and the names of certain exported functions in that DLL.