WdfRequestCompleteWithPriorityBoost function

[Applies to KMDF only]

The WdfRequestCompleteWithPriorityBoost method completes a specified I/O request and supplies a completion status. It also specifies a value that the system can use to boost the run-time priority of the thread that requested the I/O operation.

Syntax

void WdfRequestCompleteWithPriorityBoost(
  WDFREQUEST Request,
  NTSTATUS   Status,
  CCHAR      PriorityBoost
);

Parameters

Request

A handle to the framework request object that represents the I/O request that is being completed.

Status

An NTSTATUS value that represents the completion status of the request. Valid status values include, but are not limited to, the following:

STATUS_SUCCESS

The driver successfully completed the request.

STATUS_CANCELLED

The driver canceled the request.

STATUS_UNSUCCESSFUL

The driver encountered an error while processing the request.

PriorityBoost

A system-defined constant value by which to increment the run-time priority of the original thread that requested the operation. Constant values are device-type-specific and are defined in Wdm.h. The format for the constant names is XXX_INCREMENT. For more information about priority boost values, see Specifying Priority Boosts When Completing I/O Requests.

Return Value

None.

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

Remarks

Your driver should call WdfRequestCompleteWithPriorityBoost if you want to override the default priority boost that the framework provides. For example, the driver might set the priority boost to IO_NO_INCREMENT if it was able to complete the request quickly, perhaps because it detected an error.

After a call to WdfRequestCompleteWithPriorityBoost returns, the request handle is no longer valid unless the driver has called WdfObjectReference to add one or more additional reference counts to the request object. Note that after WdfRequestCompleteWithPriorityBoost returns, the driver must not attempt to access the associated WDM IRP structure, even if it has called WdfObjectReference.

For more information about calling WdfRequestCompleteWithPriorityBoost, see Completing I/O Requests.

Examples

The following code example shows how the example at WdfRequestComplete can use WdfRequestCompleteWithPriorityBoost instead of WdfRequestComplete.

switch (params.Type) {
    case WdfRequestTypeRead:
        length = params.Parameters.Read.Length;
        direction = WdfDmaDirectionReadFromDevice;
        break;
    case WdfRequestTypeWrite:
        length = params.Parameters.Write.Length;
        direction = WdfDmaDirectionWriteToDevice;
        break;
    default:
        WdfRequestCompleteWithPriorityBoost(
                                            Request,
                                            STATUS_INVALID_PARAMETER,
                                            IO_NO_INCREMENT
                                            );
        return;
    }

Requirements

   
Target Platform Universal
Minimum KMDF version 1.0
Header wdfrequest.h (include Wdf.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL "<=DISPATCH_LEVEL"
DDI compliance rules BufAfterReqCompletedIntIoctl, BufAfterReqCompletedIntIoctlA, BufAfterReqCompletedIoctl, BufAfterReqCompletedIoctlA, BufAfterReqCompletedRead, BufAfterReqCompletedReadA, BufAfterReqCompletedWrite, BufAfterReqCompletedWriteA, CompleteCanceledReq, DeferredRequestCompleted, DoubleCompletion, DoubleCompletionLocal, DriverCreate, EvtIoStopCancel, EvtIoStopCompleteOrStopAck, EvtSurpriseRemoveNoRequestComplete, InvalidReqAccess, KmdfIrql, KmdfIrql2, MarkCancOnCancReqLocal, MdlAfterReqCompletedIntIoctl, MdlAfterReqCompletedIntIoctlA, MdlAfterReqCompletedIoctl, MdlAfterReqCompletedIoctlA, MdlAfterReqCompletedRead, MdlAfterReqCompletedReadA, MdlAfterReqCompletedWrite, MdlAfterReqCompletedWriteA, MemAfterReqCompletedIntIoctl, MemAfterReqCompletedIntIoctlA, MemAfterReqCompletedIoctl, MemAfterReqCompletedIoctlA, MemAfterReqCompletedRead, MemAfterReqCompletedReadA, MemAfterReqCompletedWrite, MemAfterReqCompletedWriteA, NoCancelFromEvtSurpriseRemove, ReqDelete, ReqIsCancOnCancReq, ReqNotCanceledLocal, ReqSendFail, RequestCompleted, RequestCompletedLocal

See Also

WdfObjectReference

WdfRequestComplete

WdfRequestCompleteWithInformation