# HG changeset patch # User Richard Marti # Date 1528469718 -7200 # Node ID df1d8c4c590c33e83d6232e1b3396a6f05bf0a94 # Parent 14c51cd8a79ab9407f8cd9d58b2c68c323693db6 Bug 1467706 - Port bug 1445025: DLL Blocklist needs to be safe enough to run before kernel32 is loaded. r=jorgk diff --git a/mail/app/nsMailApp.cpp b/mail/app/nsMailApp.cpp --- a/mail/app/nsMailApp.cpp +++ b/mail/app/nsMailApp.cpp @@ -245,16 +245,21 @@ InitXPCOMGlue() } // This will set this thread as the main thread. gBootstrap->NS_LogInit(); return NS_OK; } +#ifdef HAS_DLL_BLOCKLIST +// NB: This must be extern, as this value is checked elsewhere +uint32_t gBlocklistInitFlags = eDllBlocklistInitFlagDefault; +#endif + int main(int argc, char* argv[], char* envp[]) { mozilla::TimeStamp start = mozilla::TimeStamp::Now(); #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC // We are launching as a content process, delegate to the appropriate // main if (argc > 1 && IsArg(argv[1], "contentproc")) { @@ -280,17 +285,17 @@ int main(int argc, char* argv[], char* e // InitXPCOMGlue calls NS_LogInit, so we need to balance it here. gBootstrap->NS_LogTerm(); return result; } #endif #ifdef HAS_DLL_BLOCKLIST - DllBlocklist_Initialize(); + DllBlocklist_Initialize(gBlocklistInitFlags); #endif nsresult rv = InitXPCOMGlue(); if (NS_FAILED(rv)) { return 255; } diff --git a/suite/app/nsSuiteApp.cpp b/suite/app/nsSuiteApp.cpp --- a/suite/app/nsSuiteApp.cpp +++ b/suite/app/nsSuiteApp.cpp @@ -245,16 +245,21 @@ InitXPCOMGlue() } // This will set this thread as the main thread. gBootstrap->NS_LogInit(); return NS_OK; } +#ifdef HAS_DLL_BLOCKLIST +// NB: This must be extern, as this value is checked elsewhere +uint32_t gBlocklistInitFlags = eDllBlocklistInitFlagDefault; +#endif + int main(int argc, char* argv[], char* envp[]) { mozilla::TimeStamp start = mozilla::TimeStamp::Now(); #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC // We are launching as a content process, delegate to the appropriate // main if (argc > 1 && IsArg(argv[1], "contentproc")) { @@ -280,17 +285,17 @@ int main(int argc, char* argv[], char* e // InitXPCOMGlue calls NS_LogInit, so we need to balance it here. gBootstrap->NS_LogTerm(); return result; } #endif #ifdef HAS_DLL_BLOCKLIST - DllBlocklist_Initialize(); + DllBlocklist_Initialize(gBlocklistInitFlags); #endif nsresult rv = InitXPCOMGlue(); if (NS_FAILED(rv)) { return 255; }