[comp.sys.mac.programmer] While we're discussing patches...

ejd@iris.brown.edu (Ed Devinney) (11/07/89)

Hi folks -

   In prototyping some desktop extensions here we've written a set of 
patches to the Window Manager which override some standard window 
behavior.  We'd like to permanently install them so that our new window 
behavior is system-wide, preferably via an init.  The init is very simple: 
it reads in our patches (saved as code resources), places them in the 
system heap, stores the 'standard' trap address where the patch can find 
it (actually in the patch's LSC CODE-resource header), and calls 
SetTrapAddress().  Very basic, and following along in TMON shows that the 
patches are actually being installed correctly.  However, TMON also shows 
someone (the Finder, probably) setting a whole bunch of trap addresses 
after the inits have run; many of these traps are the same Window Mgr 
traps that we wish to override, and we're getting bulldozed.
  IM v5 sez PTCH resources run before INITs - INITs are the last thing to 
run before the finder.  I'd prefer not to have to pound through the finder 
with _dumpcode_  or patch the Finder itself, but that's about what's left. 
 
   Now, we can't use an application to set the new traps, as MoFo finder 
apparently swaps trap tables between apps so they can have their own 
overrides.  Any idea why the OS is patching these traps after the 
INIT-stage?
    I've exhausted my local sources of information...any takers?

Thanks very much,

ed


++++++
ed devinney, IRIS/Brown University, Providence, RI...ejd@iris.brown.edu
-- "It's Bread and Circuses, y'all" --

mnkonar@gorby.SRC.Honeywell.COM (Murat N. Konar) (11/08/89)

In article <19954@brunix.UUCP> ejd@iris.brown.edu (Ed Devinney) writes:
[he's trying to patch the window manager]
>patches are actually being installed correctly.  However, TMON also shows 
>someone (the Finder, probably) setting a whole bunch of trap addresses 
>after the inits have run; many of these traps are the same Window Mgr 
>traps that we wish to override, and we're getting bulldozed.

I suspect MultiFinder is patching those traps but your traps should
get called eventually, mine do :) .  If you are trying to completely 
patch out the old routines, good luck (see related thread on tail 
patches).  

____________________________________________________________________
Have a day. :^|
Murat N. Konar        Honeywell Systems & Research Center, Camden, MN
mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)