mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
Added updating of FileObject->CurrentByteOffset in VfatRead()/VfatWrite.
svn path=/trunk/; revision=2152
This commit is contained in:
parent
b4a4e5c0be
commit
34b4c8f40b
1 changed files with 24 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
/* $Id: rw.c,v 1.25 2001/07/20 08:00:20 ekohl Exp $
|
/* $Id: rw.c,v 1.26 2001/08/04 11:02:47 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -369,7 +369,7 @@ VfatReadFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
assert (FileObject != NULL);
|
assert (FileObject != NULL);
|
||||||
assert (FileObject->FsContext != NULL);
|
assert (FileObject->FsContext != NULL);
|
||||||
|
|
||||||
DPRINT("VfatReadFile(DeviceExt %x, FileObject %x, Buffer %x, "
|
DPRINT1("VfatReadFile(DeviceExt %x, FileObject %x, Buffer %x, "
|
||||||
"Length %d, ReadOffset 0x%x)\n", DeviceExt, FileObject, Buffer,
|
"Length %d, ReadOffset 0x%x)\n", DeviceExt, FileObject, Buffer,
|
||||||
Length, ReadOffset);
|
Length, ReadOffset);
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ VfatReadFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the cluster to start the read from
|
* Find the cluster to start the read from
|
||||||
* FIXME: Optimize by remembering the last cluster read and using if
|
* FIXME: Optimize by remembering the last cluster read and using if
|
||||||
* possible.
|
* possible.
|
||||||
*/
|
*/
|
||||||
Status = OffsetToCluster(DeviceExt,
|
Status = OffsetToCluster(DeviceExt,
|
||||||
|
@ -786,7 +786,7 @@ VfatWriteFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOLEAN Extend;
|
BOOLEAN Extend;
|
||||||
|
|
||||||
DPRINT ("VfatWriteFile(FileObject %x, Buffer %x, Length %x, "
|
DPRINT1 ("VfatWriteFile(FileObject %x, Buffer %x, Length %x, "
|
||||||
"WriteOffset %x\n", FileObject, Buffer, Length, WriteOffset);
|
"WriteOffset %x\n", FileObject, Buffer, Length, WriteOffset);
|
||||||
|
|
||||||
/* Locate the first cluster of the file */
|
/* Locate the first cluster of the file */
|
||||||
|
@ -941,8 +941,8 @@ VfatWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
PVOID Buffer;
|
PVOID Buffer;
|
||||||
ULONG Offset;
|
ULONG Offset;
|
||||||
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation (Irp);
|
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation (Irp);
|
||||||
PFILE_OBJECT FileObject = Stack->FileObject;
|
PFILE_OBJECT FileObject = Stack->FileObject;
|
||||||
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
|
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG NoCache;
|
ULONG NoCache;
|
||||||
|
|
||||||
|
@ -962,8 +962,16 @@ VfatWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
NoCache = FALSE;
|
NoCache = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = VfatWriteFile (DeviceExt, FileObject, Buffer, Length, Offset,
|
Status = VfatWriteFile (DeviceExt, FileObject, Buffer, Length, Offset,
|
||||||
NoCache);
|
NoCache);
|
||||||
|
|
||||||
|
if (FileObject->Flags & FO_SYNCHRONOUS_IO
|
||||||
|
&& !(Irp->Flags & IRP_PAGING_IO)
|
||||||
|
&& NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
FileObject->CurrentByteOffset.QuadPart = Offset + Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Irp->IoStatus.Status = Status;
|
Irp->IoStatus.Status = Status;
|
||||||
Irp->IoStatus.Information = Length;
|
Irp->IoStatus.Information = Length;
|
||||||
|
@ -1003,7 +1011,7 @@ VfatRead (PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
Length = Stack->Parameters.Read.Length;
|
Length = Stack->Parameters.Read.Length;
|
||||||
Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress);
|
Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress);
|
||||||
Offset = Stack->Parameters.Read.ByteOffset.u.LowPart;
|
Offset = Stack->Parameters.Read.ByteOffset.u.LowPart;
|
||||||
|
|
||||||
if (Irp->Flags & IRP_PAGING_IO ||
|
if (Irp->Flags & IRP_PAGING_IO ||
|
||||||
FileObject->Flags & FO_NO_INTERMEDIATE_BUFFERING)
|
FileObject->Flags & FO_NO_INTERMEDIATE_BUFFERING)
|
||||||
{
|
{
|
||||||
|
@ -1027,6 +1035,13 @@ VfatRead (PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
NoCache);
|
NoCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FileObject->Flags & FO_SYNCHRONOUS_IO
|
||||||
|
&& !(Irp->Flags & IRP_PAGING_IO)
|
||||||
|
&& NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
FileObject->CurrentByteOffset.QuadPart = Offset + LengthRead;
|
||||||
|
}
|
||||||
|
|
||||||
Irp->IoStatus.Status = Status;
|
Irp->IoStatus.Status = Status;
|
||||||
Irp->IoStatus.Information = LengthRead;
|
Irp->IoStatus.Information = LengthRead;
|
||||||
IoCompleteRequest (Irp, IO_NO_INCREMENT);
|
IoCompleteRequest (Irp, IO_NO_INCREMENT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue