[Ttssh2-commit] [7896] Merge branch 'x64' into trunk

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 7月 30日 (火) 00:04:09 JST


Revision: 7896
          https://osdn.net/projects/ttssh2/scm/svn/commits/7896
Author:   zmatsuo
Date:     2019-07-30 00:04:08 +0900 (Tue, 30 Jul 2019)
Log Message:
-----------
Merge branch 'x64' into trunk

Modified Paths:
--------------
    trunk/TTProxy/ProxyWSockHook.h
    trunk/TTProxy/TTProxy.h
    trunk/TTProxy/YCL/include/YCL/Dialog.h
    trunk/TTProxy/YCL/include/YCL/HASHCODE.h
    trunk/TTProxy/YCL/include/YCL/Window.h
    trunk/libs/SFMT.cmake
    trunk/libs/buildall.cmake
    trunk/libs/oniguruma.cmake
    trunk/libs/openssl.cmake
    trunk/libs/zlib.cmake
    trunk/teraterm/CMakeLists.txt
    trunk/teraterm/teraterm/tekwin.cpp
    trunk/teraterm/teraterm/teraterm.manifest
    trunk/teraterm/teraterm/ttplug.c
    trunk/teraterm/teraterm/vtdisp.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h
    trunk/teraterm/ttpcmn/ttcmn.c
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpfile/ttfile.c
    trunk/teraterm/ttpmacro/ttmmain.cpp
    trunk/ttpmenu/ttpmenu.cpp
    trunk/ttpmenu/ttpmenu.h
    trunk/ttpmenu/winmisc.cpp
    trunk/ttssh2/ttxssh/auth.c
    trunk/ttssh2/ttxssh/fwd.c
    trunk/ttssh2/ttxssh/fwdui.c
    trunk/ttssh2/ttxssh/hosts.c
    trunk/ttssh2/ttxssh/key.c
    trunk/ttssh2/ttxssh/sftp.c
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c

Added Paths:
-----------
    trunk/libs/jom.cmake

-------------- next part --------------
Modified: trunk/TTProxy/ProxyWSockHook.h
===================================================================
--- trunk/TTProxy/ProxyWSockHook.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/TTProxy/ProxyWSockHook.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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;
@@ -618,12 +618,14 @@
         HANDLE getTask(ConnectionInfo* info) {
             if (info == NULL)
                 return NULL;
-            return (HANDLE) -info->addr.S_un.S_un_b.s_b4;
+			// s_b4\x82̃}\x83C\x83i\x83X\x82̒l\x82\xF0\x83n\x83\x93\x83h\x83\x8B\x82Ƃ\xB5\x82Ďg\x97p\x82\xB7\x82\xE9
+            return (HANDLE)(intptr_t)-info->addr.S_un.S_un_b.s_b4;
         }
         ConnectionInfo* get(HANDLE task) {
-            if ((DWORD) task >= 0)
+			// \x83n\x83\x93\x83h\x83\x8B\x82͐\x94\x92l\x82Ƃ\xB5\x82ă}\x83C\x83i\x83X\x82̒l\x82̂͂\xB8
+            if ((intptr_t) task >= 0)
                 return NULL;
-            return get((int) -((long) task) - 1);
+            return get((int) -((intptr_t) task) - 1);
         }
         ConnectionInfo* get(in_addr addr) {
             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 @@
         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 +891,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: trunk/TTProxy/TTProxy.h
===================================================================
--- trunk/TTProxy/TTProxy.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/TTProxy/TTProxy.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -191,10 +191,6 @@
 		          getInstance().ts->UILanguageFile, _TRUNCATE);
 	}
 
-	static BOOL CALLBACK EnumProc(HMODULE, const char*, const char*, WORD langid, LONG lParam) {
-		*((WORD*) lParam) = langid;
-		return FALSE;
-	}
 	static void PASCAL TTXInit(PTTSet ts, PComVar cv) {
 		getInstance().ts = ts;
 		getInstance().cv = cv;

Modified: trunk/TTProxy/YCL/include/YCL/Dialog.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/Dialog.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/TTProxy/YCL/include/YCL/Dialog.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/TTProxy/YCL/include/YCL/HASHCODE.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/HASHCODE.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/TTProxy/YCL/include/YCL/HASHCODE.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -27,8 +27,10 @@
 	}
 	HASHCODE(const void* value):value((int)(uintptr_t) value) {
 	}
-	HASHCODE(const FARPROC value):value((int)(uintptr_t) value) {
+	HASHCODE(const FARPROC value) :value((int)(uintptr_t)value) {
 	}
+	HASHCODE(SOCKET value) :value((int)(uintptr_t)value) {
+	}
 	HASHCODE(int value):value(value) {
 	}
 	operator int()const {

Modified: trunk/TTProxy/YCL/include/YCL/Window.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/Window.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/TTProxy/YCL/include/YCL/Window.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/libs/SFMT.cmake
===================================================================
--- trunk/libs/SFMT.cmake	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/libs/SFMT.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P SFMT.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P SFMT.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P SFMT.cmake
 
 ####

Modified: trunk/libs/buildall.cmake
===================================================================
--- trunk/libs/buildall.cmake	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/libs/buildall.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1,6 +1,8 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=x64 -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P buildall.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" -P buildall.cmake
-# cmake -DCMAKE_GENERATOR="Unix Makefiles" -P buildall.cmake -DCMAKE_TOOLCHAIN_FILE=../mingw.toolchain.cmake
+# cmake -DCMAKE_GENERATOR="Unix Makefiles" -P buildall.cmake
 
 if("${CMAKE_GENERATOR}" STREQUAL "")
   message(FATAL_ERROR "set CMAKE_GENERATOR!")
@@ -10,6 +12,12 @@
   set(ARCHITECTURE_OPTION -DARCHITECTURE=${ARCHITECTURE})
 endif()
 
+# install tool
+message("jom")
+execute_process(
+  COMMAND ${CMAKE_COMMAND} -P jom.cmake
+  )
+
 # build
 message("oniguruma")
 execute_process(
@@ -31,3 +39,4 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P openssl.cmake
   )
+message("done buildall.cmake")

Added: trunk/libs/jom.cmake
===================================================================
--- trunk/libs/jom.cmake	                        (rev 0)
+++ trunk/libs/jom.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -0,0 +1,29 @@
+# cmake -P jom.cmake
+
+set(SRC_ARC "jom_1_1_3.zip")
+set(SRC_URL "http://download.qt.io/official_releases/jom/jom_1_1_3.zip")
+set(SRC_ARC_HASH_SHA256 128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8)
+set(DOWN_DIR "${CMAKE_SOURCE_DIR}/download/jom")
+set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/jom")
+
+if(NOT EXISTS ${INSTALL_DIR}/nmake.exe)
+
+  file(DOWNLOAD
+    ${SRC_URL}
+    ${DOWN_DIR}/${SRC_ARC}
+    EXPECTED_HASH SHA256=${SRC_ARC_HASH_SHA256}
+    SHOW_PROGRESS
+    )
+
+  file(MAKE_DIRECTORY ${INSTALL_DIR})
+
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -E tar "xvf" ${DOWN_DIR}/${SRC_ARC}
+    WORKING_DIRECTORY ${INSTALL_DIR}
+    )
+
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -E copy ${INSTALL_DIR}/jom.exe ${INSTALL_DIR}/nmake.exe
+    )
+
+endif()

Modified: trunk/libs/oniguruma.cmake
===================================================================
--- trunk/libs/oniguruma.cmake	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/libs/oniguruma.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=x64 -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake

Modified: trunk/libs/openssl.cmake
===================================================================
--- trunk/libs/openssl.cmake	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/libs/openssl.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P openssl.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P openssl.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P openssl.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P openssl.cmake
 
 ####
@@ -10,6 +11,7 @@
       -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
       -DCMAKE_CONFIGURATION_TYPE=Release
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/VSToolchain.cmake
+      -DARCHITECTURE=${ARCHITECTURE}
       -P openssl.cmake
       )
     execute_process(
@@ -17,6 +19,7 @@
       -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
       -DCMAKE_CONFIGURATION_TYPE=Debug
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/VSToolchain.cmake
+      -DARCHITECTURE=${ARCHITECTURE}
       -P openssl.cmake
       )
     return()
@@ -63,7 +66,7 @@
 
 set(EXTRACT_DIR "${CMAKE_SOURCE_DIR}/build/openssl/src_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/openssl_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${ARCHITECTURE}" MATCHES "x64"))
   set(EXTRACT_DIR "${EXTRACT_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()
@@ -171,11 +174,11 @@
   else()
     message(FATAL_ERROR "CMAKE_GENERATOR ${CMAKE_GENERATOR} not supported")
   endif()
-  if(VCVARS32-NOTFOUND)
+  if(VCVARS32-NOTFOUND OR (${VCVARS32} STREQUAL "VCVARS32-NOTFOUND"))
     message(FATAL_ERROR "vcvars32.bat not found")
   endif()
 
-  if(${CMAKE_GENERATOR} MATCHES "Win64")
+  if((${CMAKE_GENERATOR} MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64"))
     set(CONFIG_TARGET "VC-WIN64A")
     set(DO_MS "ms\\do_win64a.bat")
   else()
@@ -212,9 +215,15 @@
       )
   endif()
   if(${CMAKE_GENERATOR} MATCHES "Visual Studio 16 2019")
-    file(APPEND "${SRC_DIR}/build_cmake.bat"
-      "call \"${VCVARS32_N}\" x86\n"
-      )
+    if("${ARCHITECTURE}" MATCHES "x64")
+      file(APPEND "${SRC_DIR}/build_cmake.bat"
+        "call \"${VCVARS32_N}\" amd64\n"
+        )
+    else()
+      file(APPEND "${SRC_DIR}/build_cmake.bat"
+        "call \"${VCVARS32_N}\" x86\n"
+        )
+    endif()
   elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017 Win64")
     file(APPEND "${SRC_DIR}/build_cmake.bat"
       "call \"${VCVARS32_N}\" amd64\n"
@@ -228,11 +237,18 @@
       "call \"${VCVARS32_N}\"\n"
       )
   endif()
+  # jomでビルドの高速化を試したが次のエラーが出てしまう
+  # 複数の CL.EXE が同じ .PDB ファイルに書き込む場合、/FS を使用してください。
+  # if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/jom/nmake.exe")
+  #   file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} CMAKE_CURRENT_SOURCE_DIR_N)
+  #   file(APPEND "${SRC_DIR}/build_cmake.bat"
+  #     "set PATH=${CMAKE_CURRENT_SOURCE_DIR_N}\\jom;%PATH%\n"
+  #     )
+  # endif()
   file(APPEND "${SRC_DIR}/build_cmake.bat"
     "set PATH=%PATH%;${PERL_N_PATH}\n"
     "nmake -f ms\\nt.mak install\n"
     )
-
   set(BUILD_CMAKE_BAT "${SRC_DIR}/build_cmake.bat")
   file(TO_NATIVE_PATH ${BUILD_CMAKE_BAT} BUILD_CMAKE_BAT_N)
   execute_process(

Modified: trunk/libs/zlib.cmake
===================================================================
--- trunk/libs/zlib.cmake	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/libs/zlib.cmake	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P zlib.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P zlib.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P zlib.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P zlib.cmake
 
 ####

Modified: trunk/teraterm/CMakeLists.txt
===================================================================
--- trunk/teraterm/CMakeLists.txt	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/CMakeLists.txt	2019-07-29 15:04:08 UTC (rev 7896)
@@ -14,13 +14,10 @@
   ttpset
   PROPERTIES FOLDER teraterm)
 
-#if((NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" AND ${CMAKE_MAKE_PROGRAM} MATCHES "VCExpress.exe")) AND (NOT(MINGW)))
-  # MFCを使用しているため VS2005 Express ではビルドできない
-  add_subdirectory(ttpmacro)
-  set_target_properties(
-    ttpmacro
-    PROPERTIES FOLDER teraterm)
-#endif()
+add_subdirectory(ttpmacro)
+set_target_properties(
+  ttpmacro
+  PROPERTIES FOLDER teraterm)
 
 add_subdirectory(ttptek)
 set_target_properties(

Modified: trunk/teraterm/teraterm/tekwin.cpp
===================================================================
--- trunk/teraterm/teraterm/tekwin.cpp	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/tekwin.cpp	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/teraterm/teraterm.manifest
===================================================================
--- trunk/teraterm/teraterm/teraterm.manifest	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/teraterm.manifest	2019-07-29 15:04:08 UTC (rev 7896)
@@ -9,7 +9,7 @@
         type="win32"
         name="Microsoft.Windows.Common-Controls"
         version="6.0.0.0"
-        processorArchitecture="X86"
+        processorArchitecture="*"
         publicKeyToken="6595b64144ccf1df"
         language="*"
       />

Modified: trunk/teraterm/teraterm/ttplug.c
===================================================================
--- trunk/teraterm/teraterm/ttplug.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/ttplug.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -445,8 +445,14 @@
   if(spiVersion[2] != 'I' || spiVersion[3] != 'N')
     goto error;
 
+#if !defined(_M_X64)
   if(!(SPI_IsSupported)(nameFile,(unsigned long)bufFile))
     goto error;
+#else
+  // TODO \x83|\x83C\x83\x93\x83^\x82\xF0 unsigned long \x82ɕϊ\xB7\x82\xB5\x82Ă\xA2\x82\xE9
+  // 64bit\x94\xC5Susie Plug-in \x82\xAA\x91\xB6\x8D݂\xB7\x82\xE9?
+  goto error;
+#endif
 
   if((SPI_GetPicture)(bufFile,sizeFile,1,hbmi,hbuf,NULL,0))
     goto error;

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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;
@@ -3264,7 +3268,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:
@@ -3357,7 +3361,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam)
 {
 	HMENU SysMenu;
 	BOOL Show, B1, B2;
@@ -3398,7 +3402,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);
@@ -5975,7 +5979,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: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/teraterm/vtwin.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/ttpfile/ttfile.c
===================================================================
--- trunk/teraterm/ttpfile/ttfile.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/ttpfile/ttfile.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.cpp	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/teraterm/ttpmacro/ttmmain.cpp	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttpmenu/ttpmenu.cpp
===================================================================
--- trunk/ttpmenu/ttpmenu.cpp	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttpmenu/ttpmenu.cpp	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttpmenu/ttpmenu.h
===================================================================
--- trunk/ttpmenu/ttpmenu.h	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttpmenu/ttpmenu.h	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttpmenu/winmisc.cpp
===================================================================
--- trunk/ttpmenu/winmisc.cpp	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttpmenu/winmisc.cpp	2019-07-29 15:04:08 UTC (rev 7896)
@@ -457,6 +457,6 @@
 		}
 	}
 
-	return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
+	return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA),
 	                      control, msg, wParam, lParam);
 }

Modified: trunk/ttssh2/ttxssh/auth.c
===================================================================
--- trunk/ttssh2/ttxssh/auth.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/auth.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttssh2/ttxssh/fwd.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/fwd.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttssh2/ttxssh/fwdui.c
===================================================================
--- trunk/ttssh2/ttxssh/fwdui.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/fwdui.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttssh2/ttxssh/hosts.c
===================================================================
--- trunk/ttssh2/ttxssh/hosts.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/hosts.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -1714,8 +1714,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];
@@ -1724,7 +1724,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));
@@ -1798,7 +1798,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:
@@ -1869,8 +1869,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];
@@ -1879,7 +1879,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));
@@ -1950,7 +1950,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:
@@ -2022,8 +2022,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];
@@ -2032,7 +2032,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));
@@ -2105,7 +2105,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: trunk/ttssh2/ttxssh/key.c
===================================================================
--- trunk/ttssh2/ttxssh/key.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/key.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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:
@@ -2329,6 +2329,7 @@
 	buffer_t *bsig = NULL;
 	char *cp, *sig;
 	size_t i, ndone, siglen;
+	int siglen_i;
 	int ret;
 
 	// SSH2 packet format:
@@ -2384,7 +2385,8 @@
 		free(blob);
 		blob = NULL;
 
-		sig = buffer_get_string_msg(bsig, &siglen);
+		sig = buffer_get_string_msg(bsig, &siglen_i);
+		siglen = siglen_i;
 		// Verify signature
 		ret = key_verify(ctx->keys[i], sig, siglen, buffer_ptr(b), buffer_len(b));
 		free(sig);

Modified: trunk/ttssh2/ttxssh/sftp.c
===================================================================
--- trunk/ttssh2/ttxssh/sftp.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/sftp.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/ssh.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -7427,7 +7427,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: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2019-07-29 11:19:53 UTC (rev 7895)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2019-07-29 15:04:08 UTC (rev 7896)
@@ -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 メーリングリストの案内
Back to archive index