diff --git a/reactos/ntoskrnl/cache/copysup.c b/reactos/ntoskrnl/cache/copysup.c index 8820779fb5c..138af93c655 100644 --- a/reactos/ntoskrnl/cache/copysup.c +++ b/reactos/ntoskrnl/cache/copysup.c @@ -186,7 +186,6 @@ CcCopyWrite(IN PFILE_OBJECT FileObject, WriteBuf, Bcb->BaseAddress); - //MiZeroFillSection(WriteBuf, &CurrentOffset, WriteLen); RtlCopyMemory(WriteBuf, ((PCHAR)Buffer) + Count, WriteLen); Count += WriteLen; Length -= WriteLen; diff --git a/reactos/ntoskrnl/cache/section/data.c b/reactos/ntoskrnl/cache/section/data.c index 09ab9432019..3c70ff74634 100644 --- a/reactos/ntoskrnl/cache/section/data.c +++ b/reactos/ntoskrnl/cache/section/data.c @@ -112,78 +112,6 @@ _MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line) //DPRINT("MmUnlockSectionSegment(%p,%s:%d)\n", Segment, file, line); } -NTSTATUS -NTAPI -MiZeroFillSection(PVOID Address, PLARGE_INTEGER FileOffsetPtr, ULONG Length) -{ - PFN_NUMBER Page; - PMMSUPPORT AddressSpace; - PMEMORY_AREA MemoryArea; - PMM_SECTION_SEGMENT Segment; - LARGE_INTEGER FileOffset = *FileOffsetPtr, End, FirstMapped; - KIRQL OldIrql; - - DPRINT("MiZeroFillSection(Address %p, Offset 0x%I64x,Length 0x%lx)\n", - Address, - FileOffset.QuadPart, - Length); - - AddressSpace = MmGetKernelAddressSpace(); - - MmLockAddressSpace(AddressSpace); - MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address); - MmUnlockAddressSpace(AddressSpace); - if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW || MemoryArea->DeleteInProgress) - { - return STATUS_NOT_MAPPED_DATA; - } - - Segment = MemoryArea->Data.SectionData.Segment; - End.QuadPart = FileOffset.QuadPart + Length; - End.LowPart = PAGE_ROUND_DOWN(End.LowPart); - FileOffset.LowPart = PAGE_ROUND_UP(FileOffset.LowPart); - FirstMapped.QuadPart = MemoryArea->Data.SectionData.ViewOffset.QuadPart; - DPRINT("Pulling zero pages for %08x%08x-%08x%08x\n", - FileOffset.u.HighPart, FileOffset.u.LowPart, - End.u.HighPart, End.u.LowPart); - - while (FileOffset.QuadPart < End.QuadPart) - { - PVOID CurrentAddress; - ULONG_PTR Entry; - - if (!NT_SUCCESS(MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &Page))) - break; - - MmLockAddressSpace(AddressSpace); - MmLockSectionSegment(Segment); - - Entry = MmGetPageEntrySectionSegment(Segment, &FileOffset); - if (Entry == 0) - { - MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page)); - CurrentAddress = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart; - - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmReferencePage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - - MmCreateVirtualMapping(NULL, CurrentAddress, PAGE_READWRITE, &Page, 1); - MmInsertRmap(Page, NULL, CurrentAddress); - } - else - { - MmReleasePageMemoryConsumer(MC_CACHE, Page); - } - - MmUnlockSectionSegment(Segment); - MmUnlockAddressSpace(AddressSpace); - - FileOffset.QuadPart += PAGE_SIZE; - } - return STATUS_SUCCESS; -} - /* MiFlushMappedSection diff --git a/reactos/ntoskrnl/cache/section/newmm.h b/reactos/ntoskrnl/cache/section/newmm.h index 43df777d4a2..d5f9998993c 100644 --- a/reactos/ntoskrnl/cache/section/newmm.h +++ b/reactos/ntoskrnl/cache/section/newmm.h @@ -262,12 +262,6 @@ MiCowCacheSectionPage ( _In_ BOOLEAN Locked, _Inout_ PMM_REQUIRED_RESOURCES Required); -NTSTATUS -NTAPI -MiZeroFillSection(PVOID Address, - PLARGE_INTEGER FileOffsetPtr, - ULONG Length); - VOID MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process,