Chapter 9
In the preceding eight chapters, I've described most of the features of a full-blown WDM driver suitable for any random sort of hardware device. But you should understand a few more general-purpose techniques, and I'll describe them in this chapter. In the chapter's first section, I'll explain how to create a filter driver that sits above or below the function driver and modifies the standard behavior evoked by the function driver. Then I'll describe how to log errors for eventual viewing by a system administrator. After that, I'll discuss the very important subject of how you use I/O control (IOCTL) operations to allow an application to control your hardware or features of your driver. That discussion includes an explanation of how a WDM driver can alert an application to "interesting" events. I'll wrap up the chapter with instructions about how to create your own system threads, how to queue work items for execution within the context of existing system threads, and how to set up watchdog timers for unresponsive devices.