[Ttssh2-commit] [7870] HANDLEを扱う部分のエラー対策

scmno****@osdn***** scmno****@osdn*****
2019年 7月 21日 (日) 00:18:45 JST


Revision: 7870
          https://osdn.net/projects/ttssh2/scm/svn/commits/7870
Author:   zmatsuo
Date:     2019-07-21 00:18:45 +0900 (Sun, 21 Jul 2019)
Log Message:
-----------
HANDLEを扱う部分のエラー対策

Modified Paths:
--------------
    branches/x64/TTProxy/ProxyWSockHook.h

-------------- next part --------------
Modified: branches/x64/TTProxy/ProxyWSockHook.h
===================================================================
--- branches/x64/TTProxy/ProxyWSockHook.h	2019-07-20 15:18:35 UTC (rev 7869)
+++ branches/x64/TTProxy/ProxyWSockHook.h	2019-07-20 15:18:45 UTC (rev 7870)
@@ -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)


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