This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
This namespace defines Windows Runtime classes that a UWP app can use to communicate with
WinUSB
devices. These devices are handled by the inbox
winusb.sys
driver and are identified by a specific
Microsoft OS Descriptor
.
A valid WinUSB device will have a compatible id of
USB\MS_COMP_WINUSB
Device Support
This namespace supports most WinUSB devices. However, it does not provide access to USB devices with device classes of the following:
Audio (
0x01
)
HID (
0x03
)
Image (
0x06
)
Printer (
0x07
)
Mass Storage (
0x08
)
Smart Card (
0x0B
)
Audio/Video (
0x10
)
Wireless Controller (
0xE0
)
USB Device Capabilities
A UWP app that accesses a USB device must include specific device capability data in the capabilities node of its manifest. This data identifies the device and its purpose (or function). Note that some devices may have multiple functions.
Since Windows 10, version 1809 (October 2018 Update)
<DeviceCapability Name="usb"/>
Before Windows 10, version 1809 (October 2018 Update)
Since 1809, the VendorId/ProductId and function-type no longer need to be specified and will be ignored on newer systems. If targeting systems below 1809, then see legacy USB device capabilities.
Troubleshooting
Verify the USB capability (usb) is in the application manifest.
Verify the user has granted permission for the application to utilize USB devices.
Validate the device type is not one designated as inaccessible.
Machine-internal devices (DEVPKEY_Device_InLocalMachineContainer == TRUE) are generally not accessible unless running on a SKU with embedded mode and lowLevelDevices capability.
Devices with stacks that contain upper/lower filter drivers are generally not accessible. These are sometimes added by 3rd parties to enable additional functionality for custom hardware.
Device restriction is partially determined by winusb.sys during device enumeration, which may set the device interface property DEVPKEY_DeviceInterface_Restricted to TRUE on the WinUSB Device Interface GUID_DEVINTERFACE_WINUSB_WINRT based on the presence of device/class filters.
The presence of device UpperFilter/LowerFilter drivers can be determined using DeviceManager by looking for UpperFilters and LowerFilters properties.
The presence of WinUSB class UpperFilter/LowerFilter drivers can be determined using DeviceManager by looking for Class upper filters and Class lower filters properties.
Device Interface properties can be inspected by calling CM_Get_Device_Interface_Property where pszDeviceInterface is the same string as would be passed to FromIdAsync.
These restrictions can be bypassed when making a custom device by working with the driver-developer to create a Hardware Support App
Derives information from the first 9 bytes of a USB configuration descriptor. The information includes the power capabilities of the device when the configuration is active and the number of interfaces included in that configuration. For an explanation of a configuration descriptor, Section 9.6.3 Universal Serial Bus Specification. For information about descriptor fields, see:
Table 9.15 in the Universal Serial Bus 3.0 Specification
Table 9.10 in the Universal Serial Bus Specification (version 2.0)
Provides a way for you to retrieve a UsbDeviceClass object based on the USB device class of a device. The properties defined in this class represent the supported USB device classes, and they return UsbDeviceClass objects.
For information about USB device classes, see the official USB Website for Approved Class Specification Documents.
Derives information from the USB endpoint descriptor of the endpoint, such as type, direction, and endpoint number. This object also gets the specific endpoint descriptors based on the type of endpoint. For an explanation of an endpoint descriptor, see Section 9.6.5 in the Universal Serial Bus Specification:
Table 9.18 in the Universal Serial Bus 3.0 Specification
Table 9.13 in the Universal Serial Bus Specification (version 2.0)
Describes a USB alternate setting (of an interface) in an interface descriptor. For an explanation of an interface descriptor, see Section 9.6.5 in the Universal Serial Bus Specification:
Table 9.15 in the Universal Serial Bus 3.0 Specification
Table 9.12 in the Universal Serial Bus Specification (version 2.0)
The endpoint descriptor for a USB interrupt OUT endpoint. The descriptor specifies the endpoint type, direction, number and also the maximum number of bytes that can be written to the endpoint, in a single transfer. The app can also get information about how often the host polls the endpoint to send data.