Important: The information in this document is obsolete and should not be used for new development.
SGetDriver
You can use theSGetDriverfunction to load an sResource's device driver.
FUNCTION SGetDriver (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
<-- spResultHandle A handle to the device driver. --> spsExecPBlkPtr A pointer to the SEBlock.--> spSlotSignedByte The slot number. --> spIDSignedByte The sResource ID. --> spExtDevSignedByte The external device ID. X spSizeSignedByte X spFlagsSignedByte DESCRIPTION
TheSGetDriverfunction loads a device driver from an sResource into a relocatable block in the system heap.You specify an sResource with the
spSlot,spID, andspExtDevfields of the Slot Manager parameter block you point to in the spBlkPtr parameter, and provide a pointer to a slot execution parameter block in thespsExecPBlkfield.The
SGetDriverfunction searches the sResource for ansRsrcLoadRecentry. If it finds one, it loads thesLoadDriverrecord and executes it. If nosRsrcLoadRecentry exists, theSGetDriverfunction looks for ansRsrcDrvrDirentry. If it finds one, it loads the driver into memory.The
SGetDriverfunction returns a handle to the driver in thespResultfield of the parameter block.SPECIAL CONSIDERATIONS
TheSGetDriverfunction allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSGetDriverfunction are
Trap macro Selector _SlotManager $002D You must set up register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When
_SlotManagerreturns, register A0 contains a handle to the loaded driver, and register D0 contains the result code.
Registers on entry A0 Address of the parameter block D0 $002D
Registers on exit A0 Handle to loaded driver D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more information about sResources, including thesRsrcDrvrDirandsRsrcLoadRecentry types, see Designing Cards and Drivers for the Macintosh Family, third edition.