mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[fastfat_new]
- Implement root directory open operation. - Add OpenCount counter to FCB. svn path=/trunk/; revision=43646
This commit is contained in:
parent
dc333c6ad4
commit
c013577df5
2 changed files with 58 additions and 2 deletions
|
@ -23,10 +23,64 @@ FatiOpenRootDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
IN ULONG CreateDisposition)
|
IN ULONG CreateDisposition)
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
PFCB Dcb;
|
||||||
|
NTSTATUS Status;
|
||||||
|
PCCB Ccb;
|
||||||
|
|
||||||
DPRINT1("Opening root directory\n");
|
/* Reference our DCB */
|
||||||
|
Dcb = Vcb->RootDcb;
|
||||||
|
|
||||||
Iosb.Status = STATUS_NOT_IMPLEMENTED;
|
DPRINT("Opening root directory\n");
|
||||||
|
|
||||||
|
/* Exclusively lock this DCB */
|
||||||
|
(VOID)FatAcquireExclusiveFcb(IrpContext, Dcb);
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
/* Validate parameters */
|
||||||
|
if (CreateDisposition != FILE_OPEN &&
|
||||||
|
CreateDisposition != FILE_OPEN_IF)
|
||||||
|
{
|
||||||
|
Iosb.Status = STATUS_ACCESS_DENIED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Check file access
|
||||||
|
|
||||||
|
/* Is it a first time open? */
|
||||||
|
if (Dcb->OpenCount == 0)
|
||||||
|
{
|
||||||
|
/* Set share access */
|
||||||
|
IoSetShareAccess(*DesiredAccess,
|
||||||
|
ShareAccess,
|
||||||
|
FileObject,
|
||||||
|
&Dcb->ShareAccess);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Check share access */
|
||||||
|
Status = IoCheckShareAccess(*DesiredAccess,
|
||||||
|
ShareAccess,
|
||||||
|
FileObject,
|
||||||
|
&Dcb->ShareAccess,
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set file object pointers */
|
||||||
|
Ccb = FatCreateCcb(IrpContext);
|
||||||
|
FatSetFileObject(FileObject, UserDirectoryOpen, Dcb, Ccb);
|
||||||
|
|
||||||
|
/* Increment counters */
|
||||||
|
Dcb->OpenCount++;
|
||||||
|
Vcb->OpenFileCount++;
|
||||||
|
|
||||||
|
/* Set success statuses */
|
||||||
|
Iosb.Status = STATUS_SUCCESS;
|
||||||
|
Iosb.Information = FILE_OPENED;
|
||||||
|
} while (FALSE);
|
||||||
|
|
||||||
|
/* Release the DCB lock */
|
||||||
|
FatReleaseFcb(IrpContext, Dcb);
|
||||||
|
|
||||||
return Iosb;
|
return Iosb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,8 @@ typedef struct _FCB
|
||||||
ULONG OutstandingAsyncWrites;
|
ULONG OutstandingAsyncWrites;
|
||||||
/* The outstanding async writes sync event */
|
/* The outstanding async writes sync event */
|
||||||
PKEVENT OutstandingAsyncEvent;
|
PKEVENT OutstandingAsyncEvent;
|
||||||
|
/* Counters */
|
||||||
|
ULONG OpenCount;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
|
Loading…
Reference in a new issue