#include "win_res.h"
#include "storage.h"
#include "dialog.h"
+#include "licence.h"
#include <commctrl.h>
#include <commdlg.h>
recurse = 0;
}
-static int CALLBACK LogProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK LogProc(HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam)
{
int i;
return 0;
}
-static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
char *str = dupprintf("%s Licence", appname);
SetWindowText(hwnd, str);
sfree(str);
-
- SetDlgItemText(hwnd, IDA_TEXT,
- "Copyright 1997-2015 Simon Tatham.\r\n\r\n"
-
- "Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
- "Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas "
- "Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, "
- "Markus Kuhn, Colin Watson, Christopher Staite, and CORE SDI S.A.\r\n\r\n"
-
- "Permission is hereby granted, free of charge, to any person "
- "obtaining a copy of this software and associated documentation "
- "files (the ""Software""), to deal in the Software without restriction, "
- "including without limitation the rights to use, copy, modify, merge, "
- "publish, distribute, sublicense, and/or sell copies of the Software, "
- "and to permit persons to whom the Software is furnished to do so, "
- "subject to the following conditions:\r\n\r\n"
-
- "The above copyright notice and this permission notice shall be "
- "included in all copies or substantial portions of the Software.\r\n\r\n"
-
- "THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT "
- "WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
- "INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
- "MERCHANTABILITY, FITNESS FOR A PARTICULAR "
- "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
- "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "
- "OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
- "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
- "CONNECTION WITH THE SOFTWARE OR THE USE OR "
- "OTHER DEALINGS IN THE SOFTWARE."
-);
+ SetDlgItemText(hwnd, IDA_TEXT, LICENCE_TEXT("\r\n\r\n"));
}
return 1;
case WM_COMMAND:
return 0;
}
-static int CALLBACK AboutProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam)
{
char *str;
char *text = dupprintf
("%s\r\n\r\n%s\r\n\r\n%s",
appname, ver,
- "\251 1997-2015 Simon Tatham. All rights reserved.");
+ "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
SetDlgItemText(hwnd, IDA_TEXT, text);
sfree(text);
}
/*
* Null dialog procedure.
*/
-static int CALLBACK NullDlgProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK NullDlgProc(HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam)
{
return 0;
}
* (Being a dialog procedure, in general it returns 0 if the default
* dialog processing should be performed, and 1 if it should not.)
*/
-static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam)
{
HWND hw, treeview;
struct treeview_faff tvfaff;
return 0;
}
+int askhk(void *frontend, const char *algname, const char *betteralgs,
+ void (*callback)(void *ctx, int result), void *ctx)
+{
+ static const char mbtitle[] = "%s Security Alert";
+ static const char msg[] =
+ "The first host key type we have stored for this server\n"
+ "is %s, which is below the configured warning threshold.\n"
+ "The server also provides the following types of host key\n"
+ "above the threshold, which we do not have stored:\n"
+ "%s\n"
+ "Do you want to continue with this connection?\n";
+ char *message, *title;
+ int mbret;
+
+ message = dupprintf(msg, algname, betteralgs);
+ title = dupprintf(mbtitle, appname);
+ mbret = MessageBox(NULL, message, title,
+ MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2);
+ socket_reselect_all();
+ sfree(message);
+ sfree(title);
+ if (mbret == IDYES)
+ return 1;
+ else
+ return 0;
+}
+
/*
* Ask whether to wipe a session log file before writing to it.
* Returns 2 for wipe, 1 for append, 0 for cancel (don't log).