[vlc-devel] commit: Win32: add a --no-crashdump option (Geoffroy Couprie )

git version control git at videolan.org
Mon Jul 6 15:58:53 CEST 2009


vlc | branch: master | Geoffroy Couprie <geal at videolan.org> | Mon Jul  6 15:58:23 2009 +0200| [f5c2514a7a64f8d96b1365802210e3b493f30b51] | committer: Geoffroy Couprie 

Win32: add a --no-crashdump option

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5c2514a7a64f8d96b1365802210e3b493f30b51
---

 bin/winvlc.c |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index a2d6616..a8dd08a 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -120,10 +120,31 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
         return 1;
 
     char *argv[argc + 1];
+    BOOL crash_handling = TRUE;
+    int j = 0;
     for (int i = 0; i < argc; i++)
-        argv[i] = FromWide (wargv[i]);
+    {
+        if(!wcscmp(wargv[i], L"--no-crashdump"))
+        {
+            crash_handling = FALSE;
+        }
+        else
+        {
+            argv[j] = FromWide (wargv[i]);
+            j++;
+        }
+    }
+
+    argc = j;
     argv[argc] = NULL;
     LocalFree (wargv);
+
+    if(crash_handling)
+    {
+        check_crashdump();
+        SetUnhandledExceptionFilter(vlc_exception_filter);
+    }
+
 #else
     char **argv, psz_cmdline[wcslen(lpCmdLine) * 4];
 
@@ -137,11 +158,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     libvlc_exception_init (&ex);
     libvlc_exception_init (&dummy);
 
-#if !defined( UNDER_CE )
-    check_crashdump();
-    SetUnhandledExceptionFilter(vlc_exception_filter);
-#endif
-
     /* Initialize libvlc */
     libvlc_instance_t *vlc;
     vlc = libvlc_new (argc - 1, (const char **)argv + 1, &ex);




More information about the vlc-devel mailing list