diff --git a/reactos/drivers/filesystems/cdfs/cdfs.h b/reactos/drivers/filesystems/cdfs/cdfs.h index 78c9b57e387..dd281f027f7 100644 --- a/reactos/drivers/filesystems/cdfs/cdfs.h +++ b/reactos/drivers/filesystems/cdfs/cdfs.h @@ -160,6 +160,10 @@ typedef struct PFILE_OBJECT StreamFileObject; CDINFO CdInfo; + + /* Notifications */ + LIST_ENTRY NotifyList; + PNOTIFY_SYNC NotifySync; } DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB; diff --git a/reactos/drivers/filesystems/cdfs/cleanup.c b/reactos/drivers/filesystems/cdfs/cleanup.c index ee494d181a0..19d866de6fd 100644 --- a/reactos/drivers/filesystems/cdfs/cleanup.c +++ b/reactos/drivers/filesystems/cdfs/cleanup.c @@ -46,6 +46,10 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt, DeviceExt, FileObject); + /* Notify about the cleanup */ + FsRtlNotifyCleanup(DeviceExt->NotifySync, + &(DeviceExt->NotifyList), + FileObject->FsContext2); /* Uninitialize file cache if initialized for this file object. */ if (FileObject->SectionObjectPointer && FileObject->SectionObjectPointer->SharedCacheMap) diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index 652ca111bc0..ed6e5c9c2fd 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -752,6 +752,40 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, } +static NTSTATUS +CdfsNotifyChangeDirectory(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PDEVICE_EXTENSION DeviceExtension; + PFCB Fcb; + PCCB Ccb; + PIO_STACK_LOCATION Stack; + PFILE_OBJECT FileObject; + + DPRINT("CdfsNotifyChangeDirectory() called\n"); + + DeviceExtension = DeviceObject->DeviceExtension; + Stack = IoGetCurrentIrpStackLocation(Irp); + FileObject = Stack->FileObject; + + Ccb = (PCCB)FileObject->FsContext2; + Fcb = (PFCB)FileObject->FsContext; + + FsRtlNotifyFullChangeDirectory(DeviceExtension->NotifySync, + &(DeviceExtension->NotifyList), + Ccb, + (PSTRING)&(Fcb->PathName), + BooleanFlagOn(Stack->Flags, SL_WATCH_TREE), + FALSE, + Stack->Parameters.NotifyDirectory.CompletionFilter, + Irp, + NULL, + NULL); + + return STATUS_PENDING; +} + + NTSTATUS NTAPI CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -772,8 +806,8 @@ CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n"); - Status = STATUS_NOT_IMPLEMENTED; + Status = CdfsNotifyChangeDirectory(DeviceObject, + Irp); break; default: @@ -785,7 +819,10 @@ CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, Irp->IoStatus.Status = Status; Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + if (Status != STATUS_PENDING) + { + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } FsRtlExitFileSystem(); return(Status); diff --git a/reactos/drivers/filesystems/cdfs/fsctl.c b/reactos/drivers/filesystems/cdfs/fsctl.c index c4920b4533b..8504b0f8c22 100644 --- a/reactos/drivers/filesystems/cdfs/fsctl.c +++ b/reactos/drivers/filesystems/cdfs/fsctl.c @@ -429,6 +429,9 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject, KeInitializeSpinLock(&DeviceExt->FcbListLock); InitializeListHead(&DeviceExt->FcbListHead); + FsRtlNotifyInitializeSync(&DeviceExt->NotifySync); + InitializeListHead(&DeviceExt->NotifyList); + Status = STATUS_SUCCESS; ByeBye: