From 4675f892ad1e6262b981f7618ede09b4c82205ab Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sun, 24 Jan 2010 20:05:30 +0100 Subject: [PATCH] Win32: close vlc when heap corruption is detected --- bin/winvlc.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.39.2