Message_PreQuit ? (and how to tell if the machine is actually being shut down)
Rick Murray (539) 13840 posts |
Is there an issue with Message_PreQuit? I have a module task (in Module space, not paged) which is set to claim messages &8 (PreQuit) and &400C3 (TaskCloseDown). Message Quit is always received. I’m just not seeing any PreQuit. I have tried passing the indicated message list, and also passing a null list (for all messages). When I click to Quit my application from the task manager, I only get the message Quit, no PreQuit. Additionally, is it possible to detect when a system shutdown has started? I can’t reliably use the Service_Shutdown service call as it can be claimed which means the shutdown could be aborted after I have seen it. I’m doing my shutdown on the ShutdownComplete message, which isn’t ideal to tidy up after the shutdown process… |
Chris Evans (457) 1614 posts |
The sources for shutdown on the Iyonix may be enlightening! |
Rick Murray (539) 13840 posts |
Oh. Duh. After looking at the Switcher sources, it dawned on me that PreQuit is an ack message, so is Wimp poll 18, not 17. That’s why I wasn’t seeing it. It also appears that it isn’t directly possible to determine if the machine is being shut down. The goshutdown code will broadcast the Shutdown service call and if this is claimed by something it’ll bail. If it isn’t claimed, we pass to the goexit code, and then through a convoluted process that appears to be telling everything to Quit (including Switcher itself), the shutdown progresses until we finally hit the tail end at doshutdown. This sets some state and “does stuff”, part of which is the Service_ShutDownComplete service call. There doesn’t appear to be any sort of “DoingShutdown” service call once the shutdown actually begins (and is not aborted). Hmmm… |