From bd6a13ce6db683bcdb0d1ac754f6132c82239be8 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 25 May 2016 10:07:42 +0200 Subject: [PATCH] Backed out changeset 8b76fb7a3e31 (bug 1270686) for bustage on a CLOSED TREE --- mozglue/build/WindowsDllBlocklist.cpp | 39 ++----------------- mozglue/build/WindowsDllBlocklist.h | 12 ------ mozglue/build/moz.build | 1 - toolkit/crashreporter/nsExceptionHandler.cpp | 15 ------- .../test/unit/test_crashreporter_crash.js | 5 +-- 5 files changed, 4 insertions(+), 68 deletions(-) diff --git a/mozglue/build/WindowsDllBlocklist.cpp b/mozglue/build/WindowsDllBlocklist.cpp index fe66807211d3..89eaca40d363 100644 --- a/mozglue/build/WindowsDllBlocklist.cpp +++ b/mozglue/build/WindowsDllBlocklist.cpp @@ -17,13 +17,10 @@ #include #include #include -#define PSAPI_VERSION 1 -#include #pragma warning( push ) #pragma warning( disable : 4275 4530 ) // See msvc-stl-wrapper.template.h #include -#include #pragma warning( pop ) #include "nsAutoPtr.h" @@ -546,15 +543,11 @@ static wchar_t* lastslash(wchar_t* s, int len) return nullptr; } -#ifdef NIGHTLY_BUILD -static std::vector gDllLoadInfos; -static LoadCallBackFn gLoadInfoCallback; -#endif - static NTSTATUS NTAPI patched_LdrLoadDll (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle) { // We have UCS2 (UTF16?), we want ASCII, but we also just want the filename portion +#define DLLNAME_MAX 128 char dllName[DLLNAME_MAX+1]; wchar_t *dll_part; char *dot; @@ -742,40 +735,14 @@ continue_loading: return STATUS_DLL_NOT_FOUND; } } - NTSTATUS ret = stub_LdrLoadDll(filePath, flags, moduleFileName, handle); -#ifdef NIGHTLY_BUILD - if (!ret) { - MODULEINFO moduleInfo; - if (GetModuleInformation(GetCurrentProcess(), *(HMODULE*)handle, &moduleInfo, sizeof(moduleInfo))) { - DllLoadInfo info; - strcpy(info.name, dllName); - info.lpBaseOfDll = moduleInfo.lpBaseOfDll; - info.SizeOfImage = moduleInfo.SizeOfImage; - if (gLoadInfoCallback) { - gLoadInfoCallback(info); - } else { - gDllLoadInfos.push_back(info); - } - } - } -#endif - return ret; + + return stub_LdrLoadDll(filePath, flags, moduleFileName, handle); } WindowsDllInterceptor NtDllIntercept; } // namespace -#ifdef NIGHTLY_BUILD -MFBT_API void -RegisterDllLoadCallback(LoadCallBackFn aCallback) { - gLoadInfoCallback = aCallback; - for (DllLoadInfo &info : gDllLoadInfos) { - aCallback(info); - } -} -#endif - MFBT_API void DllBlocklist_Initialize() { diff --git a/mozglue/build/WindowsDllBlocklist.h b/mozglue/build/WindowsDllBlocklist.h index b1774848e4d2..691d77c99189 100644 --- a/mozglue/build/WindowsDllBlocklist.h +++ b/mozglue/build/WindowsDllBlocklist.h @@ -34,17 +34,5 @@ class MOZ_RAII AutoSetXPCOMLoadOnMainThread MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; -#define DLLNAME_MAX 128 -#ifdef NIGHTLY_BUILD -struct DllLoadInfo -{ - char name[DLLNAME_MAX+1]; - LPVOID lpBaseOfDll; - DWORD SizeOfImage; -}; -typedef void (*LoadCallBackFn)(DllLoadInfo&); -MFBT_API void RegisterDllLoadCallback(LoadCallBackFn); -#endif // NIGHTLY_BUILD - #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) #endif // mozilla_windowsdllblocklist_h diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build index 7a0cbbc505dd..1183320c57e0 100644 --- a/mozglue/build/moz.build +++ b/mozglue/build/moz.build @@ -52,7 +52,6 @@ if not CONFIG['JS_STANDALONE']: ] DISABLE_STL_WRAPPING = True OS_LIBS += [ - 'psapi', 'version', ] diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 8814444ab4f7..02d190058fd2 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -1437,17 +1437,6 @@ ChildFilter(void* context) return result; } -#ifdef NIGHTLY_BUILD -static void DllLoadCallback(DllLoadInfo& info) -{ - nsAutoCString note; - note.AppendPrintf("%s-%p-%x\n", info.name, info.lpBaseOfDll, info.SizeOfImage); - - CrashReporter::AppendAppNotesToCrashReport(note); -} -#endif - - nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force/*=false*/) { @@ -1685,10 +1674,6 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize); -#if defined(XP_WIN) && defined(NIGHTLY_BUILD) - RegisterDllLoadCallback(DllLoadCallback); -#endif - return NS_OK; } diff --git a/toolkit/crashreporter/test/unit/test_crashreporter_crash.js b/toolkit/crashreporter/test/unit/test_crashreporter_crash.js index 1af0651cf249..bfaaef90c2f8 100644 --- a/toolkit/crashreporter/test/unit/test_crashreporter_crash.js +++ b/toolkit/crashreporter/test/unit/test_crashreporter_crash.js @@ -45,10 +45,7 @@ function run_test() function(mdump, extra) { do_check_eq(extra.TestKey, "TestValue"); do_check_eq(extra["\u2665"], "\u{1F4A9}"); - // we spam the crash dumps with dlls loading so temporarily disable - // this check on windows - if (!is_windows) - do_check_eq(extra.Notes, "JunkMoreJunk"); + do_check_eq(extra.Notes, "JunkMoreJunk"); do_check_true(!("TelemetrySessionId" in extra)); }); }