From 34a9e118b6d35b8a5b9a767a35cfc0e002605c10 Mon Sep 17 00:00:00 2001 From: csware Date: Tue, 12 Nov 2019 22:02:57 +0100 Subject: Windows: Allow system encrypted devices to be mounted from WindowsPE - even if changing the keyboard layout failed (#539) When my system broke and I had to use WindowsPE to rescue some files the password dialog always closed immediately. There was no chance to mount the system device using the GUI. It took me a while to realize that I could try using the CLI by passing the password as a parameter (which might not be so obvious for not advanced users). Signed-off-by: Sven Strickroth --- src/Mount/Mount.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Mount') diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 833dbe01..9ba4ae86 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -3019,11 +3019,16 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa if (keybLayout != 0x00000409 && keybLayout != 0x04090409) { Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", hwndDlg); - EndDialog (hwndDlg, IDCANCEL); - return 1; + /* don't be too agressive on enforcing an English keyboard layout. E.g. on WindowsPE this call fails and + * then the user can only mount a system encrypted device using the command line by passing the password as a parameter + * (which might not be obvious for not so advanced users). + * + * Now, we informed the user that English keyboard is required, if it is not available the volume can just not be mounted. + * There should be no other drawback (as e.g., on the change password dialog, when you might change to a password which won't + * work on the pre-start environment. + */ } - - if (SetTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD, TIMER_INTERVAL_KEYB_LAYOUT_GUARD, NULL) == 0) + else if (SetTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD, TIMER_INTERVAL_KEYB_LAYOUT_GUARD, NULL) == 0) { Error ("CANNOT_SET_TIMER", hwndDlg); EndDialog (hwndDlg, IDCANCEL); -- cgit v1.2.3