]> git.sesse.net Git - vlc/commitdiff
Win32: close vlc when heap corruption is detected
authorGeoffroy Couprie <geal@videolan.org>
Sun, 24 Jan 2010 19:05:30 +0000 (20:05 +0100)
committerGeoffroy Couprie <geal@videolan.org>
Sun, 24 Jan 2010 19:05:30 +0000 (20:05 +0100)
bin/winvlc.c

index 6e933856cfa2d55d775c2b1e04d07266af0c6158..874116035847621e195a4aae3262b5224efe6ac8 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
 
 #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;