Commit 856800c8 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Translate ERROR_BAD_PATHNAME into ERROR_FILE_NOT_FOUND.

parent 5d46eeac
......@@ -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 )
......
......@@ -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;
......
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