Besides implementing the stream interface, a driver may implement a specific set of IOCTLs. In reality, most functionality is implemented by this “backdoor” because it enables far greater flexibility than the read-and-write driver functions. For example, drivers that implement power management implement a standard set of IOCTLs. Drivers that implement serial devices also implement a standard set of IOCTLs.
Many drivers implement an alternative interface by implementing a specific set of IOCTLs. Compact 7 formalizes this by specifying a number of predefined interfaces, as shown in Table 32-4. Devices that implement the IOCTLs for an interface belong to the associated class. This can be indicated by adding a class GUID entry into a driver’s registry settings as a subkey IClass, or the Device Manager function AdvertiseInterface can be used. Custom interfaces classes can also be defined. If a driver implements the interface for a driver class though, then it must fully implement the functionality because system components that use it assume that the functions are fully executed.