Ticket #10297: 0001-Set-CREATE_NO_WINDOW-in-tor_spawn_background.patch

File 0001-Set-CREATE_NO_WINDOW-in-tor_spawn_background.patch, 1.9 KB (added by dcf, 7 years ago)
  • src/common/util.c

    From 02a13f3f4a287efad1e1933e8cab541b5b207830 Mon Sep 17 00:00:00 2001
    From: David Fifield <david@bamsoftware.com>
    Date: Thu, 5 Dec 2013 04:56:28 +0000
    Subject: [PATCH] Set CREATE_NO_WINDOW in tor_spawn_background.
    
    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
    ---
     src/common/util.c |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/common/util.c b/src/common/util.c
    index db160fd..dd7e22a 100644
    a b tor_spawn_background(const char *const filename, const char **argv, 
    36733673                 TRUE,          // handles are inherited
    36743674  /*(TODO: set CREATE_NEW CONSOLE/PROCESS_GROUP to make GetExitCodeProcess()
    36753675   * work?) */
    3676                  0,             // creation flags
     3676                 CREATE_NO_WINDOW,             // creation flags
    36773677                 (env==NULL) ? NULL : env->windows_environment_block,
    36783678                 NULL,          // use parent's current directory
    36793679                 &siStartInfo,  // STARTUPINFO pointer