Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!apple!portal!sv!news From: leonardr@svc.portal.com (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: RAM serial driver and event handling Message-ID: <1990Oct19.175524.17822@svc.portal.com> Date: 19 Oct 90 17:55:24 GMT References: <1990Sep20.143626.23475@midway.uchicago.edu> <10326@goofy.Apple.COM> <1990Sep24.000818.29952@svc.portal.com> <10749@goofy.Apple.COM> <1990Oct19.043030.27980@comp.vuw.ac.nz> Sender: news@svc.portal.com Reply-To: leonardr@svc.portal.com (Leonard Rosenthol) Organization: Software Ventures Corporation. Lines: 28 In article <1990Oct19.043030.27980@comp.vuw.ac.nz>, newbery@rata.vuw.ac.nz (Michael Newbery) writes: > 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 > IF > BTst(BOr(GetDCtlEntry(rAIn)^^.dCtlFlags,GetDCtlEntry(rAOut)^^.dCtlFlags),5) > THEN > { The A driver(s) are open } > Which is just fine, if your application is old fashioned and only knows how to address the modem and printer ports...However, any current application should be smart enough to know how to find (either hard coded or dynamically) other serial devices and drivers to open and work with - therefore making your suggestions useless. Bottom line is that the current Apple serial driver does not return an error when being opened by another application (ie a second time). If Apple would improve the serial driver, at least to the level of some of the third party drivers, it would REALLY HELP THINGS! -- Leonard Rosenthol Software Ventures Corp. MicroPhone II Development Team