diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-10-14 09:21:55 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-10-14 09:21:55 +0000 |
commit | db3137ccb5d3c7499a665d17abf84cf523146cbf (patch) | |
tree | b1b538b50fca9ff69e4706d3cd975a302fce0453 /winsup/cygwin/window.cc | |
parent | 2286046e474399b7d5a8ddd7b30ba96dd915a4e8 (diff) | |
download | newlib-db3137ccb5d3c7499a665d17abf84cf523146cbf.zip newlib-db3137ccb5d3c7499a665d17abf84cf523146cbf.tar.gz newlib-db3137ccb5d3c7499a665d17abf84cf523146cbf.tar.bz2 |
* 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.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index ea9ed6e..3f94625 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; +} |