DescriptorType Property
The DescriptorType property gets or sets the value of the bDescriptorType 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_DescriptorType(
[in] BYTE bDescriptorType
);
HRESULT get_DescriptorType(
[out, retval] BYTE *pbDescriptorType
);
Property Value
The new descriptor type.
Error Codes
DescriptorType returns S_OK if the operation succeeds or E_POINTER if the pbDescriptorType parameter is not a valid pointer.
Remarks
The following C++ code example shows how to get the DescriptorType property.
HRESULT CLoopBackDevice::GetDeviceType(BYTE *pbDescriptorType)
{
HRESULT hr = S_OK;
BYTE bDescriptorType = 0;
if (NULL == m_piDevice)
{
hr = E_INVALIDARG;
goto Exit;
}
if(NULL == pbDescriptorType)
{
hr = E_POINTER;
goto Exit;
}
//Initialize the return size
*pbDescriptorType = 0;
// Get the descriptor type
hr = m_piDevice ->get_DescriptorType(pbDescriptorType);
Exit:
return hr;
}
Requirements
Header |
SoftUSBIf.h |
See Also
Send comments about this topic to Microsoft
Build date: 9/21/2010