Developing Windows client drivers for USB devices

Purpose

This section describes Universal Serial Bus (USB) support in the Windows operating system, so that you can develop USB device drivers that are interoperable with Windows.

Where applicable

USB devices are peripherals, such as mouse devices and keyboards, that are connected to a computer through a single port. A USB client driver is the software installed on the computer that communicates with the hardware to make the device function. If the device belongs to a device class supported by Microsoft, Windows loads one of the Microsoft-provided USB drivers (in-box class drivers) for the device. Otherwise, a custom client driver must be provided by the hardware manufacturer or a third party vendor. The user installs the client driver for the device when the device is first detected by Windows. After successful installation, Windows loads the client driver every time the device is attached and unloads the driver when the device is detached from the host computer.

You can develop a custom client driver for a USB device by using the Windows Driver Frameworks (WDF) or the Windows Driver Model (WDM). Instead of communicating with the hardware directly, most client drivers send their requests to the Microsoft-provided USB driver stack that makes hardware abstraction layer (HAL) function calls to send the client driver's request to the hardware. The topics in this section describe the typical requests that a client driver can send and the device driver interfaces (DDIs) that the client driver must call to create those requests.

Developer audience

A client driver for a USB device is a WDF or WDM driver that communicates with the device through DDIs exposed by the USB driver stack. This section is intended for use by C/C++ programmers who are familiar with WDM. Before you use this section, you should understand basic driver development. For more information, see Getting Started with Windows Drivers. For WDF drivers, the client driver can use Kernel-Mode Driver Framework (KMDF) or User-Mode Driver Framework (UMDF) interfaces designed specifically to work with USB targets. For more information about the USB-specific interfaces, see Framework USB Reference and UMDF USB I/O Target Interfaces.

Development tools

The Windows Driver Kit (WDK) contains resources that are required for driver development, such as headers, libraries, tools, and samples.

Windows 8.1 Preview: Download kits, bits, and tools

USB programming reference

Gives specifications for I/O requests, support routines, structures, and interfaces used by USB client drivers. Those routines and related data structures are defined in the WDK headers.

USB driver samples

Use these samples to get started with USB client driver programming.

Related standards and specifications

You can download official USB specifications from the Universal Serial Bus Documents website. This website contains links to the Universal Serial Bus Revision 3.0 Specification and the Universal Serial Bus Revision 2.0 specification.

Documentation sections

Getting started with USB client driver development

Introduces you to USB driver development. Provides information about choosing the most appropriate model for providing a USB driver for your device.
Write, build, and install your first skeleton user-mode and kernel-mode USB drivers by using the USB templates included with Microsoft Visual Studio.

USB Driver Stack Architecture

Provides an overview of the USB driver stack architecture.

About USB Block Requests (URBs)

Learn how a client driver builds a variable-length data structure called a USB Request Block (URB) to submit requests to the USB driver stack.

USB descriptors

Learn how a client driver builds a variable-length data structure called a USB Request Block (URB) to submit requests to the USB driver stack.

Selecting a USB configuration in USB drivers

Device configuration refers to the tasks that the client driver performs to select a USB configuration and an alternate interface in each interface. The section shows the methods calls required to select a USB configuration.

Sending USB data transfers in USB client drivers

Device configuration refers to the tasks that the client driver performs to select a USB configuration and an alternate interface in each interface. The section shows the methods calls required to select a USB configuration.

Implementing power management in USB client drivers

Use the power management abilities of USB devices that comply with the Universal Serial Bus (USB) specification have a rich and complex set of power management features.

 

Related topics

Universal Serial Bus (USB)

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.