Author: pschweitzer
Date: Thu Nov 27 06:16:21 2014
New Revision: 65501
URL:
http://svn.reactos.org/svn/reactos?rev=65501&view=rev
Log:
[FASTFAT]
Set clean shutdown bit on dismount
Modified:
trunk/reactos/drivers/filesystems/fastfat/fsctl.c
Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Thu Nov 27 06:16:21
2014
@@ -925,6 +925,8 @@
PLIST_ENTRY NextEntry;
PVFATFCB Fcb;
PFILE_OBJECT FileObject;
+ ULONG eocMark;
+ NTSTATUS Status;
DPRINT("VfatDismountVolume(%p)\n", IrpContext);
@@ -950,6 +952,18 @@
ExAcquireResourceExclusiveLite(&DeviceExt->FatResource, TRUE);
+ if (DeviceExt->VolumeFcb->Flags & VCB_CLEAR_DIRTY)
+ {
+ /* Set clean shutdown bit */
+ Status = GetNextCluster(DeviceExt, 1, &eocMark);
+ if (NT_SUCCESS(Status))
+ {
+ eocMark |= DeviceExt->CleanShutBitMask;
+ if (NT_SUCCESS(WriteCluster(DeviceExt, 1, eocMark)))
+ DeviceExt->VolumeFcb->Flags &= ~VCB_IS_DIRTY;
+ }
+ }
+
/* Flush volume & files */
VfatFlushVolume(DeviceExt, (PVFATFCB)FileObject->FsContext);