From: Geoffroy Couprie Date: Sun, 24 Jan 2010 19:05:30 +0000 (+0100) Subject: Win32: close vlc when heap corruption is detected X-Git-Tag: 1.1.0-ff~950 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=4675f892ad1e6262b981f7618ede09b4c82205ab Win32: close vlc when heap corruption is detected --- diff --git a/bin/winvlc.c b/bin/winvlc.c index 6e933856cf..8741160358 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;