Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!jarvis.csri.toronto.edu!neat.ai.toronto.edu!dudek From: dudek@ai.toronto.edu (Gregory Dudek) Subject: Re: Patching Trap Calling under Multifinder Message-ID: <88Jun30.162844edt.539@neat.ai.toronto.edu> Keywords: patch trap multifinder Organization: University of Toronto, AI group References: <1988Jun22.111251.394@mntgfx.mentor.com> <4778@hoptoad.uucp> Date: Thu, 30 Jun 88 15:08:30 EDT In article <4778@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >In article <1988Jun22.111251.394@mntgfx.mentor.com> tomc@mntgfx.mentor.com >(Tom Carstensen) writes: > >>Here's a repost of my original posting: >>> What I'm trying to do is patch _DrawMenuBar, to >>> call a routine that simply sets a global flag, and then >>> calls the actual _DrawMenuBar. >> >>> This works great NOT using Multifinder, but BOOM/Crash >>> under Multifinder. >> >>> I tried restoring/installing the patch on suspend/resume >>> events, but it still crashed. >> >>> What can and can't I do?? > >What you can't do is patch traps and assume that A5 is the same inside the >patch. This is explicitly stated in one of the technical notes (I don't >remember the number, but I believe the title was "Don't Use Register A5 >Inside Trap Patches", originally enough.) If you want access to your A5, >you will have to manage it yourself, and be sure to set it back to what the >system passed you when you return. > I am pretty sure that *IF* you de-install your patch on suspend events (and make sure you don't miss one), you can get your A5 value from the global "CurrentA5". You have to be extra careful with patchs that could get called from interrupt routines, but the one you want isn't one of those. A question I was wondering about, however, is how to install a permanent patch while running under MultiFinder. As far as I know, MF rips out your patches when the task ends. The MF developer's package doesn't address this either, so any help would be appreciated. (I am fearing it's impossible) Greg Dudek -- Dept. of Computer Science (vision group) University of Toronto Nice mailers: dudek@ai.utoronto.ca UUCP: {uunet,decvax,linus,pyramid, dalcs,watmath,garfield,ubc-vision,calgary}!utai!dudek ARPA: user%ai.toronto.edu@relay.cs.net