mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:45:41 +00:00
[CDFS]
Allow registering notifications. None implemented yet. svn path=/trunk/; revision=62780
This commit is contained in:
parent
81f368964f
commit
8b86c3ee99
4 changed files with 51 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue