{"docs":[{"id":155,"title":"KMDF, UMDF and WDM: Choosing a Windows Driver Framework","heading":"KMDF, UMDF and WDM: Choosing a Windows Driver Framework","subheading":null,"category":"Device Drivers","body":{"root":{"type":"root","children":[{"type":"heading","tag":"h3","version":1,"children":[{"type":"text","text":"Where each fits","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"UMDF 2 suits many USB, HID, sensor and simple bus devices, and Microsoft recommends it where it meets the requirements. It supports interrupts and access to device registers but not DMA, and it cannot sit below kernel-mode drivers in a device stack. KMDF covers the rest, including PCIe devices that use DMA and filter drivers in kernel-mode stacks.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Many device classes have their own model: NDIS and NetAdapterCx for networking, Storport for storage, WDDM for display and ACX for audio. Where one exists, use it. Because UMDF 2 and KMDF share most of their API, a driver started in UMDF can move to KMDF later with moderate rework.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"tags":"Device Drivers, Windows, KMDF, UMDF","cardCta":{"label":null,"link":null},"pageCta":{"label":"Talk to AAVICO engineering","link":"/contact"},"excerpt":"Windows offers several ways to write a driver, and the choice fixes how much kernel code you own. For most new hardware the answer is a framework, not raw WDM.","featuredImage":null,"type":"Blog","readTime":"3 min read","publishedAt":"2026-11-15T19:02:00.000Z","heroImage":null,"introText":"The Windows Driver Model is the foundation every Windows driver ultimately sits on, but writing to it directly means handling Plug and Play, power management and I/O cancellation yourself, which is where many historic driver bugs came from. The Windows Driver Frameworks wrap that model: KMDF for kernel-mode drivers and UMDF for user-mode drivers. Many device classes add their own models on top.","metrics":[{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-metric-1","value":"KMDF","label":"Kernel-Mode Driver Framework, which handles Plug and Play and power for the driver.","icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-metric-2","value":"UMDF 2","label":"User-Mode Driver Framework version 2, sharing most of the KMDF programming model.","icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-metric-3","value":"WDM","label":"The underlying driver model; direct use is now rare outside specialised cases.","icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-metric-4","value":"WDK","label":"The Windows Driver Kit, used with Visual Studio to build, test and package drivers.","icon":null}],"gallery":[],"challenge":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Older sample code and legacy drivers are often pure WDM, and copying them carries over the hardest parts of Windows driver writing: IRP handling, cancellation races and power state transitions.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Choosing kernel mode by default is the other common mistake. A KMDF driver that faults causes a system crash; a UMDF driver that faults ends its host process, and the device can often be restarted without a reboot.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"blockquote":{"quote":"Start in user mode, move to kernel mode only for what UMDF cannot do, and leave raw WDM to the cases that truly need it.","author":"","role":"AAVICO Engineering"},"supportImage1":null,"deliverables":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Check for an inbox Windows driver for the class, such as HID, USB serial, audio or mass storage; matching it may remove the need for a driver.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"If a driver is needed, start from UMDF 2 and list anything it cannot do, such as DMA. Only those needs justify KMDF.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Build with the current WDK, follow the driver package isolation and DCH guidance, and test under Driver Verifier from the first build.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"results":[{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-result-1","title":"Stability","description":"More code in user mode means fewer system crashes."},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-result-2","title":"Less Boilerplate","description":"The framework handles Plug and Play, power and I/O queue details."},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-result-3","title":"Portability","description":"Shared KMDF and UMDF APIs make a later move between modes practical."},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-result-4","title":"Supportability","description":"The driver follows patterns Microsoft documents and supports."}],"lookingAhead":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"For a vendor-specific USB device, consider WinUSB with a user-space application before writing any driver. For many devices it is enough.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Plan signing at the start: kernel-mode drivers need a Microsoft signature to load on current Windows.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"supportImage2":null,"testimonial":{"quote":null,"author":null,"role":null,"photo":null},"challengesSolved":[{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-challenge-1","title":"Cancellation and power bugs copied from old WDM samples","description":null,"icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-challenge-2","title":"Kernel-mode crashes from code that could run in user mode","description":null,"icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-challenge-3","title":"A custom driver for a device Windows already supports","description":null,"icon":null},{"id":"kmdf-umdf-and-wdm-choosing-a-windows-driver-fram-challenge-4","title":"Signing requirements found late in the schedule","description":null,"icon":null}],"relatedPosts":[],"contactUs":{"show":true},"updatedAt":"2026-11-15T17:32:32.682Z","createdAt":"2026-11-15T17:32:32.682Z"}],"hasNextPage":false,"hasPrevPage":false,"limit":10,"nextPage":null,"page":1,"pagingCounter":1,"prevPage":null,"totalDocs":1,"totalPages":1}