]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Set CREATE_NO_WINDOW in tor_spawn_background.
authorDavid Fifield <david@bamsoftware.com>
Thu, 5 Dec 2013 04:56:28 +0000 (04:56 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 5 Dec 2013 17:30:11 +0000 (12:30 -0500)
This flag prevents the creation of a console window popup on Windows. We
need it for pluggable transport executables--otherwise you get blank
console windows when you launch the 3.x browser bundle with transports
enabled.

http://msdn.microsoft.com/en-us/library/ms684863.aspx#CREATE_NO_WINDOW

The browser bundles that used Vidalia used to set this flag when
launching tor itself; it was apparently inherited by the pluggable
transports launched by tor. In the 3.x bundles, tor is launched by some
JavaScript code, which doesn't have the ability to set CREATE_NO_WINDOW.
tor itself is now being compiled with the -mwindows option, so that it
is a GUI application, not a console application, and doesn't show a
console window in any case. This workaround doesn't work for pluggable
transports, because they need to be able to write control messages to
stdout.

https://trac.torproject.org/projects/tor/ticket/9444#comment:30

changes/bug10297 [new file with mode: 0644]
src/common/util.c

diff --git a/changes/bug10297 b/changes/bug10297
new file mode 100644 (file)
index 0000000..4cdd80f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features:
+    - Spawn background processes using the CREATE_NO_WINDOW flag on
+      Windows, in order to prevent a console window from appearing.
+      Resolves ticket 10297.
index ae3f69b5e37181ee1eb59d371845141c94604b21..054de3dbe923653bc28a0169997a80e8a2ff7f05 100644 (file)
@@ -3803,7 +3803,7 @@ tor_spawn_background(const char *const filename, const char **argv,
                  TRUE,          // handles are inherited
   /*(TODO: set CREATE_NEW CONSOLE/PROCESS_GROUP to make GetExitCodeProcess()
    * work?) */
-                 0,             // creation flags
+                 CREATE_NO_WINDOW,             // creation flags
                  (env==NULL) ? NULL : env->windows_environment_block,
                  NULL,          // use parent's current directory
                  &siStartInfo,  // STARTUPINFO pointer