mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1751367: Delay loading winmm.dll, so it loads after COM initialization. r=cmartin,media-playback-reviewers,alwu
This is to prevent user32.dll from loading before COM initialization on earlier version of windows. Differential Revision: https://phabricator.services.mozilla.com/D136936
This commit is contained in:
parent
dd05abfc31
commit
b9d6b5e60a
@ -212,6 +212,7 @@ mozilla::ipc::IPCResult GMPChild::RecvPreloadLibs(const nsCString& aLibs) {
|
||||
u"ole32.dll", // required for OPM
|
||||
u"psapi.dll", // For GetMappedFileNameW, see bug 1383611
|
||||
u"softokn3.dll", // NSS for clearkey CDM
|
||||
u"winmm.dll", // Dependency for widevine
|
||||
};
|
||||
constexpr static bool (*IsASCII)(const char16_t*) =
|
||||
IsAsciiNullTerminated<char16_t>;
|
||||
|
@ -907,7 +907,7 @@ RefPtr<GenericPromise> GMPParent::ParseChromiumManifest(
|
||||
#if XP_WIN
|
||||
// psapi.dll added for GetMappedFileNameW, which could possibly be avoided
|
||||
// in future versions, see bug 1383611 for details.
|
||||
mLibs = "dxva2.dll, ole32.dll, psapi.dll"_ns;
|
||||
mLibs = "dxva2.dll, ole32.dll, psapi.dll, winmm.dll"_ns;
|
||||
#endif
|
||||
} else if (mDisplayName.EqualsASCII("fake")) {
|
||||
// The fake CDM just exposes a key system with id "fake".
|
||||
|
@ -23,6 +23,10 @@ UtilityProcessImpl::~UtilityProcessImpl() { mUtility = nullptr; }
|
||||
|
||||
bool UtilityProcessImpl::Init(int aArgc, char* aArgv[]) {
|
||||
#if defined(MOZ_SANDBOX) && defined(OS_WIN)
|
||||
// We delay load winmm.dll so that its dependencies don't interfere with COM
|
||||
// initialization when win32k is locked down. We need to load it before we
|
||||
// lower the sandbox in processes where the policy will prevent loading.
|
||||
::LoadLibraryW(L"winmm.dll");
|
||||
mozilla::SandboxTarget::Instance()->StartSandbox();
|
||||
#endif
|
||||
|
||||
|
@ -145,6 +145,11 @@ if CONFIG["OS_TARGET"] == "WINNT":
|
||||
if CONFIG["CPU_ARCH"] == "x86":
|
||||
# This should really be the default.
|
||||
sandbox_vars["ASFLAGS"] = ["-safeseh"]
|
||||
|
||||
DELAYLOAD_DLLS += [
|
||||
"winmm.dll",
|
||||
]
|
||||
|
||||
if CONFIG["OS_TARGET"] == "Android":
|
||||
sandbox_vars["CFLAGS"] = [
|
||||
"-include",
|
||||
|
@ -53,6 +53,7 @@ def Libxul(name, output_category=None):
|
||||
"usp10.dll",
|
||||
"uxtheme.dll",
|
||||
"wininet.dll",
|
||||
"winmm.dll",
|
||||
"winspool.drv",
|
||||
"wtsapi32.dll",
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user