#include "tree234.h"
#include "winsecur.h"
#include "pageant.h"
+#include "licence.h"
#include <shellapi.h>
/*
* Dialog-box function for the Licence box.
*/
-static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
+static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
+ SetDlgItemText(hwnd, 1000, LICENCE_TEXT("\r\n\r\n"));
return 1;
case WM_COMMAND:
switch (LOWORD(wParam)) {
/*
* Dialog-box function for the About box.
*/
-static int CALLBACK AboutProc(HWND hwnd, UINT msg,
+static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
- SetDlgItemText(hwnd, 100, ver);
+ {
+ char *text = dupprintf
+ ("Pageant\r\n\r\n%s\r\n\r\n%s",
+ ver,
+ "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
+ SetDlgItemText(hwnd, 1000, text);
+ sfree(text);
+ }
return 1;
case WM_COMMAND:
switch (LOWORD(wParam)) {
/*
* Dialog-box function for the passphrase box.
*/
-static int CALLBACK PassphraseProc(HWND hwnd, UINT msg,
+static INT_PTR CALLBACK PassphraseProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
static char **passphrase = NULL;
* comment to use in the passphrase prompt.
*/
while (1) {
- int dlgret;
+ INT_PTR dlgret;
struct PassphraseProcStruct pps;
pps.passphrase = &passphrase;
NULL, PassphraseProc, (LPARAM) &pps);
passphrase_box = NULL;
- sfree(err);
-
if (!dlgret)
goto done; /* operation cancelled */
+ sfree(err);
+
assert(passphrase != NULL);
ret = pageant_add_keyfile(filename, passphrase, &err);
/*
* Dialog-box function for the key list box.
*/
-static int CALLBACK KeyListProc(HWND hwnd, UINT msg,
+static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
struct RSAKey *rkey;
case WM_SYSCOMMAND:
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
case IDM_PUTTY:
- if((int)ShellExecute(hwnd, NULL, putty_path, _T(""), _T(""),
+ if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, _T(""), _T(""),
SW_SHOW) <= 32) {
MessageBox(NULL, "Unable to execute PuTTY!",
"Error", MB_OK | MB_ICONERROR);
GetMenuItemInfo(session_menu, wParam, FALSE, &mii);
strcpy(param, "@");
strcat(param, mii.dwTypeData);
- if((int)ShellExecute(hwnd, NULL, putty_path, param,
+ if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, param,
_T(""), SW_SHOW) <= 32) {
MessageBox(NULL, "Unable to execute PuTTY!", "Error",
MB_OK | MB_ICONERROR);
debug(("couldn't get default SID\n"));
#endif
CloseHandle(filemap);
- sfree(ourself);
return 0;
}
rc));
#endif
CloseHandle(filemap);
- sfree(ourself);
sfree(ourself2);
return 0;
}
!EqualSid(mapowner, ourself2)) {
CloseHandle(filemap);
LocalFree(psd);
- sfree(ourself);
sfree(ourself2);
return 0; /* security ID mismatch! */
}
debug(("security stuff matched\n"));
#endif
LocalFree(psd);
- sfree(ourself);
sfree(ourself2);
} else {
#ifdef DEBUG_IPC
session_menu = CreateMenu();
AppendMenu(systray_menu, MF_ENABLED, IDM_PUTTY, "&New Session");
AppendMenu(systray_menu, MF_POPUP | MF_ENABLED,
- (UINT) session_menu, "&Saved Sessions");
+ (UINT_PTR) session_menu, "&Saved Sessions");
AppendMenu(systray_menu, MF_SEPARATOR, 0, 0);
}
AppendMenu(systray_menu, MF_ENABLED, IDM_VIEWKEYS,