WdfUsbTargetDeviceGetDeviceDescriptor - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfusb.h

VOID WdfUsbTargetDeviceGetDeviceDescriptor(
  [in]  WDFUSBDEVICE           UsbDevice,
  [out] PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfusb-wdfusbtargetdevicegetdevicedescriptor)

WdfUsbTargetDeviceGetDeviceDescriptor function

Description

[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.

Parameters

UsbDevice [in]

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

UsbDeviceDescriptor [out]

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

Remarks

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

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
                                      );

See also

USB_DEVICE_DESCRIPTOR

WdfUsbTargetDeviceCreateWithParameters