Important: The information in this document is obsolete and should not be used for new development.
Chapter 8 - Shutdown Manager
This chapter describes the Shutdown Manager, the part of the Operating System that manages the final stages of shutting down or restarting a Macintosh computer. The Shutdown Manager allows you to install a custom procedure that is executed during the process of shutting down or restarting. You can also use the Shutdown Manager to restart or shut down the computer directly, although this practice is strongly discouraged.
Read the information in this chapter if your application or other software component needs to intervene in the standard process of shutting down or restarting the computer. In general, applications do not need to intervene in this process. You are likely to use the Shutdown Manager only if you are designing a device driver or system extension requiring notification that the computer is about to be shut down or restarted.
- WARNING
- For reasons described later, you should avoid shutting down or restarting the computer directly except in an emergency (for instance, when data on the disk might be destroyed). If you need to restart or shut down the system, send a Shutdown or Restart event to the Finder, as described in "Sending a Shutdown or Restart Event" on page 8-7. ·
If you want to install a custom shutdown procedure, you should know how to install a code segment into the system heap, as described in the chapter "Memory Manager" in Inside Macintosh: Memory. If you want to shut down or restart the computer and need to familiarize yourself with the process of sending Apple events, see the chapter "Apple Event Manager" in Inside Macintosh: Interapplication Communication.
This chapter begins with a description of the Shutdown Manager and of the typical shutdown or restart process. Then it describes how you can
- use Apple events to request that the system be shut down or restarted
- install a custom shutdown procedure to be executed during the shutdown or
restart process- remove a shutdown procedure that you have previously installed
Chapter Contents
- About the Shutdown Manager
- The Shutdown Process
- Closing Open Applications
- Checking for Custom Shutdown Procedures
- Checking for Open Device Drivers
- Saving the Desk Scrap
- Unmounting Volumes
- Turning Off the Computer
- Using the Shutdown Manager
- Sending a Shutdown or Restart Event
- Installing a Custom Shutdown Procedure
- Shutdown Manager Reference
- Shutdown Manager Routines
- Shutting Down or Restarting a Macintosh Computer
- Installing or Removing a Shutdown Procedure
- Application-Defined Routine
- Shutdown Procedures
- Summary of the Shutdown Manager
- Pascal Summary
- Constants
- Shutdown Manager Routines
- Shutting Down or Restarting the Computer
- Installing or Removing a Shutdown Procedure
- Application-Defined Routine
- Shutdown Procedures
- C Summary
- Constants
- Data Types
- Shutdown Manager Routines
- Shutting Down or Restarting the Computer
- Installing or Removing a Shutdown Procedure
- Application-Defined Routine
- Shutdown Procedures
- Assembly-Language Summary
- Constants
- Trap Macros Requiring Routine Selectors