Commit b9627b99 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

ntoskrnl: Add ExGetPreviousMode and test.

parent f3e1d897
......@@ -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)
......
......@@ -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)
......
......@@ -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");
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment