Configuration Property

The Configuration property gets or sets the iConfiguration field of the configuration descriptor, as described in section 9.6.3 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_Configuration(
  [in]           BYTE bConfig
);

HRESULT get_Configuration(
  [out, retval]  BYTE *pbConfig
);

Property Value

The new number of the configuration property.

Error Codes

Configuration returns S_OK if the operation succeeds or E_POINTER if the pbConfigValue parameter is not a valid pointer.

Remarks

The following C++ code example shows how to set the Configuration value.

HRESULT SetConfiguration(ISoftUSBConfiguration *piConfig)
{
 HRESULT  hr             = S_OK;
    BYTE     bCurrentConfig = 0;
    BYTE     bConfigIndex   = 3;

 hr = piConfig->get_Configuration(&bCurrentConfig);
 if (SUCCEEDED(hr))
    {
 if (bConfigIndex != bCurrentConfig)
        {
 hr = piConfig->put_Configuration(bConfigIndex);
        }
    }

 return hr;
}

Requirements

Header

SoftUSBif.h

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010