typedef ULONG SWAPENTRY;
typedef ULONG PFN_TYPE, *PPFN_TYPE;
+#define MI_STATIC_MEMORY_AREAS (8)
+
#define MEMORY_AREA_INVALID (0)
#define MEMORY_AREA_SECTION_VIEW (1)
#define MEMORY_AREA_CONTINUOUS_MEMORY (2)
#define MEMORY_AREA_PAGED_POOL (12)
#define MEMORY_AREA_NO_ACCESS (13)
#define MEMORY_AREA_PEB_OR_TEB (14)
+#define MEMORY_AREA_STATIC (0x80000000)
#define MM_PHYSICAL_PAGE_MPW_PENDING (0x8)
/* Number of list heads to use */
#define MI_FREE_POOL_LISTS 4
-#define HYPER_SPACE (0xC0400000)
-
#define MI_HYPERSPACE_PTES (256 - 1)
+#define MI_ZERO_PTES (32)
#define MI_MAPPING_RANGE_START (ULONG)HYPER_SPACE
#define MI_MAPPING_RANGE_END (MI_MAPPING_RANGE_START + \
MI_HYPERSPACE_PTES * PAGE_SIZE)
#define MC_USER (1)
#define MC_PPOOL (2)
#define MC_NPPOOL (3)
-#define MC_MAXIMUM (4)
+#define MC_SYSTEM (4)
+#define MC_MAXIMUM (5)
#define PAGED_POOL_MASK 1
#define MUST_SUCCEED_POOL_MASK 2
ULONG PagingRequestsInLastFifteenMinutes;
} MM_STATS;
+//
+// These two mappings are actually used by Windows itself, based on the ASSERTS
+//
+#define StartOfAllocation ReadInProgress
+#define EndOfAllocation WriteInProgress
+
typedef struct _MMPFNENTRY
{
USHORT Modified:1;
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
- PULONG ResultLength
+ PSIZE_T ResultLength
);
VOID
MiGetPfnEntry(IN PFN_TYPE Pfn)
{
PMMPFN Page;
+ extern RTL_BITMAP MiPfnBitMap;
/* Make sure the PFN number is valid */
if (Pfn > MmHighestPhysicalPage) return NULL;
+
+ /* Make sure this page actually has a PFN entry */
+ if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, Pfn))) return NULL;
/* Get the entry */
Page = &MmPfnDatabase[Pfn];
VOID
);
+VOID
+NTAPI
+MmDumpPfnDatabase(
+ VOID
+);
+
PFN_TYPE
NTAPI
MmGetContinuousPages(
ULONG NumberOfBytes,
PHYSICAL_ADDRESS LowestAcceptableAddress,
PHYSICAL_ADDRESS HighestAcceptableAddress,
- PHYSICAL_ADDRESS BoundaryAddressMultiple
+ PHYSICAL_ADDRESS BoundaryAddressMultiple,
+ BOOLEAN ZeroPages
);
NTSTATUS
PVOID
NTAPI
-MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page);
+MiMapPagesToZeroInHyperSpace(IN PMMPFN *Pages,
+ IN PFN_NUMBER NumberOfPages);
+
+VOID
+NTAPI
+MiUnmapPagesInZeroSpace(IN PVOID VirtualAddress,
+ IN PFN_NUMBER NumberOfPages);
//
// ReactOS Compatibility Layer
//
-PVOID
FORCEINLINE
+PVOID
MmCreateHyperspaceMapping(IN PFN_NUMBER Page)
{
HyperProcess = (PEPROCESS)KeGetCurrentThread()->ApcState.Process;
return MiMapPageInHyperSpace(HyperProcess, Page, &HyperIrql);
}
+FORCEINLINE
+PVOID
+MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page)
+{
+ PMMPFN Pfn1 = MiGetPfnEntry(Page);
+ return MiMapPagesToZeroInHyperSpace(&Pfn1, 1);
+}
+
#define MmDeleteHyperspaceMapping(x) MiUnmapPageInHyperSpace(HyperProcess, x, HyperIrql);
/* i386/page.c *********************************************************/
MmCreateProcessAddressSpace(
IN ULONG MinWs,
IN PEPROCESS Dest,
- IN PULONG DirectoryTableBase
+ IN PULONG_PTR DirectoryTableBase
);
NTSTATUS
NTAPI
MmInitializeHandBuiltProcess(
IN PEPROCESS Process,
- IN PULONG DirectoryTableBase
+ IN PULONG_PTR DirectoryTableBase
);
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
- PULONG ResultLength
+ PSIZE_T ResultLength
);
NTSTATUS
IN PVOID Address,
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
- IN ULONG Length,
- OUT PULONG ResultLength
+ IN SIZE_T Length,
+ OUT PSIZE_T ResultLength
);
/* sysldr.c ******************************************************************/