From: Nick Mathewson Date: Fri, 24 Sep 2010 18:16:55 +0000 (-0400) Subject: Consistency issues in load_windows_system_library patch. Thanks Sebastian X-Git-Tag: tor-0.2.2.17-alpha~29^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d073d7d4ebd461a1550595d0180f0367b67bcc16;p=thirdparty%2Ftor.git Consistency issues in load_windows_system_library patch. Thanks Sebastian --- diff --git a/src/common/util.c b/src/common/util.c index 12be008745..caedc5e2d9 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2800,7 +2800,7 @@ load_windows_system_library(const TCHAR *library_name) { TCHAR path[MAX_PATH]; unsigned n; - n = GetSystemDirectory(path, 1024); + n = GetSystemDirectory(path, MAX_PATH); if (n == 0 || n + _tcslen(library_name) + 2 >= MAX_PATH) return 0; _tcscat(path, TEXT("\\")); diff --git a/src/or/eventdns.c b/src/or/eventdns.c index c6fcbd9484..b929303fd5 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -3131,7 +3131,6 @@ load_nameservers_with_getnetworkparams(void) IP_ADDR_STRING *ns; GetNetworkParams_fn_t fn; - /* XXXX Possibly, we should hardcode the location of this DLL. */ if (!(handle = load_windows_system_library(TEXT("iphlpapi.dll")))) { log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll"); /* right now status = 0, doesn't that mean "good" - mikec */ diff --git a/src/or/ntmain.c b/src/or/ntmain.c index e5855aad8e..46e7afb78b 100644 --- a/src/or/ntmain.c +++ b/src/or/ntmain.c @@ -138,7 +138,6 @@ nt_service_loadlibrary(void) if (service_fns.loaded) return; - /* XXXX Possibly, we should hardcode the location of this DLL. */ if (!(library = load_windows_system_library(TEXT("advapi32.dll")))) { log_err(LD_GENERAL, "Couldn't open advapi32.dll. Are you trying to use " "NT services on Windows 98? That doesn't work.");