HandleStdDeviceRequests Property
The HandleStdDeviceRequests property gets or sets whether an endpoint should always handle standard device requests.
This property is read/write.
Syntax
HRESULT put_HandleStdDeviceRequests(
[in] VARIANT_BOOL fHandleStdRequests
);
HRESULT get_HandleStdDeviceRequests(
[out, retval] VARIANT_BOOL *pfHandleStdRequests
);
Property Value
The new value for HandleStdDeviceRequests that is sent to the endpoint.
Error Codes
HandleStdDeviceRequests returns one of the following values:
Name | Meaning |
---|---|
S_OK | The operation succeeded. |
E_POINTER | The pfHandleStdRequests parameter was not a valid pointer. |
Remarks
This property is a Boolean property. Setting this property TRUE indicates that the endpoint should handle all device requests. Setting this property to FALSE indicates that the simulated device should handle all of the device requests. The default setting for this property is TRUE.
If an endpoint should always handle standard device requests, an event sink will never receive OnSetupTransfer or OnDeviceRequest events for standard device requests and the endpoint will handle these requests based on its current state.
The following C++ code example shows how to set the HandleStdDeviceRequests property....
HRESULT CLoopBackDevice::UpdateHandleStdRequest(ISoftUSBEndpoint *piEndpoint)
{
HRESULT hr = S_OK;
VARIANT_BOOL fHandleStdRequest= FALSE;
VARIANT_BOOL fNewHandleStdRequest = TRUE;
if(NULL == piEndpoint)
{
hr = E_INVALIDARG;
goto Exit;
}
// Get the current value of HandleStdRequests
hr = piEndpoint->get_HandleStdRequest (&fHandleStdRequest);
if(FAILED(hr))
goto Exit;
// Update the handle standard request property if necessary
if (fNewHandleStdRequest != fHandleStdRequest)
{
hr = piEndpoint->put_HandleStdRequest (fNewHandleStdRequest);
if(FAILED(hr))
goto Exit;
}
Exit:
return hr;
}
Requirements
Header |
SoftUSBif.h |
See Also
Send comments about this topic to Microsoft
Build date: 9/21/2010