Export (0) Print
Expand All
Expand Minimize

WinUsb_QueryInterfaceSettings function

The WinUsb_QueryInterfaceSettings function retrieves the interface descriptor for the specified alternate interface settings for a particular interface handle.


BOOL __stdcall WinUsb_QueryInterfaceSettings(
  _In_   WINUSB_INTERFACE_HANDLE InterfaceHandle,
  _In_   UCHAR AlternateSettingNumber,
  _Out_  PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor


InterfaceHandle [in]

An opaque handle to an interface in the selected configuration.

To retrieve the settings of the first interface, use the handle returned by WinUsb_Initialize. For all other interfaces, use the handle to the target interface, retrieved by WinUsb_GetAssociatedInterface.

AlternateSettingNumber [in]

A value that indicates which alternate settings to return. A value of 0 indicates the first alternate setting, a value of 1 indicates the second alternate setting, and so on.

UsbAltInterfaceDescriptor [out]

A pointer to a caller-allocated USB_INTERFACE_DESCRIPTOR structure that contains information about the interface that AlternateSettingNumber specified.

Return value

WinUsb_QueryInterfaceSettings returns TRUE if the operation succeeds. Otherwise, it returns FALSE, and the caller can retrieve the logged error by calling GetLastError.

GetLastError can return the following error code.

Return codeDescription

The caller passed NULL in the InterfaceHandle parameter.


The specified alternate interface was not found.



WinUsb_QueryInterfaceSettings parses the configuration descriptor previously retrieved by WinUsb_Initialize. For more information, see the Remarks section for WinUsb_Initialize.

The WinUsb_QueryInterfaceSettings call searches the interface array for the alternate interface specified by the interface index passed by the caller in the AlternateSettingNumber. If the specified interface is found, the function populates the caller-allocated USB_INTERFACE_DESCRIPTOR structure. If the specified interface is not found, then the call fails with the ERROR_NO_MORE_ITEMS code.



Winusb.h (include Winusb.h)



See also

WinUSB Functions



Send comments about this topic to Microsoft

© 2014 Microsoft