FindFirstFile on mapped drives work sporadically
I have written a 32-bit program that has a problem running on 64 bit Win 7 pro. When the program runs on Win 7 and my FindFirstFile call accesses a mapped drive (whose source is a folder on an XP machine), the FindFirstFile fails with a system message (via GetlastError()) of "The System cannot find the path specified." In this same program, I also have a CFileDialog that allows me to browse to that same mapped drive. If I use CFileDialog to browse to that mapped drive, I can access the mapped drive perfectly - so I know the mapped drive has been set up correctly (with reconnect at log on, etc.). But here's the wierd part: After I use the CFileDialog AND browse to the folders of the mapped drive from within the CFileDialog, then any future calls to FindFirstFile suddenly start working! It seems that CFileDialog somehow has some functionality that activates the mapped drive so it can be accessed by FindFirstFile. So FindFirstFile works perfectly as long as I use CFileDialog to browse the mapped drive prior to my FindFirstFile call! It will work perfectly until I reboot the computer. Upon rebooting, FindFIrstFile will fail until I use the CFileDialog to again browse to the mapped drive. This problem is not present on other types of systems, such as running the program on XP and accessing a mapped drive on another XP or Vista (32-bit) mapped to XP. This problem only occurs for Win 7 (64-bit) for mapped drives on the XP. The FindFirstFile also works perfectly on the Win 7 (64-bit) machine for accessing files on the Win 7 local C drive. I have tried setting autoconnect to ffffffff on the Win 7 machine, I have also used Wow64DisableWow64FsRedirection. The mapped drive is also set with reconnect at logon. None of these fix the problem. Can anyone help? Thanks
July 7th, 2011 1:24pm

Hi, According to your description, I suggest you asking MSDN for further help: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/threads The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding. Regards, Leo HuangPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 2:43am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics