[PSAPI_WINETEST] Sync with Wine Staging 2.16. CORE-13762

This commit is contained in:
Amine Khaldi 2017-10-21 13:24:28 +01:00
parent 3ce9d8ab17
commit bff534936a

View file

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