The Windows Driver Model (WDM) is a driver framework for drivers that are source-code compatible across all Windows versions. They operate in the kernel. All WDM drivers must:

  • #include Wdm.h and not Ntddk.h.
  • Be designed as a {bus, function, or filter} driver.
  • Create device objects.

Basics

There are three main types of drivers in the WDM:

  • A bus driver drives an individual I/O bus device. It provides per-slot functionality that is device-independent. Bus drivers also detect and report connected child devices.
  • A function driver drives an individual device.
  • A filter driver filters I/O requests for a device, class of devices, or a bus.

Each device typically has a bus driver for the parent I/O bus, a function driver for the device, and ≥0 filter drivers for the device.

Programming

All Windows KMDs must implement a function called DriverEntry. It functions as an initialisation function, called shortly after the driver is loaded. DriverEntry fills in members of a DRIVER_OBJECT struct with pointers to other functions that the driver implements.

Sub-pages