summaryrefslogtreecommitdiff
path: root/general/SimpleMediaSource/MediaSource/dllMain.cpp
diff options
context:
space:
mode:
authorPeihsun Yeh <[email protected]>2018-08-01 16:58:31 -0700
committerPeihsun Yeh <[email protected]>2018-08-01 16:58:31 -0700
commitedcb51e041d612e3fb8a0c0a9135d989c881ccc9 (patch)
treec30b3e38242aac68061556481ddace96bee1a9ca /general/SimpleMediaSource/MediaSource/dllMain.cpp
parenta49f6121e1976979af7d6d8fc1f9af7acec9bcb2 (diff)
Creating custom media source solution and project (still needs driver)
Diffstat (limited to 'general/SimpleMediaSource/MediaSource/dllMain.cpp')
-rw-r--r--general/SimpleMediaSource/MediaSource/dllMain.cpp35
1 files changed, 35 insertions, 0 deletions
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 file="dllmain.cpp" company="Microsoft">
+/// Copyright (c) Microsoft Corporation. All rights reserved.
+/// </copyright>
+// dllmain.cpp : Defines the entry point for the DLL application.
+#include "stdafx.h"
+
+#include <wrl\module.h>
+
+#if !defined(__WRL_CLASSIC_COM__)
+STDAPI DllGetActivationFactory(_In_ HSTRING activatibleClassId, _COM_Outptr_ IActivationFactory** factory)
+{
+ return Module<InProc>::GetModule().GetActivationFactory(activatibleClassId, factory);
+}
+#endif
+
+#if !defined(__WRL_WINRT_STRICT__)
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, _COM_Outptr_ void** ppv)
+{
+ return Module<InProc>::GetModule().GetClassObject(rclsid, riid, ppv);
+}
+#endif
+
+STDAPI DllCanUnloadNow()
+{
+ return Module<InProc>::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;
+}