kernel32: Hold PEB lock during process exit.

This commit is contained in:
Dmitry Timoshkov 2013-05-06 15:42:29 +09:00 committed by Alexandre Julliard
parent bac0387d29
commit 77f222505c
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -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)
{