Commit 69258469 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent 2a9e0f1f
......@@ -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));
......
......@@ -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)
{
......
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