services/tests: Initialize critical section just once.

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-03-03 06:25:16 +01:00 committed by Alexandre Julliard
parent a80c0d3cf2
commit d98194e791
1 changed files with 2 additions and 1 deletions

View File

@ -442,7 +442,6 @@ static void test_runner(void (*p_run_test)(void))
if(pipe_handle == INVALID_HANDLE_VALUE)
return;
InitializeCriticalSection(&event_cs);
event_handle = CreateEventA(NULL, FALSE, FALSE, NULL);
ok(event_handle != INVALID_HANDLE_VALUE, "CreateEvent failed: %u\n", GetLastError());
if(event_handle == INVALID_HANDLE_VALUE)
@ -465,6 +464,8 @@ START_TEST(service)
char **argv;
int argc;
InitializeCriticalSection(&event_cs);
pRegisterServiceCtrlHandlerExA = (void*)GetProcAddress(GetModuleHandleA("advapi32.dll"), "RegisterServiceCtrlHandlerExA");
if(!pRegisterServiceCtrlHandlerExA) {
win_skip("RegisterServiceCtrlHandlerExA not available, skipping tests\n");