阅读:2346回复:5
打开UNC文件用ZwCreateFile失败?请大家帮忙!
我在驱动中,用ZwCreateFile打开本地文件或本机的共享文件成功,
但打开别人的共享文件就失败,? ? ?.请大家帮忙! |
|
最新喜欢:cyliu |
沙发#
发布于:2002-01-16 14:14
first sorry our computer has no chinese input. :(
I met the same problem once. Now it has been solved anyway. As I know, in win98 WDM driver you cannot use zwcreate to open a file. But you can call VMM service routine to open it. Just use the full path just like: \\\\machiename\\filepath\\filename In another case if you wanna create a file in win2K on other machine, of course you cannot open it directly. Maybe you can use KeAttachProcess to cheat the system or turn in the dummy clinet context to the system. Because in NT OS kernal driver has no the authority to access remote file. You should change the security context. Maybe you can use your own upper applicantion to send a ioctl to your driver and in your driver you should get its security context. when you gonna access remote file you should turn in the context instead of the original one. Maybe it\'s a useful way you can try! good luck! |
|
|
板凳#
发布于:2002-03-13 20:02
应该用\\\\UNC\\computername\\filename,我网络前面是否要\\\\.\\,就可以了,这个问题折磨了我好久,最后还是自己钻处来的,应该错不了。
|
|
地板#
发布于:2002-03-14 08:43
在win98中可以用ZwCreateFile打开文件,而且可以进行所有的ZwXXX调用,要注意两点:
1、filename要用“\"\\\\DosDevices\\\\**\"。(**表示路径名,:\\\\1.dat)。而DosDevice就是本地设备连接绝对路径。 2、要注意调用ZwXXX的级别只能在PASSIVE LEVEL。如果高于此级,可以使用ExXXXWorkItem建立工作者线程。 我已经在98中使用以上技术进行程序的调试,并用来生成驱动程序的日志文件。 如果需要,我可以将源代码发给各位。 :) |
|
|
地下室#
发布于:2002-03-14 08:45
sorry,路径名:前少了一个盘符,如c、d等。 :)
|
|
|
5楼#
发布于:2002-03-14 17:30
好象不行呀,idapro大哥的方法用\\\\UNC根本就打不开,而用\\\\??\\\\UNC\\网络文件名的形式就是打开别人的网络共享的优先级不够,访问违反,skysky牛大哥能说的清楚一点吗?谢谢了。。
|
|
|