WdfUsbInterfaceGetDescriptor function (wdfusb.h)

[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

[in] UsbInterface

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

[in] SettingIndex

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

[out] InterfaceDescriptor

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

Return value

None

Remarks

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.

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

Requirement Value
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(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), UsbKmdfIrql(kmdf), UsbKmdfIrql2(kmdf), UsbKmdfIrqlExplicit(kmdf)

See also

USB_INTERFACE_DESCRIPTOR

WdfUsbTargetDeviceGetInterface