summaryrefslogtreecommitdiff
path: root/audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp')
-rw-r--r--audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp b/audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp
new file mode 100644
index 00000000..39c15c7b
--- /dev/null
+++ b/audio/SoundWire/Samples/SdcaVad/EventDetectorAdapter/dllmain.cpp
@@ -0,0 +1,35 @@
+// Copyright (C) Microsoft Corporation. All rights reserved.
+#include "stdafx.h"
+#include <wrl\module.h>
+
+using namespace Microsoft::WRL;
+
+#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__)
+_Check_return_
+STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID FAR* ppv)
+{
+ return Module<InProc>::GetModule().GetClassObject(rclsid, riid, ppv);
+}
+#endif
+
+__control_entrypoint(DllExport)
+STDAPI DllCanUnloadNow()
+{
+ return Module<InProc>::GetModule().Terminate() ? S_OK : S_FALSE;
+}
+
+STDAPI_(BOOL) DllMain(_In_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
+{
+ if (reason == DLL_PROCESS_ATTACH)
+ {
+ DisableThreadLibraryCalls(hinst);
+ }
+ return TRUE;
+}