Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!sdd.hp.com!wuarchive!uunet!comp.vuw.ac.nz!newbery From: newbery@rata.vuw.ac.nz (Michael Newbery) Newsgroups: comp.sys.mac.programmer Subject: Re: RAM serial driver and event handling Message-ID: <1990Oct19.043030.27980@comp.vuw.ac.nz> Date: 19 Oct 90 04:30:30 GMT References: <1990Sep20.143626.23475@midway.uchicago.edu> <10326@goofy.Apple.COM> <1990Sep24.000818.29952@svc.portal.com> <10749@goofy.Apple.COM> Sender: news@comp.vuw.ac.nz (News Admin) Organization: Computing Serv. Ctr, Victoria Uni., Wellington, New Zealand Lines: 27 Nntp-Posting-Host: rata.vuw.ac.nz In article <10749@goofy.Apple.COM> han@Apple.COM (Byron Han, scapegoat) writes: >In article <1990Sep24.000818.29952@svc.portal.com> leonardr@svc.portal.com writes: >> How would you recommed that you check for 'already open'? I can't > >You might want to check the driver unit table and check the driver flags >to see if the driver has already been opened... there is a routine in the >7.0 version of the Comm Rsrc Mgr called CRMIsDriverOpen() which does this... And the following code (in Pascal) does the job now CONST { refNums of .AIn etc } rAIn = -6; rAOut = -7; rBIn = -8; rBOut = -9; IF BTst(BOr(GetDCtlEntry(rAIn)^^.dCtlFlags,GetDCtlEntry(rAOut)^^.dCtlFlags),5) THEN { The A driver(s) are open } Reference: IM II-190 "The Device Manager---The Structure of a Device Driver" -- Michael Newbery Nunc est bibendum Horace Od I xxxvii 1