Share via


Length Property

The Length property gets or sets the value of the bLength 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_Length(
  [in]           BYTE bLength
);

HRESULT get_Length(
  [out, retval]  BYTE *pbLength
);

Property Value

The new length of the device descriptor.

Error Codes

Length returns S_OK if the operation succeeds or E_POINTER if the pbLength parameter is not a valid pointer.

Remarks

The following C++ code example shows how to get the Length property.

HRESULT CLoopBackDevice::GetDeviceLength(BYTE *pbLength)
{
HRESULT hr = S_OK;

 if(NULL == pbLength)
{
 hr = E_POINTER;
 goto Exit;
}

// Initialize the return size
*pbLength = 0;

// Get the descriptor length
 hr = m_piDevice ->get_Length(pbLength);
 if(FAILEDHr(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