Important: The information in this document is obsolete and should not be used for new development.
DriverInstallReserveMem
You can use theDriverInstallReserveMemfunction to create a device control entry and install it in the unit table.
pascal OSErr DriverInstallReserveMem(Ptr drvrPtr, short refNum);
drvrPtr- A pointer to the device driver.
 refNum- The driver reference number.
 DESCRIPTION
TheDriverInstallReserveMemfunction is equivalent to theDriverInstallfunction, except that it calls the Memory ManagerReserveMemfunction to compact the heap before allocating memory for the device control entry (DCE).After calling the
ReserveMemfunction, theDriverInstallReserveMemfunction allocates a 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
TheDriverInstallReserveMemfunction 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
DriverInstallReserveMemfunction allocates memory; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theDriverInstallReserveMemfunction is_DrvrInstall(0xA03D). You must set bit 10 of the trap word to signal the Device Manager to call theReserveMemfunction before allocating memory for the DCE.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