mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[FASTFAT]
Set clean shutdown bit on dismount svn path=/trunk/; revision=65501
This commit is contained in:
parent
9cfe36c5ca
commit
267881ff71
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue