From a41001a3c6c750c1e11675d4fcaffebecde310ce Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Mon, 1 Jul 2013 19:12:06 -0400 Subject: [PATCH] Bug 859072. r=rstrong --- toolkit/mozapps/update/updater/Makefile.in | 2 +- toolkit/mozapps/update/updater/loaddlls.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/toolkit/mozapps/update/updater/Makefile.in b/toolkit/mozapps/update/updater/Makefile.in index 669c964bd996..4c0edc6a4307 100644 --- a/toolkit/mozapps/update/updater/Makefile.in +++ b/toolkit/mozapps/update/updater/Makefile.in @@ -72,7 +72,7 @@ DEFINES += -DNS_NO_XPCOM \ 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 diff --git a/toolkit/mozapps/update/updater/loaddlls.cpp b/toolkit/mozapps/update/updater/loaddlls.cpp index 8ff69d682958..a94152743444 100644 --- a/toolkit/mozapps/update/updater/loaddlls.cpp +++ b/toolkit/mozapps/update/updater/loaddlls.cpp @@ -16,10 +16,15 @@ struct AutoLoadSystemDependencies // 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