diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp')
-rw-r--r-- | toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp index 29745d5af6..4f97ccc39f 100644 --- a/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp +++ b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp @@ -15,7 +15,6 @@ #include "BaseProfiler.h" #include "nsWindowsDllInterceptor.h" #include "mozilla/CmdLineAndEnvUtils.h" -#include "mozilla/DebugOnly.h" #include "mozilla/StackWalk_windows.h" #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" @@ -44,9 +43,6 @@ glue::detail::DllServicesBase* gDllServices; using namespace mozilla; -using CrashReporter::Annotation; -using CrashReporter::AnnotationWriter; - #define DLL_BLOCKLIST_ENTRY(name, ...) {name, __VA_ARGS__}, #define DLL_BLOCKLIST_STRING_TYPE const char* #include "mozilla/WindowsDllBlocklistLegacyDefs.h" @@ -54,10 +50,13 @@ using CrashReporter::AnnotationWriter; // define this for very verbose dll load debug spew #undef DEBUG_very_verbose +using WritableBuffer = mozilla::glue::detail::WritableBuffer<1024>; + static uint32_t sInitFlags; static bool sBlocklistInitAttempted; static bool sBlocklistInitFailed; static bool sUser32BeforeBlocklist; +static WritableBuffer sBlocklistWriter; typedef MOZ_NORETURN_PTR void(__fastcall* BaseThreadInitThunk_func)( BOOL aIsInitialThread, void* aStartAddress, void* aThreadParam); @@ -174,8 +173,6 @@ class ReentrancySentinel { std::map<DWORD, const char*>* ReentrancySentinel::sThreadMap; -using WritableBuffer = mozilla::glue::detail::WritableBuffer<1024>; - /** * This is a linked list of DLLs that have been blocked. It doesn't use * mozilla::LinkedList because this is an append-only list and doesn't need @@ -673,22 +670,11 @@ MFBT_API void DllBlocklist_Initialize(uint32_t aInitFlags) { MFBT_API void DllBlocklist_Shutdown() {} #endif // DEBUG -static void InternalWriteNotes(AnnotationWriter& aWriter) { - WritableBuffer buffer; - DllBlockSet::Write(buffer); - - aWriter.Write(Annotation::BlockedDllList, buffer.Data(), buffer.Length()); - - if (sBlocklistInitFailed) { - aWriter.Write(Annotation::BlocklistInitFailed, "1"); - } - - if (sUser32BeforeBlocklist) { - aWriter.Write(Annotation::User32BeforeBlocklist, "1"); - } +static void InternalWriteNotes(WritableBuffer& aBuffer) { + DllBlockSet::Write(aBuffer); } -using WriterFn = void (*)(AnnotationWriter&); +using WriterFn = void (*)(WritableBuffer& aBuffer); static WriterFn gWriterFn = &InternalWriteNotes; static void GetNativeNtBlockSetWriter() { @@ -699,16 +685,25 @@ static void GetNativeNtBlockSetWriter() { } } -MFBT_API void DllBlocklist_WriteNotes(AnnotationWriter& aWriter) { - MOZ_ASSERT(gWriterFn); - gWriterFn(aWriter); -} +MFBT_API void DllBlocklist_WriteNotes() { gWriterFn(sBlocklistWriter); } MFBT_API bool DllBlocklist_CheckStatus() { if (sBlocklistInitFailed || sUser32BeforeBlocklist) return false; return true; } +MFBT_API bool* DllBlocklist_GetBlocklistInitFailedPointer() { + return &sBlocklistInitFailed; +} + +MFBT_API bool* DllBlocklist_GetUser32BeforeBlocklistPointer() { + return &sUser32BeforeBlocklist; +} + +MFBT_API const char* DllBlocklist_GetBlocklistWriterData() { + return sBlocklistWriter.Data(); +} + // ============================================================================ // This section is for DLL Services // ============================================================================ |