]> git.sesse.net Git - vlc/blobdiff - bin/winvlc.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / bin / winvlc.c
index 09f56b6e9629d637e277a1941ff7e7b36d30a37f..b91cea1a791b845ab38f4853a35f2341a36465fe 100644 (file)
 static void check_crashdump(void);
 LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo);
 # endif
-typedef enum _HEAP_INFORMATION_CLASS {
-        HeapCompatibilityInformation,
-        HeapEnableTerminationOnCorruption
-} HEAP_INFORMATION_CLASS;
-WINBASEAPI BOOL WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
 #define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
 #endif
 
@@ -126,6 +121,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;