[FASTFAT]

Set clean shutdown bit on dismount

svn path=/trunk/; revision=65501
This commit is contained in:
Pierre Schweitzer 2014-11-27 06:16:21 +00:00
parent 9cfe36c5ca
commit 267881ff71

View file

@ -925,6 +925,8 @@ VfatDismountVolume(
PLIST_ENTRY NextEntry;
PVFATFCB Fcb;
PFILE_OBJECT FileObject;
ULONG eocMark;
NTSTATUS Status;
DPRINT("VfatDismountVolume(%p)\n", IrpContext);
@ -950,6 +952,18 @@ VfatDismountVolume(
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);