[MSGINA] Erase passwords & set focus back to the password field, in failure cases (#8337)

Do this in the "Logon", "Unlock Computer", and "Change Password" dialogs.
This commit is contained in:
Hermès Bélusca-Maïto
2025-08-14 23:22:33 +02:00
parent bded90874e
commit 752f6b5591

View File

@@ -793,6 +793,7 @@ ChangePasswordDialogProc(
}
else
{
SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_OLDPWD, NULL);
SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD1, NULL);
SetDlgItemTextW(hwndDlg, IDC_CHANGEPWD_NEWPWD2, NULL);
SendMessageW(hwndDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hwndDlg, IDC_CHANGEPWD_OLDPWD), TRUE);
@@ -1364,7 +1365,14 @@ LogonDialogProc(
{
case IDOK:
if (DoLogon(hwndDlg, pDlgData->pgContext))
{
EndDialog(hwndDlg, WLX_SAS_ACTION_LOGON);
}
else
{
SetDlgItemTextW(hwndDlg, IDC_LOGON_PASSWORD, NULL);
SendMessageW(hwndDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hwndDlg, IDC_LOGON_PASSWORD), TRUE);
}
return TRUE;
case IDCANCEL:
@@ -1625,7 +1633,14 @@ UnlockDialogProc(
{
case IDOK:
if (DoUnlock(hwndDlg, pDlgData->pgContext, &result))
{
EndDialog(hwndDlg, result);
}
else
{
SetDlgItemTextW(hwndDlg, IDC_UNLOCK_PASSWORD, NULL);
SendMessageW(hwndDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hwndDlg, IDC_UNLOCK_PASSWORD), TRUE);
}
return TRUE;
case IDCANCEL: