Bewerken

Delen via


WdfRequestCompleteWithPriorityBoost function (wdfrequest.h)

[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(
  [in] WDFREQUEST Request,
  [in] NTSTATUS   Status,
  [in] CCHAR      PriorityBoost
);

Parameters

[in] Request

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

[in] 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.

[in] 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

Remarks

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

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

Requirement Value
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(kmdf), BufAfterReqCompletedIntIoctlA(kmdf), BufAfterReqCompletedIoctl(kmdf), BufAfterReqCompletedIoctlA(kmdf), BufAfterReqCompletedRead(kmdf), BufAfterReqCompletedReadA(kmdf), BufAfterReqCompletedWrite(kmdf), BufAfterReqCompletedWriteA(kmdf), CompleteCanceledReq(kmdf), DeferredRequestCompleted(kmdf), DoubleCompletion(kmdf), DoubleCompletionLocal(kmdf), DriverCreate(kmdf), EvtIoStopCancel(kmdf), EvtIoStopCompleteOrStopAck(kmdf), EvtSurpriseRemoveNoRequestComplete(kmdf), InvalidReqAccess(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), MarkCancOnCancReqLocal(kmdf), MdlAfterReqCompletedIntIoctl(kmdf), MdlAfterReqCompletedIntIoctlA(kmdf), MdlAfterReqCompletedIoctl(kmdf), MdlAfterReqCompletedIoctlA(kmdf), MdlAfterReqCompletedRead(kmdf), MdlAfterReqCompletedReadA(kmdf), MdlAfterReqCompletedWrite(kmdf), MdlAfterReqCompletedWriteA(kmdf), MemAfterReqCompletedIntIoctl(kmdf), MemAfterReqCompletedIntIoctlA(kmdf), MemAfterReqCompletedIoctl(kmdf), MemAfterReqCompletedIoctlA(kmdf), MemAfterReqCompletedRead(kmdf), MemAfterReqCompletedReadA(kmdf), MemAfterReqCompletedWrite(kmdf), MemAfterReqCompletedWriteA(kmdf), NoCancelFromEvtSurpriseRemove(kmdf), ReqDelete(kmdf), ReqIsCancOnCancReq(kmdf), ReqNotCanceledLocal(kmdf), ReqSendFail(kmdf), RequestCompleted(kmdf), RequestCompletedLocal(kmdf)

See also

WdfObjectReference

WdfRequestComplete

WdfRequestCompleteWithInformation