From 1782e34b55f8f0fdb3504ee05a2ec94b7aae73e1 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 16 Sep 2009 18:07:19 +0000 Subject: [PATCH] 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(+) 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