guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
阅读:2570回复:24

耳边风进来一下,有问题想请教你啊

楼主#
更多 发布于:2002-10-31 16:52
对于
pIrp->CurrentLocation == 1
的情况
PIO_STACK_LOCATION pIrpSp = NULL;
PIO_STACK_LOCATION pNextIrpSp = NULL;
pIrpSp = IoGetCurrentIrpStackLocation(pIrp);
pNextIrpSp = IoGetNextIrpStackLocation(pIrp);
switch(g_nDebugFlags)
{
case 1:
      *pNextIrpSp = *pIrpSp;
      break;
case 2:
           IoCopyCurrentIrpStackLocationToNext(pIrp);
break;
default:
IoSkipCurrentIrpStackLocation(pIrp);
break;
}
return IoCallDriver(pDevExt->pTargetDevObj,pIrp);
这个里面除了default的执行没有问题之外,其他的都有问题啊!不知道为什么呢?
fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
沙发#
发布于:2002-10-31 16:56
关注!
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-10-31 17:08
耳边风怎么跑啦?
fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
地板#
发布于:2002-10-31 17:25
她怕老鼠?
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-11-01 01:08
DDK 上说得很清楚啊:

case 1: *pNextIrpSp = *pIrpSp;
这种拷贝包括了IO_STACK_LOCATION最后的CompletionRoutine和Context。这两项是不应该copy的。接着:

case 2: IoCopyCurrentIrpStackLocationToNext只copy不移动stack pointer。

case 3: IoSkipCurrentIrpStackLocation 仅仅移动stack pointer。Drivers that pass on their IRP parameters but do not set an I/O completion routine should call IoSkipCurrentIrpStackLocation instead of IoCopyCurrentIrpStackLocationToNext.

IoSkipCurrentIrpStackLocation后再call IoCallDriver,因为IO Manager根据stack处理Irp completion。你的driver不在有机会见到这个Irp。我说的不大清楚,其实你想像普通函数的返回就能理解了。
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-11-01 09:18
如果我不需要设置完成通知例程的话,在正常的情况下这三个都应该可以吧!可是在IRP-》CurrentLocation  == 1的时候,却只有
IoSkipCurrentIrpStackLocation可以!如果按照你所说的那样,那么IoSkipCurrentIrpStackLocation也应该是有问题的啊!
fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
6楼#
发布于:2002-11-01 09:43
up一下。
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2002-11-01 10:09
如果我不需要设置完成通知例程的话,在正常的情况下这三个都应该可以吧!可是在IRP-》CurrentLocation  == 1的时候,却只有
IoSkipCurrentIrpStackLocation可以!如果按照你所说的那样,那么IoSkipCurrentIrpStackLocation也应该是有问题的啊!


出什么问题?crash? 兄弟,空口无凭,你跟踪一下吧。或者你把driver给我我来trace,我最喜欢system crash了。
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2002-11-01 10:18
呵呵!我碰到的就是在写一个TDI的驱动程序的时候过滤TCP设备对象,结果发现在打开网上邻居的时候,上层发送过来的IRP有的会是CurrentLocation == 1而设备对象却是过滤设备对象的情况,这个时候使用IoSkipCurrentIrpStackLocation是很好的,而使用其他两种方法的时候却出现蓝屏
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2002-11-01 10:29
呵呵!我碰到的就是在写一个TDI的驱动程序的时候过滤TCP设备对象,结果发现在打开网上邻居的时候,上层发送过来的IRP有的会是CurrentLocation == 1而设备对象却是过滤设备对象的情况,这个时候使用IoSkipCurrentIrpStackLocation是很好的,而使用其他两种方法的时候却出现蓝屏


恭喜!你碰到一个Windows的bug乐!!!以前见过网上有文章说这个bug。

可不可以把你的dump file(kernel memory dump file就好)和.sys, .pdb文件给我?

我是假耳朵
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
10楼#
发布于:2002-11-01 10:30
Here is some information about the bug I mentioned above.
---------------------------------------------------------
Another problem is an apparent bug in the way Windows NT handles network filter devices. When Windows NT constructs an IRP, it must allocate enough stack space in it to account for the maximum depth of the device stack that the IRP will pass through. To allow this, each device object has a stack count field indicating how large the stack must be in IRPs it receives. Unfortunately, Windows NT sometimes brazenly ignores the stack count field in our filter device objects and sends it an IRP with insufficient stack space. If we push a new location onto this stack and pass it on, eventually the stack overflows and we see the blue screen. We solve the stack problem by checking for insufficient stack space, and creating a new IRP to pass to the lower-level driver when needed.
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
11楼#
发布于:2002-11-01 10:30
好的!我把我的驱动程序源文件给你吧!不过我怎么给你啊?
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
12楼#
发布于:2002-11-01 10:32
好的!我把我的驱动程序源文件给你吧!不过我怎么给你啊?


If you have memory dump file, .sys and .pdb file, source file is not needed (It\'s trouble to build and install it, right? :-)). Please mail it to xhkang@promise.com, thanks.
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
13楼#
发布于:2002-11-01 10:32
Here is some information about the bug I mentioned above.
---------------------------------------------------------
Another problem is an apparent bug in the way Windows NT handles network filter devices. When Windows NT constructs an IRP, it must allocate enough stack space in it to account for the maximum depth of the device stack that the IRP will pass through. To allow this, each device object has a stack count field indicating how large the stack must be in IRPs it receives. Unfortunately, Windows NT sometimes brazenly ignores the stack count field in our filter device objects and sends it an IRP with insufficient stack space. If we push a new location onto this stack and pass it on, eventually the stack overflows and we see the blue screen. We solve the stack problem by checking for insufficient stack space, and creating a new IRP to pass to the lower-level driver when needed.

对!就是这个问题!可能是上面的创建请求的时候根本就不参考device_object里面的stacksize
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
14楼#
发布于:2002-11-01 10:35
对!就是这个问题!可能是上面的创建请求的时候根本就不参考device_object里面的stacksize


是不是考虑给我点水分?不过上次你已经给了我3000多了。就免费好了。:)
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
15楼#
发布于:2002-11-01 10:35
dump文件是很大的啊!因为我的是256M内存呢!还有就是只要使用ds里面的drivermonitor来加载,在加载之后就访问网上邻居,就可以出现我说的问题了!对了,我使用的是adv server,sp2,p4 cpu ,256m内存
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
16楼#
发布于:2002-11-01 10:36
完了!我现在最大可放的分数只有20了!
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
17楼#
发布于:2002-11-01 10:38
dump文件是很大的啊!因为我的是256M内存呢!还有就是只要使用ds里面的drivermonitor来加载,在加载之后就访问网上邻居,就可以出现我说的问题了!对了,我使用的是adv server,sp2,p4 cpu ,256m内存


dont use full memory dump. jump dump kernel memory (not mini dump). compress it. It\'s not too big. Otherwise you have to upload to my ftp server.
我是假耳朵
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
18楼#
发布于:2002-11-01 10:39
完了!我现在最大可放的分数只有20了!

可怜,要不要我还点分给你?
我是假耳朵
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
19楼#
发布于:2002-11-01 10:43
呵呵!不用了!我好象没有让他DUMP出那个文件,并且我当时也没有弄成是核心dump我先把源程序给你吧!你编译一下!就好了!跟编译环境应该没有关系的!不过我倒是担心跟系统有关,可能到了英文的没有这个问题呢!不过到时候你试不出来的话我再弄那个dump吧!
上一页
游客

返回顶部