[Ttssh2-commit] [7257] 64bit考慮

scmno****@osdn***** scmno****@osdn*****
2018年 11月 4日 (日) 00:33:39 JST


Revision: 7257
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7257
Author:   zmatsuo
Date:     2018-11-04 00:33:38 +0900 (Sun, 04 Nov 2018)
Log Message:
-----------
64bit考慮

Modified Paths:
--------------
    branches/cmake/teraterm/teraterm/CMakeLists.txt
    branches/cmake/teraterm/ttpdlg/ttdlg.c
    branches/cmake/teraterm/ttpfile/ttfile.c
    branches/cmake/ttpmenu/ttpmenu.cpp
    branches/cmake/ttpmenu/winmisc.cpp
    branches/cmake/ttssh2/ttxssh/auth.c
    branches/cmake/ttssh2/ttxssh/fwd.c
    branches/cmake/ttssh2/ttxssh/fwdui.c
    branches/cmake/ttssh2/ttxssh/hosts.c
    branches/cmake/ttssh2/ttxssh/key.c
    branches/cmake/ttssh2/ttxssh/sftp.c
    branches/cmake/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: branches/cmake/teraterm/teraterm/CMakeLists.txt
===================================================================
--- branches/cmake/teraterm/teraterm/CMakeLists.txt	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/teraterm/teraterm/CMakeLists.txt	2018-11-03 15:33:38 UTC (rev 7257)
@@ -4,14 +4,10 @@
 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_oniguruma.cmake)
 
 if (MSVC)
-    string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG            ${CMAKE_C_FLAGS_DEBUG})
-    string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_MINSIZEREL       ${CMAKE_C_FLAGS_MINSIZEREL})
-    string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE          ${CMAKE_C_FLAGS_RELEASE})
-    string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO   ${CMAKE_C_FLAGS_RELWITHDEBINFO})
-    string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG          ${CMAKE_CXX_FLAGS_DEBUG})
-    string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL     ${CMAKE_CXX_FLAGS_MINSIZEREL})
-    string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE        ${CMAKE_CXX_FLAGS_RELEASE})
-    string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG            ${CMAKE_C_FLAGS_DEBUG})
+  string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE          ${CMAKE_C_FLAGS_RELEASE})
+  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG          ${CMAKE_CXX_FLAGS_DEBUG})
+  string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE        ${CMAKE_CXX_FLAGS_RELEASE})
 endif ()
 
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")

Modified: branches/cmake/teraterm/ttpdlg/ttdlg.c
===================================================================
--- branches/cmake/teraterm/ttpdlg/ttdlg.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/teraterm/ttpdlg/ttdlg.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -140,7 +140,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfosCom, _countof(TextInfosCom), UILanguageFile);
 			if ( ts->Language==IdJapanese ) {
@@ -273,7 +273,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 
 					if ( ts!=NULL ) {
 						int width, height;
@@ -551,7 +551,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 			SetDlgItemText(Dialog, IDC_WINTITLE, ts->Title);
@@ -689,7 +689,7 @@
 			return TRUE;
 
 		case WM_COMMAND:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 			RestoreVar(Dialog,ts,&IAttr,&IOffset);
 			switch (LOWORD(wParam)) {
 				case IDOK:
@@ -941,7 +941,7 @@
 			break;
 
 		case WM_PAINT:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 			if ( ts==NULL ) {
 				return TRUE;
 			}
@@ -950,7 +950,7 @@
 			break;
 
 		case WM_HSCROLL:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 			if (ts==NULL) {
 				return TRUE;
 			}
@@ -1043,7 +1043,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 
@@ -1069,7 +1069,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 					if ( ts!=NULL ) {
 						WORD w;
 
@@ -1133,7 +1133,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 
@@ -1204,7 +1204,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 					if ( ts!=NULL ) {
 						memset(Temp, 0, sizeof(Temp));
 						GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1);
@@ -1284,7 +1284,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 				
@@ -1322,7 +1322,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						WritePrivateProfileString("Hosts",NULL,NULL,ts->SetupFName);
 
@@ -1471,7 +1471,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)GetWindowLong(Dialog,DWLP_USER);
 						if (ts!=NULL) {
 							SetDlgItemInt(Dialog,IDC_TCPIPPORT,ts->TelPort,FALSE);
 						}
@@ -1515,7 +1515,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			GetHNRec = (PGetHNRec)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 		
@@ -1620,7 +1620,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+					GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWLP_USER);
 					if ( GetHNRec!=NULL ) {
 						char afstr[BUFSIZ];
 						GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
@@ -1681,7 +1681,7 @@
 				case IDC_HOSTTELNET:
 					GetRB(Dialog,&i,IDC_HOSTTELNET,IDC_HOSTTELNET);
 					if ( i==1 ) {
-						GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+						GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWLP_USER);
 						if ( GetHNRec!=NULL ) {
 							SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TelPort,FALSE);
 						}
@@ -1746,7 +1746,7 @@
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 				
 			CurDir = (PCHAR)(lParam);
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgItemText(Dialog, IDC_DIRCURRENT, CurDir);
 			SendDlgItemMessage(Dialog, IDC_DIRNEW, EM_LIMITTEXT,
@@ -1825,7 +1825,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					CurDir = (PCHAR)GetWindowLong(Dialog,DWL_USER);
+					CurDir = (PCHAR)GetWindowLong(Dialog,DWLP_USER);
 					if ( CurDir!=NULL ) {
 						_getcwd(HomeDir,sizeof(HomeDir));
 						_chdir(CurDir);
@@ -2551,7 +2551,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			ts = (PTTSet)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 		
@@ -2593,7 +2593,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLong(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						w = (WORD)GetCurSel(Dialog, IDC_GENPORT);
 						if (w>1) {
@@ -2674,7 +2674,7 @@
 	switch (Message) {
 		case WM_INITDIALOG:
 			Close = (PBOOL)lParam;
-			SetWindowLong(Dialog, DWL_USER, lParam);
+			SetWindowLong(Dialog, DWLP_USER, lParam);
 
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 		
@@ -2719,7 +2719,7 @@
 						PostMessage(Hw,WM_SYSCOMMAND,SC_CLOSE,0);
 					}
 					else {
-						Close = (PBOOL)GetWindowLong(Dialog,DWL_USER);
+						Close = (PBOOL)GetWindowLong(Dialog,DWLP_USER);
 						if (Close!=NULL) {
 							*Close = TRUE;
 						}

Modified: branches/cmake/teraterm/ttpfile/ttfile.c
===================================================================
--- branches/cmake/teraterm/ttpfile/ttfile.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/teraterm/ttpfile/ttfile.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -270,7 +270,7 @@
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)(ofn->lCustData);
 		opt = *pl;
-		SetWindowLongPtr(Dialog, DWLP_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -602,7 +602,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);
@@ -629,7 +629,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) {
@@ -647,7 +647,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) {
@@ -822,7 +822,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);
@@ -857,7 +857,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) {
@@ -985,7 +985,7 @@
 	case WM_INITDIALOG:
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)ofn->lCustData;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -1042,7 +1042,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
@@ -1077,7 +1077,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;

Modified: branches/cmake/ttpmenu/ttpmenu.cpp
===================================================================
--- branches/cmake/ttpmenu/ttpmenu.cpp	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttpmenu/ttpmenu.cpp	2018-11-03 15:33:38 UTC (rev 7257)
@@ -655,8 +655,8 @@
 {
 	HWND passwordControl = GetDlgItem(dlg, item);
 
-	SetWindowLong(passwordControl, GWL_USERDATA,
-	              SetWindowLong(passwordControl, GWL_WNDPROC,
+	SetWindowLong(passwordControl, GWLP_USERDATA,
+	              SetWindowLong(passwordControl, GWLP_WNDPROC,
 	                            (LONG) password_wnd_proc));
 }
 
@@ -2076,7 +2076,7 @@
 	case BUTTON_ETC:
 		::GetDlgItemText(hWnd, EDIT_ENTRY, g_JobInfo.szName, MAX_PATH);
 		g_JobInfo.bTtssh	= ::IsDlgButtonChecked(hWnd, CHECK_TTSSH);
-		if (::DialogBox(g_hI, (LPCTSTR) DIALOG_ETC, hWnd, DlgCallBack_Etc) == TRUE) {
+		if (::DialogBox(g_hI, (LPCTSTR) DIALOG_ETC, hWnd, (DLGPROC)DlgCallBack_Etc) == TRUE) {
 			::CheckDlgButton(hWnd, CHECK_TTSSH, 0);
 			if ((pt = lstrstri(g_JobInfo.szTeraTerm, TTSSH)) != NULL)
 				if (::lstrcmpi(pt, TTSSH) == 0)
@@ -2279,13 +2279,13 @@
 
 	switch(LOWORD(wParam)) {
 	case ID_TMENU_ADD:
-		::DialogBox(g_hI, (LPCTSTR) DIALOG_CONFIG, 0, DlgCallBack_Config);
+		::DialogBox(g_hI, (LPCTSTR) DIALOG_CONFIG, 0, (DLGPROC)DlgCallBack_Config);
 		return TRUE;
 	case ID_TMENU_CLOSE:
 		::DestroyWindow(hWnd);
 		return	TRUE;
 	case ID_VERSION:
-		::DialogBox(g_hI, (LPCTSTR) DIALOG_VERSION, hWnd, DlgCallBack_Version);
+		::DialogBox(g_hI, (LPCTSTR) DIALOG_VERSION, hWnd, (DLGPROC)DlgCallBack_Version);
 		return TRUE;
 	case ID_ICON:
 		if (GetMenuState(g_hConfigMenu, ID_ICON, MF_BYCOMMAND & MF_CHECKED) != 0) {

Modified: branches/cmake/ttpmenu/winmisc.cpp
===================================================================
--- branches/cmake/ttpmenu/winmisc.cpp	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttpmenu/winmisc.cpp	2018-11-03 15:33:38 UTC (rev 7257)
@@ -457,6 +457,6 @@
 		}
 	}
 
-	return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
+	return CallWindowProc((WNDPROC) GetWindowLong(control, GWLP_USERDATA),
 	                      control, msg, wParam, lParam);
 }

Modified: branches/cmake/ttssh2/ttxssh/auth.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/auth.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/auth.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -78,7 +78,7 @@
 		}
 	}
 
-	return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
+	return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA),
 	                      control, msg, wParam, lParam);
 }
 
@@ -86,9 +86,9 @@
 {
 	HWND passwordControl = GetDlgItem(dlg, IDC_SSHPASSWORD);
 
-	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));
 
 	SetFocus(passwordControl);
 }
@@ -691,7 +691,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->auth_state.auth_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_auth_dlg(pvar, dlg);
 
@@ -748,7 +748,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_TIMER:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(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
@@ -839,7 +839,7 @@
 		return FALSE;
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1145,7 +1145,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);
 
@@ -1171,7 +1171,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1366,7 +1366,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);
 
@@ -1398,7 +1398,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/cmake/ttssh2/ttxssh/fwd.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/fwd.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/fwd.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -533,11 +533,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);
 		}
 	}
 
@@ -747,7 +747,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/cmake/ttssh2/ttxssh/fwdui.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/fwdui.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/fwdui.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -982,7 +982,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);
@@ -1020,7 +1020,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:
@@ -1147,7 +1147,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_fwd_dlg(pvar, dlg);
 
@@ -1171,7 +1171,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/cmake/ttssh2/ttxssh/hosts.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/hosts.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/hosts.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -1710,7 +1710,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(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));
@@ -1803,7 +1803,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -1876,7 +1876,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(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));
@@ -1966,7 +1966,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -2040,7 +2040,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(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));
@@ -2133,7 +2133,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:

Modified: branches/cmake/ttssh2/ttxssh/key.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/key.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/key.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -2200,7 +2200,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar)lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOSTKEY_ROTATION_TITLE", pvar, uimsg);
@@ -2261,7 +2261,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar)GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar)GetWindowLong(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/cmake/ttssh2/ttxssh/sftp.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/sftp.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/sftp.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -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)GetWindowLong(hEdit, GWLP_WNDPROC);
+			SetWindowLong(hEdit, GWLP_WNDPROC, (LONG)EditProc);
 
 			return TRUE;
 

Modified: branches/cmake/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/ttxssh.c	2018-11-03 15:33:07 UTC (rev 7256)
+++ branches/cmake/ttssh2/ttxssh/ttxssh.c	2018-11-03 15:33:38 UTC (rev 7257)
@@ -1255,7 +1255,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		GetHNRec = (PGetHNRec) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg);
@@ -1332,8 +1332,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)GetWindowLong(hwndHostnameEdit, GWLP_WNDPROC);
+		SetWindowLong(hwndHostnameEdit, GWLP_WNDPROC, (LONG)HostnameEditProc);
 
 		CheckRadioButton(dlg, IDC_HOSTTELNET, IDC_HOSTOTHER,
 		                 pvar->settings.Enabled ? IDC_HOSTSSH : GetHNRec->
@@ -1488,7 +1488,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWLP_USER);
 			if (GetHNRec != NULL) {
 				if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) {
 					char afstr[BUFSIZ];
@@ -1554,7 +1554,7 @@
 					}
 				}
 			}
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLong(hwndHostnameEdit, GWLP_WNDPROC, (LONG)OrigHostnameEditProc);
 			EndDialog(dlg, 1);
 
 			if (DlgHostFont != NULL) {
@@ -1564,7 +1564,7 @@
 			return TRUE;
 
 		case IDCANCEL:
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLong(hwndHostnameEdit, GWLP_WNDPROC, (LONG)OrigHostnameEditProc);
 			EndDialog(dlg, 0);
 
 			if (DlgHostFont != NULL) {
@@ -1614,7 +1614,7 @@
 			enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled
 hostssh_enabled:
 
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWLP_USER);
 
 			if (IsDlgButtonChecked(dlg, IDC_HOSTTELNET)) {
 				if (GetHNRec != NULL)
@@ -3297,7 +3297,7 @@
 
 	switch (msg) {
 	case WM_INITDIALOG:
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLong(dlg, DWLP_USER, lParam);
 		init_setup_dlg((PTInstVar) lParam, dlg);
 
 		font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
@@ -3361,7 +3361,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWL_USER), dlg);
+			complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWLP_USER), dlg);
 			EndDialog(dlg, 1);
 			if (DlgSetupFont != NULL) {
 				DeleteObject(DlgSetupFont);
@@ -4128,8 +4128,8 @@
 {
 	HWND passwordControl = GetDlgItem(dlg, item);
 
-	SetWindowLong(passwordControl, GWL_USERDATA,
-	              SetWindowLong(passwordControl, GWL_WNDPROC,
+	SetWindowLong(passwordControl, GWLP_USERDATA,
+	              SetWindowLong(passwordControl, GWLP_WNDPROC,
 	                            (LONG) password_wnd_proc));
 }
 


More information about the Ttssh2-commit mailing list