Windows Driver Model (WDM)
Updated: April 15, 2002
Windows driver model (WDM) is a strategy for making driver development simpler. The ultimate goal of WDM is a more robust platform for Microsoft Windows operating systems and better user experiences with new hardware for Windows-based PCs.
WDM provides a common set of services for developers to create drivers that are compatible across Windows operating systems for certain device classes. A WDM driver can be source-code-compatible for Windows XP, Windows 2000, Windows Millennium Edition (Windows Me), and Windows 98.
This article provides an orientation to WDM for non-developers. Driver developers should see the Windows DDK for in-depth information about developing WDM and non-WDM drivers for Windows operating systems.
On This Page
Why WDM Is Important
Why WDM Is Important
WDM helps developers produce more robust drivers with less effort. Driver developers can gain substantial benefits from studying the WDM model for their device class during early driver development and test planning:
Writing one driver for multiple platforms means that developers can create and manage a single source-code base rather than writing a separate driver for each platform, and this reduces the amount of code that must be tested and debugged.
The WDM strategy is a cornerstone of Microsofts driver quality initiative, which also includes:
How WDM Benefits Developers
WDM development at Microsoft has developed, tested, and released code for each version of the Windows operating system since Windows 95. Microsoft WDM developers:
WDM for Windows XP, Windows 2000, and Windows Me
All versions of Microsoft Windows after Windows 95 have implemented WDM, which has continued to evolve for Windows XP, Windows 2000, and Windows Me. With a few special-case statements in the code, WDM drivers for supported device classes can be source-code compatible across Windows XP/Windows 2000 and Windows 98/Me operating systems.
Binary compatibility is possible on processors that are compatible with the Intel Architecture. Achieving a single binary still requires rigorous testing on all versions of all operating systems.
Later operating system releases support WDM features that were not available in earlier releases. For details about differences between WDM versions, see "Writing Drivers for Multiple Platforms and Operating Systems" in the Beta release of the Windows DDK to be released with Windows XP.
WDM Bus and Device Support
Bus Support. In the context of WDM, a bus is any device to which other physical, logical, or virtual devices are attached. Windows XP contains WDM support for these buses:
The goals of new RNDIS support are consistent with the WDM strategy:
RNDIS Information for Developers
Device Support. Windows XP contains WDM support for:
Layered Driver Architecture
WDM uses a layered approach in which a given device is served by at least two drivers: a bus driver and a function driver. A device might also have filter drivers that add value or modify the behavior of the device. The chain of drivers that serve a device is called a driver stack.
Bus drivers. A bus driver serves an I/O bus, such as IEEE 1394. In context of WDM, a bus is any device to which other physical, logical, or virtual devices are attached. This includes traditional buses such as SCSI and PCI, as well as parallel ports, serial ports, and i8042 ports.
Microsoft supplies the bus drivers for Windows operating systems. A bus driver provides the following services for third-party driver developers:
Function drivers. A function driver is the main driver for a device and is typically written by the device manufacturer. The primary responsibilities of a function driver are to:
Filter drivers. Filter drivers are an option available to driver writers who must add value to or modify the behavior of a device, a class of devices, or a bus. A filter driver is installed above or below one or more other drivers in a driver stack. A filter driver intercepts requests for a device, a class of devices, or a bus, evaluates these requests, and may modify the content or destination of the request. For example:
Function Drivers Structured as Class Drivers and Minidrivers
Common operations for a class of devices can be implemented in a class driver. Driver developers write a much smaller minidriver that interacts with their hardware and that calls the class driver to do most of the work. Taken together, a class driver and a minidriver serve as the function driver for a device.
If an industry standard exists for a device class, the Microsoft-supplied WDM class driver may be able to handle all the necessary tasks for a device that fully implements the standard, which eliminates the need for a third-party minidriver. For example, the Microsoft-supplied HID class driver is based on the USB HID Class Specification, v1.1, and eliminates the need for a third-party minidriver for many USB keyboards, mice, and game controllers.
Microsoft provides the following WDM class drivers:
Writing WDM Drivers
Any new kernel-mode driver should be a WDM driver, and Windows XP is the recommended development platform. All WDM drivers must support Plug and Play and power management and can also implement WMI, as documented in the Windows DDK.
In general, it is always better to start driver development on Windows XP and then migrate support back to other Windows versions. This is true even if driver support for the targeted device does not fit completely within the WDM model.
To write a WDM driver, developers must understand differences among Windows platforms as documented in the latest Windows DDK. Developers should also understand bus- and device-specific issues, and Windows kernel concepts such as:
Differences among Windows platforms are documented in the Windows DDK. Here are some brief examples:
Windows beta testing
Microsoft Technical Support for driver developers
Debugging tools and resources
Driver Verifier Preview in Windows XP
Digital signatures for drivers
Windows Hardware Quality Labs (WHQL)
News and white papers for developing Windows drivers
Programming the Microsoft Windows Driver Model