From 1782e34b55f8f0fdb3504ee05a2ec94b7aae73e1 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 16 Sep 2009 18:07:19 +0000 Subject: Hack: set DEP/NX on Windows via SetProcessDEPPolicy. This should really be done via the NXCOMPAT PE flag, but looks like binutils will not get support for it any time soon and not having this security feature enabled is just ridiculous. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29683 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index fb81ffd2f1..d6d73c2bfa 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2606,6 +2606,13 @@ int gui_no_filename=0; #endif #if defined(__MINGW32__) || defined(__CYGWIN__) + { + HMODULE kernel32 = GetModuleHandle("Kernel32.dll"); + BOOL WINAPI (*setDEP)(DWORD) = NULL; + if (kernel32) + setDEP = GetProcAddress(kernel32, "SetProcessDEPPolicy"); + if (setDEP) setDEP(3); + } // stop Windows from showing all kinds of annoying error dialogs SetErrorMode(0x8003); // request 1ms timer resolution -- cgit v1.2.3 From 4dae2a980c4313deed6ddb69556d2ead4417119c Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 16 Sep 2009 18:09:48 +0000 Subject: Merge two Windows-specific #if sections to simplify the condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29684 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index d6d73c2bfa..59a0b48a7f 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2590,7 +2590,8 @@ int gui_no_filename=0; print_version("MPlayer"); -#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_GUI) +#if defined(__MINGW32__) || defined(__CYGWIN__) +#ifdef CONFIG_GUI void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows"); if(runningmplayer && filename && use_gui){ COPYDATASTRUCT csData; @@ -2605,7 +2606,6 @@ int gui_no_filename=0; } #endif -#if defined(__MINGW32__) || defined(__CYGWIN__) { HMODULE kernel32 = GetModuleHandle("Kernel32.dll"); BOOL WINAPI (*setDEP)(DWORD) = NULL; -- cgit v1.2.3