зеркало из https://github.com/mozilla/gecko-dev.git
Backed out bug 286382 to fix bug 584613
This commit is contained in:
Родитель
dc23c8f9f4
Коммит
826e429c31
|
@ -40,10 +40,6 @@
|
|||
#include <windows.h>
|
||||
#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;
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <winternl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче