[comp.sys.mac.programmer] GetResource failure during ShutDown procedure

ma199at@sdcc6.ucsd.edu (L J Cris) (12/24/89)

Is there something special to loading resources during a shutdown proc?
I was trying to load a 'snd ' resource during a routine installed by
ShutDwnInstall and I always got a ResErr of -204, resProblem.

Is there a way to get around this?

Thanks is advance, and Merry Cristmas!
-Cris Rys 

urlichs@smurf.ira.uka.de (12/30/89)

In comp.sys.mac.programmer ma199at@sdcc6.ucsd.edu (L J Cris) writes:
< Is there something special to loading resources during a shutdown proc?
< I was trying to load a 'snd ' resource during a routine installed by
< ShutDwnInstall and I always got a ResErr of -204, resProblem.
< 
Your problem is that you installed your shutdown proc with
sdOnRestart/sdOnShutdown.
At that point, all volumes are unmounted and there isn't any hard disk you can
get your resource from.

< Is there a way to get around this?
< 
Use a procedure installed w/ sdOnUnmount to read the resource, store its
handle somewhere convenient, then use that later.

General Hint #1243: If you want to put up a dialog box allowing to _cancel_
the shutdown, you'll have to patch _Shutdown. (Jump to the original code to
continue, return to abort.) Calling _ExitToShell from within the shutdown
procedure (the way TOPS does) crashes your Mac.
-- 
Matthias Urlichs