| 63 |
#define EndDialog(p1,p2) \ |
#define EndDialog(p1,p2) \ |
| 64 |
TTEndDialog(p1, p2) |
TTEndDialog(p1, p2) |
| 65 |
|
|
|
//static HFONT DlgAuthFont; |
|
|
//static HFONT DlgTisFont; |
|
|
//static HFONT DlgAuthSetupFont; |
|
|
|
|
| 66 |
void destroy_malloced_string(char **str) |
void destroy_malloced_string(char **str) |
| 67 |
{ |
{ |
| 68 |
if (*str != NULL) { |
if (*str != NULL) { |
| 771 |
} |
} |
| 772 |
|
|
| 773 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
|
#if 0 |
|
|
if (DlgAuthFont != NULL) { |
|
|
DeleteObject(DlgAuthFont); |
|
|
} |
|
|
#endif |
|
| 774 |
|
|
| 775 |
return TRUE; |
return TRUE; |
| 776 |
} |
} |
| 824 |
const int IDC_TIMER3 = 302; // challenge で ask4passwd でCheckAuthListFirst が FALSE のとき |
const int IDC_TIMER3 = 302; // challenge で ask4passwd でCheckAuthListFirst が FALSE のとき |
| 825 |
const int autologin_timeout = 10; // ミリ秒 |
const int autologin_timeout = 10; // ミリ秒 |
| 826 |
PTInstVar pvar; |
PTInstVar pvar; |
|
// LOGFONT logfont; |
|
|
// HFONT font; |
|
| 827 |
static BOOL UseControlChar; |
static BOOL UseControlChar; |
| 828 |
static BOOL ShowPassPhrase; |
static BOOL ShowPassPhrase; |
| 829 |
static HICON hIconDropdown; |
static HICON hIconDropdown; |
| 837 |
UseControlChar = TRUE; |
UseControlChar = TRUE; |
| 838 |
ShowPassPhrase = FALSE; |
ShowPassPhrase = FALSE; |
| 839 |
init_auth_dlg(pvar, dlg, &UseControlChar); |
init_auth_dlg(pvar, dlg, &UseControlChar); |
| 840 |
#if 0 |
|
|
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
|
|
GetObject(font, sizeof(LOGFONT), &logfont); |
|
|
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthFont, pvar)) { |
|
|
SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERNAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHPASSWORDCAPTION, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHPASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_REMEMBER_PASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_FORWARD_AGENT, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_RSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_LOCALUSERNAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_HOSTRSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSEPAGEANT, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0)); |
|
|
} |
|
|
else { |
|
|
DlgAuthFont = NULL; |
|
|
} |
|
|
#endif |
|
| 841 |
// "▼"画像をセットする |
// "▼"画像をセットする |
| 842 |
hIconDropdown = LoadImage(hInst, MAKEINTRESOURCE(IDI_DROPDOWN), |
hIconDropdown = LoadImage(hInst, MAKEINTRESOURCE(IDI_DROPDOWN), |
| 843 |
IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); |
IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); |
| 991 |
pvar->auth_state.auth_dialog = NULL; |
pvar->auth_state.auth_dialog = NULL; |
| 992 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 993 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
|
#if 0 |
|
|
if (DlgAuthFont != NULL) { |
|
|
DeleteObject(DlgAuthFont); |
|
|
} |
|
|
#endif |
|
| 994 |
return TRUE; |
return TRUE; |
| 995 |
|
|
| 996 |
case IDC_SSHUSERNAME: |
case IDC_SSHUSERNAME: |
| 1386 |
LPARAM lParam) |
LPARAM lParam) |
| 1387 |
{ |
{ |
| 1388 |
PTInstVar pvar; |
PTInstVar pvar; |
|
// LOGFONT logfont; |
|
|
// HFONT font; |
|
| 1389 |
|
|
| 1390 |
switch (msg) { |
switch (msg) { |
| 1391 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
| 1394 |
SetWindowLong(dlg, DWL_USER, lParam); |
SetWindowLong(dlg, DWL_USER, lParam); |
| 1395 |
|
|
| 1396 |
init_TIS_dlg(pvar, dlg); |
init_TIS_dlg(pvar, dlg); |
| 1397 |
#if 0 |
|
|
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
|
|
GetObject(font, sizeof(LOGFONT), &logfont); |
|
|
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgTisFont, pvar)) { |
|
|
SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHPASSWORD, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0)); |
|
|
} |
|
|
else { |
|
|
DlgTisFont = NULL; |
|
|
} |
|
|
#endif |
|
| 1398 |
// /auth=challenge を追加 (2007.10.5 maya) |
// /auth=challenge を追加 (2007.10.5 maya) |
| 1399 |
if (pvar->ssh2_autologin == 1) { |
if (pvar->ssh2_autologin == 1) { |
| 1400 |
SetDlgItemText(dlg, IDC_SSHPASSWORD, pvar->ssh2_password); |
SetDlgItemText(dlg, IDC_SSHPASSWORD, pvar->ssh2_password); |
| 1409 |
|
|
| 1410 |
switch (LOWORD(wParam)) { |
switch (LOWORD(wParam)) { |
| 1411 |
case IDOK: |
case IDOK: |
|
#if 0 |
|
|
if (DlgTisFont != NULL) { |
|
|
DeleteObject(DlgTisFont); |
|
|
} |
|
|
#endif |
|
| 1412 |
return end_TIS_dlg(pvar, dlg); |
return end_TIS_dlg(pvar, dlg); |
| 1413 |
|
|
| 1414 |
case IDCANCEL: /* kill the connection */ |
case IDCANCEL: /* kill the connection */ |
| 1415 |
pvar->auth_state.auth_dialog = NULL; |
pvar->auth_state.auth_dialog = NULL; |
| 1416 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 1417 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
|
#if 0 |
|
|
if (DlgTisFont != NULL) { |
|
|
DeleteObject(DlgTisFont); |
|
|
} |
|
|
#endif |
|
| 1418 |
return TRUE; |
return TRUE; |
| 1419 |
|
|
| 1420 |
default: |
default: |
| 1586 |
WPARAM wParam, LPARAM lParam) |
WPARAM wParam, LPARAM lParam) |
| 1587 |
{ |
{ |
| 1588 |
PTInstVar pvar; |
PTInstVar pvar; |
|
// LOGFONT logfont; |
|
|
// HFONT font; |
|
| 1589 |
|
|
| 1590 |
switch (msg) { |
switch (msg) { |
| 1591 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
| 1593 |
SetWindowLong(dlg, DWL_USER, lParam); |
SetWindowLong(dlg, DWL_USER, lParam); |
| 1594 |
|
|
| 1595 |
init_default_auth_dlg(pvar, dlg); |
init_default_auth_dlg(pvar, dlg); |
|
#if 0 |
|
|
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
|
|
GetObject(font, sizeof(LOGFONT), &logfont); |
|
|
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthSetupFont, pvar)) { |
|
|
SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERNAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_RSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_LOCALUSERNAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_HOSTRSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_SSHUSEPAGEANT, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDC_CHECKAUTH, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0)); |
|
|
} |
|
|
else { |
|
|
DlgAuthSetupFont = NULL; |
|
|
} |
|
|
#endif |
|
| 1596 |
CenterWindow(dlg, GetParent(dlg)); |
CenterWindow(dlg, GetParent(dlg)); |
| 1597 |
return TRUE; /* because we do not set the focus */ |
return TRUE; /* because we do not set the focus */ |
| 1598 |
|
|
| 1601 |
|
|
| 1602 |
switch (LOWORD(wParam)) { |
switch (LOWORD(wParam)) { |
| 1603 |
case IDOK: |
case IDOK: |
|
#if 0 |
|
|
if (DlgAuthSetupFont != NULL) { |
|
|
DeleteObject(DlgAuthSetupFont); |
|
|
} |
|
|
#endif |
|
| 1604 |
return end_default_auth_dlg(pvar, dlg); |
return end_default_auth_dlg(pvar, dlg); |
| 1605 |
|
|
| 1606 |
case IDCANCEL: |
case IDCANCEL: |
| 1607 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
|
#if 0 |
|
|
if (DlgAuthSetupFont != NULL) { |
|
|
DeleteObject(DlgAuthSetupFont); |
|
|
} |
|
|
#endif |
|
| 1608 |
return TRUE; |
return TRUE; |
| 1609 |
|
|
| 1610 |
case IDC_CHOOSERSAFILE: |
case IDC_CHOOSERSAFILE: |