From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/ntoskrnl.exe/ntoskrnl.c | 26 ++++++++++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 5 +++++ include/winbase.h | 1 + 3 files changed, 32 insertions(+)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index fd18ea706c2..7e6be60514a 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2593,6 +2593,16 @@ ULONG WINAPI KeQueryActiveProcessorCountEx(USHORT group_number) return GetActiveProcessorCount(group_number); }
+ULONG WINAPI KeQueryActiveProcessorCount(PKAFFINITY active_processors) +{ + TRACE("active_processors %p.\n", active_processors); + + if(active_processors) + *active_processors = KeQueryActiveProcessors(); + + return KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS); +} + /********************************************************************** * KeQueryInterruptTime (NTOSKRNL.EXE.@) * @@ -3406,6 +3416,22 @@ ULONG WINAPI KeGetCurrentProcessorNumberEx(PPROCESSOR_NUMBER process_number) return cur_number; }
+/*********************************************************************** + * KeQueryMaximumProcessorCountEx (NTOSKRNL.EXE.@) + */ +ULONG WINAPI KeQueryMaximumProcessorCountEx(USHORT group_number) +{ + return (ULONG) GetMaximumProcessorCount(group_number); +} + +/*********************************************************************** + * KeQueryMaximumProcessorCount (NTOSKRNL.EXE.@) + */ +ULONG WINAPI KeQueryMaximumProcessorCount(void) +{ + return KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS); +} + /*********************************************************************** * READ_REGISTER_BUFFER_UCHAR (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index a1a42d52fd1..790e11bf3fb 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -599,12 +599,17 @@ @ stub KePulseEvent @ stdcall KeQueryActiveProcessors() @ stdcall KeQueryActiveProcessorCountEx(long) +@ stdcall KeQueryActiveProcessorCount(ptr) +@ stdcall KeQueryActiveGroupCount() GetActiveProcessorGroupCount @ stdcall KeQueryInterruptTime() @ stdcall KeQueryPriorityThread(ptr) @ stub KeQueryRuntimeThread @ stdcall KeQuerySystemTime(ptr) @ stdcall KeQueryTickCount(ptr) @ stdcall KeQueryTimeIncrement() +@ stdcall KeQueryMaximumGroupCount() GetMaximumProcessorGroupCount +@ stdcall KeQueryMaximumProcessorCountEx(long) +@ stdcall KeQueryMaximumProcessorCount() @ stub KeRaiseUserException @ stdcall KeReadStateEvent(ptr) @ stub KeReadStateMutant diff --git a/include/winbase.h b/include/winbase.h index 3cfc4649c7d..a4d69e85187 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2196,6 +2196,7 @@ WINBASEAPI DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD); WINBASEAPI DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD); #define GetLongPathName WINELIB_NAME_AW(GetLongPathName) WINBASEAPI BOOL WINAPI GetMailslotInfo(HANDLE,LPDWORD,LPDWORD,LPDWORD,LPDWORD); +WINBASEAPI DWORD WINAPI GetMaximumProcessorCount(WORD); WINBASEAPI DWORD WINAPI GetModuleFileNameA(HMODULE,LPSTR,DWORD); WINBASEAPI DWORD WINAPI GetModuleFileNameW(HMODULE,LPWSTR,DWORD); #define GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)