Bug 859072. r=rstrong
authorBrian R. Bondy <netzen@gmail.com>
Mon, 01 Jul 2013 19:12:06 -0400
changeset 137227 969ad7ca404c235ae57f0c608c58adf4079d7716
parent 137226 b6bca6113b5d836042c477a75c6a2c0dcfb98aaf
child 137228 bc1a5c66674bf4e41a14ae2ea9477a52f7222650
push id1824
push userryanvm@gmail.com
push dateWed, 03 Jul 2013 18:16:56 +0000
treeherderfx-team@dcbbfcdf7bb4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs859072
milestone25.0a1
Bug 859072. r=rstrong
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/loaddlls.cpp
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -67,17 +67,17 @@ include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DNS_NO_XPCOM \
   -DMAR_CHANNEL_ID='"$(MAR_CHANNEL_ID)"' \
   -DMOZ_APP_VERSION='"$(MOZ_APP_VERSION)"' \
   $(NULL)
 
 ifdef _MSC_VER
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
-WIN32_EXE_LDFLAGS += -DELAYLOAD:wsock32.dll -DELAYLOAD:crypt32.dll
+WIN32_EXE_LDFLAGS += -DELAYLOAD:wsock32.dll -DELAYLOAD:crypt32.dll -DELAYLOAD:userenv.dll
 endif
 
 ifdef MOZ_WIDGET_GTK
 libs:: updater.png
 	$(NSINSTALL) -D $(DIST)/bin/icons
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons
 endif
 
--- a/toolkit/mozapps/update/updater/loaddlls.cpp
+++ b/toolkit/mozapps/update/updater/loaddlls.cpp
@@ -11,20 +11,25 @@
 struct AutoLoadSystemDependencies
 {
   AutoLoadSystemDependencies()
   {
     // Remove the current directory from the search path for dynamically loaded
     // DLLs as a precaution.  This call has no effect for delay load DLLs.
     SetDllDirectory(L"");
 
-    static LPCWSTR delayDLLs[] = { L"wsock32.dll", L"crypt32.dll",
-                                   L"cryptsp.dll", L"cryptbase.dll",
-                                   L"msasn1.dll", L"userenv.dll",
-                                   L"secur32.dll" };
+    // The order that these are loaded matter, for example if we load something
+    // that tries to load profapi.dll first, then profapi.dll would be loaded
+    // wrongly from the current directory.
+    static LPCWSTR delayDLLs[] = { L"profapi.dll", L"wsock32.dll",
+                                   L"crypt32.dll", L"cryptsp.dll",
+                                   L"cryptbase.dll", L"msasn1.dll",
+                                   L"userenv.dll", L"secur32.dll",
+                                   L"ws2_32.dll", L"ws2help.dll",
+                                   L"apphelp.dll", L"bcryptprimitives.dll" };
 
     WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
     // If GetSystemDirectory fails we accept that we'll load the DLLs from the
     // normal search path.
     GetSystemDirectory(systemDirectory, MAX_PATH + 1);
     size_t systemDirLen = wcslen(systemDirectory);
 
     // Make the system directory path terminate with a slash