home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!haven.umd.edu!ames!data.nas.nasa.gov!taligent!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: Patching the _Launch Trap
- Message-ID: <BuA3vu.97H@taligent.com>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <1992Sep8.024049.20121@Arco.COM> <abrn6k+.leonardr@netcom.com>
- Date: Tue, 8 Sep 1992 21:33:29 GMT
- Lines: 53
-
- In article <abrn6k+.leonardr@netcom.com>, leonardr@netcom.com (Leonard
- Rosenthol) writes:
- >
- > In article <1992Sep8.024049.20121@Arco.COM> John Champion <dedjhc@arco.com>
- writes:
- > >Hi all,
- > >I'm trying to install a fairly unobtrusive head patch into the _Launch
- > >trap. The problem is that no matter what I do, my patch always gets
- > >re-patched (presumeably by the system). This unknown code does not pass
- > >control down the line like a normal patch would, so my code never gets
- > >called.
- > >
- > Welcome to the wonderful world of "protected patches". This is a
- > new trick in System 7 to make sure that programmers don't "screw up" system
- > patches. It basically means that it is near impossible to patch such a trap.
- >
-
- The problem with patching _Launch is not that it's protected. You can patch
- protected patches; you just won't be the first in the chain when you're done.
-
- The problem with patching _Launch is that it is patched after INIT time, and
- doesn't call the original trap. You'd have the same problem with other traps as
- well, notably Window Manager traps.
-
-
- In article <1992Sep8.145100.26889@Arco.COM> John Champion <dedjhc@arco.com>
- writes:
- >In article <abrn6k+.leonardr@netcom.com> Leonard Rosenthol,
- >leonardr@netcom.com writes:
- >>
- >> If you could post what you are trying to accomplish by patching _Launch
- >>someone could probably suggest an alternate approach that would be
- >successful.
- >
- >I need FSSpec type information on applications and associated documents
- >that are launched, particularly by the finder. Unfortunately, not all
- >applications accept apple events so I can't just check for those.
- >
-
- I do something like this. I patch InitGraf right now, but I'm considering a
- scheme where I patch InitAllPacks, instead. The problem with patching InitGraf
- is in determining if the call is being made from the start of an application.
- Some InitGraf calls are made from INITs at INIT time (by ShowINIT, for example);
- some applications call InitGraf more than once (applications written with THINK
- Pascal are common "offenders"); and CE Toolbox calls InitGraf at shutdown time
- under certain circumstances. If you patch InitGraf, you'll have to look out for
- all these cases.
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-