From: Hugh McMaster hugh.mcmaster@outlook.com
--- dlls/kernel32/tests/process.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 8ad5bed9549..9faec85badf 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -252,10 +252,6 @@ static BOOL init(void) hkernel32 = GetModuleHandleA("kernel32"); hntdll = GetModuleHandleA("ntdll.dll");
- pNtQueryInformationProcess = (void *)GetProcAddress(hntdll, "NtQueryInformationProcess"); - pNtQueryInformationThread = (void *)GetProcAddress(hntdll, "NtQueryInformationThread"); - pNtQuerySystemInformationEx = (void *)GetProcAddress(hntdll, "NtQuerySystemInformationEx"); - pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo"); pGetSystemRegistryQuota = (void *) GetProcAddress(hkernel32, "GetSystemRegistryQuota"); pIsWow64Process = (void *) GetProcAddress(hkernel32, "IsWow64Process"); @@ -287,6 +283,16 @@ static BOOL init(void) pGetActiveProcessorCount = (void *)GetProcAddress(hkernel32, "GetActiveProcessorCount"); pGetMaximumProcessorCount = (void *)GetProcAddress(hkernel32, "GetMaximumProcessorCount");
+#define NTDLL_GET_PROC(func) \ + p##func = (void *)GetProcAddress(hntdll, #func); \ + if (!p##func) trace("GetProcAddress(hntdll, '%s') failed\n", #func); + + NTDLL_GET_PROC(NtQueryInformationProcess); + NTDLL_GET_PROC(NtQueryInformationThread); + NTDLL_GET_PROC(NtQuerySystemInformationEx); + +#undef NTDLL_GET_PROC + return TRUE; }