lwglucky
驱动牛犊
驱动牛犊
  • 注册日期2003-01-06
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分21分
  • 威望129点
  • 贡献值0点
  • 好评度15点
  • 原创分0分
  • 专家分0分
阅读:897回复:2

如何拷备一份当前的Irp并发送到下层的驱动去??

楼主#
更多 发布于:2004-08-10 11:01
如何拷备一份当前的Irp并发送到下层的驱动去??

PIRP I;  ////I为需要拷贝的Irp.
CCHAR  c = m_TargetDevice->StackRequirement() ;
PIRP Irp = KIrp::Allocate(c+1);  ///----是否需要加一???
IoSetNextIrpStackLocation(m_queIrp);
*Irp = *I;  -----是否这样???
IoSetCompletionRoutine(Irp,WaitMastIrpComplete, this, TRUE, TRUE, false);
IoSetCancelRoutine(Irp,CanelIrp);
IoMarkIrpPending(Irp);
status = IoCallDriver(m_TargetDevice->DeviceObject(),Irp);
------------------
这样代码对吗??
我这样做,程序老崩!!
眼底手高
lwglucky
驱动牛犊
驱动牛犊
  • 注册日期2003-01-06
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分21分
  • 威望129点
  • 贡献值0点
  • 好评度15点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-08-10 12:15
help , please!
眼底手高
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-08-11 15:04
if you just want to call the lower DO, just copy down.

if you want to call a DO in another stack, why don't you set up the params in the stack location of the new IRP? those params you copied is for the old stack not for the new one.
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
游客

返回顶部