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.

This commit is contained in:
Mounir IDRASSI 2020-07-02 02:17:58 +02:00
parent 28c51228f8
commit 002a9a29a7
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F

View File

@ -778,16 +778,15 @@ int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams)
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)