IoCompleteRequest routine

来源:互联网 发布:阿里云 数据库 编辑:程序博客网 时间:2024/05/18 02:26

IoCompleteRequest routine

调用 IoCompleteRequest 例程表示调用者已经处理完一个给定的I/O请求,并将指定的IRP返回给I/O manager.

Syntax

 

VOID IoCompleteRequest(  _In_ PIRP  Irp,  _In_ CCHAR PriorityBoost);

 

Parameters

Irp [in]

指向将完成的IRP

PriorityBoost [in]

指定一个系统定义的常量,此常量用以提升请求该操作的线程的运行时优先级。若线程请求的操作是一个可以迅速完成的操作(so the requesting thread is not compensated for its assumed wait for I/O to be completed) ,或者是IRP以一个错误结束,这个值设置为IO_NO_INCREMENT 否则这个PriorityBoost常量是设备类型相关的值,关于这些常量见Ntddk.h or Wdm.h

Return value

None

Remarks

当驱动程序完成了对一个给定IRP的所有处理过程时调用IoCompleteRequestI/O manager检查确认是否有一个更高层级的驱动程序在这个IRP设置了IoCompletion 例程,如果则依次调用每一个IoCompletion ,直到所有层上的驱动程序都完成了IRP

When all drivers have completed a given IRP, the I/O manager returns status to the original requester of the operation. Note that a higher-level driver that sets up a driver-created IRP must supply an IoCompletion routine to release the IRP it created.

Never call IoCompleteRequest while holding a spin lock. Attempting to complete an IRP while holding a spin lock can cause deadlocks.当所有的驱动程序都完成了给定的IRPI/O manager返回状态值给最初的操作请求者。注意一个创建了一个“驱动创建”的IRP的高层级的驱动程序必须提供一个IoCompletion 以释放它创建的IRP。请勿在获得一个 spin lock时调用IoCompleteRequest 。在获得一个spin lock 时试图完成一个IRP将可能导致死锁。

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

CompleteRequestCompleteRequestStatusCheckDoubleCompletionIoAllocateCompleteIoBuildFsdComplete,IoSetCompletionExCompleteIrpIrpProcessingCompleteMarkIrpPendingPendedCompletedRequest,PendedCompletedRequest2PendedCompletedRequest3PendedCompletedRequestExPnpIrpCompletionSpinLockSafe,WmiCompleteHwStorPortProhibitedDDIsSpinLockSafe(storport)

See also

IoSetCompletionRoutine

 

0 0
原创粉丝点击