From 7de3f1b5b59c6e42333e94f2c5a62656d0fab39a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 19 Apr 2013 18:48:31 +0900 Subject: [PATCH] kernel32: Check whether FreeLibrary actually has unloaded the module. --- dlls/kernel32/tests/loader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 9fd5091bb54..8d266782a23 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -1259,14 +1259,21 @@ todo_wine CloseHandle(handle); CloseHandle(process); - SetLastError(0xdeadbeef); handle = GetModuleHandle("winver.exe"); ok(!handle, "winver.exe shouldn't be loaded yet\n"); + SetLastError(0xdeadbeef); handle = LoadLibrary("winver.exe"); ok(handle != 0, "LoadLibrary error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = FreeLibrary(handle); - ok(ret, "LoadLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %d\n", GetLastError()); + handle = GetModuleHandle("winver.exe"); + /* manual call to LdrShutdownProcess doesn't prevent module unloading */ + if (param && test_dll_phase != 4) + ok(handle != 0, "winver.exe should not be unloaded\n"); + else + todo_wine + ok(!handle || broken(handle != 0) /* before win7 */, "winver.exe should be unloaded\n"); SetLastError(0xdeadbeef); ret = WaitForDebugEvent(&de, 0);