ntoskrnl: Add ExGetPreviousMode and test.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54378
This commit is contained in:
Alex Henrie 2023-01-27 21:17:42 -07:00 committed by Alexandre Julliard
parent f3e1d897ca
commit b9627b996f
4 changed files with 9 additions and 1 deletions

View file

@ -4566,6 +4566,12 @@ NTSTATUS WINAPI KdEnableDebugger(void)
return STATUS_DEBUGGER_INACTIVE;
}
KPROCESSOR_MODE WINAPI ExGetPreviousMode(void)
{
TRACE("\n");
return PsIsSystemThread((PETHREAD)KeGetCurrentThread()) ? KernelMode : UserMode;
}
#ifdef __x86_64__
void WINAPI KfRaiseIrql(KIRQL new, KIRQL *old)

View file

@ -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)

View file

@ -454,6 +454,7 @@ static void test_current_thread(BOOL is_system)
ok(PsGetThreadId((PETHREAD)KeGetCurrentThread()) == PsGetCurrentThreadId(), "thread IDs don't match\n");
ok(PsIsSystemThread((PETHREAD)KeGetCurrentThread()) == is_system, "unexpected system thread\n");
ok(ExGetPreviousMode() == is_system ? KernelMode : UserMode, "previous mode is not correct\n");
if (!is_system)
{
ok(create_caller_thread == KeGetCurrentThread(), "thread is not create caller thread\n");

View file

@ -1683,6 +1683,7 @@ void WINAPI ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST);
void WINAPI ExDeletePagedLookasideList(PPAGED_LOOKASIDE_LIST);
NTSTATUS WINAPI ExDeleteResourceLite(ERESOURCE*);
ULONG WINAPI ExGetExclusiveWaiterCount(ERESOURCE*);
KPROCESSOR_MODE WINAPI ExGetPreviousMode(void);
ULONG WINAPI ExGetSharedWaiterCount(ERESOURCE*);
void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);
void WINAPI ExInitializePagedLookasideList(PPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);