[Ttssh2-commit] [7931] _beginthreadex()の戻り値チェックを修正

Zurück zum Archiv-Index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 9日 (金) 22:37:01 JST


Revision: 7931
          https://osdn.net/projects/ttssh2/scm/svn/commits/7931
Author:   zmatsuo
Date:     2019-08-09 22:37:01 +0900 (Fri, 09 Aug 2019)
Log Message:
-----------
_beginthreadex()の戻り値チェックを修正

- エラー時の戻り値は0

Modified Paths:
--------------
    trunk/doc/en/html/reference/sourcecode.html
    trunk/doc/ja/html/reference/sourcecode.html
    trunk/teraterm/teraterm/telnet.c
    trunk/ttssh2/ttxssh/ssh.c

-------------- next part --------------
Modified: trunk/doc/en/html/reference/sourcecode.html
===================================================================
--- trunk/doc/en/html/reference/sourcecode.html	2019-08-09 13:36:46 UTC (rev 7930)
+++ trunk/doc/en/html/reference/sourcecode.html	2019-08-09 13:37:01 UTC (rev 7931)
@@ -515,7 +515,7 @@
 <pre class=code>
 #define WM_SEND_HEARTBEAT (WM_USER + 1)
 
-static LRESULT CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+static INT_PTR CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 
 	switch (msg) {
@@ -566,11 +566,12 @@
   if (ts.TelKeepAliveInterval > 0) {
     nop_interval = ts.TelKeepAliveInterval;
 
-	keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
-               HVTWin, (DLGPROC)telnet_heartbeat_dlg_proc);
+    keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+               HVTWin, telnet_heartbeat_dlg_proc);
 
     keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-    if (keepalive_thread == (HANDLE)-1) {
+    if (keepalive_thread == 0) {
+      keepalive_thread = INVALID_HANDLE_VALUE;
       nop_interval = 0;
     }
   }

Modified: trunk/doc/ja/html/reference/sourcecode.html
===================================================================
--- trunk/doc/ja/html/reference/sourcecode.html	2019-08-09 13:36:46 UTC (rev 7930)
+++ trunk/doc/ja/html/reference/sourcecode.html	2019-08-09 13:37:01 UTC (rev 7931)
@@ -515,7 +515,7 @@
 <pre class=code>
 #define WM_SEND_HEARTBEAT (WM_USER + 1)
 
-static LRESULT CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+static INT_PTR CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 
 	switch (msg) {
@@ -566,11 +566,12 @@
   if (ts.TelKeepAliveInterval > 0) {
     nop_interval = ts.TelKeepAliveInterval;
 
-	keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
-               HVTWin, (DLGPROC)telnet_heartbeat_dlg_proc);
+    keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+               HVTWin, telnet_heartbeat_dlg_proc);
 
     keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-    if (keepalive_thread == (HANDLE)-1) {
+    if (keepalive_thread == 0) {
+      keepalive_thread = INVALID_HANDLE_VALUE;
       nop_interval = 0;
     }
   }

Modified: trunk/teraterm/teraterm/telnet.c
===================================================================
--- trunk/teraterm/teraterm/telnet.c	2019-08-09 13:36:46 UTC (rev 7930)
+++ trunk/teraterm/teraterm/telnet.c	2019-08-09 13:37:01 UTC (rev 7931)
@@ -862,7 +862,8 @@
 										HVTWin, telnet_heartbeat_dlg_proc);
 
 		keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-		if (keepalive_thread == (HANDLE)-1) {
+		if (keepalive_thread == 0) {
+			keepalive_thread = INVALID_HANDLE_VALUE;
 			nop_interval = 0;
 		}
 	}

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2019-08-09 13:36:46 UTC (rev 7930)
+++ trunk/ttssh2/ttxssh/ssh.c	2019-08-09 13:37:01 UTC (rev 7931)
@@ -6825,8 +6825,9 @@
 
 	// TTSSH\x82\xCD thread-safe \x82ł͂Ȃ\xA2\x82̂ŃX\x83\x8C\x83b\x83h\x93\xE0\x82\xA9\x82\xE7\x82̃p\x83P\x83b\x83g\x91\x97\x90M\x82͕s\x89B(2007.12.26 yutaka)
 	thread = (HANDLE)_beginthreadex(NULL, 0, ssh_heartbeat_thread, pvar, 0, &tid);
-	if (thread == (HANDLE)-1) {
+	if (thread == 0) {
 		// TODO:
+		thread = INVALID_HANDLE_VALUE;
 	}
 	pvar->ssh_heartbeat_thread = thread;
 }
@@ -8436,8 +8437,9 @@
 		}
 
 		thread = (HANDLE)_beginthreadex(NULL, 0, ssh_scp_thread, c, 0, &tid);
-		if (thread == (HANDLE)-1) {
+		if (thread == 0) {
 			// TODO:
+			thread = INVALID_HANDLE_VALUE;
 		}
 		c->scp.thread = thread;
 
@@ -8697,8 +8699,9 @@
 
 			ssh2_scp_alloc_packetlist(c);
 			thread = (HANDLE)_beginthreadex(NULL, 0, ssh_scp_receive_thread, c, 0, &tid);
-			if (thread == (HANDLE)-1) {
+			if (thread == 0) {
 				// TODO:
+				thread = INVALID_HANDLE_VALUE;
 			}
 			c->scp.thread = thread;
 			c->scp.thread_id = tid;


Ttssh2-commit メーリングリストの案内
Zurück zum Archiv-Index