Author: fireball Date: Mon Sep 28 13:02:34 2009 New Revision: 43203
URL: http://svn.reactos.org/svn/reactos?rev=43203&view=rev Log: [fastfat_new] - Add an internal routine for opening root DCB (a stub for now). - Add code for checking if this is a relative or absolute open. Start implementing absolute opening part.
Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h
Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] Mon Sep 28 13:02:34 2009 @@ -12,6 +12,24 @@ #include "fastfat.h"
/* FUNCTIONS *****************************************************************/ + +IO_STATUS_BLOCK +NTAPI +FatiOpenRootDcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFILE_OBJECT FileObject, + IN PVCB Vcb, + IN PACCESS_MASK DesiredAccess, + IN USHORT ShareAccess, + IN ULONG CreateDisposition) +{ + IO_STATUS_BLOCK Iosb; + + DPRINT1("Opening root directory\n"); + + Iosb.Status = STATUS_NOT_IMPLEMENTED; + + return Iosb; +}
NTSTATUS NTAPI @@ -36,6 +54,7 @@ PVCB Vcb, DecodedVcb; PFCB Fcb; PCCB Ccb; + PFCB ParentDcb;
/* IRP data */ PFILE_OBJECT FileObject; @@ -51,7 +70,7 @@
/* Misc */ NTSTATUS Status; - //IO_STATUS_BLOCK Iosb; + IO_STATUS_BLOCK Iosb; PIO_STACK_LOCATION IrpSp;
/* Get current IRP stack location */ @@ -184,10 +203,10 @@
// TODO: Make sure EAs aren't supported on FAT32
+ /* Check if it's a volume open request */ if (FileName.Length == 0) { - /* It is a volume open request, check related FO to be sure */ - + /* Test related FO to be sure */ if (!RelatedFO || FatDecodeFileObject(RelatedFO, &DecodedVcb, &Fcb, &Ccb) == UserVolumeOpen) { @@ -197,6 +216,58 @@ } }
+ /* Check if this is a relative open */ + if (RelatedFO) + { + // RelatedFO will be a parent directory + UNIMPLEMENTED; + } + else + { + /* Absolute open */ + if ((FileName.Length == sizeof(WCHAR)) && + (FileName.Buffer[0] == L'\')) + { + /* Check if it's ok to open it */ + if (NonDirectoryFile) + { + DPRINT1("Trying to open root dir as a file\n"); + + /* Cleanup and return */ + FatReleaseVcb(IrpContext, Vcb); + return STATUS_FILE_IS_A_DIRECTORY; + } + + /* Check delete on close on a root dir */ + if (DeleteOnClose) + { + /* Cleanup and return */ + FatReleaseVcb(IrpContext, Vcb); + return STATUS_CANNOT_DELETE; + } + + /* Call root directory open routine */ + Iosb = FatiOpenRootDcb(IrpContext, + FileObject, + Vcb, + DesiredAccess, + ShareAccess, + CreateDisposition); + + Irp->IoStatus.Information = Iosb.Information; + + /* Cleanup and return */ + FatReleaseVcb(IrpContext, Vcb); + return Iosb.Status; + } + else + { + /* Not a root dir */ + ParentDcb = Vcb->RootDcb; + DPRINT1("ParentDcb %p\n", ParentDcb); + } + } + //return Iosb.Status; return STATUS_SUCCESS; }
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] Mon Sep 28 13:02:34 2009 @@ -170,8 +170,9 @@ ULONG RootDirentSectors; LONGLONG BeyondLastClusterInFat; FAT_METHODS Methods; - /* Root Directory Fcb: */ - struct _FCB *RootFcb; + + /* Root Directory Control block */ + struct _FCB *RootDcb;
ULONG MediaChangeCount; } VCB, *PVCB;