Xref: utzoo comp.sys.amiga.tech:3433 comp.sys.amiga:28370 Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!rochester!rutgers!apple!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: FixReq -- a FIX for NAUGHTY PROGRAMS that don't set pr_WindowPtr Summary: A NAUGHTY FIX Message-ID: <10492@well.UUCP> Date: 26 Jan 89 08:52:48 GMT References: <3747@crash.cts.com> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: MTV (Mostly Terrible Videos) Lines: 31 Quote: "Logic is wreath of pretty flowers, which smell *bad*." -- Spock In article <3747@crash.cts.com> billk@pnet01.cts.com (Bill W. Kelly) writes: >There are many programs that open custom screens; there are few programs that >set pr_WindowPtr to point to their window. [ ... ] > >FixReq solves this problem by patching AutoRequest() to substitute >IntuitionBase->ib_ActiveWindow in place of whatever window pointer was passed >to AutoRequest(). > JimM will probably toast you for this. What happens if the Window pointed to by ib_ActiveWindow goes away while you're still busy putting up the requester? Your task could switch out just long enough for the active Window's owner to CloseWindow() it out from under your feet. This is Very Bad. Also, LockIBase() won't help you here. In order to keep the Window from going away, you have to hold on to the IntuitionBase lock long enough to get your AutoRequester up. However, in order to get the AutoRequester up, Intuition needs to lock IntuitionBase. Deadlock. Also Very Bad. >It works nicely. > I'll bet it will break in a big way if you stress-test it. Caveat Emptor. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape INET: well!ewhac@ucbvax.Berkeley.EDU \_ -_ Recumbent Bikes: UUCP: pacbell > !{well,unicom}!ewhac O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack") "Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor