#include "terminal.h"
#include "storage.h"
#include "win_res.h"
+#include "winsecur.h"
#ifndef NO_MULTIMON
#include <multimon.h>
#define WHEEL_DELTA 120
#endif
+/* VK_PACKET, used to send Unicode characters in WM_KEYDOWNs */
+#ifndef VK_PACKET
+#define VK_PACKET 0xE7
+#endif
+
static Mouse_Button translate_button(Mouse_Button button);
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
{
}
+int frontend_is_utf8(void *frontend)
+{
+ return ucsdata.line_codepage == CP_UTF8;
+}
+
char *get_ttymode(void *frontend, const char *mode)
{
return term_get_ttymode(term, mode);
HRESULT hr;
int guess_width, guess_height;
+ dll_hijacking_protection();
+
hinst = inst;
hwnd = NULL;
flags = FLAG_VERBOSE | FLAG_INTERACTIVE;
InitCommonControls();
+ /* Set Explicit App User Model Id so that jump lists don't cause
+ PuTTY to hang on to removable media. */
+
+ set_explicit_app_user_model_id();
+
/* Ensure a Maximize setting in Explorer doesn't maximise the
* config box. */
defuse_showwindow();
return 1;
}
+ /*
+ * Protect our process
+ */
+ {
+#if !defined UNPROTECT && !defined NO_SECURITY
+ char *error = NULL;
+ if (! setprocessacl(error)) {
+ char *message = dupprintf("Could not restrict process ACL: %s",
+ error);
+ logevent(NULL, message);
+ sfree(message);
+ sfree(error);
+ }
+#endif
+ }
/*
* Process the command line.
*/
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_ENABLED, IDM_NEWSESS, "Ne&w Session...");
AppendMenu(m, MF_ENABLED, IDM_DUPSESS, "&Duplicate Session");
- AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT) savedsess_menu,
+ AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT_PTR) savedsess_menu,
"Sa&ved Sessions");
AppendMenu(m, MF_ENABLED, IDM_RECONF, "Chan&ge Settings...");
AppendMenu(m, MF_SEPARATOR, 0, 0);
saved_menu = new_menu; /* XXX lame stacking */
new_menu = CreatePopupMenu();
AppendMenu(saved_menu, MF_POPUP | MF_ENABLED,
- (UINT) new_menu, specials[i].name);
+ (UINT_PTR) new_menu, specials[i].name);
break;
case TS_EXITMENU:
nesting--;
for (j = 0; j < lenof(popup_menus); j++) {
if (specials_menu) {
/* XXX does this free up all submenus? */
- DeleteMenu(popup_menus[j].menu, (UINT)specials_menu, MF_BYCOMMAND);
+ DeleteMenu(popup_menus[j].menu, (UINT_PTR)specials_menu,
+ MF_BYCOMMAND);
DeleteMenu(popup_menus[j].menu, IDM_SPECIALSEP, MF_BYCOMMAND);
}
if (new_menu) {
InsertMenu(popup_menus[j].menu, IDM_SHOWLOG,
MF_BYCOMMAND | MF_POPUP | MF_ENABLED,
- (UINT) new_menu, "S&pecial Command");
+ (UINT_PTR) new_menu, "S&pecial Command");
InsertMenu(popup_menus[j].menu, IDM_SHOWLOG,
MF_BYCOMMAND | MF_SEPARATOR, IDM_SPECIALSEP, 0);
}
unsigned char buf[20];
int len;
- if (wParam == VK_PROCESSKEY) { /* IME PROCESS key */
+ if (wParam == VK_PROCESSKEY || /* IME PROCESS key */
+ wParam == VK_PACKET) { /* 'this key is a Unicode char' */
if (message == WM_KEYDOWN) {
MSG m;
m.hwnd = hwnd;