From bff534936af398e6a6c0ac73c8e93a6b11b7c268 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 21 Oct 2017 13:24:28 +0100 Subject: [PATCH] [PSAPI_WINETEST] Sync with Wine Staging 2.16. CORE-13762 --- modules/rostests/winetests/psapi/psapi_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/psapi/psapi_main.c b/modules/rostests/winetests/psapi/psapi_main.c index 5869866553b..b02c7a0f062 100644 --- a/modules/rostests/winetests/psapi/psapi_main.c +++ b/modules/rostests/winetests/psapi/psapi_main.c @@ -149,6 +149,7 @@ static void test_EnumProcessModules(void) static void test_GetModuleInformation(void) { HMODULE hMod = GetModuleHandleA(NULL); + DWORD *tmp, counter = 0; MODULEINFO info; DWORD ret; @@ -168,10 +169,21 @@ static void test_GetModuleInformation(void) pGetModuleInformation(hpQV, hMod, &info, sizeof(info)-1); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected error=ERROR_INSUFFICIENT_BUFFER but got %d\n", GetLastError()); - SetLastError(0xdeadbeef); ret = pGetModuleInformation(hpQV, hMod, &info, sizeof(info)); ok(ret == 1, "failed with %d\n", GetLastError()); ok(info.lpBaseOfDll == hMod, "lpBaseOfDll=%p hMod=%p\n", info.lpBaseOfDll, hMod); + + hMod = LoadLibraryA("shell32.dll"); + ok(hMod != NULL, "Failed to load shell32.dll, error: %u\n", GetLastError()); + + ret = pGetModuleInformation(hpQV, hMod, &info, sizeof(info)); + ok(ret == 1, "failed with %d\n", GetLastError()); + info.SizeOfImage /= sizeof(DWORD); + for (tmp = (DWORD *)hMod; info.SizeOfImage; info.SizeOfImage--) + counter ^= *tmp++; + trace("xor of shell32: %08x\n", counter); + + FreeLibrary(hMod); } static BOOL check_with_margin(SIZE_T perf, SIZE_T sysperf, int margin)