Merge branch 'x64' into trunk
@@ -72,8 +72,8 @@ | ||
72 | 72 | event = 0; |
73 | 73 | } |
74 | 74 | } |
75 | - operator int()const { | |
76 | - return window == NULL && message == 0 && event == 0 ? 0 : (int) window; | |
75 | + operator HWND() const { | |
76 | + return window == NULL && message == 0 && event == 0 ? 0 : window; | |
77 | 77 | } |
78 | 78 | }; |
79 | 79 | Hashtable<SOCKET, AsyncSelectInfo> table; |
@@ -618,12 +618,14 @@ | ||
618 | 618 | HANDLE getTask(ConnectionInfo* info) { |
619 | 619 | if (info == NULL) |
620 | 620 | return NULL; |
621 | - return (HANDLE) -info->addr.S_un.S_un_b.s_b4; | |
621 | + // s_b4のマイナスの値をハンドルとして使用する | |
622 | + return (HANDLE)(intptr_t)-info->addr.S_un.S_un_b.s_b4; | |
622 | 623 | } |
623 | 624 | ConnectionInfo* get(HANDLE task) { |
624 | - if ((DWORD) task >= 0) | |
625 | + // ハンドルは数値としてマイナスの値のはず | |
626 | + if ((intptr_t) task >= 0) | |
625 | 627 | return NULL; |
626 | - return get((int) -((long) task) - 1); | |
628 | + return get((int) -((intptr_t) task) - 1); | |
627 | 629 | } |
628 | 630 | ConnectionInfo* get(in_addr addr) { |
629 | 631 | if (addr.S_un.S_un_b.s_b1 != 0 || addr.S_un.S_un_b.s_b2 != 0 || addr.S_un.S_un_b.s_b3 != 0) |
@@ -715,9 +717,8 @@ | ||
715 | 717 | Window conn; |
716 | 718 | Window erro; |
717 | 719 | Window log; |
718 | -// HFONT DlgFont; | |
719 | 720 | protected: |
720 | - virtual bool dispatch(int message, int wParam, long lParam) { | |
721 | + virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) { | |
721 | 722 | if (message == WM_COMMAND && wParam == MAKEWPARAM(IDC_REFER, BN_CLICKED)) { |
722 | 723 | char buffer[1024]; |
723 | 724 | char uimsg[MAX_UIMSG]; |
@@ -890,7 +891,7 @@ | ||
890 | 891 | EditBoxCtrl pass; |
891 | 892 | bool lock; |
892 | 893 | protected: |
893 | - virtual bool dispatch(int message, int wParam, long lParam) { | |
894 | + virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) { | |
894 | 895 | if (message == WM_COMMAND) { |
895 | 896 | switch (wParam) { |
896 | 897 | case MAKEWPARAM(IDC_OPTIONS, BN_CLICKED): |
@@ -191,10 +191,6 @@ | ||
191 | 191 | getInstance().ts->UILanguageFile, _TRUNCATE); |
192 | 192 | } |
193 | 193 | |
194 | - static BOOL CALLBACK EnumProc(HMODULE, const char*, const char*, WORD langid, LONG lParam) { | |
195 | - *((WORD*) lParam) = langid; | |
196 | - return FALSE; | |
197 | - } | |
198 | 194 | static void PASCAL TTXInit(PTTSet ts, PComVar cv) { |
199 | 195 | getInstance().ts = ts; |
200 | 196 | getInstance().cv = cv; |
@@ -31,7 +31,7 @@ | ||
31 | 31 | initializeing = next; |
32 | 32 | return prev; |
33 | 33 | } |
34 | - static BOOL CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) { | |
34 | + static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) { | |
35 | 35 | Map& map = getMap(); |
36 | 36 | Dialog* target = map.get(dialog); |
37 | 37 | if (target == NULL) { |
@@ -53,7 +53,7 @@ | ||
53 | 53 | || message == WM_CTLCOLORLISTBOX |
54 | 54 | || message == WM_CTLCOLORSCROLLBAR |
55 | 55 | || message == WM_CTLCOLORSTATIC)) { |
56 | - result = (BOOL) ::GetWindowLong(dialog, DWL_MSGRESULT); | |
56 | + result = (BOOL) ::GetWindowLongPtr(dialog, DWLP_MSGRESULT); | |
57 | 57 | } |
58 | 58 | return result; |
59 | 59 | } |
@@ -87,7 +87,7 @@ | ||
87 | 87 | } |
88 | 88 | |
89 | 89 | void setResult(LRESULT result) { |
90 | - SetWindowLong(DWL_MSGRESULT, result); | |
90 | + SetWindowLongPtr(DWLP_MSGRESULT, result); | |
91 | 91 | } |
92 | 92 | int getDefID()const { |
93 | 93 | return LOWORD(SendMessage(DM_GETDEFID)); |
@@ -118,7 +118,7 @@ | ||
118 | 118 | #endif |
119 | 119 | } |
120 | 120 | protected: |
121 | - virtual bool dispatch(int message, int wparam, long lparam) { | |
121 | + virtual bool dispatch(UINT message, WPARAM wparam, LPARAM lparam) { | |
122 | 122 | switch (message) { |
123 | 123 | case WM_INITDIALOG: |
124 | 124 | return onInitDialog(); |
@@ -27,8 +27,10 @@ | ||
27 | 27 | } |
28 | 28 | HASHCODE(const void* value):value((int)(uintptr_t) value) { |
29 | 29 | } |
30 | - HASHCODE(const FARPROC value):value((int)(uintptr_t) value) { | |
30 | + HASHCODE(const FARPROC value) :value((int)(uintptr_t)value) { | |
31 | 31 | } |
32 | + HASHCODE(SOCKET value) :value((int)(uintptr_t)value) { | |
33 | + } | |
32 | 34 | HASHCODE(int value):value(value) { |
33 | 35 | } |
34 | 36 | operator int()const { |
@@ -30,11 +30,11 @@ | ||
30 | 30 | return window; |
31 | 31 | } |
32 | 32 | |
33 | - long GetWindowLong(int index)const { | |
34 | - return ::GetWindowLong(window, index); | |
33 | + LONG_PTR GetWindowLongPtr(int index)const { | |
34 | + return ::GetWindowLongPtr(window, index); | |
35 | 35 | } |
36 | - long SetWindowLong(int index, long data) { | |
37 | - return ::SetWindowLong(window, index, data); | |
36 | + LONG_PTR SetWindowLongPtr(int index, LONG_PTR data) { | |
37 | + return ::SetWindowLongPtr(window, index, data); | |
38 | 38 | } |
39 | 39 | int GetWindowTextLength()const { |
40 | 40 | return ::GetWindowTextLength(window); |
@@ -51,10 +51,10 @@ | ||
51 | 51 | bool SetWindowText(const char* text) { |
52 | 52 | return ::SetWindowText(window, text) != FALSE; |
53 | 53 | } |
54 | - long SendMessage(int message, int wparam = 0, long lparam = 0)const { | |
54 | + LRESULT SendMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const { | |
55 | 55 | return ::SendMessage(window, message, wparam, lparam); |
56 | 56 | } |
57 | - long PostMessage(int message, int wparam = 0, long lparam = 0)const { | |
57 | + LRESULT PostMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const { | |
58 | 58 | return ::PostMessage(window, message, wparam, lparam); |
59 | 59 | } |
60 | 60 | HWND GetParent()const { |
@@ -63,10 +63,10 @@ | ||
63 | 63 | bool EnableWindow(bool enabled) { |
64 | 64 | return ::EnableWindow(window, enabled) != FALSE; |
65 | 65 | } |
66 | - long DefWindowProc(int message, int wparam, long lparam) { | |
66 | + LRESULT DefWindowProc(int message, int wparam, long lparam) { | |
67 | 67 | return ::DefWindowProc(window, message, wparam, lparam); |
68 | 68 | } |
69 | - long CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) { | |
69 | + LRESULT CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) { | |
70 | 70 | return ::CallWindowProc(proc, window, message, wParam, lParam); |
71 | 71 | } |
72 | 72 | bool ShowWindow(int command) { |
@@ -90,7 +90,7 @@ | ||
90 | 90 | bool IsZoomed()const { |
91 | 91 | return ::IsZoomed(window) != FALSE; |
92 | 92 | } |
93 | - int SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) { | |
93 | + UINT_PTR SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) { | |
94 | 94 | return ::SetTimer(window, id, elapse, timerProc); |
95 | 95 | } |
96 | 96 | bool KillTimer(int id) { |
@@ -236,11 +236,11 @@ | ||
236 | 236 | } |
237 | 237 | return MessageBox(message, top.GetWindowText(), type); |
238 | 238 | } |
239 | - long GetClassLong(int index)const { | |
240 | - return ::GetClassLong(window, index); | |
239 | + ULONG_PTR GetClassLongPtr(int index)const { | |
240 | + return ::GetClassLongPtr(window, index); | |
241 | 241 | } |
242 | - long SetClassLong(int index, long data) { | |
243 | - return ::SetClassLong(window, index, data); | |
242 | + ULONG_PTR SetClassLongPtr(int index, LONG_PTR data) { | |
243 | + return ::SetClassLongPtr(window, index, data); | |
244 | 244 | } |
245 | 245 | |
246 | 246 | bool create(long exStyle, const char* classname, const char* title, long style, const RECT& rect, HWND parent, HMENU menu, void* param = NULL) { |
@@ -266,29 +266,29 @@ | ||
266 | 266 | HICON setIcon(HICON icon, bool large) { |
267 | 267 | return (HICON) SendMessage(WM_SETICON, large, (LPARAM) icon); |
268 | 268 | } |
269 | - long getStyle()const { | |
270 | - return GetWindowLong(GWL_STYLE); | |
269 | + LONG_PTR getStyle()const { | |
270 | + return GetWindowLongPtr(GWL_STYLE); | |
271 | 271 | } |
272 | - long getExStyle()const { | |
273 | - return GetWindowLong(GWL_EXSTYLE); | |
272 | + LONG_PTR getExStyle()const { | |
273 | + return GetWindowLongPtr(GWL_EXSTYLE); | |
274 | 274 | } |
275 | - long setStyle(long style) { | |
276 | - return SetWindowLong(GWL_STYLE, style); | |
275 | + LONG_PTR setStyle(LONG_PTR style) { | |
276 | + return SetWindowLongPtr(GWL_STYLE, style); | |
277 | 277 | } |
278 | - long setExStyle(long exStyle) { | |
279 | - return SetWindowLong(GWL_EXSTYLE, exStyle); | |
278 | + LONG_PTR setExStyle(LONG_PTR exStyle) { | |
279 | + return SetWindowLongPtr(GWL_EXSTYLE, exStyle); | |
280 | 280 | } |
281 | 281 | WNDPROC getWndProc()const { |
282 | - return (WNDPROC) GetWindowLong(GWL_WNDPROC); | |
282 | + return (WNDPROC) GetWindowLongPtr(GWLP_WNDPROC); | |
283 | 283 | } |
284 | 284 | WNDPROC setWndProc(WNDPROC proc) { |
285 | - return (WNDPROC) SetWindowLong(GWL_WNDPROC, (long) proc); | |
285 | + return (WNDPROC) SetWindowLongPtr(GWLP_WNDPROC, (LONG_PTR) proc); | |
286 | 286 | } |
287 | 287 | HWND getOwner()const { |
288 | - return (HWND) GetWindowLong(GWL_HWNDPARENT); | |
288 | + return (HWND) GetWindowLongPtr(GWLP_HWNDPARENT); | |
289 | 289 | } |
290 | 290 | HWND setOwner(HWND owner) { |
291 | - return (HWND) SetWindowLong(GWL_HWNDPARENT, (long) owner); | |
291 | + return (HWND) SetWindowLongPtr(GWLP_HWNDPARENT, (LONG_PTR) owner); | |
292 | 292 | } |
293 | 293 | HWND getChildWindow()const { |
294 | 294 | return GetWindow(GW_CHILD); |
@@ -312,7 +312,7 @@ | ||
312 | 312 | #define WS_EX_LAYERED 0x80000 |
313 | 313 | #endif |
314 | 314 | void setAlpha(BYTE alpha) { |
315 | - long exStyle = getExStyle(); | |
315 | + LONG_PTR exStyle = getExStyle(); | |
316 | 316 | if ((exStyle & WS_EX_LAYERED) == 0) |
317 | 317 | setExStyle(exStyle | WS_EX_LAYERED); |
318 | 318 | SetLayeredWindowAttributes(alpha, 2); |
@@ -322,41 +322,43 @@ | ||
322 | 322 | return rect; |
323 | 323 | } |
324 | 324 | ATOM getClassAtom()const { |
325 | - return (ATOM) GetClassLong(GCW_ATOM); | |
325 | + return (ATOM) GetClassLongPtr(GCW_ATOM); | |
326 | 326 | } |
327 | - long getClassExtra()const { | |
328 | - return GetClassLong(GCL_CBCLSEXTRA); | |
327 | + LONG_PTR getClassExtra()const { | |
328 | + return GetClassLongPtr(GCL_CBCLSEXTRA); | |
329 | 329 | } |
330 | - long getWindowExtra()const { | |
331 | - return GetClassLong(GCL_CBWNDEXTRA); | |
330 | + LONG_PTR getWindowExtra()const { | |
331 | + return GetClassLongPtr(GCL_CBWNDEXTRA); | |
332 | 332 | } |
333 | 333 | HBRUSH getBackgroundBrush()const { |
334 | - return (HBRUSH) GetClassLong(GCL_HBRBACKGROUND); | |
334 | + return (HBRUSH) GetClassLongPtr(GCLP_HBRBACKGROUND); | |
335 | 335 | } |
336 | 336 | HCURSOR getClassCursor()const { |
337 | - return (HCURSOR) GetClassLong(GCL_HCURSOR); | |
337 | + return (HCURSOR) GetClassLongPtr(GCLP_HCURSOR); | |
338 | 338 | } |
339 | 339 | HICON getClassIcon()const { |
340 | - return (HICON) GetClassLong(GCL_HICON); | |
340 | + return (HICON) GetClassLongPtr(GCLP_HICON); | |
341 | 341 | } |
342 | 342 | HICON getClassSmallIcon()const { |
343 | - return (HICON) GetClassLong(GCL_HICONSM); | |
343 | + return (HICON) GetClassLongPtr(GCLP_HICONSM); | |
344 | 344 | } |
345 | 345 | HINSTANCE getClassInstance()const { |
346 | - return (HINSTANCE) GetClassLong(GCL_HMODULE); | |
346 | + return (HINSTANCE) GetClassLongPtr(GCLP_HMODULE); | |
347 | 347 | } |
348 | - int getMenuResourceId()const { | |
349 | - return GetClassLong(GCL_MENUNAME); | |
348 | + LONG_PTR getMenuResourceId()const { | |
349 | + return GetClassLongPtr(GCLP_MENUNAME); | |
350 | 350 | } |
351 | - int getClassStyle()const { | |
352 | - return GetClassLong(GCL_STYLE); | |
351 | + LONG_PTR getClassStyle()const { | |
352 | + return GetClassLongPtr(GCL_STYLE); | |
353 | 353 | } |
354 | 354 | WNDPROC getClassWindowProc()const { |
355 | - return (WNDPROC) GetClassLong(GCL_WNDPROC); | |
355 | + return (WNDPROC) GetClassLongPtr(GCLP_WNDPROC); | |
356 | 356 | } |
357 | 357 | }; |
358 | 358 | |
359 | +#if defined(_MSC_VER) | |
359 | 360 | #pragma comment(lib, "user32.lib") |
361 | +#endif | |
360 | 362 | } |
361 | 363 | |
362 | 364 | #endif//_YCL_WINDOWS_H_ |
@@ -14,13 +14,10 @@ | ||
14 | 14 | ttpset |
15 | 15 | PROPERTIES FOLDER teraterm) |
16 | 16 | |
17 | -#if((NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" AND ${CMAKE_MAKE_PROGRAM} MATCHES "VCExpress.exe")) AND (NOT(MINGW))) | |
18 | - # MFCを使用しているため VS2005 Express ではビルドできない | |
19 | - add_subdirectory(ttpmacro) | |
20 | - set_target_properties( | |
21 | - ttpmacro | |
22 | - PROPERTIES FOLDER teraterm) | |
23 | -#endif() | |
17 | +add_subdirectory(ttpmacro) | |
18 | +set_target_properties( | |
19 | + ttpmacro | |
20 | + PROPERTIES FOLDER teraterm) | |
24 | 21 | |
25 | 22 | add_subdirectory(ttptek) |
26 | 23 | set_target_properties( |
@@ -352,7 +352,7 @@ | ||
352 | 352 | |
353 | 353 | AppendMenu(PopupBase, |
354 | 354 | submenu != NULL ? LOBYTE(state) | MF_POPUP : state, |
355 | - submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i), | |
355 | + submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i), | |
356 | 356 | itemText); |
357 | 357 | } |
358 | 358 | } |
@@ -9,7 +9,7 @@ | ||
9 | 9 | type="win32" |
10 | 10 | name="Microsoft.Windows.Common-Controls" |
11 | 11 | version="6.0.0.0" |
12 | - processorArchitecture="X86" | |
12 | + processorArchitecture="*" | |
13 | 13 | publicKeyToken="6595b64144ccf1df" |
14 | 14 | language="*" |
15 | 15 | /> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /* |
2 | 2 | * Copyright (C) 1994-1998 T. Teranishi |
3 | 3 | * (C) Robert O'Callahan |
4 | - * (C) 2004-2017 TeraTerm Project | |
4 | + * (C) 2004-2019 TeraTerm Project | |
5 | 5 | * All rights reserved. |
6 | 6 | * |
7 | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -118,7 +118,7 @@ | ||
118 | 118 | if (1) { |
119 | 119 | char buf[1024]; |
120 | 120 | struct _finddata_t searchData; |
121 | - long searchHandle; | |
121 | + intptr_t searchHandle; | |
122 | 122 | |
123 | 123 | _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\TTX*.DLL", ts->HomeDir); |
124 | 124 |
@@ -445,8 +445,14 @@ | ||
445 | 445 | if(spiVersion[2] != 'I' || spiVersion[3] != 'N') |
446 | 446 | goto error; |
447 | 447 | |
448 | +#if !defined(_M_X64) | |
448 | 449 | if(!(SPI_IsSupported)(nameFile,(unsigned long)bufFile)) |
449 | 450 | goto error; |
451 | +#else | |
452 | + // TODO ポインタを unsigned long に変換している | |
453 | + // 64bit版Susie Plug-in が存在する? | |
454 | + goto error; | |
455 | +#endif | |
450 | 456 | |
451 | 457 | if((SPI_GetPicture)(bufFile,sizeFile,1,hbmi,hbuf,NULL,0)) |
452 | 458 | goto error; |
@@ -254,6 +254,7 @@ | ||
254 | 254 | // (2007.9.30 yutaka) |
255 | 255 | // |
256 | 256 | // 例外コードを文字列へ変換する |
257 | +#if !defined(_M_X64) | |
257 | 258 | static const char *GetExceptionString(DWORD exception) |
258 | 259 | { |
259 | 260 | #define EXCEPTION(x) case EXCEPTION_##x: return (#x); |
@@ -443,6 +444,7 @@ | ||
443 | 444 | // return (EXCEPTION_EXECUTE_HANDLER); /* そのままプロセスを終了させる */ |
444 | 445 | return (EXCEPTION_CONTINUE_SEARCH); /* 引き続き[アプリケーションエラー]ポップアップメッセージボックスを呼び出す */ |
445 | 446 | } |
447 | +#endif // !defined(_M_X64 ) | |
446 | 448 | |
447 | 449 | |
448 | 450 | // Virtual Storeが有効であるかどうかを判別する。 |
@@ -548,7 +550,9 @@ | ||
548 | 550 | BOOL isFirstInstance; |
549 | 551 | |
550 | 552 | // 例外ハンドラのフック (2007.9.30 yutaka) |
553 | +#if !defined(_M_X64) | |
551 | 554 | SetUnhandledExceptionFilter(ApplicationFaultHandler); |
555 | +#endif | |
552 | 556 | |
553 | 557 | CommInit(&cv); |
554 | 558 | isFirstInstance = StartTeraTerm(&ts); |
@@ -879,7 +883,7 @@ | ||
879 | 883 | |
880 | 884 | AppendMenu(PopupBase, |
881 | 885 | submenu != NULL ? LOBYTE(state) | MF_POPUP : state, |
882 | - submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i), | |
886 | + submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i), | |
883 | 887 | itemText); |
884 | 888 | } |
885 | 889 | } |
@@ -1297,7 +1301,7 @@ | ||
1297 | 1301 | "&Window", ts.UILanguageFile); |
1298 | 1302 | ::InsertMenu(*Menu,ID_HELPMENU, |
1299 | 1303 | MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION, |
1300 | - (int)WinMenu, ts.UIMsg); | |
1304 | + (UINT_PTR)WinMenu, ts.UIMsg); | |
1301 | 1305 | } |
1302 | 1306 | |
1303 | 1307 | TTXModifyMenu(*Menu); /* TTPLUG */ |
@@ -1821,7 +1825,7 @@ | ||
1821 | 1825 | } |
1822 | 1826 | |
1823 | 1827 | // 終了問い合わせなしにTera Termを終了する。OnAllClose()受信用。 |
1824 | -LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam) | |
1828 | +LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam) | |
1825 | 1829 | { |
1826 | 1830 | // ここで ts の内容を意図的に書き換えても、終了時に自動セーブされるわけではないので、特に問題なし。 |
1827 | 1831 | ts.PortFlag &= ~PF_CONFIRMDISCONN; |
@@ -1971,7 +1975,7 @@ | ||
1971 | 1975 | } |
1972 | 1976 | } |
1973 | 1977 | |
1974 | -LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam) | |
1978 | +LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam) | |
1975 | 1979 | { |
1976 | 1980 | // iniに保存されない、今実行しているTera Termでのみ有効な設定 |
1977 | 1981 | static enum drop_type DefaultDropType = DROP_TYPE_CANCEL; |
@@ -3264,7 +3268,7 @@ | ||
3264 | 3268 | return TTCFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam); |
3265 | 3269 | } |
3266 | 3270 | |
3267 | -LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam) | |
3271 | +LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam) | |
3268 | 3272 | { |
3269 | 3273 | switch (wParam) { |
3270 | 3274 | case IdHold: |
@@ -3357,7 +3361,7 @@ | ||
3357 | 3361 | return 0; |
3358 | 3362 | } |
3359 | 3363 | |
3360 | -LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam) | |
3364 | +LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam) | |
3361 | 3365 | { |
3362 | 3366 | HMENU SysMenu; |
3363 | 3367 | BOOL Show, B1, B2; |
@@ -3398,7 +3402,7 @@ | ||
3398 | 3402 | "&Window", ts.UILanguageFile); |
3399 | 3403 | ::InsertMenu(MainMenu,ID_HELPMENU, |
3400 | 3404 | MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION, |
3401 | - (int)WinMenu, ts.UIMsg); | |
3405 | + (UINT_PTR)WinMenu, ts.UIMsg); | |
3402 | 3406 | } |
3403 | 3407 | else { |
3404 | 3408 | RemoveMenu(MainMenu,ID_HELPMENU,MF_BYPOSITION); |
@@ -5975,7 +5979,7 @@ | ||
5975 | 5979 | } |
5976 | 5980 | |
5977 | 5981 | // WM_COPYDATAの受信 |
5978 | -LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam) | |
5982 | +LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam) | |
5979 | 5983 | { |
5980 | 5984 | COPYDATASTRUCT *cds; |
5981 | 5985 | char *buf, *msg, *name; |
@@ -124,7 +124,7 @@ | ||
124 | 124 | //--> |
125 | 125 | LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam); |
126 | 126 | LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam); |
127 | - LRESULT OnIMEComposition(UINT wParam, LONG lParam); | |
127 | + LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam); | |
128 | 128 | LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam); |
129 | 129 | LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam); |
130 | 130 | LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam); |
@@ -1029,7 +1029,7 @@ | ||
1029 | 1029 | Temp[1] = ' '; |
1030 | 1030 | GetWindowText(Hw,&Temp[2],sizeof(Temp)-3); |
1031 | 1031 | SendDlgItemMessage(HDlg, IList, LB_ADDSTRING, |
1032 | - 0, (LONG)Temp); | |
1032 | + 0, (LPARAM)Temp); | |
1033 | 1033 | if (Hw==HWin) { |
1034 | 1034 | SendDlgItemMessage(HDlg, IList, LB_SETCURSEL, i,0); |
1035 | 1035 | } |
@@ -270,7 +270,7 @@ | ||
270 | 270 | case WM_COMMAND: |
271 | 271 | switch (LOWORD(wParam)) { |
272 | 272 | case IDOK: |
273 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
273 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
274 | 274 | |
275 | 275 | if ( ts!=NULL ) { |
276 | 276 | int width, height; |
@@ -683,7 +683,7 @@ | ||
683 | 683 | return TRUE; |
684 | 684 | |
685 | 685 | case WM_COMMAND: |
686 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
686 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
687 | 687 | RestoreVar(Dialog,ts,&IAttr,&IOffset); |
688 | 688 | switch (LOWORD(wParam)) { |
689 | 689 | case IDOK: |
@@ -935,7 +935,7 @@ | ||
935 | 935 | break; |
936 | 936 | |
937 | 937 | case WM_PAINT: |
938 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
938 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
939 | 939 | if ( ts==NULL ) { |
940 | 940 | return TRUE; |
941 | 941 | } |
@@ -944,7 +944,7 @@ | ||
944 | 944 | break; |
945 | 945 | |
946 | 946 | case WM_HSCROLL: |
947 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
947 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
948 | 948 | if (ts==NULL) { |
949 | 949 | return TRUE; |
950 | 950 | } |
@@ -1203,7 +1203,7 @@ | ||
1203 | 1203 | case WM_COMMAND: |
1204 | 1204 | switch (LOWORD(wParam)) { |
1205 | 1205 | case IDOK: |
1206 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
1206 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
1207 | 1207 | if ( ts!=NULL ) { |
1208 | 1208 | memset(Temp, 0, sizeof(Temp)); |
1209 | 1209 | GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1); |
@@ -1323,7 +1323,7 @@ | ||
1323 | 1323 | case WM_COMMAND: |
1324 | 1324 | switch (LOWORD(wParam)) { |
1325 | 1325 | case IDOK: |
1326 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
1326 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
1327 | 1327 | if (ts!=NULL) { |
1328 | 1328 | WritePrivateProfileString("Hosts",NULL,NULL,ts->SetupFName); |
1329 | 1329 |
@@ -1472,7 +1472,7 @@ | ||
1472 | 1472 | GetRB(Dialog,&w,IDC_TCPIPTELNET,IDC_TCPIPTELNET); |
1473 | 1473 | if (w==1) { |
1474 | 1474 | EnableDlgItem(Dialog,IDC_TCPIPTERMTYPELABEL,IDC_TCPIPTERMTYPE); |
1475 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
1475 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
1476 | 1476 | if (ts!=NULL) { |
1477 | 1477 | SetDlgItemInt(Dialog,IDC_TCPIPPORT,ts->TelPort,FALSE); |
1478 | 1478 | } |
@@ -1623,7 +1623,7 @@ | ||
1623 | 1623 | case WM_COMMAND: |
1624 | 1624 | switch (LOWORD(wParam)) { |
1625 | 1625 | case IDOK: |
1626 | - GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER); | |
1626 | + GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER); | |
1627 | 1627 | if ( GetHNRec!=NULL ) { |
1628 | 1628 | char afstr[BUFSIZ]; |
1629 | 1629 | GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL); |
@@ -1684,7 +1684,7 @@ | ||
1684 | 1684 | case IDC_HOSTTELNET: |
1685 | 1685 | GetRB(Dialog,&i,IDC_HOSTTELNET,IDC_HOSTTELNET); |
1686 | 1686 | if ( i==1 ) { |
1687 | - GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER); | |
1687 | + GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER); | |
1688 | 1688 | if ( GetHNRec!=NULL ) { |
1689 | 1689 | SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TelPort,FALSE); |
1690 | 1690 | } |
@@ -1830,7 +1830,7 @@ | ||
1830 | 1830 | case WM_COMMAND: |
1831 | 1831 | switch (LOWORD(wParam)) { |
1832 | 1832 | case IDOK: |
1833 | - CurDir = (PCHAR)GetWindowLong(Dialog,DWL_USER); | |
1833 | + CurDir = (PCHAR)GetWindowLongPtr(Dialog,DWLP_USER); | |
1834 | 1834 | if ( CurDir!=NULL ) { |
1835 | 1835 | _getcwd(HomeDir,sizeof(HomeDir)); |
1836 | 1836 | _chdir(CurDir); |
@@ -2615,7 +2615,7 @@ | ||
2615 | 2615 | case WM_COMMAND: |
2616 | 2616 | switch (LOWORD(wParam)) { |
2617 | 2617 | case IDOK: |
2618 | - ts = (PTTSet)GetWindowLong(Dialog,DWL_USER); | |
2618 | + ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER); | |
2619 | 2619 | if (ts!=NULL) { |
2620 | 2620 | w = (WORD)GetCurSel(Dialog, IDC_GENPORT); |
2621 | 2621 | if (w>1) { |
@@ -2745,7 +2745,7 @@ | ||
2745 | 2745 | PostMessage(Hw,WM_SYSCOMMAND,SC_CLOSE,0); |
2746 | 2746 | } |
2747 | 2747 | else { |
2748 | - Close = (PBOOL)GetWindowLong(Dialog,DWL_USER); | |
2748 | + Close = (PBOOL)GetWindowLongPtr(Dialog,DWLP_USER); | |
2749 | 2749 | if (Close!=NULL) { |
2750 | 2750 | *Close = TRUE; |
2751 | 2751 | } |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * Copyright (C) 1994-1998 T. Teranishi |
3 | - * (C) 2005-2017 TeraTerm Project | |
3 | + * (C) 2005-2019 TeraTerm Project | |
4 | 4 | * All rights reserved. |
5 | 5 | * |
6 | 6 | * Redistribution and use in source and binary forms, with or without |
@@ -184,7 +184,7 @@ | ||
184 | 184 | WORD BinFlag, val; |
185 | 185 | long opt = 0; |
186 | 186 | |
187 | - pl = (LPLONG)GetWindowLong(Dialog, DWL_USER); | |
187 | + pl = (LPLONG)GetWindowLongPtr(Dialog, DWLP_USER); | |
188 | 188 | if (pl) { |
189 | 189 | GetRB(Dialog, &BinFlag, IDC_FOPTBIN, IDC_FOPTBIN); |
190 | 190 | if (BinFlag) { |
@@ -266,7 +266,7 @@ | ||
266 | 266 | ofn = (LPOPENFILENAME)lParam; |
267 | 267 | pl = (LPLONG)(ofn->lCustData); |
268 | 268 | opt = *pl; |
269 | - SetWindowLong(Dialog, DWL_USER, (LONG)pl); | |
269 | + SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl); | |
270 | 270 | |
271 | 271 | font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0); |
272 | 272 | GetObject(font, sizeof(LOGFONT), &logfont); |
@@ -526,7 +526,7 @@ | ||
526 | 526 | |
527 | 527 | ofn.lpfnHook = (LPOFNHOOKPROC)(&LogFnHook); |
528 | 528 | optl = *Option; |
529 | - ofn.lCustData = (DWORD)&optl; | |
529 | + ofn.lCustData = (LPARAM)&optl; | |
530 | 530 | break; |
531 | 531 | case GTF_SEND: |
532 | 532 | ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; |
@@ -535,7 +535,7 @@ | ||
535 | 535 | |
536 | 536 | ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook); |
537 | 537 | optw = (WORD)*Option; |
538 | - ofn.lCustData = (DWORD)&optw; | |
538 | + ofn.lCustData = (LPARAM)&optw; | |
539 | 539 | break; |
540 | 540 | case GTF_BP: |
541 | 541 | ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; |
@@ -600,7 +600,7 @@ | ||
600 | 600 | case WM_INITDIALOG: |
601 | 601 | ofn = (LPOPENFILENAME)lParam; |
602 | 602 | pw = (LPWORD)ofn->lCustData; |
603 | - SetWindowLong(Dialog, DWL_USER, (LONG)pw); | |
603 | + SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pw); | |
604 | 604 | |
605 | 605 | font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0); |
606 | 606 | GetObject(font, sizeof(LOGFONT), &logfont); |
@@ -630,7 +630,7 @@ | ||
630 | 630 | case WM_COMMAND: // for old style dialog |
631 | 631 | switch (LOWORD(wParam)) { |
632 | 632 | case IDOK: |
633 | - pw = (LPWORD)GetWindowLong(Dialog,DWL_USER); | |
633 | + pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER); | |
634 | 634 | if (pw!=NULL) |
635 | 635 | GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN); |
636 | 636 | if (DlgFoptFont != NULL) { |
@@ -648,7 +648,7 @@ | ||
648 | 648 | notify = (LPOFNOTIFY)lParam; |
649 | 649 | switch (notify->hdr.code) { |
650 | 650 | case CDN_FILEOK: |
651 | - pw = (LPWORD)GetWindowLong(Dialog,DWL_USER); | |
651 | + pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER); | |
652 | 652 | if (pw!=NULL) |
653 | 653 | GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN); |
654 | 654 | if (DlgFoptFont != NULL) { |
@@ -743,7 +743,7 @@ | ||
743 | 743 | ofn.lCustData = 0; |
744 | 744 | if (FuncId==GMF_Z) { |
745 | 745 | ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING; |
746 | - ofn.lCustData = (DWORD)Option; | |
746 | + ofn.lCustData = (LPARAM)Option; | |
747 | 747 | ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook); |
748 | 748 | ofn.lpTemplateName = MAKEINTRESOURCE(IDD_FOPT); |
749 | 749 | } else if (FuncId==GMF_Y) { |
@@ -813,7 +813,7 @@ | ||
813 | 813 | return Ok; |
814 | 814 | } |
815 | 815 | |
816 | -static BOOL CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) | |
816 | +static INT_PTR CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) | |
817 | 817 | { |
818 | 818 | PFileVar fv; |
819 | 819 | char TempFull[MAX_PATH]; |
@@ -825,7 +825,7 @@ | ||
825 | 825 | switch (Message) { |
826 | 826 | case WM_INITDIALOG: |
827 | 827 | fv = (PFileVar)lParam; |
828 | - SetWindowLong(Dialog, DWL_USER, lParam); | |
828 | + SetWindowLongPtr(Dialog, DWLP_USER, lParam); | |
829 | 829 | SendDlgItemMessage(Dialog, IDC_GETFN, EM_LIMITTEXT, sizeof(TempFull)-1,0); |
830 | 830 | |
831 | 831 | font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0); |
@@ -860,7 +860,7 @@ | ||
860 | 860 | return TRUE; |
861 | 861 | |
862 | 862 | case WM_COMMAND: |
863 | - fv = (PFileVar)GetWindowLong(Dialog,DWL_USER); | |
863 | + fv = (PFileVar)GetWindowLongPtr(Dialog,DWLP_USER); | |
864 | 864 | switch (LOWORD(wParam)) { |
865 | 865 | case IDOK: |
866 | 866 | if (fv!=NULL) { |
@@ -894,7 +894,7 @@ | ||
894 | 894 | { |
895 | 895 | return (BOOL)DialogBoxParam(hInst, |
896 | 896 | MAKEINTRESOURCE(IDD_GETFNDLG), |
897 | - HWin, GetFnDlg, (LONG)fv); | |
897 | + HWin, GetFnDlg, (LPARAM)fv); | |
898 | 898 | } |
899 | 899 | |
900 | 900 | void WINAPI SetFileVar(PFileVar fv) |
@@ -990,7 +990,7 @@ | ||
990 | 990 | case WM_INITDIALOG: |
991 | 991 | ofn = (LPOPENFILENAME)lParam; |
992 | 992 | pl = (LPLONG)ofn->lCustData; |
993 | - SetWindowLong(Dialog, DWL_USER, (LONG)pl); | |
993 | + SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl); | |
994 | 994 | |
995 | 995 | font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0); |
996 | 996 | GetObject(font, sizeof(LOGFONT), &logfont); |
@@ -1048,7 +1048,7 @@ | ||
1048 | 1048 | case WM_COMMAND: // for old style dialog |
1049 | 1049 | switch (LOWORD(wParam)) { |
1050 | 1050 | case IDOK: |
1051 | - pl = (LPLONG)GetWindowLong(Dialog,DWL_USER); | |
1051 | + pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER); | |
1052 | 1052 | if (pl!=NULL) |
1053 | 1053 | { |
1054 | 1054 | if (LOWORD(*pl)==0xFFFF) { // Send |
@@ -1083,7 +1083,7 @@ | ||
1083 | 1083 | notify = (LPOFNOTIFY)lParam; |
1084 | 1084 | switch (notify->hdr.code) { |
1085 | 1085 | case CDN_FILEOK: |
1086 | - pl = (LPLONG)GetWindowLong(Dialog,DWL_USER); | |
1086 | + pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER); | |
1087 | 1087 | if (pl!=NULL) { |
1088 | 1088 | if (LOWORD(*pl) == 0xFFFF) { // Send |
1089 | 1089 | Lo = 0xFFFF; |
@@ -1182,7 +1182,7 @@ | ||
1182 | 1182 | } |
1183 | 1183 | ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING; |
1184 | 1184 | ofn.Flags |= OFN_SHOWHELP; |
1185 | - ofn.lCustData = (DWORD)&opt; | |
1185 | + ofn.lCustData = (LPARAM)&opt; | |
1186 | 1186 | ofn.lpstrTitle = fv->DlgCaption; |
1187 | 1187 | ofn.lpfnHook = (LPOFNHOOKPROC)(&XFnHook); |
1188 | 1188 | ofn.lpTemplateName = MAKEINTRESOURCE(IDD_XOPT); |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * Copyright (C) 1994-1998 T. Teranishi |
3 | - * (C) 2005-2017 TeraTerm Project | |
3 | + * (C) 2005-2019 TeraTerm Project | |
4 | 4 | * All rights reserved. |
5 | 5 | * |
6 | 6 | * Redistribution and use in source and binary forms, with or without |
@@ -459,7 +459,7 @@ | ||
459 | 459 | if (::IsIconic(m_hWnd)) { |
460 | 460 | int OldMapMode = GetMapMode(dc); |
461 | 461 | SetMapMode(dc, MM_TEXT); |
462 | - SendMessage(WM_ICONERASEBKGND,(UINT)dc, 0); // TODO | |
462 | + SendMessage(WM_ICONERASEBKGND,(WPARAM)dc, 0); // TODO | |
463 | 463 | DrawIcon(dc, 0, 0, m_hIcon); |
464 | 464 | SetMapMode(dc, OldMapMode); |
465 | 465 | } |
@@ -317,7 +317,7 @@ | ||
317 | 317 | ti.cbSize = sizeof(TOOLINFO); |
318 | 318 | ti.uFlags = TTF_IDISHWND; |
319 | 319 | ti.hwnd = g_hWndMenu; |
320 | - ti.uId = (UINT) ::GetDlgItem(g_hWndMenu, idControl); | |
320 | + ti.uId = (UINT_PTR)::GetDlgItem(g_hWndMenu, idControl); | |
321 | 321 | ti.hinst = 0; |
322 | 322 | ti.lpszText = LPSTR_TEXTCALLBACK; |
323 | 323 |
@@ -656,9 +656,9 @@ | ||
656 | 656 | { |
657 | 657 | HWND passwordControl = GetDlgItem(dlg, item); |
658 | 658 | |
659 | - SetWindowLong(passwordControl, GWL_USERDATA, | |
660 | - SetWindowLong(passwordControl, GWL_WNDPROC, | |
661 | - (LONG) password_wnd_proc)); | |
659 | + SetWindowLongPtr(passwordControl, GWLP_USERDATA, | |
660 | + SetWindowLongPtr(passwordControl, GWLP_WNDPROC, | |
661 | + (LONG_PTR) password_wnd_proc)); | |
662 | 662 | } |
663 | 663 | |
664 | 664 | /* ========================================================================== |
@@ -1416,7 +1416,7 @@ | ||
1416 | 1416 | ModifyMenu(g_hConfigMenu, ID_HOTKEY, MF_BYCOMMAND, ID_HOTKEY, uimsg); |
1417 | 1417 | |
1418 | 1418 | UTIL_get_lang_msg("MENU_EXEC", uimsg, sizeof(uimsg), "Execute", UILanguageFile); |
1419 | - ::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT) g_hListMenu, (LPCTSTR) uimsg); | |
1419 | + ::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT_PTR)g_hListMenu, (LPCTSTR) uimsg); | |
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | return TRUE; |
@@ -2350,7 +2350,7 @@ | ||
2350 | 2350 | Attention : |
2351 | 2351 | Up Date : |
2352 | 2352 | ======1=========2=========3=========4=========5=========6=========7======= */ |
2353 | -BOOL CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2353 | +INT_PTR CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2354 | 2354 | { |
2355 | 2355 | TEXTMETRIC textMetric; |
2356 | 2356 | PDRAWITEMSTRUCT lpdis; |
@@ -2437,7 +2437,7 @@ | ||
2437 | 2437 | Attention : |
2438 | 2438 | Up Date : |
2439 | 2439 | ======1=========2=========3=========4=========5=========6=========7======= */ |
2440 | -BOOL CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2440 | +INT_PTR CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2441 | 2441 | { |
2442 | 2442 | switch(uMsg) { |
2443 | 2443 | case WM_INITDIALOG: |
@@ -2464,7 +2464,7 @@ | ||
2464 | 2464 | Attention : |
2465 | 2465 | Up Date : |
2466 | 2466 | ======1=========2=========3=========4=========5=========6=========7======= */ |
2467 | -BOOL CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2467 | +INT_PTR CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
2468 | 2468 | { |
2469 | 2469 | switch(uMsg) { |
2470 | 2470 | case WM_INITDIALOG: |
@@ -166,9 +166,9 @@ | ||
166 | 166 | BOOL SetDefaultEtcDlg(HWND hWnd); |
167 | 167 | BOOL SetMenuFont(HWND hWnd); |
168 | 168 | BOOL SetTaskTray(HWND hWnd, DWORD dwMessage); |
169 | -BOOL CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
170 | -BOOL CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
171 | -BOOL CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
169 | +INT_PTR CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
170 | +INT_PTR CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
171 | +INT_PTR CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
172 | 172 | LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam); |
173 | 173 | LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
174 | 174 |
@@ -457,6 +457,6 @@ | ||
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
460 | - return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA), | |
460 | + return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA), | |
461 | 461 | control, msg, wParam, lParam); |
462 | 462 | } |
@@ -815,8 +815,8 @@ | ||
815 | 815 | |
816 | 816 | |
817 | 817 | BOOL autologin_sent_none; |
818 | -static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
819 | - LPARAM lParam) | |
818 | +static INT_PTR CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
819 | + LPARAM lParam) | |
820 | 820 | { |
821 | 821 | const int IDC_TIMER1 = 300; // 自動ログインが有効なとき |
822 | 822 | const int IDC_TIMER2 = 301; // サポートされているメソッドを自動チェック(CheckAuthListFirst) |
@@ -832,7 +832,7 @@ | ||
832 | 832 | case WM_INITDIALOG: |
833 | 833 | pvar = (PTInstVar) lParam; |
834 | 834 | pvar->auth_state.auth_dialog = dlg; |
835 | - SetWindowLong(dlg, DWL_USER, lParam); | |
835 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
836 | 836 | |
837 | 837 | UseControlChar = TRUE; |
838 | 838 | ShowPassPhrase = FALSE; |
@@ -869,7 +869,7 @@ | ||
869 | 869 | return FALSE; /* because we set the focus */ |
870 | 870 | |
871 | 871 | case WM_TIMER: |
872 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
872 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
873 | 873 | // 認証準備ができてから、認証データを送信する。早すぎると、落ちる。(2004.12.16 yutaka) |
874 | 874 | if (wParam == IDC_TIMER1) { |
875 | 875 | // 自動ログインのため |
@@ -961,7 +961,7 @@ | ||
961 | 961 | return FALSE; |
962 | 962 | |
963 | 963 | case WM_COMMAND: |
964 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
964 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
965 | 965 | |
966 | 966 | switch (LOWORD(wParam)) { |
967 | 967 | case IDOK: |
@@ -1392,8 +1392,8 @@ | ||
1392 | 1392 | return TRUE; |
1393 | 1393 | } |
1394 | 1394 | |
1395 | -static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1396 | - LPARAM lParam) | |
1395 | +static INT_PTR CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1396 | + LPARAM lParam) | |
1397 | 1397 | { |
1398 | 1398 | PTInstVar pvar; |
1399 | 1399 |
@@ -1401,7 +1401,7 @@ | ||
1401 | 1401 | case WM_INITDIALOG: |
1402 | 1402 | pvar = (PTInstVar) lParam; |
1403 | 1403 | pvar->auth_state.auth_dialog = dlg; |
1404 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1404 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1405 | 1405 | |
1406 | 1406 | init_TIS_dlg(pvar, dlg); |
1407 | 1407 |
@@ -1415,7 +1415,7 @@ | ||
1415 | 1415 | return FALSE; /* because we set the focus */ |
1416 | 1416 | |
1417 | 1417 | case WM_COMMAND: |
1418 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
1418 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
1419 | 1419 | |
1420 | 1420 | switch (LOWORD(wParam)) { |
1421 | 1421 | case IDOK: |
@@ -1593,8 +1593,8 @@ | ||
1593 | 1593 | return TRUE; |
1594 | 1594 | } |
1595 | 1595 | |
1596 | -static BOOL CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg, | |
1597 | - WPARAM wParam, LPARAM lParam) | |
1596 | +static INT_PTR CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg, | |
1597 | + WPARAM wParam, LPARAM lParam) | |
1598 | 1598 | { |
1599 | 1599 | PTInstVar pvar; |
1600 | 1600 |
@@ -1601,7 +1601,7 @@ | ||
1601 | 1601 | switch (msg) { |
1602 | 1602 | case WM_INITDIALOG: |
1603 | 1603 | pvar = (PTInstVar) lParam; |
1604 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1604 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1605 | 1605 | |
1606 | 1606 | init_default_auth_dlg(pvar, dlg); |
1607 | 1607 | CenterWindow(dlg, GetParent(dlg)); |
@@ -1608,7 +1608,7 @@ | ||
1608 | 1608 | return TRUE; /* because we do not set the focus */ |
1609 | 1609 | |
1610 | 1610 | case WM_COMMAND: |
1611 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
1611 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
1612 | 1612 | |
1613 | 1613 | switch (LOWORD(wParam)) { |
1614 | 1614 | case IDOK: |
@@ -529,11 +529,11 @@ | ||
529 | 529 | hInst, NULL); |
530 | 530 | if (pvar->fwd_state.accept_wnd != NULL) { |
531 | 531 | pvar->fwd_state.old_accept_wnd_proc = |
532 | - (WNDPROC) SetWindowLong(pvar->fwd_state.accept_wnd, | |
533 | - GWL_WNDPROC, | |
534 | - (LONG) accept_wnd_proc); | |
535 | - SetWindowLong(pvar->fwd_state.accept_wnd, GWL_USERDATA, | |
536 | - (LONG) pvar); | |
532 | + (WNDPROC) SetWindowLongPtr(pvar->fwd_state.accept_wnd, | |
533 | + GWLP_WNDPROC, | |
534 | + (LONG_PTR) accept_wnd_proc); | |
535 | + SetWindowLongPtr(pvar->fwd_state.accept_wnd, GWLP_USERDATA, | |
536 | + (LONG_PTR) pvar); | |
537 | 537 | } |
538 | 538 | } |
539 | 539 |
@@ -812,7 +812,7 @@ | ||
812 | 812 | static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam, |
813 | 813 | LPARAM lParam) |
814 | 814 | { |
815 | - PTInstVar pvar = (PTInstVar) GetWindowLong(wnd, GWL_USERDATA); | |
815 | + PTInstVar pvar = (PTInstVar) GetWindowLongPtr(wnd, GWLP_USERDATA); | |
816 | 816 | |
817 | 817 | if (msg == WM_SOCK_ACCEPT && |
818 | 818 | (LOWORD(lParam) == FD_READ || LOWORD(lParam) == FD_CLOSE || |
@@ -975,7 +975,7 @@ | ||
975 | 975 | return TRUE; |
976 | 976 | } |
977 | 977 | |
978 | -static BOOL CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
978 | +static UINT_PTR CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
979 | 979 | LPARAM lParam) |
980 | 980 | { |
981 | 981 | FWDEditClosure *closure; |
@@ -985,7 +985,7 @@ | ||
985 | 985 | switch (msg) { |
986 | 986 | case WM_INITDIALOG: |
987 | 987 | closure = (FWDEditClosure *) lParam; |
988 | - SetWindowLong(dlg, DWL_USER, lParam); | |
988 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
989 | 989 | |
990 | 990 | pvar = closure->pvar; |
991 | 991 | init_fwd_edit_dlg(pvar, closure->spec, dlg); |
@@ -993,7 +993,7 @@ | ||
993 | 993 | return FALSE; /* because we set the focus */ |
994 | 994 | |
995 | 995 | case WM_COMMAND: |
996 | - closure = (FWDEditClosure *) GetWindowLong(dlg, DWL_USER); | |
996 | + closure = (FWDEditClosure *) GetWindowLongPtr(dlg, DWLP_USER); | |
997 | 997 | |
998 | 998 | switch (LOWORD(wParam)) { |
999 | 999 | case IDOK: |
@@ -1101,7 +1101,7 @@ | ||
1101 | 1101 | } |
1102 | 1102 | } |
1103 | 1103 | |
1104 | -static BOOL CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1104 | +static UINT_PTR CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1105 | 1105 | LPARAM lParam) |
1106 | 1106 | { |
1107 | 1107 | PTInstVar pvar; |
@@ -1110,7 +1110,7 @@ | ||
1110 | 1110 | switch (msg) { |
1111 | 1111 | case WM_INITDIALOG: |
1112 | 1112 | pvar = (PTInstVar) lParam; |
1113 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1113 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1114 | 1114 | |
1115 | 1115 | init_fwd_dlg(pvar, dlg); |
1116 | 1116 | CenterWindow(dlg, GetParent(dlg)); |
@@ -1117,7 +1117,7 @@ | ||
1117 | 1117 | return TRUE; /* because we do not set the focus */ |
1118 | 1118 | |
1119 | 1119 | case WM_COMMAND: |
1120 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
1120 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
1121 | 1121 | |
1122 | 1122 | switch (LOWORD(wParam)) { |
1123 | 1123 | case IDOK: |
@@ -1714,8 +1714,8 @@ | ||
1714 | 1714 | // TODO: finger printの表示も行う。 |
1715 | 1715 | // (2006.3.25 yutaka) |
1716 | 1716 | // |
1717 | -static BOOL CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1718 | - LPARAM lParam) | |
1717 | +static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1718 | + LPARAM lParam) | |
1719 | 1719 | { |
1720 | 1720 | PTInstVar pvar; |
1721 | 1721 | char uimsg[MAX_UIMSG]; |
@@ -1724,7 +1724,7 @@ | ||
1724 | 1724 | case WM_INITDIALOG: |
1725 | 1725 | pvar = (PTInstVar) lParam; |
1726 | 1726 | pvar->hosts_state.hosts_dialog = dlg; |
1727 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1727 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1728 | 1728 | |
1729 | 1729 | // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある |
1730 | 1730 | GetWindowText(dlg, uimsg, sizeof(uimsg)); |
@@ -1798,7 +1798,7 @@ | ||
1798 | 1798 | return TRUE; /* because we do not set the focus */ |
1799 | 1799 | |
1800 | 1800 | case WM_COMMAND: |
1801 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
1801 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
1802 | 1802 | |
1803 | 1803 | switch (LOWORD(wParam)) { |
1804 | 1804 | case IDC_CONTINUE: |
@@ -1869,8 +1869,8 @@ | ||
1869 | 1869 | // |
1870 | 1870 | // 置き換え時の確認ダイアログを分離 |
1871 | 1871 | // |
1872 | -static BOOL CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1873 | - LPARAM lParam) | |
1872 | +static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
1873 | + LPARAM lParam) | |
1874 | 1874 | { |
1875 | 1875 | PTInstVar pvar; |
1876 | 1876 | char uimsg[MAX_UIMSG]; |
@@ -1879,7 +1879,7 @@ | ||
1879 | 1879 | case WM_INITDIALOG: |
1880 | 1880 | pvar = (PTInstVar) lParam; |
1881 | 1881 | pvar->hosts_state.hosts_dialog = dlg; |
1882 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1882 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1883 | 1883 | |
1884 | 1884 | // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある |
1885 | 1885 | GetWindowText(dlg, uimsg, sizeof(uimsg)); |
@@ -1950,7 +1950,7 @@ | ||
1950 | 1950 | return TRUE; /* because we do not set the focus */ |
1951 | 1951 | |
1952 | 1952 | case WM_COMMAND: |
1953 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
1953 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
1954 | 1954 | |
1955 | 1955 | switch (LOWORD(wParam)) { |
1956 | 1956 | case IDC_CONTINUE: |
@@ -2022,8 +2022,8 @@ | ||
2022 | 2022 | // |
2023 | 2023 | // 同じホストで鍵形式が違う時の追加確認ダイアログを分離 |
2024 | 2024 | // |
2025 | -static BOOL CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
2026 | - LPARAM lParam) | |
2025 | +static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, | |
2026 | + LPARAM lParam) | |
2027 | 2027 | { |
2028 | 2028 | PTInstVar pvar; |
2029 | 2029 | char uimsg[MAX_UIMSG]; |
@@ -2032,7 +2032,7 @@ | ||
2032 | 2032 | case WM_INITDIALOG: |
2033 | 2033 | pvar = (PTInstVar) lParam; |
2034 | 2034 | pvar->hosts_state.hosts_dialog = dlg; |
2035 | - SetWindowLong(dlg, DWL_USER, lParam); | |
2035 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
2036 | 2036 | |
2037 | 2037 | // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある |
2038 | 2038 | GetWindowText(dlg, uimsg, sizeof(uimsg)); |
@@ -2105,7 +2105,7 @@ | ||
2105 | 2105 | return TRUE; /* because we do not set the focus */ |
2106 | 2106 | |
2107 | 2107 | case WM_COMMAND: |
2108 | - pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER); | |
2108 | + pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER); | |
2109 | 2109 | |
2110 | 2110 | switch (LOWORD(wParam)) { |
2111 | 2111 | case IDC_CONTINUE: |
@@ -2161,7 +2161,7 @@ | ||
2161 | 2161 | strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
2162 | 2162 | } |
2163 | 2163 | } |
2164 | - SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf); | |
2164 | + SetDlgItemTextA(dlg, IDC_ADDKEY_EDIT, buf); | |
2165 | 2165 | free(buf); |
2166 | 2166 | } |
2167 | 2167 |
@@ -2168,7 +2168,7 @@ | ||
2168 | 2168 | if (ctx->nold > 0) { |
2169 | 2169 | buf_len = 100 * ctx->nold; |
2170 | 2170 | buf = calloc(100, ctx->nold); |
2171 | - SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)""); | |
2171 | + SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, ""); | |
2172 | 2172 | for (i = 0; i < ctx->nold; i++) { |
2173 | 2173 | switch (dgst_alg) { |
2174 | 2174 | case SSH_DIGEST_MD5: |
@@ -2189,12 +2189,12 @@ | ||
2189 | 2189 | strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
2190 | 2190 | } |
2191 | 2191 | } |
2192 | - SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf); | |
2192 | + SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, buf); | |
2193 | 2193 | free(buf); |
2194 | 2194 | } |
2195 | 2195 | } |
2196 | 2196 | |
2197 | -static BOOL CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) | |
2197 | +static UINT_PTR CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) | |
2198 | 2198 | { |
2199 | 2199 | PTInstVar pvar; |
2200 | 2200 | char buf[1024]; |
@@ -2205,7 +2205,7 @@ | ||
2205 | 2205 | switch (msg) { |
2206 | 2206 | case WM_INITDIALOG: |
2207 | 2207 | pvar = (PTInstVar)lParam; |
2208 | - SetWindowLong(dlg, DWL_USER, lParam); | |
2208 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
2209 | 2209 | |
2210 | 2210 | GetWindowText(dlg, uimsg, sizeof(uimsg)); |
2211 | 2211 | UTIL_get_lang_msg("DLG_HOSTKEY_ROTATION_TITLE", pvar, uimsg); |
@@ -2249,7 +2249,7 @@ | ||
2249 | 2249 | return TRUE; /* because we do not set the focus */ |
2250 | 2250 | |
2251 | 2251 | case WM_COMMAND: |
2252 | - pvar = (PTInstVar)GetWindowLong(dlg, DWL_USER); | |
2252 | + pvar = (PTInstVar)GetWindowLongPtr(dlg, DWLP_USER); | |
2253 | 2253 | |
2254 | 2254 | switch (LOWORD(wParam)) { |
2255 | 2255 | case IDOK: |
@@ -2329,6 +2329,7 @@ | ||
2329 | 2329 | buffer_t *bsig = NULL; |
2330 | 2330 | char *cp, *sig; |
2331 | 2331 | size_t i, ndone, siglen; |
2332 | + int siglen_i; | |
2332 | 2333 | int ret; |
2333 | 2334 | |
2334 | 2335 | // SSH2 packet format: |
@@ -2384,7 +2385,8 @@ | ||
2384 | 2385 | free(blob); |
2385 | 2386 | blob = NULL; |
2386 | 2387 | |
2387 | - sig = buffer_get_string_msg(bsig, &siglen); | |
2388 | + sig = buffer_get_string_msg(bsig, &siglen_i); | |
2389 | + siglen = siglen_i; | |
2388 | 2390 | // Verify signature |
2389 | 2391 | ret = key_verify(ctx->keys[i], sig, siglen, buffer_ptr(b), buffer_len(b)); |
2390 | 2392 | free(sig); |
@@ -1073,8 +1073,8 @@ | ||
1073 | 1073 | SetFocus(hEdit); |
1074 | 1074 | |
1075 | 1075 | // エディットコントロールのサブクラス化 |
1076 | - hEditProc = (WNDPROC)GetWindowLong(hEdit, GWL_WNDPROC); | |
1077 | - SetWindowLong(hEdit, GWL_WNDPROC, (LONG)EditProc); | |
1076 | + hEditProc = (WNDPROC)GetWindowLongPtr(hEdit, GWLP_WNDPROC); | |
1077 | + SetWindowLongPtr(hEdit, GWLP_WNDPROC, (LONG_PTR)EditProc); | |
1078 | 1078 | |
1079 | 1079 | CenterWindow(hDlgWnd, GetParent(hDlgWnd)); |
1080 | 1080 |
@@ -7427,7 +7427,7 @@ | ||
7427 | 7427 | char new_passwd[PASSWD_MAXLEN]; |
7428 | 7428 | }; |
7429 | 7429 | |
7430 | -static BOOL CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) | |
7430 | +static INT_PTR CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) | |
7431 | 7431 | { |
7432 | 7432 | char old_passwd[PASSWD_MAXLEN]; |
7433 | 7433 | char new_passwd[PASSWD_MAXLEN]; |
@@ -1252,8 +1252,8 @@ | ||
1252 | 1252 | return CallWindowProc(OrigHostnameEditProc, dlg, msg, wParam, lParam); |
1253 | 1253 | } |
1254 | 1254 | |
1255 | -static BOOL CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam, | |
1256 | - LPARAM lParam) | |
1255 | +static INT_PTR CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam, | |
1256 | + LPARAM lParam) | |
1257 | 1257 | { |
1258 | 1258 | static char *ssh_version[] = {"SSH1", "SSH2", NULL}; |
1259 | 1259 | PGetHNRec GetHNRec; |
@@ -1271,7 +1271,7 @@ | ||
1271 | 1271 | switch (msg) { |
1272 | 1272 | case WM_INITDIALOG: |
1273 | 1273 | GetHNRec = (PGetHNRec) lParam; |
1274 | - SetWindowLong(dlg, DWL_USER, lParam); | |
1274 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
1275 | 1275 | |
1276 | 1276 | GetWindowText(dlg, uimsg, sizeof(uimsg)); |
1277 | 1277 | UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg); |
@@ -1348,8 +1348,8 @@ | ||
1348 | 1348 | // C-n/C-p のためにサブクラス化 (2007.9.4 maya) |
1349 | 1349 | hwndHostname = GetDlgItem(dlg, IDC_HOSTNAME); |
1350 | 1350 | hwndHostnameEdit = GetWindow(hwndHostname, GW_CHILD); |
1351 | - OrigHostnameEditProc = (WNDPROC)GetWindowLong(hwndHostnameEdit, GWL_WNDPROC); | |
1352 | - SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)HostnameEditProc); | |
1351 | + OrigHostnameEditProc = (WNDPROC)GetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC); | |
1352 | + SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc); | |
1353 | 1353 | |
1354 | 1354 | CheckRadioButton(dlg, IDC_HOSTTELNET, IDC_HOSTOTHER, |
1355 | 1355 | pvar->settings.Enabled ? IDC_HOSTSSH : GetHNRec-> |
@@ -1478,7 +1478,7 @@ | ||
1478 | 1478 | case WM_COMMAND: |
1479 | 1479 | switch (LOWORD(wParam)) { |
1480 | 1480 | case IDOK: |
1481 | - GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER); | |
1481 | + GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER); | |
1482 | 1482 | if (GetHNRec != NULL) { |
1483 | 1483 | if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) { |
1484 | 1484 | char afstr[BUFSIZ]; |
@@ -1544,12 +1544,12 @@ | ||
1544 | 1544 | } |
1545 | 1545 | } |
1546 | 1546 | } |
1547 | - SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc); | |
1547 | + SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc); | |
1548 | 1548 | EndDialog(dlg, 1); |
1549 | 1549 | return TRUE; |
1550 | 1550 | |
1551 | 1551 | case IDCANCEL: |
1552 | - SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc); | |
1552 | + SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc); | |
1553 | 1553 | EndDialog(dlg, 0); |
1554 | 1554 | return TRUE; |
1555 | 1555 |
@@ -1594,7 +1594,7 @@ | ||
1594 | 1594 | enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled |
1595 | 1595 | hostssh_enabled: |
1596 | 1596 | |
1597 | - GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER); | |
1597 | + GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER); | |
1598 | 1598 | |
1599 | 1599 | if (IsDlgButtonChecked(dlg, IDC_HOSTTELNET)) { |
1600 | 1600 | if (GetHNRec != NULL) |
@@ -2441,8 +2441,8 @@ | ||
2441 | 2441 | return CallWindowProc(g_defAboutDlgEditWndProc, hWnd, msg, wp, lp); |
2442 | 2442 | } |
2443 | 2443 | |
2444 | -static BOOL CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam, | |
2445 | - LPARAM lParam) | |
2444 | +static INT_PTR CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam, | |
2445 | + LPARAM lParam) | |
2446 | 2446 | { |
2447 | 2447 | static HFONT DlgAboutTextFont; |
2448 | 2448 |
@@ -3252,12 +3252,12 @@ | ||
3252 | 3252 | } |
3253 | 3253 | } |
3254 | 3254 | |
3255 | -static BOOL CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam, | |
3256 | - LPARAM lParam) | |
3255 | +static INT_PTR CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam, | |
3256 | + LPARAM lParam) | |
3257 | 3257 | { |
3258 | 3258 | switch (msg) { |
3259 | 3259 | case WM_INITDIALOG: |
3260 | - SetWindowLong(dlg, DWL_USER, lParam); | |
3260 | + SetWindowLongPtr(dlg, DWLP_USER, lParam); | |
3261 | 3261 | init_setup_dlg((PTInstVar) lParam, dlg); |
3262 | 3262 | |
3263 | 3263 | CenterWindow(dlg, GetParent(dlg)); |
@@ -3266,7 +3266,7 @@ | ||
3266 | 3266 | case WM_COMMAND: |
3267 | 3267 | switch (LOWORD(wParam)) { |
3268 | 3268 | case IDOK: |
3269 | - complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWL_USER), dlg); | |
3269 | + complete_setup_dlg((PTInstVar) GetWindowLongPtr(dlg, DWLP_USER), dlg); | |
3270 | 3270 | EndDialog(dlg, 1); |
3271 | 3271 | return TRUE; |
3272 | 3272 | case IDCANCEL: /* there isn't a cancel button, but other Windows |
@@ -3783,7 +3783,7 @@ | ||
3783 | 3783 | // |
3784 | 3784 | // SCP dialog |
3785 | 3785 | // |
3786 | -static BOOL CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam, | |
3786 | +static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam, | |
3787 | 3787 | LPARAM lParam) |
3788 | 3788 | { |
3789 | 3789 | static char sendfile[MAX_PATH] = ""; |
@@ -4172,8 +4172,8 @@ | ||
4172 | 4172 | buffer_free(blob); |
4173 | 4173 | } |
4174 | 4174 | |
4175 | -static BOOL CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam, | |
4176 | - LPARAM lParam) | |
4175 | +static INT_PTR CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam, | |
4176 | + LPARAM lParam) | |
4177 | 4177 | { |
4178 | 4178 | static ssh_keytype key_type; |
4179 | 4179 | static int saved_key_bits; |
@@ -5344,7 +5344,7 @@ | ||
5344 | 5344 | hInst = hInstance; |
5345 | 5345 | pvar = &InstVar; |
5346 | 5346 | __mem_mapping = |
5347 | - CreateFileMapping((HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE, 0, | |
5347 | + CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, | |
5348 | 5348 | sizeof(TS_SSH), TTSSH_FILEMAPNAME); |
5349 | 5349 | if (__mem_mapping == NULL) { |
5350 | 5350 | /* fake it. The settings won't be shared, but what the heck. */ |