Share via


DeviceQualifier Property

The DeviceQualifier property gets or sets the ISoftUSBDeviceQualifier object that represents the Device_Qualifier descriptor for a device.

This property is read/write.

Syntax

HRESULT put_DeviceQualifier(
  [in]   ISoftUSBDeviceQualifier *piDeviceQualifier
);

HRESULT get_DeviceQualifier(
  [out]  ISoftUSBDeviceQualifier **ppiDeviceQualifier
);

Property Value

A pointer to the new device qualifier for the device.

Error Codes

DeviceQualifier returns one of the following values:

This property can also return other standard COM return values.

Name Meaning
S_OK

The operation succeeded.

E_POINTER

The ppiDeviceQualifier parameter was not a valid pointer.

E_INVALIDARG

The piDeviceQualifier parameter was not a valid ISoftUSBDeviceQualifier object.

Examples

The following C++ code example shows how to get the DeviceQualifier property.

HRESULT CLoopBackDevice::CreateDeviceQualifier()
{
HRESULT hr = S_OK;
 ISoftUSBDeviceQualifier *piQualifier = NULL;

 hr = ::CoCreateInstance(CLSID_SoftUSBDeviceQualifier,
  NULL,
  CLSCTX_INPROC_SERVER,
  __uuidof(ISoftUSBDeviceQualifier),
 Reinterpret_cast<void**>(&piQualifier));

 if(FAILED(hr)
 goto Exit;

// Add the qualifier to the device
 hr = m_piDevice->put_DeviceQualifier(piQualifier);
 if(FAILED(hr))
 goto Exit;
Exit:
 if (NULL != piQualifier)
{
  piQualifier->Release();
} 

 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDevice

ISoftUSBDeviceQualifier

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010