svnno****@sourc*****
svnno****@sourc*****
2013年 3月 22日 (金) 23:17:03 JST
Revision: 5159 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5159 Author: maya Date: 2013-03-22 23:17:01 +0900 (Fri, 22 Mar 2013) Log Message: ----------- getipv4addr マクロコマンドが IPv4 アドレスを返さない問題を修正 Modified Paths: -------------- trunk/teraterm/ttpmacro/ttl.c -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/ttl.c =================================================================== --- trunk/teraterm/ttpmacro/ttl.c 2013-03-22 11:10:08 UTC (rev 5158) +++ trunk/teraterm/ttpmacro/ttl.c 2013-03-22 14:17:01 UTC (rev 5159) @@ -2181,6 +2181,7 @@ { WORD Err; TVarId VarId, id; + WSADATA ws; INTERFACE_INFO info[MAX_IPADDR]; SOCKET sock; DWORD socknum; @@ -2195,6 +2196,10 @@ if (Err!=0) return Err; // \x8E\xA9\x95\xAA\x8E\xA9\x90g\x82̑SIPv4\x83A\x83h\x83\x8C\x83X\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B + if (WSAStartup(MAKEWORD(2,2), &ws) != 0) { + SetResult(-1); + return Err; + } num = 0; sock = WSASocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0); if (WSAIoctl(sock, SIO_GET_INTERFACE_LIST, NULL, 0, info, sizeof(info), &socknum, NULL, NULL) != SOCKET_ERROR) { @@ -2216,6 +2221,7 @@ } } closesocket(sock); + WSACleanup(); SetResult(num);