Commit 13f9461e authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

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

parent 608aa7f3
...@@ -48,6 +48,20 @@ int msgbox_res_id(HWND hwnd, UINT textid, UINT captionid, UINT type) ...@@ -48,6 +48,20 @@ int msgbox_res_id(HWND hwnd, UINT textid, UINT captionid, UINT type)
return IDCANCEL; return IDCANCEL;
} }
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) static WCHAR *get_program_name(HANDLE hProcess)
{ {
WCHAR image_name[MAX_PATH]; WCHAR image_name[MAX_PATH];
...@@ -362,7 +376,7 @@ int display_crash_dialog(void) ...@@ -362,7 +376,7 @@ int display_crash_dialog(void)
/* dbg_curr_process->handle is not set */ /* dbg_curr_process->handle is not set */
HANDLE hProcess; HANDLE hProcess;
if (!DBG_IVAR(ShowCrashDialog)) if (!DBG_IVAR(ShowCrashDialog) || !is_visible())
return TRUE; return TRUE;
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dbg_curr_pid); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dbg_curr_pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment