Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/kernel32/tests/process.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 7c6a0ff0a84..ea9cde5facc 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -90,6 +90,8 @@ static SIZE_T (WINAPI *pGetLargePageMinimum)(void); static BOOL (WINAPI *pInitializeProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*, DWORD, DWORD, SIZE_T*); static BOOL (WINAPI *pUpdateProcThreadAttribute)(struct _PROC_THREAD_ATTRIBUTE_LIST*, DWORD, DWORD_PTR, void *,SIZE_T,void*,SIZE_T*); static void (WINAPI *pDeleteProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*); +static DWORD (WINAPI *pGetActiveProcessorCount)(WORD); +static DWORD (WINAPI *pGetMaximumProcessorCount)(WORD);
/* ############################### */ static char base[MAX_PATH]; @@ -270,6 +272,8 @@ static BOOL init(void) pInitializeProcThreadAttributeList = (void *)GetProcAddress(hkernel32, "InitializeProcThreadAttributeList"); pUpdateProcThreadAttribute = (void *)GetProcAddress(hkernel32, "UpdateProcThreadAttribute"); pDeleteProcThreadAttributeList = (void *)GetProcAddress(hkernel32, "DeleteProcThreadAttributeList"); + pGetActiveProcessorCount = (void *)GetProcAddress(hkernel32, "GetActiveProcessorCount"); + pGetMaximumProcessorCount = (void *)GetProcAddress(hkernel32, "GetMaximumProcessorCount");
return TRUE; } @@ -2320,6 +2324,23 @@ static void test_SystemInfo(void) } }
+static void test_ProcessorCount(void) +{ + DWORD active, maximum; + + if (!pGetActiveProcessorCount || !pGetMaximumProcessorCount) + { + win_skip("GetActiveProcessorCount or GetMaximumProcessorCount is not available\n"); + return; + } + + active = pGetActiveProcessorCount(ALL_PROCESSOR_GROUPS); + maximum = pGetMaximumProcessorCount(ALL_PROCESSOR_GROUPS); + ok(active <= maximum, + "Number of active processors %i is greater than maximum number of processors %i\n", + active, maximum); +} + static void test_RegistryQuota(void) { BOOL ret; @@ -4257,6 +4278,7 @@ START_TEST(process) test_IsWow64Process(); test_IsWow64Process2(); test_SystemInfo(); + test_ProcessorCount(); test_RegistryQuota(); test_DuplicateHandle(); test_StartupNoConsole();