IWDFIoRequest2::Reuse method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

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

Syntax

void Reuse(
  [in] HRESULT hrNewStatus
);

Parameters

[in] hrNewStatus

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

Requirement Value
End of support Unavailable in UMDF 2.0 and later.
Target Platform Desktop
Minimum UMDF version 1.9
Header wudfddi.h (include Wudfddi.h)
DLL WUDFx.dll

See also

IRequestCallbackRequestCompletion::OnCompletion

IWDFIoRequest2

IWDFIoRequest::SetCompletionCallback