// wdfusb.h
VOID WdfUsbInterfaceGetDescriptor(
[in] WDFUSBINTERFACE UsbInterface,
[in] UCHAR SettingIndex,
[out] PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
);
View the official Windows Driver Kit DDI referenceNo description available.
[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.
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.
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.
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
);
WdfUsbTargetDeviceGetInterface