Windows driver code samples
To help you write drivers for Windows, we provide driver code samples and the necessary development tools. Whether you’re getting started or porting an older driver to the newest version of Windows, driver samples are valuable guides on how to write device drivers that deliver a great experience with Windows.
Driver samples for Windows 10
These are the official Microsoft Windows Driver Kit (WDK) team driver code samples for Windows 10. They provide a foundation for universal driver support of all hardware form factors, from phones to desktop PCs. Use these samples with Visual Studio Community 2015, Visual Studio Tools for Windows 10, Windows SDK for Windows 10, and WDK 10.
Driver samples for Windows 8
These are the official Microsoft WDK team driver code samples for Windows 8.1. Use these samples with Microsoft Visual Studio Express 2013 for Windows Desktop and WDK 8.1 Update.
Visual Studio with the Windows Driver Kit (WDK)
Samples are downloaded as entire Visual Studio solutions, so you need Visual Studio and the WDK to build a driver sample. Together, Visual Studio and the WDK make up a complete driver development environment that you can use to install, deploy, test, and debug your drivers, as well as build them.
For building Windows 10 driver samples, Visual Studio Community 2015 works with WDK 10 to build samples from the samples gallery. Visual Studio Community 2015 is available free. Click the Visual Studio Community 2015 link below and click here to join or sign in to the Windows Insider Program.
For building Windows 8.1 driver samples, Visual Studio Express 2013 for Windows Desktop, a free development environment, works with the Windows Driver Kit (WDK) 8.1 Update. This combination of freely available tools supports many of the samples from the samples gallery. Just check the description page for a sample to see if it will work with Visual Studio Express 2013 for Windows Desktop.
Tools for Windows 10 driver samples
Download Visual Studio Community 2015 and WDK 10 to build driver samples for Windows 10.
Tools for Windows 8 driver samples
Download Visual Studio 2013 (or Visual Studio Express 2013 for Desktop) and WDK 8.1 Update to build driver samples for Windows 8.1, Windows 8, and Windows 7.
End-to-end HID sample for Windows 8.1
This end-to-end sample for HID, consists of a passive-infrared motion sensor, device firmware, and a Windows Runtime (WinRT) app that monitors the sensor and triggers a video capture when motion is detected. The app lets the user establish a connection to the device, enable video captures, and set the interval at which the sensor transmits data.
Two tutorials are included with the Visual Studio projects for the firmware and app. The first describes the creation of the device and firmware, and the second describes the creation of the app.
New to driver development?
If you’re interested in using a sample to get started in Windows driver development, see the topic “Getting started with Windows drivers” for an introduction to the process.