g_spawn_* and Win32



Hi all,

I've been playing with the g_spawn_* functions on Win32 and I've been
running into some issues. The basic problems I've run into are:

. things generally work if you use "G_SPAWN_LEAVE_DESCRIPTORS_OPEN |
G_SPAWN_CHILD_INHERITS_STDIN", meaning they seem to work if the
gspawn-win32-helper.exe process is not involved in the process.

. with glib 2.16 (not from gtk.org, custom compiled with VC8), the
helper process seems to work from a terminal (you still need the
G_SPAWN_LEAVE_DESCRIPTORS_OPEN flag, though). But it doesn't work if
the process is a service (run through the SCM).

. with glib 2.18 (custom compiled with VC8.5, and also the one from
the web site), neither of the above scenarios work.

I'm attaching the code I used to test this; it can run both from the
terminal (use "spawn.exe -c") or as a service ("spawn.exe -i" to
install it; then "net start spawntest" - the start will fail, but you
can use DbgView to get the log messages; "spawn.exe -u" to remove it).

Any idea if I'm doing anything wrong? Relying on
"G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_CHILD_INHERITS_STDIN" to
force bypassing the helper app doesn't seem very good, since things
may change in the future (and what if I need any of the other flags
that trigger the helper app?).

P.S.: I'd just like to say, if any glib developers are around, that
http://bugzilla.gnome.org/show_bug.cgi?id=509201 would be really nice
to have.

-- 
Marcelo Vanzin
mmvgroups gmail com
"Life's too short to drink cheap beer."


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]