mirror of
https://github.com/reactos/reactos.git
synced 2025-06-23 19:10:25 +00:00
Fixed several erronious checks to detect things such as eof on directories too, not just files
svn path=/trunk/; revision=1192
This commit is contained in:
parent
274c4db921
commit
4e91635e4a
1 changed files with 4 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rw.c,v 1.5 2000/04/07 02:24:03 dwelch Exp $
|
/* $Id: rw.c,v 1.6 2000/06/17 22:04:08 phreak Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -55,13 +55,11 @@ NTSTATUS FsdReadFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
FirstCluster=CurrentCluster;
|
FirstCluster=CurrentCluster;
|
||||||
DPRINT("DeviceExt->BytesPerCluster %x\n",DeviceExt->BytesPerCluster);
|
DPRINT("DeviceExt->BytesPerCluster %x\n",DeviceExt->BytesPerCluster);
|
||||||
|
|
||||||
if (ReadOffset >= Fcb->entry.FileSize
|
if (ReadOffset >= Fcb->entry.FileSize)
|
||||||
&& !(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
|
|
||||||
{
|
{
|
||||||
return(STATUS_END_OF_FILE);
|
return(STATUS_END_OF_FILE);
|
||||||
}
|
}
|
||||||
if ((ReadOffset + Length) > Fcb->entry.FileSize
|
if ((ReadOffset + Length) > Fcb->entry.FileSize)
|
||||||
&& !(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
|
|
||||||
{
|
{
|
||||||
Length = Fcb->entry.FileSize - ReadOffset;
|
Length = Fcb->entry.FileSize - ReadOffset;
|
||||||
}
|
}
|
||||||
|
@ -353,8 +351,7 @@ NTSTATUS FsdWriteFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
&Fcb->entry.UpdateTime);
|
&Fcb->entry.UpdateTime);
|
||||||
Fcb->entry.AccessDate = Fcb->entry.UpdateDate;
|
Fcb->entry.AccessDate = Fcb->entry.UpdateDate;
|
||||||
|
|
||||||
if (Fcb->entry.FileSize < WriteOffset+Length
|
if (Fcb->entry.FileSize < WriteOffset+Length)
|
||||||
&& !(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
|
|
||||||
{
|
{
|
||||||
Fcb->entry.FileSize = WriteOffset+Length;
|
Fcb->entry.FileSize = WriteOffset+Length;
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue