Important: The information in this document is obsolete and should not be used for new development.
CallOSTrapUniversalProc
You can call theCallOSTrapUniversalProc
function to call the routine associated with a universal procedure pointer, following Operating System register saving and restoring conventions. You're likely to need to use this function only if you need to patch an Operating System trap.
long CallOSTrapUniversalProc (UniversalProcPtr theProcPtr, ProcInfoType theProcInfo, ...);
theProcPtr
- A universal procedure pointer.
theProcInfo
- The procedure information associated with the routine specified by the
theProcPtr
parameter.DESCRIPTION
TheCallOSTrapUniversalProc
function executes the routine associated with the specified universal procedure pointer, following standard conventions for executing Operating System traps. Registers A1, A2, D1, and D2 are saved before the routine is executed and restored after its completion; in addition, register A0 is saved and restored, depending on the setting of the appropriate flag bit in the trap word. The trap number
is put into register D1; you should make certain to record that fact in any procedure information you build yourself.You pass
CallOSTrapUniversalProc
a universal procedure pointer (which may be either a 680x0 procedure pointer or the address of a routine descriptor), a set of procedure information, and a variable number of parameters that are passed to the routine.CallOSTrapUniversalProc
returns a result of typelong
that contains the result (if any) returned by the called routine.SPECIAL CONSIDERATIONS
If the universal procedure pointer passed toCallOSTrapUniversalProc
is the address of the routine descriptor, that routine descriptor must already exist before you callCallOSTrapUniversalProc
. If you pass the address of an invalid routine descriptor
toCallOSTrapUniversalProc
, a system error will occur.The
CallOSTrapUniversalProc
function is defined only for register-based Operating System traps. Make sure that the procedure information specified in thetheProcInfo
parameter correctly specifies the calling conventions of the trap. In particular, do not specify either C or Pascal calling conventions.