Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!rutgers!mephisto!prism!cc100aa From: cc100aa@prism.gatech.EDU (Ray Spalding) Newsgroups: comp.sys.mac.programmer Subject: Re: Crash recovery under MultiFinder Keywords: resume, system error, unexpectedly quit Message-ID: <5718@hydra.gatech.EDU> Date: 6 Feb 90 21:11:08 GMT References: <4413@vanuata.cs.glasgow.ac.uk> Reply-To: cc100aa@prism.gatech.EDU (Ray Spalding) Organization: Georgia Institute of Technology Lines: 40 In article <4413@vanuata.cs.glasgow.ac.uk> dunlop@cs.glasgow.ac.uk (Mark Dunlop) writes: >[...] Is there any way to [...] tell the system >to give me the good ole System Error dialogue rather than the MultiFinder >getting its paws on it and mucking up any crash recovery? [...] I asked a similar question a few months back, and the best answer I got was to patch ExitToShell(). This seems to work well under both Multi- and Unifinder. But note that your patch gets control under normal exit conditions as well as error conditions (unless you un-patch before exiting). The code I'm using (MPW C) looks like the following; perhaps someone more familiar with patching could comment if there are any potential problems with this code. #include #include #include pascal void resume_proc(); long sysExit; main() { /* ... */ sysExit = NGetTrapAddress(_ExitToShell,ToolTrap); NSetTrapAddress((long)resume_proc,_ExitToShell,ToolTrap); /* ... */ } pascal void resume_proc() { if (sysExit) { NSetTrapAddress(sysExit,_ExitToShell,ToolTrap); } /* clean up my mess ... */ ExitToShell(); } -- Ray Spalding, Office of Computing Services Georgia Institute of Technology, Atlanta Georgia, 30332-0275 uucp: ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!cc100aa Internet: cc100aa@prism.gatech.edu