]> git.sesse.net Git - vlc/blobdiff - bin/winvlc.c
Generate Windows resource file on need basis
[vlc] / bin / winvlc.c
index 5bec350613542c3323f935adc6be9b83c39a8c05..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;
@@ -162,9 +169,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     argc = parse_cmdline (psz_cmdline, &argv);
 #endif
 
-    libvlc_exception_t ex, dummy;
+    libvlc_exception_t ex;
     libvlc_exception_init (&ex);
-    libvlc_exception_init (&dummy);
 
     /* Initialize libvlc */
     libvlc_instance_t *vlc;
@@ -173,14 +179,13 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     {
         libvlc_add_intf (vlc, "globalhotkeys,none");
         libvlc_add_intf (vlc, NULL);
-        libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
+        libvlc_playlist_play (vlc, -1, 0, NULL);
         libvlc_wait (vlc);
         libvlc_release (vlc);
     }
 
     ret = libvlc_exception_raised (&ex);
     libvlc_exception_clear (&ex);
-    libvlc_exception_clear (&dummy);
 
     for (int i = 0; i < argc; i++)
         free (argv[i]);