VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-02 02:17:58 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-02 02:21:25 +0200
commit002a9a29a715a06bac91fb2b4f08295b33c2518c (patch)
treeef4e74746ae1352d3e9ca6b1919cfca5d18f2d7f /src/Common
parent28c51228f84e607ecf87a882fc4fd0cc0fcaf9d9 (diff)
downloadVeraCrypt-002a9a29a715a06bac91fb2b4f08295b33c2518c.tar.gz
VeraCrypt-002a9a29a715a06bac91fb2b4f08295b33c2518c.zip
Windows: Use native Windows format program first to perform formatting since it is more reliable and only fallback to FormatEx function from fmifs.dll in case of issue.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Format.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Common/Format.c b/src/Common/Format.c
index d1aa653c..f691c78d 100644
--- a/src/Common/Format.c
+++ b/src/Common/Format.c
@@ -778,16 +778,15 @@ error:
nStatus = ERR_VOL_MOUNT_FAILED;
goto fv_end;
}
-
- if (!Silent && !IsAdmin () && IsUacSupported ())
- retCode = UacFormatFs (volParams->hwndDlg, driveNo, volParams->clusterSize, fsType);
- else
- retCode = FormatFs (driveNo, volParams->clusterSize, fsType);
+ retCode = ExternalFormatFs (driveNo, volParams->clusterSize, fsType);
if (retCode != TRUE)
{
- /* fallback to calling Windows native formatting tool */
- retCode = ExternalFormatFs (driveNo, volParams->clusterSize, fsType);
+ /* fallback to using FormatEx function from fmifs.dll */
+ if (!Silent && !IsAdmin () && IsUacSupported ())
+ retCode = UacFormatFs (volParams->hwndDlg, driveNo, volParams->clusterSize, fsType);
+ else
+ retCode = FormatFs (driveNo, volParams->clusterSize, fsType);
}
if (retCode != TRUE)