msi: Translate ERROR_BAD_PATHNAME into ERROR_FILE_NOT_FOUND.

This commit is contained in:
James Hawkins 2008-02-04 11:34:10 -06:00 committed by Alexandre Julliard
parent 5d46eeac75
commit 856800c84b
2 changed files with 10 additions and 7 deletions

View File

@ -1569,7 +1569,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
'%','d','.','%','d','.','%','d','.','%','d',0};
static const WCHAR szLangFormat[] = {'%','d',0};
UINT ret = 0;
DWORD dwVerLen;
DWORD dwVerLen, gle;
LPVOID lpVer = NULL;
VS_FIXEDFILEINFO *ffi;
UINT puLen;
@ -1581,7 +1581,13 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
dwVerLen = GetFileVersionInfoSizeW(szFilePath, NULL);
if( !dwVerLen )
return GetLastError();
{
gle = GetLastError();
if (gle == ERROR_BAD_PATHNAME)
return ERROR_FILE_NOT_FOUND;
return gle;
}
lpVer = msi_alloc(dwVerLen);
if( !lpVer )

View File

@ -1847,17 +1847,14 @@ static void test_MsiGetFileVersion(void)
lstrcpyA(version, "version");
lstrcpyA(lang, "lang");
r = MsiGetFileVersionA("", version, &versz, lang, &langsz);
ok(r == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
ok(!lstrcmpA(version, "version"),
"Expected version to be unchanged, got %s\n", version);
ok(versz == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, versz);
ok(!lstrcmpA(lang, "lang"),
"Expected lang to be unchanged, got %s\n", lang);
ok(langsz == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, langsz);
todo_wine
{
ok(r == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
}
/* nonexistent szFilePath */
versz = MAX_PATH;