IWDFIoRequest2::GetStatus method

The GetStatus method returns the status of an I/O request.

Syntax


HRESULT GetStatus();

Parameters

This method has no parameters.

Return value

GetStatus returns an HRESULT-typed status value, This value indicates the current status of the I/O request that the IWDFIoRequest2 interface represents.

Remarks

A driver can call GetStatus after it has called IWDFIoRequest::Send to send an I/O request to an I/O target.

  • If a driver's call to Send succeeds, GetStatus returns the status value that is set by the driver that completes the specified request.

    If the driver specifies WDF_REQUEST_SEND_OPTION_SYNCHRONOUS for a request when it calls Send, the driver can call GetStatus (or IWDFIoRequest::GetCompletionParams) immediately after calling Send.

    If the driver does not specify WDF_REQUEST_SEND_OPTION_SYNCHRONOUS when it calls Send, the driver typically calls GetStatus (or IWDFIoRequest::GetCompletionParams) from within an IRequestCallbackRequestCompletion::OnCompletion callback function.

  • If a driver's call to Send fails, Send returns a status value that the framework has set to describe the failure. The driver can call GetStatus (but notIWDFIoRequest::GetCompletionParams) to obtain the current status of the request, but in this case GetStatus returns the same failure code that Send returned.

For more information about request completion, see Completing I/O Requests.

Examples

The following code example sends an I/O request to an I/O target. If the call to Send succeeds, the example obtains the IWDFIoRequest2 interface, calls GetStatus to obtain the request's status value, and then calls IWDFIoRequest::CompleteWithInformation to complete the I/O request.


HRESULT hrSend = S_OK;
...
hrSend = fxRequest->Send(m_pIoTarget,
                         WDF_REQUEST_SEND_OPTION_SYNCHRONOUS,
                         0);
if (SUCCEEDED(hrSend))
{
    //
    // If send succeeded, complete the request and specify 
    // the current status value.
    //
    CComQIPtr<IWDFIoRequest2> fxRequest2 = fxRequest;
    hrSend = fxRequest2->GetStatus();
    fxRequest->CompleteWithInformation(hrSend, 0);
}
...

Requirements

Target platform

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::CompleteWithInformation
IWDFIoRequest::GetCompletionParams
IWDFIoRequest::Send

 

 

Send comments about this topic to Microsoft

Show: