VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 4afeb174..d26564fc 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -7837,41 +7837,41 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
if (KeyFilesEnable)
{
KeyFilesApply (hwndDlg, &volumePassword, FirstKeyFile, NULL);
}
if (!bInPlaceEncNonSys)
{
/* Mount the volume which is to host the new hidden volume as read only */
if (hiddenVolHostDriveNo >= 0) // If the hidden volume host is currently mounted (e.g. after previous unsuccessful dismount attempt)
{
BOOL tmp_result;
// Dismount the hidden volume host (in order to remount it as read-only subsequently)
while (!(tmp_result = UnmountVolume (hwndDlg, hiddenVolHostDriveNo, TRUE)))
{
- if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
+ if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
{
// Cancel
NormalCursor();
return 1;
}
}
if (tmp_result) // If dismounted
hiddenVolHostDriveNo = -1;
}
if (hiddenVolHostDriveNo < 0) // If the hidden volume host is not mounted
{
int retCode;
// Mount the hidden volume host as read-only (to ensure consistent and secure
// results of the volume bitmap scanning)
switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, volumePim, TRUE))
{
case ERR_NO_FREE_DRIVES:
NormalCursor ();
@@ -7915,41 +7915,41 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
case 1:
// Determine the maximum possible size of the hidden volume
if (DetermineMaxHiddenVolSize (hwndDlg) < 1)
{
// Non-fatal error while determining maximum possible size of the hidden volume
NormalCursor();
return 1;
}
else
{
BOOL tmp_result;
/* Maximum possible size of the hidden volume successfully determined */
// Dismount the hidden volume host
while (!(tmp_result = UnmountVolume (hwndDlg, hiddenVolHostDriveNo, TRUE)))
{
- if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
+ if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
{
// Cancel
NormalCursor();
return 1;
}
}
if (tmp_result) // If dismounted
{
hiddenVolHostDriveNo = -1;
bHiddenVolHost = FALSE;
bHiddenVolFinished = FALSE;
// save the outer volume password to use it for comparison with hidden volume one
memcpy (&outerVolumePassword, &volumePassword, sizeof (volumePassword));
outerVolumePim = volumePim;
// Clear the outer volume password
WipePasswordsAndKeyfiles (false);
@@ -8006,41 +8006,41 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
NormalCursor();
}
else
{
/* Try to mount the non-system volume to decrypt in place (the process has not started yet, we are NOT trying to resume it).
We will try to mount it using the backup header, which we require to work (i.e. be non-damaged) before we start writing
to the volume (the primary header will be overwritten by decrypted data soon after the decryption process begins, so the
backup header will contain the only copy of the master key). */
int driveNo = -1;
// The volume may already be mounted. We need to dismount it first in order to verify the supplied password/keyfile(s) is/are correct.
if (IsMountedVolume (szFileName))
{
driveNo = GetMountedVolumeDriveNo (szFileName);
if (driveNo == -1
|| !UnmountVolume (hwndDlg, driveNo, TRUE))
{
handleWin32Error (MainDlg, SRC_POS);
- AbortProcess ("CANT_DISMOUNT_VOLUME");
+ AbortProcess ("CANT_UNMOUNT_VOLUME");
}
}
driveNo = GetLastAvailableDrive ();
if (driveNo < 0)
AbortProcess ("NO_FREE_DRIVES");
MountOptions mountOptions;
ZeroMemory (&mountOptions, sizeof (mountOptions));
mountOptions.UseBackupHeader = FALSE; // This must be FALSE at this point because otherwise we wouldn't be able to detect a legacy volume
mountOptions.ReadOnly = TRUE;
mountOptions.Removable = ConfigReadInt ("MountVolumesRemovable", FALSE);
// Check that it is not a hidden or legacy volume
if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, volumePim, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
{
NormalCursor();
@@ -8061,55 +8061,55 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (volProp.volFormatVersion == TC_VOLUME_FORMAT_VERSION_PRE_6_0)
{
UnmountVolume (hwndDlg, driveNo, TRUE);
AbortProcess ("NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT");
}
if (volProp.hiddenVolume)
{
UnmountVolume (hwndDlg, driveNo, TRUE);
AbortProcess ("NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL");
}
}
// Remount the volume using the backup header to verify it is working
if (!UnmountVolume (hwndDlg, driveNo, TRUE))
{
handleWin32Error (MainDlg, SRC_POS);
- AbortProcess ("CANT_DISMOUNT_VOLUME");
+ AbortProcess ("CANT_UNMOUNT_VOLUME");
}
mountOptions.UseBackupHeader = TRUE; // This must be TRUE at this point (we won't be using the regular header, which will be lost soon after the decryption process starts)
if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, volumePim, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
{
NormalCursor();
return 1;
}
if (!UnmountVolume (hwndDlg, driveNo, TRUE))
{
handleWin32Error (MainDlg, SRC_POS);
- AbortProcess ("CANT_DISMOUNT_VOLUME");
+ AbortProcess ("CANT_UNMOUNT_VOLUME");
}
BOOL tmpbDevice;
CreateFullVolumePath (szDiskFile, sizeof(szDiskFile), szFileName, &tmpbDevice);
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
handleWin32Error (MainDlg, SRC_POS);
AbortProcessSilent ();
}
nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
NormalCursor();
}
}
else if (nCurPageNo == FILESYS_PAGE)
{
@@ -8698,41 +8698,41 @@ retryCDDriveCheck:
SetWindowTextW (GetDlgItem (MainDlg, IDCANCEL), GetString ("CANCEL"));
bHiddenVolFinished = FALSE;
WipePasswordsAndKeyfiles (true);
return 1;
}
else
{
/* We're going to scan the bitmap of the hidden volume host (in the non-Direct hidden volume wizard mode) */
int retCode;
WaitCursor ();
if (hiddenVolHostDriveNo != -1) // If the hidden volume host is mounted
{
BOOL tmp_result;
// Dismount the hidden volume host (in order to remount it as read-only subsequently)
CloseVolumeExplorerWindows (hwndDlg, hiddenVolHostDriveNo);
while (!(tmp_result = UnmountVolume (hwndDlg, hiddenVolHostDriveNo, TRUE)))
{
- if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL | MB_ICONERROR | MB_SETFOREGROUND) != IDRETRY)
+ if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL | MB_ICONERROR | MB_SETFOREGROUND) != IDRETRY)
{
// Cancel
NormalCursor();
return 1;
}
}
if (tmp_result) // If dismounted
hiddenVolHostDriveNo = -1;
}
if (hiddenVolHostDriveNo < 0) // If the hidden volume host is not mounted
{
// Remount the hidden volume host as read-only (to ensure consistent and secure
// results of the volume bitmap scanning)
switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, volumePim, TRUE))
{
case ERR_NO_FREE_DRIVES:
MessageBoxW (hwndDlg, GetString ("NO_FREE_DRIVE_FOR_OUTER_VOL"), lpszTitle, ICON_HAND);
NormalCursor ();
return 1;
@@ -8767,41 +8767,41 @@ retryCDDriveCheck:
case 0: // Unsupported file system (or other non-fatal error which has already been reported)
NormalCursor ();
return 1;
case 1: // Success
{
BOOL tmp_result;
// Determine the maximum possible size of the hidden volume
if (DetermineMaxHiddenVolSize (hwndDlg) < 1)
{
NormalCursor ();
goto ovf_end;
}
/* Maximum possible size of the hidden volume successfully determined */
// Dismount the hidden volume host
while (!(tmp_result = UnmountVolume (hwndDlg, hiddenVolHostDriveNo, TRUE)))
{
- if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
+ if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY)
{
// Cancel
NormalCursor ();
goto ovf_end;
}
}
// Prevent having to recreate the outer volume due to inadvertent exit
bConfirmQuit = TRUE;
hiddenVolHostDriveNo = -1;
nNewPageNo = HIDDEN_VOL_HOST_PRE_CIPHER_PAGE;
// save the outer volume password to use it for comparison with hidden volume one
memcpy (&outerVolumePassword, &volumePassword, sizeof (volumePassword));
outerVolumePim = volumePim;
// Clear the outer volume password
WipePasswordsAndKeyfiles (false);