home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15170 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.6 KB  |  65 lines

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