switch (MemoryArea->Type)
{
- case MEMORY_AREA_SYSTEM:
- Status = STATUS_ACCESS_VIOLATION;
- break;
-
case MEMORY_AREA_PAGED_POOL:
Status = STATUS_SUCCESS;
break;
Status = STATUS_ACCESS_VIOLATION;
break;
- case MEMORY_AREA_SHARED_DATA:
- Status = STATUS_ACCESS_VIOLATION;
- break;
-
default:
Status = STATUS_ACCESS_VIOLATION;
break;
MEMORY_AREA* MemoryArea;
NTSTATUS Status;
BOOLEAN Locked = FromMdl;
- extern PMMPTE MmSharedUserDataPte;
DPRINT("MmNotPresentFault(Mode %d, Address %x)\n", Mode, Address);
break;
}
- case MEMORY_AREA_SYSTEM:
- Status = STATUS_ACCESS_VIOLATION;
- break;
-
case MEMORY_AREA_SECTION_VIEW:
Status = MmNotPresentFaultSectionView(AddressSpace,
MemoryArea,
break;
case MEMORY_AREA_VIRTUAL_MEMORY:
- case MEMORY_AREA_PEB_OR_TEB:
Status = MmNotPresentFaultVirtualMemory(AddressSpace,
MemoryArea,
(PVOID)Address,
Locked);
break;
- case MEMORY_AREA_SHARED_DATA:
- *MiAddressToPte(USER_SHARED_DATA) = *MmSharedUserDataPte;
- Status = STATUS_SUCCESS;
- break;
-
default:
Status = STATUS_ACCESS_VIOLATION;
break;
#endif
}
- //
- // Check if this is an ARM3 memory area
- //
+ /*
+ * Check if this is an ARM3 memory area or if there's no memory area at all.
+ * The latter can happen early in the boot cycle when ARM3 paged pool is in
+ * use before having defined the memory areas proper.
+ * A proper fix would be to define memory areas in the ARM3 code, but we want
+ * to avoid adding this ReactOS-specific construct to ARM3 code.
+ * Either way, in the future, as ReactOS-paged pool is eliminated, this hack
+ * can go away.
+ */
MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address);
- if ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3))
+ if (!(MemoryArea) && (Address <= MM_HIGHEST_USER_ADDRESS))
+ {
+ /* Could this be a VAD fault from user-mode? */
+ MemoryArea = MmLocateMemoryAreaByAddress(MmGetCurrentAddressSpace(), Address);
+ }
+ if ((!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmPagedPoolStart)) ||
+ ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)))
{
//
// Hand it off to more competent hands...
//
+ DPRINT("ARM3 fault %p\n", MemoryArea);
return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation);
- }
+ }
/* Keep same old ReactOS Behaviour */
if (StoreInstruction)
MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
{
NTSTATUS Status;
- PFN_TYPE AllocatedPage;
+ PFN_NUMBER AllocatedPage;
Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage);
if (!NT_SUCCESS(Status))