diff options
Diffstat (limited to 'src/ExpandVolume/WinMain.cpp')
-rw-r--r-- | src/ExpandVolume/WinMain.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp index 18df1b4d..ec7a6f56 100644 --- a/src/ExpandVolume/WinMain.cpp +++ b/src/ExpandVolume/WinMain.cpp @@ -448,8 +448,17 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage (GetDlgItem (hwndDlg, IDC_PIM), EM_LIMITTEXT, MAX_PIM, 0);
SetPim (hwndDlg, IDC_PIM, *pim);
+ /* make PIM field visible if a PIM value has been explicitely specified */
+ if (*pim > 0)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
+ }
+
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
mountOptions.PartitionInInactiveSysEncScope = bPrebootPasswordDlgMode;
@@ -606,8 +615,17 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return 1;
}
+ if (lw == IDC_PIM_ENABLE)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), SW_SHOW);
+ return 1;
+ }
+
if (lw == IDC_SHOW_PASSWORD)
{
SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD),
EM_SETPASSWORDCHAR,
@@ -658,13 +676,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA bCacheInDriver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_CACHE));
*pkcs5 = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
*truecryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
- GetWindowText (GetDlgItem (hwndDlg, IDC_PIM), tmp, MAX_PIM + 1);
- if (strlen(tmp))
- *pim = (int) strtol(tmp, NULL, 10); /* IDC_PIM is configured to accept only numbers */
- else
- *pim = 0;
+ *pim = GetPim (hwndDlg, IDC_PIM);
/* SHA-256 is not supported by TrueCrypt */
if ( (*truecryptMode)
&& ((*pkcs5 == SHA256) || (mountOptions.ProtectHiddenVolume && mountOptions.ProtectedHidVolPkcs5Prf == SHA256))
|