1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 03:18:26 -06:00

Windows: when mounting multiple favorites, use PIM of previous favorite alongside its password if option "Include PIM when caching password" is selected alongside option "Temporarily cache password during Mount Favorite Volumes operations".

This commit is contained in:
Mounir IDRASSI
2017-07-02 17:03:03 +02:00
parent 2db0061741
commit a0f2ffb90b
6 changed files with 28 additions and 23 deletions

View File

@@ -5801,7 +5801,7 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (benchmarkType == BENCHMARK_TYPE_PRF)
{
benchmarkPim = GetPim (hwndDlg, IDC_PIM);
benchmarkPim = GetPim (hwndDlg, IDC_PIM, 0);
benchmarkPreBoot = GetCheckBox (hwndDlg, IDC_BENCHMARK_PREBOOT);
}
else
@@ -12670,9 +12670,9 @@ std::wstring FindLatestFileOrDirectory (const std::wstring &directory, const wch
return wstring (directory) + L"\\" + name;
}
int GetPim (HWND hwndDlg, UINT ctrlId)
int GetPim (HWND hwndDlg, UINT ctrlId, int defaultPim)
{
int pim = 0;
int pim = defaultPim;
HWND hCtrl = GetDlgItem (hwndDlg, ctrlId);
if (IsWindowEnabled (hCtrl) && IsWindowVisible (hCtrl))
{
@@ -12682,7 +12682,7 @@ int GetPim (HWND hwndDlg, UINT ctrlId)
wchar_t* endPtr = NULL;
pim = wcstol(szTmp, &endPtr, 10);
if (pim < 0 || endPtr == szTmp || !endPtr || *endPtr != L'\0')
pim = 0;
pim = defaultPim;
}
}
return pim;