Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-10-14 13:21:55 +0400
committerCorinna Vinschen <corinna@vinschen.de>2003-10-14 13:21:55 +0400
commitdb3137ccb5d3c7499a665d17abf84cf523146cbf (patch)
treeb1b538b50fca9ff69e4706d3cd975a302fce0453 /winsup/cygwin/window.cc
parent2286046e474399b7d5a8ddd7b30ba96dd915a4e8 (diff)
* exceptions.cc (ctrl_c_handler): Don't send SIGHUP on
CTRL_LOGOFF_EVENT to processes running in invisible Windows Stations. * window.cc (has_visible_window_station): New function. * winsup.h: Add declaration for has_visible_window_station.
Diffstat (limited to 'winsup/cygwin/window.cc')
-rw-r--r--winsup/cygwin/window.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc
index ea9ed6e04..3f9462509 100644
--- a/winsup/cygwin/window.cc
+++ b/winsup/cygwin/window.cc
@@ -247,3 +247,23 @@ ualarm (useconds_t value, useconds_t interval)
return (otimer.it_value.tv_sec * 1000000) + otimer.it_value.tv_usec;
}
+bool
+has_visible_window_station (void)
+{
+ HWINSTA station_hdl;
+ USEROBJECTFLAGS uof;
+ DWORD len;
+
+ /* Check if the process is associated with a visible window station.
+ These are processes running on the local desktop as well as processes
+ running in terminal server sessions.
+ Processes running in a service session not explicitely associated
+ with the desktop (using the "Allow service to interact with desktop"
+ property) are running in an invisible window station. */
+ if ((station_hdl = GetProcessWindowStation ())
+ && GetUserObjectInformationA (station_hdl, UOI_FLAGS, &uof,
+ sizeof uof, &len)
+ && (uof.dwFlags & WSF_VISIBLE))
+ return true;
+ return false;
+}