Fix some additional -DUNICODE issues on win32.

Brodie's patch didn't catch the ones that were new since 1.4.
This commit is contained in:
Nick Mathewson 2010-02-03 23:49:22 -05:00
parent 000a33ec83
commit a7a943106c
2 changed files with 9 additions and 9 deletions

14
evdns.c
View File

@ -3415,7 +3415,7 @@ evdns_get_default_hosts_filename(void)
char *path_out; char *path_out;
int len_out; int len_out;
if (! SHGetSpecialFolderPath(NULL, path, CSIDL_SYSTEM, 0)) if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0))
return NULL; return NULL;
len_out = strlen(path)+strlen(hostfile); len_out = strlen(path)+strlen(hostfile);
path_out = mm_malloc(len_out+1); path_out = mm_malloc(len_out+1);
@ -3530,7 +3530,7 @@ load_nameservers_with_getnetworkparams(struct evdns_base *base)
GetNetworkParams_fn_t fn; GetNetworkParams_fn_t fn;
ASSERT_LOCKED(base); ASSERT_LOCKED(base);
if (!(handle = LoadLibraryA("iphlpapi.dll"))) { if (!(handle = LoadLibraryA("iphlpapi.dll"))) {
log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll"); log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll");
status = -1; status = -1;
goto done; goto done;
@ -3603,13 +3603,13 @@ config_nameserver_from_reg_key(struct evdns_base *base, HKEY key, const char *su
int status = 0; int status = 0;
ASSERT_LOCKED(base); ASSERT_LOCKED(base);
if (RegQueryValueExA(key, subkey, 0, &type, NULL, &bufsz) if (RegQueryValueExA(key, subkey, 0, &type, NULL, &bufsz)
!= ERROR_MORE_DATA) != ERROR_MORE_DATA)
return -1; return -1;
if (!(buf = mm_malloc(bufsz))) if (!(buf = mm_malloc(bufsz)))
return -1; return -1;
if (RegQueryValueExA(key, subkey, 0, &type, (LPBYTE)buf, &bufsz) if (RegQueryValueExA(key, subkey, 0, &type, (LPBYTE)buf, &bufsz)
== ERROR_SUCCESS && bufsz > 1) { == ERROR_SUCCESS && bufsz > 1) {
status = evdns_nameserver_ip_add_line(base,buf); status = evdns_nameserver_ip_add_line(base,buf);
} }
@ -3641,12 +3641,12 @@ load_nameservers_from_registry(struct evdns_base *base)
if (((int)GetVersion()) > 0) { /* NT */ if (((int)GetVersion()) > 0) { /* NT */
HKEY nt_key = 0, interfaces_key = 0; HKEY nt_key = 0, interfaces_key = 0;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
KEY_READ, &nt_key) != ERROR_SUCCESS) { KEY_READ, &nt_key) != ERROR_SUCCESS) {
log(EVDNS_LOG_DEBUG,"Couldn't open nt key, %d",(int)GetLastError()); log(EVDNS_LOG_DEBUG,"Couldn't open nt key, %d",(int)GetLastError());
return -1; return -1;
} }
r = RegOpenKeyExA(nt_key, "Interfaces", 0, r = RegOpenKeyExA(nt_key, "Interfaces", 0,
KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS, KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,
&interfaces_key); &interfaces_key);
if (r != ERROR_SUCCESS) { if (r != ERROR_SUCCESS) {
@ -3661,7 +3661,7 @@ load_nameservers_from_registry(struct evdns_base *base)
RegCloseKey(nt_key); RegCloseKey(nt_key);
} else { } else {
HKEY win_key = 0; HKEY win_key = 0;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X_KEY, 0, if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X_KEY, 0,
KEY_READ, &win_key) != ERROR_SUCCESS) { KEY_READ, &win_key) != ERROR_SUCCESS) {
log(EVDNS_LOG_DEBUG, "Couldn't open registry key, %d", (int)GetLastError()); log(EVDNS_LOG_DEBUG, "Couldn't open registry key, %d", (int)GetLastError());
return -1; return -1;

View File

@ -107,7 +107,7 @@ _testcase_run_forked(const struct testgroup_t *group,
*/ */
int ok; int ok;
char buffer[LONGEST_TEST_NAME+256]; char buffer[LONGEST_TEST_NAME+256];
STARTUPINFO si; STARTUPINFOA si;
PROCESS_INFORMATION info; PROCESS_INFORMATION info;
DWORD exitcode; DWORD exitcode;
@ -126,7 +126,7 @@ _testcase_run_forked(const struct testgroup_t *group,
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
si.cb = sizeof(si); si.cb = sizeof(si);
ok = CreateProcess(commandname, buffer, NULL, NULL, 0, ok = CreateProcessA(commandname, buffer, NULL, NULL, 0,
0, NULL, NULL, &si, &info); 0, NULL, NULL, &si, &info);
if (!ok) { if (!ok) {
printf("CreateProcess failed!\n"); printf("CreateProcess failed!\n");