Important: The information in this document is obsolete and should not be used for new development.
DriverInstall
You can use theDriverInstall
function to create a device control entry and install it in the unit table.
pascal OSErr DriverInstall(Ptr drvrPtr, short refNum);
drvrPtr
- A pointer to the device driver.
refNum
- The driver reference number.
DESCRIPTION
TheDriverInstall
function allocates a device control entry (DCE) in the system heap and installs a handle to this DCE in the unit table location specified by therefNum
parameter. You pass a pointer to the device driver in thedrvrPtr
parameter.In addition, this function copies the
refNum
parameter to thedCtlRefNum
field of the DCE, sets thedRAMBased
flag in thedCtlFlags
field, and clears all the other fields.SPECIAL CONSIDERATIONS
TheDriverInstall
function does not load the driver resource into memory, copy the flags from the driver header to thedCtlFlags
field, or open the driver. You can write code to perform these tasks, or use theOpenDriver
,OpenSlot
, orPBOpen
functions instead.The
DriverInstall
function allocates memory; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theDriverInstall
function is_DrvrInstall
(0xA03D).You place a pointer to the device driver in register A0, and the driver reference number in register D0. When
_DrvrInstall
returns, register D0 contains the result code.
Registers on entry A0 A pointer to the device driver D0 The driver reference number
Registers on exit D0 Result code RESULT CODES
noErr 0 No error badUnitErr -21 Driver reference number does not match unit table SEE ALSO
For information about theDriverInstallReserveMem
function, which installs a driver as low as possible in the system heap, see the next section.