Share via


DeviceSubClass Property

The DeviceSubClass gets or sets the bDeviceSubClass field of the device qualifier descriptor, as described in section 9.6.2 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_DeviceSubClass(
  [in]           BYTE bDeviceSubClass
);

HRESULT get_DeviceSubClass(
  [out, retval]  BYTE *pbDeviceSubClass
);

Property Value

The new value for the device subclass.

Error Codes

DeviceSubClass returns S_OK if the operation succeeds or E_POINTER if the pbDeviceSubClass parameter is not a valid pointer.

Remarks

The following C++ code example shows how to get and set DeviceSubClass property.

HRESULT CLoopBackDevice::SetDeviceQualifierDeviceSubClass(ISoftUSBDeviceQualifier *piQualifier)
{
HRESULT hr = S_OK;
BYTE         bDeviceSubClass = 0;
BYTE         bNewDeviceSubClass = 0xff; //Vendor specific

if (NULL == piQualifier)
{
  hr = E_INVALIDARG;
  goto Exit;
}

// Get the current device subclass value
hr = piQualifier->get_DeviceSubClass(&bDeviceSubClass);
if(FAILED(hr))
  goto Exit;
 
// Update the device subclass if required
if (bDeviceSubClass != bNewDeviceSubClass)
{
  hr = piQualifier->put_DeviceSubClass(bNewDeviceSubClass);
  if(FAILED(hr))
    goto Exit;
}
Exit:
return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDeviceQualifier

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010