[PATCH 0/1] MR2033: ntoskrnl: Add ExGetPreviousMode stub.
From: Alex Henrie <alexhenrie24(a)gmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54378 --- dlls/ntoskrnl.exe/ntoskrnl.c | 6 ++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index cc30750a160..42fe2c88a28 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -4566,6 +4566,12 @@ NTSTATUS WINAPI KdEnableDebugger(void) return STATUS_DEBUGGER_INACTIVE; } +KPROCESSOR_MODE WINAPI ExGetPreviousMode(void) +{ + FIXME("stub\n"); + return UserMode; +} + #ifdef __x86_64__ void WINAPI KfRaiseIrql(KIRQL new, KIRQL *old) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 2447d01458d..0b694b08de0 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -154,7 +154,7 @@ @ stub ExGetCurrentProcessorCounts @ stub ExGetCurrentProcessorCpuUsage @ stdcall ExGetExclusiveWaiterCount(ptr) -@ stub ExGetPreviousMode +@ stdcall ExGetPreviousMode() @ stdcall ExGetSharedWaiterCount(ptr) @ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long) @ stdcall ExInitializePagedLookasideList(ptr ptr ptr long long long long) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2033
Is UserMode better to return or is it KernelMode? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_21988
I will implement KeReleaseGuardedMutex if you haven't already. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_21989
On Thu Jan 26 21:58:13 2023 +0000, Etaash Mathamsetty wrote:
Is UserMode better to return or is it KernelMode? I don't think it matters for the stub. I chose UserMode because technically Wine always runs in user mode.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_22062
On Thu Jan 26 22:00:16 2023 +0000, Etaash Mathamsetty wrote:
I will implement KeReleaseGuardedMutex and KeAcquireGuardedMutex if you haven't already. (according to MSDN guarded mutexes are implemented in the same way as a fast mutex, so it should be simple) I haven't started on KeAcquireGuardedMutex and KeReleaseGuardedMutex yet. I'd love it if you do that part!
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_22063
I don't think it matters for the stub. I chose UserMode because technically Wine always runs in user mode.
That's not really a good reason. The point of ntoskrnl is to emulate kernel mode. This should probably come from the current thread; perhaps it should just be keyed on PsIsSystemThread(KeGetCurrentThread()). Ideally we'd have at least some tests. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_22072
This should probably come from the current thread; perhaps it should just be keyed on PsIsSystemThread(KeGetCurrentThread()). Ideally we'd have at least some tests.
I agree that that's about the best we can do. It won't work for Zw*() calls though, since we just forward Zw*() to Nt*() counterparts just like ntdll. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2033#note_22225
participants (5)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Etaash Mathamsetty (@etaash.mathamsetty) -
Jinoh Kang (@iamahuman) -
Zebediah Figura (@zfigura)