mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[NTOS:MM] Remove usage of memory area in MiProtectVirtualMemory
This commit is contained in:
parent
edecbf4799
commit
f60128b69d
1 changed files with 12 additions and 14 deletions
|
@ -2201,7 +2201,6 @@ MiProtectVirtualMemory(IN PEPROCESS Process,
|
|||
IN ULONG NewAccessProtection,
|
||||
OUT PULONG OldAccessProtection OPTIONAL)
|
||||
{
|
||||
PMEMORY_AREA MemoryArea;
|
||||
PMMVAD Vad;
|
||||
PMMSUPPORT AddressSpace;
|
||||
ULONG_PTR StartingAddress, EndingAddress;
|
||||
|
@ -2240,19 +2239,6 @@ MiProtectVirtualMemory(IN PEPROCESS Process,
|
|||
goto FailPath;
|
||||
}
|
||||
|
||||
/* Check for ROS specific memory area */
|
||||
MemoryArea = MmLocateMemoryAreaByAddress(&Process->Vm, *BaseAddress);
|
||||
if ((MemoryArea) && (MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3))
|
||||
{
|
||||
/* Evil hack */
|
||||
MmUnlockAddressSpace(AddressSpace);
|
||||
return MiRosProtectVirtualMemory(Process,
|
||||
BaseAddress,
|
||||
NumberOfBytesToProtect,
|
||||
NewAccessProtection,
|
||||
OldAccessProtection);
|
||||
}
|
||||
|
||||
/* Get the VAD for this address range, and make sure it exists */
|
||||
Result = MiCheckForConflictingNode(StartingAddress >> PAGE_SHIFT,
|
||||
EndingAddress >> PAGE_SHIFT,
|
||||
|
@ -2265,6 +2251,18 @@ MiProtectVirtualMemory(IN PEPROCESS Process,
|
|||
goto FailPath;
|
||||
}
|
||||
|
||||
/* Check if this is a ROSMM VAD */
|
||||
if (MI_IS_ROSMM_VAD(Vad))
|
||||
{
|
||||
/* Not very awesome hack */
|
||||
MmUnlockAddressSpace(AddressSpace);
|
||||
return MiRosProtectVirtualMemory(Process,
|
||||
BaseAddress,
|
||||
NumberOfBytesToProtect,
|
||||
NewAccessProtection,
|
||||
OldAccessProtection);
|
||||
}
|
||||
|
||||
/* Make sure the address is within this VAD's boundaries */
|
||||
if ((((ULONG_PTR)StartingAddress >> PAGE_SHIFT) < Vad->StartingVpn) ||
|
||||
(((ULONG_PTR)EndingAddress >> PAGE_SHIFT) > Vad->EndingVpn))
|
||||
|
|
Loading…
Reference in a new issue