KMDF Drivers
About the Kernel Mode Driver Framework (KMDF)
The Kernel Mode Driver Framework encapsulates much of WDM, often making it easier to write WDM drivers. KMDF is often suitable for writing
- 1394 drivers
- USB drivers
- Functional device drivers (FDO)
- Filter device drivers
- Physical device drivers (PDO)
- Legacy device drivers
Outside of the Windows DDK, the starting point for the Kernel Mode Driver Framework is Developing Drivers with the Windows Driver Foundation (Pro Developer)
Need help with a KMDF driver project? Learn about our Windows driver development services or contact us to discuss your requirements.
KMDF vs WDM vs UMDF: Choosing the Right Framework
KMDF is the recommended starting point for most new kernel-mode device drivers. It sits on top of the Windows Driver Model (WDM) and handles the aspects of kernel driver development that are high-effort and high-risk to implement manually: PnP state machines, power management transitions, I/O request queuing, DMA buffer management, interrupt handling, and object lifetime management. A KMDF driver expresses its intent through framework callbacks and framework-managed objects rather than by directly manipulating IRPs, which eliminates an entire class of subtle completion and cancellation bugs that WDM drivers are prone to.
WDM remains appropriate when a driver needs direct IRP-level control that KMDF does not expose: certain filter driver scenarios, drivers that must interoperate with legacy WDM stacks in specific ways, or file system minifilter drivers, which use the Filter Manager framework rather than KMDF or WDM directly. UMDF (User-Mode Driver Framework) moves the driver out of the kernel entirely and runs it in a user-mode host process. A crash in a UMDF driver restarts the driver host process rather than crashing the machine. USB peripheral drivers, HID devices, sensors, and other hardware that does not require DMA or interrupt handling at kernel IRQL are good UMDF candidates. If a driver does not need to run at kernel privilege, UMDF is the safer choice.
What KMDF Manages for You
The concrete benefit of KMDF is that it handles several of the most error-prone parts of Windows driver development correctly, shielding your driver from having to get them right from scratch:
- PnP and power management. KMDF handles the full Plug and Play state machine and power management transitions, routing events to your callbacks only when your driver needs to take action. Drivers written in raw WDM must implement this state machine manually, and getting it wrong produces crashes during sleep/wake cycles or device hot-plug.
- I/O queuing. KMDF provides configurable I/O queues (sequential, parallel, or manual dispatch) that automatically handle IRP cancellation, request requeuing, and forward-progress guarantees. This removes a well-known category of race conditions in IRP management.
- Object lifetime management. KMDF objects have well-defined lifetimes managed by a parent-child relationship. When a parent object is deleted, all child objects are cleaned up automatically, reducing the risk of resource leaks on device removal or driver unload.
- DMA and interrupt handling. KMDF provides DMA enabler objects and interrupt objects with correct synchronization between ISR and DPC contexts, abstracting platform-specific DMA interface differences.
The WDK Toolchain
KMDF development requires the Windows Driver Kit (WDK), which Microsoft distributes as a Visual Studio extension. The WDK includes the KMDF headers and link libraries, the driver build system based on MSBuild, the WDK samples, and the tools needed for testing: Driver Verifier, WinDbg, and the Windows Hardware Lab Kit (HLK) for certification testing. Driver Verifier with its KMDF-specific verifier options is a standard part of the test pass for every KMDF driver we deliver. For diagnosing KMDF driver issues that survive Driver Verifier, our kernel debugging services use WinDbg as the primary tool, and the KMDF debugger extension (!wdfkd) provides framework-aware inspection of KMDF object state.
For clients building KMDF drivers, we provide development from scratch, review and remediation of existing KMDF code, and debugging support for KMDF drivers that are crashing or behaving incorrectly. See our Windows driver development services for the full picture of our kernel-mode development capabilities, or contact us to discuss a specific KMDF project.
Frequently Asked Questions
- What is KMDF (Kernel-Mode Driver Framework)?
- KMDF is a higher-level abstraction over the Windows Driver Model (WDM), maintained by Microsoft and shipped as part of the Windows Driver Kit. It provides framework-managed objects for device, queue, request, and synchronization that handle common boilerplate — power management state machines, Plug and Play event sequences, I/O cancellation, and DMA buffer management — so developers can focus on hardware-specific logic. KMDF is the preferred starting point for any new device driver that does not require direct access to WDM internals.
- When should I use KMDF versus WDM or UMDF?
- KMDF is the right choice for most kernel-mode device drivers targeting Windows Vista and later. WDM should be reserved for situations where the driver needs direct control over IRP flow that KMDF does not expose, or where it must interoperate tightly with legacy WDM components. UMDF (User-Mode Driver Framework) is appropriate for drivers that do not require kernel-level access — USB peripheral drivers, HID devices, and sensor drivers are common UMDF candidates. If kernel access is not strictly required, UMDF is safer because a bug crashes only the driver host process rather than the entire system.
- What hardware types does KMDF support?
- KMDF supports USB, PCI, IEEE 1394 (FireWire), and general-purpose I/O buses. It handles PnP enumeration, power state transitions, and I/O request queuing for all of these bus types through a uniform object model. For custom or proprietary buses, KMDF bus drivers can enumerate child devices through the framework's PDO (physical device object) support.
- Is KMDF suitable for filter drivers?
- Yes. KMDF supports filter drivers through its filter device object model, where the filter sits above or below the functional device object in the device stack. File system filter drivers are a distinct category and use a separate framework — the Filter Manager with its minifilter model — rather than KMDF. KMDF filter drivers are most commonly used for bus filters and device filters in the storage and input device stacks.
- What tools do I need to develop a KMDF driver?
- KMDF development requires the Windows Driver Kit (WDK), available from Microsoft, which includes headers, libraries, build tooling, and sample drivers. Visual Studio is the standard IDE, integrated with the WDK build system. For testing and debugging, WinDbg and a second test machine — physical or virtual — running with kernel debugging enabled are essential. Driver Verifier should be enabled on the test machine to surface memory, locking, and IRP handling errors early in development.
Technologies
Developer Tools
What our customers say about us?

Read our customer testimonials to find out why our clients keep returning for their projects.
View Testimonials
