From d315b7bb39f5e044b4759c0674d54b752a7d776b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 19:42:54 +0000 Subject: [PATCH] [FASTFAT] - Implement VfatNotifyChangeDirectory which handles file system notifications registration - Also add support to dispatch routine for not queuing IRPs when pending and not required CORE-2582 svn path=/trunk/; revision=62444 --- reactos/drivers/filesystems/fastfat/dir.c | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/dir.c b/reactos/drivers/filesystems/fastfat/dir.c index 2b5d8f1da52..57fda52556f 100644 --- a/reactos/drivers/filesystems/fastfat/dir.c +++ b/reactos/drivers/filesystems/fastfat/dir.c @@ -584,6 +584,32 @@ DoQuery( return Status; } +NTSTATUS VfatNotifyChangeDirectory(PVFAT_IRP_CONTEXT * IrpContext) +{ + PVCB pVcb; + PVFATFCB pFcb; + PIO_STACK_LOCATION Stack; + Stack = (*IrpContext)->Stack; + pVcb = (*IrpContext)->DeviceExt; + pFcb = (PVFATFCB) (*IrpContext)->FileObject->FsContext; + + FsRtlNotifyFullChangeDirectory(pVcb->NotifySync, + &(pVcb->NotifyList), + (*IrpContext)->FileObject->FsContext2, + (PSTRING)&(pFcb->PathNameU), + BooleanFlagOn(Stack->Flags, SL_WATCH_TREE), + FALSE, + Stack->Parameters.NotifyDirectory.CompletionFilter, + (*IrpContext)->Irp, + NULL, + NULL); + + /* We don't need the IRP context as we won't handle IRP completion */ + VfatFreeIrpContext(*IrpContext); + *IrpContext = NULL; + + return STATUS_PENDING; +} /* * FUNCTION: directory control : read/write directory informations @@ -603,8 +629,7 @@ VfatDirectoryControl( break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - DPRINT("VFAT, dir : change\n"); - Status = STATUS_NOT_IMPLEMENTED; + Status = VfatNotifyChangeDirectory(&IrpContext); break; default: @@ -617,7 +642,11 @@ VfatDirectoryControl( if (Status == STATUS_PENDING) { - Status = VfatQueueRequest(IrpContext); + /* Only queue if there's IRP context */ + if (IrpContext) + { + Status = VfatQueueRequest(IrpContext); + } } else {