[vlc-commits] [Git][videolan/vlc][master] win32: assume PROCESS_MITIGATION_IMAGE_LOAD_POLICY is defined

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Nov 24 14:05:58 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
64d46c2b by Steve Lhomme at 2024-11-24T13:51:46+00:00
win32: assume PROCESS_MITIGATION_IMAGE_LOAD_POLICY is defined

It was added in mingw-w64 in [1] which is in v6, our minimum version.
We don't need to have it defined in UWP builds as we don't use winvlc.c.

[1] https://github.com/mingw-w64/mingw-w64/commit/36d7b92bbcec1e72d3ce24013b01f7acc34be3b0

- - - - -


4 changed files:

- bin/winvlc.c
- config.h.meson
- configure.ac
- meson.build


Changes:

=====================================
bin/winvlc.c
=====================================
@@ -81,19 +81,6 @@ static BOOL SetDefaultDllDirectories_(DWORD flags)
 
 static void PrioritizeSystem32(void)
 {
-#ifndef HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY
-    typedef struct _PROCESS_MITIGATION_IMAGE_LOAD_POLICY {
-      union {
-        DWORD  Flags;
-        struct {
-          DWORD NoRemoteImages  :1;
-          DWORD NoLowMandatoryLabelImages  :1;
-          DWORD PreferSystem32Images  :1;
-          DWORD ReservedFlags  :29;
-        };
-      };
-    } PROCESS_MITIGATION_IMAGE_LOAD_POLICY;
-#endif
 #if _WIN32_WINNT < _WIN32_WINNT_WIN8
     BOOL (WINAPI *SetProcessMitigationPolicy)(PROCESS_MITIGATION_POLICY, PVOID, SIZE_T);
     HINSTANCE h_Kernel32 = GetModuleHandle(TEXT("kernel32.dll"));


=====================================
config.h.meson
=====================================
@@ -313,10 +313,6 @@
 /* Define to 1 if you have the `posix_memalign' function. */
 #mesondefine HAVE_POSIX_MEMALIGN
 
-/* Define to 1 if the system has the type
-   `PROCESS_MITIGATION_IMAGE_LOAD_POLICY'. */
-#mesondefine HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY
-
 /* Define to 1 if using libprojectM 2.x */
 #mesondefine HAVE_PROJECTM2
 


=====================================
configure.ac
=====================================
@@ -4781,14 +4781,6 @@ AS_IF([test "${SYS}" = "mingw32"], [
 ])
 AM_CONDITIONAL([HAVE_MAKENSIS], [test "$MAKENSIS" != "no" && test "$nsis_version_ok" = "yes"])
 
-dnl
-dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
-dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
-dnl
-if test "${SYS}" = "mingw32"; then
-    AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
-fi
-
 EXTEND_HELP_STRING([Components:])
 
 dnl


=====================================
meson.build
=====================================
@@ -379,11 +379,6 @@ windows_version_test = '''
         vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
     endforeach
 
-    # Check for HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY type
-    if cc.has_type('PROCESS_MITIGATION_IMAGE_LOAD_POLICY', prefix: '#include <windows.h>')
-        cdata.set('HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY', 1)
-    endif
-
     mingw_check = '''
     #ifndef __MINGW32__
     # error Not compiling with mingw



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/64d46c2ba05c591b381306b8c7db1ae72ae0342a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/64d46c2ba05c591b381306b8c7db1ae72ae0342a
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