Skip to content

Commit

Permalink
[NTOS:CC] Use MmMakeSegmentDirty
Browse files Browse the repository at this point in the history
  • Loading branch information
TAN-Gaming committed Nov 21, 2024
1 parent 3c23711 commit 2f4683f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions ntoskrnl/cc/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,9 @@ CcCopyWrite (
CurrentOffset += VacbLength;

/* Tell Mm */
Status = MmMakePagesDirty(NULL, Add2Ptr(Vacb->BaseAddress, VacbOffset), VacbLength);
Status = MmMakeSegmentDirty(FileObject->SectionObjectPointer,
Vacb->FileOffset.QuadPart + VacbOffset,
VacbLength);
if (!NT_SUCCESS(Status))
ExRaiseStatus(Status);
}
Expand Down Expand Up @@ -913,7 +915,9 @@ CcZeroData (
Length -= VacbLength;

/* Tell Mm */
Status = MmMakePagesDirty(NULL, Add2Ptr(Vacb->BaseAddress, VacbOffset), VacbLength);
Status = MmMakeSegmentDirty(FileObject->SectionObjectPointer,
Vacb->FileOffset.QuadPart + VacbOffset,
VacbLength);
if (!NT_SUCCESS(Status))
ExRaiseStatus(Status);
}
Expand Down
11 changes: 6 additions & 5 deletions ntoskrnl/cc/pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,17 +551,18 @@ CcSetDirtyPinnedData (
IN PLARGE_INTEGER Lsn)
{
PINTERNAL_BCB iBcb = CONTAINING_RECORD(Bcb, INTERNAL_BCB, PFCB);
PROS_VACB Vacb = iBcb->Vacb;

CCTRACE(CC_API_DEBUG, "Bcb=%p Lsn=%p\n", Bcb, Lsn);

/* Tell Mm */
MmMakePagesDirty(NULL,
Add2Ptr(iBcb->Vacb->BaseAddress, iBcb->PFCB.MappedFileOffset.QuadPart - iBcb->Vacb->FileOffset.QuadPart),
iBcb->PFCB.MappedLength);
MmMakeSegmentDirty(Vacb->SharedCacheMap->FileObject->SectionObjectPointer,
iBcb->PFCB.MappedFileOffset.QuadPart,
iBcb->PFCB.MappedLength);

if (!iBcb->Vacb->Dirty)
if (!Vacb->Dirty)
{
CcRosMarkDirtyVacb(iBcb->Vacb);
CcRosMarkDirtyVacb(Vacb);
}
}

Expand Down

0 comments on commit 2f4683f

Please sign in to comment.