WdfUsbInterfaceGetDescriptor - NtDoc

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

VOID WdfUsbInterfaceGetDescriptor(
  [in]  WDFUSBINTERFACE           UsbInterface,
  [in]  UCHAR                     SettingIndex,
  [out] PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

WdfUsbInterfaceGetDescriptor function

Description

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

Parameters

UsbInterface [in]

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

SettingIndex [in]

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

InterfaceDescriptor [out]

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

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

See also

USB_INTERFACE_DESCRIPTOR

WdfUsbTargetDeviceGetInterface