diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-06 12:47:58 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-06 20:31:04 +0200 |
commit | e445863ae477b36ed2831591e3e414685aab2785 (patch) | |
tree | e870ed99723d6636b3a7cfd4f22248e13a587448 /src/Mount | |
parent | 42a7a17cb963eff8a94e60f218db943398d0dee0 (diff) | |
download | VeraCrypt-e445863ae477b36ed2831591e3e414685aab2785.tar.gz VeraCrypt-e445863ae477b36ed2831591e3e414685aab2785.zip |
Windows: Save/Restore last selected drive in drivers list only when saving history is enabled.
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Mount.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 5e5719c5..8afc1094 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -723,7 +723,7 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL* ConfigReadCompareInt ("HiddenSystemLeakProtNotifStatus", TC_HIDDEN_OS_READ_ONLY_NOTIF_MODE_NONE, &HiddenSysLeakProtectionNotificationStatus, bOnlyCheckModified, pbSettingsModified);
// Drive letter - command line arg overrides registry
- if (!bOnlyCheckModified && szDriveLetter[0] == 0)
+ if (!bOnlyCheckModified && bHistory && szDriveLetter[0] == 0)
ConfigReadString ("LastSelectedDrive", "", szDriveLetter, sizeof (szDriveLetter));
if (bHistory && pbSettingsModified)
{
@@ -846,11 +846,15 @@ void SaveSettings (HWND hwndDlg) if (IsHiddenOSRunning())
ConfigWriteInt ("HiddenSystemLeakProtNotifStatus", HiddenSysLeakProtectionNotificationStatus);
- // Drive Letter
- lLetter = GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST));
- if (LOWORD (lLetter) != 0xffff)
- StringCbPrintfA (szTmp, sizeof(szTmp), "%c:", (char) HIWORD (lLetter));
- ConfigWriteString ("LastSelectedDrive", szTmp);
+ // save last selected drive only when history enabled
+ if (bHistory)
+ {
+ // Drive Letter
+ lLetter = GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST));
+ if (LOWORD (lLetter) != 0xffff)
+ StringCbPrintfA (szTmp, sizeof(szTmp), "%c:", (char) HIWORD (lLetter));
+ ConfigWriteString ("LastSelectedDrive", szTmp);
+ }
ConfigWriteInt ("CloseSecurityTokenSessionsAfterMount", CloseSecurityTokenSessionsAfterMount);
|