mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52:57 +00:00
[NTOS:MM] Remove one more instance of MmLocateMemoryAreaByAddress
This commit is contained in:
parent
0e58b59794
commit
2e85425c53
1 changed files with 5 additions and 8 deletions
|
@ -1675,7 +1675,6 @@ MiQueryMemoryBasicInformation(IN HANDLE ProcessHandle,
|
||||||
MEMORY_BASIC_INFORMATION MemoryInfo;
|
MEMORY_BASIC_INFORMATION MemoryInfo;
|
||||||
KAPC_STATE ApcState;
|
KAPC_STATE ApcState;
|
||||||
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||||
PMEMORY_AREA MemoryArea;
|
|
||||||
SIZE_T ResultLength;
|
SIZE_T ResultLength;
|
||||||
|
|
||||||
/* Check for illegal addresses in user-space, or the shared memory area */
|
/* Check for illegal addresses in user-space, or the shared memory area */
|
||||||
|
@ -1901,17 +1900,15 @@ MiQueryMemoryBasicInformation(IN HANDLE ProcessHandle,
|
||||||
MemoryInfo.Type = MEM_MAPPED;
|
MemoryInfo.Type = MEM_MAPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the memory area the specified address belongs to */
|
/* Check if this is a RosMM VAD */
|
||||||
MemoryArea = MmLocateMemoryAreaByAddress(&TargetProcess->Vm, BaseAddress);
|
if (MI_IS_ROSMM_VAD(Vad))
|
||||||
|
|
||||||
/* Determine information dependent on the memory area type */
|
|
||||||
if (MemoryArea && MemoryArea->Type == MEMORY_AREA_SECTION_VIEW)
|
|
||||||
{
|
{
|
||||||
Status = MmQuerySectionView(MemoryArea, BaseAddress, &MemoryInfo, &ResultLength);
|
ASSERT(((PMEMORY_AREA)Vad)->Type == MEMORY_AREA_SECTION_VIEW);
|
||||||
|
Status = MmQuerySectionView((PMEMORY_AREA)Vad, BaseAddress, &MemoryInfo, &ResultLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MmQuerySectionView failed. MemoryArea=%p (%p-%p), BaseAddress=%p\n",
|
DPRINT1("MmQuerySectionView failed. MemoryArea=%p (%p-%p), BaseAddress=%p\n",
|
||||||
MemoryArea, MA_GetStartingAddress(MemoryArea), MA_GetEndingAddress(MemoryArea), BaseAddress);
|
Vad, Vad->StartingVpn, Vad->EndingVpn, BaseAddress);
|
||||||
ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue