阅读:1570回复:0
卸载sfilter驱动BSOD
基于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的时候再卸载? |
|