WdfUsbTargetDeviceQueryUsbCapability function

[Applies to KMDF and UMDF]

The WdfUsbTargetDeviceQueryUsbCapability method determines whether the host controller and USB driver stack support a specific capability.


NTSTATUS WdfUsbTargetDeviceQueryUsbCapability(
  _In_            WDFUSBDEVICE UsbDevice,
  _In_      const PGUID        *CapabilityType,
  _In_            ULONG        CapabilityBufferLength,
  _Out_opt_       PVOID        CapabilityBuffer,
  _Out_opt_       PULONG       ResultLength



A handle to a USB device object.


A pointer to a GUID that represents the capability about which the client driver wants to retrieve information. The possible PGUID values are as follows:


See more information in Remarks.


Length, in bytes, of the buffer pointed to by CapabilityBuffer.


A pointer to a caller-allocated buffer to receive the requested USB capability. This parameter is optional. If CapabilityBufferLength is zero, this parameter must be NULL. Similarly, if CapabilityBufferLength is nonzero, this parameter must be supplied. This parameter corresponds to the OutputBuffer parameter of the USBD_QueryUsbCapability routine.


A pointer to a location containing the size, in bytes, of the returned capability. This parameter is optional.

Return Value

WdfUsbTargetDeviceQueryUsbCapability returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method can return one of the following values:

Return code Description
The USB device object handle is not valid.
Insufficient memory was available.
The caller passed an invalid parameter value.
  • UsbDevice or CapabilityType is NULL.
  • CapabilityBuffer is NULL but CapabilityBufferLength contains a nonzero value. Conversely, the caller provided a CapabilityBuffer but CapabilityBufferLength is zero.
The specified capability is not supported by the underlying USB driver stack.
The specified capability is not supported by the host controller hardware.

This method also might return other NTSTATUS values.


Before calling WdfUsbTargetDeviceQueryUsbCapability, the driver must call WdfUsbTargetDeviceCreateWithParameters to register with the underlying USB driver stack.

WdfUsbTargetDeviceQueryUsbCapability must be called after the driver's EvtDevicePrepareHardware callback function has been called.

The following table describes the USB-specific capabilities that a KMDF-based USB client driver can query through a WdfUsbTargetDeviceQueryUsbCapability call.

Capability GUID Description
GUID_USB_CAPABILITY_CHAINED_MDLS The new USB driver stack in Windows 8 is capable of accepting a chained MDL (see MDL) from the a KMDF-based USB client driver. For more information about the chained MDLs capability in the USB driver stack, see How to Send Chained MDLs.
This GUID applies to KMDF drivers only.
GUID_USB_CAPABILITY_STATIC_STREAMS Whereas USB 2.0 and earlier supports sending only a single data stream through a bulk endpoint, USB 3.0 permits sending and receiving multiple data streams through a bulk endpoint. For more information about opening streams, see How to Open and Close Static Streams in a USB Bulk Endpoint. This GUID applies to KMDF drivers only.
GUID_USB_CAPABILITY_FUNCTION_SUSPEND The Universal Serial Bus (USB) 3.0 specification defines a new feature called function suspend. The feature enables an individual function of a composite device to enter a low-power state, independently of other functions. For more information about function suspend, see How to Implement Function Suspend in a Composite Driver. This GUID applies to KMDF drivers only.
GUID_USB_CAPABILITY_SELECTIVE_SUSPEND For information about selective suspend, see USB Selective Suspend. This GUID applies to KMDF drivers only.
GUID_USB_CAPABILITY_DEVICE_CONNECTION_HIGH_SPEED_COMPATIBLE Determines whether the bus is operating at high-speed or higher. This GUID applies to KMDF and UMDF drivers.
GUID_USB_CAPABILITY_DEVICE_CONNECTION_SUPER_SPEED_COMPATIBLE Determines whether the bus is operating at SuperSpeed or higher. This GUID applies to KMDF and UMDF drivers.


Windows version Windows Vista
Target Platform Universal
Minimum KMDF version 1.11
Minimum UMDF version 2.0
Header wdfusb.h (include Wdfusb.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
DDI compliance rules DriverCreate

See Also