hora
游客
游客
阅读:3404回复:2

两个例子的区别!

楼主#
更多 发布于:2001-04-19 13:56
我比较了一下在UsbTherm和用driverworks生成的一个空的usb程序中,在creat例程中有点不同,在usbtherm中为:
NTSTATUS UsbThermometer::Create(KIrp I)
{
I.ForceReuseOfCurrentStackLocationInCalldown();
NTSTATUS status = m_Usb.PnpCall(this, I);

CurrentIrp() = NULL;

return status;
}

而在driverworks 生成的usb中为:
status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

而它把
I.ForceReuseOfCurrentStackLocationInCalldown();
NTSTATUS status = m_Usb.PnpCall(this, I);
这两项给注释掉了。为什么?难道他们会有一样的creat效果吗?
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2001-04-24 08:51
关注!
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2001-04-27 08:28
老兄!差点被你搞晕掉!
你没有看Numega的注释吗?
// Generally a create IRP is targeted at our FDO, so we don't need
// to pass it down to the PDO.  We have found for some devices, the
// PDO is not expecting this Irp and returns an error code.
// The default wizard code, therefore completes the Irp here using
// PnpComplete().  The following commented code could be used instead
// of PnpComplete() to pass the Irp to the PDO, which would complete it.
//
我当时看到这句,就直接用的PnpComplete,没有试过把IRP传下去.
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
游客

返回顶部