mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Support A: and B: as driver letters for mounting volumes.
This commit is contained in:
@@ -6072,7 +6072,7 @@ int GetFirstAvailableDrive ()
|
|||||||
DWORD dwUsedDrives = GetLogicalDrives();
|
DWORD dwUsedDrives = GetLogicalDrives();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 3; i < 26; i++)
|
for (i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
if (!(dwUsedDrives & 1 << i))
|
if (!(dwUsedDrives & 1 << i))
|
||||||
return i;
|
return i;
|
||||||
@@ -6087,7 +6087,7 @@ int GetLastAvailableDrive ()
|
|||||||
DWORD dwUsedDrives = GetLogicalDrives();
|
DWORD dwUsedDrives = GetLogicalDrives();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 25; i > 2; i--)
|
for (i = 25; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (!(dwUsedDrives & 1 << i))
|
if (!(dwUsedDrives & 1 << i))
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ int MaxVolumeIdleTime = -120;
|
|||||||
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
|
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
|
||||||
int nSelectedDriveIndex = -1; /* Item number of selected drive */
|
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 VolumePassword; /* Password used for mounting volumes */
|
||||||
Password CmdVolumePassword; /* Password passed from command line */
|
Password CmdVolumePassword; /* Password passed from command line */
|
||||||
BOOL CmdVolumePasswordValid = FALSE;
|
BOOL CmdVolumePasswordValid = FALSE;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ int MaxVolumeIdleTime = -120;
|
|||||||
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
|
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
|
||||||
int nSelectedDriveIndex = -1; /* Item number of selected drive */
|
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 VolumePassword; /* Password used for mounting volumes */
|
||||||
Password CmdVolumePassword; /* Password passed from command line */
|
Password CmdVolumePassword; /* Password passed from command line */
|
||||||
int VolumePkcs5 = 0;
|
int VolumePkcs5 = 0;
|
||||||
@@ -1255,7 +1255,7 @@ void LoadDriveLetters (HWND hwndDlg, HWND hTree, int drive)
|
|||||||
|
|
||||||
/* Drive letters */
|
/* Drive letters */
|
||||||
|
|
||||||
for (i = 2; i < 26; i++)
|
for (i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
int curDrive = 0;
|
int curDrive = 0;
|
||||||
|
|
||||||
@@ -3926,7 +3926,7 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo)
|
|||||||
BOOL status = FALSE;
|
BOOL status = FALSE;
|
||||||
WaitCursor ();
|
WaitCursor ();
|
||||||
|
|
||||||
if (nDosDriveNo == 0)
|
if (nDosDriveNo == -2)
|
||||||
nDosDriveNo = (char) (HIWORD (GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST))) - 'A');
|
nDosDriveNo = (char) (HIWORD (GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST))) - 'A');
|
||||||
|
|
||||||
if (bCloseDismountedWindows)
|
if (bCloseDismountedWindows)
|
||||||
@@ -5322,7 +5322,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dismount
|
// Dismount
|
||||||
if (cmdUnmountDrive > 0)
|
if (cmdUnmountDrive >= 0)
|
||||||
{
|
{
|
||||||
MOUNT_LIST_STRUCT mountList;
|
MOUNT_LIST_STRUCT mountList;
|
||||||
DWORD bytesReturned;
|
DWORD bytesReturned;
|
||||||
@@ -6150,7 +6150,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
case IDM_UNMOUNT_VOLUME:
|
case IDM_UNMOUNT_VOLUME:
|
||||||
if (CheckMountList (hwndDlg, FALSE))
|
if (CheckMountList (hwndDlg, FALSE))
|
||||||
Dismount (hwndDlg, 0);
|
Dismount (hwndDlg, -2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDPM_OPEN_VOLUME:
|
case IDPM_OPEN_VOLUME:
|
||||||
@@ -6238,7 +6238,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CheckMountList (hwndDlg, FALSE))
|
if (CheckMountList (hwndDlg, FALSE))
|
||||||
Dismount (hwndDlg, 0);
|
Dismount (hwndDlg, -2);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7262,7 +7262,7 @@ void ExtractCommandLine (HWND hwndDlg, char *lpszCommandLine)
|
|||||||
{
|
{
|
||||||
commandLineDrive = *szDriveLetter = (char) toupper (*szDriveLetter);
|
commandLineDrive = *szDriveLetter = (char) toupper (*szDriveLetter);
|
||||||
|
|
||||||
if (commandLineDrive < 'C' || commandLineDrive > 'Z')
|
if (commandLineDrive < 'A' || commandLineDrive > 'Z')
|
||||||
AbortProcess ("BAD_DRIVE_LETTER");
|
AbortProcess ("BAD_DRIVE_LETTER");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user