WdfUsbInterfaceGetDescriptor function

[Applies to KMDF and UMDF]

The WdfUsbInterfaceGetDescriptor method retrieves the USB interface descriptor that is associated with a specified alternate setting of a specified USB interface.

Syntax

VOID WdfUsbInterfaceGetDescriptor(
  _In_  WDFUSBINTERFACE           UsbInterface,
  _In_  UCHAR                     SettingIndex,
  _Out_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
);

Parameters

UsbInterface

A handle to a USB interface object that was obtained by calling WdfUsbTargetDeviceGetInterface.

SettingIndex

An index value that identifies an alternate setting for the interface. For more information about alternate settings, see the USB specification.

InterfaceDescriptor

A pointer to a caller-allocated USB_INTERFACE_DESCRIPTOR structure that the framework fills in.

Return Value

None.

If the SettingIndex value is invalid, the USB_INTERFACE_DESCRIPTOR structure can receive invalid data.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

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

Examples

The following code example obtains the alternate setting index for a specified USB interface. Then, the example obtains the USB interface descriptor that represents the USB interface's current alternate setting.

BYTE  settingIndex;
USB_INTERFACE_DESCRIPTOR  interfaceDescriptor;

settingIndex = WdfUsbInterfaceGetConfiguredSettingIndex(
                             UsbInterface
                             );

WdfUsbInterfaceGetDescriptor(
                             UsbInterface,
                             settingIndex,
                             &interfaceDescriptor
                             );

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 "<=DISPATCH_LEVEL"
DDI compliance rules DriverCreate, KmdfIrql, KmdfIrql2, UsbKmdfIrql, UsbKmdfIrql2

See Also

USB_INTERFACE_DESCRIPTOR

WdfUsbTargetDeviceGetInterface

Send comments about this topic to Microsoft