Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pacbell!att!ttrdc!ttrde!ttrdf!fjo From: fjo@ttrdf.UUCP (Frank Owen ) Newsgroups: comp.sys.mac.programmer Subject: Re: How to do a LEGAL tail-patch Message-ID: <875@ttrdf.UUCP> Date: 16 Feb 89 17:17:56 GMT References: <1272@ccnysci.UUCP> Organization: AT&T, Skokie, IL Lines: 22 in article <1272@ccnysci.UUCP>, alexis@ccnysci.UUCP (Alexis Rosen) says: > > Procedure MyPatch > SetTrapAddress to original trap address > Trap to original trap using A-line instruction > SetTrapAddress back to @MyPatch (&MyPatch for C people) > Fixup stack and return Nope, Nope, Nope. This won't work. If the trap you are patching looks at what routine has called it by examining the return address on the stack, (Multifinder's GetNextEvent does this), it will appear as if only one routine (your patch) has ever called it. This may screw up the normal functioning of the original trap. (It would screw up Multifinder's GNE, for example.) -- Frank Owen (fjo@ttrdf) 312-982-2182 AT&T Bell Laboratories 5555 Touhy Ave., Skokie, IL 60077 PATH: ...!att!ttrdf!fjo