* 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.
This commit is contained in:
Corinna Vinschen
2003-10-14 09:21:55 +00:00
parent 2286046e47
commit db3137ccb5
4 changed files with 46 additions and 5 deletions

View File

@@ -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;
}