diff options
Diffstat (limited to 'src/Format')
-rw-r--r-- | src/Format/Format.rc | 13 | ||||
-rw-r--r-- | src/Format/Resource.h | 3 | ||||
-rw-r--r-- | src/Format/Tcformat.c | 77 |
3 files changed, 71 insertions, 22 deletions
diff --git a/src/Format/Format.rc b/src/Format/Format.rc index 13833f79..f34cae1f 100644 --- a/src/Format/Format.rc +++ b/src/Format/Format.rc @@ -118,11 +118,12 @@ BEGIN EDITTEXT IDC_VERIFY,53,19,163,14,ES_PASSWORD | ES_AUTOHSCROLL
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,35,95,10
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,152,36,64,14,WS_DISABLED
CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,45,95,11,WS_EX_TRANSPARENT
+ CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,56,97,10
RTEXT "Password:",IDT_PASSWORD,1,6,50,8
RTEXT "&Confirm:",IDT_CONFIRM,1,23,50,8
- LTEXT "",IDC_BOX_HELP,0,63,225,105
+ LTEXT "",IDC_BOX_HELP,0,71,225,97
END
IDD_SIZE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
@@ -223,17 +224,18 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD_DIRECT,50,2,149,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,50,17,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
- EDITTEXT IDC_PIM,50,32,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_PIM,50,32,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,96,34,127,8,NOT WS_VISIBLE
CONTROL "&Display password",IDC_SHOW_PASSWORD_SINGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,46,84,11,WS_EX_TRANSPARENT
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,57,82,11
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,142,54,64,14
LTEXT "",IDC_BOX_HELP,0,74,225,94
RTEXT "Password:",IDT_PASSWORD,0,6,48,8
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,19,48,8
- RTEXT "Volume PIM:",IDT_PIM,0,34,48,8
- LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,96,34,127,8
+ RTEXT "Volume PIM:",IDT_PIM,0,35,48,8,NOT WS_VISIBLE
+ CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,35,97,10
END
IDD_VOLUME_TYPE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
@@ -435,11 +437,12 @@ IDD_PIM_PAGE_DLG DIALOGEX 0, 0, 226, 172 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PIM,53,8,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "",IDC_BOX_HELP,0,28,225,143
+ LTEXT "",IDC_BOX_HELP,0,28,225,130
RTEXT "Volume PIM:",IDT_PIM,1,11,50,8
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,97,11,126,8
+ LTEXT "Information on PIM",IDC_LINK_PIM_INFO,0,161,213,8,SS_NOTIFY
END
#ifdef APSTUDIO_INVOKED
diff --git a/src/Format/Resource.h b/src/Format/Resource.h index 1d2f4687..3b717e84 100644 --- a/src/Format/Resource.h +++ b/src/Format/Resource.h @@ -140,16 +140,17 @@ #define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1101
#define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1102
#define IDC_DRIVE_LETTER_LIST 1103
#define IDT_DRIVE_LETTER 1104
+#define IDC_LINK_PIM_INFO 1105
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1105
+#define _APS_NEXT_CONTROL_VALUE 1106
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index bd83078f..7106a230 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -2699,8 +2699,10 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg) /* Volume successfully created */
RestoreDefaultKeyFilesParam ();
+ PimEnable = FALSE;
+
if (bDevice && !bInPlaceEncNonSys)
{
// Handle assigned drive letter (if any)
@@ -4133,8 +4135,13 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa StringCbPrintfA(szTmp, sizeof(szTmp), "%d", volumePim);
SetWindowText (GetDlgItem (hwndDlg, IDC_PIM), szTmp);
}
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_ENABLE), PimEnable? SW_HIDE : SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), PimEnable? SW_SHOW : SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), PimEnable? SW_SHOW : SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), PimEnable? SW_SHOW : SW_HIDE);
+
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? (bInPlaceEncNonSysResumed ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "NONSYS_INPLACE_DEC_PASSWORD_PAGE_HELP") : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
@@ -4206,8 +4213,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), szRawPassword);
SetWindowText (GetDlgItem (hwndDlg, IDC_VERIFY), szVerify);
SetFocus (GetDlgItem (hwndDlg, IDC_PASSWORD));
+
+ SetCheckBox (hwndDlg, IDC_PIM_ENABLE, PimEnable);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable && !SysEncInEffect());
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), KeyFilesEnable);
@@ -4254,8 +4263,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa SetFocus (GetDlgItem (hwndDlg, IDC_PIM));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (SysEncInEffect ()? "PIM_SYSENC_HELP" : "PIM_HELP"));
+ ToHyperlink (hwndDlg, IDC_LINK_PIM_INFO);
+
if (CreatingHiddenSysVol())
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("PIM_HIDDEN_OS_TITLE"));
else if (bHiddenVol)
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bHiddenVolHost ? "PIM_HIDVOL_HOST_TITLE" : "PIM_HIDVOL_TITLE"));
@@ -5347,8 +5358,14 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa Applink ("hashalgorithms", TRUE, "");
return 1;
}
+ if (lw == IDC_LINK_PIM_INFO && nCurPageNo == PIM_PAGE)
+ {
+ Applink ("pim", TRUE, "");
+ return 1;
+ }
+
if (hw == CBN_EDITCHANGE && nCurPageNo == VOLUME_LOCATION_PAGE)
{
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
GetWindowTextLength (GetDlgItem (hCurPage, IDC_COMBO_BOX)) > 0);
@@ -5392,22 +5409,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa NULL,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
- if (lw == IDC_PIM)
- {
- if(GetPim (hwndDlg, IDC_PIM) != 0)
- {
- PimValueChangedWarning = TRUE;
- SetDlgItemTextW (hwndDlg, IDC_PIM_HELP, GetString (SysEncInEffect ()? "PIM_SYSENC_CHANGE_WARNING" : "PIM_CHANGE_WARNING"));
- }
- else
- {
- PimValueChangedWarning = FALSE;
- SetDlgItemTextW (hwndDlg, IDC_PIM_HELP, (wchar_t *) GetDictionaryValueByInt (IDC_PIM_HELP));
- }
- }
-
return 1;
}
if (hw == EN_CHANGE && nCurPageNo == PIM_PAGE)
@@ -5442,8 +5445,25 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD), NULL, TRUE);
InvalidateRect (GetDlgItem (hwndDlg, IDC_VERIFY), NULL, TRUE);
return 1;
}
+
+ if (lw == IDC_PIM_ENABLE)
+ {
+ PimEnable = GetCheckBox (hwndDlg, IDC_PIM_ENABLE);
+ if (!PimEnable)
+ volumePim = 0;
+ if (nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
+ || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE
+ )
+ {
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_ENABLE), PimEnable? SW_HIDE : SW_SHOW);
+ ShowWindow (GetDlgItem( hwndDlg, IDT_PIM), PimEnable? SW_SHOW : SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM), PimEnable? SW_SHOW : SW_HIDE);
+ ShowWindow (GetDlgItem( hwndDlg, IDC_PIM_HELP), PimEnable? SW_SHOW : SW_HIDE);
+ }
+ return 1;
+ }
if (nCurPageNo == PASSWORD_PAGE
|| nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
|| nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
@@ -7140,8 +7160,33 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa bKeyboardLayoutChanged = FALSE;
}
}
+
+ if (!PimEnable)
+ {
+ // PIM not activated. Skip PIM page
+ volumePim = 0;
+
+ if (SysEncInEffect ())
+ {
+ nNewPageNo = SYSENC_COLLECTING_RANDOM_DATA_PAGE - 1; // Skip irrelevant pages
+ }
+
+ if (bInPlaceEncNonSys)
+ {
+ nNewPageNo = NONSYS_INPLACE_ENC_RAND_DATA_PAGE - 1; // Skip irrelevant pages
+ }
+ else if (WizardMode != WIZARD_MODE_SYS_DEVICE
+ && !FileSize4GBLimitQuestionNeeded ()
+ || CreatingHiddenSysVol()) // If we're creating a hidden volume for a hidden OS, we don't need to format it with any filesystem (the entire OS will be copied to the hidden volume sector by sector).
+ {
+ nNewPageNo = FORMAT_PAGE - 1; // Skip irrelevant pages
+ }
+ else
+ nNewPageNo = PIM_PAGE; // Skip PIM page
+
+ }
}
else if (nCurPageNo == PIM_PAGE)
{
@@ -8327,9 +8372,9 @@ ovf_end: memset (tmp, 'X', sizeof(tmp));
tmp [sizeof(tmp)-1] = 0;
SetWindowText (hRandPoolSys, tmp);
- nNewPageNo = PIM_PAGE + 1; // Skip irrelevant pages
+ nNewPageNo = (PimEnable? PIM_PAGE : PASSWORD_PAGE) + 1; // Skip irrelevant pages
}
else if (nCurPageNo == SYSENC_KEYS_GEN_PAGE)
{
@@ -8371,9 +8416,9 @@ ovf_end: {
nNewPageNo = FILESYS_PAGE + 1;
}
else
- nNewPageNo = PIM_PAGE + 1;
+ nNewPageNo = (PimEnable? PIM_PAGE : PASSWORD_PAGE) + 1;
}
}
LoadPage (hwndDlg, nNewPageNo - 1);
|