Important: The information in this document is obsolete and should not be used for new development.
DriverInstall
You can use theDriverInstallfunction 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
TheDriverInstallfunction allocates a device control entry (DCE) in the system heap and installs a handle to this DCE in the unit table location specified by therefNumparameter. You pass a pointer to the device driver in thedrvrPtrparameter.In addition, this function copies the
refNumparameter to thedCtlRefNumfield of the DCE, sets thedRAMBasedflag in thedCtlFlagsfield, and clears all the other fields.SPECIAL CONSIDERATIONS
TheDriverInstallfunction does not load the driver resource into memory, copy the flags from the driver header to thedCtlFlagsfield, or open the driver. You can write code to perform these tasks, or use theOpenDriver,OpenSlot, orPBOpenfunctions instead.The
DriverInstallfunction allocates memory; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theDriverInstallfunction is_DrvrInstall(0xA03D).You place a pointer to the device driver in register A0, and the driver reference number in register D0. When
_DrvrInstallreturns, 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 theDriverInstallReserveMemfunction, which installs a driver as low as possible in the system heap, see the next section.