PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

InstallDriverFromDisk

InstallDriverFromDisk locates a file in the Extensions folder, verifies that the file contains a native driver, and loads and installs the driver.

OSErr InstallDriverFromDisk(
                     Ptr theDriverName,
                     RegEntryIDPtr theDevice,
                     UnitNumber theBeginningUnit,
                     UnitNumber theEndingUnit,
                     DriverRefNum *theRefNum);
theDriverName
Name of a disk file containing a driver.
theDevice
Pointer to entry in the Name Registry.
theBeginningUnit
First unit table number of range acceptable for installation.
theEndingUnit
Last unit table number of range acceptable for installation.
theRefNum
Reference number returned by InstallDriverFromDisk.
DESCRIPTION

InstallDriverFromDisk installs a driver that is located on disk anywhere within the specified unit number range of the unit table and invokes the driver's Initialize command, passing the RegEntryIDPtr value to it. The driver's initialization code must return noErr for InstallDriverFromDisk to complete successfully. This function returns the driver's refNum value but it does not open the driver.

If the unit table is filled throughout the range from beginningUnit to the value returned by HighestUnitNumber, and the table has not already grown to its maximum size, it can expand to accept the new driver. To use this feature, set endingUnit larger than the value returned by the HighestUnitNumber function.

Note

InstallDriverFromDisk uses GetDriverMemoryFragment to load the driver, which then calls SetDriverClosureMemory to hold the driver's closure memory.

RESULT CODES
noErr 0 No error
badUnitErr -21 Bad unit number
unitTblFullErr -29 Unit table or requested range full
fnfErr -43 File not found
All CFM errors (see Inside Macintosh: PowerPC System Software)

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)