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
This commit is contained in:
reimar 2009-09-16 18:07:19 +00:00
parent 11ce51e3f0
commit 1782e34b55
1 changed files with 7 additions and 0 deletions

View File

@ -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