简体   繁体   English

无法从Windows XP X64 Prof中的用户帐户访问已安装的筛选器驱动程序的重解析点目录

[英]Can't access reparse point directory of mounted filter driver from user account in windows xp x64 prof

I created a "special file system" for a very special security application. 我为一个非常特殊的安全应用程序创建了一个“特殊文件系统”。

I create a reparse point using an empty directory. 我使用一个空目录创建一个重解析点。 Behind this reparse point is a filter driver, which handels the communication between NTFS and a usermode program, which is doing some encryption/decryption and control work (a mixture between FUSE, TrueCrypt, RamDisc,...). 这个重新解析点的后面是一个筛选器驱动程序,它负责处理NTFS和一个用户模式程序之间的通信,该程序正在执行一些加密/解密和控制工作(FUSE,TrueCrypt,RamDisc等的混合)。 The whole thing is native in C/C++ and works fine unter Win7 x64. 整个东西都是C / C ++原生的,在Win7 x64下可以正常工作。

Now I have the nice task to make it work for windwos xp x64 professional. 现在,我有一项不错的任务,使其可以在windwos xp x64 Professional中使用。 When the whole application is running with admin rights it works fine, but when I switch to user account, I can't access the mounted directory. 当整个应用程序以管理员权限运行时,它可以正常工作,但是当我切换到用户帐户时,无法访问已挂载的目录。

The mounter and the "special file system" (lets name it sfs) are system services and an other app have to run under user account (COM relevant), the mount operation is successfull (when I switch to admin account after mount operation I can access the directory), the other parts of the application works fine too, but the only thing I can't manage is to get access to this very directory. 挂载程序和“特殊文件系统”(将其命名为sfs)是系统服务,另一个应用程序必须在用户帐户(与COM相关)下运行,挂载操作成功(当我在挂载操作后切换到管理帐户时,我可以访问目录),应用程序的其他部分也可以正常工作,但我唯一无法管理的就是访问该目录。

I gave the "everyone" and the users group and the specific user all permissions to the driver, the library(link between driver and sfs), the mounter and the special file system and did a lot in the registry too. 我向“所有人”,用户组和特定用户授予了驱动程序,库(驱动程序与sfs之间的链接),安装程序和特殊文件系统的所有权限,并且在注册表中也做了很多工作。 I also gave this permissions to the mounted dir (all rigths, owner,...) but nothing works. 我也将此权限授予了挂载的目录(所有权限,所有者等),但没有任何效果。

The debug outprint shows, that the request for the directory or the files inside never comes to to "sfs". 调试记录显示,对目录或其中文件的请求永远不会到达“ sfs”。 It seems, that the IO-Manager never sends someting to this addres. 似乎IO-Manager从不向此地址发送消息。 An other problem is, that I can't manage to get all the debug outprints from the OS (boot in local debug mode and use DebugView.exe from SysInternals), but thats another story. 另一个问题是,我无法从操作系统获得所有调试输出(以本地调试模式启动并使用SysInternals的DebugView.exe),但这又是另一回事了。

What did I miss? 我错过了什么? What is the difference between the security system of XP and Win7? XP和Win7的安全系统有什么区别? Are there any basic restrictions in XP which I don't know? 我不知道XP中有什么基本限制吗?

Please ask if you need snippets of the code. 请询问您是否需要代码片段。

Any advise or idea is welcome! 欢迎任何建议或想法!

Found it! 找到了!

I forgot to set security for the device itselfe! 我忘了为设备本身设置安全性! What a bad thing not to find this earlier! 没早找到这个真不好! :-( :-(

This is the section in the mount service: 这是安装服务中的部分:

static VOID GetSecAttr(PSECURITY_ATTRIBUTES SecAttr)
{

   LPTSTR sd = L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGW;;;WD)(A;;GR;;;RC)";

   ZeroMemory(SecAttr, sizeof(SECURITY_ATTRIBUTES));

   ConvertStringSecurityDescriptorToSecurityDescriptor(sd, SDDL_REVISION_1, &SecAttr->lpSecurityDescriptor, NULL);

   SecAttr->nLength = sizeof(SECURITY_ATTRIBUTES);
   SecAttr->bInheritHandle = TRUE;
}

static VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv)
{

//... some declarations ...
   SECURITY_ATTRIBUTES sa;

//... some stuff like syncronisation, named pipe and so on...
   GetSecAttr(&sa);

   device = CreateFile(
       MY_DEVICE_NAME,
       GENERIC_READ | GENERIC_WRITE,
       FILE_SHARE_READ | FILE_SHARE_WRITE,
       &sa,                //!!! and this was NULL!!!
       OPEN_EXISTING, 
       FILE_FLAG_OVERLAPPED, 
       NULL);

   if (device == INVALID_HANDLE_VALUE) {/*...*/}
}

Thanks to all of you who spent time to help me! 感谢所有花时间帮助我的人!

... and why the hell did this work for Win7 ?!? ...以及为什么这对Win7有用?!?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM