[Ttssh2-commit] [7865] Win32API由来の型,64bit対応API,定数へ変更

scmno****@osdn***** scmno****@osdn*****
2019年 7月 21日 (日) 00:17:55 JST


Revision: 7865
          https://osdn.net/projects/ttssh2/scm/svn/commits/7865
Author:   zmatsuo
Date:     2019-07-21 00:17:54 +0900 (Sun, 21 Jul 2019)
Log Message:
-----------
Win32API由来の型,64bit対応API,定数へ変更

- int,long を LONG_PTR,INT_PTR,LRESULT,WPARAM,LPARAM など
- Win32でもx64でも問題なく利用できるAPI、定数に置き換え
    - SetWindowLong() を SetWindowLongPtr() など
    - GWL_WNDPROC を GWLP_WNDPROC など
- manifestファイルも両対応に変更
- 64bitで使用できない関数無効化
    - ApplicationFaultHandler()@vtwin.cpp 例外発生時に関数の呼び出し履歴を表示など

Modified Paths:
--------------
    branches/x64/TTProxy/ProxyWSockHook.h
    branches/x64/TTProxy/YCL/include/YCL/Dialog.h
    branches/x64/TTProxy/YCL/include/YCL/Window.h
    branches/x64/teraterm/teraterm/tekwin.cpp
    branches/x64/teraterm/teraterm/teraterm.manifest
    branches/x64/teraterm/teraterm/ttplug.c
    branches/x64/teraterm/teraterm/vtwin.cpp
    branches/x64/teraterm/teraterm/vtwin.h
    branches/x64/teraterm/ttpcmn/ttcmn.c
    branches/x64/teraterm/ttpdlg/ttdlg.c
    branches/x64/teraterm/ttpfile/ttfile.c
    branches/x64/teraterm/ttpmacro/ttmmain.cpp
    branches/x64/ttpmenu/ttpmenu.cpp
    branches/x64/ttpmenu/ttpmenu.h
    branches/x64/ttpmenu/winmisc.cpp
    branches/x64/ttssh2/ttxssh/auth.c
    branches/x64/ttssh2/ttxssh/fwd.c
    branches/x64/ttssh2/ttxssh/fwdui.c
    branches/x64/ttssh2/ttxssh/hosts.c
    branches/x64/ttssh2/ttxssh/key.c
    branches/x64/ttssh2/ttxssh/sftp.c
    branches/x64/ttssh2/ttxssh/ssh.c
    branches/x64/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: branches/x64/TTProxy/ProxyWSockHook.h
===================================================================
--- branches/x64/TTProxy/ProxyWSockHook.h	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/TTProxy/ProxyWSockHook.h	2019-07-20 15:17:54 UTC (rev 7865)
@@ -72,8 +72,8 @@
                     event = 0;
                 }
             }
-            operator int()const {
-                return window == NULL && message == 0 && event == 0 ? 0 : (int) window;
+            operator HWND() const {
+                return window == NULL && message == 0 && event == 0 ? 0 : window;
             }
         };
         Hashtable<SOCKET, AsyncSelectInfo> table;
@@ -715,9 +715,8 @@
         Window conn;
         Window erro;
         Window log;
-//      HFONT DlgFont;
     protected:
-        virtual bool dispatch(int message, int wParam, long lParam) {
+        virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
             if (message == WM_COMMAND && wParam == MAKEWPARAM(IDC_REFER, BN_CLICKED)) {
                 char buffer[1024];
                 char uimsg[MAX_UIMSG];
@@ -890,7 +889,7 @@
         EditBoxCtrl  pass;
         bool lock;
     protected:
-        virtual bool dispatch(int message, int wParam, long lParam) {
+        virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
             if (message == WM_COMMAND) {
                 switch (wParam) {
                 case MAKEWPARAM(IDC_OPTIONS, BN_CLICKED):

Modified: branches/x64/TTProxy/YCL/include/YCL/Dialog.h
===================================================================
--- branches/x64/TTProxy/YCL/include/YCL/Dialog.h	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/TTProxy/YCL/include/YCL/Dialog.h	2019-07-20 15:17:54 UTC (rev 7865)
@@ -31,7 +31,7 @@
 		initializeing = next;
 		return prev;
 	}
-	static BOOL CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) {
+	static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) {
 		Map& map = getMap();
 		Dialog* target = map.get(dialog);
 		if (target == NULL) {
@@ -53,7 +53,7 @@
 				|| message == WM_CTLCOLORLISTBOX
 				|| message == WM_CTLCOLORSCROLLBAR
 				|| message == WM_CTLCOLORSTATIC)) {
-			result = (BOOL) ::GetWindowLong(dialog, DWL_MSGRESULT);
+			result = (BOOL) ::GetWindowLongPtr(dialog, DWLP_MSGRESULT);
 		}
 		return result;
 	}
@@ -87,7 +87,7 @@
 	}
 
 	void setResult(LRESULT result) {
-		SetWindowLong(DWL_MSGRESULT, result);
+		SetWindowLongPtr(DWLP_MSGRESULT, result);
 	}
 	int getDefID()const {
 		return LOWORD(SendMessage(DM_GETDEFID));
@@ -118,7 +118,7 @@
 #endif
 	}
 protected:
-	virtual bool dispatch(int message, int wparam, long lparam) {
+	virtual bool dispatch(UINT message, WPARAM wparam, LPARAM lparam) {
 		switch (message) {
 		case WM_INITDIALOG:
 			return onInitDialog();

Modified: branches/x64/TTProxy/YCL/include/YCL/Window.h
===================================================================
--- branches/x64/TTProxy/YCL/include/YCL/Window.h	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/TTProxy/YCL/include/YCL/Window.h	2019-07-20 15:17:54 UTC (rev 7865)
@@ -30,11 +30,11 @@
 		return window;
 	}
 
-	long GetWindowLong(int index)const {
-		return ::GetWindowLong(window, index);
+	LONG_PTR GetWindowLongPtr(int index)const {
+		return ::GetWindowLongPtr(window, index);
 	}
-	long SetWindowLong(int index, long data) {
-		return ::SetWindowLong(window, index, data);
+	LONG_PTR SetWindowLongPtr(int index, LONG_PTR data) {
+		return ::SetWindowLongPtr(window, index, data);
 	}
 	int GetWindowTextLength()const {
 		return ::GetWindowTextLength(window);
@@ -51,10 +51,10 @@
 	bool SetWindowText(const char* text) {
 		return ::SetWindowText(window, text) != FALSE;
 	}
-	long SendMessage(int message, int wparam = 0, long lparam = 0)const {
+	LRESULT SendMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::SendMessage(window, message, wparam, lparam);
 	}
-	long PostMessage(int message, int wparam = 0, long lparam = 0)const {
+	LRESULT PostMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::PostMessage(window, message, wparam, lparam);
 	}
 	HWND GetParent()const {
@@ -63,10 +63,10 @@
 	bool EnableWindow(bool enabled) {
 		return ::EnableWindow(window, enabled) != FALSE;
 	}
-	long DefWindowProc(int message, int wparam, long lparam) {
+	LRESULT DefWindowProc(int message, int wparam, long lparam) {
 		return ::DefWindowProc(window, message, wparam, lparam);
 	}
-	long CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
+	LRESULT CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
 		return ::CallWindowProc(proc, window, message, wParam, lParam);
 	}
 	bool ShowWindow(int command) {
@@ -90,7 +90,7 @@
 	bool IsZoomed()const {
 		return ::IsZoomed(window) != FALSE;
 	}
-	int SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
+	UINT_PTR SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
 		return ::SetTimer(window, id, elapse, timerProc);
 	}
 	bool KillTimer(int id) {
@@ -236,11 +236,11 @@
 		}
 		return MessageBox(message, top.GetWindowText(), type);
 	}
-	long GetClassLong(int index)const {
-		return ::GetClassLong(window, index);
+	ULONG_PTR GetClassLongPtr(int index)const {
+		return ::GetClassLongPtr(window, index);
 	}
-	long SetClassLong(int index, long data) {
-		return ::SetClassLong(window, index, data);
+	ULONG_PTR SetClassLongPtr(int index, LONG_PTR data) {
+		return ::SetClassLongPtr(window, index, data);
 	}
 
 	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 @@
 	HICON setIcon(HICON icon, bool large) {
 		return (HICON) SendMessage(WM_SETICON, large, (LPARAM) icon);
 	}
-	long getStyle()const {
-		return GetWindowLong(GWL_STYLE);
+	LONG_PTR getStyle()const {
+		return GetWindowLongPtr(GWL_STYLE);
 	}
-	long getExStyle()const {
-		return GetWindowLong(GWL_EXSTYLE);
+	LONG_PTR getExStyle()const {
+		return GetWindowLongPtr(GWL_EXSTYLE);
 	}
-	long setStyle(long style) {
-		return SetWindowLong(GWL_STYLE, style);
+	LONG_PTR setStyle(LONG_PTR style) {
+		return SetWindowLongPtr(GWL_STYLE, style);
 	}
-	long setExStyle(long exStyle) {
-		return SetWindowLong(GWL_EXSTYLE, exStyle);
+	LONG_PTR setExStyle(LONG_PTR exStyle) {
+		return SetWindowLongPtr(GWL_EXSTYLE, exStyle);
 	}
 	WNDPROC getWndProc()const {
-		return (WNDPROC) GetWindowLong(GWL_WNDPROC);
+		return (WNDPROC) GetWindowLongPtr(GWLP_WNDPROC);
 	}
 	WNDPROC setWndProc(WNDPROC proc) {
-		return (WNDPROC) SetWindowLong(GWL_WNDPROC, (long) proc);
+		return (WNDPROC) SetWindowLongPtr(GWLP_WNDPROC, (LONG_PTR) proc);
 	}
 	HWND getOwner()const {
-		return (HWND) GetWindowLong(GWL_HWNDPARENT);
+		return (HWND) GetWindowLongPtr(GWLP_HWNDPARENT);
 	}
 	HWND setOwner(HWND owner) {
-		return (HWND) SetWindowLong(GWL_HWNDPARENT, (long) owner);
+		return (HWND) SetWindowLongPtr(GWLP_HWNDPARENT, (LONG_PTR) owner);
 	}
 	HWND getChildWindow()const {
 		return GetWindow(GW_CHILD);
@@ -312,7 +312,7 @@
 #define WS_EX_LAYERED 0x80000
 #endif
 	void setAlpha(BYTE alpha) {
-		long exStyle = getExStyle();
+		LONG_PTR exStyle = getExStyle();
 		if ((exStyle & WS_EX_LAYERED) == 0)
 			setExStyle(exStyle | WS_EX_LAYERED);
 		SetLayeredWindowAttributes(alpha, 2);
@@ -322,41 +322,43 @@
 		return rect;
 	}
 	ATOM getClassAtom()const {
-		return (ATOM) GetClassLong(GCW_ATOM);
+		return (ATOM) GetClassLongPtr(GCW_ATOM);
 	}
-	long getClassExtra()const {
-		return GetClassLong(GCL_CBCLSEXTRA);
+	LONG_PTR getClassExtra()const {
+		return GetClassLongPtr(GCL_CBCLSEXTRA);
 	}
-	long getWindowExtra()const {
-		return GetClassLong(GCL_CBWNDEXTRA);
+	LONG_PTR getWindowExtra()const {
+		return GetClassLongPtr(GCL_CBWNDEXTRA);
 	}
 	HBRUSH getBackgroundBrush()const {
-		return (HBRUSH) GetClassLong(GCL_HBRBACKGROUND);
+		return (HBRUSH) GetClassLongPtr(GCLP_HBRBACKGROUND);
 	}
 	HCURSOR getClassCursor()const {
-		return (HCURSOR) GetClassLong(GCL_HCURSOR);
+		return (HCURSOR) GetClassLongPtr(GCLP_HCURSOR);
 	}
 	HICON getClassIcon()const {
-		return (HICON) GetClassLong(GCL_HICON);
+		return (HICON) GetClassLongPtr(GCLP_HICON);
 	}
 	HICON getClassSmallIcon()const {
-		return (HICON) GetClassLong(GCL_HICONSM);
+		return (HICON) GetClassLongPtr(GCLP_HICONSM);
 	}
 	HINSTANCE getClassInstance()const {
-		return (HINSTANCE) GetClassLong(GCL_HMODULE);
+		return (HINSTANCE) GetClassLongPtr(GCLP_HMODULE);
 	}
-	int getMenuResourceId()const {
-		return GetClassLong(GCL_MENUNAME);
+	LONG_PTR getMenuResourceId()const {
+		return GetClassLongPtr(GCLP_MENUNAME);
 	}
-	int getClassStyle()const {
-		return GetClassLong(GCL_STYLE);
+	LONG_PTR getClassStyle()const {
+		return GetClassLongPtr(GCL_STYLE);
 	}
 	WNDPROC getClassWindowProc()const {
-		return (WNDPROC) GetClassLong(GCL_WNDPROC);
+		return (WNDPROC) GetClassLongPtr(GCLP_WNDPROC);
 	}
 };
 
+#if defined(_MSC_VER)
 #pragma comment(lib, "user32.lib")
+#endif
 }
 
 #endif//_YCL_WINDOWS_H_

Modified: branches/x64/teraterm/teraterm/tekwin.cpp
===================================================================
--- branches/x64/teraterm/teraterm/tekwin.cpp	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/teraterm/tekwin.cpp	2019-07-20 15:17:54 UTC (rev 7865)
@@ -352,7 +352,7 @@
 
 				AppendMenu(PopupBase,
 				           submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
-				           submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
+				           submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
 				           itemText);
 			}
 		}

Modified: branches/x64/teraterm/teraterm/teraterm.manifest
===================================================================
--- branches/x64/teraterm/teraterm/teraterm.manifest	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/teraterm/teraterm.manifest	2019-07-20 15:17:54 UTC (rev 7865)
@@ -9,7 +9,7 @@
         type="win32"
         name="Microsoft.Windows.Common-Controls"
         version="6.0.0.0"
-        processorArchitecture="X86"
+        processorArchitecture="*"
         publicKeyToken="6595b64144ccf1df"
         language="*"
       />

Modified: branches/x64/teraterm/teraterm/ttplug.c
===================================================================
--- branches/x64/teraterm/teraterm/ttplug.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/teraterm/ttplug.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
  * (C) Robert O'Callahan
- * (C) 2004-2017 TeraTerm Project
+ * (C) 2004-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -118,7 +118,7 @@
   if (1) {
     char buf[1024];
     struct _finddata_t searchData;
-    long searchHandle;
+	intptr_t searchHandle;
 
     _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\TTX*.DLL", ts->HomeDir);
 

Modified: branches/x64/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/x64/teraterm/teraterm/vtwin.cpp	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/teraterm/vtwin.cpp	2019-07-20 15:17:54 UTC (rev 7865)
@@ -254,6 +254,7 @@
 // (2007.9.30 yutaka)
 //
 // \x97\xE1\x8AO\x83R\x81[\x83h\x82𕶎\x9A\x97\xF1\x82֕ϊ\xB7\x82\xB7\x82\xE9
+#if !defined(_M_X64)
 static const char *GetExceptionString(DWORD exception)
 {
 #define EXCEPTION(x) case EXCEPTION_##x: return (#x);
@@ -443,6 +444,7 @@
 //	return (EXCEPTION_EXECUTE_HANDLER);  /* \x82\xBB\x82̂܂܃v\x83\x8D\x83Z\x83X\x82\xF0\x8FI\x97\xB9\x82\xB3\x82\xB9\x82\xE9 */
 	return (EXCEPTION_CONTINUE_SEARCH);  /* \x88\xF8\x82\xAB\x91\xB1\x82\xAB\x81m\x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x83G\x83\x89\x81[\x81n\x83|\x83b\x83v\x83A\x83b\x83v\x83\x81\x83b\x83Z\x81[\x83W\x83{\x83b\x83N\x83X\x82\xF0\x8CĂяo\x82\xB7 */
 }
+#endif // !defined(_M_X64 )
 
 
 // Virtual Store\x82\xAA\x97L\x8C\xF8\x82ł\xA0\x82邩\x82ǂ\xA4\x82\xA9\x82𔻕ʂ\xB7\x82\xE9\x81B
@@ -548,7 +550,9 @@
 	BOOL isFirstInstance;
 
 	// \x97\xE1\x8AO\x83n\x83\x93\x83h\x83\x89\x82̃t\x83b\x83N (2007.9.30 yutaka)
+#if !defined(_M_X64)
 	SetUnhandledExceptionFilter(ApplicationFaultHandler);
+#endif
 
 	CommInit(&cv);
 	isFirstInstance = StartTeraTerm(&ts);
@@ -879,7 +883,7 @@
 
 				AppendMenu(PopupBase,
 				           submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
-				           submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
+				           submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
 				           itemText);
 			}
 		}
@@ -1297,7 +1301,7 @@
 		             "&Window", ts.UILanguageFile);
 		::InsertMenu(*Menu,ID_HELPMENU,
 		             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-		             (int)WinMenu, ts.UIMsg);
+		             (UINT_PTR)WinMenu, ts.UIMsg);
 	}
 
 	TTXModifyMenu(*Menu); /* TTPLUG */
@@ -1821,7 +1825,7 @@
 }
 
 // \x8FI\x97\xB9\x96₢\x8D\x87\x82킹\x82Ȃ\xB5\x82\xC9Tera Term\x82\xF0\x8FI\x97\xB9\x82\xB7\x82\xE9\x81BOnAllClose()\x8E\xF3\x90M\x97p\x81B
-LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam)
 {
 	// \x82\xB1\x82\xB1\x82\xC5 ts \x82̓\xE0\x97e\x82\xF0\x88Ӑ}\x93I\x82ɏ\x91\x82\xAB\x8A\xB7\x82\xA6\x82Ă\xE0\x81A\x8FI\x97\xB9\x8E\x9E\x82Ɏ\xA9\x93\xAE\x83Z\x81[\x83u\x82\xB3\x82\xEA\x82\xE9\x82킯\x82ł͂Ȃ\xA2\x82̂ŁA\x93\xC1\x82ɖ\xE2\x91\xE8\x82Ȃ\xB5\x81B
 	ts.PortFlag &= ~PF_CONFIRMDISCONN;
@@ -1971,7 +1975,7 @@
 	}
 }
 
-LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam)
+LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam)
 {
 	// ini\x82ɕۑ\xB6\x82\xB3\x82\xEA\x82Ȃ\xA2\x81A\x8D\xA1\x8E\xC0\x8Ds\x82\xB5\x82Ă\xA2\x82\xE9Tera Term\x82ł̂ݗL\x8C\xF8\x82Ȑݒ\xE8
 	static enum drop_type DefaultDropType = DROP_TYPE_CANCEL;
@@ -3238,7 +3242,7 @@
 	return TTCFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam);
 }
 
-LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam)
 {
 	switch (wParam) {
 		case IdHold:
@@ -3331,7 +3335,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam)
 {
 	HMENU SysMenu;
 	BOOL Show, B1, B2;
@@ -3372,7 +3376,7 @@
 			             "&Window", ts.UILanguageFile);
 			::InsertMenu(MainMenu,ID_HELPMENU,
 			             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-			             (int)WinMenu, ts.UIMsg);
+			             (UINT_PTR)WinMenu, ts.UIMsg);
 		}
 		else {
 			RemoveMenu(MainMenu,ID_HELPMENU,MF_BYPOSITION);
@@ -5949,7 +5953,7 @@
 }
 
 // WM_COPYDATA\x82̎\xF3\x90M
-LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam)
 {
 	COPYDATASTRUCT *cds;
 	char *buf, *msg, *name;

Modified: branches/x64/teraterm/teraterm/vtwin.h
===================================================================
--- branches/x64/teraterm/teraterm/vtwin.h	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/teraterm/vtwin.h	2019-07-20 15:17:54 UTC (rev 7865)
@@ -124,7 +124,7 @@
 //-->
 	LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam);
-	LRESULT OnIMEComposition(UINT wParam, LONG lParam);
+	LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam);

Modified: branches/x64/teraterm/ttpcmn/ttcmn.c
===================================================================
--- branches/x64/teraterm/ttpcmn/ttcmn.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/ttpcmn/ttcmn.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1029,7 +1029,7 @@
 			Temp[1] = ' ';
 			GetWindowText(Hw,&Temp[2],sizeof(Temp)-3);
 			SendDlgItemMessage(HDlg, IList, LB_ADDSTRING,
-			                   0, (LONG)Temp);
+			                   0, (LPARAM)Temp);
 			if (Hw==HWin) {
 				SendDlgItemMessage(HDlg, IList, LB_SETCURSEL, i,0);
 			}

Modified: branches/x64/teraterm/ttpdlg/ttdlg.c
===================================================================
--- branches/x64/teraterm/ttpdlg/ttdlg.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/ttpdlg/ttdlg.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -270,7 +270,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 
 					if ( ts!=NULL ) {
 						int width, height;
@@ -683,7 +683,7 @@
 			return TRUE;
 
 		case WM_COMMAND:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			RestoreVar(Dialog,ts,&IAttr,&IOffset);
 			switch (LOWORD(wParam)) {
 				case IDOK:
@@ -935,7 +935,7 @@
 			break;
 
 		case WM_PAINT:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			if ( ts==NULL ) {
 				return TRUE;
 			}
@@ -944,7 +944,7 @@
 			break;
 
 		case WM_HSCROLL:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (ts==NULL) {
 				return TRUE;
 			}
@@ -1203,7 +1203,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( ts!=NULL ) {
 						memset(Temp, 0, sizeof(Temp));
 						GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1);
@@ -1323,7 +1323,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						WritePrivateProfileString("Hosts",NULL,NULL,ts->SetupFName);
 
@@ -1472,7 +1472,7 @@
 					GetRB(Dialog,&w,IDC_TCPIPTELNET,IDC_TCPIPTELNET);
 					if (w==1) {
 						EnableDlgItem(Dialog,IDC_TCPIPTERMTYPELABEL,IDC_TCPIPTERMTYPE);
-						ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+						ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 						if (ts!=NULL) {
 							SetDlgItemInt(Dialog,IDC_TCPIPPORT,ts->TelPort,FALSE);
 						}
@@ -1623,7 +1623,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+					GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( GetHNRec!=NULL ) {
 						char afstr[BUFSIZ];
 						GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
@@ -1684,7 +1684,7 @@
 				case IDC_HOSTTELNET:
 					GetRB(Dialog,&i,IDC_HOSTTELNET,IDC_HOSTTELNET);
 					if ( i==1 ) {
-						GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+						GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
 						if ( GetHNRec!=NULL ) {
 							SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TelPort,FALSE);
 						}
@@ -1830,7 +1830,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					CurDir = (PCHAR)GetWindowLong(Dialog,DWL_USER);
+					CurDir = (PCHAR)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( CurDir!=NULL ) {
 						_getcwd(HomeDir,sizeof(HomeDir));
 						_chdir(CurDir);
@@ -2615,7 +2615,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						w = (WORD)GetCurSel(Dialog, IDC_GENPORT);
 						if (w>1) {
@@ -2745,7 +2745,7 @@
 						PostMessage(Hw,WM_SYSCOMMAND,SC_CLOSE,0);
 					}
 					else {
-						Close = (PBOOL)GetWindowLong(Dialog,DWL_USER);
+						Close = (PBOOL)GetWindowLongPtr(Dialog,DWLP_USER);
 						if (Close!=NULL) {
 							*Close = TRUE;
 						}

Modified: branches/x64/teraterm/ttpfile/ttfile.c
===================================================================
--- branches/x64/teraterm/ttpfile/ttfile.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/ttpfile/ttfile.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2017 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -184,7 +184,7 @@
 	WORD BinFlag, val;
 	long opt = 0;
 
-	pl = (LPLONG)GetWindowLong(Dialog, DWL_USER);
+	pl = (LPLONG)GetWindowLongPtr(Dialog, DWLP_USER);
 	if (pl) {
 		GetRB(Dialog, &BinFlag, IDC_FOPTBIN, IDC_FOPTBIN);
 		if (BinFlag) {
@@ -266,7 +266,7 @@
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)(ofn->lCustData);
 		opt = *pl;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -526,7 +526,7 @@
 
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&LogFnHook);
 		optl = *Option;
-		ofn.lCustData = (DWORD)&optl;
+		ofn.lCustData = (LPARAM)&optl;
 		break;
 	case GTF_SEND:
 		ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -535,7 +535,7 @@
 
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
 		optw = (WORD)*Option;
-		ofn.lCustData = (DWORD)&optw;
+		ofn.lCustData = (LPARAM)&optw;
 		break;
 	case GTF_BP:
 		ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -600,7 +600,7 @@
 	case WM_INITDIALOG:
 		ofn = (LPOPENFILENAME)lParam;
 		pw = (LPWORD)ofn->lCustData;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pw);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pw);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -630,7 +630,7 @@
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
+			pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pw!=NULL)
 				GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
 			if (DlgFoptFont != NULL) {
@@ -648,7 +648,7 @@
 		notify = (LPOFNOTIFY)lParam;
 		switch (notify->hdr.code) {
 		case CDN_FILEOK:
-			pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
+			pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pw!=NULL)
 				GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
 			if (DlgFoptFont != NULL) {
@@ -743,7 +743,7 @@
 	ofn.lCustData = 0;
 	if (FuncId==GMF_Z) {
 		ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
-		ofn.lCustData = (DWORD)Option;
+		ofn.lCustData = (LPARAM)Option;
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
 		ofn.lpTemplateName = MAKEINTRESOURCE(IDD_FOPT);
 	} else if (FuncId==GMF_Y) {
@@ -813,7 +813,7 @@
 	return Ok;
 }
 
-static BOOL CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
 	PFileVar fv;
 	char TempFull[MAX_PATH];
@@ -825,7 +825,7 @@
 	switch (Message) {
 	case WM_INITDIALOG:
 		fv = (PFileVar)lParam;
-		SetWindowLong(Dialog, DWL_USER, lParam);
+		SetWindowLongPtr(Dialog, DWLP_USER, lParam);
 		SendDlgItemMessage(Dialog, IDC_GETFN, EM_LIMITTEXT, sizeof(TempFull)-1,0);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
@@ -860,7 +860,7 @@
 		return TRUE;
 
 	case WM_COMMAND:
-		fv = (PFileVar)GetWindowLong(Dialog,DWL_USER);
+		fv = (PFileVar)GetWindowLongPtr(Dialog,DWLP_USER);
 		switch (LOWORD(wParam)) {
 		case IDOK:
 			if (fv!=NULL) {
@@ -894,7 +894,7 @@
 {
 	return (BOOL)DialogBoxParam(hInst,
 	                            MAKEINTRESOURCE(IDD_GETFNDLG),
-	                            HWin, GetFnDlg, (LONG)fv);
+	                            HWin, GetFnDlg, (LPARAM)fv);
 }
 
 void WINAPI SetFileVar(PFileVar fv)
@@ -990,7 +990,7 @@
 	case WM_INITDIALOG:
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)ofn->lCustData;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -1048,7 +1048,7 @@
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
+			pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pl!=NULL)
 			{
 				if (LOWORD(*pl)==0xFFFF) { // Send
@@ -1083,7 +1083,7 @@
 		notify = (LPOFNOTIFY)lParam;
 		switch (notify->hdr.code) {
 		case CDN_FILEOK:
-			pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
+			pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pl!=NULL) {
 				if (LOWORD(*pl) == 0xFFFF) { // Send
 					Lo = 0xFFFF;
@@ -1182,7 +1182,7 @@
 	}
 	ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
 	ofn.Flags |= OFN_SHOWHELP;
-	ofn.lCustData = (DWORD)&opt;
+	ofn.lCustData = (LPARAM)&opt;
 	ofn.lpstrTitle = fv->DlgCaption;
 	ofn.lpfnHook = (LPOFNHOOKPROC)(&XFnHook);
 	ofn.lpTemplateName = MAKEINTRESOURCE(IDD_XOPT);

Modified: branches/x64/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- branches/x64/teraterm/ttpmacro/ttmmain.cpp	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/teraterm/ttpmacro/ttmmain.cpp	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2017 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -459,7 +459,7 @@
 	if (::IsIconic(m_hWnd)) {
 		int OldMapMode = GetMapMode(dc);
 		SetMapMode(dc, MM_TEXT);
-		SendMessage(WM_ICONERASEBKGND,(UINT)dc, 0);	// TODO
+		SendMessage(WM_ICONERASEBKGND,(WPARAM)dc, 0);	// TODO
 		DrawIcon(dc, 0, 0, m_hIcon);
 		SetMapMode(dc, OldMapMode);
 	}

Modified: branches/x64/ttpmenu/ttpmenu.cpp
===================================================================
--- branches/x64/ttpmenu/ttpmenu.cpp	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttpmenu/ttpmenu.cpp	2019-07-20 15:17:54 UTC (rev 7865)
@@ -317,7 +317,7 @@
 	ti.cbSize	= sizeof(TOOLINFO);
 	ti.uFlags	= TTF_IDISHWND; 
 	ti.hwnd		= g_hWndMenu; 
-	ti.uId		= (UINT) ::GetDlgItem(g_hWndMenu, idControl); 
+	ti.uId		= (UINT_PTR)::GetDlgItem(g_hWndMenu, idControl); 
 	ti.hinst	= 0; 
 	ti.lpszText	= LPSTR_TEXTCALLBACK;
 
@@ -656,9 +656,9 @@
 {
 	HWND passwordControl = GetDlgItem(dlg, item);
 
-	SetWindowLong(passwordControl, GWL_USERDATA,
-	              SetWindowLong(passwordControl, GWL_WNDPROC,
-	                            (LONG) password_wnd_proc));
+	SetWindowLongPtr(passwordControl, GWLP_USERDATA,
+					 SetWindowLongPtr(passwordControl, GWLP_WNDPROC,
+									  (LONG_PTR) password_wnd_proc));
 }
 
 /* ==========================================================================
@@ -1416,7 +1416,7 @@
 		ModifyMenu(g_hConfigMenu, ID_HOTKEY, MF_BYCOMMAND, ID_HOTKEY, uimsg);
 
 		UTIL_get_lang_msg("MENU_EXEC", uimsg, sizeof(uimsg), "Execute", UILanguageFile);
-		::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT) g_hListMenu, (LPCTSTR) uimsg);
+		::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT_PTR)g_hListMenu, (LPCTSTR) uimsg);
 	}
 
 	return TRUE;
@@ -2350,7 +2350,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	TEXTMETRIC			textMetric;
 	PDRAWITEMSTRUCT		lpdis;
@@ -2437,7 +2437,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	switch(uMsg) {
 	case WM_INITDIALOG:
@@ -2464,7 +2464,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	switch(uMsg) {
 	case WM_INITDIALOG:

Modified: branches/x64/ttpmenu/ttpmenu.h
===================================================================
--- branches/x64/ttpmenu/ttpmenu.h	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttpmenu/ttpmenu.h	2019-07-20 15:17:54 UTC (rev 7865)
@@ -166,9 +166,9 @@
 BOOL	SetDefaultEtcDlg(HWND hWnd);
 BOOL	SetMenuFont(HWND hWnd);
 BOOL	SetTaskTray(HWND hWnd, DWORD dwMessage);
-BOOL	CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-BOOL	CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-BOOL	CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 LRESULT	CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
 LRESULT	CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 

Modified: branches/x64/ttpmenu/winmisc.cpp
===================================================================
--- branches/x64/ttpmenu/winmisc.cpp	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttpmenu/winmisc.cpp	2019-07-20 15:17:54 UTC (rev 7865)
@@ -457,6 +457,6 @@
 		}
 	}
 
-	return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
+	return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA),
 	                      control, msg, wParam, lParam);
 }

Modified: branches/x64/ttssh2/ttxssh/auth.c
===================================================================
--- branches/x64/ttssh2/ttxssh/auth.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/auth.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -815,8 +815,8 @@
 
 
 BOOL autologin_sent_none;
-static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                   LPARAM lParam)
+static INT_PTR CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+									  LPARAM lParam)
 {
 	const int IDC_TIMER1 = 300; // \x8E\xA9\x93\xAE\x83\x8D\x83O\x83C\x83\x93\x82\xAA\x97L\x8C\xF8\x82ȂƂ\xAB
 	const int IDC_TIMER2 = 301; // \x83T\x83|\x81[\x83g\x82\xB3\x82\xEA\x82Ă\xA2\x82郁\x83\\x83b\x83h\x82\xF0\x8E\xA9\x93\xAE\x83`\x83F\x83b\x83N(CheckAuthListFirst)
@@ -832,7 +832,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->auth_state.auth_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		UseControlChar = TRUE;
 		ShowPassPhrase = FALSE;
@@ -869,7 +869,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_TIMER:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 		// \x94F\x8F؏\x80\x94\x{142A82}ł\xAB\x82Ă\xA9\x82\xE7\x81A\x94F\x8F؃f\x81[\x83^\x82𑗐M\x82\xB7\x82\xE9\x81B\x91\x81\x82\xB7\x82\xAC\x82\xE9\x82ƁA\x97\x8E\x82\xBF\x82\xE9\x81B(2004.12.16 yutaka)
 		if (wParam == IDC_TIMER1) {
 			// \x8E\xA9\x93\xAE\x83\x8D\x83O\x83C\x83\x93\x82̂\xBD\x82\xDF
@@ -961,7 +961,7 @@
 		return FALSE;
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1392,8 +1392,8 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                  LPARAM lParam)
+static INT_PTR CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+									 LPARAM lParam)
 {
 	PTInstVar pvar;
 
@@ -1401,7 +1401,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->auth_state.auth_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_TIS_dlg(pvar, dlg);
 
@@ -1415,7 +1415,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1593,8 +1593,8 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg,
-										   WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg,
+											  WPARAM wParam, LPARAM lParam)
 {
 	PTInstVar pvar;
 
@@ -1601,7 +1601,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_default_auth_dlg(pvar, dlg);
 		CenterWindow(dlg, GetParent(dlg));
@@ -1608,7 +1608,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/x64/ttssh2/ttxssh/fwd.c
===================================================================
--- branches/x64/ttssh2/ttxssh/fwd.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/fwd.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -529,11 +529,11 @@
 			             hInst, NULL);
 		if (pvar->fwd_state.accept_wnd != NULL) {
 			pvar->fwd_state.old_accept_wnd_proc =
-				(WNDPROC) SetWindowLong(pvar->fwd_state.accept_wnd,
-				                        GWL_WNDPROC,
-				                        (LONG) accept_wnd_proc);
-			SetWindowLong(pvar->fwd_state.accept_wnd, GWL_USERDATA,
-			              (LONG) pvar);
+				(WNDPROC) SetWindowLongPtr(pvar->fwd_state.accept_wnd,
+										   GWLP_WNDPROC,
+										   (LONG_PTR) accept_wnd_proc);
+			SetWindowLongPtr(pvar->fwd_state.accept_wnd, GWLP_USERDATA,
+							 (LONG_PTR) pvar);
 		}
 	}
 
@@ -812,7 +812,7 @@
 static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam,
                                         LPARAM lParam)
 {
-	PTInstVar pvar = (PTInstVar) GetWindowLong(wnd, GWL_USERDATA);
+	PTInstVar pvar = (PTInstVar) GetWindowLongPtr(wnd, GWLP_USERDATA);
 
 	if (msg == WM_SOCK_ACCEPT &&
 	    (LOWORD(lParam) == FD_READ || LOWORD(lParam) == FD_CLOSE ||

Modified: branches/x64/ttssh2/ttxssh/fwdui.c
===================================================================
--- branches/x64/ttssh2/ttxssh/fwdui.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/fwdui.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -975,7 +975,7 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+static UINT_PTR CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
                                        LPARAM lParam)
 {
 	FWDEditClosure *closure;
@@ -985,7 +985,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		closure = (FWDEditClosure *) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		pvar = closure->pvar;
 		init_fwd_edit_dlg(pvar, closure->spec, dlg);
@@ -993,7 +993,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
-		closure = (FWDEditClosure *) GetWindowLong(dlg, DWL_USER);
+		closure = (FWDEditClosure *) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1101,7 +1101,7 @@
 	}
 }
 
-static BOOL CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+static UINT_PTR CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
                                   LPARAM lParam)
 {
 	PTInstVar pvar;
@@ -1110,7 +1110,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_fwd_dlg(pvar, dlg);
 		CenterWindow(dlg, GetParent(dlg));
@@ -1117,7 +1117,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/x64/ttssh2/ttxssh/hosts.c
===================================================================
--- branches/x64/ttssh2/ttxssh/hosts.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/hosts.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1708,8 +1708,8 @@
 // TODO: finger print\x82̕\\x8E\xA6\x82\xE0\x8Ds\x82\xA4\x81B
 // (2006.3.25 yutaka)
 //
-static BOOL CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                        LPARAM lParam)
+static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+										   LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -1718,7 +1718,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1792,7 +1792,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -1863,8 +1863,8 @@
 //
 // \x92u\x82\xAB\x8A\xB7\x82\xA6\x8E\x9E\x82̊m\x94F\x83_\x83C\x83A\x83\x8D\x83O\x82𕪗\xA3
 //
-static BOOL CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                            LPARAM lParam)
+static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+											   LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -1873,7 +1873,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1944,7 +1944,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -2016,8 +2016,8 @@
 //
 // \x93\xAF\x82\xB6\x83z\x83X\x83g\x82Ō\xAE\x8C`\x8E\xAE\x82\xAA\x88Ⴄ\x8E\x9E\x82̒lj\xC1\x8Am\x94F\x83_\x83C\x83A\x83\x8D\x83O\x82𕪗\xA3
 //
-static BOOL CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                         LPARAM lParam)
+static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+											LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -2026,7 +2026,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -2099,7 +2099,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:

Modified: branches/x64/ttssh2/ttxssh/key.c
===================================================================
--- branches/x64/ttssh2/ttxssh/key.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/key.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -2161,7 +2161,7 @@
 				strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
 			}
 		}
-		SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
+		SetDlgItemTextA(dlg, IDC_ADDKEY_EDIT, buf);
 		free(buf);
 	}
 
@@ -2168,7 +2168,7 @@
 	if (ctx->nold > 0) {
 		buf_len = 100 * ctx->nold;
 		buf = calloc(100, ctx->nold);
-		SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)"");
+		SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, "");
 		for (i = 0; i < ctx->nold; i++) {
 			switch (dgst_alg) {
 			case SSH_DIGEST_MD5:
@@ -2189,12 +2189,12 @@
 				strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
 			}
 		}
-		SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
+		SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, buf);
 		free(buf);
 	}
 }
 
-static BOOL CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static UINT_PTR CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 	PTInstVar pvar;
 	char buf[1024];
@@ -2205,7 +2205,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar)lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOSTKEY_ROTATION_TITLE", pvar, uimsg);
@@ -2249,7 +2249,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar)GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar)GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/x64/ttssh2/ttxssh/sftp.c
===================================================================
--- branches/x64/ttssh2/ttxssh/sftp.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/sftp.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1073,8 +1073,8 @@
 			SetFocus(hEdit);
 
 			// \x83G\x83f\x83B\x83b\x83g\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x82̃T\x83u\x83N\x83\x89\x83X\x89\xBB
-			hEditProc = (WNDPROC)GetWindowLong(hEdit, GWL_WNDPROC);
-			SetWindowLong(hEdit, GWL_WNDPROC, (LONG)EditProc);
+			hEditProc = (WNDPROC)GetWindowLongPtr(hEdit, GWLP_WNDPROC);
+			SetWindowLongPtr(hEdit, GWLP_WNDPROC, (LONG_PTR)EditProc);
 
 			CenterWindow(hDlgWnd, GetParent(hDlgWnd));
 

Modified: branches/x64/ttssh2/ttxssh/ssh.c
===================================================================
--- branches/x64/ttssh2/ttxssh/ssh.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/ssh.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -7424,7 +7424,7 @@
 	char new_passwd[PASSWD_MAXLEN];
 };
 
-static BOOL CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 	char old_passwd[PASSWD_MAXLEN];
 	char new_passwd[PASSWD_MAXLEN];

Modified: branches/x64/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/x64/ttssh2/ttxssh/ttxssh.c	2019-07-20 15:12:03 UTC (rev 7864)
+++ branches/x64/ttssh2/ttxssh/ttxssh.c	2019-07-20 15:17:54 UTC (rev 7865)
@@ -1252,8 +1252,8 @@
 	return CallWindowProc(OrigHostnameEditProc, dlg, msg, wParam, lParam);
 }
 
-static BOOL CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                LPARAM lParam)
+static INT_PTR CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam,
+								   LPARAM lParam)
 {
 	static char *ssh_version[] = {"SSH1", "SSH2", NULL};
 	PGetHNRec GetHNRec;
@@ -1271,7 +1271,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		GetHNRec = (PGetHNRec) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg);
@@ -1348,8 +1348,8 @@
 		// C-n/C-p \x82̂\xBD\x82߂ɃT\x83u\x83N\x83\x89\x83X\x89\xBB (2007.9.4 maya)
 		hwndHostname = GetDlgItem(dlg, IDC_HOSTNAME);
 		hwndHostnameEdit = GetWindow(hwndHostname, GW_CHILD);
-		OrigHostnameEditProc = (WNDPROC)GetWindowLong(hwndHostnameEdit, GWL_WNDPROC);
-		SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)HostnameEditProc);
+		OrigHostnameEditProc = (WNDPROC)GetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC);
+		SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc);
 
 		CheckRadioButton(dlg, IDC_HOSTTELNET, IDC_HOSTOTHER,
 		                 pvar->settings.Enabled ? IDC_HOSTSSH : GetHNRec->
@@ -1478,7 +1478,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
 			if (GetHNRec != NULL) {
 				if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) {
 					char afstr[BUFSIZ];
@@ -1544,12 +1544,12 @@
 					}
 				}
 			}
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
 			EndDialog(dlg, 1);
 			return TRUE;
 
 		case IDCANCEL:
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
 			EndDialog(dlg, 0);
 			return TRUE;
 
@@ -1594,7 +1594,7 @@
 			enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled
 hostssh_enabled:
 
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
 
 			if (IsDlgButtonChecked(dlg, IDC_HOSTTELNET)) {
 				if (GetHNRec != NULL)
@@ -2441,8 +2441,8 @@
     return CallWindowProc(g_defAboutDlgEditWndProc, hWnd, msg, wp, lp);
 }
 
-static BOOL CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                 LPARAM lParam)
+static INT_PTR CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam,
+									LPARAM lParam)
 {
 	static HFONT DlgAboutTextFont;
 
@@ -3252,12 +3252,12 @@
 	}
 }
 
-static BOOL CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                 LPARAM lParam)
+static INT_PTR CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam,
+									LPARAM lParam)
 {
 	switch (msg) {
 	case WM_INITDIALOG:
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 		init_setup_dlg((PTInstVar) lParam, dlg);
 
 		CenterWindow(dlg, GetParent(dlg));
@@ -3266,7 +3266,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWL_USER), dlg);
+			complete_setup_dlg((PTInstVar) GetWindowLongPtr(dlg, DWLP_USER), dlg);
 			EndDialog(dlg, 1);
 			return TRUE;
 		case IDCANCEL:			/* there isn't a cancel button, but other Windows
@@ -3783,7 +3783,7 @@
 //
 // SCP dialog
 //
-static BOOL CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
+static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
                                      LPARAM lParam)
 {
 	static char sendfile[MAX_PATH] = "";
@@ -4172,8 +4172,8 @@
 	buffer_free(blob);
 }
 
-static BOOL CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam,
-                                     LPARAM lParam)
+static INT_PTR CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam,
+										LPARAM lParam)
 {
 	static ssh_keytype key_type;
 	static int saved_key_bits;
@@ -5344,7 +5344,7 @@
 		hInst = hInstance;
 		pvar = &InstVar;
 		__mem_mapping =
-			CreateFileMapping((HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE, 0,
+			CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
 			                  sizeof(TS_SSH), TTSSH_FILEMAPNAME);
 		if (__mem_mapping == NULL) {
 			/* fake it. The settings won't be shared, but what the heck. */


Ttssh2-commit メーリングリストの案内