Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!att!poseidon!ech From: ech@poseidon.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Multifinder: how do I patch GetNextEvent? Message-ID: <529@poseidon.ATT.COM> Date: 14 Oct 88 16:21:41 GMT References: <749@ttrdf.UUCP> Organization: AT&T Bell Laboratories, Lincroft, NJ Lines: 31 In article <10050022@eecs.nwu.edu> bob@eecs.nwu.edu (Bob Hablutzel) writes: ! What is the proper way to patch the GetNextEvent() trap for ! compatibility with MultiFinder?... In article <2453@spray.CalComp.COM>, anson@spray.CalComp.COM (Ed Anson) says: ! The problem here is that you have written a "tail patch"... ! forbidding a very useful type of patch? From article <749@ttrdf.UUCP>, by fjo@ttrdf.UUCP (Frank Owen ): ! ...There is this ! low-memory global called "jGNEfilter" which points to a filter routine ! that GNE will jump to prior to returning. When GNE jumps to this address, ! register A1 contains a pointer to the EventRecord. ! I have changed my INIT so that now it no longer patches GetNextEvent, ! but rather "inserts" code to be executed just before the jGNEfilter ! routine. The address of my code is inserted into the low-memory ! global, and when I'm done mangling the EventRecord, my routine jumps to ! the address that had been there prior to my patch. simple. And it works. ! I think tech-note #85 spells out all the rules for this. I don't have ! that particuliar note, but if anyone on the net does, I'd appreciatte it ! if you'd send me a copy. I'd like to abide by the rules if at all possible. You've got it exactly right, Frank: the only detail is to make sure you set the Boolean result at 4(sp) to TRUE if you replace a null event with one you created (or to FALSE if you "eat" a non-null event that would otherwise be returned). I'll send a copy of TN 85 in the BTL mail; look for it around Christmas... =Ned Horvath=