From b3fd4ef2f0e143e67e214a631996ef3c149c9795 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Thu, 30 Oct 2014 21:12:38 +0000 Subject: [PATCH] [VFATLIB] When we're done with formatting, attempt to umount the volume, so that it can be remounted properly by FastFAT. svn path=/trunk/; revision=65130 --- reactos/lib/fslib/vfatlib/vfatlib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/reactos/lib/fslib/vfatlib/vfatlib.c b/reactos/lib/fslib/vfatlib/vfatlib.c index 804cd0a2025..09f00c3419f 100644 --- a/reactos/lib/fslib/vfatlib/vfatlib.c +++ b/reactos/lib/fslib/vfatlib/vfatlib.c @@ -251,6 +251,23 @@ VfatFormat(IN PUNICODE_STRING DriveRoot, Status = STATUS_INVALID_PARAMETER; } + /* Attempt to dismount formatted volume */ + LockStatus = NtFsControlFile(FileHandle, + NULL, + NULL, + NULL, + &Iosb, + FSCTL_DISMOUNT_VOLUME, + NULL, + 0, + NULL, + 0); + if (!NT_SUCCESS(LockStatus)) + { + DPRINT1("Failed to umount volume (Status: 0x%x)\n", LockStatus); + } + + LockStatus = NtFsControlFile(FileHandle, NULL, NULL, -- 2.17.1