diff --git a/ipc/glue/UtilityAudioDecoderParent.cpp b/ipc/glue/UtilityAudioDecoderParent.cpp index 5764150ea03b..0ef8bb95793c 100644 --- a/ipc/glue/UtilityAudioDecoderParent.cpp +++ b/ipc/glue/UtilityAudioDecoderParent.cpp @@ -18,6 +18,7 @@ # include "WMFUtils.h" # include "mozilla/sandboxTarget.h" +# include "mozilla/ipc/UtilityProcessImpl.h" #endif // defined(XP_WIN) && defined(MOZ_SANDBOX) #ifdef MOZ_WIDGET_ANDROID @@ -69,20 +70,20 @@ void UtilityAudioDecoderParent::GenericPreloadForSandbox() { #if defined(MOZ_SANDBOX) && defined(OS_WIN) // Preload AV dlls so we can enable Binary Signature Policy // to restrict further dll loads. - ::LoadLibraryW(L"mozavcodec.dll"); - ::LoadLibraryW(L"mozavutil.dll"); + UtilityProcessImpl::LoadLibraryOrCrash(L"mozavcodec.dll"); + UtilityProcessImpl::LoadLibraryOrCrash(L"mozavutil.dll"); #endif // defined(MOZ_SANDBOX) && defined(OS_WIN) } /* static */ void UtilityAudioDecoderParent::WMFPreloadForSandbox() { #if defined(MOZ_SANDBOX) && defined(OS_WIN) - ::LoadLibraryW(L"mfplat.dll"); - ::LoadLibraryW(L"mf.dll"); + UtilityProcessImpl::LoadLibraryOrCrash(L"mfplat.dll"); + UtilityProcessImpl::LoadLibraryOrCrash(L"mf.dll"); # if defined(DEBUG) // WMF Shutdown on debug build somehow requires this - ::LoadLibraryW(L"ole32.dll"); + UtilityProcessImpl::LoadLibraryOrCrash(L"ole32.dll"); # endif // defined(DEBUG) auto rv = wmf::MediaFoundationInitializer::HasInitialized(); diff --git a/ipc/glue/UtilityProcessImpl.cpp b/ipc/glue/UtilityProcessImpl.cpp index b2f1e1399082..4a8e29a292b1 100644 --- a/ipc/glue/UtilityProcessImpl.cpp +++ b/ipc/glue/UtilityProcessImpl.cpp @@ -46,7 +46,7 @@ bool UtilityProcessImpl::Init(int aArgc, char* aArgv[]) { // 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"); + LoadLibraryOrCrash(L"winmm.dll"); if (*sandboxingKind == SandboxingKind::GENERIC_UTILITY) { // Preload audio generic libraries required for ffmpeg only