In my code, I am trying to open a directory of Solaris OS from Windows OS using FindFirstFile().
In Windows XP, the code is working fine but in Window 7 same code is not working.
FindFirstFile() returns INVALID HANDLE in Windows 7 and GetLastError() return error code 50,
which means "The request is not supported. "
Can anybody help me out why the same code working fine in Windows XP but not in Windows 7 ??
I tried with disabling all the firewalls in Windows 7 but the result were same.
Here is the sample code :
int _tmain(int argc, _TCHAR* argv[])
{
char *path = "\\\\mach_name\\usr1\\usrname\\mydir\\*.*";
wchar_t wstr[256];
HANDLE filehandle;
WIN32_FIND_DATAW fileinfoW;
DWORD i;
mbstowcs (wstr, path, 256);
filehandle = FindFirstFileW(wstr, &fileinfoW);
if (filehandle != INVALID_HANDLE_VALUE)
FindClose(filehandle);
else
i = GetLastError();
return 0;
}
It works fine in XP but in Windows 7 FindFirstFile() returns INVALID_HANDLE_VALUE and then GetLastError() reports Error Code 50.
Response awaited..
Thanks in advance