Browse Source

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] 36d7b92bbc
pull/175/head
Steve Lhomme 1 year ago
parent
commit
64d46c2ba0
  1. 13
      bin/winvlc.c
  2. 4
      config.h.meson
  3. 8
      configure.ac
  4. 5
      meson.build

13
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"));

4
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

8
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

5
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

Loading…
Cancel
Save