mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-05-23 13:01:33 +00:00
Windows: workaround FormatEx keeping references on formatted volume by adding extra delays.
This commit is contained in:
@@ -6889,12 +6889,12 @@ retry:
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
BOOL UnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forceUnmount)
|
||||
static BOOL UnmountVolumeBase (HWND hwndDlg, int nDosDriveNo, BOOL forceUnmount, BOOL ntfsFormatCase)
|
||||
{
|
||||
int result;
|
||||
BOOL forced = forceUnmount;
|
||||
int dismountMaxRetries = UNMOUNT_MAX_AUTO_RETRIES;
|
||||
int dismountMaxRetries = ntfsFormatCase? 5 : UNMOUNT_MAX_AUTO_RETRIES;
|
||||
DWORD retryDelay = ntfsFormatCase? 2000: UNMOUNT_AUTO_RETRY_DELAY;
|
||||
|
||||
retry:
|
||||
BroadcastDeviceChange (DBT_DEVICEREMOVEPENDING, nDosDriveNo, 0);
|
||||
@@ -6904,7 +6904,7 @@ retry:
|
||||
result = DriverUnmountVolume (hwndDlg, nDosDriveNo, forced);
|
||||
|
||||
if (result == ERR_FILES_OPEN)
|
||||
Sleep (UNMOUNT_AUTO_RETRY_DELAY);
|
||||
Sleep (retryDelay);
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -6940,6 +6940,16 @@ retry:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL UnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forceUnmount)
|
||||
{
|
||||
return UnmountVolumeBase (hwndDlg, nDosDriveNo, forceUnmount, FALSE);
|
||||
}
|
||||
|
||||
BOOL UnmountVolumeAfterFormatExCall (HWND hwndDlg, int nDosDriveNo)
|
||||
{
|
||||
return UnmountVolumeBase (hwndDlg, nDosDriveNo, FALSE, TRUE);
|
||||
}
|
||||
|
||||
|
||||
BOOL IsPasswordCacheEmpty (void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user