Skip to content

Commit db1cf42

Browse files
codebyteresergepetrenko
authored andcommitted
fix: windows UNICODE incompatibilities with ares_getaddrinfo (c-ares#328)
Fixes the following compatibility issues: * Use RegQueryValueExA instead of RegQueryValueEx * Use ExpandEnvironmentStringsA instead of ExpandEnvironmentStrings * Use RegOpenKeyExA instead of RegOpenKeyExA * Use GetWindowsDirectoryA instead of GetWindowsDirectoryA Fix By: Shelley Vohr (@codebytere) Closes: c-ares#327
1 parent db2973e commit db1cf42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ares_getaddrinfo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,18 @@ static int file_lookup(struct host_query *hquery)
456456
char tmp[MAX_PATH];
457457
HKEY hkeyHosts;
458458

459-
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
459+
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
460460
&hkeyHosts) == ERROR_SUCCESS)
461461
{
462462
DWORD dwLength = MAX_PATH;
463-
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
463+
RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
464464
&dwLength);
465-
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
465+
ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
466466
RegCloseKey(hkeyHosts);
467467
}
468468
}
469469
else if (platform == WIN_9X)
470-
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
470+
GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
471471
else
472472
return ARES_ENOTFOUND;
473473

0 commit comments

Comments
 (0)