diff options
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Mount.c | 74 | ||||
-rw-r--r-- | src/Mount/Mount.rc | 21 | ||||
-rw-r--r-- | src/Mount/Resource.h | 3 |
3 files changed, 88 insertions, 10 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 212a5d39..3213a693 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -1952,8 +1952,9 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_PIM_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_ENABLE_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
@@ -1968,8 +1969,9 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_PIM_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), FALSE);
@@ -1988,8 +1990,9 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_PIM_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_ENABLE_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
@@ -2181,8 +2184,39 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return 1;
}
+ if (lw == IDC_PIM_ENABLE)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDT_OLD_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_OLD_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_OLD_PIM_HELP), SW_SHOW);
+
+ // check also the "Use PIM" for the new password if it is enabled
+ if (IsWindowEnabled (GetDlgItem (hwndDlg, IDC_NEW_PIM_ENABLE)))
+ {
+ SetCheckBox (hwndDlg, IDC_NEW_PIM_ENABLE, TRUE);
+
+ ShowWindow (GetDlgItem (hwndDlg, IDC_NEW_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_NEW_PIM_ENABLE)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_NEW_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_KEYFILES)
{
if (bSysEncPwdChangeDlgMode)
{
@@ -2545,8 +2579,18 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa 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)
+ {
+ SetCheckBox (hwndDlg, IDC_PIM_ENABLE, TRUE);
+ 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;
@@ -2710,8 +2754,17 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa 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,
@@ -3172,8 +3225,9 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), protect);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT, hidVolProtKeyFilesParam.EnableKeyFiles);
SendDlgItemMessage (hwndDlg, IDC_PASSWORD_PROT_HIDVOL, EM_LIMITTEXT, MAX_PASSWORD, 0);
@@ -3182,8 +3236,18 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (mountOptions->ProtectedHidVolPassword.Length > 0)
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), (LPSTR) mountOptions->ProtectedHidVolPassword.Text);
SetPim (hwndDlg, IDC_PIM, mountOptions->ProtectedHidVolPim);
+
+ /* make PIM field visible if a PIM value has been explicitely specified */
+ if (mountOptions->ProtectedHidVolPim > 0)
+ {
+ SetCheckBox (hwndDlg, IDC_PIM_ENABLE, TRUE);
+ 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);
+ }
ToHyperlink (hwndDlg, IDC_LINK_HIDVOL_PROTECTION_INFO);
}
@@ -3238,8 +3302,17 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), NULL, TRUE);
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_LINK_HIDVOL_PROTECTION_INFO)
{
Applink ("hiddenvolprotection", TRUE, "");
}
@@ -3319,8 +3392,9 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_ENABLE), protect);
return 1;
}
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc index e7ef8e19..c181741b 100644 --- a/src/Mount/Mount.rc +++ b/src/Mount/Mount.rc @@ -113,15 +113,17 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN
EDITTEXT IDC_OLD_PASSWORD,89,14,162,13,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_OLD_PRF_ID,89,33,85,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,35,78,10
- EDITTEXT IDC_OLD_PIM,89,51,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_OLD_PIM,89,51,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,59,97,10
CONTROL "Use keyfiles",IDC_ENABLE_KEYFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,72,98,10
PUSHBUTTON "Keyfiles...",IDC_KEYFILES,192,70,59,14
CONTROL "Display password",IDC_SHOW_PASSWORD_CHPWD_ORI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,85,138,10,WS_EX_TRANSPARENT
EDITTEXT IDC_PASSWORD,89,121,162,13,ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT IDC_VERIFY,89,137,162,13,ES_PASSWORD | ES_AUTOHSCROLL
- EDITTEXT IDC_PIM,89,154,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_PIM,89,154,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ CONTROL "Use PIM",IDC_NEW_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,161,97,10
CONTROL "Use keyfiles",IDC_ENABLE_NEW_KEYFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,172,99,11
PUSHBUTTON "Keyfiles...",IDC_NEW_KEYFILES,192,170,59,14
CONTROL "Display password",IDC_SHOW_PASSWORD_CHPWD_NEW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,184,160,11,WS_EX_TRANSPARENT
COMBOBOX IDC_PKCS5_PRF_ID,89,199,85,90,CBS_DROPDOWNLIST | WS_TABSTOP
@@ -135,12 +137,12 @@ BEGIN GROUPBOX "Current",IDT_CURRENT,6,3,252,97
GROUPBOX "New",IDT_NEW,6,108,252,130
RTEXT "Wipe mode:",IDT_WIPE_MODE,9,220,74,8,0,WS_EX_RIGHT
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,12,34,74,10,SS_CENTERIMAGE
- RTEXT "Volume PIM:",IDT_OLD_PIM,12,54,74,10
- LTEXT "(Empty or 0 for default iterations)",IDC_OLD_PIM_HELP,135,54,119,8
- RTEXT "Volume PIM:",IDT_PIM,9,157,75,16
- LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,135,157,119,8
+ RTEXT "Volume PIM:",IDT_OLD_PIM,12,54,74,10,NOT WS_VISIBLE
+ LTEXT "(Empty or 0 for default iterations)",IDC_OLD_PIM_HELP,135,54,119,8,NOT WS_VISIBLE
+ RTEXT "Volume PIM:",IDT_PIM,9,157,75,16,NOT WS_VISIBLE
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,135,157,119,8,NOT WS_VISIBLE
END
IDD_MOUNT_DLG DIALOGEX 0, 0, 375, 271
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
@@ -179,21 +181,22 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN
EDITTEXT IDC_PASSWORD,69,8,166,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,69,26,86,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,28,76,10
- EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,48,97,10
CONTROL "Cache passwords and keyfil&es in memory",IDC_CACHE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,61,153,10
CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,74,83,10
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,87,83,11
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,171,84,64,14
PUSHBUTTON "Mount Opti&ons...",IDC_MOUNT_OPTIONS,243,84,64,14
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,115,46,189,8,NOT WS_VISIBLE
DEFPUSHBUTTON "OK",IDOK,243,8,64,14
PUSHBUTTON "Cancel",IDCANCEL,243,25,64,14
RTEXT "Password:",IDT_PASSWORD,0,10,65,13
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,27,65,11
- RTEXT "Volume PIM:",IDT_PIM,0,46,65,8
- LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,115,46,189,8
+ RTEXT "Volume PIM:",IDT_PIM,0,46,65,8,NOT WS_VISIBLE
END
IDD_TRAVELER_DLG DIALOGEX 0, 0, 300, 269
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index e8b4512a..81c64dc0 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -165,8 +165,9 @@ #define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
#define IDT_OLD_PIM 1142
#define IDC_OLD_PIM 1143
#define IDC_OLD_PIM_HELP 1144
+#define IDC_NEW_PIM_ENABLE 1145
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
#define IDM_CLEAR_HISTORY 40004
@@ -240,8 +241,8 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 119
#define _APS_NEXT_COMMAND_VALUE 40068
-#define _APS_NEXT_CONTROL_VALUE 1145
+#define _APS_NEXT_CONTROL_VALUE 1146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|