Skip to main content

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 Microsoft Visual Studio 2015 CTP 6, Microsoft Visual Studio Tools for Windows 10 Technical Preview, 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.

Important: You must install Visual Studio Professional 2012 or Visual Studio Ultimate before you install WDK 8.

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 2015 CTP 6 works with WDK 10 to build samples from the samples gallery. Visual Studio 2015 CTP 6 is available free. Click the Visual Studio 2015 CTP 6 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 2015 CTP 6 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.

What kind of driver samples are available?

Here are some of the Windows driver sample categories available for Windows 8.1.

What kind of driver samples are available for Windows 8.1?

Here are some of the sample categories available:

End-to-end HID sample for Windows 8.1

Check out the new end-to-end sample for HID, which 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.

End-to-end sample for HID

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.

Getting started with Windows drivers