kumingderen
驱动牛犊
驱动牛犊
  • 注册日期2009-08-24
  • 最后登录2010-01-14
  • 粉丝0
  • 关注0
  • 积分25分
  • 威望161点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1353回复:1

关于sFilter.... 求救

楼主#
更多 发布于:2010-01-12 10:22
  在sFilter中SfEnumerateFileSystemVolumes 函数功能是找出所有文件系统控制设备对象上卷设备。并挂载他们。
   但在函数中有这样一段说明不是很明白。


            //
            //  See if this device has a name. If so, then it must
// be a control device so don't attach to it.
 This handles
            //  drivers with more then one control device (like FastFat).
            // We also don't want to attach if we could not get a name.            //
            
status = SfGetBaseDeviceObjectName( devList, devName );
            if (!NT_SUCCESS(status) || (devName->Name.Length > 0)) {
                leave;
            }
            

SfGetBaseDeviceObjectName 中调用IoGetDeviceAttachmentBaseRef  获取最底层的设备对象。我理解就是文件系统控制设备对象...WDK也有说明(The filter driver's notification callback routine calls IoGetDeviceAttachmentBaseRef to get a pointer to the file system's control device object, and then calls ObQueryNameString to retrieve this object's name for debugging purposes)


    但上面解释说See if this device has a name.  If so, then it must be a control device so don't attach to it.
    下面又说
     We also don't want to attach if we could not get a name.

    到底什么情况在挂载呢????

真是一点都不理解,忘高手指点....... 小菜先谢了.

michaelgz
论坛版主
论坛版主
  • 注册日期2005-01-26
  • 最后登录2012-10-22
  • 粉丝1
  • 关注1
  • 积分150分
  • 威望1524点
  • 贡献值1点
  • 好评度213点
  • 原创分0分
  • 专家分2分
沙发#
发布于:2010-01-13 01:10
You missed one condition. Just check the if statement below this comment. It's something like:

if (!NT_SUCCESS(status) || (name.Length > 0)) {
 ......
}

It means SFilter only attaches to devices with empty name.
游客

返回顶部