4.4.1 Naming Device Objects

NT drivers’ device objects have names for two basic reasons:

The system uses a simple naming scheme to identify the NT devices in every machine. In general, each device object that can be the target of an I/O request or can be connected to by a higher-level NT driver has a name of the form:

\Device\GenericDeviceTypeDigit
where

GenericDeviceType indicates the kind of device, such as Harddisk, Serial, Tape, etc.

and
The Digit suffix indicates the zero-based number of this device, depending on how many other devices of the same type have already been named.

Every NT driver must follow these naming conventions for device objects.

Note that each GenericDeviceType guarantees that all device objects representing a particular type of device have the same name, so NT higher-level drivers can readily find device objects representing the set of underlying physical devices over which such a higher-level driver can layer itself. Note also that the Digit suffix guarantees that each device object of that type has a unique name in every Windows NT machine. For more information about how to assign an appropriate Digit suffix to a named device object, see also the section on using the registry in Chapter 16.

The DriverEntry routine is responsible for setting up a unique-to-the-machine Unicode string to name each device object that an NT driver creates, except for any device object that cannot be a target for an I/O request or that cannot be connected to by a higher-level driver.