WdfUsbTargetDeviceGetDeviceDescriptor function

[Applies to KMDF and UMDF]

The WdfUsbTargetDeviceGetDeviceDescriptor method retrieves the USB device descriptor for the USB device that is associated with a specified framework USB device object.

Syntax

void WdfUsbTargetDeviceGetDeviceDescriptor(
  WDFUSBDEVICE           UsbDevice,
  PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor
);

Parameters

UsbDevice

A handle to a USB device object that was obtained from a previous call to WdfUsbTargetDeviceCreateWithParameters.

UsbDeviceDescriptor

A pointer to a caller-allocated USB_DEVICE_DESCRIPTOR structure that receives the USB device descriptor.

Return Value

None.

A bug check occurs if a driver-supplied object handle is invalid.

Remarks

For more information about the WdfUsbTargetDeviceGetDeviceDescriptor method and USB I/O targets, see USB I/O Targets.

Examples

The following code example obtains the USB device descriptor for a device. The example stores the descriptor in driver-defined context space.

PMY_DEVICE_CONTEXT  myDeviceContext;

myDeviceContext = GetDeviceContext(device);

WdfUsbTargetDeviceGetDeviceDescriptor(
                                      myDeviceContext->UsbTargetDevice,
                                      &myDeviceContext->UsbDeviceDescr
                                      );

Requirements

   
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfusb.h (include Wdfusb.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL PASSIVE_LEVEL
DDI compliance rules DriverCreate, KmdfIrql, KmdfIrql2, UsbKmdfIrql, UsbKmdfIrql2

See Also

USB_DEVICE_DESCRIPTOR

WdfUsbTargetDeviceCreateWithParameters