Important: The information in this document is obsolete and should not be used for new development.
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 theShutDwnInstall
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 withShutDwnInstall
. See the description ofShutDwnInstall
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 constantssdOnDrivers
orsdOnUnmount
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.