WinUsb_GetCurrentAlternateSetting function (winusb.h)

The WinUsb_GetCurrentAlternateSetting function gets the current alternate interface setting for an interface. This is a synchronous operation.

Syntax

BOOL WinUsb_GetCurrentAlternateSetting(
  [in]  WINUSB_INTERFACE_HANDLE InterfaceHandle,
  [out] PUCHAR                  SettingNumber
);

Parameters

[in] InterfaceHandle

An opaque handle to an interface in the selected configuration. To get the current alternate setting in the first (default) interface on the device, use the interface handle returned by WinUsb_Initialize. For all other interfaces, use the handle to the target interface, retrieved by WinUsb_GetAssociatedInterface.

[out] SettingNumber

A pointer to an unsigned character that receives an integer that indicates the current alternate setting.

Return value

WinUsb_GetCurrentAlternateSetting returns TRUE if the operation succeeds. Otherwise, this routine returns FALSE, and the caller can retrieve the logged error by calling GetLastError.

GetLastError can return the following error code.

Return code Description
ERROR_INVALID_HANDLE
The caller passed NULL in the InterfaceHandle parameter.

Requirements

Requirement Value
Target Platform Universal
Header winusb.h (include Winusb.h)
Library Winusb.lib
DLL Winusb.dll

See also

WinUSB

WinUSB Functions

WinUsb_Initialize