USB Property
The USB property gets or sets the value of the bcdUSB field of the device descriptor, as defined in section 9.6.1 of the USB 2.0 specification.
This property is read/write.
Syntax
HRESULT put_USB(
[in] SHORT sUSB
);
HRESULT get_USB(
[out, retval] SHORT *psUSB
);
Property Value
The new USB version number for the device.
Error Codes
USB returns S_OK if the operation succeeds or E_POINTER if the psUSB parameter is not a valid pointer.
Remarks
The USB property contains the USB release number.
The following C++ code example shows how to set and get the USB property.
HRESULT CLoopBackDevice::SetDeviceUSB(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
SHORT sUSB = 0;
SHORT sNewUSB= 0x0200; //binary coded decimal USB version 2.0
if (NULL == piDevice)
{
hr = E_INVALIDARG;
goto Exit;
}
// Get the current USB property
hr = piDevice->get_USB (&sUSB);
if(FAILED(hr))
goto Exit;
// Set the USB property if required.
if (sUSB!= sNewUSB)
{
hr = piDevice->put_USB (sNewUSB);
if(FAILED(hr))
goto Exit;
}
Exit:
return hr;
}
Requirements
Header |
SoftUSBif.h |
See Also
Send comments about this topic to Microsoft
Build date: 9/21/2010