[ros-kernel] Shutdown/logoff

Ge van Geldorp gvg at reactos.com
Sat Jul 3 18:15:37 CEST 2004


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
- 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
- If ExitWindowsEx() was called with EWX_LOGOFF a new login session is
started
- 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 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.





More information about the Ros-kernel mailing list