Share via


ProductDesc Property

The ProductDesc property gets or sets the product description, which is the value of the iProduct field of the device descriptor as defined in section 9.6.1 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_ProductDesc(
  [in]           BYTE bProductDesc
);

HRESULT get_ProductDesc(
  [out, retval]  BYTE *pbProductDesc
);

Property Value

The new product descriptor string index.

Error Codes

ProductDesc returns S_OK if the operation succeeds or E_POINTER if the pbProductDesc parameter is not a valid pointer.

Remarks

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

HRESULT CLoopBackDevice::UpdateProductDescriptor(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
BYTE        bProductDesc= 0;
BYTE        bNewProductDesc = STRING_IDX_PRODUCT;

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

// Get the current product descriptor
 hr = piDevice->get_ProductDesc(&bProductDesc);
 if(FAILED(hr))
 goto Exit;

// Update the product descriptor if required
 if (bNewProductDesc != bProductDesc)
{
 hr = piDevice->put_ProductDesc (bNewProductDesc);
 if(FAILED(hr))
 goto Exit;
}
Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDevice

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010