VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-04-26 18:36:43 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-04-27 23:59:53 +0200
commiteac440ae9e9d313712bef01fcd7e70ff255e0eea (patch)
tree770b079f808ec3b94d871a846fc55413f721cb7d /src
parentdc3bc64b8685aeec3ab461e632a1604833ed6fd6 (diff)
downloadVeraCrypt-eac440ae9e9d313712bef01fcd7e70ff255e0eea.tar.gz
VeraCrypt-eac440ae9e9d313712bef01fcd7e70ff255e0eea.zip
Windows: Support A: and B: as driver letters for mounting volumes.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c4
-rw-r--r--src/ExpandVolume/WinMain.cpp2
-rw-r--r--src/Mount/Mount.c14
3 files changed, 10 insertions, 10 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 94b1fc05..b96891c3 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6071,9 +6071,9 @@ int GetFirstAvailableDrive ()
{
DWORD dwUsedDrives = GetLogicalDrives();
int i;
- for (i = 3; i < 26; i++)
+ for (i = 0; i < 26; i++)
{
if (!(dwUsedDrives & 1 << i))
return i;
}
@@ -6086,9 +6086,9 @@ int GetLastAvailableDrive ()
{
DWORD dwUsedDrives = GetLogicalDrives();
int i;
- for (i = 25; i > 2; i--)
+ for (i = 25; i >= 0; i--)
{
if (!(dwUsedDrives & 1 << i))
return i;
}
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index f107c98f..19c5abe7 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -133,9 +133,9 @@ int HiddenSysLeakProtectionNotificationStatus = TC_HIDDEN_OS_READ_ONLY_NOTIF_MOD
int MaxVolumeIdleTime = -120;
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
int nSelectedDriveIndex = -1; /* Item number of selected drive */
-int cmdUnmountDrive = 0; /* Volume drive letter to unmount (-1 = all) */
+int cmdUnmountDrive = -2; /* Volume drive letter to unmount (-1 = all) */
Password VolumePassword; /* Password used for mounting volumes */
Password CmdVolumePassword; /* Password passed from command line */
BOOL CmdVolumePasswordValid = FALSE;
MountOptions mountOptions;
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 95457b75..0aafbf60 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -119,9 +119,9 @@ int HiddenSysLeakProtectionNotificationStatus = TC_HIDDEN_OS_READ_ONLY_NOTIF_MOD
int MaxVolumeIdleTime = -120;
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
int nSelectedDriveIndex = -1; /* Item number of selected drive */
-int cmdUnmountDrive = 0; /* Volume drive letter to unmount (-1 = all) */
+int cmdUnmountDrive = -2; /* Volume drive letter to unmount (-1 = all) */
Password VolumePassword; /* Password used for mounting volumes */
Password CmdVolumePassword; /* Password passed from command line */
int VolumePkcs5 = 0;
int CmdVolumePkcs5 = 0;
@@ -1254,9 +1254,9 @@ void LoadDriveLetters (HWND hwndDlg, HWND hTree, int drive)
}
/* Drive letters */
- for (i = 2; i < 26; i++)
+ for (i = 0; i < 26; i++)
{
int curDrive = 0;
BOOL bSysEncPartition = (bSysEnc && !bWholeSysDriveEncryption && sysDriveLetter == *((char *) szDriveLetters[i]));
@@ -3925,9 +3925,9 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo)
{
BOOL status = FALSE;
WaitCursor ();
- if (nDosDriveNo == 0)
+ if (nDosDriveNo == -2)
nDosDriveNo = (char) (HIWORD (GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST))) - 'A');
if (bCloseDismountedWindows)
{
@@ -5321,9 +5321,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
// Dismount
- if (cmdUnmountDrive > 0)
+ if (cmdUnmountDrive >= 0)
{
MOUNT_LIST_STRUCT mountList;
DWORD bytesReturned;
@@ -6149,9 +6149,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
break;
case IDM_UNMOUNT_VOLUME:
if (CheckMountList (hwndDlg, FALSE))
- Dismount (hwndDlg, 0);
+ Dismount (hwndDlg, -2);
break;
case IDPM_OPEN_VOLUME:
{
@@ -6237,9 +6237,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
if (CheckMountList (hwndDlg, FALSE))
- Dismount (hwndDlg, 0);
+ Dismount (hwndDlg, -2);
return 1;
}
if ((lw == IDOK || lw == IDM_MOUNT_VOLUME || lw == IDM_MOUNT_VOLUME_OPTIONS || lw == IDC_MOUNTALL || lw == IDM_MOUNTALL)
@@ -7261,9 +7261,9 @@ void ExtractCommandLine (HWND hwndDlg, char *lpszCommandLine)
)
{
commandLineDrive = *szDriveLetter = (char) toupper (*szDriveLetter);
- if (commandLineDrive < 'C' || commandLineDrive > 'Z')
+ if (commandLineDrive < 'A' || commandLineDrive > 'Z')
AbortProcess ("BAD_DRIVE_LETTER");
}
else
AbortProcess ("BAD_DRIVE_LETTER");