mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[NTOS:MM] Forward MmLocateMemoryAreaByAddress to MmLocateMemoryAreaByRegion
Both functions do exactly the same.
This commit is contained in:
parent
31a693a035
commit
7b23673851
1 changed files with 5 additions and 40 deletions
|
@ -56,49 +56,14 @@ BOOLEAN MiRosKernelVadRootInitialized;
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
PMEMORY_AREA NTAPI
|
||||
PMEMORY_AREA
|
||||
NTAPI
|
||||
MmLocateMemoryAreaByAddress(
|
||||
PMMSUPPORT AddressSpace,
|
||||
PVOID Address_)
|
||||
PVOID Address)
|
||||
{
|
||||
ULONG_PTR StartVpn = (ULONG_PTR)Address_ / PAGE_SIZE;
|
||||
PEPROCESS Process;
|
||||
PMM_AVL_TABLE Table;
|
||||
PMMADDRESS_NODE Node;
|
||||
PMEMORY_AREA MemoryArea;
|
||||
TABLE_SEARCH_RESULT Result;
|
||||
PMMVAD_LONG Vad;
|
||||
|
||||
Process = MmGetAddressSpaceOwner(AddressSpace);
|
||||
Table = (Process != NULL) ? &Process->VadRoot : &MiRosKernelVadRoot;
|
||||
|
||||
Result = MiCheckForConflictingNode(StartVpn, StartVpn, Table, &Node);
|
||||
if (Result != TableFoundNode)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Vad = (PMMVAD_LONG)Node;
|
||||
if (Vad->u.VadFlags.Spare == 0)
|
||||
{
|
||||
/* Check if this is VM VAD */
|
||||
if (Vad->ControlArea == NULL)
|
||||
{
|
||||
/* We store the reactos MEMORY_AREA here */
|
||||
MemoryArea = (PMEMORY_AREA)Vad->FirstPrototypePte;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a section VAD. Store the MAREA here for now */
|
||||
MemoryArea = (PMEMORY_AREA)Vad->u4.Banked;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MemoryArea = (PMEMORY_AREA)Node;
|
||||
}
|
||||
|
||||
return MemoryArea;
|
||||
/* Do it the simple way */
|
||||
return MmLocateMemoryAreaByRegion(AddressSpace, Address, 1);
|
||||
}
|
||||
|
||||
PMEMORY_AREA
|
||||
|
|
Loading…
Reference in a new issue