https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c7eb46d9fdda30a3b286e…
commit c7eb46d9fdda30a3b286e244eba023d95f0a4a9b
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Thu Apr 19 21:58:09 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Jun 3 20:40:51 2018 +0200
[NTOSKRNL] Ignore IMAGE_SCN_CNT_UNINITIALIZED_DATA
CORE-12582
CORE-14556
---
ntoskrnl/mm/section.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index e79ff5f07b..9bf9f3cd50 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -684,7 +684,7 @@ l_ReadHeaderFromFile:
pssSegments[0].Length.QuadPart = nPrevVirtualEndOfSegment;
pssSegments[0].RawLength.QuadPart = nFileSizeOfHeaders;
pssSegments[0].Image.VirtualAddress = 0;
- pssSegments[0].Image.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA;
+ pssSegments[0].Image.Characteristics = 0;
pssSegments[0].WriteCopy = TRUE;
/* skip the headers segment */
@@ -1365,7 +1365,7 @@ MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace,
HasSwapEntry = MmIsPageSwapEntry(Process, Address);
/* See if we should use a private page */
- if ((HasSwapEntry) || (Segment->Image.Characteristics &
IMAGE_SCN_CNT_UNINITIALIZED_DATA))
+ if (HasSwapEntry)
{
SWAPENTRY DummyEntry;
@@ -1956,9 +1956,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
*/
MmUnlockSectionSegment(Context.Segment);
Context.WasDirty = FALSE;
- if (Context.Segment->Image.Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA
||
- IS_SWAP_FROM_SSE(Entry) ||
- PFN_FROM_SSE(Entry) != Page)
+ if (IS_SWAP_FROM_SSE(Entry) || PFN_FROM_SSE(Entry) != Page)
{
Context.Private = TRUE;
}
@@ -2346,9 +2344,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace,
/*
* Check for a private (COWed) page.
*/
- if (Segment->Image.Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA ||
- IS_SWAP_FROM_SSE(Entry) ||
- PFN_FROM_SSE(Entry) != Page)
+ if (IS_SWAP_FROM_SSE(Entry) || PFN_FROM_SSE(Entry) != Page)
{
Private = TRUE;
}
@@ -2481,9 +2477,7 @@ MmAlterViewAttributes(PMMSUPPORT AddressSpace,
Page = MmGetPfnForProcess(Process, Address);
Protect = PAGE_READONLY;
- if (Segment->Image.Characteristics &
IMAGE_SCN_CNT_UNINITIALIZED_DATA ||
- IS_SWAP_FROM_SSE(Entry) ||
- PFN_FROM_SSE(Entry) != Page)
+ if (IS_SWAP_FROM_SSE(Entry) || PFN_FROM_SSE(Entry) != Page)
{
Protect = NewProtect;
}