IWDFIoRequest2::Reuse method

The Reuse method reinitializes a framework request object so that it can be reused.

Syntax


void Reuse(
  [in]  HRESULT hrNewStatus
);

Parameters

hrNewStatus [in]

An HRESULT-typed status value that the framework assigns to the request.

Return value

None.

Remarks

If a framework-based driver calls IWDFDevice::CreateRequest to create request objects, the driver can reuse those request objects. Drivers can also reuse request objects that they receive from the framework in their I/O queues.

A driver can reuse a request object after the original request has been completed. After a driver has called Reuse, the request's contents must be reinitialized.

If you want the reused request to have an IRequestCallbackRequestCompletion::OnCompletion callback function, the driver must call IWDFIoRequest::SetCompletionCallback after it calls Reuse.

For more information about Reuse, see Reusing Framework Request Objects.

Examples

The following code example shows how an IRequestCallbackRequestCompletion::OnCompletion callback function can obtain the IWDFIoRequest2 interface and then call Reuse.


void 
STDMETHODCALLTYPE
CMyRemoteDevice::OnCompletion(
    __in IWDFIoRequest*  FxRequest,
    __in IWDFIoTarget*  FxTarget,
    __in IWDFRequestCompletionParams*  Params,
    __in void*  Context
    )
{
...
    CComQIPtr<IWDFIoRequest2> fxRequest2(FxRequest);
    fxRequest2->Reuse(S_OK);
...
}

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.9

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFIoRequest2
IRequestCallbackRequestCompletion::OnCompletion
IWDFIoRequest::SetCompletionCallback

 

 

Send comments about this topic to Microsoft

Показ:
© 2014 Microsoft