bigcat26
驱动牛犊
驱动牛犊
  • 注册日期2007-06-14
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分33分
  • 威望152点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
阅读:1459回复:0

卸载sfilter驱动BSOD

楼主#
更多 发布于:2011-08-14 13:11
基于sfilter做了个驱动,但是每次stop的时候总有一点小概率会蓝屏,特别是当磁盘IO比较繁忙的时候
sfilter的unload代码有一段注释如下



        //
        //  The IO Manager does not currently add a reference count to a device
        //  object for each outstanding IRP.  This means there is no way to
        //  know if there are any outstanding IRPs on the given device.
        //  We are going to wait for a reasonable amount of time for pending
        //  irps to complete.  
        //
        //  WARNING: This does not work 100% of the time and the driver may be
        //           unloaded before all IRPs are completed.  This can easily
        //           occur under stress situations and if a long lived IRP is
        //           pending (like oplocks and directory change notifications).
        //           The system will fault when this Irp actually completes.
        //           This is a sample of how to do this during testing.  This
        //           is not recommended for production code.
        //


就是活的比较久的IRP,可能会导致出问题。
有没有办法能够解决?
要在sfilter里面记录pending的irp counter然后等counter =0的时候再卸载?
游客

返回顶部