Commit 4defc2b5 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

ntoskrnl.exe: Implement MmGetSystemRoutineAddress.

parent bf92d683
......@@ -1071,6 +1071,36 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE
return STATUS_SUCCESS;
}
/***********************************************************************
* MmGetSystemRoutineAddress (NTOSKRNL.EXE.@)
*/
PVOID WINAPI MmGetSystemRoutineAddress(PUNICODE_STRING SystemRoutineName)
{
HMODULE hMod;
STRING routineNameA;
PVOID pFunc = NULL;
static const WCHAR ntoskrnlW[] = {'n','t','o','s','k','r','n','l','.','e','x','e',0};
static const WCHAR halW[] = {'h','a','l','.','d','l','l',0};
if (!SystemRoutineName) return NULL;
if (RtlUnicodeStringToAnsiString( &routineNameA, SystemRoutineName, TRUE ) == STATUS_SUCCESS)
{
/* We only support functions exported from ntoskrnl.exe or hal.dll */
hMod = GetModuleHandleW( ntoskrnlW );
pFunc = GetProcAddress( hMod, routineNameA.Buffer );
if (!pFunc)
{
hMod = GetModuleHandleW( halW );
if (hMod) pFunc = GetProcAddress( hMod, routineNameA.Buffer );
}
RtlFreeAnsiString( &routineNameA );
}
TRACE( "%s -> %p\n", debugstr_us(SystemRoutineName), pFunc );
return pFunc;
}
/*****************************************************
* DllMain
......
......@@ -675,7 +675,7 @@
@ stub MmFreePagesFromMdl
@ stub MmGetPhysicalAddress
@ stub MmGetPhysicalMemoryRanges
@ stub MmGetSystemRoutineAddress
@ stdcall MmGetSystemRoutineAddress(ptr)
@ stub MmGetVirtualForPhysical
@ stub MmGrowKernelStack
@ stub MmHighestUserAddress
......
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