[vlc-commits] commit: Win32: Activate DEP on XP SP3. DEP is useless without ASLR, but people using an 10 year old OS don't have the right to complain ( Geoffroy Couprie )

git at videolan.org git at videolan.org
Sat Jul 3 14:14:59 CEST 2010


vlc/vlc-1.1 | branch: master | Geoffroy Couprie <geal at videolan.org> | Thu Jul  1 22:17:38 2010 +0200| [d70c154320903c019bb0bd3d35f36fed2327ec8f] | committer: Jean-Baptiste Kempf 

Win32: Activate DEP on XP SP3. DEP is useless without ASLR, but people using an 10 year old OS don't have the right to complain
(cherry picked from commit 89486ccb0bcebd2e047cdcf2d2c51a59ec4a0adf)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=d70c154320903c019bb0bd3d35f36fed2327ec8f
---

 bin/winvlc.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 09f56b6..2d09cba 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -126,6 +126,20 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     int argc;
 #ifndef UNDER_CE
     HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
+
+    HINSTANCE h_Kernel32 = LoadLibraryW(L"kernel32.dll");
+    if(h_Kernel32)
+    {
+        BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
+# define PROCESS_DEP_ENABLE 1
+
+        mySetProcessDEPPolicy = (BOOL WINAPI (*)(DWORD))
+                            GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
+        if(mySetProcessDEPPolicy)
+            mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
+        FreeLibrary(h_Kernel32);
+    }
+
     wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
     if (wargv == NULL)
         return 1;



More information about the vlc-commits mailing list