Subject: Problem with winsup CTRL_LOGOFF_EVENT handler
From: [email-masked] (Curtis Galloway)

23 Mar 1998 23:12:08 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

The exception handler that deals with the Win32 events CTRL_LOGOFF_EVENT,
CTRL_SHUTDOWN_EVENT and CTRL_CLOSE_EVENT seems to not quite do the right
thing.  When shutting down my NT 4.0 system, I get a dialog box for each open
bash window asking me if I want to kill the process or wait for it to shut
down.

This happens because the winsup handler function returns TRUE, which,
according to the MS documentation, signals the OS to bring up this dialog box.

However, if the handler returns FALSE, Win32 will call the other registered
handlers for the event, and the default handler terminates the process, which
may not be what you want.

The doc goes on to say that you can use the SetProcessShutdownParameters
function to prevent the dialog box from being displayed.

My question to the Win32 experts is this: is it better to have the handler
return FALSE, or to use SetProcessShutdownParameters?

--Curtis Galloway
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".