Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!usc!ucsd!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Opening Drivers Message-ID: <9310@hoptoad.uucp> Date: 16 Dec 89 22:50:00 GMT References: <7421@hubcap.clemson.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 27 In article <7421@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >First, I know that there are a certain number of "slots" for use by >drivers and da's. Does my driver have to be numbered as one of those >slots? For instance, I am opening the driver from an INIT and the driver >will continue to run in the background while the machine is running. Am >i going to have to look thru the system file at boot time to see if there >is an empty slot, renumber my driver and then open it? Close. Check the unit table, not the system file. Walk over the unit table in a way similar to that of Tech Note #71. Look for an empty DCE entry. You may then install yourself as the driver with the reference number corresponding to the empty slot. Use the _DrvrInstall trap documented in Tech Note #108. >I read the device >manager stuff but am still confused on this point. My guess is that the >refNum passed by OpenDriver() will give me the slot i am in. Is this correct? It doesn't give you the slot number, but it gives you a reference number from which the slot number can readily be derived; the slot number is -1 * (refNum + 1). -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Those who restrain desire, do so because theirs is weak enough to be restrained..." - Blake, "The Marriage of Heaven and Hell"