summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-16 18:07:19 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-16 18:07:19 +0000
commit1782e34b55f8f0fdb3504ee05a2ec94b7aae73e1 (patch)
tree2f220f66a2f4cb4b76511c3cac972de696f46d10
parent11ce51e3f08d01fbe6339c8c06b8e44965903ed7 (diff)
downloadmpv-1782e34b55f8f0fdb3504ee05a2ec94b7aae73e1.tar.bz2
mpv-1782e34b55f8f0fdb3504ee05a2ec94b7aae73e1.tar.xz
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
-rw-r--r--mplayer.c7
1 files changed, 7 insertions, 0 deletions
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