Attributes Property

The Attributes property returns the bmAttributes field of the configuration descriptor, as described in section 9.6.3 of the USB 2.0 specification. This property is read/write.

This property is read/write.

Syntax

HRESULT put_Attributes(
  [in]           BYTE bAttributes
);

HRESULT get_Attributes(
  [out, retval]  BYTE *pbAttributes
);

Property Value

The new value of the attributes.

Error Codes

Attributes returns S_OK if the operation succeeds or E_POINTER if the pbAttributes parameter is not a valid pointer.

Remarks

The following C++ code example shows how to set the Attributes property.

HRESULT SetConfigToSelfPowered(ISoftUSBConfiguration *piConfig)
{
    HRESULT hr           = S_OK;
    BYTE    bAttributes  = 0;
    BYTE    bSelfPowered = 0x40;

 hr = piConfig->get_Attributes(&bAttributes);
 if (SUCCEEDED(hr))
    {
 if ( (bSelfPowered & bAttributes) != bSelfPowered )
        {
 bSelfPowered |= bAttributes;
 hr = piConfig->put_Attributes(bSelfPowered);
        }
    }

 return hr;
}

Requirements

Header

SoftUSBif.h

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010