|
|
|
@ -150,12 +150,23 @@ static int file_lookup(struct in_addr *addr, struct hostent **host) |
|
|
|
|
|
|
|
|
|
char PATH_HOSTS[MAX_PATH]; |
|
|
|
|
if (IsNT) { |
|
|
|
|
GetSystemDirectory(PATH_HOSTS, MAX_PATH); |
|
|
|
|
strcat(PATH_HOSTS, PATH_HOSTS_NT); |
|
|
|
|
} else { |
|
|
|
|
char tmp[MAX_PATH]; |
|
|
|
|
HKEY hkeyHosts; |
|
|
|
|
|
|
|
|
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) |
|
|
|
|
== ERROR_SUCCESS) |
|
|
|
|
{ |
|
|
|
|
DWORD dwLength = MAX_PATH; |
|
|
|
|
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, tmp,
|
|
|
|
|
&dwLength); |
|
|
|
|
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); |
|
|
|
|
RegCloseKey(hkeyHosts); |
|
|
|
|
} |
|
|
|
|
}
|
|
|
|
|
else |
|
|
|
|
GetWindowsDirectory(PATH_HOSTS, MAX_PATH); |
|
|
|
|
strcat(PATH_HOSTS, PATH_HOSTS_9X); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
strcat(PATH_HOSTS, WIN_PATH_HOSTS); |
|
|
|
|
|
|
|
|
|
#elif defined(WATT32) |
|
|
|
|
extern const char *_w32_GetHostsFile (void); |
|
|
|
|