Commit 702941ea authored by Alexandre Julliard's avatar Alexandre Julliard

version: Check the Windows directory first in VerFindFileA/W.

parent c8d91237
......@@ -89,7 +89,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
todo_wine ok(0, "Got unexpected return value %x\n", ret);
ok(0, "Got unexpected return value %x\n", ret);
}
dwCur=MAX_PATH;
......@@ -111,7 +111,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
todo_wine ok(0, "Got unexpected return value %x\n", ret);
ok(0, "Got unexpected return value %x\n", ret);
}
}
}
......
......@@ -1101,7 +1101,7 @@ DWORD WINAPI VerFindFileA(
const char *destDir;
unsigned int curDirSizeReq;
unsigned int destDirSizeReq;
char systemDir[MAX_PATH];
char winDir[MAX_PATH], systemDir[MAX_PATH];
/* Print out debugging information */
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
......@@ -1132,17 +1132,20 @@ DWORD WINAPI VerFindFileA(
}
else /* not a shared file */
{
if(lpszAppDir)
destDir = lpszAppDir ? lpszAppDir : "";
if(lpszFilename)
{
destDir = lpszAppDir;
if(lpszFilename)
GetWindowsDirectoryA( winDir, MAX_PATH );
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(testFileExistenceA(winDir, lpszFilename, FALSE))
{
curDir = winDir;
retval |= VFF_CURNEDEST;
}
else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
{
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
{
curDir = systemDir;
retval |= VFF_CURNEDEST;
}
curDir = systemDir;
retval |= VFF_CURNEDEST;
}
}
}
......@@ -1195,7 +1198,7 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
const WCHAR *destDir;
unsigned int curDirSizeReq;
unsigned int destDirSizeReq;
WCHAR systemDir[MAX_PATH];
WCHAR winDir[MAX_PATH], systemDir[MAX_PATH];
/* Print out debugging information */
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
......@@ -1226,17 +1229,20 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
}
else /* not a shared file */
{
if(lpszAppDir)
destDir = lpszAppDir ? lpszAppDir : &emptyW;
if(lpszFilename)
{
destDir = lpszAppDir;
if(lpszFilename)
GetWindowsDirectoryW( winDir, MAX_PATH );
if(testFileExistenceW(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(testFileExistenceW(winDir, lpszFilename, FALSE))
{
curDir = winDir;
retval |= VFF_CURNEDEST;
}
else if(testFileExistenceW(systemDir, lpszFilename, FALSE))
{
if(testFileExistenceW(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(testFileExistenceW(systemDir, lpszFilename, FALSE))
{
curDir = systemDir;
retval |= VFF_CURNEDEST;
}
curDir = systemDir;
retval |= VFF_CURNEDEST;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment