VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-01-10 19:35:57 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-01-10 20:45:15 +0100
commitfb430c403b2e0deb3f34328d3b65bd39c10b14ba (patch)
tree274cefc763648484f7094f948365704aaf29e729 /src/Mount/Mount.c
parent5597a1e390e510a1c4e91866e88c2f10de80688b (diff)
downloadVeraCrypt-fb430c403b2e0deb3f34328d3b65bd39c10b14ba.tar.gz
VeraCrypt-fb430c403b2e0deb3f34328d3b65bd39c10b14ba.zip
Windows: Don't show disconnected network drives in the list of available drives. Add option to make them available for mounting if needed.
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 59023200..1aef7a53 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -705,6 +705,8 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL*
if (!bOnlyCheckModified)
bPreserveTimestamp = defaultMountOptions.PreserveTimestamp;
+ ConfigReadCompareInt ("ShowDisconnectedNetworkDrives", FALSE, &bShowDisconnectedNetworkDrives, bOnlyCheckModified, pbSettingsModified);
+
ConfigReadCompareInt ("MountVolumesRemovable", FALSE, &defaultMountOptions.Removable, bOnlyCheckModified, pbSettingsModified);
ConfigReadCompareInt ("MountVolumesReadOnly", FALSE, &defaultMountOptions.ReadOnly, bOnlyCheckModified, pbSettingsModified);
@@ -860,6 +862,7 @@ void SaveSettings (HWND hwndDlg)
ConfigWriteInt ("MountVolumesReadOnly", defaultMountOptions.ReadOnly);
ConfigWriteInt ("MountVolumesRemovable", defaultMountOptions.Removable);
ConfigWriteInt ("PreserveTimestamps", defaultMountOptions.PreserveTimestamp);
+ ConfigWriteInt ("ShowDisconnectedNetworkDrives",bShowDisconnectedNetworkDrives);
ConfigWriteInt ("EnableBackgroundTask", bEnableBkgTask);
ConfigWriteInt ("CloseBackgroundTaskOnNoVolumes", bCloseBkgTaskWhenNoVolumes);
@@ -1454,7 +1457,7 @@ void LoadDriveLetters (HWND hwndDlg, HWND hTree, int drive)
AbortProcessSilent();
}
- LastKnownLogicalDrives = dwUsedDrives = GetLogicalDrives ();
+ LastKnownLogicalDrives = dwUsedDrives = GetUsedLogicalDrives ();
if (dwUsedDrives == 0)
Warning ("DRIVELETTERS", hwndDlg);
@@ -3069,6 +3072,9 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendMessage (GetDlgItem (hwndDlg, IDC_PRESERVE_TIMESTAMPS), BM_SETCHECK,
defaultMountOptions.PreserveTimestamp ? BST_CHECKED:BST_UNCHECKED, 0);
+
+ SendMessage (GetDlgItem (hwndDlg, IDC_SHOW_DISCONNECTED_NETWORK_DRIVES), BM_SETCHECK,
+ bShowDisconnectedNetworkDrives ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT), BM_SETCHECK,
bCacheDuringMultipleMount ? BST_CHECKED:BST_UNCHECKED, 0);
@@ -3183,6 +3189,7 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
bExplore = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_OPEN_EXPLORER));
bUseDifferentTrayIconIfVolMounted = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_USE_DIFF_TRAY_ICON_IF_VOL_MOUNTED));
bPreserveTimestamp = defaultMountOptions.PreserveTimestamp = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PRESERVE_TIMESTAMPS));
+ bShowDisconnectedNetworkDrives = IsButtonChecked (GetDlgItem (hwndDlg, IDC_SHOW_DISCONNECTED_NETWORK_DRIVES));
bCacheDuringMultipleMount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT));
bWipeCacheOnExit = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_EXIT));
bWipeCacheOnAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT));
@@ -5830,7 +5837,7 @@ static BOOL CheckMountList (HWND hwndDlg, BOOL bForceTaskBarUpdate)
return TRUE;
}
- if (LastKnownLogicalDrives != GetLogicalDrives()
+ if (LastKnownLogicalDrives != GetUsedLogicalDrives()
|| memcmp (&LastKnownMountList, &current, sizeof (current)) != 0)
{
wchar_t selDrive;
@@ -6188,6 +6195,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
// Set critical default options in case UsePreferences is false
bPreserveTimestamp = defaultMountOptions.PreserveTimestamp = TRUE;
+ bShowDisconnectedNetworkDrives = FALSE;
ResetWrongPwdRetryCount ();
@@ -7006,7 +7014,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (i = 0; i < 26; i++)
{
- if ((vol->dbcv_unitmask & (1 << i)) && !(GetLogicalDrives() & (1 << i)))
+ if ((vol->dbcv_unitmask & (1 << i)) && !(GetUsedLogicalDrives() & (1 << i)))
{
for (m = 0; m < 26; m++)
{
@@ -7891,7 +7899,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (lw == IDM_REFRESH_DRIVE_LETTERS)
{
- DWORD driveMap = GetLogicalDrives ();
+ DWORD driveMap = GetUsedLogicalDrives ();
WaitCursor ();