[vlc-commits] direct3d9: make the OS detection not dependent on the app manifest

Steve Lhomme git at videolan.org
Wed Aug 1 08:05:43 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Aug  1 07:56:11 2018 +0200| [6f6803c954a8e6b4856f281dde2e0a8a93eea4e9] | committer: Steve Lhomme

direct3d9: make the OS detection not dependent on the app manifest

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6f6803c954a8e6b4856f281dde2e0a8a93eea4e9
---

 modules/video_output/win32/direct3d9.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 2cb4141704..d3def81868 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -56,7 +56,6 @@
 #include "builtin_shaders.h"
 
 #include <assert.h>
-#include <versionhelpers.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -254,9 +253,18 @@ static int Open(vlc_object_t *object)
     if ( !vd->obj.force && vd->source.mastering.max_luminance != 0)
         return VLC_EGENERIC; /* let a module who can handle it do it */
 
+#if !VLC_WINSTORE_APP
     /* do not use D3D9 on XP unless forced */
-    if(!object->obj.force && !IsWindowsVistaOrGreater())
-        return VLC_EGENERIC;
+    if (!vd->obj.force)
+    {
+        bool isVistaOrGreater = false;
+        HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+        if (likely(hKernel32 != NULL))
+            isVistaOrGreater = GetProcAddress(hKernel32, "EnumResourceLanguagesExW") != NULL;
+        if (!isVistaOrGreater)
+            return VLC_EGENERIC;
+    }
+#endif
 
     /* Allocate structure */
     vd->sys = sys = calloc(1, sizeof(vout_display_sys_t));



More information about the vlc-commits mailing list