Windows Driver Model
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, the Windows Driver Model (WDM) — also known at one point as the Win32 Driver Model — is a framework for device driver
Device driver
In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device....

s that was introduced with Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

 and Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

 to replace VxD
VxD
VxD is the device driver model used in Microsoft Windows/386, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extend also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 multitasker...

, which was used on older versions of Windows such as Windows 95
Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...

 and Windows 3.1
Windows 3.1x
Windows 3.1x is a series of 16-bit operating systems produced by Microsoft for use on personal computers. The series began with Windows 3.1, which was first sold during March 1992 as a successor to Windows 3.0...

, as well as the Windows NT Driver Model.

Overview

WDM drivers are layered in a complex hierarchy and communicate with each other via I/O request packets (IRPs). The Microsoft Windows Driver unified driver model for the Windows 98 and Windows 2000 lines by standardizing requirements and reducing the amount of code that needed to be written. WDM drivers will not run on operating systems earlier than Windows 98 or Windows 2000, such as Windows 95, Windows NT 4.0 and Windows 3.1. By conforming to WDM, drivers can be binary compatible and source-compatible across Windows 98, Windows 98 Second Edition, Windows Me
Windows Me
Windows Millennium Edition, or Windows Me , is a graphical operating system released on September 14, 2000 by Microsoft, and was the last operating system released in the Windows 9x series. Support for Windows Me ended on July 11, 2006....

, Windows 2000, Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

, Windows Server 2003
Windows Server 2003
Windows Server 2003 is a server operating system produced by Microsoft, introduced on 24 April 2003. An updated version, Windows Server 2003 R2, was released to manufacturing on 6 December 2005...

 and Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 (for backwards compatibility) on x86-based computers. WDM drivers are designed to be forward-compatible
Forward compatibility
Forward compatibility or upward compatibility is a compatibility concept for systems design, as e.g. backward compatibility. Forward compatibility aims at the ability of a design to gracefully accept input intended for later versions of itself...

 so that a WDM driver can run on a version of Windows newer than what the driver was initially written for, but doing that would mean that the driver cannot take advantage of any new features introduced with the new version. WDM is generally not backward-compatible
Backward compatibility
In the context of telecommunications and computing, a device or technology is said to be backward or downward compatible if it can work with input generated by an older device...

, that is, a WDM driver is not guaranteed to run on any older version of Windows. For example, Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

 can use a driver written for Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

 but will not make use of any of the new WDM features that were introduced in Windows XP. However, a driver written for Windows XP may or may not load on Windows 2000.

WDM exists in the intermediary layer of Windows 2000 kernel-mode drivers and was introduced to increase the functionality and ease of writing drivers for Windows. Although WDM was mainly designed to be binary and source compatible between Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

 and Windows 2000, this may not always be desired and so specific drivers can be developed for either operating system. WDM drivers can be classified into the following types and sub-types:

Device function drivers

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). A function driver can service one or more devices.
  • Class driver
    Class driver
    In computing, a class driver is a type of hardware device driver that can operate a large number of different devices of a broadly similar type....

    s:
    These are a type of function drivers and can be thought of as built-in framework drivers that miniport
    Miniport
    A miniport is a type of hardware-driver, part of the Windows Driver Model. These are USB, Audio, SCSI and network card adapters. They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific...

     and other class driver
    Class driver
    In computing, a class driver is a type of hardware device driver that can operate a large number of different devices of a broadly similar type....

    s can be built on top of. The class driver
    Class driver
    In computing, a class driver is a type of hardware device driver that can operate a large number of different devices of a broadly similar type....

    s provide interfaces between different levels of the WDM architecture. Common functionality between different classes of drivers can be written into the class driver and used by other class and miniport
    Miniport
    A miniport is a type of hardware-driver, part of the Windows Driver Model. These are USB, Audio, SCSI and network card adapters. They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific...

     drivers. The lower edge of the class driver will have its interface exposed to the miniport
    Miniport
    A miniport is a type of hardware-driver, part of the Windows Driver Model. These are USB, Audio, SCSI and network card adapters. They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific...

     driver, while the upper edge of top level class drivers is operating system specific. Class drivers can be dynamically loaded and unloaded at will. They can do class specific functions that are not hardware or bus-specific (with the exception of bus-type class drivers) and in fact sometimes only do class specific functions like enumeration
    Enumeration
    In mathematics and theoretical computer science, the broadest and most abstract definition of an enumeration of a set is an exact listing of all of its elements . The restrictions imposed on the type of list used depend on the branch of mathematics and the context in which one is working...

    .
  • Miniport
    Miniport
    A miniport is a type of hardware-driver, part of the Windows Driver Model. These are USB, Audio, SCSI and network card adapters. They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific...

     drivers:
    These are also function drivers for USB, Audio
    Sound card
    A sound card is an internal computer expansion card that facilitates the input and output of audio signals to and from a computer under control of computer programs. The term sound card is also applied to external audio interfaces that use software to generate sound, as opposed to using hardware...

    , SCSI
    SCSI
    Small Computer System Interface is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, and electrical and optical interfaces. SCSI is most commonly used for hard disks and tape drives, but it...

     and network adapters
    Network card
    A network interface controller is a computer hardware component that connects a computer to a computer network....

    . They should usually be source and binary compatible between Windows 98 and Windows 2000 and are hardware specific but control access to the hardware through a specific bus class driver
    Class driver
    In computing, a class driver is a type of hardware device driver that can operate a large number of different devices of a broadly similar type....

    .

Bus drivers

A bus driver services a bus controller, adapter, or bridge. Microsoft provides bus drivers for most common buses, such as PCI
Peripheral Component Interconnect
Conventional PCI is a computer bus for attaching hardware devices in a computer...

, PnPISA
Plug-and-play
In computing, plug and play is a term used to describe the characteristic of a computer bus, or device specification, which facilitates the discovery of a hardware component in a system, without the need for physical device configuration, or user intervention in resolving resource conflicts.Plug...

, SCSI
SCSI
Small Computer System Interface is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, and electrical and optical interfaces. SCSI is most commonly used for hard disks and tape drives, but it...

, USB and FireWire. Each software vendor can create their own bus drivers if needed. A bus driver can service more than one bus if there is more than one bus of the same type on the machine.

Filter drivers

Filter driver
Filter driver
A filter driver is a Microsoft Windows driver that adds value to peripheral devices or supports a specialized device in the personal computer. It is a driver/program/module that is inserted into the existing driver stack to perform some specific function. A filter driver should not affect the...

s
are optional drivers that add value to or modify the behavior of a device and may be non-device drivers. A filter driver
Filter driver
A filter driver is a Microsoft Windows driver that adds value to peripheral devices or supports a specialized device in the personal computer. It is a driver/program/module that is inserted into the existing driver stack to perform some specific function. A filter driver should not affect the...

 can also service one or more devices. 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.
  • Driver service
    Windows Service
    On Microsoft Windows operating systems, a Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention. Windows services can be configured to start when the operating system is booted and run in the background as long as...

    :
    This is a type of kernel-level filter driver implemented as a Windows service
    Windows Service
    On Microsoft Windows operating systems, a Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention. Windows services can be configured to start when the operating system is booted and run in the background as long as...

     that enables applications to work with devices.

VxD, WDM and Windows 98

Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

 based operating systems (Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

, Windows 98 Second Edition
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

, and Windows Me
Windows Me
Windows Millennium Edition, or Windows Me , is a graphical operating system released on September 14, 2000 by Microsoft, and was the last operating system released in the Windows 9x series. Support for Windows Me ended on July 11, 2006....

) are able to use both WDM and VxD
VxD
VxD is the device driver model used in Microsoft Windows/386, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extend also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 multitasker...

 (Virtual device driver) driver standards. Both drivers models can provide unique and different features for the same hardware. However, usually the newer WDM standard provides more features. For example, if a TV tuner card
TV tuner card
A TV tuner card is a kind of television tuner that allows television signals to be received by a computer. Most TV tuners also function as video capture cards, allowing them to record television programs onto a hard disk much like the Tivo digital video recorder does.-Variants: The interfaces for...

 using a VxD
VxD
VxD is the device driver model used in Microsoft Windows/386, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extend also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 multitasker...

 driver is able to capture images at a resolution of 384 x 288 pixels, the same TV Tuner card with the WDM driver model may be able to capture at a resolution of 768 x 576 pixels. This can be attributed to the new Broadcast Driver Architecture
Broadcast Driver Architecture
The Broadcast Driver Architecture is a Microsoft standard for digital video capture on Microsoft Windows operating systems. It encompasses the ATSC and DVB standards and gives developers a standardized method of accessing TV tuner devices...

 model which is part of WDM.

Criticism

The Windows Driver Model, while a significant improvement over the VxD
VxD
VxD is the device driver model used in Microsoft Windows/386, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extend also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 multitasker...

 and Windows NT driver model used before it, has been criticised by driver software developers http://www.wd-3.com/archive/FrameworkIntro.htm, most significantly for the following:
  • WDM has a very steep learning curve.
  • Interactions with power management
    Power management
    Power management is a feature of some electrical appliances, especially copiers, computers and computer peripherals such as monitors and printers, that turns off the power or switches the system to a low-power state when inactive. In computing this is known as PC power management and is built...

     events and plug and play are difficult. This leads to a variety of situations where Windows machines cannot go to sleep
    Sleep mode
    Sleep mode refers to a low power mode for electronic devices such as computers, televisions, and remote controlled devices. These modes save significant electrical consumption compared to leaving a device fully on and idle, but allow the user to avoid having to reset programming codes or wait for a...

     or wake up correctly due to bugs in driver code.
  • I/O cancellation is almost impossible to get right.
  • Thousands of lines of support code are required for every driver.
  • No support for writing pure user-mode drivers.


There were also a number of concerns about the quality of documentation and samples that Microsoft provided.

Because of these issues, Microsoft has released a new framework to replace WDM, called the Windows Driver Foundation
Windows Driver Foundation
Windows Driver Foundation is a set of Microsoft tools that aid in the creation of device drivers for Windows 2000 and later versions of Windows....

, which includes Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF). Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 supports both WDM and the newer Windows Driver Foundation
Windows Driver Foundation
Windows Driver Foundation is a set of Microsoft tools that aid in the creation of device drivers for Windows 2000 and later versions of Windows....

. KMDF is also available for download for Windows XP and even Windows 2000, while UMDF is available for Windows XP and above.

See also

  • Windows Driver Foundation
    Windows Driver Foundation
    Windows Driver Foundation is a set of Microsoft tools that aid in the creation of device drivers for Windows 2000 and later versions of Windows....

  • Kernel-Mode Driver Framework
  • User-Mode Driver Framework
    • Windows Display Driver Model
      Windows Display Driver Model
      Windows Display Driver Model is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista....


External links

  • WDM Input Output Concepts - This article gives a high level overview of the I/O concepts as defined in the Windows Driver Model.
  • Windows driver API basics - This article informs you about the basics behind soundcard drivers such as WDM, ASIO
    Audio stream input output
    Audio Stream Input/Output is a computer sound card driver protocol for digital audio specified by Steinberg, providing a low-latency and high fidelity interface between a software application and a computer's sound card...

    , MME, DirectX, etc.
  • Channel 9 Video - Interview with the Device Management and Installation team at Microsoft, primarily covering Plug-and-play
    Plug-and-play
    In computing, plug and play is a term used to describe the characteristic of a computer bus, or device specification, which facilitates the discovery of a hardware component in a system, without the need for physical device configuration, or user intervention in resolving resource conflicts.Plug...

    .

  • Kernel Survival guide - Free lecture notes book fragment detailing basic creation of Windows Drivers, Kernel Mode programming, and Memory management
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK