mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Only use A: and B: for mounting when no other free drive letter available or when explicitly chosen by user. This avoid side effects when mounting volumes as removable media and automatic drive selection (e.g. A: become invisible in explorer after closing all explorer instances although it is still mounted).
This commit is contained in:
@@ -6760,11 +6760,13 @@ DWORD GetUsedLogicalDrives (void)
|
||||
int GetFirstAvailableDrive ()
|
||||
{
|
||||
DWORD dwUsedDrives = GetUsedLogicalDrives();
|
||||
int i;
|
||||
int i, drive;
|
||||
|
||||
for (i = 0; i < 26; i++)
|
||||
/* let A: and B: be used as last resort since they can introduce side effects */
|
||||
for (i = 2; i < 28; i++)
|
||||
{
|
||||
if (!(dwUsedDrives & 1 << i))
|
||||
drive = (i < 26) ? i : (i - 26);
|
||||
if (!(dwUsedDrives & 1 << drive))
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user