summaryrefslogtreecommitdiff
path: root/avstream/sampledevicemft/dllmain.cpp
diff options
context:
space:
mode:
authorAdonais Romero González <[email protected]>2020-04-07 16:17:44 -0700
committerGitHub <[email protected]>2020-04-07 16:17:44 -0700
commit13c61ceeb3f7da66a2b57730d12d14eb7463c46a (patch)
treeff52f9ac442a60625936a266db1bef12ac694a8e /avstream/sampledevicemft/dllmain.cpp
parentdd4fad494b996f5729be98e0271ea74ef1a5d2ad (diff)
parent27c8560ba860165db5a173b37591271397d20bb7 (diff)
Update all the AvStream samples for Vibranium136198136197136196136195136194
Update all the AvStream samples for Vibranium.
Diffstat (limited to 'avstream/sampledevicemft/dllmain.cpp')
-rw-r--r--avstream/sampledevicemft/dllmain.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/avstream/sampledevicemft/dllmain.cpp b/avstream/sampledevicemft/dllmain.cpp
index 6978a9d5..88bfe6ab 100644
--- a/avstream/sampledevicemft/dllmain.cpp
+++ b/avstream/sampledevicemft/dllmain.cpp
@@ -196,13 +196,35 @@ STDMETHODIMP_(BOOL) WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, void *)
DisableThreadLibraryCalls(hInstance);
#ifdef MF_WPP
WPP_INIT_TRACING(L"MultiPinMft");
+
+ // Hook up WIL tracing to our trace provider.
+ wil::SetResultLoggingCallback(
+ [](const wil::FailureInfo &failure)
+ {
+ wchar_t debugString[2048];
+ if (SUCCEEDED(wil::GetFailureLogString(debugString, ARRAYSIZE(debugString), failure)))
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_ERROR, L"%S", debugString);
+ }
+ else
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_ERROR,
+ L"File: %s, Line: %u, Error: 0x%08X - %S\n",
+ failure.pszFile,
+ failure.uLineNumber,
+ failure.hr,
+ failure.pszMessage);
+ }
+ }
+ );
#endif
}
else
if (dwReason == DLL_PROCESS_DETACH)
{
#ifdef MF_WPP
- WPP_CLEANUP();
+ wil::SetResultLoggingCallback(nullptr);
+ WPP_CLEANUP();
#endif
}
return TRUE;