HOWTO: Control Device Driver Load OrderID: Q115486
|
Windows NT is designed around the concept that the first driver to claim a device obtains ownership of that device. This ownership can be shared or it can be exclusive; this is up to the claiming device driver. If the device is exclusively claimed by a device driver, any further attempts to claim the device by subsequently loaded device drivers fail. Because of this, it is imperative that the order in which device drivers load can be modified by device driver authors. This article describes the two methods that you can use to control the order in which device drivers load.
There are two methods that you can use to control the order in which device
drivers load. Both methods take advantage of entries in the registry that
can be found at \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control. The
first method is to modify the ServiceGroupOrder. The second method is to
assign Tag values that determine the order of driver loading according to
the GroupOrderList.
These two methods only work for device drivers that have a start value of
0 (SERVICE_BOOT_START) or 1 (SERVICE_SYSTEM_START). In all cases, device
drivers with a start value of 0 load before any device drivers with a start
value of 1 attempt to load.
SCSI miniportAccording to the ServiceGroupOrder, device drivers in the group "SCSI class" load after all device drivers in the group "Primary disk" and before device drivers in the group "SCSI CDROM class" load. The higher a device driver's group is in the list, the sooner it loads. The ServiceGroupOrder list is scanned twice. First, all device drivers with a start value of 0 load; then, all device drivers with a start value of 1 load. Thus, a device driver with a start value of 0 loads before any device driver with a start value of 1, no matter what its position on the ServiceGroupOrder list.
port
Primary disk
SCSI class
SCSI CDROM class
filter
boot file system
Base
Pointer Port
Keyboard Port
Pointer Class
Keyboard Class
Video Init
Video
Video Save
file system
Event log
Streams Drivers
NDIS
TDI
NetBIOSGroup
SpoolerGroup
\registry\machine\system\currentcontrolset\services\scsidisk
Type = REG_DWORD 0x00000001
Start = REG_DWORD 0x00000000
Group = SCSI class
ErrorControl = REG_DWORD 0x00000000
DependOnGroup = REG_MULTI_SZ "SCSI miniport"
SCSI miniportHere are SAMPLDRV's registry entries:
port
Primary disk
Load Me First
SCSI class
SCSI CDROM class
filter
boot file system
.
.
.
\registry\machine\system\currentcontrolset\services\sampldrv
Type = REG_DWORD 0x00000001
Start = REG_DWORD 0x00000000
Group = Load Me First
ErrorControl = REG_DWORD 0x00000000
DependOnGroup = REG_MULTI_SZ "SCSI miniport"
\registry\machine\system\currentcontrolset\control\grouporderlist
Base = REG_BINARY 0d 00 00 00 01 00...
Extended base = REG_BINARY 04 00 00 00 01 00...
Filter = REG_BINARY 05 00 00 00 01 00...
Keyboard Class = REG_BINARY 01 00 00 00 01 00...
Keyboard Port = REG_BINARY 01 00 00 00 01 00...
Ndis = REG_BINARY 09 00 00 00 01 00...
Pointer Class = REG_BINARY 01 00 00 00 01 00...
Pointer Port = REG_BINARY 03 00 00 00 01 00...
.
.
.
\registry\machine\system\currentcontrolset\control\grouporderlist
SCSI class = REG_BINARY 02 00 00 00 02 00 00 00 01 00 00 00
Base = REG_BINARY 0d 00 00 00 01 00...
Extended base = REG_BINARY 04 00 00 00 01 00...
.
.
.
\registry\machine\system\currentcontrolset\services\sampldrv
Type = REG_DWORD 0x00000001
Start = REG_DWORD 0x00000000
Group = SCSI class
ErrorControl = REG_DWORD 0x00000000
DependOnGroup = REG_MULTI_SZ "SCSI miniport"
Tag = REG_DWORD 0x00000002
Keywords : NTDDKKMode
Version : WINNT:3.5,3.51;
Platform : winnt
Issue type : kbhowto
Last Reviewed: March 2, 1999