Expand Minimize

WdfUsbInterfaceGetDescriptor method

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

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

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

Show:
© 2014 Microsoft. All rights reserved.