[PATCH v2 0/1] MR824: ntoskrnl: Implement KeGetCurrentProcessorNumberEx
required by mrac anti-cheat -- v2: ntoskrnl: Implement KeGetCurrentProcessorNumberEx https://gitlab.winehq.org/wine/wine/-/merge_requests/824
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/ntoskrnl.exe/ntoskrnl.c | 10 ++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 + 2 files changed, 11 insertions(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 031e9900544..6c814f46dea 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3379,6 +3379,16 @@ VOID WINAPI KeSetTargetProcessorDpc(PRKDPC dpc, CCHAR number) FIXME("%p, %d stub\n", dpc, number); } +/*********************************************************************** + * KeGetCurrentProcessorNumberEx (NTOSKRNL.EXE.@) + */ +ULONG WINAPI KeGetCurrentProcessorNumberEx(PPROCESSOR_NUMBER ProcNumber) +{ + if(ProcNumber) FIXME("Unhandled ProcNumber\n"); + + return NtGetCurrentProcessorNumber(); +} + /*********************************************************************** * READ_REGISTER_BUFFER_UCHAR (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index e3898b06f89..2377311f9c5 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -555,6 +555,7 @@ @ stub KeFlushEntireTb @ stdcall KeFlushQueuedDpcs() @ stdcall KeGetCurrentProcessorNumber() NtGetCurrentProcessorNumber +@ stdcall KeGetCurrentProcessorNumberEx(ptr) @ stdcall KeGetCurrentThread() @ stub KeGetPreviousMode @ stub KeGetRecommendedSharedDataAlignment -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/824
Zhiyi Zhang (@zhiyi) commented about dlls/ntoskrnl.exe/ntoskrnl.c:
FIXME("%p, %d stub\n", dpc, number); }
+/*********************************************************************** + * KeGetCurrentProcessorNumberEx (NTOSKRNL.EXE.@) + */ +ULONG WINAPI KeGetCurrentProcessorNumberEx(PPROCESSOR_NUMBER ProcNumber) +{ + if(ProcNumber) FIXME("Unhandled ProcNumber\n");
Space after if. ProcNumber -> process_number. And the parameter is optional so you need to check for NULL pointers. Also, I think the PROCESSOR_NUMBER structure is simple enough to be stubbed as well. Just report all Group and Reserved as zero and Number from NtGetCurrentProcessorNumber() and then print a FIXME. A FIXME at the start saying the function is a semi-stub is also helpful. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/824#note_8189
On Mon Sep 12 01:56:43 2022 +0000, Zhiyi Zhang wrote:
Space after if. ProcNumber -> process_number. And the parameter is optional so you need to check for NULL pointers. Also, I think the PROCESSOR_NUMBER structure is simple enough to be stubbed as well. Just report all Group and Reserved as zero and Number from NtGetCurrentProcessorNumber() and then print a FIXME. A FIXME at the start saying the function is a semi-stub is also helpful. that was my original patch, but I thought that would not be even close to correct lol I'll fix this.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/824#note_8262
participants (3)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty) -
Zhiyi Zhang (@zhiyi)