sys: IRP_MJ_READ, IRP_MJ_WRITE: fix paging I/O sizes

This commit is contained in:
Bill Zissimopoulos
2016-04-13 18:00:02 -07:00
parent 49f9f13806
commit 41296044e6
6 changed files with 34 additions and 27 deletions

View File

@ -220,10 +220,11 @@ static NTSTATUS FspFsvolReadNonCached(
if (FlagOn(IrpSp->MinorFunction, IRP_MN_MDL))
return STATUS_INVALID_PARAMETER;
/* if this is a recursive read (cache) see if we can optimize it away! */
if (FlagOn(FspIrpTopFlags(Irp), FspFileNodeAcquireMain) && /* if TopLevelIrp has acquired Main */
FspFileNodeTryGetFileInfo(FileNode, &FileInfo) && /* and the cached FileSize is valid */
(UINT64)ReadOffset.QuadPart >= FileInfo.FileSize) /* and the ReadOffset is past EOF */
/* if this is a Paging I/O see if we can optimize it away! */
if (PagingIo && /* if this is Paging I/O */
FlagOn(FspIrpTopFlags(Irp), FspFileNodeAcquireMain) && /* and TopLevelIrp has acquired Main */
FspFileNodeTryGetFileInfo(FileNode, &FileInfo) && /* and the cached FileSize is valid */
(UINT64)ReadOffset.QuadPart >= FileInfo.FileSize) /* and the ReadOffset is past EOF */
return STATUS_END_OF_FILE;
/* probe and lock the user buffer */