From 63c36da6da2f1da6fc4b184b5101503ad2996f81 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 17 Aug 2016 09:36:13 +0200 Subject: [PATCH] advapi32: Hold lock while processing service controls. Signed-off-by: Sebastian Lackner Signed-off-by: Alexandre Julliard --- dlls/advapi32/service.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index ccca721a49f..11186c56c46 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -461,6 +461,8 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg) } } + EnterCriticalSection( &service_cs ); + /* validate service name */ name = (WCHAR *)data; if (!info.name_size || data_size < info.name_size * sizeof(WCHAR) || name[info.name_size - 1]) @@ -504,6 +506,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg) } done: + LeaveCriticalSection( &service_cs ); WriteFile( disp->pipe, &result, sizeof(result), &count, NULL ); heap_free( data ); } -- 2.11.4.GIT