Author: dgorbachev
Date: Sat Mar 14 21:13:32 2009
New Revision: 40014
URL:
http://svn.reactos.org/svn/reactos?rev=40014&view=rev
Log:
Trying to fix boot breakage.
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/kmap.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Sat Mar 14 21:13:32 2009
@@ -942,6 +942,21 @@
return NumberOfPagesFound;
}
+static
+NTSTATUS
+MiZeroPageInternal(PFN_TYPE Page)
+{
+ PVOID TempAddress;
+
+ TempAddress = MiMapPageToZeroInHyperSpace(Page);
+ if (TempAddress == NULL)
+ {
+ return(STATUS_NO_MEMORY);
+ }
+ memset(TempAddress, 0, PAGE_SIZE);
+ return(STATUS_SUCCESS);
+}
+
NTSTATUS
NTAPI
MmZeroPageThreadMain(PVOID Ignored)
@@ -989,7 +1004,7 @@
PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_USED;
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
Pfn = PageDescriptor - MmPageArray;
- Status = MiZeroPage(Pfn);
+ Status = MiZeroPageInternal(Pfn);
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
if (PageDescriptor->MapCount != 0)
Modified: trunk/reactos/ntoskrnl/mm/kmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/kmap.c?rev=400…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/kmap.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/kmap.c [iso-8859-1] Sat Mar 14 21:13:32 2009
@@ -16,18 +16,23 @@
/* GLOBALS *****************************************************************/
/* FUNCTIONS ***************************************************************/
+
NTSTATUS
NTAPI
MiZeroPage(PFN_TYPE Page)
{
+ PEPROCESS Process;
+ KIRQL Irql;
PVOID TempAddress;
- TempAddress = MiMapPageToZeroInHyperSpace(Page);
+ Process = (PEPROCESS)KeGetCurrentThread()->ApcState.Process;
+ TempAddress = MiMapPageInHyperSpace(Process, Page, &Irql);
if (TempAddress == NULL)
{
return(STATUS_NO_MEMORY);
}
memset(TempAddress, 0, PAGE_SIZE);
+ MiUnmapPageInHyperSpace(Process, TempAddress, Irql);
return(STATUS_SUCCESS);
}