diff --git a/reactos/ntoskrnl/cache/section/io.c b/reactos/ntoskrnl/cache/section/io.c index 254c25c38a6..a49e1820a62 100644 --- a/reactos/ntoskrnl/cache/section/io.c +++ b/reactos/ntoskrnl/cache/section/io.c @@ -99,6 +99,9 @@ MiSimpleRead PLARGE_INTEGER FileOffset, PVOID Buffer, ULONG Length, +#ifdef __ROS_CMAKE__ + BOOLEAN Paging, +#endif PIO_STATUS_BLOCK ReadStatus) { NTSTATUS Status; @@ -140,9 +143,13 @@ MiSimpleRead { return STATUS_NO_MEMORY; } - + +#ifndef __ROS_CMAKE__ Irp->Flags |= IRP_PAGING_IO | IRP_SYNCHRONOUS_PAGING_IO | IRP_NOCACHE | IRP_SYNCHRONOUS_API; - +#else + Irp->Flags |= (Paging ? IRP_PAGING_IO | IRP_SYNCHRONOUS_PAGING_IO | IRP_NOCACHE : 0) | IRP_SYNCHRONOUS_API; +#endif + Irp->UserEvent = &ReadWait; Irp->Tail.Overlay.OriginalFileObject = FileObject; Irp->Tail.Overlay.Thread = PsGetCurrentThread(); @@ -150,7 +157,11 @@ MiSimpleRead IrpSp->Control |= SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; IrpSp->FileObject = FileObject; IrpSp->CompletionRoutine = MiSimpleReadComplete; - + +#ifdef __ROS_CMAKE__ + ObReferenceObject(FileObject); +#endif + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { diff --git a/reactos/ntoskrnl/cache/section/newmm.h b/reactos/ntoskrnl/cache/section/newmm.h index 43fd3fe7cef..39e390dda87 100644 --- a/reactos/ntoskrnl/cache/section/newmm.h +++ b/reactos/ntoskrnl/cache/section/newmm.h @@ -181,6 +181,9 @@ MiSimpleRead PLARGE_INTEGER FileOffset, PVOID Buffer, ULONG Length, +#ifdef __ROS_CMAKE__ + BOOLEAN Paging, +#endif PIO_STATUS_BLOCK ReadStatus); NTSTATUS @@ -404,40 +407,6 @@ MmCreateCacheSection ULONG AllocationAttributes, PFILE_OBJECT FileObject); -NTSTATUS -NTAPI -MiSimpleRead -(PFILE_OBJECT FileObject, - PLARGE_INTEGER FileOffset, - PVOID Buffer, - ULONG Length, - PIO_STATUS_BLOCK ReadStatus); - -NTSTATUS -NTAPI -_MiSimpleWrite -(PFILE_OBJECT FileObject, - PLARGE_INTEGER FileOffset, - PVOID Buffer, - ULONG Length, - PIO_STATUS_BLOCK ReadStatus, - const char *file, - int line); - -#define MiSimpleWrite(F,O,B,L,R) _MiSimpleWrite(F,O,B,L,R,__FILE__,__LINE__) - -NTSTATUS -NTAPI -_MiWriteBackPage -(PFILE_OBJECT FileObject, - PLARGE_INTEGER Offset, - ULONG Length, - PFN_NUMBER Page, - const char *File, - int Line); - -#define MiWriteBackPage(F,O,L,P) _MiWriteBackPage(F,O,L,P,__FILE__,__LINE__) - PVOID NTAPI MmGetSegmentRmap(PFN_NUMBER Page, PULONG RawOffset);