Author: pschweitzer
Date: Fri Apr 18 21:49:12 2014
New Revision: 62780
URL:
http://svn.reactos.org/svn/reactos?rev=62780&view=rev
Log:
[CDFS]
Allow registering notifications.
None implemented yet.
Modified:
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/cleanup.c
trunk/reactos/drivers/filesystems/cdfs/dirctl.c
trunk/reactos/drivers/filesystems/cdfs/fsctl.c
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Fri Apr 18 21:49:12 2014
@@ -160,6 +160,10 @@
PFILE_OBJECT StreamFileObject;
CDINFO CdInfo;
+
+ /* Notifications */
+ LIST_ENTRY NotifyList;
+ PNOTIFY_SYNC NotifySync;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB;
Modified: trunk/reactos/drivers/filesystems/cdfs/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] Fri Apr 18 21:49:12
2014
@@ -46,6 +46,10 @@
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)
Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Fri Apr 18 21:49:12 2014
@@ -752,6 +752,40 @@
}
+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 @@
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 @@
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);
Modified: trunk/reactos/drivers/filesystems/cdfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] Fri Apr 18 21:49:12 2014
@@ -429,6 +429,9 @@
KeInitializeSpinLock(&DeviceExt->FcbListLock);
InitializeListHead(&DeviceExt->FcbListHead);
+ FsRtlNotifyInitializeSync(&DeviceExt->NotifySync);
+ InitializeListHead(&DeviceExt->NotifyList);
+
Status = STATUS_SUCCESS;
ByeBye: