Index: cleanup.c =================================================================== --- reactos/drivers/filesystems/fastfat/cleanup.c (revision 74045) +++ reactos/drivers/filesystems/fastfat/cleanup.c (working copy) @@ -24,6 +24,7 @@ PVFAT_IRP_CONTEXT IrpContext) { PVFATFCB pFcb; + PVFATCCB pCcb; PDEVICE_EXTENSION DeviceExt = IrpContext->DeviceExt; PFILE_OBJECT FileObject = IrpContext->FileObject; @@ -58,6 +59,12 @@ return STATUS_PENDING; } + pCcb = FileObject->FsContext2; + if (pCcb->Flags & CCB_DELETE_ON_CLOSE) + { + pFcb->Flags |= FCB_DELETE_PENDING; + } + /* Notify about the cleanup */ FsRtlNotifyCleanup(IrpContext->DeviceExt->NotifySync, &(IrpContext->DeviceExt->NotifyList), Index: create.c =================================================================== --- reactos/drivers/filesystems/fastfat/create.c (revision 74045) +++ reactos/drivers/filesystems/fastfat/create.c (working copy) @@ -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++; } @@ -906,6 +913,12 @@ &pFcb->FCBShareAccess); } + pCcb = FileObject->FsContext2; + if (RequestedOptions & FILE_DELETE_ON_CLOSE) + { + pCcb->Flags |= CCB_DELETE_ON_CLOSE; + } + if (Irp->IoStatus.Information == FILE_CREATED) { FsRtlNotifyFullReportChange(DeviceExt->NotifySync, Index: vfat.h =================================================================== --- reactos/drivers/filesystems/fastfat/vfat.h (revision 74045) +++ reactos/drivers/filesystems/fastfat/vfat.h (working copy) @@ -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 */ Index: kmt_test.h =================================================================== --- rostests/kmtests/include/kmt_test.h (revision 74432) +++ rostests/kmtests/include/kmt_test.h (working copy) @@ -281,6 +281,7 @@ } while (InterlockedCompareExchange(&Buffer->LogBufferLength, NewLength, OldLength) != OldLength); memcpy(&Buffer->LogBuffer[OldLength], String, Length); + DbgPrint("KMTEST: %.*s", (int)Length, String); } KMT_FORMAT(ms_printf, 5, 0)