mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
ntoskrnl.exe: Implement MmGetSystemRoutineAddress.
This commit is contained in:
parent
bf92d68330
commit
4defc2b50a
2 changed files with 31 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue