[2/3] kernel32: Terminate threads before unloading DLLs on process exit.
Dmitry Timoshkov
dmitry at baikal.ru
Fri May 10 05:18:41 CDT 2013
If it's not yet time to make this change please let me know what else needs
to be tested/fixed/investigated.
---
dlls/kernel32/process.c | 2 ++
dlls/kernel32/tests/loader.c | 22 ----------------------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 683385f..d07065c 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2631,6 +2631,7 @@ __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitPr
void WINAPI process_ExitProcess( DWORD status )
{
RtlAcquirePebLock();
+ NtTerminateProcess(0, status);
LdrShutdownProcess();
NtTerminateProcess(GetCurrentProcess(), status);
exit(status);
@@ -2641,6 +2642,7 @@ void WINAPI process_ExitProcess( DWORD status )
void WINAPI ExitProcess( DWORD status )
{
RtlAcquirePebLock();
+ NtTerminateProcess(0, status);
LdrShutdownProcess();
NtTerminateProcess(GetCurrentProcess(), status);
exit(status);
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index ac171bd..390382c 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -1205,19 +1205,11 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
if (expected_code != STILL_ACTIVE)
{
ret = WaitForSingleObject(attached_thread[i], 1000);
- /* FIXME: remove once Wine is fixed */
- if (test_dll_phase == 1) todo_wine
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
- else
ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
}
ret = GetExitCodeThread(attached_thread[i], &code);
trace("dll: GetExitCodeThread(%u) => %d,%u\n", i, ret, code);
ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret);
- /* FIXME: remove once Wine is fixed */
- if (test_dll_phase == 1) todo_wine
- ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
- else
ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
}
@@ -1228,13 +1220,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
if (expected_code == STILL_ACTIVE)
ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret);
else
- {
- /* FIXME: remove once Wine is fixed */
- if (test_dll_phase == 1) todo_wine
- ok(ret == WAIT_ABANDONED, "expected WAIT_ABANDONED, got %#x\n", ret);
- else
ok(ret == WAIT_ABANDONED, "expected WAIT_ABANDONED, got %#x\n", ret);
- }
/* semaphore is not abandoned on thread termination */
ret = WaitForSingleObject(semaphore, 0);
@@ -1250,16 +1236,8 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
else
{
ret = WaitForSingleObject(attached_thread[0], 0);
- /* FIXME: remove once Wine is fixed */
- if (test_dll_phase == 1) todo_wine
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
- else
ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
ret = WaitForSingleObject(attached_thread[1], 0);
- /* FIXME: remove once Wine is fixed */
- if (test_dll_phase == 1) todo_wine
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
- else
ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret);
}
--
1.8.2.2
More information about the wine-patches
mailing list