mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:12:55 +00:00
[WINESYNC] msi: Protect communication with the custom action server with a critical section.
Avoids a potential race whereby an asynchronous custom action receives the wrong thread handle. 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 583edf7f59866cf0a58c978e692f3077e74b4938 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
parent
eca4d999d6
commit
b1b2cc1e8d
1 changed files with 4 additions and 0 deletions
|
@ -698,6 +698,8 @@ static DWORD WINAPI custom_client_thread(void *arg)
|
||||||
pipe = info->package->custom_server_64_pipe;
|
pipe = info->package->custom_server_64_pipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EnterCriticalSection(&msi_custom_action_cs);
|
||||||
|
|
||||||
if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) ||
|
if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) ||
|
||||||
size != sizeof(info->guid))
|
size != sizeof(info->guid))
|
||||||
{
|
{
|
||||||
|
@ -710,6 +712,8 @@ static DWORD WINAPI custom_client_thread(void *arg)
|
||||||
return GetLastError();
|
return GetLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LeaveCriticalSection(&msi_custom_action_cs);
|
||||||
|
|
||||||
if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(),
|
if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(),
|
||||||
&thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
&thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue