diff --git a/toolkit/xre/nsWindowsDllBlocklist.cpp b/toolkit/xre/nsWindowsDllBlocklist.cpp index 4ae7e66beb02..a9d64b1bf741 100644 --- a/toolkit/xre/nsWindowsDllBlocklist.cpp +++ b/toolkit/xre/nsWindowsDllBlocklist.cpp @@ -436,8 +436,6 @@ continue_loading: printf_stderr("LdrLoadDll: continuing load... ('%S')\n", moduleFileName->Buffer); #endif - NS_SetHasLoadedNewDLLs(); - if (gInXPCOMLoadOnMainThread && NS_IsMainThread()) { // Check to ensure that the DLL has ASLR. full_fname = getFullPath(filePath, fname); diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index fe44bb468f29..147012c37736 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -15,10 +15,6 @@ #include "mozilla/widget/AudioSession.h" #include "mozilla/HangMonitor.h" -// For skidmark code -#include -#include - const PRUnichar* kAppShellEventId = L"nsAppShell:EventID"; const PRUnichar* kTaskbarButtonEventId = L"TaskbarButtonCreated"; @@ -147,84 +143,10 @@ nsAppShell::Init() return nsBaseAppShell::Init(); } -/** - * This is some temporary code to keep track of where in memory dlls are - * loaded. This is useful in case someone calls into a dll that has been - * unloaded. This code lets us see which dll used to be loaded at the given - * called address. - */ -#if defined(_MSC_VER) && defined(_M_IX86) - -#define LOADEDMODULEINFO_STRSIZE 23 -#define NUM_LOADEDMODULEINFO 250 - -struct LoadedModuleInfo { - void* mStartAddr; - void* mEndAddr; - char mName[LOADEDMODULEINFO_STRSIZE + 1]; -}; - -static LoadedModuleInfo* sLoadedModules = 0; - -static void -CollectNewLoadedModules() -{ - HANDLE hModuleSnap = INVALID_HANDLE_VALUE; - MODULEENTRY32W module; - - // Take a snapshot of all modules in our process. - hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0); - if (hModuleSnap == INVALID_HANDLE_VALUE) - return; - - // Set the size of the structure before using it. - module.dwSize = sizeof(MODULEENTRY32W); - - // Now walk the module list of the process, - // and display information about each module - bool done = !Module32FirstW(hModuleSnap, &module); - while (!done) { - NS_LossyConvertUTF16toASCII moduleName(module.szModule); - bool found = false; - uint32_t i; - for (i = 0; i < NUM_LOADEDMODULEINFO && - sLoadedModules[i].mStartAddr; ++i) { - if (sLoadedModules[i].mStartAddr == module.modBaseAddr && - !strcmp(moduleName.get(), - sLoadedModules[i].mName)) { - found = true; - break; - } - } - - if (!found && i < NUM_LOADEDMODULEINFO) { - sLoadedModules[i].mStartAddr = module.modBaseAddr; - sLoadedModules[i].mEndAddr = module.modBaseAddr + module.modBaseSize; - strncpy(sLoadedModules[i].mName, moduleName.get(), - LOADEDMODULEINFO_STRSIZE); - sLoadedModules[i].mName[LOADEDMODULEINFO_STRSIZE] = 0; - } - - done = !Module32NextW(hModuleSnap, &module); - } - - uint32_t i; - for (i = 0; i < NUM_LOADEDMODULEINFO && - sLoadedModules[i].mStartAddr; ++i) {} - - CloseHandle(hModuleSnap); -} -#endif // defined(_MSC_VER) && defined(_M_IX86) NS_IMETHODIMP nsAppShell::Run(void) { -#if defined(_MSC_VER) && defined(_M_IX86) - LoadedModuleInfo modules[NUM_LOADEDMODULEINFO]; - memset(modules, 0, sizeof(modules)); - sLoadedModules = modules; -#endif - // Ignore failure; failing to start the application is not exactly an // appropriate response to failing to start an audio session. mozilla::widget::StartAudioSession(); @@ -233,11 +155,6 @@ nsAppShell::Run(void) mozilla::widget::StopAudioSession(); -#if defined(_MSC_VER) && defined(_M_IX86) - // Don't forget to null this out! - sLoadedModules = nullptr; -#endif - return rv; } @@ -295,13 +212,6 @@ nsAppShell::ScheduleNativeEventCallback() bool nsAppShell::ProcessNextNativeEvent(bool mayWait) { -#if defined(_MSC_VER) && defined(_M_IX86) - if (sXPCOMHasLoadedNewDLLs && sLoadedModules) { - sXPCOMHasLoadedNewDLLs = false; - CollectNewLoadedModules(); - } -#endif - // Notify ipc we are spinning a (possibly nested) gecko event loop. mozilla::ipc::RPCChannel::NotifyGeckoEventDispatch(); diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 0a49726f5fbd..ad01d719aa9e 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -592,12 +592,3 @@ NS_ErrorAccordingToNSPR() //////////////////////////////////////////////////////////////////////////////// -#ifdef XP_WIN -bool sXPCOMHasLoadedNewDLLs = false; - -NS_EXPORT void -NS_SetHasLoadedNewDLLs() -{ - sXPCOMHasLoadedNewDLLs = true; -} -#endif diff --git a/xpcom/base/nsError.h b/xpcom/base/nsError.h index 20e5bb72b837..a99c43bdd487 100644 --- a/xpcom/base/nsError.h +++ b/xpcom/base/nsError.h @@ -223,9 +223,4 @@ inline bool NS_ERROR_GET_SEVERITY(nsresult err) { #pragma warning(disable: 4275) /* non dll-interface class 'nsISupports' used as base for dll-interface class 'nsIRDFNode' */ #endif -#if defined(XP_WIN) && defined(__cplusplus) -extern bool sXPCOMHasLoadedNewDLLs; -NS_EXPORT void NS_SetHasLoadedNewDLLs(); -#endif - #endif