Expand Minimize

WinUsb_QueryInterfaceSettings function

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

Syntax


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

Parameters

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
ERROR_INVALID_HANDLE

The caller passed NULL in the InterfaceHandle parameter.

ERROR_NO_MORE_ITEMS

The specified alternate interface was not found.

 

Remarks

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.

Requirements

Header

Winusb.h (include Winusb.h)

Library

Winusb.lib

See also

WinUSB
WinUsb_Initialize
USB_INTERFACE_DESCRIPTOR
WinUSB Functions

 

 

Send comments about this topic to Microsoft

Build date: 12/5/2013

Show:
© 2014 Microsoft. All rights reserved.