Author: pschweitzer
Date: Fri Sep 15 11:49:55 2017
New Revision: 75844
URL:
http://svn.reactos.org/svn/reactos?rev=75844&view=rev
Log:
[NTOSKRNL]
Fix the way the paging IO MDLs are issued by Cc on read.
Similar to r75834.
Fixes tests from r75842.
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=758…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Fri Sep 15 11:49:55 2017
@@ -86,14 +86,29 @@
return STATUS_INSUFFICIENT_RESOURCES;
}
- MmBuildMdlForNonPagedPool(Mdl);
- Mdl->MdlFlags |= MDL_IO_PAGE_READ;
- KeInitializeEvent(&Event, NotificationEvent, FALSE);
- Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl,
&Vacb->FileOffset, &Event, &IoStatus);
- if (Status == STATUS_PENDING)
- {
- KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
- Status = IoStatus.Status;
+ Status = STATUS_SUCCESS;
+ _SEH2_TRY
+ {
+ MmProbeAndLockPages(Mdl, KernelMode, IoWriteAccess);
+ }
+ _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ KeBugCheck(CACHE_MANAGER);
+ } _SEH2_END;
+
+ if (NT_SUCCESS(Status))
+ {
+ Mdl->MdlFlags |= MDL_IO_PAGE_READ;
+ KeInitializeEvent(&Event, NotificationEvent, FALSE);
+ Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl,
&Vacb->FileOffset, &Event, &IoStatus);
+ if (Status == STATUS_PENDING)
+ {
+ KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
+ Status = IoStatus.Status;
+ }
+
+ MmUnlockPages(Mdl);
}
IoFreeMdl(Mdl);