mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 12:23:28 +00:00
[CDFS]
Allow registering notifications. None implemented yet. svn path=/trunk/; revision=62780
This commit is contained in:
@@ -160,6 +160,10 @@ typedef struct
|
||||
PFILE_OBJECT StreamFileObject;
|
||||
|
||||
CDINFO CdInfo;
|
||||
|
||||
/* Notifications */
|
||||
LIST_ENTRY NotifyList;
|
||||
PNOTIFY_SYNC NotifySync;
|
||||
} DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB;
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -429,6 +429,9 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
|
||||
KeInitializeSpinLock(&DeviceExt->FcbListLock);
|
||||
InitializeListHead(&DeviceExt->FcbListHead);
|
||||
|
||||
FsRtlNotifyInitializeSync(&DeviceExt->NotifySync);
|
||||
InitializeListHead(&DeviceExt->NotifyList);
|
||||
|
||||
Status = STATUS_SUCCESS;
|
||||
|
||||
ByeBye:
|
||||
|
||||
Reference in New Issue
Block a user