mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-24 12:03:28 +01:00
Windows: Fix regression that caused the system encryption wizard to crash when displaying password field.
This commit is contained in:
parent
c2b69b248c
commit
558746c482
@ -1310,10 +1310,15 @@ static LRESULT CALLBACK NormalPwdFieldProc (HWND hwnd, UINT message, WPARAM wPar
|
||||
void ToNormalPwdField (HWND hwndDlg, UINT ctrlId)
|
||||
{
|
||||
HWND hwndCtrl = GetDlgItem (hwndDlg, ctrlId);
|
||||
WNDPROC originalwp = (WNDPROC) GetWindowLongPtrW (hwndCtrl, GWLP_USERDATA);
|
||||
|
||||
SendMessage (hwndCtrl, EM_LIMITTEXT, MAX_PASSWORD, 0);
|
||||
SetWindowLongPtrW (hwndCtrl, GWLP_USERDATA, (LONG_PTR) GetWindowLongPtrW (hwndCtrl, GWLP_WNDPROC));
|
||||
SetWindowLongPtrW (hwndCtrl, GWLP_WNDPROC, (LONG_PTR) NormalPwdFieldProc);
|
||||
// only change WNDPROC if not changed already
|
||||
if (!originalwp)
|
||||
{
|
||||
SetWindowLongPtrW (hwndCtrl, GWLP_USERDATA, (LONG_PTR) GetWindowLongPtrW (hwndCtrl, GWLP_WNDPROC));
|
||||
SetWindowLongPtrW (hwndCtrl, GWLP_WNDPROC, (LONG_PTR) NormalPwdFieldProc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -4301,6 +4301,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
hPasswordInputField = GetDlgItem (hwndDlg, IDC_PASSWORD);
|
||||
hVerifyPasswordInputField = GetDlgItem (hwndDlg, IDC_VERIFY);
|
||||
|
||||
ToNormalPwdField (hwndDlg, IDC_PASSWORD);
|
||||
ToNormalPwdField (hwndDlg, IDC_VERIFY);
|
||||
|
||||
if (SysEncInEffect ())
|
||||
{
|
||||
ToBootPwdField (hwndDlg, IDC_PASSWORD);
|
||||
@ -4345,9 +4348,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
StringCbCopyW (str, sizeof(str), GetString ("PASSWORD_HELP"));
|
||||
}
|
||||
|
||||
ToNormalPwdField (hwndDlg, IDC_PASSWORD);
|
||||
ToNormalPwdField (hwndDlg, IDC_VERIFY);
|
||||
|
||||
SetPassword (hwndDlg, IDC_PASSWORD, szRawPassword);
|
||||
SetPassword (hwndDlg, IDC_VERIFY, szVerify);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user