The WinSock library is now loaded at run-time, which means we can
[u/mdw/putty] / windlg.c
index c9f96fe..3bdceff 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -1,6 +1,3 @@
-#include <windows.h>
-#include <commctrl.h>
-#include <commdlg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -8,13 +5,15 @@
 #include <ctype.h>
 #include <time.h>
 
-#include "ssh.h"
 #include "putty.h"
-#include "winstuff.h"
+#include "ssh.h"
 #include "win_res.h"
 #include "storage.h"
 #include "dialog.h"
 
+#include <commctrl.h>
+#include <commdlg.h>
+
 #ifdef MSVC4
 #define TVINSERTSTRUCT  TV_INSERTSTRUCT
 #define TVITEM          TV_ITEM
@@ -471,7 +470,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
         */
        ReleaseCapture();
        if (dp.ended)
-           EndDialog(hwnd, dp.endresult ? 1 : 0);
+           SaneEndDialog(hwnd, dp.endresult ? 1 : 0);
        break;
       case WM_NOTIFY:
        if (LOWORD(wParam) == IDCX_TREEVIEW &&
@@ -526,7 +525,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
        if (GetWindowLong(hwnd, GWL_USERDATA) == 1) {
            ret = winctrl_handle_command(&dp, msg, wParam, lParam);
            if (dp.ended && GetCapture() != hwnd)
-               EndDialog(hwnd, dp.endresult ? 1 : 0);
+               SaneEndDialog(hwnd, dp.endresult ? 1 : 0);
        } else
            ret = 0;
        return ret;
@@ -544,7 +543,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
             WinHelp(hwnd, help_path, HELP_QUIT, 0);
             requested_help = FALSE;
         }
-       EndDialog(hwnd, 0);
+       SaneEndDialog(hwnd, 0);
        return 0;
 
        /* Grrr Explorer will maximize Dialogs! */
@@ -611,7 +610,7 @@ int do_config(void)
 
     get_sesslist(&sesslist, TRUE);
     ret =
-       DialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
+       SaneDialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
                  GenericMainDlgProc);
     get_sesslist(&sesslist, FALSE);
 
@@ -643,8 +642,7 @@ int do_reconfig(HWND hwnd)
     dp.data = &cfg;
     dp.shortcuts['g'] = TRUE;         /* the treeview: `Cate&gory' */
 
-    ret =
-       DialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
+    ret = SaneDialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
                  GenericMainDlgProc);
 
     ctrl_free_box(ctrlbox);
@@ -712,7 +710,7 @@ void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
        "The server's host key is not cached in the registry. You\n"
        "have no guarantee that the server is the computer you\n"
        "think it is.\n"
-       "The server's key fingerprint is:\n"
+       "The server's %s key fingerprint is:\n"
        "%s\n"
        "If you trust this host, hit Yes to add the key to\n"
        "%s's cache and carry on connecting.\n"
@@ -729,7 +727,7 @@ void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
        "server administrator has changed the host key, or you\n"
        "have actually connected to another computer pretending\n"
        "to be the server.\n"
-       "The new key fingerprint is:\n"
+       "The new %s key fingerprint is:\n"
        "%s\n"
        "If you were expecting this change and trust the new key,\n"
        "hit Yes to update %s's cache and continue connecting.\n"
@@ -750,7 +748,7 @@ void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
     if (ret == 2) {                   /* key was different */
        int mbret;
        char *message, *title;
-       message = dupprintf(wrongmsg, appname, fingerprint, appname);
+       message = dupprintf(wrongmsg, appname, keytype, fingerprint, appname);
        title = dupprintf(mbtitle, appname);
        mbret = MessageBox(NULL, message, title,
                           MB_ICONWARNING | MB_YESNOCANCEL);
@@ -764,7 +762,7 @@ void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
     if (ret == 1) {                   /* key was absent */
        int mbret;
        char *message, *title;
-       message = dupprintf(absentmsg, fingerprint, appname);
+       message = dupprintf(absentmsg, keytype, fingerprint, appname);
        title = dupprintf(mbtitle, appname);
        mbret = MessageBox(NULL, message, title,
                           MB_ICONWARNING | MB_YESNOCANCEL);