Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!claris!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Re: Legal Tail Patches Message-ID: <26157@apple.Apple.COM> Date: 21 Feb 89 18:32:06 GMT References: <1285@ccnysci.UUCP> <10050076@accuvax.nwu.edu> Organization: Advanced Technology Group, Apple Computer Lines: 52 In article <10050076@accuvax.nwu.edu> bob@accuvax.nwu.edu (Bob Hablutzel) writes: > >Are Apple people the only people blessed to do come-from patches? Let us >assume, for the sake of argument, that I have an application which does >come-from patches (very carefully). Am I breaking the rules? By definition, a come-from patch means you are looking at the return address to decide whether to do something. In the System's case, these patches fix ROM bugs, and are hard wired with ROM addresses. If you want to do a similar thing, then you will have to hard-wire or somehow figure out what the desired come-from address is for each ROM. So if you are prepared to deal with different ROMs, then I suppose you can do a come-from patch. You are almost guaranteed not to work on new machines. The same cautions about any patch apply in this case. >Also, if I am not breaking the rules, I would really appreciate it if Apple >did not tail-patch. (gotcha!) I know of at least one: the _Open patch in MPW, >which seems to be concerned with having too many files open. Why couldn't this >be handled in a subroutine? This is MPW 3.0, btw, which I got with my TML II I don't know. One reason might be to support tools compiled for an earlier version of MPW. Presumably the MPW people talked to the System Software people and know what they are doing. MPW is not a typical application. It has to hook into the File Manager in several places to provide the appearance that files and windows are the same. It also sets up separate worlds for the tools it runs, etc. Plus the MPW people have the benefits of working for Apple. Doing any kind of patch is a risk, since there are many applications out there that have subtle bugs in them that patches may being out. (There are lots of programs out there that pass the wrong thing to MenuSelect, which screwed me up.) Anytime you want to write a patch you have to weigh the benefits vs. the risks. Some patches are riskier than others. As I said before, you should think carefully about what assumptions your patches are making, and how those assumptions may be violated in the future. The bottom line is that its your machine, and you can do whatever you want with it. A good example of this is my "sure-fire Tetris beating" INIT, which patches the _Random trap and returns the same value each time. (Tetris is much easier if all you get are straight pieces. :-)) Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr