svnno****@sourc*****
svnno****@sourc*****
2016年 1月 7日 (木) 23:49:04 JST
Revision: 6258 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6258 Author: maya Date: 2016-01-07 23:49:04 +0900 (Thu, 07 Jan 2016) Log Message: ----------- バージョンチェックを変更 OS のバージョン番号ではなく関数の有無をチェックする関数を作成 Modified Paths: -------------- branches/vs2015_warn/teraterm/common/ttlib.c branches/vs2015_warn/teraterm/common/ttlib.h branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def branches/vs2015_warn/ttssh2/ttxssh/dns.c -------------- next part -------------- Modified: branches/vs2015_warn/teraterm/common/ttlib.c =================================================================== --- branches/vs2015_warn/teraterm/common/ttlib.c 2016-01-07 14:29:18 UTC (rev 6257) +++ branches/vs2015_warn/teraterm/common/ttlib.c 2016-01-07 14:49:04 UTC (rev 6258) @@ -1228,6 +1228,19 @@ return FALSE; } +// OS \x82\xAA DnsQuery \x82\xF0\x83T\x83|\x81[\x83g\x82\xB5\x82Ă\xA2\x82邩\x82ǂ\xA4\x82\xA9\x82ʂ\xB7\x82\xE9\x81B +// 2000 \x88ȍ~\x82\xCD TRUE \x82\xF0\x95Ԃ\xB7 +BOOL HasDnsQuery() +{ + HMODULE mod; + + if (((mod = GetModuleHandle("Dnsapi.dll")) != NULL) && + (GetProcAddress(mod, "DnsQuery") != NULL)) { + return TRUE; + } + return FALSE; +} + int get_OPENFILENAME_SIZE() { if (IsWindows2000OrLater()) { Modified: branches/vs2015_warn/teraterm/common/ttlib.h =================================================================== --- branches/vs2015_warn/teraterm/common/ttlib.h 2016-01-07 14:29:18 UTC (rev 6257) +++ branches/vs2015_warn/teraterm/common/ttlib.h 2016-01-07 14:49:04 UTC (rev 6258) @@ -54,6 +54,7 @@ BOOL IsWindows7OrLater(); BOOL HasMultiMonitorSupport(); BOOL HasGetAdaptersAddresses(); +BOOL HasDnsQuery(); int KanjiCode2List(int lang, int kcode); int List2KanjiCode(int lang, int kcode); int KanjiCodeTranslate(int lang, int kcode); Modified: branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def =================================================================== --- branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def 2016-01-07 14:29:18 UTC (rev 6257) +++ branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def 2016-01-07 14:49:04 UTC (rev 6258) @@ -68,3 +68,4 @@ IsWindows7OrLater @70 HasMultiMonitorSupport @71 HasGetAdaptersAddresses @72 + HasDnsQuery @73 Modified: branches/vs2015_warn/ttssh2/ttxssh/dns.c =================================================================== --- branches/vs2015_warn/ttssh2/ttxssh/dns.c 2016-01-07 14:29:18 UTC (rev 6257) +++ branches/vs2015_warn/ttssh2/ttxssh/dns.c 2016-01-07 14:49:04 UTC (rev 6258) @@ -61,7 +61,7 @@ BYTE *hostkey_digest = NULL; int found = DNS_VERIFY_NOTFOUND; - if (!IsWindows2000OrLater()) { + if (!HasDnsQuery()) { // DnsQuery \x82\xCD Windows 2000 \x88ȏ\xE3\x82ł\xB5\x82\xA9\x93\xAE\x8D삵\x82Ȃ\xA2\x82\xBD\x82\xDF return DNS_VERIFY_NONE; }