=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: winedbg: Check for visible window station before displaying crash dialog.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 03:49:16 CDT 2018


Module: wine
Branch: stable
Commit: 716dc2fcd057ad805db8fc18715c7fefa4d42c2b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=716dc2fcd057ad805db8fc18715c7fefa4d42c2b

Author: André Hentschel <nerv at dawncrow.de>
Date:   Fri Jul 13 19:49:40 2018 +0200

winedbg: Check for visible window station before displaying crash dialog.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35928
Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 13f9461e99398f4080bf0fdd68a03f57a5427002)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 programs/winedbg/crashdlg.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/programs/winedbg/crashdlg.c b/programs/winedbg/crashdlg.c
index 4e02a4b..d7059e6 100644
--- a/programs/winedbg/crashdlg.c
+++ b/programs/winedbg/crashdlg.c
@@ -43,6 +43,20 @@ int msgbox_res_id(HWND hwnd, UINT textId, UINT captionId, UINT uType)
     return MessageBoxW(hwnd, text, caption, uType);
 }
 
+static BOOL is_visible(void)
+{
+    USEROBJECTFLAGS flags;
+    HWINSTA winstation;
+
+    if (!(winstation = GetProcessWindowStation()))
+        return FALSE;
+
+    if (!(GetUserObjectInformationA(winstation, UOI_FLAGS, &flags, sizeof(flags), NULL)))
+        return FALSE;
+
+    return flags.dwFlags & WSF_VISIBLE;
+}
+
 static WCHAR *get_program_name(HANDLE hProcess)
 {
     WCHAR image_name[MAX_PATH];
@@ -358,7 +372,7 @@ int display_crash_dialog(void)
     /* dbg_curr_process->handle is not set */
     HANDLE hProcess;
 
-    if (!DBG_IVAR(ShowCrashDialog))
+    if (!DBG_IVAR(ShowCrashDialog) || !is_visible())
         return TRUE;
 
     hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dbg_curr_pid);




More information about the wine-cvs mailing list