core, w32: Enable spawning GUI applications

* src/engine-spawn.c (engspawn_start): Translate spawn flag
to IOSPAWN flag.
* src/gpgme-w32spawn.c (my_spawn): Handle the new flag.
* src/gpgme.h.in (GPGME_SPAWN_SHOW_WINDOW): New.
* src/priv-io.h (IOSPAWN_FLAG_SHOW_WINDOW): New.

--
Used by GpgOL
This commit is contained in:
Andre Heinecke 2018-02-09 16:07:58 +01:00
parent f10605ffb5
commit 201db83a7f
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
4 changed files with 6 additions and 4 deletions

View File

@ -241,7 +241,8 @@ engspawn_start (engine_spawn_t esp, const char *file, const char *argv[],
spflags |= IOSPAWN_FLAG_DETACHED;
if ((flags & GPGME_SPAWN_ALLOW_SET_FG))
spflags |= IOSPAWN_FLAG_ALLOW_SET_FG;
if ((flags & GPGME_SPAWN_SHOW_WINDOW))
spflags |= IOSPAWN_FLAG_SHOW_WINDOW;
err = build_fd_data_map (esp);
if (err)

View File

@ -121,8 +121,6 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
int duped_stdout = 0;
int duped_stderr = 0;
HANDLE hnul = INVALID_HANDLE_VALUE;
/* FIXME. */
int debug_me = 0;
i = 0;
while (argv[i])
@ -142,7 +140,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
memset (&si, 0, sizeof si);
si.cb = sizeof (si);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = debug_me ? SW_SHOW : SW_HIDE;
si.wShowWindow = (flags & IOSPAWN_FLAG_SHOW_WINDOW) ? SW_SHOW : SW_HIDE;
si.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
si.hStdError = GetStdHandle (STD_ERROR_HANDLE);

View File

@ -2007,6 +2007,7 @@ gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
/* Flags for the spawn operations. */
#define GPGME_SPAWN_DETACHED 1
#define GPGME_SPAWN_ALLOW_SET_FG 2
#define GPGME_SPAWN_SHOW_WINDOW 4
/* Run the command FILE with the arguments in ARGV. Connect stdin to

View File

@ -83,6 +83,8 @@ int _gpgme_io_set_nonblocking (int fd);
#define IOSPAWN_FLAG_ALLOW_SET_FG 2
/* Don't close any child FDs. */
#define IOSPAWN_FLAG_NOCLOSE 4
/* Set show window to true for windows */
#define IOSPAWN_FLAG_SHOW_WINDOW 8
/* Spawn the executable PATH with ARGV as arguments. After forking
close all fds except for those in FD_LIST in the child, then