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 / Shutdown Manager Reference
Application-Defined Routine / Shutdown Procedures


MyShutDownProc

A typical shutdown procedure has the following form:

PROCEDURE MyShutDownProc;
DESCRIPTION
You can install the address of your shutdown procedure in the Shutdown Manager's queue by calling the ShutDwnInstall procedure. When the computer restarts or shuts down, the Shutdown Manager searches its queue, reads the addresses it finds there, and executes the procedures at the points specified by the shutdown flag or flags that you passed with ShutDwnInstall. See the description of ShutDwnInstall on page 8-13 for details.

To remove your shutdown procedure, call the ShutDwnRemove routine, passing it a pointer to your procedure.

Be sure to install your shutdown procedure in the system heap. Because the Process Manager deallocates memory for all application heaps before the Finder calls ShutDwnPower, you can't rely on the application heap being intact. In addition, if you need to use Toolbox managers, specify the constants sdOnDrivers or sdOnUnmount to ensure that your procedure is executed while these managers are still available.

ASSEMBLY-LANGUAGE INFORMATION
The Shutdown Manager conforms with the standard assembly-language conventions for saving registers. The Shutdown Manager does not preserve the contents of these registers. Therefore, be sure to save and restore the data and address registers before issuing a jump instruction to your shutdown procedure.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996