Share via


NumConfigurations Property

The NumConfigurations property gets or sets the bNumConfigurations 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_NumConfigurations(
  [in]           BYTE bNumConfigs
);

HRESULT get_NumConfigurations(
  [out, retval]  BYTE *pbNumConfigs
);

Property Value

The new number of configurations value for the device qualifier.

Error Codes

NumConfigurations returns S_OK if the operation succeeds or E_POINTER if the pbNumConfigs parameter is not a valid pointer.

Remarks

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

HRESULT CLoopBackDevice::SetDeviceQualifierNumConfigs(ISoftUSBDeviceQualifier *piQualifier)
{
HRESULT hr = S_OK;
BYTE         bNumConfigs = 0;
BYTE         bNewNumConfigs = 1;

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

// Get the current number of configurations
hr = piQualifier->get_NumConfigs (&bNumConfigs);
if(FAILED(hr))
  goto Exit;
 
// Update the number of configurations if required
if (bNumConfigs!= bNewNumConfigs)
{
  hr = piQualifier->put_NumConfigs (bNewNumConfigs);
  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