Share via


Length Property

The Length property gets or sets the bLength field of the endpoint descriptor, as described in section 9.6.6 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 endpoint 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 of the SoftUSBEndpoint descriptor.

HRESULT CLoopBackDevice::GetEndpointSize(BYTE *pbSize)
{
HRESULT hr = S_OK;
 if(NULL == pbSize)
{
 hr = E_POINTER;
 goto Exit;
}

// Initialize the return size
*pbSize = 0;


// Get the descriptor length
 hr = m_piEndpoint ->get_Length(pbSize);
 if(FAILED(hr))
 goto Exit;

Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBEndpoint

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010