[vlc-devel] commit: Win32: close vlc when heap corruption is detected ( Geoffroy Couprie )

git version control git at videolan.org
Sun Jan 24 20:05:47 CET 2010


vlc | branch: master | Geoffroy Couprie <geal at videolan.org> | Sun Jan 24 20:05:30 2010 +0100| [4675f892ad1e6262b981f7618ede09b4c82205ab] | committer: Geoffroy Couprie 

Win32: close vlc when heap corruption is detected

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

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

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 6e93385..8741160 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -46,6 +46,12 @@
 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
 
 #ifndef UNDER_CE
@@ -119,6 +125,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 {
     int argc, ret;
 #ifndef UNDER_CE
+    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
     wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
     if (wargv == NULL)
         return 1;




More information about the vlc-devel mailing list