1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: workaround FormatEx keeping references on formatted volume by adding extra delays.

This commit is contained in:
Mounir IDRASSI
2015-05-29 02:04:13 +02:00
parent 5867250820
commit fdc2143bfa
3 changed files with 18 additions and 7 deletions

View File

@@ -641,7 +641,7 @@ error:
if (retCode != TRUE)
{
if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
if (!UnmountVolumeAfterFormatExCall (volParams->hwndDlg, driveNo))
MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
if (dataAreaSize <= TC_MAX_FAT_SECTOR_COUNT * FormatSectorSize)
@@ -663,7 +663,7 @@ error:
goto fv_end;
}
if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
if (!UnmountVolumeAfterFormatExCall (volParams->hwndDlg, driveNo))
MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
}
@@ -836,7 +836,7 @@ BOOL FormatNtfs (int driveNo, int clusterSize)
}
// The device may be referenced for some time after FormatEx() returns
Sleep (2000);
Sleep (4000);
FreeLibrary (hModule);
return FormatExResult;