阅读:1993回复:13
不调用IoCompleteRequest可以吗?
在一个IRP处理例程,任务结束后不调用IoCompleteRequest可以吗?
|
|
最新喜欢:flyfox |
沙发#
发布于:2001-12-02 12:16
在一个IRP处理例程,任务结束后不调用IoCompleteRequest可以吗? 不可以! 任务结束时一定要调用IoCompleteRequest,否则APC过程还在傻傻地等待!。 而且这个irp所占用的非分页内存资源也得不到释放,非分页内存可是很宝贵的哦! |
|
板凳#
发布于:2001-12-03 09:59
IoCompleteRoutine?
|
|
|
地板#
发布于:2001-12-03 15:46
不可以! jeosph,你的话不要说绝对了,你看一下DDK文档,关于IoBuildSynchronousFsdRequest 的文档: The caller can determine when the I/O has completed by calling KeWaitForSingleObject with the Event. Performing this wait operation causes the current thread to wait. Therefore, this operation can be requested during the initialization of an intermediate driver or from an FSD in the context of a thread requesting a synchronous I/O operation. A driver cannot wait for a nonzero interval on the Event at raised IRQL in an arbitrary thread context. Because the caller can wait on a given Event, the caller need not set an IoCompletion routine in the caller-allocated IRP before calling IoCallDriver. When the caller completes the IRP, the I/O Manager releases it. 只要你设置一个event, 然后wait它,就可以,不一定必须调用IoCompleteRequest. 而且我作的一个软驱动中就没调用IoCompleteRequest。 |
|
地下室#
发布于:2001-12-05 17:28
[quote]不可以! jeosph,你的话不要说绝对了,你看一下DDK文档,关于IoBuildSynchronousFsdRequest 的文档: The caller can determine when the I/O has completed by calling KeWaitForSingleObject with the Event. Performing this wait operation causes the current thread to wait. Therefore, this operation can be requested during the initialization of an intermediate driver or from an FSD in the context of a thread requesting a synchronous I/O operation. A driver cannot wait for a nonzero interval on the Event at raised IRQL in an arbitrary thread context. Because the caller can wait on a given Event, the caller need not set an IoCompletion routine in the caller-allocated IRP before calling IoCallDriver. When the caller completes the IRP, the I/O Manager releases it. 只要你设置一个event, 然后wait它,就可以,不一定必须调用IoCompleteRequest. 而且我作的一个软驱动中就没调用IoCompleteRequest。 [/quote] 拜托!我有一个相同的问题晕了3个礼拜了! 我在调用KeWaitForSingleObject时候,会跳出softice,而且会永远等待下去,是什么原因?????(急!!!) |
|
|
5楼#
发布于:2001-12-05 19:50
与blue探讨:
关于IoBuildSynchronousFsdRequest文档中所说的need not set an IoCompletion routine,是否是指:不需要设置一个它所要调用的低层驱动程序的IRP的完成回调例程,而不是说不需要调用IoCompleteRequest来完成它自己的IRP。每个IRP在完成时都应该调用IoCompleteRequest来释放资源。 如有不对,请大家多多指教! |
|
6楼#
发布于:2001-12-10 14:57
I agree with mydrive .I think ,as explained in the ddk,an irp should be indicated as completed by calling IoCompleteRequest ( one to one),which routine can be supplied by you directly
or other system routine indirectly. |
|
7楼#
发布于:2001-12-11 12:20
如果下层driver不call IoCompleteRequest()
上层过滤driver的完成例程怎么能够获得调用呢? |
|
8楼#
发布于:2001-12-11 14:22
sorry,是我理解有误。应该调用IoCompleteRequest。
如果不调用,是不是就不能将此IRP标记为已完成,就不能转交给 the I/O Manager,此IRP 也就没释放了呢? |
|
9楼#
发布于:2001-12-11 19:49
你用SOFTICE跟中一下这个函数就知道了,我记得这个函数只是把IRP中的一些标志致为位
|
|
10楼#
发布于:2001-12-12 10:01
sorry,是我理解有误。应该调用IoCompleteRequest。 也不一定,看irp的建立方式,可能的情况是不需要你的驱动调用IoCompleteRequest,而是由下层的驱动调用。所以,在本层驱动看来,是不需要调用IoCompleteRequest的。 |
|
|
11楼#
发布于:2001-12-12 17:06
也可以由另外一个系统线程完成IoCompleteRequest。
|
|
12楼#
发布于:2007-03-21 15:11
当然要调用了,这样I/o manager 会把该irp释放掉。
|
|
13楼#
发布于:2007-03-21 15:22
而且,上层程序也许还在等你结束呢。
|
|