阅读:1434回复:1
关于sFilter.... 求救
在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. 到底什么情况在挂载呢???? 真是一点都不理解,忘高手指点....... 小菜先谢了. |
|
沙发#
发布于: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. |
|