Commit 4675f892 authored by Geoffroy Couprie's avatar Geoffroy Couprie

Win32: close vlc when heap corruption is detected

parent 275f3572
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
static void check_crashdump(void); static void check_crashdump(void);
LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo); LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo);
# endif # 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 #endif
#ifndef UNDER_CE #ifndef UNDER_CE
...@@ -119,6 +125,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ...@@ -119,6 +125,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
{ {
int argc, ret; int argc, ret;
#ifndef UNDER_CE #ifndef UNDER_CE
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc); wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
if (wargv == NULL) if (wargv == NULL)
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment