msi: Generate unique names for 32- and 64-bit custom action server pipes.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.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-07-30 14:11:11 -05:00 committed by Alexandre Julliard
parent 2a9e0f1fad
commit 6925846988
2 changed files with 6 additions and 4 deletions

View File

@ -589,7 +589,7 @@ UINT CDECL __wine_msi_call_dll_function(const GUID *guid)
static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
{
static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x',0};
static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0};
static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c','.','e','x','e',0};
static const WCHAR argsW[] = {'%','s',' ','-','E','m','b','e','d','d','i','n','g',' ','%','d',0};
@ -605,9 +605,11 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
(arch == SCS_64BIT_BINARY && package->custom_server_64_process))
return ERROR_SUCCESS;
sprintfW(buffer, pipe_name, GetCurrentProcessId());
sprintfW(buffer, pipe_name, GetCurrentProcessId(), arch == SCS_32BIT_BINARY ? 32 : 64);
pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64),
sizeof(GUID), 0, NULL);
if (pipe == INVALID_HANDLE_VALUE)
ERR("Failed to create custom action client pipe: %u\n", GetLastError());
if (sizeof(void *) == 8 && arch == SCS_32BIT_BINARY)
GetSystemWow64DirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR));

View File

@ -406,7 +406,7 @@ static DWORD CALLBACK custom_action_thread(void *arg)
static int custom_action_server(const WCHAR *arg)
{
static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x',0};
static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0};
DWORD client_pid = atoiW(arg);
DWORD64 thread64;
WCHAR buffer[24];
@ -423,7 +423,7 @@ static int custom_action_server(const WCHAR *arg)
return 1;
}
sprintfW(buffer, pipe_name, client_pid);
sprintfW(buffer, pipe_name, client_pid, sizeof(void *) * 8);
pipe = CreateFileW(buffer, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (pipe == INVALID_HANDLE_VALUE)
{