[NTOSKRNL]

Kill MiZeroFillSection

svn path=/trunk/; revision=64533
This commit is contained in:
Timo Kreuzer
2014-10-05 08:49:15 +00:00
parent 0a3873c1c2
commit 52e72ad273
3 changed files with 0 additions and 79 deletions
-1
View File
@@ -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;
-72
View File
@@ -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
-6
View File
@@ -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,