From 8e1feb2760e62b619e3226572dca19001a192bd8 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 28 Apr 2001 11:41:33 +0000 Subject: [PATCH] Jacob's patch to make passphrase boxes work more sanely git-svn-id: svn://svn.tartarus.org/sgt/putty@1084 cda61777-01e9-0310-a592-d414129be87e --- pageant.c | 5 +++-- pageant.rc | 2 +- puttygen.c | 5 +++-- puttygen.rc | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pageant.c b/pageant.c index 6f942625..2d0b15ee 100644 --- a/pageant.c +++ b/pageant.c @@ -170,7 +170,7 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg, */ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - static char *passphrase; + static char *passphrase = NULL; struct PassphraseProcStruct *p; switch (msg) { @@ -197,6 +197,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, if (p->comment) SetDlgItemText(hwnd, 101, p->comment); *passphrase = 0; + SetDlgItemText (hwnd, 102, passphrase); return 0; case WM_COMMAND: switch (LOWORD(wParam)) { @@ -210,7 +211,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, EndDialog (hwnd, 0); return 0; case 102: /* edit box */ - if (HIWORD(wParam) == EN_CHANGE) { + if ((HIWORD(wParam) == EN_CHANGE) && passphrase) { GetDlgItemText (hwnd, 102, passphrase, PASSPHRASE_MAXLEN-1); passphrase[PASSPHRASE_MAXLEN-1] = '\0'; } diff --git a/pageant.rc b/pageant.rc index f25ebcf0..e80cb541 100644 --- a/pageant.rc +++ b/pageant.rc @@ -13,7 +13,7 @@ FONT 8, "MS Sans Serif" BEGIN CTEXT "Enter passphrase for key", 100, 10, 6, 120, 8 CTEXT "", 101, 10, 16, 120, 8 - EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD + EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD | ES_AUTOHSCROLL DEFPUSHBUTTON "O&K", IDOK, 20, 42, 40, 14 PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14 END diff --git a/puttygen.c b/puttygen.c index ac5079e0..6f5d8164 100644 --- a/puttygen.c +++ b/puttygen.c @@ -93,7 +93,7 @@ struct PassphraseProcStruct { */ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - static char *passphrase; + static char *passphrase = NULL; struct PassphraseProcStruct *p; switch (msg) { @@ -121,6 +121,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, if (p->comment) SetDlgItemText(hwnd, 101, p->comment); *passphrase = 0; + SetDlgItemText(hwnd, 102, passphrase); return 0; case WM_COMMAND: switch (LOWORD(wParam)) { @@ -134,7 +135,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, EndDialog (hwnd, 0); return 0; case 102: /* edit box */ - if (HIWORD(wParam) == EN_CHANGE) { + if ((HIWORD(wParam) == EN_CHANGE) && passphrase) { GetDlgItemText (hwnd, 102, passphrase, PASSPHRASE_MAXLEN-1); passphrase[PASSPHRASE_MAXLEN-1] = '\0'; } diff --git a/puttygen.rc b/puttygen.rc index f98393b8..02b3e8bb 100644 --- a/puttygen.rc +++ b/puttygen.rc @@ -19,7 +19,7 @@ FONT 8, "MS Sans Serif" BEGIN CTEXT "Enter passphrase for key", 100, 10, 6, 120, 8 CTEXT "", 101, 10, 16, 120, 8 - EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD + EDITTEXT 102, 10, 26, 120, 12, ES_PASSWORD | ES_AUTOHSCROLL DEFPUSHBUTTON "O&K", IDOK, 20, 42, 40, 14 PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14 END -- 2.11.0