public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Handling CTRL_LOGOFF_EVENT
@ 1999-02-19 10:36 Sergey Okhapkin
  1999-02-19 12:52 ` Curtis Galloway
  1999-02-28 23:02 ` Sergey Okhapkin
  0 siblings, 2 replies; 16+ messages in thread
From: Sergey Okhapkin @ 1999-02-19 10:36 UTC (permalink / raw)
  To: Curtis Galloway, cygwin

>I submitted a fix a while ago to the winsup module regarding bash hanging
when
>I rebooted my NT machine.  The problem was that the cygwin signal handler
was
>returning TRUE after receiving a CTRL_CLOSE_EVENT or CTRL_SHUTDOWN_EVENT
window
>event, so Windows thought that cygwin programs refused to exit when you
were


It's very important to _ignore_ (return TRUE) CTRL_LOGOFF_EVENT to not
terminate cygwin apps running as services on user's logoff!

Sergey Okhapkin, http://www.lexa.ru/sos
Piscataway, NJ



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <38172EB6.6F7DC9BA@pdi.com>]
* Re: Handling CTRL_LOGOFF_EVENT
@ 1999-02-19 13:18 Sergey Okhapkin
  1999-02-19 15:47 ` Curtis Galloway
  1999-02-28 23:02 ` Sergey Okhapkin
  0 siblings, 2 replies; 16+ messages in thread
From: Sergey Okhapkin @ 1999-02-19 13:18 UTC (permalink / raw)
  To: Curtis Galloway, cygwin

From my reading of the Microsoft documentation, a service won't be
terminated
>no matter what it returns for a CTRL_LOGOFF_EVENT message.  Does your
>experience indicate otherwise?
>


CTRL_LOGOFF_EVENT is sent to every running application including services.

Sergey Okhapkin, http://www.lexa.ru/sos
Piscataway, NJ



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Handling CTRL_LOGOFF_EVENT
@ 1999-02-19  9:27 Curtis Galloway
  1999-02-28 23:02 ` Curtis Galloway
  0 siblings, 1 reply; 16+ messages in thread
From: Curtis Galloway @ 1999-02-19  9:27 UTC (permalink / raw)
  To: cygwin

I submitted a fix a while ago to the winsup module regarding bash hanging when
I rebooted my NT machine.  The problem was that the cygwin signal handler was
returning TRUE after receiving a CTRL_CLOSE_EVENT or CTRL_SHUTDOWN_EVENT window
event, so Windows thought that cygwin programs refused to exit when you were
shutting down the system.  This resulted in Windows popping up a dialog box for
every open bash window asking if you wanted to kill the program.

That particular problem was fixed, but the problem still occurs if you log out
rather than shutting down the machine.  I have enclosed a patch below, which I
have been using for some time with no problems.

I haven't tested with programs that act as NT services, though, and I'm unsure
what the consequences of this change would be to such a program.  Anyone
writing NT services out there?

--Curtis



*** exceptions.cc.00    Fri Dec 04 04:35:03 1998
--- exceptions.cc       Wed Jan 27 15:45:54 1999
***************
*** 534,540 ****
    BOOL ret;

    if (type == CTRL_LOGOFF_EVENT)
!     return 1;

    if ((type == CTRL_CLOSE_EVENT) || (type == CTRL_SHUTDOWN_EVENT))
      /* Return FALSE to prevent an "End task" dialog box from appearing
--- 534,540 ----
    BOOL ret;

    if (type == CTRL_LOGOFF_EVENT)
!     return FALSE;

    if ((type == CTRL_CLOSE_EVENT) || (type == CTRL_SHUTDOWN_EVENT))
      /* Return FALSE to prevent an "End task" dialog box from appearing

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1999-10-31 19:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-19 10:36 Handling CTRL_LOGOFF_EVENT Sergey Okhapkin
1999-02-19 12:52 ` Curtis Galloway
1999-02-28 23:02   ` Curtis Galloway
1999-02-28 23:02 ` Sergey Okhapkin
     [not found] <38172EB6.6F7DC9BA@pdi.com>
1999-10-28  7:12 ` Tom Rodman
1999-10-31 19:54   ` Tom Rodman
  -- strict thread matches above, loose matches on Subject: below --
1999-02-19 13:18 Sergey Okhapkin
1999-02-19 15:47 ` Curtis Galloway
     [not found]   ` < 36CDF573.361DC410@pdi.com >
1999-02-19 17:24     ` Christopher Faylor
1999-02-28 23:02       ` Christopher Faylor
1999-02-28 23:02   ` Curtis Galloway
1999-10-27  5:42   ` Tom Rodman
1999-10-31 19:54     ` Tom Rodman
1999-02-28 23:02 ` Sergey Okhapkin
1999-02-19  9:27 Curtis Galloway
1999-02-28 23:02 ` Curtis Galloway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).