VanCheer
驱动老牛
驱动老牛
  • 注册日期2002-02-21
  • 最后登录2003-08-28
  • 粉丝0
  • 关注0
  • 积分-20分
  • 威望-10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
20楼#
发布于:2002-10-16 18:24
谢谢大家给我回答问题

 

阿兰真的好慷慨
[img]http://www.driverdevelop.com/forum/upload/VanCheer/2003-03-21_mon.gif[/img][img]http://www.driverdevelop.com/forum/upload/VanCheer/2002-12-07_smallbaby.jpg[/img]
zsb9527
驱动小牛
驱动小牛
  • 注册日期2002-05-31
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
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]
小子,从今天开始,你就是华府的低等下人,9527就是你的终身代号。 [img]http://www.driverdevelop.com/forum/upload/zsb9527/2002-06-25_6.jpg[/img]
alan2u
驱动巨牛
驱动巨牛
  • 注册日期2001-12-11
  • 最后登录2018-06-02
  • 粉丝0
  • 关注0
  • 积分5926分
  • 威望43813点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
  • 社区居民
22楼#
发布于:2002-10-17 08:32
明白了,谢谢zsb9527
上一页 下一页
游客

返回顶部