Author: tfaber
Date: Tue May 2 19:33:14 2017
New Revision: 74450
URL:
http://svn.reactos.org/svn/reactos?rev=74450&view=rev
Log:
[FASTFAT]
- Add support for FILE_DELETE_ON_CLOSE
CORE-6931 #resolve
Modified:
trunk/reactos/drivers/filesystems/fastfat/cleanup.c
trunk/reactos/drivers/filesystems/fastfat/create.c
trunk/reactos/drivers/filesystems/fastfat/vfat.h
Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] Tue May 2 19:33:14
2017
@@ -24,6 +24,7 @@
PVFAT_IRP_CONTEXT IrpContext)
{
PVFATFCB pFcb;
+ PVFATCCB pCcb;
PDEVICE_EXTENSION DeviceExt = IrpContext->DeviceExt;
PFILE_OBJECT FileObject = IrpContext->FileObject;
@@ -56,6 +57,12 @@
{
ExReleaseResourceLite(&pFcb->MainResource);
return STATUS_PENDING;
+ }
+
+ pCcb = FileObject->FsContext2;
+ if (BooleanFlagOn(pCcb->Flags, CCB_DELETE_ON_CLOSE))
+ {
+ pFcb->Flags |= FCB_DELETE_PENDING;
}
/* Notify about the cleanup */
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Tue May 2 19:33:14
2017
@@ -394,6 +394,7 @@
ULONG RequestedDisposition, RequestedOptions;
PVFATFCB pFcb = NULL;
PVFATFCB ParentFcb = NULL;
+ PVFATCCB pCcb = NULL;
PWCHAR c, last;
BOOLEAN PagingFileCreate;
BOOLEAN Dots;
@@ -657,6 +658,12 @@
}
}
+ pCcb = FileObject->FsContext2;
+ if (BooleanFlagOn(RequestedOptions, FILE_DELETE_ON_CLOSE))
+ {
+ pCcb->Flags |= CCB_DELETE_ON_CLOSE;
+ }
+
pFcb->OpenHandleCount++;
DeviceExt->OpenHandleCount++;
}
@@ -904,6 +911,12 @@
{
IoUpdateShareAccess(FileObject,
&pFcb->FCBShareAccess);
+ }
+
+ pCcb = FileObject->FsContext2;
+ if (BooleanFlagOn(RequestedOptions, FILE_DELETE_ON_CLOSE))
+ {
+ pCcb->Flags |= CCB_DELETE_ON_CLOSE;
}
if (Irp->IoStatus.Information == FILE_CREATED)
Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Tue May 2 19:33:14
2017
@@ -486,9 +486,12 @@
ULONG LastOffset;
} VFATFCB, *PVFATFCB;
+#define CCB_DELETE_ON_CLOSE 0x0001
+
typedef struct _VFATCCB
{
LARGE_INTEGER CurrentByteOffset;
+ ULONG Flags;
/* for DirectoryControl */
ULONG Entry;
/* for DirectoryControl */