[PATCH 2/3] ntdll: Don't return an error when reading past EOF in NtReadFileScatter

Andrew Eikum aeikum at codeweavers.com
Thu Nov 30 07:26:44 CST 2017


On Thu, Nov 30, 2017 at 10:43:41AM +0100, Thomas Faber wrote:
> On 2017-11-29 19:52, Andrew Eikum wrote:
> > diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
> > index bdfc383d7e..f7db24cc8b 100644
> > --- a/dlls/ntdll/file.c
> > +++ b/dlls/ntdll/file.c
> > @@ -1071,10 +1071,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
> >               break;
> >           }
> >           if (!result)
> > -        {
> > -            status = STATUS_END_OF_FILE;
> >               break;
> > -        }
> >           total += result;
> >           length -= result;
> >           if ((pos += result) == page_size)
> > 
> 
> I think your conclusion from the test may be overly broad.
> The regular NtReadFile only returns STATUS_END_OF_FILE if the file
> pointer was already at EOF, i.e. if no data was read.
> It seems likely the Scatter version would do the same, so another test
> that starts reading at or beyond EOF should still return
> STATUS_END_OF_FILE.
> 

Thanks for the pointer, I'll add a test for that.

Andrew



More information about the wine-devel mailing list