为什么无法从网络驱动器读取CreateFile? [英] Why Can't CreateFile Read from Network drive?

查看:107
本文介绍了为什么无法从网络驱动器读取CreateFile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了Windows应用程序,并且正在使用自己发明的客户端/服务器体系结构.我的应用程序的服务器版本在第一顿午餐时会创建初始化值以及所有必要的文件和文件夹.随后,它读取初始化值并在执行其功能时根据需要读取和写入文件.它在第一顿午餐时创建的一个Prime文件是一个空的隐藏文件,其存在仅表示该应用程序的初始化值已获取并保存在注册表中.

另一方面,应用程序的客户端版本在其第一个午餐期间请求有关服务器计算机的必要信息.服务器计算机是安装了服务器版本的计算机.它要求服务器的名称,服务器计算机的登录用户名和密码以及在服务器计算机上保存服务器版本数据库的文件夹的共享名.然后,利用这些信息,客户端版本使用WNetAddconnection2创建到远程数据库的本地网络驱动器,然后验证是否通过使用CreateFile打开基本文件获得了服务器版本的初始化值.成功打开主文件表示已获取初始化值.然后,它使用RegconnectRegistry连接到远程注册表,以复制初始化值.


服务器版本还成功执行了上述初始化值存在验证并在本地访问注册表,而客户端版本则无法成功执行初始化值存在验证.调试工作表明,在成功创建共享数据库的网络驱动器之后,CreateFile返回INVALID_HANDLE_VALUE以尝试使用成功打开同一文件的服务器版本相同的条件和参数来打开Prime文件.在Windows XP操作系统的我的电脑"中进行的快速检查表明存在预期的网络驱动器.使用由您的应用程序客户端版本创建的网络驱动器的图标,我成功访问了远程数据库并成功地打开了文件夹和文件,但是创建netwotk驱动器的应用程序的客户端版本却无法.

除了上述内容之外,尽管我已授予网络访问HKEY_CURRENT_USER和相关注册表项的权限,但我仍然观察到RgConnectRegistry也未能连接到远程注册表项.
请为什么RgConnectRegistry无法连接到远程注册表?

这两个应用程序(服务器和客户端)是相同的,不同之处在于一个应用程序访问本地文件夹,而另一个访问与本地网络驱动器相同的文件夹.请为什么CreateFile无法打开所说的网络本地驱动器.我真的迫切需要解决这个问题.该项目对时间敏感.

I have developed a windows application and I am using my own invented client/server achitecture. The sever version of my application creates initialization values and all neccessary files and folders at first lunch. Subsequently, it reads the initializationnvalus and reads and writes to files as neccessary as it carries out its function. One Prime File it creates at first lunch is an empty hidden file whose presence merely indicate that the initialization values of the application has been got and saved in the registry.

The client version of the application on the other hand, during it first lunch request for the neccessary informationn about the server computer. The server computer is the computer on which the server version is installed. It request for the sever computer''s name, the logon username and password to the server computer and the share name of the folder that holds the server versions database on the server computer. Then with these information the client version Creates a local network drive to the remote database using WNetAddconnection2, and then it verifies to see if the initialization values of the server version has been gotten by using CreateFile to open the Prime File. A successful open of the prime file indicates that initialization values have already been gotten. It then connects to the remote registry using RegconnectRegistry to copy the initialization values.


While the server version also carries out the said initialization values existence verification and access to registry locally successfully, the client version was unable to carry out the initialization values existence verification successfully. Debug efforts showed that after successfully creating a network drive to the shared database, CreateFile returns INVALID_HANDLE_VALUE for an attempt to open the Prime File using the same conditions and parameters hat the server versions used successfully to open the same file. a quick check at MY COMPUTER of my Windows XP operating System showed the existence of a the expected network drive. using the Icon of the network drive created by thee client version of the applixcation I succesfully accessed the remote database and successdfully openfolders and files, yet the client version of my application which created the netwotk drive could not.

Aside from the above, I observed that RgConnectRegistry also failed to connect to the remote registry key in spite of the fact that I had granted permission to the network to access HKEY_CURRENT_USER and the registry key in question.
Please why does RgConnectRegistry fail to connect to the remote registry?

The two applications(server and client) are identical apart from the fact that one acess a local folder while the other access the same folder as a local network drive. Please why cant CreateFile open the said network local drive. I really and urgently need to resovlve this problem. The project is time sensitive.

推荐答案

可以通过运行Windows资源管理器的服务器上的计算机打开该网络驱动器和文件吗?
Can you open that network drive and file from your machine that you are running the server on through Windows Explorer?


这篇关于为什么无法从网络驱动器读取CreateFile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆