Share via


DeviceSubClass Property

The DeviceSubClass property returns the value of the bDeviceSubClass field of the device descriptor, as defined in section 9.6.1 of the USB 2.0 specification. This property is read/write.

This property is read/write.

Syntax

HRESULT put_DeviceSubClass(
  [in]           BYTE bDeviceSubClass
);

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

Property Value

The new device subclass.

Error Codes

DeviceSubClass returns an HRESULT value.

Remarks

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

HRESULT CLoopBackDevice::SetDeviceSubClass(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
BYTE         bDeviceSubClass= 0;
BYTE         bNewDeviceSubClass = 0xff; //Vendor specific sub class 

 if (NULL == piDevice)
{
 hr = E_POINTER;
 goto Exit;
}

 hr = piDevice->get_DeviceSubClass(&bDeviceSubClass);
 if(FAILED(hr))
 goto Exit;

 if (bDeviceSubClass != bNewDeviceSubClass)
{
 hr = piDevice->put_DeviceClass(bNewDeviceSubClass);
 if(FAILED(hr))
 goto Exit;
}
Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010