From edcb51e041d612e3fb8a0c0a9135d989c881ccc9 Mon Sep 17 00:00:00 2001 From: Peihsun Yeh Date: Wed, 1 Aug 2018 16:58:31 -0700 Subject: Creating custom media source solution and project (still needs driver) --- general/SimpleMediaSource/MediaSource/dllMain.cpp | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 general/SimpleMediaSource/MediaSource/dllMain.cpp (limited to 'general/SimpleMediaSource/MediaSource/dllMain.cpp') diff --git a/general/SimpleMediaSource/MediaSource/dllMain.cpp b/general/SimpleMediaSource/MediaSource/dllMain.cpp new file mode 100644 index 00000000..aed44eb0 --- /dev/null +++ b/general/SimpleMediaSource/MediaSource/dllMain.cpp @@ -0,0 +1,35 @@ +/// +/// Copyright (c) Microsoft Corporation. All rights reserved. +/// +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +#include + +#if !defined(__WRL_CLASSIC_COM__) +STDAPI DllGetActivationFactory(_In_ HSTRING activatibleClassId, _COM_Outptr_ IActivationFactory** factory) +{ + return Module::GetModule().GetActivationFactory(activatibleClassId, factory); +} +#endif + +#if !defined(__WRL_WINRT_STRICT__) +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, _COM_Outptr_ void** ppv) +{ + return Module::GetModule().GetClassObject(rclsid, riid, ppv); +} +#endif + +STDAPI DllCanUnloadNow() +{ + return Module::GetModule().Terminate() ? S_OK : S_FALSE; +} + +STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*) +{ + if (reason == DLL_PROCESS_ATTACH) + { + DisableThreadLibraryCalls(hinst); + } + return TRUE; +} -- cgit v1.3.1