• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7896 (tree)
Time2019-07-30 00:04:08
Authorzmatsuo

Log Message

Merge branch 'x64' into trunk

Change Summary

Incremental Difference

--- trunk/TTProxy/ProxyWSockHook.h (revision 7895)
+++ trunk/TTProxy/ProxyWSockHook.h (revision 7896)
@@ -72,8 +72,8 @@
7272 event = 0;
7373 }
7474 }
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;
7777 }
7878 };
7979 Hashtable<SOCKET, AsyncSelectInfo> table;
@@ -618,12 +618,14 @@
618618 HANDLE getTask(ConnectionInfo* info) {
619619 if (info == NULL)
620620 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;
622623 }
623624 ConnectionInfo* get(HANDLE task) {
624- if ((DWORD) task >= 0)
625+ // ハンドルは数値としてマイナスの値のはず
626+ if ((intptr_t) task >= 0)
625627 return NULL;
626- return get((int) -((long) task) - 1);
628+ return get((int) -((intptr_t) task) - 1);
627629 }
628630 ConnectionInfo* get(in_addr addr) {
629631 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 @@
715717 Window conn;
716718 Window erro;
717719 Window log;
718-// HFONT DlgFont;
719720 protected:
720- virtual bool dispatch(int message, int wParam, long lParam) {
721+ virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
721722 if (message == WM_COMMAND && wParam == MAKEWPARAM(IDC_REFER, BN_CLICKED)) {
722723 char buffer[1024];
723724 char uimsg[MAX_UIMSG];
@@ -890,7 +891,7 @@
890891 EditBoxCtrl pass;
891892 bool lock;
892893 protected:
893- virtual bool dispatch(int message, int wParam, long lParam) {
894+ virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
894895 if (message == WM_COMMAND) {
895896 switch (wParam) {
896897 case MAKEWPARAM(IDC_OPTIONS, BN_CLICKED):
--- trunk/TTProxy/TTProxy.h (revision 7895)
+++ trunk/TTProxy/TTProxy.h (revision 7896)
@@ -191,10 +191,6 @@
191191 getInstance().ts->UILanguageFile, _TRUNCATE);
192192 }
193193
194- static BOOL CALLBACK EnumProc(HMODULE, const char*, const char*, WORD langid, LONG lParam) {
195- *((WORD*) lParam) = langid;
196- return FALSE;
197- }
198194 static void PASCAL TTXInit(PTTSet ts, PComVar cv) {
199195 getInstance().ts = ts;
200196 getInstance().cv = cv;
--- trunk/TTProxy/YCL/include/YCL/Dialog.h (revision 7895)
+++ trunk/TTProxy/YCL/include/YCL/Dialog.h (revision 7896)
@@ -31,7 +31,7 @@
3131 initializeing = next;
3232 return prev;
3333 }
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) {
3535 Map& map = getMap();
3636 Dialog* target = map.get(dialog);
3737 if (target == NULL) {
@@ -53,7 +53,7 @@
5353 || message == WM_CTLCOLORLISTBOX
5454 || message == WM_CTLCOLORSCROLLBAR
5555 || message == WM_CTLCOLORSTATIC)) {
56- result = (BOOL) ::GetWindowLong(dialog, DWL_MSGRESULT);
56+ result = (BOOL) ::GetWindowLongPtr(dialog, DWLP_MSGRESULT);
5757 }
5858 return result;
5959 }
@@ -87,7 +87,7 @@
8787 }
8888
8989 void setResult(LRESULT result) {
90- SetWindowLong(DWL_MSGRESULT, result);
90+ SetWindowLongPtr(DWLP_MSGRESULT, result);
9191 }
9292 int getDefID()const {
9393 return LOWORD(SendMessage(DM_GETDEFID));
@@ -118,7 +118,7 @@
118118 #endif
119119 }
120120 protected:
121- virtual bool dispatch(int message, int wparam, long lparam) {
121+ virtual bool dispatch(UINT message, WPARAM wparam, LPARAM lparam) {
122122 switch (message) {
123123 case WM_INITDIALOG:
124124 return onInitDialog();
--- trunk/TTProxy/YCL/include/YCL/HASHCODE.h (revision 7895)
+++ trunk/TTProxy/YCL/include/YCL/HASHCODE.h (revision 7896)
@@ -27,8 +27,10 @@
2727 }
2828 HASHCODE(const void* value):value((int)(uintptr_t) value) {
2929 }
30- HASHCODE(const FARPROC value):value((int)(uintptr_t) value) {
30+ HASHCODE(const FARPROC value) :value((int)(uintptr_t)value) {
3131 }
32+ HASHCODE(SOCKET value) :value((int)(uintptr_t)value) {
33+ }
3234 HASHCODE(int value):value(value) {
3335 }
3436 operator int()const {
--- trunk/TTProxy/YCL/include/YCL/Window.h (revision 7895)
+++ trunk/TTProxy/YCL/include/YCL/Window.h (revision 7896)
@@ -30,11 +30,11 @@
3030 return window;
3131 }
3232
33- long GetWindowLong(int index)const {
34- return ::GetWindowLong(window, index);
33+ LONG_PTR GetWindowLongPtr(int index)const {
34+ return ::GetWindowLongPtr(window, index);
3535 }
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);
3838 }
3939 int GetWindowTextLength()const {
4040 return ::GetWindowTextLength(window);
@@ -51,10 +51,10 @@
5151 bool SetWindowText(const char* text) {
5252 return ::SetWindowText(window, text) != FALSE;
5353 }
54- long SendMessage(int message, int wparam = 0, long lparam = 0)const {
54+ LRESULT SendMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
5555 return ::SendMessage(window, message, wparam, lparam);
5656 }
57- long PostMessage(int message, int wparam = 0, long lparam = 0)const {
57+ LRESULT PostMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
5858 return ::PostMessage(window, message, wparam, lparam);
5959 }
6060 HWND GetParent()const {
@@ -63,10 +63,10 @@
6363 bool EnableWindow(bool enabled) {
6464 return ::EnableWindow(window, enabled) != FALSE;
6565 }
66- long DefWindowProc(int message, int wparam, long lparam) {
66+ LRESULT DefWindowProc(int message, int wparam, long lparam) {
6767 return ::DefWindowProc(window, message, wparam, lparam);
6868 }
69- long CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
69+ LRESULT CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
7070 return ::CallWindowProc(proc, window, message, wParam, lParam);
7171 }
7272 bool ShowWindow(int command) {
@@ -90,7 +90,7 @@
9090 bool IsZoomed()const {
9191 return ::IsZoomed(window) != FALSE;
9292 }
93- int SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
93+ UINT_PTR SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
9494 return ::SetTimer(window, id, elapse, timerProc);
9595 }
9696 bool KillTimer(int id) {
@@ -236,11 +236,11 @@
236236 }
237237 return MessageBox(message, top.GetWindowText(), type);
238238 }
239- long GetClassLong(int index)const {
240- return ::GetClassLong(window, index);
239+ ULONG_PTR GetClassLongPtr(int index)const {
240+ return ::GetClassLongPtr(window, index);
241241 }
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);
244244 }
245245
246246 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 @@
266266 HICON setIcon(HICON icon, bool large) {
267267 return (HICON) SendMessage(WM_SETICON, large, (LPARAM) icon);
268268 }
269- long getStyle()const {
270- return GetWindowLong(GWL_STYLE);
269+ LONG_PTR getStyle()const {
270+ return GetWindowLongPtr(GWL_STYLE);
271271 }
272- long getExStyle()const {
273- return GetWindowLong(GWL_EXSTYLE);
272+ LONG_PTR getExStyle()const {
273+ return GetWindowLongPtr(GWL_EXSTYLE);
274274 }
275- long setStyle(long style) {
276- return SetWindowLong(GWL_STYLE, style);
275+ LONG_PTR setStyle(LONG_PTR style) {
276+ return SetWindowLongPtr(GWL_STYLE, style);
277277 }
278- long setExStyle(long exStyle) {
279- return SetWindowLong(GWL_EXSTYLE, exStyle);
278+ LONG_PTR setExStyle(LONG_PTR exStyle) {
279+ return SetWindowLongPtr(GWL_EXSTYLE, exStyle);
280280 }
281281 WNDPROC getWndProc()const {
282- return (WNDPROC) GetWindowLong(GWL_WNDPROC);
282+ return (WNDPROC) GetWindowLongPtr(GWLP_WNDPROC);
283283 }
284284 WNDPROC setWndProc(WNDPROC proc) {
285- return (WNDPROC) SetWindowLong(GWL_WNDPROC, (long) proc);
285+ return (WNDPROC) SetWindowLongPtr(GWLP_WNDPROC, (LONG_PTR) proc);
286286 }
287287 HWND getOwner()const {
288- return (HWND) GetWindowLong(GWL_HWNDPARENT);
288+ return (HWND) GetWindowLongPtr(GWLP_HWNDPARENT);
289289 }
290290 HWND setOwner(HWND owner) {
291- return (HWND) SetWindowLong(GWL_HWNDPARENT, (long) owner);
291+ return (HWND) SetWindowLongPtr(GWLP_HWNDPARENT, (LONG_PTR) owner);
292292 }
293293 HWND getChildWindow()const {
294294 return GetWindow(GW_CHILD);
@@ -312,7 +312,7 @@
312312 #define WS_EX_LAYERED 0x80000
313313 #endif
314314 void setAlpha(BYTE alpha) {
315- long exStyle = getExStyle();
315+ LONG_PTR exStyle = getExStyle();
316316 if ((exStyle & WS_EX_LAYERED) == 0)
317317 setExStyle(exStyle | WS_EX_LAYERED);
318318 SetLayeredWindowAttributes(alpha, 2);
@@ -322,41 +322,43 @@
322322 return rect;
323323 }
324324 ATOM getClassAtom()const {
325- return (ATOM) GetClassLong(GCW_ATOM);
325+ return (ATOM) GetClassLongPtr(GCW_ATOM);
326326 }
327- long getClassExtra()const {
328- return GetClassLong(GCL_CBCLSEXTRA);
327+ LONG_PTR getClassExtra()const {
328+ return GetClassLongPtr(GCL_CBCLSEXTRA);
329329 }
330- long getWindowExtra()const {
331- return GetClassLong(GCL_CBWNDEXTRA);
330+ LONG_PTR getWindowExtra()const {
331+ return GetClassLongPtr(GCL_CBWNDEXTRA);
332332 }
333333 HBRUSH getBackgroundBrush()const {
334- return (HBRUSH) GetClassLong(GCL_HBRBACKGROUND);
334+ return (HBRUSH) GetClassLongPtr(GCLP_HBRBACKGROUND);
335335 }
336336 HCURSOR getClassCursor()const {
337- return (HCURSOR) GetClassLong(GCL_HCURSOR);
337+ return (HCURSOR) GetClassLongPtr(GCLP_HCURSOR);
338338 }
339339 HICON getClassIcon()const {
340- return (HICON) GetClassLong(GCL_HICON);
340+ return (HICON) GetClassLongPtr(GCLP_HICON);
341341 }
342342 HICON getClassSmallIcon()const {
343- return (HICON) GetClassLong(GCL_HICONSM);
343+ return (HICON) GetClassLongPtr(GCLP_HICONSM);
344344 }
345345 HINSTANCE getClassInstance()const {
346- return (HINSTANCE) GetClassLong(GCL_HMODULE);
346+ return (HINSTANCE) GetClassLongPtr(GCLP_HMODULE);
347347 }
348- int getMenuResourceId()const {
349- return GetClassLong(GCL_MENUNAME);
348+ LONG_PTR getMenuResourceId()const {
349+ return GetClassLongPtr(GCLP_MENUNAME);
350350 }
351- int getClassStyle()const {
352- return GetClassLong(GCL_STYLE);
351+ LONG_PTR getClassStyle()const {
352+ return GetClassLongPtr(GCL_STYLE);
353353 }
354354 WNDPROC getClassWindowProc()const {
355- return (WNDPROC) GetClassLong(GCL_WNDPROC);
355+ return (WNDPROC) GetClassLongPtr(GCLP_WNDPROC);
356356 }
357357 };
358358
359+#if defined(_MSC_VER)
359360 #pragma comment(lib, "user32.lib")
361+#endif
360362 }
361363
362364 #endif//_YCL_WINDOWS_H_
--- trunk/teraterm/CMakeLists.txt (revision 7895)
+++ trunk/teraterm/CMakeLists.txt (revision 7896)
@@ -14,13 +14,10 @@
1414 ttpset
1515 PROPERTIES FOLDER teraterm)
1616
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)
2421
2522 add_subdirectory(ttptek)
2623 set_target_properties(
--- trunk/teraterm/teraterm/tekwin.cpp (revision 7895)
+++ trunk/teraterm/teraterm/tekwin.cpp (revision 7896)
@@ -352,7 +352,7 @@
352352
353353 AppendMenu(PopupBase,
354354 submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
355- submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
355+ submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
356356 itemText);
357357 }
358358 }
--- trunk/teraterm/teraterm/teraterm.manifest (revision 7895)
+++ trunk/teraterm/teraterm/teraterm.manifest (revision 7896)
@@ -9,7 +9,7 @@
99 type="win32"
1010 name="Microsoft.Windows.Common-Controls"
1111 version="6.0.0.0"
12- processorArchitecture="X86"
12+ processorArchitecture="*"
1313 publicKeyToken="6595b64144ccf1df"
1414 language="*"
1515 />
--- trunk/teraterm/teraterm/ttplug.c (revision 7895)
+++ trunk/teraterm/teraterm/ttplug.c (revision 7896)
@@ -1,7 +1,7 @@
11 /*
22 * Copyright (C) 1994-1998 T. Teranishi
33 * (C) Robert O'Callahan
4- * (C) 2004-2017 TeraTerm Project
4+ * (C) 2004-2019 TeraTerm Project
55 * All rights reserved.
66 *
77 * Redistribution and use in source and binary forms, with or without
@@ -118,7 +118,7 @@
118118 if (1) {
119119 char buf[1024];
120120 struct _finddata_t searchData;
121- long searchHandle;
121+ intptr_t searchHandle;
122122
123123 _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\TTX*.DLL", ts->HomeDir);
124124
--- trunk/teraterm/teraterm/vtdisp.c (revision 7895)
+++ trunk/teraterm/teraterm/vtdisp.c (revision 7896)
@@ -445,8 +445,14 @@
445445 if(spiVersion[2] != 'I' || spiVersion[3] != 'N')
446446 goto error;
447447
448+#if !defined(_M_X64)
448449 if(!(SPI_IsSupported)(nameFile,(unsigned long)bufFile))
449450 goto error;
451+#else
452+ // TODO ポインタを unsigned long に変換している
453+ // 64bit版Susie Plug-in が存在する?
454+ goto error;
455+#endif
450456
451457 if((SPI_GetPicture)(bufFile,sizeFile,1,hbmi,hbuf,NULL,0))
452458 goto error;
--- trunk/teraterm/teraterm/vtwin.cpp (revision 7895)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 7896)
@@ -254,6 +254,7 @@
254254 // (2007.9.30 yutaka)
255255 //
256256 // 例外コードを文字列へ変換する
257+#if !defined(_M_X64)
257258 static const char *GetExceptionString(DWORD exception)
258259 {
259260 #define EXCEPTION(x) case EXCEPTION_##x: return (#x);
@@ -443,6 +444,7 @@
443444 // return (EXCEPTION_EXECUTE_HANDLER); /* そのままプロセスを終了させる */
444445 return (EXCEPTION_CONTINUE_SEARCH); /* 引き続き[アプリケーションエラー]ポップアップメッセージボックスを呼び出す */
445446 }
447+#endif // !defined(_M_X64 )
446448
447449
448450 // Virtual Storeが有効であるかどうかを判別する。
@@ -548,7 +550,9 @@
548550 BOOL isFirstInstance;
549551
550552 // 例外ハンドラのフック (2007.9.30 yutaka)
553+#if !defined(_M_X64)
551554 SetUnhandledExceptionFilter(ApplicationFaultHandler);
555+#endif
552556
553557 CommInit(&cv);
554558 isFirstInstance = StartTeraTerm(&ts);
@@ -879,7 +883,7 @@
879883
880884 AppendMenu(PopupBase,
881885 submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
882- submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
886+ submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
883887 itemText);
884888 }
885889 }
@@ -1297,7 +1301,7 @@
12971301 "&Window", ts.UILanguageFile);
12981302 ::InsertMenu(*Menu,ID_HELPMENU,
12991303 MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
1300- (int)WinMenu, ts.UIMsg);
1304+ (UINT_PTR)WinMenu, ts.UIMsg);
13011305 }
13021306
13031307 TTXModifyMenu(*Menu); /* TTPLUG */
@@ -1821,7 +1825,7 @@
18211825 }
18221826
18231827 // 終了問い合わせなしにTera Termを終了する。OnAllClose()受信用。
1824-LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam)
1828+LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam)
18251829 {
18261830 // ここで ts の内容を意図的に書き換えても、終了時に自動セーブされるわけではないので、特に問題なし。
18271831 ts.PortFlag &= ~PF_CONFIRMDISCONN;
@@ -1971,7 +1975,7 @@
19711975 }
19721976 }
19731977
1974-LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam)
1978+LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam)
19751979 {
19761980 // iniに保存されない、今実行しているTera Termでのみ有効な設定
19771981 static enum drop_type DefaultDropType = DROP_TYPE_CANCEL;
@@ -3264,7 +3268,7 @@
32643268 return TTCFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam);
32653269 }
32663270
3267-LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam)
3271+LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam)
32683272 {
32693273 switch (wParam) {
32703274 case IdHold:
@@ -3357,7 +3361,7 @@
33573361 return 0;
33583362 }
33593363
3360-LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam)
3364+LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam)
33613365 {
33623366 HMENU SysMenu;
33633367 BOOL Show, B1, B2;
@@ -3398,7 +3402,7 @@
33983402 "&Window", ts.UILanguageFile);
33993403 ::InsertMenu(MainMenu,ID_HELPMENU,
34003404 MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
3401- (int)WinMenu, ts.UIMsg);
3405+ (UINT_PTR)WinMenu, ts.UIMsg);
34023406 }
34033407 else {
34043408 RemoveMenu(MainMenu,ID_HELPMENU,MF_BYPOSITION);
@@ -5975,7 +5979,7 @@
59755979 }
59765980
59775981 // WM_COPYDATAの受信
5978-LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam)
5982+LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam)
59795983 {
59805984 COPYDATASTRUCT *cds;
59815985 char *buf, *msg, *name;
--- trunk/teraterm/teraterm/vtwin.h (revision 7895)
+++ trunk/teraterm/teraterm/vtwin.h (revision 7896)
@@ -124,7 +124,7 @@
124124 //-->
125125 LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam);
126126 LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam);
127- LRESULT OnIMEComposition(UINT wParam, LONG lParam);
127+ LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam);
128128 LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam);
129129 LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam);
130130 LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam);
--- trunk/teraterm/ttpcmn/ttcmn.c (revision 7895)
+++ trunk/teraterm/ttpcmn/ttcmn.c (revision 7896)
@@ -1029,7 +1029,7 @@
10291029 Temp[1] = ' ';
10301030 GetWindowText(Hw,&Temp[2],sizeof(Temp)-3);
10311031 SendDlgItemMessage(HDlg, IList, LB_ADDSTRING,
1032- 0, (LONG)Temp);
1032+ 0, (LPARAM)Temp);
10331033 if (Hw==HWin) {
10341034 SendDlgItemMessage(HDlg, IList, LB_SETCURSEL, i,0);
10351035 }
--- trunk/teraterm/ttpdlg/ttdlg.c (revision 7895)
+++ trunk/teraterm/ttpdlg/ttdlg.c (revision 7896)
@@ -270,7 +270,7 @@
270270 case WM_COMMAND:
271271 switch (LOWORD(wParam)) {
272272 case IDOK:
273- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
273+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
274274
275275 if ( ts!=NULL ) {
276276 int width, height;
@@ -683,7 +683,7 @@
683683 return TRUE;
684684
685685 case WM_COMMAND:
686- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
686+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
687687 RestoreVar(Dialog,ts,&IAttr,&IOffset);
688688 switch (LOWORD(wParam)) {
689689 case IDOK:
@@ -935,7 +935,7 @@
935935 break;
936936
937937 case WM_PAINT:
938- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
938+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
939939 if ( ts==NULL ) {
940940 return TRUE;
941941 }
@@ -944,7 +944,7 @@
944944 break;
945945
946946 case WM_HSCROLL:
947- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
947+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
948948 if (ts==NULL) {
949949 return TRUE;
950950 }
@@ -1203,7 +1203,7 @@
12031203 case WM_COMMAND:
12041204 switch (LOWORD(wParam)) {
12051205 case IDOK:
1206- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
1206+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
12071207 if ( ts!=NULL ) {
12081208 memset(Temp, 0, sizeof(Temp));
12091209 GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1);
@@ -1323,7 +1323,7 @@
13231323 case WM_COMMAND:
13241324 switch (LOWORD(wParam)) {
13251325 case IDOK:
1326- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
1326+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
13271327 if (ts!=NULL) {
13281328 WritePrivateProfileString("Hosts",NULL,NULL,ts->SetupFName);
13291329
@@ -1472,7 +1472,7 @@
14721472 GetRB(Dialog,&w,IDC_TCPIPTELNET,IDC_TCPIPTELNET);
14731473 if (w==1) {
14741474 EnableDlgItem(Dialog,IDC_TCPIPTERMTYPELABEL,IDC_TCPIPTERMTYPE);
1475- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
1475+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
14761476 if (ts!=NULL) {
14771477 SetDlgItemInt(Dialog,IDC_TCPIPPORT,ts->TelPort,FALSE);
14781478 }
@@ -1623,7 +1623,7 @@
16231623 case WM_COMMAND:
16241624 switch (LOWORD(wParam)) {
16251625 case IDOK:
1626- GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
1626+ GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
16271627 if ( GetHNRec!=NULL ) {
16281628 char afstr[BUFSIZ];
16291629 GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
@@ -1684,7 +1684,7 @@
16841684 case IDC_HOSTTELNET:
16851685 GetRB(Dialog,&i,IDC_HOSTTELNET,IDC_HOSTTELNET);
16861686 if ( i==1 ) {
1687- GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
1687+ GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
16881688 if ( GetHNRec!=NULL ) {
16891689 SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TelPort,FALSE);
16901690 }
@@ -1830,7 +1830,7 @@
18301830 case WM_COMMAND:
18311831 switch (LOWORD(wParam)) {
18321832 case IDOK:
1833- CurDir = (PCHAR)GetWindowLong(Dialog,DWL_USER);
1833+ CurDir = (PCHAR)GetWindowLongPtr(Dialog,DWLP_USER);
18341834 if ( CurDir!=NULL ) {
18351835 _getcwd(HomeDir,sizeof(HomeDir));
18361836 _chdir(CurDir);
@@ -2615,7 +2615,7 @@
26152615 case WM_COMMAND:
26162616 switch (LOWORD(wParam)) {
26172617 case IDOK:
2618- ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
2618+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
26192619 if (ts!=NULL) {
26202620 w = (WORD)GetCurSel(Dialog, IDC_GENPORT);
26212621 if (w>1) {
@@ -2745,7 +2745,7 @@
27452745 PostMessage(Hw,WM_SYSCOMMAND,SC_CLOSE,0);
27462746 }
27472747 else {
2748- Close = (PBOOL)GetWindowLong(Dialog,DWL_USER);
2748+ Close = (PBOOL)GetWindowLongPtr(Dialog,DWLP_USER);
27492749 if (Close!=NULL) {
27502750 *Close = TRUE;
27512751 }
--- trunk/teraterm/ttpfile/ttfile.c (revision 7895)
+++ trunk/teraterm/ttpfile/ttfile.c (revision 7896)
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 1994-1998 T. Teranishi
3- * (C) 2005-2017 TeraTerm Project
3+ * (C) 2005-2019 TeraTerm Project
44 * All rights reserved.
55 *
66 * Redistribution and use in source and binary forms, with or without
@@ -184,7 +184,7 @@
184184 WORD BinFlag, val;
185185 long opt = 0;
186186
187- pl = (LPLONG)GetWindowLong(Dialog, DWL_USER);
187+ pl = (LPLONG)GetWindowLongPtr(Dialog, DWLP_USER);
188188 if (pl) {
189189 GetRB(Dialog, &BinFlag, IDC_FOPTBIN, IDC_FOPTBIN);
190190 if (BinFlag) {
@@ -266,7 +266,7 @@
266266 ofn = (LPOPENFILENAME)lParam;
267267 pl = (LPLONG)(ofn->lCustData);
268268 opt = *pl;
269- SetWindowLong(Dialog, DWL_USER, (LONG)pl);
269+ SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
270270
271271 font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
272272 GetObject(font, sizeof(LOGFONT), &logfont);
@@ -526,7 +526,7 @@
526526
527527 ofn.lpfnHook = (LPOFNHOOKPROC)(&LogFnHook);
528528 optl = *Option;
529- ofn.lCustData = (DWORD)&optl;
529+ ofn.lCustData = (LPARAM)&optl;
530530 break;
531531 case GTF_SEND:
532532 ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -535,7 +535,7 @@
535535
536536 ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
537537 optw = (WORD)*Option;
538- ofn.lCustData = (DWORD)&optw;
538+ ofn.lCustData = (LPARAM)&optw;
539539 break;
540540 case GTF_BP:
541541 ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -600,7 +600,7 @@
600600 case WM_INITDIALOG:
601601 ofn = (LPOPENFILENAME)lParam;
602602 pw = (LPWORD)ofn->lCustData;
603- SetWindowLong(Dialog, DWL_USER, (LONG)pw);
603+ SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pw);
604604
605605 font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
606606 GetObject(font, sizeof(LOGFONT), &logfont);
@@ -630,7 +630,7 @@
630630 case WM_COMMAND: // for old style dialog
631631 switch (LOWORD(wParam)) {
632632 case IDOK:
633- pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
633+ pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
634634 if (pw!=NULL)
635635 GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
636636 if (DlgFoptFont != NULL) {
@@ -648,7 +648,7 @@
648648 notify = (LPOFNOTIFY)lParam;
649649 switch (notify->hdr.code) {
650650 case CDN_FILEOK:
651- pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
651+ pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
652652 if (pw!=NULL)
653653 GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
654654 if (DlgFoptFont != NULL) {
@@ -743,7 +743,7 @@
743743 ofn.lCustData = 0;
744744 if (FuncId==GMF_Z) {
745745 ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
746- ofn.lCustData = (DWORD)Option;
746+ ofn.lCustData = (LPARAM)Option;
747747 ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
748748 ofn.lpTemplateName = MAKEINTRESOURCE(IDD_FOPT);
749749 } else if (FuncId==GMF_Y) {
@@ -813,7 +813,7 @@
813813 return Ok;
814814 }
815815
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)
817817 {
818818 PFileVar fv;
819819 char TempFull[MAX_PATH];
@@ -825,7 +825,7 @@
825825 switch (Message) {
826826 case WM_INITDIALOG:
827827 fv = (PFileVar)lParam;
828- SetWindowLong(Dialog, DWL_USER, lParam);
828+ SetWindowLongPtr(Dialog, DWLP_USER, lParam);
829829 SendDlgItemMessage(Dialog, IDC_GETFN, EM_LIMITTEXT, sizeof(TempFull)-1,0);
830830
831831 font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
@@ -860,7 +860,7 @@
860860 return TRUE;
861861
862862 case WM_COMMAND:
863- fv = (PFileVar)GetWindowLong(Dialog,DWL_USER);
863+ fv = (PFileVar)GetWindowLongPtr(Dialog,DWLP_USER);
864864 switch (LOWORD(wParam)) {
865865 case IDOK:
866866 if (fv!=NULL) {
@@ -894,7 +894,7 @@
894894 {
895895 return (BOOL)DialogBoxParam(hInst,
896896 MAKEINTRESOURCE(IDD_GETFNDLG),
897- HWin, GetFnDlg, (LONG)fv);
897+ HWin, GetFnDlg, (LPARAM)fv);
898898 }
899899
900900 void WINAPI SetFileVar(PFileVar fv)
@@ -990,7 +990,7 @@
990990 case WM_INITDIALOG:
991991 ofn = (LPOPENFILENAME)lParam;
992992 pl = (LPLONG)ofn->lCustData;
993- SetWindowLong(Dialog, DWL_USER, (LONG)pl);
993+ SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
994994
995995 font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
996996 GetObject(font, sizeof(LOGFONT), &logfont);
@@ -1048,7 +1048,7 @@
10481048 case WM_COMMAND: // for old style dialog
10491049 switch (LOWORD(wParam)) {
10501050 case IDOK:
1051- pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
1051+ pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
10521052 if (pl!=NULL)
10531053 {
10541054 if (LOWORD(*pl)==0xFFFF) { // Send
@@ -1083,7 +1083,7 @@
10831083 notify = (LPOFNOTIFY)lParam;
10841084 switch (notify->hdr.code) {
10851085 case CDN_FILEOK:
1086- pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
1086+ pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
10871087 if (pl!=NULL) {
10881088 if (LOWORD(*pl) == 0xFFFF) { // Send
10891089 Lo = 0xFFFF;
@@ -1182,7 +1182,7 @@
11821182 }
11831183 ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
11841184 ofn.Flags |= OFN_SHOWHELP;
1185- ofn.lCustData = (DWORD)&opt;
1185+ ofn.lCustData = (LPARAM)&opt;
11861186 ofn.lpstrTitle = fv->DlgCaption;
11871187 ofn.lpfnHook = (LPOFNHOOKPROC)(&XFnHook);
11881188 ofn.lpTemplateName = MAKEINTRESOURCE(IDD_XOPT);
--- trunk/teraterm/ttpmacro/ttmmain.cpp (revision 7895)
+++ trunk/teraterm/ttpmacro/ttmmain.cpp (revision 7896)
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 1994-1998 T. Teranishi
3- * (C) 2005-2017 TeraTerm Project
3+ * (C) 2005-2019 TeraTerm Project
44 * All rights reserved.
55 *
66 * Redistribution and use in source and binary forms, with or without
@@ -459,7 +459,7 @@
459459 if (::IsIconic(m_hWnd)) {
460460 int OldMapMode = GetMapMode(dc);
461461 SetMapMode(dc, MM_TEXT);
462- SendMessage(WM_ICONERASEBKGND,(UINT)dc, 0); // TODO
462+ SendMessage(WM_ICONERASEBKGND,(WPARAM)dc, 0); // TODO
463463 DrawIcon(dc, 0, 0, m_hIcon);
464464 SetMapMode(dc, OldMapMode);
465465 }
--- trunk/ttpmenu/ttpmenu.cpp (revision 7895)
+++ trunk/ttpmenu/ttpmenu.cpp (revision 7896)
@@ -317,7 +317,7 @@
317317 ti.cbSize = sizeof(TOOLINFO);
318318 ti.uFlags = TTF_IDISHWND;
319319 ti.hwnd = g_hWndMenu;
320- ti.uId = (UINT) ::GetDlgItem(g_hWndMenu, idControl);
320+ ti.uId = (UINT_PTR)::GetDlgItem(g_hWndMenu, idControl);
321321 ti.hinst = 0;
322322 ti.lpszText = LPSTR_TEXTCALLBACK;
323323
@@ -656,9 +656,9 @@
656656 {
657657 HWND passwordControl = GetDlgItem(dlg, item);
658658
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));
662662 }
663663
664664 /* ==========================================================================
@@ -1416,7 +1416,7 @@
14161416 ModifyMenu(g_hConfigMenu, ID_HOTKEY, MF_BYCOMMAND, ID_HOTKEY, uimsg);
14171417
14181418 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);
14201420 }
14211421
14221422 return TRUE;
@@ -2350,7 +2350,7 @@
23502350 Attention :
23512351 Up Date :
23522352 ======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)
23542354 {
23552355 TEXTMETRIC textMetric;
23562356 PDRAWITEMSTRUCT lpdis;
@@ -2437,7 +2437,7 @@
24372437 Attention :
24382438 Up Date :
24392439 ======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)
24412441 {
24422442 switch(uMsg) {
24432443 case WM_INITDIALOG:
@@ -2464,7 +2464,7 @@
24642464 Attention :
24652465 Up Date :
24662466 ======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)
24682468 {
24692469 switch(uMsg) {
24702470 case WM_INITDIALOG:
--- trunk/ttpmenu/ttpmenu.h (revision 7895)
+++ trunk/ttpmenu/ttpmenu.h (revision 7896)
@@ -166,9 +166,9 @@
166166 BOOL SetDefaultEtcDlg(HWND hWnd);
167167 BOOL SetMenuFont(HWND hWnd);
168168 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);
172172 LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
173173 LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
174174
--- trunk/ttpmenu/winmisc.cpp (revision 7895)
+++ trunk/ttpmenu/winmisc.cpp (revision 7896)
@@ -457,6 +457,6 @@
457457 }
458458 }
459459
460- return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
460+ return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA),
461461 control, msg, wParam, lParam);
462462 }
--- trunk/ttssh2/ttxssh/auth.c (revision 7895)
+++ trunk/ttssh2/ttxssh/auth.c (revision 7896)
@@ -815,8 +815,8 @@
815815
816816
817817 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)
820820 {
821821 const int IDC_TIMER1 = 300; // 自動ログインが有効なとき
822822 const int IDC_TIMER2 = 301; // サポートされているメソッドを自動チェック(CheckAuthListFirst)
@@ -832,7 +832,7 @@
832832 case WM_INITDIALOG:
833833 pvar = (PTInstVar) lParam;
834834 pvar->auth_state.auth_dialog = dlg;
835- SetWindowLong(dlg, DWL_USER, lParam);
835+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
836836
837837 UseControlChar = TRUE;
838838 ShowPassPhrase = FALSE;
@@ -869,7 +869,7 @@
869869 return FALSE; /* because we set the focus */
870870
871871 case WM_TIMER:
872- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
872+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
873873 // 認証準備ができてから、認証データを送信する。早すぎると、落ちる。(2004.12.16 yutaka)
874874 if (wParam == IDC_TIMER1) {
875875 // 自動ログインのため
@@ -961,7 +961,7 @@
961961 return FALSE;
962962
963963 case WM_COMMAND:
964- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
964+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
965965
966966 switch (LOWORD(wParam)) {
967967 case IDOK:
@@ -1392,8 +1392,8 @@
13921392 return TRUE;
13931393 }
13941394
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)
13971397 {
13981398 PTInstVar pvar;
13991399
@@ -1401,7 +1401,7 @@
14011401 case WM_INITDIALOG:
14021402 pvar = (PTInstVar) lParam;
14031403 pvar->auth_state.auth_dialog = dlg;
1404- SetWindowLong(dlg, DWL_USER, lParam);
1404+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
14051405
14061406 init_TIS_dlg(pvar, dlg);
14071407
@@ -1415,7 +1415,7 @@
14151415 return FALSE; /* because we set the focus */
14161416
14171417 case WM_COMMAND:
1418- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1418+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
14191419
14201420 switch (LOWORD(wParam)) {
14211421 case IDOK:
@@ -1593,8 +1593,8 @@
15931593 return TRUE;
15941594 }
15951595
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)
15981598 {
15991599 PTInstVar pvar;
16001600
@@ -1601,7 +1601,7 @@
16011601 switch (msg) {
16021602 case WM_INITDIALOG:
16031603 pvar = (PTInstVar) lParam;
1604- SetWindowLong(dlg, DWL_USER, lParam);
1604+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
16051605
16061606 init_default_auth_dlg(pvar, dlg);
16071607 CenterWindow(dlg, GetParent(dlg));
@@ -1608,7 +1608,7 @@
16081608 return TRUE; /* because we do not set the focus */
16091609
16101610 case WM_COMMAND:
1611- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1611+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
16121612
16131613 switch (LOWORD(wParam)) {
16141614 case IDOK:
--- trunk/ttssh2/ttxssh/fwd.c (revision 7895)
+++ trunk/ttssh2/ttxssh/fwd.c (revision 7896)
@@ -529,11 +529,11 @@
529529 hInst, NULL);
530530 if (pvar->fwd_state.accept_wnd != NULL) {
531531 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);
537537 }
538538 }
539539
@@ -812,7 +812,7 @@
812812 static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam,
813813 LPARAM lParam)
814814 {
815- PTInstVar pvar = (PTInstVar) GetWindowLong(wnd, GWL_USERDATA);
815+ PTInstVar pvar = (PTInstVar) GetWindowLongPtr(wnd, GWLP_USERDATA);
816816
817817 if (msg == WM_SOCK_ACCEPT &&
818818 (LOWORD(lParam) == FD_READ || LOWORD(lParam) == FD_CLOSE ||
--- trunk/ttssh2/ttxssh/fwdui.c (revision 7895)
+++ trunk/ttssh2/ttxssh/fwdui.c (revision 7896)
@@ -975,7 +975,7 @@
975975 return TRUE;
976976 }
977977
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,
979979 LPARAM lParam)
980980 {
981981 FWDEditClosure *closure;
@@ -985,7 +985,7 @@
985985 switch (msg) {
986986 case WM_INITDIALOG:
987987 closure = (FWDEditClosure *) lParam;
988- SetWindowLong(dlg, DWL_USER, lParam);
988+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
989989
990990 pvar = closure->pvar;
991991 init_fwd_edit_dlg(pvar, closure->spec, dlg);
@@ -993,7 +993,7 @@
993993 return FALSE; /* because we set the focus */
994994
995995 case WM_COMMAND:
996- closure = (FWDEditClosure *) GetWindowLong(dlg, DWL_USER);
996+ closure = (FWDEditClosure *) GetWindowLongPtr(dlg, DWLP_USER);
997997
998998 switch (LOWORD(wParam)) {
999999 case IDOK:
@@ -1101,7 +1101,7 @@
11011101 }
11021102 }
11031103
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,
11051105 LPARAM lParam)
11061106 {
11071107 PTInstVar pvar;
@@ -1110,7 +1110,7 @@
11101110 switch (msg) {
11111111 case WM_INITDIALOG:
11121112 pvar = (PTInstVar) lParam;
1113- SetWindowLong(dlg, DWL_USER, lParam);
1113+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
11141114
11151115 init_fwd_dlg(pvar, dlg);
11161116 CenterWindow(dlg, GetParent(dlg));
@@ -1117,7 +1117,7 @@
11171117 return TRUE; /* because we do not set the focus */
11181118
11191119 case WM_COMMAND:
1120- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1120+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
11211121
11221122 switch (LOWORD(wParam)) {
11231123 case IDOK:
--- trunk/ttssh2/ttxssh/hosts.c (revision 7895)
+++ trunk/ttssh2/ttxssh/hosts.c (revision 7896)
@@ -1714,8 +1714,8 @@
17141714 // TODO: finger printの表示も行う。
17151715 // (2006.3.25 yutaka)
17161716 //
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)
17191719 {
17201720 PTInstVar pvar;
17211721 char uimsg[MAX_UIMSG];
@@ -1724,7 +1724,7 @@
17241724 case WM_INITDIALOG:
17251725 pvar = (PTInstVar) lParam;
17261726 pvar->hosts_state.hosts_dialog = dlg;
1727- SetWindowLong(dlg, DWL_USER, lParam);
1727+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
17281728
17291729 // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある
17301730 GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1798,7 +1798,7 @@
17981798 return TRUE; /* because we do not set the focus */
17991799
18001800 case WM_COMMAND:
1801- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1801+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
18021802
18031803 switch (LOWORD(wParam)) {
18041804 case IDC_CONTINUE:
@@ -1869,8 +1869,8 @@
18691869 //
18701870 // 置き換え時の確認ダイアログを分離
18711871 //
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)
18741874 {
18751875 PTInstVar pvar;
18761876 char uimsg[MAX_UIMSG];
@@ -1879,7 +1879,7 @@
18791879 case WM_INITDIALOG:
18801880 pvar = (PTInstVar) lParam;
18811881 pvar->hosts_state.hosts_dialog = dlg;
1882- SetWindowLong(dlg, DWL_USER, lParam);
1882+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
18831883
18841884 // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある
18851885 GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1950,7 +1950,7 @@
19501950 return TRUE; /* because we do not set the focus */
19511951
19521952 case WM_COMMAND:
1953- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1953+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
19541954
19551955 switch (LOWORD(wParam)) {
19561956 case IDC_CONTINUE:
@@ -2022,8 +2022,8 @@
20222022 //
20232023 // 同じホストで鍵形式が違う時の追加確認ダイアログを分離
20242024 //
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)
20272027 {
20282028 PTInstVar pvar;
20292029 char uimsg[MAX_UIMSG];
@@ -2032,7 +2032,7 @@
20322032 case WM_INITDIALOG:
20332033 pvar = (PTInstVar) lParam;
20342034 pvar->hosts_state.hosts_dialog = dlg;
2035- SetWindowLong(dlg, DWL_USER, lParam);
2035+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
20362036
20372037 // 追加・置き換えとも init_hosts_dlg を呼んでいるので、その前にセットする必要がある
20382038 GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -2105,7 +2105,7 @@
21052105 return TRUE; /* because we do not set the focus */
21062106
21072107 case WM_COMMAND:
2108- pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
2108+ pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
21092109
21102110 switch (LOWORD(wParam)) {
21112111 case IDC_CONTINUE:
--- trunk/ttssh2/ttxssh/key.c (revision 7895)
+++ trunk/ttssh2/ttxssh/key.c (revision 7896)
@@ -2161,7 +2161,7 @@
21612161 strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
21622162 }
21632163 }
2164- SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
2164+ SetDlgItemTextA(dlg, IDC_ADDKEY_EDIT, buf);
21652165 free(buf);
21662166 }
21672167
@@ -2168,7 +2168,7 @@
21682168 if (ctx->nold > 0) {
21692169 buf_len = 100 * ctx->nold;
21702170 buf = calloc(100, ctx->nold);
2171- SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)"");
2171+ SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, "");
21722172 for (i = 0; i < ctx->nold; i++) {
21732173 switch (dgst_alg) {
21742174 case SSH_DIGEST_MD5:
@@ -2189,12 +2189,12 @@
21892189 strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
21902190 }
21912191 }
2192- SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
2192+ SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, buf);
21932193 free(buf);
21942194 }
21952195 }
21962196
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)
21982198 {
21992199 PTInstVar pvar;
22002200 char buf[1024];
@@ -2205,7 +2205,7 @@
22052205 switch (msg) {
22062206 case WM_INITDIALOG:
22072207 pvar = (PTInstVar)lParam;
2208- SetWindowLong(dlg, DWL_USER, lParam);
2208+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
22092209
22102210 GetWindowText(dlg, uimsg, sizeof(uimsg));
22112211 UTIL_get_lang_msg("DLG_HOSTKEY_ROTATION_TITLE", pvar, uimsg);
@@ -2249,7 +2249,7 @@
22492249 return TRUE; /* because we do not set the focus */
22502250
22512251 case WM_COMMAND:
2252- pvar = (PTInstVar)GetWindowLong(dlg, DWL_USER);
2252+ pvar = (PTInstVar)GetWindowLongPtr(dlg, DWLP_USER);
22532253
22542254 switch (LOWORD(wParam)) {
22552255 case IDOK:
@@ -2329,6 +2329,7 @@
23292329 buffer_t *bsig = NULL;
23302330 char *cp, *sig;
23312331 size_t i, ndone, siglen;
2332+ int siglen_i;
23322333 int ret;
23332334
23342335 // SSH2 packet format:
@@ -2384,7 +2385,8 @@
23842385 free(blob);
23852386 blob = NULL;
23862387
2387- sig = buffer_get_string_msg(bsig, &siglen);
2388+ sig = buffer_get_string_msg(bsig, &siglen_i);
2389+ siglen = siglen_i;
23882390 // Verify signature
23892391 ret = key_verify(ctx->keys[i], sig, siglen, buffer_ptr(b), buffer_len(b));
23902392 free(sig);
--- trunk/ttssh2/ttxssh/sftp.c (revision 7895)
+++ trunk/ttssh2/ttxssh/sftp.c (revision 7896)
@@ -1073,8 +1073,8 @@
10731073 SetFocus(hEdit);
10741074
10751075 // エディットコントロールのサブクラス化
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);
10781078
10791079 CenterWindow(hDlgWnd, GetParent(hDlgWnd));
10801080
--- trunk/ttssh2/ttxssh/ssh.c (revision 7895)
+++ trunk/ttssh2/ttxssh/ssh.c (revision 7896)
@@ -7427,7 +7427,7 @@
74277427 char new_passwd[PASSWD_MAXLEN];
74287428 };
74297429
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)
74317431 {
74327432 char old_passwd[PASSWD_MAXLEN];
74337433 char new_passwd[PASSWD_MAXLEN];
--- trunk/ttssh2/ttxssh/ttxssh.c (revision 7895)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 7896)
@@ -1252,8 +1252,8 @@
12521252 return CallWindowProc(OrigHostnameEditProc, dlg, msg, wParam, lParam);
12531253 }
12541254
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)
12571257 {
12581258 static char *ssh_version[] = {"SSH1", "SSH2", NULL};
12591259 PGetHNRec GetHNRec;
@@ -1271,7 +1271,7 @@
12711271 switch (msg) {
12721272 case WM_INITDIALOG:
12731273 GetHNRec = (PGetHNRec) lParam;
1274- SetWindowLong(dlg, DWL_USER, lParam);
1274+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
12751275
12761276 GetWindowText(dlg, uimsg, sizeof(uimsg));
12771277 UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg);
@@ -1348,8 +1348,8 @@
13481348 // C-n/C-p のためにサブクラス化 (2007.9.4 maya)
13491349 hwndHostname = GetDlgItem(dlg, IDC_HOSTNAME);
13501350 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);
13531353
13541354 CheckRadioButton(dlg, IDC_HOSTTELNET, IDC_HOSTOTHER,
13551355 pvar->settings.Enabled ? IDC_HOSTSSH : GetHNRec->
@@ -1478,7 +1478,7 @@
14781478 case WM_COMMAND:
14791479 switch (LOWORD(wParam)) {
14801480 case IDOK:
1481- GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
1481+ GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
14821482 if (GetHNRec != NULL) {
14831483 if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) {
14841484 char afstr[BUFSIZ];
@@ -1544,12 +1544,12 @@
15441544 }
15451545 }
15461546 }
1547- SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
1547+ SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
15481548 EndDialog(dlg, 1);
15491549 return TRUE;
15501550
15511551 case IDCANCEL:
1552- SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
1552+ SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
15531553 EndDialog(dlg, 0);
15541554 return TRUE;
15551555
@@ -1594,7 +1594,7 @@
15941594 enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled
15951595 hostssh_enabled:
15961596
1597- GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
1597+ GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
15981598
15991599 if (IsDlgButtonChecked(dlg, IDC_HOSTTELNET)) {
16001600 if (GetHNRec != NULL)
@@ -2441,8 +2441,8 @@
24412441 return CallWindowProc(g_defAboutDlgEditWndProc, hWnd, msg, wp, lp);
24422442 }
24432443
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)
24462446 {
24472447 static HFONT DlgAboutTextFont;
24482448
@@ -3252,12 +3252,12 @@
32523252 }
32533253 }
32543254
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)
32573257 {
32583258 switch (msg) {
32593259 case WM_INITDIALOG:
3260- SetWindowLong(dlg, DWL_USER, lParam);
3260+ SetWindowLongPtr(dlg, DWLP_USER, lParam);
32613261 init_setup_dlg((PTInstVar) lParam, dlg);
32623262
32633263 CenterWindow(dlg, GetParent(dlg));
@@ -3266,7 +3266,7 @@
32663266 case WM_COMMAND:
32673267 switch (LOWORD(wParam)) {
32683268 case IDOK:
3269- complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWL_USER), dlg);
3269+ complete_setup_dlg((PTInstVar) GetWindowLongPtr(dlg, DWLP_USER), dlg);
32703270 EndDialog(dlg, 1);
32713271 return TRUE;
32723272 case IDCANCEL: /* there isn't a cancel button, but other Windows
@@ -3783,7 +3783,7 @@
37833783 //
37843784 // SCP dialog
37853785 //
3786-static BOOL CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
3786+static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
37873787 LPARAM lParam)
37883788 {
37893789 static char sendfile[MAX_PATH] = "";
@@ -4172,8 +4172,8 @@
41724172 buffer_free(blob);
41734173 }
41744174
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)
41774177 {
41784178 static ssh_keytype key_type;
41794179 static int saved_key_bits;
@@ -5344,7 +5344,7 @@
53445344 hInst = hInstance;
53455345 pvar = &InstVar;
53465346 __mem_mapping =
5347- CreateFileMapping((HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE, 0,
5347+ CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
53485348 sizeof(TS_SSH), TTSSH_FILEMAPNAME);
53495349 if (__mem_mapping == NULL) {
53505350 /* fake it. The settings won't be shared, but what the heck. */
Show on old repository browser