Important: The information in this document is obsolete and should not be used for new development.
SExec
You can use theSExec
function to execute code stored in ansExecBlock
data structure.
FUNCTION SExec (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spsPointer
Ptr A pointer to an sResource (described in "The sResource," beginning on page 2-7). --> spsExecPBlk
Ptr A pointer to the SEBlock
.--> spID
SignedByte The ID of the sExecBlock
entry in the sResource.X spResult
LongInt DESCRIPTION
TheSExec
function loadssExecBlock
code from an sResource into the current heap zone, checks its revision level, and executes the code.You specify the
sExecBlock
by providing a pointer to the sResource in thespsPointer
field and the ID of thesExecBlock
entry in thespID
field. You must also provide in thespsExecPBlk
field a pointer to a slot execution parameter block. TheSEBlock
structure allows you to provide information about the execution of thesExecBlock
code.The
SExec
function passes thesExecBlock
code a pointer to theSEBlock
structure in register A0.SPECIAL CONSIDERATIONS
TheSExec
function allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSExec
function are
Trap macro Selector _SlotManager $0023 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 D0 contains the result code.
Registers on entry A0 Address of the parameter block D0 $0023
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smCodeRevErr
-333 The revision of the code to be executed by sExec
was wrongsmCPUErr
-334 The CPU field of the code to be executed by sExec
was wrongsmNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more information about thesExecBlock
data structure, see page 2-9.