/* INCLUDES *******************************************************************/
#include <ntoskrnl.h>
-#ifdef NEWCC
#include "../cache/section/newmm.h"
-#endif
#define NDEBUG
#include <debug.h>
PMMSUPPORT AddressSpace;
MEMORY_AREA* MemoryArea;
NTSTATUS Status;
- BOOLEAN Locked = FromMdl;
DPRINT("MmAccessFault(Mode %d, Address %x)\n", Mode, Address);
if (KeGetCurrentIrql() >= DISPATCH_LEVEL)
{
- DPRINT1("Page fault at high IRQL was %d\n", KeGetCurrentIrql());
+ DPRINT1("Page fault at high IRQL was %u\n", KeGetCurrentIrql());
return(STATUS_UNSUCCESSFUL);
}
case MEMORY_AREA_SECTION_VIEW:
Status = MmAccessFaultSectionView(AddressSpace,
MemoryArea,
- (PVOID)Address,
- Locked);
+ (PVOID)Address);
break;
- case MEMORY_AREA_VIRTUAL_MEMORY:
- Status = STATUS_ACCESS_VIOLATION;
+ case MEMORY_AREA_CACHE:
+ // This code locks for itself to keep from having to break a lock
+ // passed in.
+ if (!FromMdl)
+ MmUnlockAddressSpace(AddressSpace);
+ Status = MmAccessFaultCacheSection(Mode, Address, FromMdl);
+ if (!FromMdl)
+ MmLockAddressSpace(AddressSpace);
break;
-#ifdef NEWCC
- case MEMORY_AREA_CACHE:
- // This code locks for itself to keep from having to break a lock
- // passed in.
- if (!FromMdl)
- MmUnlockAddressSpace(AddressSpace);
- Status = MmAccessFaultCacheSection(Mode, Address, Locked);
- if (!FromMdl)
- MmLockAddressSpace(AddressSpace);
- break;
-#endif
-
default:
Status = STATUS_ACCESS_VIOLATION;
break;
PMMSUPPORT AddressSpace;
MEMORY_AREA* MemoryArea;
NTSTATUS Status;
- BOOLEAN Locked = FromMdl;
DPRINT("MmNotPresentFault(Mode %d, Address %x)\n", Mode, Address);
if (KeGetCurrentIrql() >= DISPATCH_LEVEL)
{
- DPRINT1("Page fault at high IRQL was %d, address %x\n", KeGetCurrentIrql(), Address);
+ DPRINT1("Page fault at high IRQL was %u, address %x\n", KeGetCurrentIrql(), Address);
return(STATUS_UNSUCCESSFUL);
}
*/
if (Mode != KernelMode)
{
- DPRINT1("Address: %x\n", Address);
+ DPRINT1("Address: %x\n", Address);
return(STATUS_ACCESS_VIOLATION);
}
AddressSpace = MmGetKernelAddressSpace();
Status = MmNotPresentFaultSectionView(AddressSpace,
MemoryArea,
(PVOID)Address,
- Locked);
+ FromMdl);
break;
- case MEMORY_AREA_VIRTUAL_MEMORY:
- Status = MmNotPresentFaultVirtualMemory(AddressSpace,
- MemoryArea,
- (PVOID)Address,
- Locked);
+ case MEMORY_AREA_CACHE:
+ // This code locks for itself to keep from having to break a lock
+ // passed in.
+ if (!FromMdl)
+ MmUnlockAddressSpace(AddressSpace);
+ Status = MmNotPresentFaultCacheSection(Mode, Address, FromMdl);
+ if (!FromMdl)
+ MmLockAddressSpace(AddressSpace);
break;
-#ifdef NEWCC
- case MEMORY_AREA_CACHE:
- // This code locks for itself to keep from having to break a lock
- // passed in.
- if (!FromMdl)
- MmUnlockAddressSpace(AddressSpace);
- Status = MmNotPresentFaultCacheSection(Mode, Address, Locked);
- if (!FromMdl)
- MmLockAddressSpace(AddressSpace);
- break;
-#endif
-
default:
Status = STATUS_ACCESS_VIOLATION;
break;
}
#endif
}
-
+
/* Is there a ReactOS address space yet? */
if (MmGetKernelAddressSpace())
{
MemoryArea = MmLocateMemoryAreaByAddress(MmGetCurrentAddressSpace(), Address);
}
}
-
+
/* Is this an ARM3 memory area, or is there no address space yet? */
if (((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)) ||
(!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmPagedPoolStart)) ||