Author: tfaber
Date: Tue Aug 11 08:21:36 2015
New Revision: 68677
URL: http://svn.reactos.org/svn/reactos?rev=68677&view=rev
Log:
[NTOS:MM]
- When paging in data for an image section, first flush outstanding cached data since paging reads are noncached. Fixes failure to create section in ntdll_apitest:NtMapViewOfSection/Test_NoLoadSection
- Gracefully handle out-of-pool situation
CORE-8384
Modified:
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Tue Aug 11 08:21:36 2015
@@ -3236,6 +3236,12 @@
BufferSize = Length + OffsetAdjustment;
BufferSize = PAGE_ROUND_UP(BufferSize);
+ /* Flush data since we're about to perform a non-cached read */
+ CcFlushCache(FileObject->SectionObjectPointer,
+ &FileOffset,
+ BufferSize,
+ &Iosb);
+
/*
* It's ok to use paged pool, because this is a temporary buffer only used in
* the loading of executables. The assumption is that MmCreateSection is
@@ -3247,7 +3253,7 @@
'rXmM');
if (!Buffer)
{
- KeBugCheck(MEMORY_MANAGEMENT);
+ return STATUS_INSUFFICIENT_RESOURCES;
}
UsedSize = 0;