When a shutdown is initiated, the Shutdown thread is created on the Shell process. The Shutdown thread closes all running applications in the system. The Shutdown thread creates a PM message queue. It broadcasts to all applications a message instructing them to save their data, initiates the closing of all open folders, and so on.
Each child process of the Shell process will send a WM_APPTERMINATENOTIFY to the Shell process when it goes away. Unless a shutdown is in effect, when the Shell process receives such notification for the Workplace process, it will restart the Workplace process.