[NTOS/MM] Set filler0 to 1 after initializing the section flags
authorJérôme Gardou <zefklop@users.noreply.github.com>
Thu, 15 Nov 2018 15:17:43 +0000 (16:17 +0100)
committerJérôme Gardou <jerome.gardou@reactos.org>
Tue, 1 Jan 2019 21:08:14 +0000 (22:08 +0100)
ntoskrnl/mm/section.c

index 3094192..d3ffb4a 100644 (file)
@@ -2883,10 +2883,12 @@ MmCreatePageFileSection(PSECTION *SectionObject,
      * Initialize it
      */
     RtlZeroMemory(Section, sizeof(*Section));
-    /* Mark it as a "ROS" Section */
-    Section->u.Flags.filler0 = 1;
     Section->InitialPageProtection = SectionPageProtection;
     Section->u.LongFlags = MiSectionFlagsFromAllocationAttributes(AllocationAttributes);
+
+    /* Mark it as a "ROS" Section */
+    Section->u.Flags.filler0 = 1;
+
     Section->SizeOfSection = MaximumSize;
     Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT),
                                     TAG_MM_SECTION_SEGMENT);
@@ -2953,12 +2955,13 @@ MmCreateDataFileSection(PSECTION *SectionObject,
      * Initialize it
      */
     RtlZeroMemory(Section, sizeof(*Section));
-    /* Mark it as a ROS Section */
-    Section->u.Flags.filler0 = 1;
 
     Section->InitialPageProtection = SectionPageProtection;
     Section->u.LongFlags = MiSectionFlagsFromAllocationAttributes(AllocationAttributes);
 
+    /* Mark it as a ROS Section */
+    Section->u.Flags.filler0 = 1;
+
     /*
      * FIXME: This is propably not entirely correct. We can't look into
      * the standard FCB header because it might not be initialized yet
@@ -3776,14 +3779,14 @@ MmCreateImageSection(PSECTION *SectionObject,
      * Initialize it
      */
     RtlZeroMemory(Section, sizeof(*Section));
-    /* Mark it as a "ROS" section */
-    Section->u.Flags.filler0 = 1;
-
     Section->InitialPageProtection = SectionPageProtection;
 
     /* Initialize flags */
     Section->u.LongFlags = MiSectionFlagsFromAllocationAttributes(AllocationAttributes);
 
+    /* Mark it as a "ROS" section */
+    Section->u.Flags.filler0 = 1;
+
     if (FileObject->SectionObjectPointer->ImageSectionObject == NULL)
     {
         NTSTATUS StatusExeFmt;