From 9ffacb6b0982ef388cfa327b358fe54660c6834a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 24 May 2020 17:46:14 +1000 Subject: [PATCH] Added ntoskrnl.exe-KeQueryActiveProcessorCountEx patchset --- ...d-KeQueryActiveProcessorCountEx-stub.patch | 46 +++++++++++++++++++ .../definition | 1 + patches/patchinstall.sh | 19 ++++++++ 3 files changed, 66 insertions(+) create mode 100644 patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/0001-ntoskrnl.exe-Add-KeQueryActiveProcessorCountEx-stub.patch create mode 100644 patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/definition diff --git a/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/0001-ntoskrnl.exe-Add-KeQueryActiveProcessorCountEx-stub.patch b/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/0001-ntoskrnl.exe-Add-KeQueryActiveProcessorCountEx-stub.patch new file mode 100644 index 00000000..2031dc39 --- /dev/null +++ b/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/0001-ntoskrnl.exe-Add-KeQueryActiveProcessorCountEx-stub.patch @@ -0,0 +1,46 @@ +From e896e48ccccde8d6a418284884f5dc3c14b48898 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Sat, 23 May 2020 19:02:36 +1000 +Subject: [PATCH] ntoskrnl.exe: Add KeQueryActiveProcessorCountEx stub + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49217 +Signed-off-by: Alistair Leslie-Hughes +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 8 ++++++++ + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 + + 2 files changed, 9 insertions(+) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index ea5ead5c6dce..773f8c1c3279 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -2395,6 +2395,14 @@ KAFFINITY WINAPI KeQueryActiveProcessors( void ) + return AffinityMask; + } + ++/********************************************************************** ++ * KeQueryActiveProcessorCountEx (NTOSKRNL.EXE.@ ++ */ ++ULONG WINAPI KeQueryActiveProcessorCountEx( USHORT group ) ++{ ++ FIXME("(%d) stub\n", group); ++ return 1; ++} + + /********************************************************************** + * KeQueryInterruptTime (NTOSKRNL.EXE.@) +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +index e0fda1848354..1a4f26b96303 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec ++++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +@@ -587,6 +587,7 @@ + @ stub KeProfileInterruptWithSource + @ stub KePulseEvent + @ stdcall KeQueryActiveProcessors() ++@ stdcall KeQueryActiveProcessorCountEx(long) + @ stdcall KeQueryInterruptTime() + @ stub KeQueryPriorityThread + @ stub KeQueryRuntimeThread +-- +2.26.2 + diff --git a/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/definition b/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/definition new file mode 100644 index 00000000..8c3bdd6b --- /dev/null +++ b/patches/ntoskrnl.exe-KeQueryActiveProcessorCountEx/definition @@ -0,0 +1 @@ +Fixes: [49217] ntoskrnl.exe: Add KeQueryActiveProcessorCountEx stub diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 232580dd..02a6a190 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -213,6 +213,7 @@ patch_enable_all () enable_ntdll_x86_64_SegDs="$1" enable_ntoskrnl_Stubs="$1" enable_ntoskrnl_exe_KdRefreshDebuggerNotPresent="$1" + enable_ntoskrnl_exe_KeQueryActiveProcessorCountEx="$1" enable_ntoskrnl_exe_KeRevertToUserAffinityThreadEx="$1" enable_ntoskrnl_exe_KeSetSystemAffinityThreadEx="$1" enable_nvapi_Stub_DLL="$1" @@ -744,6 +745,9 @@ patch_enable () ntoskrnl.exe-KdRefreshDebuggerNotPresent) enable_ntoskrnl_exe_KdRefreshDebuggerNotPresent="$2" ;; + ntoskrnl.exe-KeQueryActiveProcessorCountEx) + enable_ntoskrnl_exe_KeQueryActiveProcessorCountEx="$2" + ;; ntoskrnl.exe-KeRevertToUserAffinityThreadEx) enable_ntoskrnl_exe_KeRevertToUserAffinityThreadEx="$2" ;; @@ -4959,6 +4963,21 @@ if test "$enable_ntoskrnl_exe_KdRefreshDebuggerNotPresent" -eq 1; then ) >> "$patchlist" fi +# Patchset ntoskrnl.exe-KeQueryActiveProcessorCountEx +# | +# | This patchset fixes the following Wine bugs: +# | * [#49217] ntoskrnl.exe: Add KeQueryActiveProcessorCountEx stub +# | +# | Modified files: +# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec +# | +if test "$enable_ntoskrnl_exe_KeQueryActiveProcessorCountEx" -eq 1; then + patch_apply ntoskrnl.exe-KeQueryActiveProcessorCountEx/0001-ntoskrnl.exe-Add-KeQueryActiveProcessorCountEx-stub.patch + ( + printf '%s\n' '+ { "Alistair Leslie-Hughes", "ntoskrnl.exe: Add KeQueryActiveProcessorCountEx stub.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntoskrnl.exe-KeRevertToUserAffinityThreadEx # | # | This patchset fixes the following Wine bugs: