[FFmpeg-devel] [PATCH] win32_dlfcn: Support WinRT/UWP.

Matt Oliver protogonoi at gmail.com
Sat Jul 1 16:18:25 EEST 2017


This only enables dlls that are packaged with the application to be
loaded. Due to the limitations of WinRT/UWP it is not allowed to load
external/system dlls so this cannot be used as a complete replacement
for normal win32 dll loading.
---
 compat/w32dlfcn.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h
index bc9bb8c9f5..eeabfe4ee0 100644
--- a/compat/w32dlfcn.h
+++ b/compat/w32dlfcn.h
@@ -21,7 +21,7 @@

 #ifdef _WIN32
 #include <windows.h>
-#if _WIN32_WINNT < 0x0602
+#if (_WIN32_WINNT < 0x0602) || HAVE_WINRT
 #include "libavutil/wchar_filename.h"
 #endif
 /**
@@ -71,7 +71,14 @@ exit:
 #ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
 #   define LOAD_LIBRARY_SEARCH_SYSTEM32        0x00000800
 #endif
+#if !HAVE_WINRT
     return LoadLibraryExA(name, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR
| LOAD_LIBRARY_SEARCH_SYSTEM32);
+#else
+    wchar_t *name_w = NULL;
+    if (utf8towchar(name, &name_w))
+        return NULL;
+    return LoadPackagedLibrary(name_w, 0);
+#endif
 }
 #define dlopen(name, flags) win32_dlopen(name)
 #define dlclose FreeLibrary
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-win32_dlfcn-Support-WinRT-UWP.patch
Type: application/octet-stream
Size: 1341 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170701/3dc19648/attachment.obj>


More information about the ffmpeg-devel mailing list