3.2 Device Objects and Device Extensions

An NT device object, like the driver object described in Chapter 2, is partially opaque to NT drivers. NT driver writers must know about certain field names and system-defined symbolic constants associated with device objects because their drivers must access these fields through the DeviceObject pointer returned by IoCreateDevice and passed to most standard NT driver routines.

Nevertheless, NT driver writers should be aware that the location of any field that is accessible through a returned DeviceObject pointer can change from one Windows NT® platform or version to another. In addition, NT driver writers should consider “unpublished” fields within an NT object inaccessible: that is, NT drivers should never access them. Any NT driver that has dependencies on NT object field locations or that accesses undocumented fields within an NT object also compromises its own future portability and interoperability with other NT drivers.

Figure 3.2 illustrates an NT device object, representing a physical, logical, or virtual device within the system.

Figure 3.2 Device Object

Figure 3.2 shows field names and constants that are particularly important for NT device and intermediate driver writers.