There are three kinds of WDM drivers:

  • Bus driver
  • Function driver
  • Filter driver

Bus driver

Bus driver drives an individual I/O bus device and provides per-slot functionality that is device-independent. Bus drivers also detect and report child devices that are connected to the bus. For purposes of the WDM, a bus is anything that you can plug a device into, either physically or metaphorically i.e. a bus includes traditional buses such as SCSI and PCI, as well as parallel ports and serial ports. The primary responsibilities of a bus driver are to:

  • Enumerate the devices on its bus.
  • Respond to Plug and Play IRPs and power management IRPs.
  • Multiplex access to the bus.
  • Administer the devices on its bus.

 

Function driver

A function driver is the main driver for a device. It is typically written by the device vendor. A function driver provides the operational interface for its device. Typically the function driver handles reads and writes to the device and manages device power policy. 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.

 

Filter Drivers

Filter drivers are optional drivers that add value to or modify the behavior of a device. A filter driver can service one or more devices. It is a driver or program or module that is inserted into the existing Driver Stack to perform some specific function. A filter driver should not affect the normal working of the existing driver stack in any major way. Upper level filter drivers sit above the primary driver for the device (the function driver), while lower level filter drivers sit below the function driver and above the bus driver.

 

The acronyms used for drivers object (DEVICE_OBJECT) are

  • PDO stands for physical device object. The bus driver uses this object to represent the connection between the device and the bus.
  • FDO stands for function device object. The function driver uses this object to manage the functionality of the device.
  • FiDO stands for filter device object. A filter driver uses this object as a place to store the information it needs to keep about the hardware and its filtering activities.