The Frameworks: An Overview


Although the frameworks include a number of features that support the specific requirements of UMDF or KMDF drivers, most of the core WDF features are shared by both frameworks:

  • The frameworks provide objects that are abstractions of the standard objects that drivers require, such as driver objects, device objects, and I/O request objects.

  • Drivers access framework objects through a consistent, well-designed programming interface.

  • The frameworks manage object lifetimes, tracking objects that are in use and freeing them when they are no longer required.

  • The frameworks implement common driver features such as state machines to manage Plug and Play and power state, synchronization, I/O queues, registry access, and I/O request cancellation.

  • The frameworks manage the flow of I/O requests from Windows to the driver and coordinate I/O queues with Plug and Play and power management notifications.

  • Each framework works consistently across all supported versions of Windows so that WDF drivers can run on a new version of Windows with little or no modification.

A core principle of WDF is that most driver code should be devoted to managing the device, not handling routine interactions with the system such as tracking Plug and Play and power state. WDF provides an abstraction layer between the driver and Windows so that drivers interact with the frameworks for most services. This model allows WDF to provide intelligent, thoroughly tested defaults for common operations. A WDF driver opts in to override WDF defaults, as required by its device, and then allows the frameworks to handle the remaining operations. Developers are not required to implement large amounts of "boilerplate" code just to get a driver to successfully install and load.

The framework mediates interactions between a WDF driver and other drivers, and between the WDF driver and Windows. A WDF driver interacts with Windows or another driver through the various framework objects, which are used for purposes such as working with I/O requests, managing I/O flow, synchronization, memory buffers, and accessing hardware resources such as device registers or interrupts.

In addition to supporting features that all categories of devices use, WDF supports extensions for particular device categories to support features that are specific to those types of devices. For example, both UMDF and KMDF provide extensions for communicating with USB devices. As new features are added to Windows and as new categories of devices are supported, features that are common to all supported device categories will be added to the frameworks' DDI.

The following two sections discuss features that are specific to UMDF or KMDF.




Developing Drivers with the Microsoft Windows Driver Foundation
Developing Drivers with the Windows Driver Foundation (Pro Developer)
ISBN: 0735623740
EAN: 2147483647
Year: 2007
Pages: 224

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net