From 64d46c2ba05c591b381306b8c7db1ae72ae0342a Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 20 Nov 2024 15:21:14 +0100 Subject: [PATCH] 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 --- bin/winvlc.c | 13 ------------- config.h.meson | 4 ---- configure.ac | 8 -------- meson.build | 5 ----- 4 files changed, 30 deletions(-) diff --git a/bin/winvlc.c b/bin/winvlc.c index 391f296108..6efe3c6151 100644 --- a/bin/winvlc.c +++ b/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")); diff --git a/config.h.meson b/config.h.meson index 4345de78bd..d46fa53c95 100644 --- a/config.h.meson +++ b/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 diff --git a/configure.ac b/configure.ac index cc27956ca1..95f40cc1f4 100644 --- a/configure.ac +++ b/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 ]) -fi - EXTEND_HELP_STRING([Components:]) dnl diff --git a/meson.build b/meson.build index c1c4205714..7e09b2b00d 100644 --- a/meson.build +++ b/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 ') - cdata.set('HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY', 1) - endif - mingw_check = ''' #ifndef __MINGW32__ # error Not compiling with mingw