From b79d4206f482b323fb9f9d52a1c715e853752195 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 27 Aug 2024 11:38:34 +0900 Subject: w32: Add GPGRT_PROCESS_ALLOW_SET_FG for gpgrt_process_spawn. * src/gpg-error.h.in (GPGRT_PROCESS_ALLOW_SET_FG): New. * src/spawn-w32.c (_gpgrt_process_spawn): Support the flag. -- When GPGME will use gpgrt_process_spawn in future, this flag will be needed to support GPGME_SPAWN_ALLOW_SET_FG. Signed-off-by: NIIBE Yutaka --- src/gpg-error.h.in | 3 +++ src/spawn-w32.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index 5b1b9d2..68a9347 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -1098,6 +1098,9 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line, /* Allow a detached process with uid != euid (Posix only). */ #define GPGRT_PROCESS_NO_EUID_CHECK (1 << 3) +/* Allow the child process to set the foreground window (Windows only). */ +#define GPGRT_PROCESS_ALLOW_SET_FG (1 << 4) + /* Specify how to keep/connect standard fds. */ #define GPGRT_PROCESS_STDIN_PIPE (1 << 8) #define GPGRT_PROCESS_STDOUT_PIPE (1 << 9) diff --git a/src/spawn-w32.c b/src/spawn-w32.c index e6ce28f..e7be33c 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -569,7 +569,6 @@ _gpgrt_process_spawn (const char *pgmname, const char *argv[], HANDLE hd_err[2]; int i; BOOL ask_inherit = FALSE; - BOOL allow_foreground_window = FALSE; struct gpgrt_spawn_actions act_default; if (!act) @@ -869,7 +868,7 @@ _gpgrt_process_spawn (const char *pgmname, const char *argv[], /* pi.hProcess, pi.hThread, */ /* (int) pi.dwProcessId, (int) pi.dwThreadId); */ - if (allow_foreground_window) + if ((flags & GPGRT_PROCESS_ALLOW_SET_FG)) { /* Fixme: For unknown reasons AllowSetForegroundWindow returns * an invalid argument error if we pass it the correct -- cgit v1.2.3