Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Locking executable resources Message-ID: <1632@internal.Apple.COM> Date: 2 May 89 18:31:46 GMT References: <4170@druco.ATT.COM> Sender: usenet@Apple.COM Distribution: comp Organization: Objects-R-Us, Apple Computer, Inc. Lines: 22 In article <4170@druco.ATT.COM> jon@druco.ATT.COM (GotowJK) writes: > The dilemma is that this occurs because _somebody else's_ INIT resource > is not locked, and I can't control that. This seems to be major > problem - or am I missing something? An important rule in patching traps is that your patch code has to be at least as careful as the trap being patched with respect to allocating memory and saving registers. If the trap you are patching does not allocate memory, then your patch can't either. Your patch has to save at least the registers that the original patch saves. (This is especially important when patching the Resource Manager, since it saves more than the usual set of registers.) In your case, InitGraf doesn't allocate memory, but SysBeep does. So technically, you are "in the wrong." (On the other hand, those INIT should be locking themselves down.) Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1