WdfRequestGetStatus - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfrequest.h

NTSTATUS WdfRequestGetStatus(
  [in] WDFREQUEST Request
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfrequest-wdfrequestgetstatus)

WdfRequestGetStatus function

Description

[Applies to KMDF and UMDF]

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

Parameters

Request [in]

A handle to a framework request object.

Return value

WdfRequestGetStatus returns an NTSTATUS value. For more information about what value can be returned, see the following Remarks section.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

The WdfRequestGetStatus method returns one of the following:

If the driver sets the WDF_REQUEST_SEND_OPTION_SYNCHRONOUS flag for a request when calling WdfRequestSend, the driver can call WdfRequestGetStatus immediately after calling WdfRequestSend, whether the call to WdfRequestSend succeeds or fails.

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

Examples

The following code example is from the KbFiltr sample driver. This example sends an I/O request to an I/O target. If WdfRequestSend fails, the example uses the WdfRequestGetStatus return value as input to WdfRequestComplete.

VOID
KbFilter_ForwardRequest(
    IN WDFREQUEST Request,
    IN WDFIOTARGET Target
    )
{
    WDF_REQUEST_SEND_OPTIONS options;
    BOOLEAN ret;
    NTSTATUS status;

    WDF_REQUEST_SEND_OPTIONS_INIT(
                                  &options,
                                  WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET
                                  );

    ret = WdfRequestSend(
                         Request,
                         Target,
                         &options
                         );

    if (ret == FALSE) {
        status = WdfRequestGetStatus (Request);
        DebugPrint(("WdfRequestSend failed: 0x%x\n", status));
        WdfRequestComplete(
                           Request,
                           status
                           );
    }
    return;
}

See also

CompletionRoutine

WdfRequestComplete

WdfRequestSend