Important: The information in this document is obsolete and should not be used for new development.
SExec
You can use theSExecfunction to execute code stored in ansExecBlockdata structure.
FUNCTION SExec (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spsPointerPtr A pointer to an sResource (described in "The sResource," beginning on page 2-7). --> spsExecPBlkPtr A pointer to the SEBlock.--> spIDSignedByte The ID of the sExecBlockentry in the sResource.X spResultLongInt DESCRIPTION
TheSExecfunction loadssExecBlockcode from an sResource into the current heap zone, checks its revision level, and executes the code.You specify the
sExecBlockby providing a pointer to the sResource in thespsPointerfield and the ID of thesExecBlockentry in thespIDfield. You must also provide in thespsExecPBlkfield a pointer to a slot execution parameter block. TheSEBlockstructure allows you to provide information about the execution of thesExecBlockcode.The
SExecfunction passes thesExecBlockcode a pointer to theSEBlockstructure in register A0.SPECIAL CONSIDERATIONS
TheSExecfunction allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSExecfunction 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
_SlotManagerreturns, 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 sExecwas wrongsmCPUErr-334 The CPU field of the code to be executed by sExecwas wrongsmNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more information about thesExecBlockdata structure, see page 2-9.
 
  
  
 