Important: The information in this document is obsolete and should not be used for new development.
SGetDriver
You can use theSGetDriver
function to load an sResource's device driver.
FUNCTION SGetDriver (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
<-- spResult
Handle A handle to the device driver. --> spsExecPBlk
Ptr A pointer to the SEBlock
.--> spSlot
SignedByte The slot number. --> spID
SignedByte The sResource ID. --> spExtDev
SignedByte The external device ID. X spSize
SignedByte X spFlags
SignedByte DESCRIPTION
TheSGetDriver
function loads a device driver from an sResource into a relocatable block in the system heap.You specify an sResource with the
spSlot
,spID
, andspExtDev
fields of the Slot Manager parameter block you point to in the spBlkPtr parameter, and provide a pointer to a slot execution parameter block in thespsExecPBlk
field.The
SGetDriver
function searches the sResource for ansRsrcLoadRec
entry. If it finds one, it loads thesLoadDriver
record and executes it. If nosRsrcLoadRec
entry exists, theSGetDriver
function looks for ansRsrcDrvrDir
entry. If it finds one, it loads the driver into memory.The
SGetDriver
function returns a handle to the driver in thespResult
field of the parameter block.SPECIAL CONSIDERATIONS
TheSGetDriver
function allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSGetDriver
function 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
_SlotManager
returns, 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 thesRsrcDrvrDir
andsRsrcLoadRec
entry types, see Designing Cards and Drivers for the Macintosh Family, third edition.