[Ttssh2-commit] [4089] WSAAsyncGetAddrInfo を TTX からフックできるようにした。

svnno****@sourc***** svnno****@sourc*****
2010年 9月 7日 (火) 12:42:35 JST


Revision: 4089
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4089
Author:   doda
Date:     2010-09-07 12:42:35 +0900 (Tue, 07 Sep 2010)

Log Message:
-----------
WSAAsyncGetAddrInfo を TTX からフックできるようにした。

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/common/ttplugin.h
    trunk/teraterm/teraterm/commlib.c
    trunk/teraterm/teraterm/ttplug.h
    trunk/teraterm/teraterm/ttwsk.c
    trunk/teraterm/teraterm/ttwsk.h


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/doc/en/html/about/history.html	2010-09-07 03:42:35 UTC (rev 4089)
@@ -37,6 +37,7 @@
       <li>added support for the selective erase.</li>
       <!-- li>"ƒEƒBƒ“ƒhƒE" ƒƒjƒ…[A‚¨‚æ‚Ñ "ƒEƒBƒ“ƒhƒE‚̃ŠƒXƒg" ƒ_ƒCƒAƒƒO‚ŁAƒEƒBƒ“ƒhƒE‚̏ó‘Ô‚ð•\‚·•¶Žš‚ð•\Ž¦‚·‚é‚悤‚É‚µ‚½B</li -->
       <!-- li>Žg—p‰Â”\‚ȃvƒ‰ƒOƒCƒ“‚̐”‚ð 16 ‚©‚ç 32 ‚É‘‚₵‚½B</li -->
+      <!-- li>WSAAsyncGetAddrInfo ‚ðƒvƒ‰ƒOƒCƒ“‚©‚çƒtƒbƒNo—ˆ‚é‚悤‚É‚µ‚½B</li -->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/doc/ja/html/about/history.html	2010-09-07 03:42:35 UTC (rev 4089)
@@ -37,6 +37,7 @@
       <li>‘I‘ð“IÁ‹Ž‚ɑΉž‚µ‚½B</li>
       <li>"ƒEƒBƒ“ƒhƒE" ƒƒjƒ…[A‚¨‚æ‚Ñ "ƒEƒBƒ“ƒhƒE‚̃ŠƒXƒg" ƒ_ƒCƒAƒƒO‚ŁAƒEƒBƒ“ƒhƒE‚̏ó‘Ô‚ð•\‚·•¶Žš‚ð•\Ž¦‚·‚é‚悤‚É‚µ‚½B</li>
       <li>Žg—p‰Â”\‚ȃvƒ‰ƒOƒCƒ“‚̐”‚ð 16 ‚©‚ç 32 ‚É‘‚₵‚½B</li>
+      <li>WSAAsyncGetAddrInfo ‚ðƒvƒ‰ƒOƒCƒ“‚©‚çƒtƒbƒNo—ˆ‚é‚悤‚É‚µ‚½B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/common/ttplugin.h
===================================================================
--- trunk/teraterm/common/ttplugin.h	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/teraterm/common/ttplugin.h	2010-09-07 03:42:35 UTC (rev 4089)
@@ -29,6 +29,7 @@
   TWSAAsyncGetHostByName FAR * PWSAAsyncGetHostByName;
   TWSACancelAsyncRequest FAR * PWSACancelAsyncRequest;
   TWSAGetLastError FAR * PWSAGetLastError;
+  TWSAAsyncGetAddrInfo FAR * PWSAAsyncGetAddrInfo;
 } TTXSockHooks;
 
 typedef struct {

Modified: trunk/teraterm/teraterm/commlib.c
===================================================================
--- trunk/teraterm/teraterm/commlib.c	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/teraterm/teraterm/commlib.c	2010-09-07 03:42:35 UTC (rev 4089)
@@ -20,7 +20,6 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <stdio.h> /* for _snprintf() */
-#include "WSAAsyncGetAddrInfo.h"
 #endif /* NO_INET6 */
 #include <time.h>
 #include <locale.h>
@@ -327,7 +326,7 @@
 				hints.ai_protocol = IPPROTO_TCP;
 				_snprintf_s(pname, sizeof(pname), _TRUNCATE, "%d", ts->TCPPort);
 
-				HAsync = WSAAsyncGetAddrInfo(HW, WM_USER_GETHOST,
+				HAsync = PWSAAsyncGetAddrInfo(HW, WM_USER_GETHOST,
 				                             ts->HostName, pname, &hints, &cv->res0);
 				if (HAsync == 0)
 					InvalidHost = TRUE;

Modified: trunk/teraterm/teraterm/ttplug.h
===================================================================
--- trunk/teraterm/teraterm/ttplug.h	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/teraterm/teraterm/ttplug.h	2010-09-07 03:42:35 UTC (rev 4089)
@@ -21,7 +21,8 @@
       &Pclosesocket, &Pconnect, &Phtonl, &Phtons, &Pinet_addr,   \
       &Pioctlsocket, &Precv, &Pselect, &Psend, &Psetsockopt,     \
       &Psocket, &PWSAAsyncSelect, &PWSAAsyncGetHostByName,       \
-      &PWSACancelAsyncRequest, &PWSAGetLastError                 \
+      &PWSACancelAsyncRequest, &PWSAGetLastError,                \
+      &PWSAAsyncGetAddrInfo                                      \
     };                                                           \
     TTXInternalOpenTCP(&SockHooks);                              \
   } while (0)
@@ -36,7 +37,8 @@
       &Pclosesocket, &Pconnect, &Phtonl, &Phtons, &Pinet_addr,   \
       &Pioctlsocket, &Precv, &Pselect, &Psend, &Psetsockopt,     \
       &Psocket, &PWSAAsyncSelect, &PWSAAsyncGetHostByName,       \
-      &PWSACancelAsyncRequest, &PWSAGetLastError                 \
+      &PWSACancelAsyncRequest, &PWSAGetLastError,                \
+      &PWSAAsyncGetAddrInfo                                      \
     };                                                           \
     TTXInternalCloseTCP(&SockHooks);                             \
   } while (0)

Modified: trunk/teraterm/teraterm/ttwsk.c
===================================================================
--- trunk/teraterm/teraterm/ttwsk.c	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/teraterm/teraterm/ttwsk.c	2010-09-07 03:42:35 UTC (rev 4089)
@@ -6,6 +6,7 @@
 
 #include "teraterm.h"
 #include "ttwsk.h"
+#include "WSAAsyncGetAddrInfo.h"
 
 static HANDLE HWinsock = NULL;
 
@@ -27,6 +28,7 @@
 TWSAGetLastError PWSAGetLastError;
 TWSAStartup PWSAStartup;
 TWSACleanup PWSACleanup;
+TWSAAsyncGetAddrInfo PWSAAsyncGetAddrInfo;
 
 void CheckWinsock()
 {
@@ -142,6 +144,8 @@
     PWSACleanup = (TWSACleanup)GetProcAddress(HWinsock, MAKEINTRESOURCE(IdWSACLEANUP));
     if (PWSACleanup==NULL) Err = TRUE;
 
+    PWSAAsyncGetAddrInfo = WSAAsyncGetAddrInfo;
+
     if (Err)
     {
       FreeLibrary(HWinsock);

Modified: trunk/teraterm/teraterm/ttwsk.h
===================================================================
--- trunk/teraterm/teraterm/ttwsk.h	2010-09-07 03:37:11 UTC (rev 4088)
+++ trunk/teraterm/teraterm/ttwsk.h	2010-09-07 03:42:35 UTC (rev 4089)
@@ -49,6 +49,10 @@
   (HWND hWnd, u_int wMsg, const char FAR * name, char FAR * buf, int buflen);
 typedef int (PASCAL FAR *TWSACancelAsyncRequest)(HANDLE hAsyncTaskHandle);
 typedef int (PASCAL FAR *TWSAGetLastError)(void);
+typedef HANDLE (__cdecl *TWSAAsyncGetAddrInfo)
+  (HWND hWnd, unsigned int wMsg, const char FAR * hostname,
+   const char FAR * portname, struct addrinfo FAR * hints,
+   struct addrinfo FAR * FAR * res);
 
 BOOL LoadWinsock();
 void FreeWinsock();
@@ -71,6 +75,7 @@
 extern TWSAGetLastError PWSAGetLastError;
 extern TWSAStartup PWSAStartup;
 extern TWSACleanup PWSACleanup;
+extern TWSAAsyncGetAddrInfo PWSAAsyncGetAddrInfo;
 
 #ifdef __cplusplus
 }



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