User-Mode Driver Framework Frequently Asked Questions
Windows Driver Frameworks (WDF) is a set of libraries that you can use to write device drivers that run on the Windows operating system. WDF defines a single driver model that is supported by two frameworks: Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF). This topic provides answers to frequently asked questions about UMDF.
You can run UMDF drivers on the following operating systems:
- Windows 8.1
- Windows 8
- Windows 7
- Windows Vista
- Windows XP
Windows 8.1 includes UMDF version 2.0.
You write a UMDF 2.0 driver in the C programming language, and you can easily compile the same driver for KMDF. To write a UMDF version 1 driver, you must use the COM programming model.
For more info, see Getting Started with UMDF.
As of Windows 8.1, UMDF 2.0 drivers run on Windows 8.1 only.
You can build UMDF 2.0, 1.11, and 1.9 drivers using Windows Driver Kit (WDK) 8.1 and Microsoft Visual Studio. For information about which versions of Windows can run drivers built using these UMDF versions, see UMDF Version History.
Yes. Even if your driver requires access to some kernel-mode resources or features, you might be able to split your driver into two parts. This approach enables you to benefit from some of the advantages of developing and running drivers in user mode.
A UMDF driver can receive I/O requests from a kernel-mode driver. For more info about kernel-mode clients, see Supporting Kernel-Mode Clients in UMDF 2.0 Drivers.
As a result of increased parity between KMDF and UMDF, however, you will rarely need to split a driver.
If your driver requires any of the less common features listed in Comparing UMDF 2.0 Functionality to KMDF, you must use KMDF. For all other drivers, your first choice should be UMDF.
If you start with UMDF and decide later to transition to KMDF, you can do so with minimal effort, as described in How to convert a KMDF driver to a UMDF 2.0 driver (and vice-versa).
UMDF drivers run in a driver host process, which runs in the security credentials of a LocalService account, although the host process itself is not a Windows service. Thus, user-mode drivers are as secure as any other user-mode service. When a UMDF driver issues I/O requests, it can optionally impersonate its client process. Impersonation enables the driver thread to run in the security context of the client so that the system performs access checks against the client's identity rather than that of the driver host process.
A user-mode driver can impersonate its client process only for I/O requests, and not for Plug and Play or other system messages.
At driver installation, the INF file sets a maximum impersonation level for the driver. Impersonation should be set at the lowest level possible to prevent "elevation-of-privilege" attacks. When a client application calls the CreateFile function, it specifies an impersonation level. The driver then requests this level of impersonation for each individual I/O request.
Performance is a high priority in developing UMDF. Although latency and CPU usage both increase somewhat, bus capacity is the primary gating factor for the types of devices that UMDF supports.
A user-mode driver is started by the Driver Manager and runs in a driver host process. A single instance of the driver can service simultaneous requests from multiple applications. To communicate with the driver, applications issue I/O requests to the driver's device through the Win32 API. The primary entry point in a user-mode driver is the IDriverEntry interface (UMDF 1.11 and earlier) or the DriverEntry routine (starting in UMDF 2.0), rather than a main() function.
A driver also includes additional interfaces or callbacks that are invoked in response to I/O requests and Plug and Play and power notifications. A device that is managed by a UMDF driver is integrated into the system and participates in Plug and Play and power management.
You can debug a UMDF driver by using user-mode debuggers or kernel-mode debuggers. For more info, see Debugging WDF Drivers.
Starting in UMDF version 2.0, you can use many of the commands in the Wdfkd.dll debugger extension library to debug your UMDF driver. For a list of commands, see Debugger Extensions. In addition, UMDF stores the UMDF trace log (or UMDF IFR) in kernel non-paged memory. For info about the IFR, see Using the Framework's Event Logger.
You can find discussion of all aspects of Windows drivers on the following forums:
Microsoft maintains the Windows Hardware WDK and Driver Development forum.
Open Systems Resources (OSR) moderates the OSR Online NTDEV List forum.