diff options
author | Yang Tse <yangsita@gmail.com> | 2011-03-23 20:53:28 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-03-23 20:53:28 +0100 |
commit | bd066ab8efa0d43ef002954f4587a195a15ac460 (patch) | |
tree | 450f425d38f2c2d873e5cd8f1f829a957d1d4a4e /ares_gethostbyaddr.c | |
parent | 822fd0f8771d3792da0a08276ab0400b2a68f07e (diff) | |
download | c-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.tar.gz c-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.tar.bz2 c-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.zip |
build: find out windows platform using GetVersionEx()
Diffstat (limited to 'ares_gethostbyaddr.c')
-rw-r--r-- | ares_gethostbyaddr.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ares_gethostbyaddr.c b/ares_gethostbyaddr.c index 0de2cf2..2945c4b 100644 --- a/ares_gethostbyaddr.c +++ b/ares_gethostbyaddr.c @@ -186,7 +186,13 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host) #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; - if (IS_NT()) { + win_platform platform; + + PATH_HOSTS[0] = '\0'; + + platform = getplatform(); + + if (platform == WIN_NT) { char tmp[MAX_PATH]; HKEY hkeyHosts; @@ -200,8 +206,10 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host) RegCloseKey(hkeyHosts); } } - else + else if (platform == WIN_9X) GetWindowsDirectory(PATH_HOSTS, MAX_PATH); + else + return ARES_ENOTFOUND; strcat(PATH_HOSTS, WIN_PATH_HOSTS); |