diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build index 6b0841884019..4d1e1d0e45eb 100644 --- a/mozglue/build/moz.build +++ b/mozglue/build/moz.build @@ -39,9 +39,10 @@ if CONFIG["OS_TARGET"] == "WINNT": if CONFIG["MOZ_MEMORY"]: DEFFILE = "mozglue.def" # We'll break the DLL blocklist if we immediately load user32.dll. - # For the same reason, we delayload winmm.dll and ole32.dll which - # statically link user32.dll. + # For the same reason, we delayload these other DLLs to avoid eager + # dependencies on user32.dll. DELAYLOAD_DLLS += [ + "oleaut32.dll", "ole32.dll", "user32.dll", "winmm.dll", diff --git a/mozglue/misc/moz.build b/mozglue/misc/moz.build index 76ccc6f8023d..070e1f6f97ab 100644 --- a/mozglue/misc/moz.build +++ b/mozglue/misc/moz.build @@ -50,12 +50,6 @@ SOURCES += [ OS_LIBS += CONFIG["REALTIME_LIBS"] if CONFIG["OS_ARCH"] == "WINNT": - DIRS += [ - "interceptor", - ] - EXPORTS += [ - "nsWindowsDllInterceptor.h", - ] EXPORTS.mozilla += [ "DynamicallyLinkedFunctionPtr.h", "ImportDir.h", diff --git a/mozglue/moz.build b/mozglue/moz.build index d3813122c95b..75e14589ca57 100644 --- a/mozglue/moz.build +++ b/mozglue/moz.build @@ -13,9 +13,6 @@ if CONFIG["MOZ_LINKER"] or CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": DIRS += ["android"] -if CONFIG["OS_TARGET"] == "WINNT": - DIRS += ["dllservices"] - DIRS += [ "baseprofiler", "build", diff --git a/mozglue/tests/gtest/moz.build b/mozglue/tests/gtest/moz.build index 7d0a63bec1d7..7026a53c1f0b 100644 --- a/mozglue/tests/gtest/moz.build +++ b/mozglue/tests/gtest/moz.build @@ -4,17 +4,9 @@ if CONFIG["OS_ARCH"] == "WINNT": SOURCES += [ - "TestDLLBlocklist.cpp", "TestNativeNtGTest.cpp", ] - TEST_DIRS += [ - "TestDllBlocklist_AllowByVersion", - "TestDllBlocklist_MatchByName", - "TestDllBlocklist_MatchByVersion", - "TestDllBlocklist_NoOpEntryPoint", - ] - SOURCES += [ "TestStackWalk.cpp", ] diff --git a/mozglue/tests/moz.build b/mozglue/tests/moz.build index aa88eb5c8e93..15aa2581f271 100644 --- a/mozglue/tests/moz.build +++ b/mozglue/tests/moz.build @@ -36,9 +36,6 @@ if CONFIG["OS_ARCH"] == "WINNT": ], linkage=None, ) - TEST_DIRS += [ - "interceptor", - ] OS_LIBS += [ "ntdll", "version", diff --git a/toolkit/xre/ModuleEvaluator.cpp b/toolkit/xre/dllservices/ModuleEvaluator.cpp similarity index 100% rename from toolkit/xre/ModuleEvaluator.cpp rename to toolkit/xre/dllservices/ModuleEvaluator.cpp index ccc4fba6863c..58814e34a55e 100644 --- a/toolkit/xre/ModuleEvaluator.cpp +++ b/toolkit/xre/dllservices/ModuleEvaluator.cpp @@ -22,6 +22,8 @@ #include "nsWindowsHelpers.h" #include "nsXULAppAPI.h" +namespace mozilla { + // Fills a Vector with keyboard layout DLLs found in the registry. // These are leaf names only, not full paths. Here we will convert them to // lowercase before returning, to facilitate case-insensitive searches. @@ -61,8 +63,6 @@ static Vector GetKeyboardLayoutDlls() { return result; } -namespace mozilla { - /* static */ bool ModuleEvaluator::ResolveKnownFolder(REFKNOWNFOLDERID aFolderId, nsIFile** aOutFile) { diff --git a/toolkit/xre/ModuleEvaluator.h b/toolkit/xre/dllservices/ModuleEvaluator.h similarity index 98% rename from toolkit/xre/ModuleEvaluator.h rename to toolkit/xre/dllservices/ModuleEvaluator.h index e1f623cb9e33..565b5d4da4ae 100644 --- a/toolkit/xre/ModuleEvaluator.h +++ b/toolkit/xre/dllservices/ModuleEvaluator.h @@ -16,6 +16,8 @@ #include "nsIFile.h" #include "nsString.h" +#include + namespace mozilla { class ModuleRecord; diff --git a/toolkit/xre/ModuleVersionInfo.cpp b/toolkit/xre/dllservices/ModuleVersionInfo.cpp similarity index 100% rename from toolkit/xre/ModuleVersionInfo.cpp rename to toolkit/xre/dllservices/ModuleVersionInfo.cpp diff --git a/toolkit/xre/ModuleVersionInfo.h b/toolkit/xre/dllservices/ModuleVersionInfo.h similarity index 100% rename from toolkit/xre/ModuleVersionInfo.h rename to toolkit/xre/dllservices/ModuleVersionInfo.h diff --git a/toolkit/xre/UntrustedModulesData.cpp b/toolkit/xre/dllservices/UntrustedModulesData.cpp similarity index 100% rename from toolkit/xre/UntrustedModulesData.cpp rename to toolkit/xre/dllservices/UntrustedModulesData.cpp index d2f62a607a01..314e36ad89f7 100644 --- a/toolkit/xre/UntrustedModulesData.cpp +++ b/toolkit/xre/dllservices/UntrustedModulesData.cpp @@ -62,6 +62,8 @@ static LONGLONG TimeUnitsToQPC(const LONGLONG aTimeStamp, return result; } +namespace mozilla { + static Maybe QPCLoadDurationToMilliseconds( const ModuleLoadInfo& aNtInfo) { if (aNtInfo.IsBare()) { @@ -71,8 +73,6 @@ static Maybe QPCLoadDurationToMilliseconds( return Some(QPCToMilliseconds(aNtInfo.mLoadTimeInfo.QuadPart)); } -namespace mozilla { - ModuleRecord::ModuleRecord() : mTrustFlags(ModuleTrustFlags::None) {} ModuleRecord::ModuleRecord(const nsAString& aResolvedNtPath) diff --git a/toolkit/xre/UntrustedModulesData.h b/toolkit/xre/dllservices/UntrustedModulesData.h similarity index 100% rename from toolkit/xre/UntrustedModulesData.h rename to toolkit/xre/dllservices/UntrustedModulesData.h diff --git a/toolkit/xre/UntrustedModulesProcessor.cpp b/toolkit/xre/dllservices/UntrustedModulesProcessor.cpp similarity index 99% rename from toolkit/xre/UntrustedModulesProcessor.cpp rename to toolkit/xre/dllservices/UntrustedModulesProcessor.cpp index 3e02134f931f..084aa6680f2b 100644 --- a/toolkit/xre/UntrustedModulesProcessor.cpp +++ b/toolkit/xre/dllservices/UntrustedModulesProcessor.cpp @@ -688,12 +688,12 @@ UntrustedModulesProcessor::SendGetModulesTrust(ModulePaths&& aModules, switch (XRE_GetProcessType()) { case GeckoProcessType_Content: { - return ::SendGetModulesTrust(dom::ContentChild::GetSingleton(), - std::move(aModules), runNormal); + return ::mozilla::SendGetModulesTrust(dom::ContentChild::GetSingleton(), + std::move(aModules), runNormal); } case GeckoProcessType_RDD: { - return ::SendGetModulesTrust(RDDParent::GetSingleton(), - std::move(aModules), runNormal); + return ::mozilla::SendGetModulesTrust(RDDParent::GetSingleton(), + std::move(aModules), runNormal); } default: { MOZ_ASSERT_UNREACHABLE("Unsupported process type"); diff --git a/toolkit/xre/UntrustedModulesProcessor.h b/toolkit/xre/dllservices/UntrustedModulesProcessor.h similarity index 100% rename from toolkit/xre/UntrustedModulesProcessor.h rename to toolkit/xre/dllservices/UntrustedModulesProcessor.h diff --git a/toolkit/xre/WinDllServices.cpp b/toolkit/xre/dllservices/WinDllServices.cpp similarity index 100% rename from toolkit/xre/WinDllServices.cpp rename to toolkit/xre/dllservices/WinDllServices.cpp diff --git a/toolkit/xre/WinDllServices.h b/toolkit/xre/dllservices/WinDllServices.h similarity index 100% rename from toolkit/xre/WinDllServices.h rename to toolkit/xre/dllservices/WinDllServices.h diff --git a/toolkit/xre/dllservices/moz.build b/toolkit/xre/dllservices/moz.build new file mode 100644 index 000000000000..1e666f05f233 --- /dev/null +++ b/toolkit/xre/dllservices/moz.build @@ -0,0 +1,35 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +with Files("**"): + BUG_COMPONENT = ("Core", "DLL Services") + +FINAL_LIBRARY = "xul" + +EXPORTS.mozilla += [ + "ModuleVersionInfo.h", + "UntrustedModulesData.h", + "UntrustedModulesProcessor.h", + "WinDllServices.h", +] + +DIRS += [ + "mozglue", +] + +UNIFIED_SOURCES += [ + "ModuleEvaluator.cpp", + "ModuleVersionInfo.cpp", + "UntrustedModulesData.cpp", + "UntrustedModulesProcessor.cpp", + "WinDllServices.cpp", +] + +TEST_DIRS += [ + "tests", +] + +include("/ipc/chromium/chromium-config.mozbuild") diff --git a/mozglue/dllservices/Authenticode.cpp b/toolkit/xre/dllservices/mozglue/Authenticode.cpp similarity index 100% rename from mozglue/dllservices/Authenticode.cpp rename to toolkit/xre/dllservices/mozglue/Authenticode.cpp diff --git a/mozglue/dllservices/Authenticode.h b/toolkit/xre/dllservices/mozglue/Authenticode.h similarity index 100% rename from mozglue/dllservices/Authenticode.h rename to toolkit/xre/dllservices/mozglue/Authenticode.h diff --git a/mozglue/dllservices/CacheNtDllThunk.cpp b/toolkit/xre/dllservices/mozglue/CacheNtDllThunk.cpp similarity index 100% rename from mozglue/dllservices/CacheNtDllThunk.cpp rename to toolkit/xre/dllservices/mozglue/CacheNtDllThunk.cpp diff --git a/mozglue/dllservices/CacheNtDllThunk.h b/toolkit/xre/dllservices/mozglue/CacheNtDllThunk.h similarity index 100% rename from mozglue/dllservices/CacheNtDllThunk.h rename to toolkit/xre/dllservices/mozglue/CacheNtDllThunk.h diff --git a/mozglue/dllservices/LoaderAPIInterfaces.h b/toolkit/xre/dllservices/mozglue/LoaderAPIInterfaces.h similarity index 100% rename from mozglue/dllservices/LoaderAPIInterfaces.h rename to toolkit/xre/dllservices/mozglue/LoaderAPIInterfaces.h diff --git a/mozglue/dllservices/LoaderObserver.cpp b/toolkit/xre/dllservices/mozglue/LoaderObserver.cpp similarity index 100% rename from mozglue/dllservices/LoaderObserver.cpp rename to toolkit/xre/dllservices/mozglue/LoaderObserver.cpp diff --git a/mozglue/dllservices/LoaderObserver.h b/toolkit/xre/dllservices/mozglue/LoaderObserver.h similarity index 100% rename from mozglue/dllservices/LoaderObserver.h rename to toolkit/xre/dllservices/mozglue/LoaderObserver.h diff --git a/mozglue/dllservices/ModuleLoadFrame.cpp b/toolkit/xre/dllservices/mozglue/ModuleLoadFrame.cpp similarity index 100% rename from mozglue/dllservices/ModuleLoadFrame.cpp rename to toolkit/xre/dllservices/mozglue/ModuleLoadFrame.cpp diff --git a/mozglue/dllservices/ModuleLoadFrame.h b/toolkit/xre/dllservices/mozglue/ModuleLoadFrame.h similarity index 100% rename from mozglue/dllservices/ModuleLoadFrame.h rename to toolkit/xre/dllservices/mozglue/ModuleLoadFrame.h diff --git a/mozglue/dllservices/ModuleLoadInfo.h b/toolkit/xre/dllservices/mozglue/ModuleLoadInfo.h similarity index 100% rename from mozglue/dllservices/ModuleLoadInfo.h rename to toolkit/xre/dllservices/mozglue/ModuleLoadInfo.h diff --git a/mozglue/dllservices/NtLoaderAPI.h b/toolkit/xre/dllservices/mozglue/NtLoaderAPI.h similarity index 100% rename from mozglue/dllservices/NtLoaderAPI.h rename to toolkit/xre/dllservices/mozglue/NtLoaderAPI.h diff --git a/mozglue/dllservices/WindowsDllBlocklist.cpp b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp similarity index 100% rename from mozglue/dllservices/WindowsDllBlocklist.cpp rename to toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.cpp diff --git a/mozglue/dllservices/WindowsDllBlocklist.h b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.h similarity index 100% rename from mozglue/dllservices/WindowsDllBlocklist.h rename to toolkit/xre/dllservices/mozglue/WindowsDllBlocklist.h diff --git a/mozglue/dllservices/WindowsDllBlocklistCommon.h b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklistCommon.h similarity index 100% rename from mozglue/dllservices/WindowsDllBlocklistCommon.h rename to toolkit/xre/dllservices/mozglue/WindowsDllBlocklistCommon.h diff --git a/mozglue/dllservices/WindowsDllBlocklistDefs.in b/toolkit/xre/dllservices/mozglue/WindowsDllBlocklistDefs.in similarity index 100% rename from mozglue/dllservices/WindowsDllBlocklistDefs.in rename to toolkit/xre/dllservices/mozglue/WindowsDllBlocklistDefs.in diff --git a/mozglue/dllservices/WindowsDllServices.h b/toolkit/xre/dllservices/mozglue/WindowsDllServices.h similarity index 100% rename from mozglue/dllservices/WindowsDllServices.h rename to toolkit/xre/dllservices/mozglue/WindowsDllServices.h diff --git a/mozglue/dllservices/WindowsFallbackLoaderAPI.cpp b/toolkit/xre/dllservices/mozglue/WindowsFallbackLoaderAPI.cpp similarity index 100% rename from mozglue/dllservices/WindowsFallbackLoaderAPI.cpp rename to toolkit/xre/dllservices/mozglue/WindowsFallbackLoaderAPI.cpp diff --git a/mozglue/dllservices/WindowsFallbackLoaderAPI.h b/toolkit/xre/dllservices/mozglue/WindowsFallbackLoaderAPI.h similarity index 100% rename from mozglue/dllservices/WindowsFallbackLoaderAPI.h rename to toolkit/xre/dllservices/mozglue/WindowsFallbackLoaderAPI.h diff --git a/mozglue/dllservices/gen_dll_blocklist_defs.py b/toolkit/xre/dllservices/mozglue/gen_dll_blocklist_defs.py similarity index 100% rename from mozglue/dllservices/gen_dll_blocklist_defs.py rename to toolkit/xre/dllservices/mozglue/gen_dll_blocklist_defs.py diff --git a/mozglue/misc/interceptor/Arm64.cpp b/toolkit/xre/dllservices/mozglue/interceptor/Arm64.cpp similarity index 100% rename from mozglue/misc/interceptor/Arm64.cpp rename to toolkit/xre/dllservices/mozglue/interceptor/Arm64.cpp diff --git a/mozglue/misc/interceptor/Arm64.h b/toolkit/xre/dllservices/mozglue/interceptor/Arm64.h similarity index 100% rename from mozglue/misc/interceptor/Arm64.h rename to toolkit/xre/dllservices/mozglue/interceptor/Arm64.h diff --git a/mozglue/misc/interceptor/MMPolicies.h b/toolkit/xre/dllservices/mozglue/interceptor/MMPolicies.h similarity index 100% rename from mozglue/misc/interceptor/MMPolicies.h rename to toolkit/xre/dllservices/mozglue/interceptor/MMPolicies.h diff --git a/mozglue/misc/interceptor/PatcherBase.h b/toolkit/xre/dllservices/mozglue/interceptor/PatcherBase.h similarity index 100% rename from mozglue/misc/interceptor/PatcherBase.h rename to toolkit/xre/dllservices/mozglue/interceptor/PatcherBase.h diff --git a/mozglue/misc/interceptor/PatcherDetour.h b/toolkit/xre/dllservices/mozglue/interceptor/PatcherDetour.h similarity index 100% rename from mozglue/misc/interceptor/PatcherDetour.h rename to toolkit/xre/dllservices/mozglue/interceptor/PatcherDetour.h diff --git a/mozglue/misc/interceptor/PatcherNopSpace.h b/toolkit/xre/dllservices/mozglue/interceptor/PatcherNopSpace.h similarity index 100% rename from mozglue/misc/interceptor/PatcherNopSpace.h rename to toolkit/xre/dllservices/mozglue/interceptor/PatcherNopSpace.h diff --git a/mozglue/misc/interceptor/RangeMap.h b/toolkit/xre/dllservices/mozglue/interceptor/RangeMap.h similarity index 100% rename from mozglue/misc/interceptor/RangeMap.h rename to toolkit/xre/dllservices/mozglue/interceptor/RangeMap.h diff --git a/mozglue/misc/interceptor/TargetFunction.h b/toolkit/xre/dllservices/mozglue/interceptor/TargetFunction.h similarity index 100% rename from mozglue/misc/interceptor/TargetFunction.h rename to toolkit/xre/dllservices/mozglue/interceptor/TargetFunction.h diff --git a/mozglue/misc/interceptor/Trampoline.h b/toolkit/xre/dllservices/mozglue/interceptor/Trampoline.h similarity index 100% rename from mozglue/misc/interceptor/Trampoline.h rename to toolkit/xre/dllservices/mozglue/interceptor/Trampoline.h diff --git a/mozglue/misc/interceptor/VMSharingPolicies.h b/toolkit/xre/dllservices/mozglue/interceptor/VMSharingPolicies.h similarity index 100% rename from mozglue/misc/interceptor/VMSharingPolicies.h rename to toolkit/xre/dllservices/mozglue/interceptor/VMSharingPolicies.h diff --git a/mozglue/misc/interceptor/moz.build b/toolkit/xre/dllservices/mozglue/interceptor/moz.build similarity index 100% rename from mozglue/misc/interceptor/moz.build rename to toolkit/xre/dllservices/mozglue/interceptor/moz.build diff --git a/mozglue/dllservices/moz.build b/toolkit/xre/dllservices/mozglue/moz.build similarity index 95% rename from mozglue/dllservices/moz.build rename to toolkit/xre/dllservices/mozglue/moz.build index 3bb35a0be9c5..b0dc7ec07848 100644 --- a/mozglue/dllservices/moz.build +++ b/toolkit/xre/dllservices/mozglue/moz.build @@ -5,7 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG["MOZ_WIDGET_TOOLKIT"]: - SOURCES += [ # This file contains a |using namespace mozilla;| statement "WindowsDllBlocklist.cpp", @@ -35,6 +34,10 @@ DELAYLOAD_DLLS += [ "wintrust.dll", ] +EXPORTS += [ + "nsWindowsDllInterceptor.h", +] + EXPORTS.mozilla += [ "Authenticode.h", "CacheNtDllThunk.h", @@ -61,6 +64,11 @@ GeneratedFile( entry_point="gen_blocklists", inputs=["WindowsDllBlocklistDefs.in"] ) + EXPORTS.mozilla += ["!" + hdr for hdr in blocklist_files] +DIRS += [ + "interceptor", +] + FINAL_LIBRARY = "mozglue" diff --git a/mozglue/misc/nsWindowsDllInterceptor.h b/toolkit/xre/dllservices/mozglue/nsWindowsDllInterceptor.h similarity index 100% rename from mozglue/misc/nsWindowsDllInterceptor.h rename to toolkit/xre/dllservices/mozglue/nsWindowsDllInterceptor.h diff --git a/mozglue/tests/interceptor/AssemblyPayloads.h b/toolkit/xre/dllservices/tests/AssemblyPayloads.h similarity index 100% rename from mozglue/tests/interceptor/AssemblyPayloads.h rename to toolkit/xre/dllservices/tests/AssemblyPayloads.h diff --git a/mozglue/tests/interceptor/TestDllInterceptor.cpp b/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp similarity index 100% rename from mozglue/tests/interceptor/TestDllInterceptor.cpp rename to toolkit/xre/dllservices/tests/TestDllInterceptor.cpp diff --git a/mozglue/tests/interceptor/TestDllInterceptor.exe.manifest b/toolkit/xre/dllservices/tests/TestDllInterceptor.exe.manifest similarity index 100% rename from mozglue/tests/interceptor/TestDllInterceptor.exe.manifest rename to toolkit/xre/dllservices/tests/TestDllInterceptor.exe.manifest diff --git a/mozglue/tests/interceptor/TestDllInterceptorCrossProcess.cpp b/toolkit/xre/dllservices/tests/TestDllInterceptorCrossProcess.cpp similarity index 100% rename from mozglue/tests/interceptor/TestDllInterceptorCrossProcess.cpp rename to toolkit/xre/dllservices/tests/TestDllInterceptorCrossProcess.cpp diff --git a/mozglue/tests/interceptor/TestIATPatcher.cpp b/toolkit/xre/dllservices/tests/TestIATPatcher.cpp similarity index 100% rename from mozglue/tests/interceptor/TestIATPatcher.cpp rename to toolkit/xre/dllservices/tests/TestIATPatcher.cpp diff --git a/mozglue/tests/interceptor/TestMMPolicy.cpp b/toolkit/xre/dllservices/tests/TestMMPolicy.cpp similarity index 100% rename from mozglue/tests/interceptor/TestMMPolicy.cpp rename to toolkit/xre/dllservices/tests/TestMMPolicy.cpp diff --git a/mozglue/tests/gtest/TestDLLBlocklist.cpp b/toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp similarity index 100% rename from mozglue/tests/gtest/TestDLLBlocklist.cpp rename to toolkit/xre/dllservices/tests/gtest/TestDLLBlocklist.cpp diff --git a/mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.cpp b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.cpp similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.cpp rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.cpp diff --git a/mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.rc b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.rc similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.rc rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/TestDllBlocklist_AllowByVersion.rc diff --git a/mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/moz.build b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/moz.build similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_AllowByVersion/moz.build rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_AllowByVersion/moz.build diff --git a/mozglue/tests/gtest/TestDllBlocklist_MatchByName/TestDllBlocklist_MatchByName.cpp b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByName/TestDllBlocklist_MatchByName.cpp similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_MatchByName/TestDllBlocklist_MatchByName.cpp rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByName/TestDllBlocklist_MatchByName.cpp diff --git a/mozglue/tests/gtest/TestDllBlocklist_MatchByName/moz.build b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByName/moz.build similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_MatchByName/moz.build rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByName/moz.build diff --git a/mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.cpp b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.cpp similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.cpp rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.cpp diff --git a/mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.rc b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.rc similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.rc rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/TestDllBlocklist_MatchByVersion.rc diff --git a/mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/moz.build b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/moz.build similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_MatchByVersion/moz.build rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_MatchByVersion/moz.build diff --git a/mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.cpp b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.cpp similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.cpp rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.cpp diff --git a/mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.rc b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.rc similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.rc rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/TestDllBlocklist_NoOpEntryPoint.rc diff --git a/mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/moz.build b/toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/moz.build similarity index 100% rename from mozglue/tests/gtest/TestDllBlocklist_NoOpEntryPoint/moz.build rename to toolkit/xre/dllservices/tests/gtest/TestDllBlocklist_NoOpEntryPoint/moz.build diff --git a/toolkit/xre/dllservices/tests/gtest/moz.build b/toolkit/xre/dllservices/tests/gtest/moz.build new file mode 100644 index 000000000000..61f46bfd34f0 --- /dev/null +++ b/toolkit/xre/dllservices/tests/gtest/moz.build @@ -0,0 +1,16 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +SOURCES += [ + "TestDLLBlocklist.cpp", +] + +TEST_DIRS += [ + "TestDllBlocklist_AllowByVersion", + "TestDllBlocklist_MatchByName", + "TestDllBlocklist_MatchByVersion", + "TestDllBlocklist_NoOpEntryPoint", +] + +FINAL_LIBRARY = "xul-gtest" diff --git a/mozglue/tests/interceptor/moz.build b/toolkit/xre/dllservices/tests/moz.build similarity index 84% rename from mozglue/tests/interceptor/moz.build rename to toolkit/xre/dllservices/tests/moz.build index c179125cff71..f79a2667940b 100644 --- a/mozglue/tests/interceptor/moz.build +++ b/toolkit/xre/dllservices/tests/moz.build @@ -13,7 +13,7 @@ GeckoCppUnitTests( linkage=None, ) -if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["CPU_ARCH"] in ("x86", "x86_64"): +if CONFIG["CPU_ARCH"] in ("x86", "x86_64"): # Cross-process interceptors not yet supported on aarch64 GeckoCppUnitTests( [ @@ -33,8 +33,12 @@ DELAYLOAD_DLLS += [ "shlwapi.dll", ] -if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["CC_TYPE"] in ("gcc", "clang"): +if CONFIG["CC_TYPE"] in ("gcc", "clang"): # This allows us to use wmain as the entry point on mingw LDFLAGS += [ "-municode", ] + +TEST_DIRS += [ + "gtest", +] diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index 7676bc7c8220..513142b179ac 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -40,7 +40,6 @@ EXPORTS.mozilla += [ "CmdLineAndEnvUtils.h", "MultiInstanceLock.h", "SafeMode.h", - "UntrustedModulesData.h", ] if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]: @@ -50,22 +49,14 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": EXPORTS.mozilla += [ "AssembleCmdLine.h", "DllPrefetchExperimentRegistryInfo.h", - "ModuleVersionInfo.h", "PolicyChecks.h", - "UntrustedModulesProcessor.h", - "WinDllServices.h", "WinTokenUtils.h", ] UNIFIED_SOURCES += [ "/toolkit/mozapps/update/common/pathhash.cpp", "/toolkit/mozapps/update/common/updateutils_win.cpp", "DllPrefetchExperimentRegistryInfo.cpp", - "ModuleEvaluator.cpp", - "ModuleVersionInfo.cpp", "nsNativeAppSupportWin.cpp", - "UntrustedModulesData.cpp", - "UntrustedModulesProcessor.cpp", - "WinDllServices.cpp", "WinTokenUtils.cpp", ] DEFINES["PROXY_PRINTING"] = 1 @@ -79,6 +70,9 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": UNIFIED_SOURCES += [ "LauncherRegistryInfo.cpp", ] + DIRS += [ + "dllservices", + ] elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": EXPORTS.mozilla += [ "MacRunFromDmgUtils.h",