X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwindow.c;h=fc51e57fb2b5fbbe95fbdc37d76831dd7cee2e82;hb=21101c7397e460933635a7bfed813864fc4f88fe;hp=6b5a5c564bfc193e1e8b65f5df83fddb5d9c63dd;hpb=67e5ceb9a8e6bc20fa0e0cf82ee9f89582e94112;p=PuTTY.git diff --git a/windows/window.c b/windows/window.c index 6b5a5c56..fc51e57f 100644 --- a/windows/window.c +++ b/windows/window.c @@ -19,6 +19,7 @@ #include "terminal.h" #include "storage.h" #include "win_res.h" +#include "winsecur.h" #ifndef NO_MULTIMON #include @@ -76,6 +77,11 @@ #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, @@ -385,6 +391,21 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) return 1; } + /* + * Protect our process + */ + { +#ifndef UNPROTECT + 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. */ @@ -3086,7 +3107,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, 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;