[vlc-commits] [Git][videolan/vlc][master] win32: don't use SetThreadErrorMode in XBOX builds
    Steve Lhomme (@robUx4) 
    gitlab at videolan.org
       
    Thu Mar  2 12:47:26 UTC 2023
    
    
  
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
4ff98ff5 by Steve Lhomme at 2023-03-02T12:30:32+00:00
win32: don't use SetThreadErrorMode in XBOX builds
LoadLibraryExW is available, but not SetThreadErrorMode.
DLL dependencies/errors need to be managed by the host app.
This is a sandboxed environment where the library dependencies
need to be managed manually per platform.
- - - - -
1 changed file:
- src/win32/plugin.c
Changes:
=====================================
src/win32/plugin.c
=====================================
@@ -57,15 +57,22 @@ void *vlc_dlopen(const char *psz_file, bool lazy)
         return NULL;
 
     HMODULE handle = NULL;
-#ifndef VLC_WINSTORE_APP
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
     DWORD mode;
     if (SetThreadErrorMode (SEM_FAILCRITICALERRORS, &mode) != 0)
     {
         handle = LoadLibraryExW(wfile, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
         SetThreadErrorMode (mode, NULL);
     }
-#else
+#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
     handle = LoadPackagedLibrary( wfile, 0 );
+#elif defined(WINAPI_FAMILY_GAMES) && (WINAPI_FAMILY == WINAPI_FAMILY_GAMES)
+    // SEM_FAILCRITICALERRORS is not available on Xbox, error messages are not
+    // possible. This is a sandboxed environment where the library dependencies
+    // need to be managed manually per platform.
+    handle = LoadLibraryExW(wfile, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
+#else
+#error Unknown Windows Platform!
 #endif
     free (wfile);
 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4ff98ff54ec63f77441f36b10f1c3f250f1cd723
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4ff98ff54ec63f77441f36b10f1c3f250f1cd723
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
    
    
More information about the vlc-commits
mailing list