Rename MmOpenMemoryAreaBy[Address/Region] to MmLocateMemoryAreaBy[Address/Region].

svn path=/trunk/; revision=12731
This commit is contained in:
Filip Navara 2005-01-02 19:14:52 +00:00
parent 7581cc7fb9
commit e6f2a2f607
9 changed files with 40 additions and 44 deletions

View file

@ -377,11 +377,11 @@ MmCreateMemoryArea(
PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL);
PMEMORY_AREA STDCALL
MmOpenMemoryAreaByAddress(
MmLocateMemoryAreaByAddress(
PMADDRESS_SPACE AddressSpace,
PVOID Address);
ULONG STDCALL
ULONG_PTR STDCALL
MmFindGapAtAddress(
PMADDRESS_SPACE AddressSpace,
PVOID Address);
@ -404,7 +404,7 @@ VOID STDCALL
MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace);
PMEMORY_AREA STDCALL
MmOpenMemoryAreaByRegion(
MmLocateMemoryAreaByRegion(
PMADDRESS_SPACE AddressSpace,
PVOID Address,
ULONG_PTR Length);

View file

@ -580,8 +580,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
if (PBaseAddress != 0)
{
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (MemoryArea != NULL)
{
@ -813,8 +812,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
AddressSpace = &Process->AddressSpace;
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (MemoryArea == NULL)
{
MmUnlockAddressSpace(AddressSpace);

View file

@ -50,7 +50,7 @@ PVOID
MmLockPagableCodeSection(IN PVOID AddressWithinSection)
{
PVOID Handle;
Handle = MmOpenMemoryAreaByAddress(NULL,AddressWithinSection);
Handle = MmLocateMemoryAreaByAddress(NULL,AddressWithinSection);
MmLockPagableSectionByHandle(Handle);
return(Handle);
}
@ -64,7 +64,7 @@ PVOID STDCALL
MmLockPagableDataSection(IN PVOID AddressWithinSection)
{
PVOID Handle;
Handle = MmOpenMemoryAreaByAddress(NULL, AddressWithinSection);
Handle = MmLocateMemoryAreaByAddress(NULL, AddressWithinSection);
MmLockPagableSectionByHandle(Handle);
return(Handle);
}

View file

@ -197,13 +197,13 @@ MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace)
}
PMEMORY_AREA STDCALL
MmOpenMemoryAreaByAddress(
MmLocateMemoryAreaByAddress(
PMADDRESS_SPACE AddressSpace,
PVOID Address)
{
PMEMORY_AREA Node = AddressSpace->MemoryAreaRoot;
DPRINT("MmOpenMemoryAreaByAddress(AddressSpace %x, Address %x)\n",
DPRINT("MmLocateMemoryAreaByAddress(AddressSpace %x, Address %x)\n",
AddressSpace, Address);
if (!(KdDebugState & KD_DEBUG_SCREEN))
@ -217,18 +217,18 @@ MmOpenMemoryAreaByAddress(
Node = Node->RightChild;
else
{
DPRINT("MmOpenMemoryAreaByAddress(%x): %x [%x - %x]\n",
DPRINT("MmLocateMemoryAreaByAddress(%x): %x [%x - %x]\n",
Address, Node, Node->StartingAddress, Node->EndingAddress);
return Node;
}
}
DPRINT("MmOpenMemoryAreaByAddress(%x): 0\n", Address);
DPRINT("MmLocateMemoryAreaByAddress(%x): 0\n", Address);
return NULL;
}
PMEMORY_AREA STDCALL
MmOpenMemoryAreaByRegion(
MmLocateMemoryAreaByRegion(
PMADDRESS_SPACE AddressSpace,
PVOID Address,
ULONG_PTR Length)
@ -250,7 +250,7 @@ MmOpenMemoryAreaByRegion(
if (Node->StartingAddress >= Address &&
Node->StartingAddress < Extent)
{
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
Address, Address + Length, Node->StartingAddress,
Node->EndingAddress);
return Node;
@ -258,7 +258,7 @@ MmOpenMemoryAreaByRegion(
if (Node->EndingAddress > Address &&
Node->EndingAddress < Extent)
{
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
Address, Address + Length, Node->StartingAddress,
Node->EndingAddress);
return Node;
@ -266,14 +266,14 @@ MmOpenMemoryAreaByRegion(
if (Node->StartingAddress <= Address &&
Node->EndingAddress >= Extent)
{
DPRINT("MmOpenMemoryAreaByRegion(%x - %x): %x - %x\n",
DPRINT("MmLocateMemoryAreaByRegion(%x - %x): %x - %x\n",
Address, Address + Length, Node->StartingAddress,
Node->EndingAddress);
return Node;
}
if (Node->StartingAddress >= Extent)
{
DPRINT("Finished MmOpenMemoryAreaByRegion() = NULL\n");
DPRINT("Finished MmLocateMemoryAreaByRegion() = NULL\n");
return NULL;
}
}
@ -866,14 +866,14 @@ MmFreeMemoryAreaByPtr(
{
PMEMORY_AREA MemoryArea;
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x,"
"FreePageContext %d)\n",AddressSpace,BaseAddress,Length,
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, "
"FreePageContext %d)\n", AddressSpace, BaseAddress,
FreePageContext);
MmVerifyMemoryAreas(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
BaseAddress);
if (MemoryArea == NULL)
{
KEBUGCHECK(0);
@ -974,9 +974,9 @@ MmCreateMemoryArea(PEPROCESS Process,
ASSERT(((ULONG_PTR)*BaseAddress/BoundaryAddressMultiple.QuadPart) == ((DWORD_PTR)EndAddress/BoundaryAddressMultiple.QuadPart));
}
if (MmOpenMemoryAreaByRegion(AddressSpace,
*BaseAddress,
tmpLength)!=NULL)
if (MmLocateMemoryAreaByRegion(AddressSpace,
*BaseAddress,
tmpLength) != NULL)
{
DPRINT("Memory area already occupied\n");
return STATUS_CONFLICTING_ADDRESSES;
@ -1016,7 +1016,7 @@ MmReleaseMemoryAreaIfDecommitted(PEPROCESS Process,
MmVerifyMemoryAreas(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (MemoryArea != NULL)
{
Entry = MemoryArea->Data.VirtualMemoryData.RegionListHead.Flink;

View file

@ -409,7 +409,7 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
ASSERT(Mdl->Process == PsGetCurrentProcess());
Marea = MmOpenMemoryAreaByAddress( &Mdl->Process->AddressSpace, BaseAddress );
Marea = MmLocateMemoryAreaByAddress( &Mdl->Process->AddressSpace, BaseAddress );
if (Marea == NULL)
{
DPRINT1( "Couldn't open memory area when unmapping user-space pages!\n" );

View file

@ -187,8 +187,8 @@ BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress)
}
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
VirtualAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
VirtualAddress);
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{
@ -247,7 +247,7 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode,
}
do
{
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, (PVOID)Address);
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{
if (!FromMdl)
@ -374,7 +374,7 @@ NTSTATUS MmNotPresentFault(KPROCESSOR_MODE Mode,
*/
do
{
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, (PVOID)Address);
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{
if (!FromMdl)

View file

@ -117,7 +117,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page)
* freed or paged out after we read the rmap entry.)
*/
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, Address);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{
MmUnlockAddressSpace(AddressSpace);
@ -242,7 +242,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page)
}
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, Address);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{
MmUnlockAddressSpace(AddressSpace);

View file

@ -1829,7 +1829,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
BOOL DoCOW = FALSE;
ULONG i;
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
Segment = MemoryArea->Data.SectionData.Segment;
if ((Segment->WriteCopy || MemoryArea->Data.SectionData.WriteCopyView) &&
@ -3688,8 +3688,8 @@ MmUnmapViewOfSegment(PMADDRESS_SPACE AddressSpace,
PMM_REGION CurrentRegion;
PLIST_ENTRY RegionListHead;
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
BaseAddress);
if (MemoryArea == NULL)
{
return(STATUS_UNSUCCESSFUL);
@ -3749,8 +3749,8 @@ MmUnmapViewOfSection(PEPROCESS Process,
ASSERT(Process);
AddressSpace = &Process->AddressSpace;
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
BaseAddress);
if (MemoryArea == NULL ||
MemoryArea->Type != MEMORY_AREA_SECTION_VIEW ||
MemoryArea->DeleteInProgress)
@ -4209,8 +4209,8 @@ MmMapViewOfSection(IN PVOID SectionObject,
}
/* Check there is enough space to map the section at that point. */
if (MmOpenMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
PAGE_ROUND_UP(ImageSize)) != NULL)
if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
PAGE_ROUND_UP(ImageSize)) != NULL)
{
/* Fail if the user requested a fixed base address. */
if ((*BaseAddress) != NULL)

View file

@ -160,8 +160,7 @@ MiQueryVirtualMemory (IN HANDLE ProcessHandle,
AddressSpace = MmGetKernelAddressSpace();
}
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
Address);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
switch(VirtualMemoryInformationClass)
{
case MemoryBasicInformation:
@ -405,8 +404,7 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle,
AddressSpace = &Process->AddressSpace;
MmLockAddressSpace(AddressSpace);
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace,
BaseAddress);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (MemoryArea == NULL)
{
MmUnlockAddressSpace(AddressSpace);