diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 890b4ac23cd..cebfc5fc05d 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -135,6 +135,11 @@ static void test_EnumProcessModules(void) ret = pEnumProcessModules(hpQV, NULL, 0, &cbNeeded); ok(ret == 1, "failed with %d\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = pEnumProcessModules(hpQV, NULL, sizeof(HMODULE), &cbNeeded); + ok(!ret, "succeeded\n"); + ok(GetLastError() == ERROR_NOACCESS, "expected error=ERROR_NOACCESS but got %d\n", GetLastError()); + SetLastError(0xdeadbeef); ret = pEnumProcessModules(hpQV, &hMod, sizeof(HMODULE), &cbNeeded); if(ret != 1)