Backed out 2 changesets (bug 1879680) for causing spidermonkey failures on dumpValue...
[gecko.git] / media / wmf-clearkey / dllmain.cpp
blob6b5da38ae51f5da58c97d9baea85b4960b19a86e
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include <windows.h>
6 #include <wrl.h>
8 using namespace Microsoft::WRL;
10 BOOL WINAPI DllMain(_In_opt_ HINSTANCE aInstance, _In_ DWORD aReason,
11 _In_opt_ LPVOID aReserved) {
12 if (DLL_PROCESS_ATTACH == aReason) {
13 DisableThreadLibraryCalls(aInstance);
14 Module<InProc>::GetModule().Create();
15 } else if (DLL_PROCESS_DETACH == aReason) {
16 Module<InProc>::GetModule().Terminate();
18 return TRUE;
21 HRESULT WINAPI
22 DllGetActivationFactory(_In_ HSTRING aActivatibleClassId,
23 _COM_Outptr_ IActivationFactory** aFactory) {
24 auto& module = Module<InProc>::GetModule();
25 return module.GetActivationFactory(aActivatibleClassId, aFactory);
28 HRESULT WINAPI DllCanUnloadNow() {
29 auto& module = Module<InProc>::GetModule();
30 return (module.Terminate()) ? S_OK : S_FALSE;
33 STDAPI DllGetClassObject(_In_ REFCLSID aRclsid, _In_ REFIID aRiid,
34 _COM_Outptr_ LPVOID FAR* aPpv) {
35 auto& module = Module<InProc>::GetModule();
36 return module.GetClassObject(aRclsid, aRiid, aPpv);