From 3c54f088017c118a641327aad779891c75fa4025 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 15 Sep 2002 22:23:23 +0000 Subject: [PATCH] Added CdfsSetPosition/CdfsSetInformation. svn path=/trunk/; revision=3507 --- reactos/drivers/fs/cdfs/cdfs.c | 4 ++- reactos/drivers/fs/cdfs/finfo.c | 61 ++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/fs/cdfs/cdfs.c b/reactos/drivers/fs/cdfs/cdfs.c index 845a91b4330..5334cd9b22d 100644 --- a/reactos/drivers/fs/cdfs/cdfs.c +++ b/reactos/drivers/fs/cdfs/cdfs.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cdfs.c,v 1.7 2002/09/09 17:27:14 hbirr Exp $ +/* $Id: cdfs.c,v 1.8 2002/09/15 22:23:22 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -92,6 +92,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, CdfsDirectoryControl; DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = CdfsQueryInformation; + DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = + CdfsSetInformation; DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = CdfsQueryVolumeInformation; DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = diff --git a/reactos/drivers/fs/cdfs/finfo.c b/reactos/drivers/fs/cdfs/finfo.c index 11fa70a7543..71b1f9ef2db 100644 --- a/reactos/drivers/fs/cdfs/finfo.c +++ b/reactos/drivers/fs/cdfs/finfo.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: finfo.c,v 1.4 2002/07/20 11:44:24 ekohl Exp $ +/* $Id: finfo.c,v 1.5 2002/09/15 22:23:23 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -277,6 +277,19 @@ CdfsGetAllInformation(PFILE_OBJECT FileObject, return STATUS_SUCCESS; } +static NTSTATUS +CdfsSetPositionInformation(PFILE_OBJECT FileObject, + PFILE_POSITION_INFORMATION PositionInfo) +{ + DPRINT ("CdfsSetPositionInformation()\n"); + + DPRINT ("PositionInfo %x\n", PositionInfo); + DPRINT ("Setting position %d\n", PositionInfo->CurrentByteOffset.u.LowPart); + memcpy (&FileObject->CurrentByteOffset, &PositionInfo->CurrentByteOffset, + sizeof (LARGE_INTEGER)); + + return (STATUS_SUCCESS); +} NTSTATUS STDCALL CdfsQueryInformation(PDEVICE_OBJECT DeviceObject, @@ -375,4 +388,50 @@ CdfsQueryInformation(PDEVICE_OBJECT DeviceObject, return(Status); } +NTSTATUS STDCALL +CdfsSetInformation(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +/* + * FUNCTION: Retrieve the specified file information + */ +{ + FILE_INFORMATION_CLASS FileInformationClass; + PIO_STACK_LOCATION Stack; + PFILE_OBJECT FileObject; + PFCB Fcb; + PVOID SystemBuffer; + + NTSTATUS Status = STATUS_SUCCESS; + + DPRINT1("CdfsSetInformation() called\n"); + + Stack = IoGetCurrentIrpStackLocation(Irp); + FileInformationClass = Stack->Parameters.SetFile.FileInformationClass; + FileObject = Stack->FileObject; + Fcb = FileObject->FsContext; + + SystemBuffer = Irp->AssociatedIrp.SystemBuffer; + + switch (FileInformationClass) + { + case FilePositionInformation: + Status = CdfsSetPositionInformation(FileObject, + SystemBuffer); + break; + case FileBasicInformation: + case FileRenameInformation: + Status = STATUS_NOT_IMPLEMENTED; + break; + default: + Status = STATUS_NOT_SUPPORTED; + } + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return(Status); +} + /* EOF */ \ No newline at end of file