advapi32: Hold lock while processing service controls.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-08-17 09:36:13 +02:00 committed by Alexandre Julliard
parent f4590e91eb
commit 63c36da6da
1 changed files with 3 additions and 0 deletions

View File

@ -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 );
}