implemented MmGetSystemRoutineAddress()

svn path=/trunk/; revision=11643
This commit is contained in:
Thomas Bluemel 2004-11-13 13:09:07 +00:00
parent d0917c6faf
commit 3e0c6c7994
2 changed files with 35 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* $Id: loader.c,v 1.150 2004/10/26 10:56:38 ekohl Exp $
/* $Id: loader.c,v 1.151 2004/11/13 13:09:07 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -43,8 +43,8 @@
LIST_ENTRY ModuleListHead;
KSPIN_LOCK ModuleListLock;
STATIC MODULE_OBJECT NtoskrnlModuleObject;
STATIC MODULE_OBJECT HalModuleObject;
MODULE_OBJECT NtoskrnlModuleObject;
MODULE_OBJECT HalModuleObject;
LIST_ENTRY ModuleTextListHead;
STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mm.c,v 1.79 2004/10/22 20:38:22 ekohl Exp $
/* $Id: mm.c,v 1.80 2004/11/13 13:09:07 weiden Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
@ -35,6 +35,9 @@
/* GLOBALS *****************************************************************/
extern MODULE_OBJECT NtoskrnlModuleObject;
extern MODULE_OBJECT HalModuleObject;
PVOID EXPORTED MmUserProbeAddress = NULL;
PVOID EXPORTED MmHighestUserAddress = NULL;
PBOOLEAN EXPORTED Mm64BitPhysicalAddress = FALSE;
@ -496,7 +499,7 @@ MmSetAddressRangeModified (
}
/*
* @unimplemented
* @implemented
*/
PVOID
NTKERNELAPI
@ -504,8 +507,33 @@ MmGetSystemRoutineAddress (
IN PUNICODE_STRING SystemRoutineName
)
{
UNIMPLEMENTED;
return 0;
PVOID ProcAddress;
ANSI_STRING AnsiRoutineName;
NTSTATUS Status;
if(!NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiRoutineName,
SystemRoutineName,
TRUE)))
{
return NULL;
}
Status = LdrGetProcedureAddress(NtoskrnlModuleObject.Base,
&AnsiRoutineName,
0,
&ProcAddress);
if(!NT_SUCCESS(Status))
{
Status = LdrGetProcedureAddress(HalModuleObject.Base,
&AnsiRoutineName,
0,
&ProcAddress);
}
RtlFreeAnsiString(&AnsiRoutineName);
return (NT_SUCCESS(Status) ? ProcAddress : NULL);
}
/* EOF */