Sync to trunk head (r42241)
[reactos.git] / reactos / ntoskrnl / include / internal / mm.h
index ada4602..eaea19e 100644 (file)
@@ -61,8 +61,6 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE;
 /* 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
@@ -834,7 +832,7 @@ MmQueryAnonMem(
     PMEMORY_AREA MemoryArea,
     PVOID Address,
     PMEMORY_BASIC_INFORMATION Info,
-    PULONG ResultLength
+    PSIZE_T ResultLength
 );
 
 VOID
@@ -1047,9 +1045,13 @@ PMMPFN
 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];
@@ -1186,8 +1188,8 @@ MmCreateHyperspaceMapping(IN PFN_NUMBER Page)
     return MiMapPageInHyperSpace(HyperProcess, Page, &HyperIrql);
 }
 
-PVOID
 FORCEINLINE
+PVOID
 MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page)
 {
     PMMPFN Pfn1 = MiGetPfnEntry(Page);
@@ -1393,14 +1395,14 @@ NTAPI
 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
 );
 
 
@@ -1535,7 +1537,7 @@ MmQuerySectionView(
     PMEMORY_AREA MemoryArea,
     PVOID Address,
     PMEMORY_BASIC_INFORMATION Info,
-    PULONG ResultLength
+    PSIZE_T ResultLength
 );
 
 NTSTATUS
@@ -1628,8 +1630,8 @@ MiQueryVirtualMemory(
     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 ******************************************************************/