InstallDriverFromMemory loads a driver from a range of memory and installs it.
OSErr InstallDriverFromMemory (
Ptr memory,
long length,
ConstStr63Param fragName,
RegEntryIDPtr device,
UnitNumber beginningUnit,
UnitNumber endingUnit,
DriverRefNum *refNum);
InstallDriverFromMemory installs a driver that is located in a CFM code fragment anywhere within the specified unit number range of the unit table. It invokes the driver's Initialize command, passing the RegEntryIDPtr value to it. The driver's initialization code must return noErr for InstallDriverFromMemory 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 HighestUnitNumber().
InstallDriverFromMemory uses GetDriverMemoryFragment to load the driver, which then calls SetDriverClosureMemory to hold the driver's closure memory.