Index: section.c =================================================================== --- ntoskrnl/mm/ARM3/section.c (revision 72853) +++ ntoskrnl/mm/ARM3/section.c (working copy) @@ -1956,7 +1956,7 @@ IN PMMPTE PointerPte, IN ULONG ProtectionMask, IN PMMPFN Pfn1, - IN BOOLEAN CaptureDirtyBit) + IN BOOLEAN CheckForDirty) { MMPTE TempPte, PreviousPte; KIRQL OldIrql; @@ -2030,9 +2030,24 @@ ASSERT(PreviousPte.u.Hard.Valid == 1); // - // Windows updates the relevant PFN1 information, we currently don't. + // Mark the page as modified if dirty, and release page file space if appropriate // - if (CaptureDirtyBit) DPRINT1("Warning, not handling dirty bit\n"); + if (CheckForDirty) + { + ASSERT(Pfn1 != NULL); + ASSERT(KeGetCurrentIrql() > APC_LEVEL); + if (!Pfn1->u3.e1.Modified && PreviousPte.u.Hard.Dirty) + { + ASSERT(Pfn1->u3.e1.Rom == 0); + Pfn1->u3.e1.Modified = 1; + if (!Pfn1->OriginalPte.u.Soft.Prototype && + !Pfn1->u3.e1.WriteInProgress) + { + DPRINT1("Should call MiReleasePageFileSpace(Pfn1->OriginalPte)\n"); + Pfn1->OriginalPte.u.Soft.PageFileHigh = 0; + } + } + } // // Not supported in ARM3