Path: utzoo!attcan!uunet!olivea!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Whaddya do in ioCompletion routine? Keywords: ioCompletion Asynchronous Message-ID: <49791@apple.Apple.COM> Date: 2 Mar 91 01:37:58 GMT References: <63044@bbn.BBN.COM> Distribution: comp Organization: Apple Computer Inc., Cupertino, CA Lines: 27 In article <63044@bbn.BBN.COM> rmitchel@bbn.com (Rob Mitchell) writes: > > So, I'm writing all this AppleTalk Preferred Interface call, > post a few GetRequest asynchronously, and wait. > > Well, when the ioCompletion routine is called by Device Mgr., > what do I do? I know I have to SetupA5() and RestoreA5() and > call some a self-created function in the middle, but what does > that buy me? Which Parameter Block is being returned by the > Device Mgr. and how can I access it with "moving memory?" Completion routines are called when an asynchronous driver request completes (hence the name). The completion routine is passed a pointer to the parameter block from the completing request. The completion routine is most likely being called at an interrupt level, so all the rules about not moving memory apply (i.e., don't call any Toolbox, Quickdraw, etc., routines). So what does it buy you? Well, you can modify program variables if you want, or daisy-chain another request based on whether or not the current request completed successfully, or... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen Never hit a man with glasses. stevec@apple.com Hit him with a baseball bat.