]> git.sesse.net Git - vlc/blobdiff - bin/winvlc.c
Use var_InheritString for --decklink-video-connection.
[vlc] / bin / winvlc.c
index 0c2543c4174f1937bec2c79c2a64d8ef64b89c21..b91cea1a791b845ab38f4853a35f2341a36465fe 100644 (file)
@@ -46,6 +46,7 @@
 static void check_crashdump(void);
 LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo);
 # endif
+#define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
 #endif
 
 #ifndef UNDER_CE
@@ -117,8 +118,23 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 #endif
                     int nCmdShow )
 {
-    int argc, ret;
+    int argc;
 #ifndef UNDER_CE
+    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
+
+    HINSTANCE h_Kernel32 = LoadLibraryW(L"kernel32.dll");
+    if(h_Kernel32)
+    {
+        BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
+# define PROCESS_DEP_ENABLE 1
+
+        mySetProcessDEPPolicy = (BOOL WINAPI (*)(DWORD))
+                            GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
+        if(mySetProcessDEPPolicy)
+            mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
+        FreeLibrary(h_Kernel32);
+    }
+
     wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
     if (wargv == NULL)
         return 1;
@@ -126,7 +142,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     char *argv[argc + 1];
     BOOL crash_handling = TRUE;
     int j = 0;
-    for (int i = 0; i < argc; i++)
+
+    argv[j++] = FromWide( L"--no-ignore-config" );
+    for (int i = 1; i < argc; i++)
     {
         if(!wcscmp(wargv[i], L"--no-crashdump"))
         {
@@ -160,31 +178,23 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     argc = parse_cmdline (psz_cmdline, &argv);
 #endif
 
-    libvlc_exception_t ex, dummy;
-    libvlc_exception_init (&ex);
-    libvlc_exception_init (&dummy);
-
     /* Initialize libvlc */
     libvlc_instance_t *vlc;
-    vlc = libvlc_new (argc - 1, (const char **)argv + 1, &ex);
+    vlc = libvlc_new (argc, (const char **)argv);
     if (vlc != NULL)
     {
-        libvlc_add_intf (vlc, "globalhotkeys,none", &ex);
-        libvlc_add_intf (vlc, NULL, &ex);
-        libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
+        libvlc_add_intf (vlc, "globalhotkeys,none");
+        libvlc_add_intf (vlc, NULL);
+        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]);
 
     (void)hInstance; (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow;
-    return ret;
+    return 0;
 }
 
 #if !defined( UNDER_CE ) && !defined( _WIN64 )