阅读:1607回复:2
IoBuildSynchronousFsdRequest需要完成并释放irp吗?
为什么在tooflat大侠的代码中没看到对自己的irp进行IoCompleteRequest和IoFreeIrp。请大牛们指点
|
|
沙发#
发布于:2007-04-23 18:20
1。IoBuildSynchronousFsdRequest产生的IRP最终由IO管理器来负责释放,
建议你看一篇IFS中的HELP:Rolling Your Own 2。DDK上的文字: IRPs that are created by IoBuildSynchronousFsdRequest must be completed by a driver's call to IoCompleteRequest. A driver that calls IoBuildSynchronousFsdRequest must not call IoFreeIrp, because the I/O manager frees these synchronous IRPs after IoCompleteRequest has been called. |
|
|
板凳#
发布于:2007-04-23 21:27
多谢楼上的,我的ddk怎么写的不一样,
IRPs created using IoBuildSynchronousFsdRequest must be completed by calling IoCompleteRequest and not by merely deallocating the IRP with IoFreeIrp. IoBuildSynchronousFsdRequest queues the IRPs it creates in the IRP queue of the current thread. Freeing these IRPs without completing them might result in a system crash when the thread terminates as the thread attempts to deallocate the IRP's memory. 这些写文档的太不负责了 |
|