20楼#
发布于:2002-10-16 18:24
谢谢大家给我回答问题 阿兰真的好慷慨 |
|
|
21楼#
发布于:2002-10-16 20:03
Subject: Question about IoBuildDeviceIoControlRequest ; Please Ignore the first message uncompleted Hi all, I have a little doubt about IoBuildDeviceIoControl Request . In DDK documentation , it says \"IRPs created using IoBuildDeviceIoControlRequest must be completed by calling IoCompleteRequest and not by merely deallocating the IRP with IoFreeIrp. \" But when I checked the sample code in DDK , none of the samples either frees the IRP or completes the IRP . In DDK documentation , it says \"IoBuildDeviceIoControlRequest queues the IRPs it creates in the IRP queue of the current thread.\" Is that means the current thread completes the IRP and releases the memory ? Thanks srinivasa Date: Tue, 15 Oct 2002 11:18:05 -1000 Author: Justin Frodsham <zeppelin@io.com> Subject: Re: Question about IoBuildDeviceIoControlRequest ; Please Ignore the first message uncompleted I paused on that too and came to the conclusion that the lower driver you are passing the Irp to will call IoCompleteRequest. Since this is going to happen you do not manually free the Irp. Rather the call to IoCompleteRequest by the lower driver does the cleanup. -Justin Tue, 15 Oct 2002 16:20:35 -0500 Author: \"Kommuri, Chakradhar\" <Chakradhar.Kommuri@hp.com> Subject: RE: Question about IoBuildDeviceIoControlRequest ; Please Ignore the first message uncompleted Correct. Looks like, the thumb rule is, unless you allocate an Irp, you don\'t free it. 下面是Walter Oney的回答: \"Kommuri, Chakradhar\" wrote: > Correct. Looks like, the thumb rule is, unless you allocate an Irp, you > don\'t free it. Not exactly. If you build a \"synchronous\" IRP (by calling IoBuildSynchronousFsdRequest or IoBuildDeviceIoControlRequest), you (a) wait for it to finish and (b) allow the system to call IoFreeIrp. If you build an \"asynchronous\" IRP (by calling IoBuildAsynchronousFsdRequest or IoAllocateIrp), you also install a completion routine that calls IoFreeIrp. -- Walter Oney, Consulting and Training Basic and Advanced Driver Programming Seminars Now teaming with John Hyde for USB Device Engineering Seminars Check out our schedule at http://www.oneysoft.com [编辑 - 10/16/02 by zsb9527] [编辑 - 10/16/02 by zsb9527] |
|
|
22楼#
发布于:2002-10-17 08:32
明白了,谢谢zsb9527
|
|
上一页
下一页