[ros-kernel] Shutdown/logoff
Thomas Weidenmueller
thomas at reactsoft.com
Sat Jul 3 20:03:15 CEST 2004
Ge van Geldorp wrote:
>I want to implement proper logoff/shutdown/restart, i.e ExitWindowsEx()
>but I'm not sure exactly how it's supposed to work. This is what I think
>happens:
>
>- App (usually explorer) calls ExitWindowsEx()
>- ExitWindowsEx() sends a message to CSRSS
>- CSRSS sends all top-level windows WM_QUERYENDSESSION and WM_ENDSESSION
>messages with timeout
>
>
But before this is done, winlogon sends a SAS event to msgina, asking
for permission (e.g. if the required rights are granted) to proceed
>- WinLogon notices the shell terminated and asks CSRSS about the
>ExitWindowsEx() options
>- If CSRSS replies that ExitWindowsEx() was not called at all, WinLogon
>restarts a new shell
>
>
afaik that can't happen. the SAS event may be denied, but in this case
the messages shouldn't even have sent out and the shell shouldn't have
been terminated (imo)
>- If ExitWindowsEx() was called with EWX_LOGOFF a new login session is
>started
>
>
exactly, winlogon sends the SAS event (to display the "press
ctrl+alt+del"), don't remember it's name atm. winlogon then waits for
msgina until msgina sends a SAS event to login. AFAIK msgina does the
actual login procedure, winlogon just reacts and responds to SAS events.
>- else we need to shutdown/reboot, WinLogon does this by calling
>NtShutdownSystem
>
>Is my global picture correct? Who terminates stubborn processes which
>won't die, is that handled by CSRSS or by WinLogon?
>
I believe it's rather CSRSS, these app termination dialogs however are
displayed by CSRSS, so i guess CSRSS also handles hung processes
>I assume CSRSS sends
>the WM_QUERYENDSESSION and WM_ENDSESSION messages from a new thread, so
>ExitWindowsEx() can complete?
>
>Thanks for any insights, Gé van Geldorp.
>
>
>
>_______________________________________________
>Ros-kernel mailing list
>Ros-kernel at reactos.com
>http://reactos.com/mailman/listinfo/ros-kernel
>
>
>
>
More information about the Ros-kernel
mailing list