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

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Aug  1 07:49:33 2018 +0200| [81e6e779e183ffdeebbc8f72a3c81b241933ff7a] | committer: Steve Lhomme

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

hopefully the location won't change in future Windows versions

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 40e81088b0..1624eedebb 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -31,7 +31,6 @@
 
 #include <assert.h>
 #include <math.h>
-#include <versionhelpers.h>
 
 #if !defined(_WIN32_WINNT) || _WIN32_WINNT < _WIN32_WINNT_WIN7
 # undef _WIN32_WINNT
@@ -248,9 +247,18 @@ static int Open(vlc_object_t *object)
 {
     vout_display_t *vd = (vout_display_t *)object;
 
+#if !VLC_WINSTORE_APP
     /* Allow using D3D11 automatically starting from Windows 8.1 */
-    if (!vd->obj.force && !IsWindows8Point1OrGreater())
-        return VLC_EGENERIC;
+    if (!vd->obj.force)
+    {
+        bool isWin81OrGreater = false;
+        HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+        if (likely(hKernel32 != NULL))
+            isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") != NULL;
+        if (!isWin81OrGreater)
+            return VLC_EGENERIC;
+    }
+#endif
 
 #if !VLC_WINSTORE_APP
     int ret = OpenHwnd(vd);



More information about the vlc-commits mailing list