I haven't seen any software that uses this, but some older software out there might use it, so it's good idea to export it.
-- v2: ntoskrnl.exe: add KeNumberProcessors export.
From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
fix various issues with original implementation --- dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 9320e02dca9..c745ebf3008 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2595,6 +2595,9 @@ KAFFINITY WINAPI KeQueryActiveProcessors( void ) return affinity_mask; }
+static CCHAR number_processors; +CCHAR *KeNumberProcessors = &number_processors; + ULONG WINAPI KeQueryActiveProcessorCountEx(USHORT group_number) { TRACE("group_number %u.\n", group_number); @@ -4544,6 +4547,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) NtBuildNumber = NtCurrentTeb()->Peb->OSBuildNumber; ntoskrnl_heap = HeapCreate( HEAP_CREATE_ENABLE_EXECUTE, 0, 0 ); dpc_call_tls_index = TlsAlloc(); + number_processors = (CCHAR)min( 64UL, KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS) ); LdrRegisterDllNotification( 0, ldr_notify_callback, NULL, &ldr_notify_cookie ); break; case DLL_PROCESS_DETACH: diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 8f8edcac7a0..322ed5329de 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -593,7 +593,7 @@ @ stdcall KeLeaveCriticalRegion() @ stub KeLoaderBlock @ stdcall -arch=x86_64 KeLowerIrql(long) -@ stub KeNumberProcessors +@ extern KeNumberProcessors @ stub KeProfileInterrupt @ stub KeProfileInterruptWithSource @ stub KePulseEvent
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125258
Your paranoid android.
=== debian11 (build log) ===
Task: Could not create the win32 wineprefix: Failed to disable the crash dialogs: Task: WineTest did not produce the win32 report