Share via


AlternateForInterface Property

The AlternateForInterface property gets the ISoftUSBInterface object that represents the currently selected alternate for the specified interface number.

This property is read-only.

Syntax

HRESULT get_AlternateForInterface(
  [in]           BYTE bInterface,
  [out, retval]  ISoftUSBInterface **ppiInterface
);

Property Value

AlternateForInterfacebInterfaceBYTEThe interface number of the interface to retrieve.ppiInterfaceISoftUSBInterfaceCaller-allocated space to hold the returned interface. This interface is the interface for the specified interface number.HRESULTAlternateForInterface returns one of the following values:S_OKThe operation succeeded.E_POINTERThe *ppiInterface parameter was not a valid pointer.

Error Codes

AlternateForInterface returns one of the following values:

Name Meaning
S_OK

The operation succeeded.

E_POINTER

The *ppiInterface parameter was not a valid pointer.

Remarks

The AlternateForInterface property is used to determine the response data that is returned from a GET_INTERFACE request that is sent to the device, as described in section 9.4.4 of the USB 2.0 specification.

The following C++ code example shows how to get the alternate interface for the current interface.

HRESULT CLoopBackDevice::GetAlternateInterface(ISoftUSBInterface **ppiInterface)
{
HRESULT hr = OK;
BYTE        bCurrentInterface
 

 if (NULL == ppiInterface)
{
 hr = E_INVALIDARG;
 goto Exit;
}
 hr = m_piConfiguration->get_Interface (&bCurrentInterface);
 if (!(FAILED(hr))
{
  hr = m_piConfiguration->get_AlternateForInterface(bCurrentInterface. 
         ppiInterface);
}

Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBConfiguration

ISoftUSBConfiguration::Interfaces

ISoftUSBConfiguration::Interfaces

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010