mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 12:15:46 +00:00
- Allocate memory for mdl's for paging io from stack instead of the non paged pool.
svn path=/trunk/; revision=9631
This commit is contained in:
parent
3b09731efb
commit
353214e42e
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: copy.c,v 1.22 2004/06/06 07:52:22 hbirr Exp $
|
/* $Id: copy.c,v 1.23 2004/06/06 08:36:30 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -33,6 +33,15 @@ static PHYSICAL_ADDRESS CcZeroPage = { 0 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_ZERO_LENGTH (256 * 1024)
|
#define MAX_ZERO_LENGTH (256 * 1024)
|
||||||
|
#define MAX_RW_LENGTH (64 * 1024)
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
void * alloca(size_t size);
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
void* _alloca(size_t size);
|
||||||
|
#else
|
||||||
|
#error Unknown compiler for alloca intrinsic stack allocation "function"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
@ -67,6 +76,9 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG TempLength;
|
ULONG TempLength;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
|
PMDL Mdl;
|
||||||
|
|
||||||
|
Mdl = alloca(MmSizeOfMdl(NULL, MAX_RW_LENGTH));
|
||||||
|
|
||||||
Status = CcRosGetCacheSegmentChain(Bcb, ReadOffset, Length, &head);
|
Status = CcRosGetCacheSegmentChain(Bcb, ReadOffset, Length, &head);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -105,7 +117,6 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
|
||||||
{
|
{
|
||||||
PCACHE_SEGMENT current2;
|
PCACHE_SEGMENT current2;
|
||||||
ULONG current_size;
|
ULONG current_size;
|
||||||
PMDL Mdl;
|
|
||||||
ULONG i;
|
ULONG i;
|
||||||
ULONG offset;
|
ULONG offset;
|
||||||
|
|
||||||
|
@ -124,7 +135,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
|
||||||
/*
|
/*
|
||||||
* Create an MDL which contains all their pages.
|
* Create an MDL which contains all their pages.
|
||||||
*/
|
*/
|
||||||
Mdl = MmCreateMdl(NULL, NULL, current_size);
|
MmInitializeMdl(Mdl, NULL, current_size);
|
||||||
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
|
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
|
||||||
current2 = current;
|
current2 = current;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
@ -157,6 +168,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
|
||||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
Status = Iosb.Status;
|
Status = Iosb.Status;
|
||||||
}
|
}
|
||||||
|
MmUnmapLockedPages(Mdl->MappedSystemVa, Mdl);
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_END_OF_FILE)
|
if (!NT_SUCCESS(Status) && Status != STATUS_END_OF_FILE)
|
||||||
{
|
{
|
||||||
while (current != NULL)
|
while (current != NULL)
|
||||||
|
@ -206,8 +218,10 @@ ReadCacheSegment(PCACHE_SEGMENT CacheSeg)
|
||||||
{
|
{
|
||||||
Size = CacheSeg->Bcb->CacheSegmentSize;
|
Size = CacheSeg->Bcb->CacheSegmentSize;
|
||||||
}
|
}
|
||||||
Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size);
|
Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size));
|
||||||
|
MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size);
|
||||||
MmBuildMdlForNonPagedPool(Mdl);
|
MmBuildMdlForNonPagedPool(Mdl);
|
||||||
|
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
Status = IoPageRead(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, & Event, &IoStatus);
|
Status = IoPageRead(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, & Event, &IoStatus);
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
|
@ -246,8 +260,10 @@ WriteCacheSegment(PCACHE_SEGMENT CacheSeg)
|
||||||
{
|
{
|
||||||
Size = CacheSeg->Bcb->CacheSegmentSize;
|
Size = CacheSeg->Bcb->CacheSegmentSize;
|
||||||
}
|
}
|
||||||
Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size);
|
Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size));
|
||||||
|
MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size);
|
||||||
MmBuildMdlForNonPagedPool(Mdl);
|
MmBuildMdlForNonPagedPool(Mdl);
|
||||||
|
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
Status = IoPageWrite(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, &Event, &IoStatus);
|
Status = IoPageWrite(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, &Event, &IoStatus);
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
|
@ -360,7 +376,7 @@ CcCopyRead (IN PFILE_OBJECT FileObject,
|
||||||
}
|
}
|
||||||
while (Length > 0)
|
while (Length > 0)
|
||||||
{
|
{
|
||||||
TempLength = min(max(Bcb->CacheSegmentSize, 65536), Length);
|
TempLength = min(max(Bcb->CacheSegmentSize, MAX_RW_LENGTH), Length);
|
||||||
ReadCacheSegmentChain(Bcb, ReadOffset, TempLength, Buffer);
|
ReadCacheSegmentChain(Bcb, ReadOffset, TempLength, Buffer);
|
||||||
ReadLength += TempLength;
|
ReadLength += TempLength;
|
||||||
Length -= TempLength;
|
Length -= TempLength;
|
||||||
|
@ -534,6 +550,8 @@ CcZeroData (IN PFILE_OBJECT FileObject,
|
||||||
{
|
{
|
||||||
/* File is not cached */
|
/* File is not cached */
|
||||||
|
|
||||||
|
Mdl = alloca(MmSizeOfMdl(NULL, MAX_ZERO_LENGTH));
|
||||||
|
|
||||||
while (Length > 0)
|
while (Length > 0)
|
||||||
{
|
{
|
||||||
if (Length + WriteOffset.u.LowPart % PAGE_SIZE > MAX_ZERO_LENGTH)
|
if (Length + WriteOffset.u.LowPart % PAGE_SIZE > MAX_ZERO_LENGTH)
|
||||||
|
@ -544,12 +562,7 @@ CcZeroData (IN PFILE_OBJECT FileObject,
|
||||||
{
|
{
|
||||||
CurrentLength = Length;
|
CurrentLength = Length;
|
||||||
}
|
}
|
||||||
Mdl = MmCreateMdl(NULL, (PVOID)WriteOffset.u.LowPart, CurrentLength);
|
MmInitializeMdl(Mdl, (PVOID)WriteOffset.u.LowPart, CurrentLength);
|
||||||
|
|
||||||
if (Mdl == NULL)
|
|
||||||
{
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
|
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
|
||||||
for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++)
|
for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++)
|
||||||
{
|
{
|
||||||
|
@ -562,6 +575,7 @@ CcZeroData (IN PFILE_OBJECT FileObject,
|
||||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
Status = Iosb.Status;
|
Status = Iosb.Status;
|
||||||
}
|
}
|
||||||
|
MmUnmapLockedPages(Mdl->MappedSystemVa, Mdl);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
|
|
@ -368,9 +368,9 @@ extern MM_STATS MmStats;
|
||||||
PVOID
|
PVOID
|
||||||
MmGetDirtyPagesFromWorkingSet(struct _EPROCESS* Process);
|
MmGetDirtyPagesFromWorkingSet(struct _EPROCESS* Process);
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
MmWriteToSwapPage(SWAPENTRY SwapEntry, PMDL Mdl);
|
MmWriteToSwapPage(SWAPENTRY SwapEntry, PHYSICAL_ADDRESS* Page);
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
MmReadFromSwapPage(SWAPENTRY SwapEntry, PMDL Mdl);
|
MmReadFromSwapPage(SWAPENTRY SwapEntry, PHYSICAL_ADDRESS* Page);
|
||||||
VOID
|
VOID
|
||||||
MmSetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG Flags);
|
MmSetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG Flags);
|
||||||
ULONG
|
ULONG
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: irp.c,v 1.60 2004/04/20 23:14:35 gdalsnes Exp $
|
/* $Id: irp.c,v 1.61 2004/06/06 08:36:31 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -294,11 +294,15 @@ IofCompleteRequest(PIRP Irp,
|
||||||
/* Windows NT File System Internals, page 165 */
|
/* Windows NT File System Internals, page 165 */
|
||||||
if (Irp->Flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION))
|
if (Irp->Flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION))
|
||||||
{
|
{
|
||||||
if (Irp->Flags & IRP_PAGING_IO)
|
/*
|
||||||
{
|
* If MDL_IO_PAGE_READ is set, then the caller is responsible
|
||||||
/* FIXME:
|
* for deallocating of the mdl.
|
||||||
* The mdl should be freed by the caller!
|
|
||||||
*/
|
*/
|
||||||
|
if (Irp->Flags & IRP_PAGING_IO &&
|
||||||
|
Irp->MdlAddress &&
|
||||||
|
!(Irp->MdlAddress->MdlFlags & MDL_IO_PAGE_READ))
|
||||||
|
{
|
||||||
|
|
||||||
if (Irp->MdlAddress->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA)
|
if (Irp->MdlAddress->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA)
|
||||||
{
|
{
|
||||||
MmUnmapLockedPages(Irp->MdlAddress->MappedSystemVa, Irp->MdlAddress);
|
MmUnmapLockedPages(Irp->MdlAddress->MappedSystemVa, Irp->MdlAddress);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: anonmem.c,v 1.27 2004/04/10 22:35:25 gdalsnes Exp $
|
/* $Id: anonmem.c,v 1.28 2004/06/06 08:36:31 hbirr Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/anonmem.c
|
* FILE: ntoskrnl/mm/anonmem.c
|
||||||
|
@ -46,7 +46,6 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
{
|
{
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
LARGE_INTEGER PhysicalAddress;
|
LARGE_INTEGER PhysicalAddress;
|
||||||
PMDL Mdl;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -99,9 +98,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Write the page to the pagefile
|
* Write the page to the pagefile
|
||||||
*/
|
*/
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmWriteToSwapPage(SwapEntry, &PhysicalAddress);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
|
||||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
||||||
|
@ -133,7 +130,6 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
BOOL WasDirty;
|
BOOL WasDirty;
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PMDL Mdl;
|
|
||||||
|
|
||||||
DPRINT("MmPageOutVirtualMemory(Address 0x%.8X) PID %d\n",
|
DPRINT("MmPageOutVirtualMemory(Address 0x%.8X) PID %d\n",
|
||||||
Address, MemoryArea->Process->UniqueProcessId);
|
Address, MemoryArea->Process->UniqueProcessId);
|
||||||
|
@ -200,9 +196,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Write the page to the pagefile
|
* Write the page to the pagefile
|
||||||
*/
|
*/
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmWriteToSwapPage(SwapEntry, &PhysicalAddress);
|
||||||
MmBuildMdlFromPages(Mdl, (ULONG *)&PhysicalAddress.u.LowPart);
|
|
||||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
||||||
|
@ -372,12 +366,9 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
if (MmIsPageSwapEntry(NULL, Address))
|
if (MmIsPageSwapEntry(NULL, Address))
|
||||||
{
|
{
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
PMDL Mdl;
|
|
||||||
|
|
||||||
MmDeletePageFileMapping(MemoryArea->Process, Address, &SwapEntry);
|
MmDeletePageFileMapping(MemoryArea->Process, Address, &SwapEntry);
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmReadFromSwapPage(SwapEntry, &Page);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
|
||||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: section.c,v 1.150 2004/05/30 12:55:11 hbirr Exp $
|
/* $Id: section.c,v 1.151 2004/06/06 08:36:31 hbirr Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/section.c
|
* FILE: ntoskrnl/mm/section.c
|
||||||
|
@ -396,10 +396,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
||||||
* process and the current segment (also not within an other process).
|
* process and the current segment (also not within an other process).
|
||||||
*/
|
*/
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PMDL Mdl;
|
Status = MmWriteToSwapPage(SavedSwapEntry, &Page);
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
|
||||||
Status = MmWriteToSwapPage(SavedSwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n", Status);
|
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n", Status);
|
||||||
|
@ -792,7 +789,6 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
* Must be private page we have swapped out.
|
* Must be private page we have swapped out.
|
||||||
*/
|
*/
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
PMDL Mdl;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sanity check
|
* Sanity check
|
||||||
|
@ -813,9 +809,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmReadFromSwapPage(SwapEntry, &Page);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
|
||||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MmReadFromSwapPage failed, status = %x\n", Status);
|
DPRINT1("MmReadFromSwapPage failed, status = %x\n", Status);
|
||||||
|
@ -1078,7 +1072,6 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
else if (IS_SWAP_FROM_SSE(Entry))
|
else if (IS_SWAP_FROM_SSE(Entry))
|
||||||
{
|
{
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
PMDL Mdl;
|
|
||||||
|
|
||||||
SwapEntry = SWAPENTRY_FROM_SSE(Entry);
|
SwapEntry = SWAPENTRY_FROM_SSE(Entry);
|
||||||
|
|
||||||
|
@ -1095,9 +1088,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmReadFromSwapPage(SwapEntry, &Page);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
|
||||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
KEBUGCHECK(0);
|
KEBUGCHECK(0);
|
||||||
|
@ -1434,7 +1425,6 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
PHYSICAL_ADDRESS PhysicalAddress;
|
PHYSICAL_ADDRESS PhysicalAddress;
|
||||||
MM_SECTION_PAGEOUT_CONTEXT Context;
|
MM_SECTION_PAGEOUT_CONTEXT Context;
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
PMDL Mdl;
|
|
||||||
ULONG Entry;
|
ULONG Entry;
|
||||||
ULONG FileOffset;
|
ULONG FileOffset;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -1695,9 +1685,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Write the page to the pagefile
|
* Write the page to the pagefile
|
||||||
*/
|
*/
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmWriteToSwapPage(SwapEntry, &PhysicalAddress);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
|
||||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
||||||
|
@ -1784,7 +1772,6 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
PMM_SECTION_SEGMENT Segment;
|
PMM_SECTION_SEGMENT Segment;
|
||||||
PHYSICAL_ADDRESS PhysicalAddress;
|
PHYSICAL_ADDRESS PhysicalAddress;
|
||||||
SWAPENTRY SwapEntry;
|
SWAPENTRY SwapEntry;
|
||||||
PMDL Mdl;
|
|
||||||
ULONG Entry;
|
ULONG Entry;
|
||||||
BOOLEAN Private;
|
BOOLEAN Private;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -1900,9 +1887,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
||||||
/*
|
/*
|
||||||
* Write the page to the pagefile
|
* Write the page to the pagefile
|
||||||
*/
|
*/
|
||||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
Status = MmWriteToSwapPage(SwapEntry, &PhysicalAddress);
|
||||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
|
||||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
|
||||||
|
|
Loading…
Reference in a new issue