Commit 902c19d6 authored by David Reid's avatar David Reid

WASAPI: Another fix for the GDK build.

parent 64f14070
...@@ -40970,7 +40970,11 @@ static ma_result ma_context_uninit_backend_apis__win32(ma_context* pContext) ...@@ -40970,7 +40970,11 @@ static ma_result ma_context_uninit_backend_apis__win32(ma_context* pContext)
/* For some reason UWP complains when CoUninitialize() is called. I'm just not going to call it on UWP. */ /* For some reason UWP complains when CoUninitialize() is called. I'm just not going to call it on UWP. */
#if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK)
ma_CoUninitialize(pContext); ma_CoUninitialize(pContext);
#if defined(MA_WIN32_DESKTOP)
ma_dlclose(pContext, pContext->win32.hUser32DLL); ma_dlclose(pContext, pContext->win32.hUser32DLL);
#endif
ma_dlclose(pContext, pContext->win32.hOle32DLL); ma_dlclose(pContext, pContext->win32.hOle32DLL);
ma_dlclose(pContext, pContext->win32.hAdvapi32DLL); ma_dlclose(pContext, pContext->win32.hAdvapi32DLL);
#else #else
...@@ -40983,6 +40987,18 @@ static ma_result ma_context_uninit_backend_apis__win32(ma_context* pContext) ...@@ -40983,6 +40987,18 @@ static ma_result ma_context_uninit_backend_apis__win32(ma_context* pContext)
static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) static ma_result ma_context_init_backend_apis__win32(ma_context* pContext)
{ {
#if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK) #if defined(MA_WIN32_DESKTOP) || defined(MA_WIN32_GDK)
#if defined(MA_WIN32_DESKTOP)
/* User32.dll */
pContext->win32.hUser32DLL = ma_dlopen(pContext, "user32.dll");
if (pContext->win32.hUser32DLL == NULL) {
return MA_FAILED_TO_INIT_BACKEND;
}
pContext->win32.GetForegroundWindow = (ma_proc)ma_dlsym(pContext, pContext->win32.hUser32DLL, "GetForegroundWindow");
pContext->win32.GetDesktopWindow = (ma_proc)ma_dlsym(pContext, pContext->win32.hUser32DLL, "GetDesktopWindow");
#endif
/* Ole32.dll */ /* Ole32.dll */
pContext->win32.hOle32DLL = ma_dlopen(pContext, "ole32.dll"); pContext->win32.hOle32DLL = ma_dlopen(pContext, "ole32.dll");
if (pContext->win32.hOle32DLL == NULL) { if (pContext->win32.hOle32DLL == NULL) {
...@@ -40998,16 +41014,6 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext) ...@@ -40998,16 +41014,6 @@ static ma_result ma_context_init_backend_apis__win32(ma_context* pContext)
pContext->win32.StringFromGUID2 = (ma_proc)ma_dlsym(pContext, pContext->win32.hOle32DLL, "StringFromGUID2"); pContext->win32.StringFromGUID2 = (ma_proc)ma_dlsym(pContext, pContext->win32.hOle32DLL, "StringFromGUID2");
/* User32.dll */
pContext->win32.hUser32DLL = ma_dlopen(pContext, "user32.dll");
if (pContext->win32.hUser32DLL == NULL) {
return MA_FAILED_TO_INIT_BACKEND;
}
pContext->win32.GetForegroundWindow = (ma_proc)ma_dlsym(pContext, pContext->win32.hUser32DLL, "GetForegroundWindow");
pContext->win32.GetDesktopWindow = (ma_proc)ma_dlsym(pContext, pContext->win32.hUser32DLL, "GetDesktopWindow");
/* Advapi32.dll */ /* Advapi32.dll */
pContext->win32.hAdvapi32DLL = ma_dlopen(pContext, "advapi32.dll"); pContext->win32.hAdvapi32DLL = ma_dlopen(pContext, "advapi32.dll");
if (pContext->win32.hAdvapi32DLL == NULL) { if (pContext->win32.hAdvapi32DLL == NULL) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment