gio/gdbusaddress.c: Silence RunDLL errors
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 15 Aug 2013 13:27:02 +0000 (21:27 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 21 Aug 2013 12:28:26 +0000 (20:28 +0800)
The RunDLL command call during get_session_address_dbus_launch() was
expecting _g_win32_run_session_bus@16 and g_win32_run_session_bus
on Win32 and Win64 respectively at least when GLib is compiled with MSVC,
not g_win32_run_session_bus@16, which caused annoying RunDLL error dialogue
boxes to show up during the use of GtkApplication (such as when running
gtk3-demo-application on Windows), prevented GtkApplication items from
being run for more than one time during the lifespan of the program,
and this also interfered with some GTK+ tests, causing them to fail.

Update accordingly to address the issue.

gio/gdbusaddress.c

index 79b4bd6..b5143cf 100644 (file)
@@ -1400,7 +1400,15 @@ get_session_address_dbus_launch (GError **error)
          wcscat (args, rundll_path);
          wcscat (args, L"\" ");
          wcscat (args, gio_path_short);
+#ifdef _MSC_VER
+#if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64)
+         wcscat (args, L",g_win32_run_session_bus");
+#else
+         wcscat (args, L",_g_win32_run_session_bus@16");
+#endif
+#else
          wcscat (args, L",g_win32_run_session_bus@16");
+#endif
 
          res = CreateProcessW (rundll_path, args,
                                0, 0, FALSE,