mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[WINESYNC] msi: Create the custom action thread inside msiexec.exe.
This patch is effectively a no-op by itself, but makes the next patch architecturally much simpler. We need the main thread to be non-blocking to allow nested custom actions to work, so creating the thread inside of msiexec allows the custom action thread to write the result of the action to the server pipe while the main thread simply reads from it. 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> wine commit id 7908d6ee399f4ef556e194dfa5cdef746fc091b6 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
parent
0a327bfe94
commit
1fa71cf3c5
2 changed files with 58 additions and 10 deletions
|
@ -395,11 +395,30 @@ static DWORD DoUnregServer(void)
|
|||
|
||||
extern UINT CDECL __wine_msi_call_dll_function(GUID *guid);
|
||||
|
||||
static DWORD CALLBACK custom_action_thread(void *arg)
|
||||
{
|
||||
GUID *guid = arg;
|
||||
return __wine_msi_call_dll_function(guid);
|
||||
}
|
||||
|
||||
static int DoEmbedding(LPCWSTR key)
|
||||
{
|
||||
HANDLE thread;
|
||||
GUID guid;
|
||||
UINT r;
|
||||
|
||||
/* We need this to unmarshal streams, and some apps expect it to be present. */
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
|
||||
CLSIDFromString(key, &guid);
|
||||
return __wine_msi_call_dll_function(&guid);
|
||||
thread = CreateThread(NULL, 0, custom_action_thread, &guid, 0, NULL);
|
||||
WaitForSingleObject(thread, INFINITE);
|
||||
GetExitCodeThread(thread, &r);
|
||||
CloseHandle(thread);
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue