mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:12:58 +00:00
Rename MmOpenMemoryAreaBy[Address/Region] to MmLocateMemoryAreaBy[Address/Region].
svn path=/trunk/; revision=12731
This commit is contained in:
parent
7581cc7fb9
commit
e6f2a2f607
9 changed files with 40 additions and 44 deletions
|
@ -377,11 +377,11 @@ MmCreateMemoryArea(
|
||||||
PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL);
|
PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL);
|
||||||
|
|
||||||
PMEMORY_AREA STDCALL
|
PMEMORY_AREA STDCALL
|
||||||
MmOpenMemoryAreaByAddress(
|
MmLocateMemoryAreaByAddress(
|
||||||
PMADDRESS_SPACE AddressSpace,
|
PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID Address);
|
PVOID Address);
|
||||||
|
|
||||||
ULONG STDCALL
|
ULONG_PTR STDCALL
|
||||||
MmFindGapAtAddress(
|
MmFindGapAtAddress(
|
||||||
PMADDRESS_SPACE AddressSpace,
|
PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID Address);
|
PVOID Address);
|
||||||
|
@ -404,7 +404,7 @@ VOID STDCALL
|
||||||
MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace);
|
MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace);
|
||||||
|
|
||||||
PMEMORY_AREA STDCALL
|
PMEMORY_AREA STDCALL
|
||||||
MmOpenMemoryAreaByRegion(
|
MmLocateMemoryAreaByRegion(
|
||||||
PMADDRESS_SPACE AddressSpace,
|
PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID Address,
|
PVOID Address,
|
||||||
ULONG_PTR Length);
|
ULONG_PTR Length);
|
||||||
|
|
|
@ -580,8 +580,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
|
|
||||||
if (PBaseAddress != 0)
|
if (PBaseAddress != 0)
|
||||||
{
|
{
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
BaseAddress);
|
|
||||||
|
|
||||||
if (MemoryArea != NULL)
|
if (MemoryArea != NULL)
|
||||||
{
|
{
|
||||||
|
@ -813,8 +812,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
AddressSpace = &Process->AddressSpace;
|
AddressSpace = &Process->AddressSpace;
|
||||||
|
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
BaseAddress);
|
|
||||||
if (MemoryArea == NULL)
|
if (MemoryArea == NULL)
|
||||||
{
|
{
|
||||||
MmUnlockAddressSpace(AddressSpace);
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
|
|
|
@ -50,7 +50,7 @@ PVOID
|
||||||
MmLockPagableCodeSection(IN PVOID AddressWithinSection)
|
MmLockPagableCodeSection(IN PVOID AddressWithinSection)
|
||||||
{
|
{
|
||||||
PVOID Handle;
|
PVOID Handle;
|
||||||
Handle = MmOpenMemoryAreaByAddress(NULL,AddressWithinSection);
|
Handle = MmLocateMemoryAreaByAddress(NULL,AddressWithinSection);
|
||||||
MmLockPagableSectionByHandle(Handle);
|
MmLockPagableSectionByHandle(Handle);
|
||||||
return(Handle);
|
return(Handle);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ PVOID STDCALL
|
||||||
MmLockPagableDataSection(IN PVOID AddressWithinSection)
|
MmLockPagableDataSection(IN PVOID AddressWithinSection)
|
||||||
{
|
{
|
||||||
PVOID Handle;
|
PVOID Handle;
|
||||||
Handle = MmOpenMemoryAreaByAddress(NULL, AddressWithinSection);
|
Handle = MmLocateMemoryAreaByAddress(NULL, AddressWithinSection);
|
||||||
MmLockPagableSectionByHandle(Handle);
|
MmLockPagableSectionByHandle(Handle);
|
||||||
return(Handle);
|
return(Handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,13 +197,13 @@ MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace)
|
||||||
}
|
}
|
||||||
|
|
||||||
PMEMORY_AREA STDCALL
|
PMEMORY_AREA STDCALL
|
||||||
MmOpenMemoryAreaByAddress(
|
MmLocateMemoryAreaByAddress(
|
||||||
PMADDRESS_SPACE AddressSpace,
|
PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID Address)
|
PVOID Address)
|
||||||
{
|
{
|
||||||
PMEMORY_AREA Node = AddressSpace->MemoryAreaRoot;
|
PMEMORY_AREA Node = AddressSpace->MemoryAreaRoot;
|
||||||
|
|
||||||
DPRINT("MmOpenMemoryAreaByAddress(AddressSpace %x, Address %x)\n",
|
DPRINT("MmLocateMemoryAreaByAddress(AddressSpace %x, Address %x)\n",
|
||||||
AddressSpace, Address);
|
AddressSpace, Address);
|
||||||
|
|
||||||
if (!(KdDebugState & KD_DEBUG_SCREEN))
|
if (!(KdDebugState & KD_DEBUG_SCREEN))
|
||||||
|
@ -217,18 +217,18 @@ MmOpenMemoryAreaByAddress(
|
||||||
Node = Node->RightChild;
|
Node = Node->RightChild;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT("MmOpenMemoryAreaByAddress(%x): %x [%x - %x]\n",
|
DPRINT("MmLocateMemoryAreaByAddress(%x): %x [%x - %x]\n",
|
||||||
Address, Node, Node->StartingAddress, Node->EndingAddress);
|
Address, Node, Node->StartingAddress, Node->EndingAddress);
|
||||||
return Node;
|
return Node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("MmOpenMemoryAreaByAddress(%x): 0\n", Address);
|
DPRINT("MmLocateMemoryAreaByAddress(%x): 0\n", Address);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PMEMORY_AREA STDCALL
|
PMEMORY_AREA STDCALL
|
||||||
MmOpenMemoryAreaByRegion(
|
MmLocateMemoryAreaByRegion(
|
||||||
PMADDRESS_SPACE AddressSpace,
|
PMADDRESS_SPACE AddressSpace,
|
||||||
PVOID Address,
|
PVOID Address,
|
||||||
ULONG_PTR Length)
|
ULONG_PTR Length)
|
||||||
|
@ -250,7 +250,7 @@ MmOpenMemoryAreaByRegion(
|
||||||
if (Node->StartingAddress >= Address &&
|
if (Node->StartingAddress >= Address &&
|
||||||
Node->StartingAddress < Extent)
|
Node->StartingAddress < Extent)
|
||||||
{
|
{
|
||||||
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
|
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
|
||||||
Address, Address + Length, Node->StartingAddress,
|
Address, Address + Length, Node->StartingAddress,
|
||||||
Node->EndingAddress);
|
Node->EndingAddress);
|
||||||
return Node;
|
return Node;
|
||||||
|
@ -258,7 +258,7 @@ MmOpenMemoryAreaByRegion(
|
||||||
if (Node->EndingAddress > Address &&
|
if (Node->EndingAddress > Address &&
|
||||||
Node->EndingAddress < Extent)
|
Node->EndingAddress < Extent)
|
||||||
{
|
{
|
||||||
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
|
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
|
||||||
Address, Address + Length, Node->StartingAddress,
|
Address, Address + Length, Node->StartingAddress,
|
||||||
Node->EndingAddress);
|
Node->EndingAddress);
|
||||||
return Node;
|
return Node;
|
||||||
|
@ -266,14 +266,14 @@ MmOpenMemoryAreaByRegion(
|
||||||
if (Node->StartingAddress <= Address &&
|
if (Node->StartingAddress <= Address &&
|
||||||
Node->EndingAddress >= Extent)
|
Node->EndingAddress >= Extent)
|
||||||
{
|
{
|
||||||
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
|
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
|
||||||
Address, Address + Length, Node->StartingAddress,
|
Address, Address + Length, Node->StartingAddress,
|
||||||
Node->EndingAddress);
|
Node->EndingAddress);
|
||||||
return Node;
|
return Node;
|
||||||
}
|
}
|
||||||
if (Node->StartingAddress >= Extent)
|
if (Node->StartingAddress >= Extent)
|
||||||
{
|
{
|
||||||
DPRINT("Finished MmOpenMemoryAreaByRegion() = NULL\n");
|
DPRINT("Finished MmLocateMemoryAreaByRegion() = NULL\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -866,14 +866,14 @@ MmFreeMemoryAreaByPtr(
|
||||||
{
|
{
|
||||||
PMEMORY_AREA MemoryArea;
|
PMEMORY_AREA MemoryArea;
|
||||||
|
|
||||||
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x,"
|
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, "
|
||||||
"FreePageContext %d)\n",AddressSpace,BaseAddress,Length,
|
"FreePageContext %d)\n", AddressSpace, BaseAddress,
|
||||||
FreePageContext);
|
FreePageContext);
|
||||||
|
|
||||||
MmVerifyMemoryAreas(AddressSpace);
|
MmVerifyMemoryAreas(AddressSpace);
|
||||||
|
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (MemoryArea == NULL)
|
if (MemoryArea == NULL)
|
||||||
{
|
{
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
|
@ -974,9 +974,9 @@ MmCreateMemoryArea(PEPROCESS Process,
|
||||||
ASSERT(((ULONG_PTR)*BaseAddress/BoundaryAddressMultiple.QuadPart) == ((DWORD_PTR)EndAddress/BoundaryAddressMultiple.QuadPart));
|
ASSERT(((ULONG_PTR)*BaseAddress/BoundaryAddressMultiple.QuadPart) == ((DWORD_PTR)EndAddress/BoundaryAddressMultiple.QuadPart));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MmOpenMemoryAreaByRegion(AddressSpace,
|
if (MmLocateMemoryAreaByRegion(AddressSpace,
|
||||||
*BaseAddress,
|
*BaseAddress,
|
||||||
tmpLength)!=NULL)
|
tmpLength) != NULL)
|
||||||
{
|
{
|
||||||
DPRINT("Memory area already occupied\n");
|
DPRINT("Memory area already occupied\n");
|
||||||
return STATUS_CONFLICTING_ADDRESSES;
|
return STATUS_CONFLICTING_ADDRESSES;
|
||||||
|
@ -1016,7 +1016,7 @@ MmReleaseMemoryAreaIfDecommitted(PEPROCESS Process,
|
||||||
|
|
||||||
MmVerifyMemoryAreas(AddressSpace);
|
MmVerifyMemoryAreas(AddressSpace);
|
||||||
|
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, BaseAddress);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
if (MemoryArea != NULL)
|
if (MemoryArea != NULL)
|
||||||
{
|
{
|
||||||
Entry = MemoryArea->Data.VirtualMemoryData.RegionListHead.Flink;
|
Entry = MemoryArea->Data.VirtualMemoryData.RegionListHead.Flink;
|
||||||
|
|
|
@ -409,7 +409,7 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
|
||||||
|
|
||||||
ASSERT(Mdl->Process == PsGetCurrentProcess());
|
ASSERT(Mdl->Process == PsGetCurrentProcess());
|
||||||
|
|
||||||
Marea = MmOpenMemoryAreaByAddress( &Mdl->Process->AddressSpace, BaseAddress );
|
Marea = MmLocateMemoryAreaByAddress( &Mdl->Process->AddressSpace, BaseAddress );
|
||||||
if (Marea == NULL)
|
if (Marea == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1( "Couldn't open memory area when unmapping user-space pages!\n" );
|
DPRINT1( "Couldn't open memory area when unmapping user-space pages!\n" );
|
||||||
|
|
|
@ -187,8 +187,8 @@ BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
|
||||||
VirtualAddress);
|
VirtualAddress);
|
||||||
|
|
||||||
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
||||||
{
|
{
|
||||||
|
@ -247,7 +247,7 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode,
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, (PVOID)Address);
|
||||||
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
||||||
{
|
{
|
||||||
if (!FromMdl)
|
if (!FromMdl)
|
||||||
|
@ -374,7 +374,7 @@ NTSTATUS MmNotPresentFault(KPROCESSOR_MODE Mode,
|
||||||
*/
|
*/
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, (PVOID)Address);
|
||||||
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
||||||
{
|
{
|
||||||
if (!FromMdl)
|
if (!FromMdl)
|
||||||
|
|
|
@ -117,7 +117,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page)
|
||||||
* freed or paged out after we read the rmap entry.)
|
* freed or paged out after we read the rmap entry.)
|
||||||
*/
|
*/
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, Address);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
|
||||||
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
||||||
{
|
{
|
||||||
MmUnlockAddressSpace(AddressSpace);
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
|
@ -242,7 +242,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page)
|
||||||
}
|
}
|
||||||
|
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, Address);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
|
||||||
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
|
||||||
{
|
{
|
||||||
MmUnlockAddressSpace(AddressSpace);
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
|
|
|
@ -1829,7 +1829,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
||||||
BOOL DoCOW = FALSE;
|
BOOL DoCOW = FALSE;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, BaseAddress);
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
Segment = MemoryArea->Data.SectionData.Segment;
|
Segment = MemoryArea->Data.SectionData.Segment;
|
||||||
|
|
||||||
if ((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) &&
|
if ((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) &&
|
||||||
|
@ -3688,8 +3688,8 @@ MmUnmapViewOfSegment(PMADDRESS_SPACE AddressSpace,
|
||||||
PMM_REGION CurrentRegion;
|
PMM_REGION CurrentRegion;
|
||||||
PLIST_ENTRY RegionListHead;
|
PLIST_ENTRY RegionListHead;
|
||||||
|
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (MemoryArea == NULL)
|
if (MemoryArea == NULL)
|
||||||
{
|
{
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
|
@ -3749,8 +3749,8 @@ MmUnmapViewOfSection(PEPROCESS Process,
|
||||||
ASSERT(Process);
|
ASSERT(Process);
|
||||||
|
|
||||||
AddressSpace = &Process->AddressSpace;
|
AddressSpace = &Process->AddressSpace;
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (MemoryArea == NULL ||
|
if (MemoryArea == NULL ||
|
||||||
MemoryArea->Type != MEMORY_AREA_SECTION_VIEW ||
|
MemoryArea->Type != MEMORY_AREA_SECTION_VIEW ||
|
||||||
MemoryArea->DeleteInProgress)
|
MemoryArea->DeleteInProgress)
|
||||||
|
@ -4209,8 +4209,8 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check there is enough space to map the section at that point. */
|
/* Check there is enough space to map the section at that point. */
|
||||||
if (MmOpenMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
|
if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
|
||||||
PAGE_ROUND_UP(ImageSize)) != NULL)
|
PAGE_ROUND_UP(ImageSize)) != NULL)
|
||||||
{
|
{
|
||||||
/* Fail if the user requested a fixed base address. */
|
/* Fail if the user requested a fixed base address. */
|
||||||
if ((*BaseAddress) != NULL)
|
if ((*BaseAddress) != NULL)
|
||||||
|
|
|
@ -160,8 +160,7 @@ MiQueryVirtualMemory (IN HANDLE ProcessHandle,
|
||||||
AddressSpace = MmGetKernelAddressSpace();
|
AddressSpace = MmGetKernelAddressSpace();
|
||||||
}
|
}
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
|
||||||
Address);
|
|
||||||
switch(VirtualMemoryInformationClass)
|
switch(VirtualMemoryInformationClass)
|
||||||
{
|
{
|
||||||
case MemoryBasicInformation:
|
case MemoryBasicInformation:
|
||||||
|
@ -405,8 +404,7 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
AddressSpace = &Process->AddressSpace;
|
AddressSpace = &Process->AddressSpace;
|
||||||
|
|
||||||
MmLockAddressSpace(AddressSpace);
|
MmLockAddressSpace(AddressSpace);
|
||||||
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
|
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
|
||||||
BaseAddress);
|
|
||||||
if (MemoryArea == NULL)
|
if (MemoryArea == NULL)
|
||||||
{
|
{
|
||||||
MmUnlockAddressSpace(AddressSpace);
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue