msi: Check return value of GetBinaryType().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-05-04 00:32:57 -05:00 committed by Alexandre Julliard
parent b8c27cca37
commit deb4f97000
1 changed files with 3 additions and 2 deletions

View File

@ -585,6 +585,7 @@ static DWORD WINAPI DllThread( LPVOID arg )
void *cookie; void *cookie;
BOOL wow64; BOOL wow64;
DWORD arch; DWORD arch;
BOOL ret;
DWORD rc; DWORD rc;
TRACE("custom action (%x) started\n", GetCurrentThreadId() ); TRACE("custom action (%x) started\n", GetCurrentThreadId() );
@ -607,9 +608,9 @@ static DWORD WINAPI DllThread( LPVOID arg )
} }
info = find_action_by_guid(guid); info = find_action_by_guid(guid);
GetBinaryTypeW(info->source, &arch); ret = GetBinaryTypeW(info->source, &arch);
if (sizeof(void *) == 8 && arch == SCS_32BIT_BINARY) if (sizeof(void *) == 8 && ret && arch == SCS_32BIT_BINARY)
GetSystemWow64DirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); GetSystemWow64DirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR));
else else
GetSystemDirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); GetSystemDirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR));