mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
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>
This commit is contained in:
parent
3a884c2ef7
commit
583edf7f59
1 changed files with 4 additions and 0 deletions
|
@ -683,6 +683,8 @@ static DWORD WINAPI custom_client_thread(void *arg)
|
|||
pipe = info->package->custom_server_64_pipe;
|
||||
}
|
||||
|
||||
EnterCriticalSection(&msi_custom_action_cs);
|
||||
|
||||
if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) ||
|
||||
size != sizeof(info->guid))
|
||||
{
|
||||
|
@ -695,6 +697,8 @@ static DWORD WINAPI custom_client_thread(void *arg)
|
|||
return GetLastError();
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&msi_custom_action_cs);
|
||||
|
||||
if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(),
|
||||
&thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue