diff --git a/toolkit/library/nsDllMain.cpp b/toolkit/library/nsDllMain.cpp index 5f677aeb33e3..5380854bcde4 100644 --- a/toolkit/library/nsDllMain.cpp +++ b/toolkit/library/nsDllMain.cpp @@ -40,10 +40,6 @@ #include #include "nsToolkit.h" -#ifdef MOZ_ENABLE_LIBXUL -#include "../xre/nsWindowsDllBlocklist.cpp" -#endif - #if defined(__GNUC__) // If DllMain gets name mangled, it won't be seen. extern "C" { @@ -60,9 +56,6 @@ BOOL APIENTRY DllMain( { switch( reason ) { case DLL_PROCESS_ATTACH: -#ifdef MOZ_ENABLE_LIBXUL - SetupDllBlocklist(); -#endif nsToolkit::Startup((HINSTANCE)hModule); break; diff --git a/toolkit/xre/nsWindowsDllBlocklist.cpp b/toolkit/xre/nsWindowsDllBlocklist.cpp index b37301d26ae6..07b76aea82dc 100644 --- a/toolkit/xre/nsWindowsDllBlocklist.cpp +++ b/toolkit/xre/nsWindowsDllBlocklist.cpp @@ -40,7 +40,6 @@ #include #include -#include #include "nsAutoPtr.h" @@ -58,31 +57,6 @@ // define this for very verbose dll load debug spew #undef DEBUG_very_verbose -// This class takes care of setting and restoring the current directory -// to make sure that the process current directory is not searched when -// loading DLLs. -class CurrentDirectoryGuard { -public: - CurrentDirectoryGuard() { - ::GetCurrentDirectoryW(MAX_PATH, mCwd); - - WCHAR appPath[MAX_PATH] = {L'\0'}; - ::GetModuleFileNameW(NULL, appPath, MAX_PATH); - LPWSTR lastBackslash = wcsrchr(appPath, L'\\'); - if (lastBackslash) { - *lastBackslash = L'\0'; - } - ::SetCurrentDirectoryW(appPath); - } - - ~CurrentDirectoryGuard() { - ::SetCurrentDirectoryW(mCwd); - } - -private: - WCHAR mCwd[MAX_PATH]; -}; - // The signature for LdrLoadDll changed at some point, with the second arg // becoming a PULONG instead of a ULONG. This should only matter on 64-bit // systems, for which there was no support earlier -- on 32-bit systems, @@ -235,14 +209,6 @@ continue_loading: NS_SetHasLoadedNewDLLs(); - // We need to make sure that the OS implementation of LdrLoadDll does not attempt - // to load any DLLs from the current working directory. That's almost never what - // we want, and it can cause us load unexpected DLLs. This guard protects against - // that by setting the current directory to the application's directory before - // LdrLoadDll is called, and restoring it to the original value when that call - // returns. - CurrentDirectoryGuard cwdGuard; - return stub_LdrLoadDll(filePath, flags, moduleFileName, handle); } diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp index b466f4f3b72b..7f81c22580df 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp @@ -8,8 +8,7 @@ #include "nsUTF8Utils.h" -#if defined(_MSC_VER) && defined(_M_IX86) && defined(XRE_WANT_DLL_BLOCKLIST) \ - !defined(MOZ_ENABLE_LIBXUL) +#if defined(_MSC_VER) && defined(_M_IX86) && defined(XRE_WANT_DLL_BLOCKLIST) #include "nsWindowsDllBlocklist.cpp" #else #undef XRE_WANT_DLL_BLOCKLIST