WinUsb_GetAssociatedInterface function
The WinUsb_GetAssociatedInterface function retrieves a handle for an associated interface. This is a synchronous operation.
Syntax
BOOL __stdcall WinUsb_GetAssociatedInterface( _In_ WINUSB_INTERFACE_HANDLE InterfaceHandle, _In_ UCHAR AssociatedInterfaceIndex, _Out_ PWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle );
Parameters
- InterfaceHandle [in]
- 
An opaque handle to the first (default) interface on the device, which is returned by WinUsb_Initialize. 
- AssociatedInterfaceIndex [in]
- 
An index that specifies the associated interface to retrieve. A value of 0 indicates the first associated interface, a value of 1 indicates the second associated interface, and so on. 
- AssociatedInterfaceHandle [out]
- 
A handle for the associated interface. Callers must pass this interface handle to WinUSB Functions exposed by Winusb.dll. To close this handle, call WinUsb_Free. 
Return value
WinUsb_GetAssociatedInterface returns TRUE if the operation succeeds. Otherwise, this routine returns FALSE, and the caller can retrieve the logged error by calling GetLastError.
| Return code | Description | 
|---|---|
| 
 | WinUsb_GetAssociatedInterface has already returned a handle for the interface that AssociatedInterfaceIndex specifies. | 
| 
 | The caller passed NULL in the InterfaceHandle parameter. | 
| 
 | The passed AssociatedInterfaceIndex value failed an integer overflow check. | 
| 
 | An interface does not exist for the specified AssociatedInterfaceIndex value. | 
| 
 | Indicates that there is insufficient memory to perform the operation. | 
Remarks
The WinUsb_GetAssociatedInterface routine retrieves an opaque handle.
The first associated interface is the interface that immediately follows the interface whose handle the WinUsb_Initialize routine retrieves.
The handle that WinUsb_GetAssociatedInterface returns must be released by calling WinUsb_Free.
Callers of WinUsb_GetAssociatedInterfacecan retrieve only one handle for each interface. If a caller attempts to retrieve more than one handle for the same interface, the routine will fail with an error of ERROR_ALREADY_EXISTS.
Requirements
| Header | 
 | 
|---|---|
| Library | 
 | 
See also
Send comments about this topic to Microsoft
Build date: 12/5/2013

