diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-05-27 00:12:46 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-05-27 01:01:53 +0200 |
commit | 70215e3682345243301d410fc0072f294006403c (patch) | |
tree | a36ac199a658370a549a1fec7b1d413ff62f1ad7 | |
parent | 8ebf5ac605d57eab80b600a7827d2ba48668d887 (diff) | |
download | VeraCrypt-70215e3682345243301d410fc0072f294006403c.tar.gz VeraCrypt-70215e3682345243301d410fc0072f294006403c.zip |
Windows: GUI modifications around PIN field
-rw-r--r-- | src/Common/Common.rc | 17 | ||||
-rw-r--r-- | src/Common/Dlgcode.c | 18 | ||||
-rw-r--r-- | src/Common/Dlgcode.h | 1 | ||||
-rw-r--r-- | src/Common/Language.xml | 4 | ||||
-rw-r--r-- | src/Common/Resource.h | 5 | ||||
-rw-r--r-- | src/ExpandVolume/WinMain.cpp | 18 | ||||
-rw-r--r-- | src/ExpandVolume/resource.h | 14 | ||||
-rw-r--r-- | src/Format/Format.rc | 2 | ||||
-rw-r--r-- | src/Format/Resource.h | 6 | ||||
-rw-r--r-- | src/Mount/Mount.c | 29 | ||||
-rw-r--r-- | src/Mount/Resource.h | 11 |
11 files changed, 63 insertions, 62 deletions
diff --git a/src/Common/Common.rc b/src/Common/Common.rc index 1fba8899..d296e7b0 100644 --- a/src/Common/Common.rc +++ b/src/Common/Common.rc @@ -65,7 +65,7 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,248,190,50,14
END
-IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 204
+IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 224
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt - Mount Options"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
@@ -78,18 +78,21 @@ BEGIN CONTROL "&Protect hidden volume against damage caused by writing to outer volume",IDC_PROTECT_HIDDEN_VOL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,86,252,10
EDITTEXT IDC_PASSWORD_PROT_HIDVOL,112,104,151,14,ES_PASSWORD | ES_AUTOHSCROLL
- CONTROL "&Display password",IDC_SHOW_PASSWORD_MO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,146,90,10
- CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE_HIDVOL_PROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,159,90,10
- PUSHBUTTON "&Keyfiles...",IDC_KEYFILES_HIDVOL_PROT,203,148,60,14
- LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,174,247,10,SS_NOTIFY
+ CONTROL "&Display password",IDC_SHOW_PASSWORD_MO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,165,90,10
+ CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE_HIDVOL_PROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,178,90,10
+ PUSHBUTTON "&Keyfiles...",IDC_KEYFILES_HIDVOL_PROT,203,167,60,14
+ LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,193,247,10,SS_NOTIFY
DEFPUSHBUTTON "OK",IDOK,211,7,60,14
PUSHBUTTON "Cancel",IDCANCEL,211,24,60,14
RTEXT "P&assword to hidden volume:\n(if empty, cache is used)",IDT_HIDDEN_PROT_PASSWD,15,103,91,17,0,WS_EX_RIGHT
- GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,120
+ GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,139
CONTROL "Use backup header embedded in &volume if available",IDC_USE_EMBEDDED_HEADER_BAK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,39,257,11
COMBOBOX IDC_PKCS5_PRF_ID,112,125,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,15,126,91,17
+ EDITTEXT IDC_PIN,112,145,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ RTEXT "Volume PIN:",IDT_PIN,15,148,91,17
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIN_HELP,158,148,112,8
END
IDD_KEYFILES DIALOGEX 0, 0, 345, 237
@@ -348,7 +351,7 @@ BEGIN BEGIN
LEFTMARGIN, 7
TOPMARGIN, 7
- BOTTOMMARGIN, 198
+ BOTTOMMARGIN, 218
END
IDD_KEYFILES, DIALOG
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 5cf6dbaf..c9d01290 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -984,6 +984,11 @@ BOOL CALLBACK AboutDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam // Version
SendMessage (GetDlgItem (hwndDlg, IDT_ABOUT_VERSION), WM_SETFONT, (WPARAM) hUserBoldFont, 0);
StringCbPrintfA (szTmp, sizeof(szTmp), "VeraCrypt %s", VERSION_STRING);
+#ifdef _WIN64
+ StringCbCatA (szTmp, sizeof(szTmp), " (64-bit)");
+#else
+ StringCbCatA (szTmp, sizeof(szTmp), " (32-bit)");
+#endif
#if (defined(_DEBUG) || defined(DEBUG))
StringCbCatA (szTmp, sizeof(szTmp), " (debug)");
#endif
@@ -10716,3 +10721,16 @@ int GetPin (HWND hwndDlg, UINT ctrlId) }
return pin;
}
+
+void SetPin (HWND hwndDlg, UINT ctrlId, int pin)
+{
+ if (pin > 0)
+ {
+ char szTmp[MAX_PIN + 1];
+ StringCbPrintfA (szTmp, sizeof(szTmp), "%d", pin);
+ SetDlgItemText (hwndDlg, ctrlId, szTmp);
+ }
+ else
+ SetDlgItemText (hwndDlg, ctrlId, "");
+}
+
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h index 1fd12d40..7dee2db5 100644 --- a/src/Common/Dlgcode.h +++ b/src/Common/Dlgcode.h @@ -481,6 +481,7 @@ BOOL IsWindowsIsoBurnerAvailable (); BOOL LaunchWindowsIsoBurner (HWND hwnd, const char *isoPath);
BOOL IsApplicationInstalled (const char *appName);
int GetPin (HWND hwndDlg, UINT ctrlId);
+void SetPin (HWND hwndDlg, UINT ctrlId, int pin);
#ifdef __cplusplus
}
diff --git a/src/Common/Language.xml b/src/Common/Language.xml index 9ae289d9..e1cdcde7 100644 --- a/src/Common/Language.xml +++ b/src/Common/Language.xml @@ -86,6 +86,8 @@ <control lang="en" key="IDT_PARTIAL_POOL_CONTENTS">Current pool content (partial)</control>
<control lang="en" key="IDT_PASS">Pass</control>
<control lang="en" key="IDT_PASSWORD">Password:</control>
+ <control lang="en" key="IDT_PIN">Volume PIN:</control>
+ <control lang="en" key="IDT_OLD_PIN">Volume PIN:</control>
<control lang="en" key="IDT_PROGRESS">Progress:</control>
<control lang="en" key="IDT_RANDOM_POOL">Random Pool: </control>
<control lang="en" key="IDT_SINGLE_BOOT">Select this option if there is only one operating system installed on this computer (even if it has multiple users).</control>
@@ -143,6 +145,8 @@ <control lang="en" key="IDC_MOUNT_OPTIONS">Mount Opti&ons...</control>
<control lang="en" key="IDC_MOUNT_READONLY">Mount volume as read-&only</control>
<control lang="en" key="IDC_NEW_KEYFILES">Keyfiles...</control>
+ <control lang="en" key="IDC_OLD_PIN_HELP">(Empty or 0 for default iterations)</control>
+ <control lang="en" key="IDC_PIN_HELP">(Empty or 0 for default iterations)</control>
<control lang="en" key="IDC_PREF_BKG_TASK_ENABLE">Enabled</control>
<control lang="en" key="IDC_PREF_CACHE_PASSWORDS">Cache passwords in driver memory</control>
<control lang="en" key="IDC_PREF_DISMOUNT_INACTIVE">Auto-dismount volume after no data has been read/written to it for</control>
diff --git a/src/Common/Resource.h b/src/Common/Resource.h index 4b8c2df5..9cc7b9e2 100644 --- a/src/Common/Resource.h +++ b/src/Common/Resource.h @@ -188,6 +188,9 @@ #define IDC_WAIT_PROGRESS_BAR 5126
#define IDC_PKCS5_PRF_ID 5127
#define IDT_PKCS5_PRF 5128
+#define IDT_PIN 5129
+#define IDC_PIN 5130
+#define IDC_PIN_HELP 5131
// Next default values for new objects
//
@@ -196,7 +199,7 @@ #define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 542
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 5129
+#define _APS_NEXT_CONTROL_VALUE 5132
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp index f8b3234c..0dc135b1 100644 --- a/src/ExpandVolume/WinMain.cpp +++ b/src/ExpandVolume/WinMain.cpp @@ -447,14 +447,7 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage (GetDlgItem (hwndDlg, IDC_CACHE), BM_SETCHECK, bCacheInDriver ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, MAX_PIN, 0);
- if (*pin >= 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
@@ -554,14 +547,7 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), FALSE);
- if (*pin >= 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
bPrebootPasswordDlgMode = TRUE;
}
diff --git a/src/ExpandVolume/resource.h b/src/ExpandVolume/resource.h index 29a451db..bf96b1ca 100644 --- a/src/ExpandVolume/resource.h +++ b/src/ExpandVolume/resource.h @@ -63,16 +63,12 @@ #define IDC_SIZEDLG_TITLE 1111 #define IDC_INIT_NEWSPACE 1112 #define IDC_INFOEXPAND 1113 -#define IDC_EDIT1 1114 #define IDC_BOX_STATUS 1114 #define IDC_TRUECRYPT_MODE 1140 -#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141 -#define IDT_PIN 1142
-#define IDC_PIN 1143
-#define IDC_PIN_HELP 1144
-#define IDT_OLD_PIN 1145
-#define IDC_OLD_PIN 1146
-#define IDC_OLD_PIN_HELP 1147 +#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
+#define IDT_OLD_PIN 1142
+#define IDC_OLD_PIN 1143
+#define IDC_OLD_PIN_HELP 1144 #define IDM_HELP 40001 #define IDM_ABOUT 40002 #define IDM_UNMOUNT_VOLUME 40003 @@ -144,7 +140,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 120 #define _APS_NEXT_COMMAND_VALUE 40064 -#define _APS_NEXT_CONTROL_VALUE 1148 +#define _APS_NEXT_CONTROL_VALUE 1145 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/Format/Format.rc b/src/Format/Format.rc index c4e50fdd..aab29605 100644 --- a/src/Format/Format.rc +++ b/src/Format/Format.rc @@ -123,7 +123,7 @@ BEGIN RTEXT "Password:",IDT_PASSWORD,1,6,50,8
RTEXT "&Confirm:",IDT_CONFIRM,1,23,50,8
LTEXT "",IDC_BOX_HELP,0,79,225,89
- RTEXT "Volume Pin:",IDT_PIN,1,38,50,8
+ RTEXT "Volume PIN:",IDT_PIN,1,38,50,8
LTEXT "(Empty or 0 for default iterations)",IDC_PIN_HELP,97,38,126,8
END
diff --git a/src/Format/Resource.h b/src/Format/Resource.h index 2dc03faa..4cb2e579 100644 --- a/src/Format/Resource.h +++ b/src/Format/Resource.h @@ -140,10 +140,6 @@ #define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1102
#define IDC_DRIVE_LETTER_LIST 1103
#define IDT_DRIVE_LETTER 1104
-#define IDT_PIN 1105
-#define IDC_PIN 1106
-#define IDC_PIN_HELP 1107
-#define IDC_EDIT1 1108
// Next default values for new objects
//
@@ -152,7 +148,7 @@ #define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1109
+#define _APS_NEXT_CONTROL_VALUE 1105
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 7f8cbca2..ef116199 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -2390,14 +2390,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa SendMessage (GetDlgItem (hwndDlg, IDC_CACHE), BM_SETCHECK, bCacheInDriver ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, MAX_PIN, 0);
- if (*pin > 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
@@ -2499,14 +2492,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES), FALSE);
- if (*pin >= 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
bPrebootPasswordDlgMode = TRUE;
}
@@ -3026,13 +3012,19 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), protect);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT, hidVolProtKeyFilesParam.EnableKeyFiles);
SendDlgItemMessage (hwndDlg, IDC_PASSWORD_PROT_HIDVOL, EM_LIMITTEXT, MAX_PASSWORD, 0);
+ SendDlgItemMessage (hwndDlg, IDC_PIN, EM_LIMITTEXT, MAX_PIN, 0);
if (mountOptions->ProtectedHidVolPassword.Length > 0)
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), (LPSTR) mountOptions->ProtectedHidVolPassword.Text);
+
+ SetPin (hwndDlg, IDC_PIN, mountOptions->ProtectedHidVolPin);
ToHyperlink (hwndDlg, IDC_LINK_HIDVOL_PROTECTION_INFO);
@@ -3127,6 +3119,8 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM mountOptions->ProtectedHidVolPkcs5Prf = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA,
SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
+
+ mountOptions->ProtectedHidVolPin = GetPin (hwndDlg, IDC_PIN);
}
// Cleanup
@@ -3165,6 +3159,9 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), protect);
return 1;
}
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index 857ef197..05109fcc 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -163,12 +163,9 @@ #define IDC_PKCS5_OLD_PRF_ID 1139
#define IDC_TRUECRYPT_MODE 1140
#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
-#define IDT_PIN 1142
-#define IDC_PIN 1143
-#define IDC_PIN_HELP 1144
-#define IDT_OLD_PIN 1145
-#define IDC_OLD_PIN 1146
-#define IDC_OLD_PIN_HELP 1147
+#define IDT_OLD_PIN 1142
+#define IDC_OLD_PIN 1143
+#define IDC_OLD_PIN_HELP 1144
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
@@ -244,7 +241,7 @@ #define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 119
#define _APS_NEXT_COMMAND_VALUE 40068
-#define _APS_NEXT_CONTROL_VALUE 1148
+#define _APS_NEXT_CONTROL_VALUE 1145
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|