version: Check the Windows directory first in VerFindFileA/W.
This commit is contained in:
parent
c8d912376f
commit
702941eae1
|
@ -89,7 +89,7 @@ static void test_find_file(void)
|
||||||
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
|
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
todo_wine ok(0, "Got unexpected return value %x\n", ret);
|
ok(0, "Got unexpected return value %x\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
dwCur=MAX_PATH;
|
dwCur=MAX_PATH;
|
||||||
|
@ -111,7 +111,7 @@ static void test_find_file(void)
|
||||||
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
|
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
const char *destDir;
|
||||||
unsigned int curDirSizeReq;
|
unsigned int curDirSizeReq;
|
||||||
unsigned int destDirSizeReq;
|
unsigned int destDirSizeReq;
|
||||||
char systemDir[MAX_PATH];
|
char winDir[MAX_PATH], systemDir[MAX_PATH];
|
||||||
|
|
||||||
/* Print out debugging information */
|
/* Print out debugging information */
|
||||||
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
|
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
|
||||||
|
@ -1132,12 +1132,16 @@ DWORD WINAPI VerFindFileA(
|
||||||
}
|
}
|
||||||
else /* not a shared file */
|
else /* not a shared file */
|
||||||
{
|
{
|
||||||
if(lpszAppDir)
|
destDir = lpszAppDir ? lpszAppDir : "";
|
||||||
{
|
|
||||||
destDir = lpszAppDir;
|
|
||||||
if(lpszFilename)
|
if(lpszFilename)
|
||||||
{
|
{
|
||||||
|
GetWindowsDirectoryA( winDir, MAX_PATH );
|
||||||
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
|
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
|
||||||
|
else if(testFileExistenceA(winDir, lpszFilename, FALSE))
|
||||||
|
{
|
||||||
|
curDir = winDir;
|
||||||
|
retval |= VFF_CURNEDEST;
|
||||||
|
}
|
||||||
else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
|
else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
|
||||||
{
|
{
|
||||||
curDir = systemDir;
|
curDir = systemDir;
|
||||||
|
@ -1145,7 +1149,6 @@ DWORD WINAPI VerFindFileA(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Check to see if the file exists and is in use by another application */
|
/* Check to see if the file exists and is in use by another application */
|
||||||
if (lpszFilename && testFileExistenceA(curDir, lpszFilename, FALSE)) {
|
if (lpszFilename && testFileExistenceA(curDir, lpszFilename, FALSE)) {
|
||||||
|
@ -1195,7 +1198,7 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
|
||||||
const WCHAR *destDir;
|
const WCHAR *destDir;
|
||||||
unsigned int curDirSizeReq;
|
unsigned int curDirSizeReq;
|
||||||
unsigned int destDirSizeReq;
|
unsigned int destDirSizeReq;
|
||||||
WCHAR systemDir[MAX_PATH];
|
WCHAR winDir[MAX_PATH], systemDir[MAX_PATH];
|
||||||
|
|
||||||
/* Print out debugging information */
|
/* Print out debugging information */
|
||||||
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
|
TRACE("flags = %x filename=%s windir=%s appdir=%s curdirlen=%p(%u) destdirlen=%p(%u)\n",
|
||||||
|
@ -1226,12 +1229,16 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
|
||||||
}
|
}
|
||||||
else /* not a shared file */
|
else /* not a shared file */
|
||||||
{
|
{
|
||||||
if(lpszAppDir)
|
destDir = lpszAppDir ? lpszAppDir : &emptyW;
|
||||||
{
|
|
||||||
destDir = lpszAppDir;
|
|
||||||
if(lpszFilename)
|
if(lpszFilename)
|
||||||
{
|
{
|
||||||
|
GetWindowsDirectoryW( winDir, MAX_PATH );
|
||||||
if(testFileExistenceW(destDir, lpszFilename, FALSE)) curDir = destDir;
|
if(testFileExistenceW(destDir, lpszFilename, FALSE)) curDir = destDir;
|
||||||
|
else if(testFileExistenceW(winDir, lpszFilename, FALSE))
|
||||||
|
{
|
||||||
|
curDir = winDir;
|
||||||
|
retval |= VFF_CURNEDEST;
|
||||||
|
}
|
||||||
else if(testFileExistenceW(systemDir, lpszFilename, FALSE))
|
else if(testFileExistenceW(systemDir, lpszFilename, FALSE))
|
||||||
{
|
{
|
||||||
curDir = systemDir;
|
curDir = systemDir;
|
||||||
|
@ -1239,7 +1246,6 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (lpszFilename && !testFileExistenceW(curDir, lpszFilename, TRUE))
|
if (lpszFilename && !testFileExistenceW(curDir, lpszFilename, TRUE))
|
||||||
retval |= VFF_FILEINUSE;
|
retval |= VFF_FILEINUSE;
|
||||||
|
|
Loading…
Reference in New Issue