Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 8 - Shutdown Manager / The Shutdown Process


Checking for Open Device Drivers

After locating any custom shutdown procedures, ShutDwnPower checks the Device Manager's unit table to determine whether any device drivers or desk accessories are open. It also inspects the dNeedGoodBye bit in the drvrFlags word for each driver. This bit, if set, indicates that the driver requests notification when the application heap is reinitialized or the system shuts down. Accordingly, ShutDwnPower calls the driver's Control function with the csCode field set to -1 (the goodBye global constant). This notification of impending termination is called a good-bye message.

A driver in an application heap also receives a good-bye message every time an application quits. For this reason, the driver cannot always determine whether a good-bye message means that the system is about to shut down. If making this distinction is important, you can call ShutDwnInstall to install a simple procedure that informs your driver when the computer is about to shut down. For more information about the drvrFlags word and the Control function, see the chapter "Device Manager" in Inside Macintosh: Devices.

The ShutDwnPower procedure does not actually close the drivers. They stay open until the power is switched off.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996