Author: pschweitzer
Date: Fri Jun 27 13:03:32 2008
New Revision: 34139
URL:
http://svn.reactos.org/svn/reactos?rev=34139&view=rev
Log:
Implemented directory changes notifications (IRP_MN_NOTIFY_CHANGE_DIRECTORY) but commented
it out because of missing features in ntoskrnl.exe
Modified:
branches/pierre-fsd/drivers/filesystems/fastfat/dir.c
branches/pierre-fsd/drivers/filesystems/fastfat/vfat.h
Modified: branches/pierre-fsd/drivers/filesystems/fastfat/dir.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/fastfat/dir.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/fastfat/dir.c [iso-8859-1] Fri Jun 27 13:03:32
2008
@@ -471,6 +471,53 @@
return RC;
}
+static NTSTATUS NotifyChange (PVFAT_IRP_CONTEXT IrpContext) //bug 2821
+{
+ PIRP pIrp;
+ PVFATCCB pCcb;
+ PVFATFCB pFcb;
+ PDEVICE_EXTENSION pVcb;
+ BOOLEAN WatchTree = FALSE;
+ ULONG CompletionFilter = 0;
+ BOOLEAN PostRequest = FALSE;
+ NTSTATUS RC = STATUS_SUCCESS;
+
+ PIO_STACK_LOCATION Stack = IrpContext->Stack;
+
+ pIrp = (PIRP) IrpContext->Irp;
+ pFcb = (PVFATFCB) IrpContext->FileObject->FsContext;
+ pCcb = (PVFATCCB) IrpContext->FileObject->FsContext2;
+ pVcb = (PDEVICE_EXTENSION) IrpContext->DeviceExt;
+
+ if (!ExAcquireResourceSharedLite(&pFcb->MainResource,
+ (BOOLEAN)(IrpContext->Flags &
IRPCONTEXT_CANWAIT)))
+ {
+ PostRequest = TRUE;
+ }
+
+ if (!PostRequest)
+ {
+ CompletionFilter = Stack->Parameters.NotifyDirectory.CompletionFilter;
+ WatchTree = (Stack->Flags & SL_WATCH_TREE ? TRUE : FALSE);
+
+ FsRtlNotifyFullChangeDirectory(pVcb->NotifySync, &(pVcb->NotifyList),
pCcb,
+ (PSTRING)&(pFcb->LongNameU), WatchTree, FALSE,
+ CompletionFilter, pIrp, NULL, NULL);
+ }
+
+ if (PostRequest)
+ {
+ VfatQueueRequest(IrpContext);
+ }
+ else
+ {
+ VfatFreeIrpContext(IrpContext);
+ ExReleaseResourceLite(&pFcb->MainResource);
+ }
+
+ return RC;
+}
+
NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT IrpContext)
/*
@@ -486,8 +533,12 @@
RC = DoQuery (IrpContext);
break;
case IRP_MN_NOTIFY_CHANGE_DIRECTORY:
+#if 0
+ RC = NotifyChange (IrpContext);
+#else
DPRINT (" vfat, dir : change\n");
RC = STATUS_NOT_IMPLEMENTED;
+#endif
break;
default:
// error
@@ -496,17 +547,21 @@
RC = STATUS_INVALID_DEVICE_REQUEST;
break;
}
- if (RC == STATUS_PENDING)
- {
- RC = VfatQueueRequest(IrpContext);
- }
- else
- {
- IrpContext->Irp->IoStatus.Status = RC;
- IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT);
- VfatFreeIrpContext(IrpContext);
+ if (IrpContext)
+ {
+ if (RC == STATUS_PENDING)
+ {
+ RC = VfatQueueRequest(IrpContext);
+ }
+ else
+ {
+ IrpContext->Irp->IoStatus.Status = RC;
+ IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT);
+ VfatFreeIrpContext(IrpContext);
+ }
}
return RC;
}
+
Modified: branches/pierre-fsd/drivers/filesystems/fastfat/vfat.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Fri Jun 27
13:03:32 2008
@@ -289,6 +289,10 @@
/* Pointers to functions for manipulating directory entries. */
PGET_NEXT_DIR_ENTRY GetNextDirEntry;
+ /* Fields used for IRP_MN_NOTIFY_CHANGE_DIRECTORY */
+ PNOTIFY_SYNC NotifySync;
+ LIST_ENTRY NotifyList;
+
ULONG BaseDateYear;
LIST_ENTRY VolumeListEntry;