Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!wuarchive!zaphod.mps.ohio-state.edu!usc!ucsd!dog.ee.lbl.gov!ux5.lbl.gov!beard From: beard@ux5.lbl.gov (Patrick C Beard) Newsgroups: comp.sys.mac.programmer Subject: Re: patching globally after MF Keywords: MultiFinder trap patch Message-ID: <7263@dog.ee.lbl.gov> Date: 27 Sep 90 19:44:14 GMT References: <20695@well.sf.ca.us> Sender: usenet@dog.ee.lbl.gov Reply-To: beard@ux5.lbl.gov (Patrick C Beard) Distribution: comp Organization: Berkeley Systems, Inc. Lines: 31 X-Local-Date: Thu, 27 Sep 90 12:44:14 PDT In article <20695@well.sf.ca.us> gurgle@well.sf.ca.us (Pete Gontier) writes: #I need to monitor NewWindow. # #MultiFinder seems to be patching NewWindow and *replacing* it. Thus, a patch I #install at INIT time never gets called. # #A patch to NewWindow I install at the time of the first GetNextEvent affects #only the Finder (or the startup application) even if my patch code lives in #the System Heap. # #I patched OpenResFile and waited for something other than MultiFinder to be #opened. But by that time, MF has monkeyed with SetTrapAddress enough that the #trap dispatcher gets confused and blows up. # #Anybody got any secrets about patching after MultiFinder? 1. In your INIT, get the address of SetTrapAddress. 2. Patch InitGraf, or some other trap that all app's use. 3. When MF runs Finder, apply your other patches with the REAL SetTrapAddress that you've saved. This will bypass the SetTrapAddress MF installs. This works, I've tried it, although I can't guarantee that it is safe. I just know I've tried it. Good luck! -- ------------------------------------------------------------------------------- - Patrick Beard, Macintosh Programmer (beard@lbl.gov) - - Berkeley Systems, Inc. "..............Good day!" - Paul Harvey - -------------------------------------------------------------------------------