From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5768 :
[obnox/wireshark/wip.git] / rawshark.c
index a5fd3b9c27815532e3fbe721ef8cd03fd6f2005e..27d4d7639de98e4be8d06bc1650b4bcb3ce0bf6b 100644 (file)
 #endif /* HAVE_LIBPCAP */
 #include "log.h"
 
+#ifdef _WIN32
+#include <shellapi.h>
+#endif /* _WIN32 */
+
 /*
  * This is the template for the decode as option; it is shared between the
  * various functions that output the usage for this parameter.
@@ -430,7 +434,9 @@ main(int argc, char *argv[])
     gboolean             arg_error = FALSE;
 
 #ifdef _WIN32
-    WSADATA       wsaData;
+    WSADATA              wsaData;
+    LPWSTR              *wc_argv;
+    int                  wc_argc;
 #endif  /* _WIN32 */
 
     char                *gpf_path, *pf_path;
@@ -453,6 +459,16 @@ main(int argc, char *argv[])
 
     static const char    optstring[] = OPTSTRING_INIT;
 
+#ifdef _WIN32
+    /* Convert our arg list to UTF-8. */
+    wc_argv = CommandLineToArgvW(GetCommandLineW(), &wc_argc);
+    if (wc_argv && wc_argc == argc) {
+        for (i = 0; i < argc; i++) {
+            argv[i] = g_utf16_to_utf8(wc_argv[i], -1, NULL, NULL, NULL);
+        }
+    } /* XXX else bail because something is horribly, horribly wrong? */
+#endif /* _WIN32 */
+
     /*
      * Get credential information for later use.
      */
@@ -701,7 +717,7 @@ main(int argc, char *argv[])
                 GString             *runtime_info_str;
                 /* Assemble the compile-time version information string */
                 comp_info_str = g_string_new("Compiled ");
-                get_compiled_version_info(comp_info_str, epan_get_compiled_version_info);
+                get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
 
                 /* Assemble the run-time version information string */
                 runtime_info_str = g_string_new("Running ");
@@ -1648,15 +1664,6 @@ cmdarg_err_cont(const char *fmt, ...)
 }
 
 
-/****************************************************************************************************************/
-/* other "dummies" */
-void
-cf_mark_frame(capture_file *cf _U_, frame_data *frame _U_)
-{
-    /* shouldn't happen */
-    g_assert_not_reached();
-}
-
 /*
  * Editor modelines
  *