From 70215e3682345243301d410fc0072f294006403c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 27 May 2015 00:12:46 +0200 Subject: Windows: GUI modifications around PIN field --- src/Common/Common.rc | 17 ++++++++++------- src/Common/Dlgcode.c | 18 ++++++++++++++++++ src/Common/Dlgcode.h | 1 + src/Common/Language.xml | 4 ++++ src/Common/Resource.h | 5 ++++- 5 files changed, 37 insertions(+), 8 deletions(-) (limited to 'src/Common') 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 @@ Current pool content (partial) Pass Password: + Volume PIN: + Volume PIN: Progress: Random Pool: Select this option if there is only one operating system installed on this computer (even if it has multiple users). @@ -143,6 +145,8 @@ Mount Opti&ons... Mount volume as read-&only Keyfiles... + (Empty or 0 for default iterations) + (Empty or 0 for default iterations) Enabled Cache passwords in driver memory Auto-dismount volume after no data has been read/written to it for 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 -- cgit v1.2.3