grandy_kao
驱动牛犊
驱动牛犊
  • 注册日期2004-02-27
  • 最后登录2008-02-13
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
阅读:1130回复:4

请辨一辨

楼主#
更多 发布于:2004-06-25 14:33
Walter Oney在《Programming the Microsoft WDM》中写道:"If your DriverEntry routine returns a failure status, the system doesn’t call your DriverUnload routine. Therefore, if DriverEntry generates any side effects that need cleaning up prior to returning an error status, DriverEntry has to perform the cleanup"。

而DDK中说明:"The I/O Manager also calls the Unload routine when the driver returns a failure status from its DriverEntry routine."

seaquester
驱动大牛
驱动大牛
  • 注册日期2002-05-22
  • 最后登录2016-06-16
  • 粉丝0
  • 关注0
  • 积分500分
  • 威望115点
  • 贡献值0点
  • 好评度107点
  • 原创分0分
  • 专家分52分
沙发#
发布于:2004-06-25 14:39
而DDK中说明:"The I/O Manager also calls the Unload routine when the driver returns a failure status from its DriverEntry routine."


没有在Win2k DDK中看到上面这句话,倒是看到了另一种说法:
“Note that a driver's Unload routine is not called if a driver's DriverEntry routine returns a failure status.”

八风舞遥翩,九野弄清音。 鸣高常向月,善舞不迎人。
grandy_kao
驱动牛犊
驱动牛犊
  • 注册日期2004-02-27
  • 最后登录2008-02-13
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-06-25 15:39
Kernel-Mode Drivers: Windows 2000 DDK
15.2 Unload Routine Environment
这一节里提到
:"The I/O Manager also calls the Unload routine when the driver returns a failure status from its DriverEntry routine."
seaquester
驱动大牛
驱动大牛
  • 注册日期2002-05-22
  • 最后登录2016-06-16
  • 粉丝0
  • 关注0
  • 积分500分
  • 威望115点
  • 贡献值0点
  • 好评度107点
  • 原创分0分
  • 专家分52分
地板#
发布于:2004-06-25 17:12
嗯,看到了。
但是,MSDN(october 2001)中同一章(Unload Routine Environment)却是另一种说法:
Note that the Unload routine is not called if a driver's DriverEntry routine returns a failure status. In this case, the I/O manager simply frees the memory space taken up by the driver.

看来,可能是2kDDK中错了,所以后来版本修正了。



八风舞遥翩,九野弄清音。 鸣高常向月,善舞不迎人。
grandy_kao
驱动牛犊
驱动牛犊
  • 注册日期2004-02-27
  • 最后登录2008-02-13
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-06-25 18:01
看来要去更新一下2003的DDK
游客

返回顶部