From 77f222505cdb392f2880932671051b345bf64078 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 6 May 2013 15:42:29 +0900 Subject: [PATCH] kernel32: Hold PEB lock during process exit. --- dlls/kernel32/process.c | 2 ++ dlls/kernel32/tests/loader.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 7abb732988c..683385fd43e 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -2630,6 +2630,7 @@ __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitPr void WINAPI process_ExitProcess( DWORD status ) { + RtlAcquirePebLock(); LdrShutdownProcess(); NtTerminateProcess(GetCurrentProcess(), status); exit(status); @@ -2639,6 +2640,7 @@ void WINAPI process_ExitProcess( DWORD status ) void WINAPI ExitProcess( DWORD status ) { + RtlAcquirePebLock(); LdrShutdownProcess(); NtTerminateProcess(GetCurrentProcess(), status); exit(status); diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index a45235f049e..17e6cd8d3b0 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -1872,7 +1872,6 @@ static void test_ExitProcess(void) ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); -todo_wine ok(ret == WAIT_TIMEOUT, "child process should fail to terminate\n"); if (ret != WAIT_OBJECT_0) { @@ -1882,7 +1881,6 @@ todo_wine ret = WaitForSingleObject(pi.hProcess, 1000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &ret); -todo_wine ok(ret == 199, "expected exit code 199, got %u\n", ret); if (*child_failures) {