Windows Driver Model

To allow driver developers to write device drivers that are source-code compatible across all Microsoft Windows operating systems, the Windows Driver Model (WDM) was introduced. Kernel-mode drivers that follow WDM rules are called WDM drivers.

There are three kinds of WDM drivers:

  1. Bus drivers

    A bus driver services a bus controller, adapter, or bridge. Microsoft provides bus drivers for most common buses, such as PCI, PnpISA, SCSI, and USB. Other bus drivers can be provided by IHVs or OEMs. Bus drivers are required drivers; there is one bus driver for each type of bus on a machine. A bus driver can service more than one bus if there is more than one bus of the same type on the machine. Bus drivers also detect and report child devices that are connected to the bus. A Physical Device Object (PDO) represents a device on a bus to a bus driver.

  2. Function drivers

    The one driver in the stack that communicates directly with the device is called the function driver. A function driver is the main driver for a device. A function driver is typically written by the device vendor and is required (unless the device is being used in raw mode. The PnP manager loads at most one function driver for a device. A function driver can service one or more devices. The function driver for a device can be implemented as a driver/minidriver pair, such as a port/miniport driver pair or a class/miniclass driver pair. In such driver pairs, the minidriver is linked to the second driver, which is a DLL. In a minidriver model, the device driver consists of two parts: one that handles general tasks, and one that handles device-specific tasks. Typically, Microsoft writes the general portion and the device manufacturer writes the device-specific portion. A Functional Device Object (FDO) represents a device to a function driver.

  3. Filter drivers

    The drivers that perform auxiliary processing are called filter drivers. Filter drivers are optional drivers that add value to or modify the behavior of a device, a class of devices, or a bus. Bus filter drivers typically add value to a bus. Lower-level filter drivers typically modify the behavior of device hardware. Upper-level filter drivers typically provide added-value features for a device. A Filter Device Object (filter DO) represents a device to a filter driver.