[NTOS]: When expanding paged pool, use MiRemoveAnyPage, not MmAllocPage.
[reactos.git] / reactos / ntoskrnl / mm / ARM3 / pool.c
index 28cbe2e..c4a7374 100644 (file)
@@ -325,20 +325,23 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
                 //
                 ASSERT(PointerPte->u.Hard.Valid == 0);
                 
-                //
-                // Request a paged pool page and write the PFN for it
-                //
-                PageFrameNumber = MmAllocPage(MC_PPOOL);
+                /* Request a page */
+                PageFrameNumber = MiRemoveAnyPage(0);
                 TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
                 
                 //
                 // Save it into our double-buffered system page directory
                 //
                 /* This seems to be making the assumption that one PDE is one page long */
-                ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT)));
+                C_ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT)));
                 MmSystemPagePtes[(ULONG_PTR)PointerPte & (PAGE_SIZE - 1) /
                                  sizeof(MMPTE)] = TempPte;
                             
+                /* Initialize the PFN */
+                MiInitializePfnForOtherProcess(PageFrameNumber,
+                                               PointerPte,
+                                               MmSystemPageDirectory[(PointerPte - (PMMPTE)PDE_BASE) / PDE_COUNT]);
+                             
                 /* Write the actual PTE now */
                 ASSERT(TempPte.u.Hard.Valid == 1);
                 *PointerPte++ = TempPte;