[or-cvs] [tor/maint-0.2.2 2/3] Use load_windows_system_library in place of LoadLibrary

nickm at torproject.org nickm at torproject.org
Mon Sep 27 19:37:52 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Tue, 21 Sep 2010 13:45:36 -0400
Subject: Use load_windows_system_library in place of LoadLibrary
Commit: aa7f55c45f942f45692c4a99e6fe1d5784609509

---
 changes/bug1954_loadlib |    4 ++++
 src/or/eventdns.c       |    2 +-
 src/or/ntmain.c         |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)
 create mode 100644 changes/bug1954_loadlib

diff --git a/changes/bug1954_loadlib b/changes/bug1954_loadlib
new file mode 100644
index 0000000..901d9ba
--- /dev/null
+++ b/changes/bug1954_loadlib
@@ -0,0 +1,4 @@
+  o Major bugfixes
+    - Always search the windows system directory for system DLLs, and
+      nowhere else.  Fixes bug 1954.
+
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 8ebfb79..c6fcbd9 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -3132,7 +3132,7 @@ load_nameservers_with_getnetworkparams(void)
 	GetNetworkParams_fn_t fn;
 
 	/* XXXX Possibly, we should hardcode the location of this DLL. */
-	if (!(handle = LoadLibrary(TEXT("iphlpapi.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 */
 		status = -1;
diff --git a/src/or/ntmain.c b/src/or/ntmain.c
index 0b611f0..e5855aa 100644
--- a/src/or/ntmain.c
+++ b/src/or/ntmain.c
@@ -139,7 +139,7 @@ nt_service_loadlibrary(void)
     return;
 
   /* XXXX Possibly, we should hardcode the location of this DLL. */
-  if (!(library = LoadLibrary(TEXT("advapi32.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.");
     goto err;
-- 
1.7.1




More information about the tor-commits mailing list