Vendor Property

The Vendor property gets or sets the value of the idVendor 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_Vendor(
  [in]           SHORT sVendor
);

HRESULT get_Vendor(
  [out, retval]  SHORT *psVendor
);

Property Value

The new vendor ID for the device.

Error Codes

Vendor returns S_OK if the operation succeeds or E_POINTER if the psVendor parameter is not a valid pointer.

Remarks

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

HRESULT CLoopBackDevice::SetDeviceVendor(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
SHORT       sVendor = 0;
SHORT       sNewVendor= 0x045E; //Microsoft Vendor ID

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

// Get the current vendor ID
 hr = piDevice->get_Vendor (&sVendor);
 if(FAILED(hr))
 goto Exit;
 
// Update the vendor ID if required
 if (sVendor != sNewVendor)
{
 hr = piDevice->put_Vendor (sNewVendor);
 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