Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Mac OS Runtime Architectures /
Appendix B - The RTLib.o and NuRTLib.o Libraries / Runtime Operations


kRTPreLaunch and kRTPostLaunch

In the classic 68K near model environment, you cannot call _Launch or _Chain directly, but must instead use the Process Manager call LaunchApplication (See Inside Macintosh: Processes for more details). If you need to call _Launch or _Chain under the far model environment, you must wrap a call to _Launch with calls to Runtime using the kPreLaunch and KPostLaunch operations as follows:

IMPORT(Runtime): CODE

MOVE.W#kRTPreLaunch,-(SP) ; push fOperation
SUBQ.W#2,-(SP)       ; room for result
PEA2(SP)             ; push ptr to RTPB
JSRRuntime           ; prepare for launch

_Launch              ; attempt a launch

MOVE.W#kRTPostLaunch,-(SP); push fOperation
SUBQ.W#2,-(SP)       ; room for result
PEA2(SP)             ; push ptr to RTPB
JSRRuntime           ; post-launch housekeeping
The only field used in the RTPB structure (page B-2) is fOperation. Neither kPreLaunch or kPostLaunch require an fRTParams parameter block.

If you need to call _Chain, you must wrap the routine with kPreLaunch and kPostLaunch in the same manner as with the _Launch routine.

IMPORTANT
You must never call the _Chain trap since it is not implemented by the System 7 Process Manager.
The CFM-68K runtime environment does not support calling _Launch or _Chain directly from a CFM-68K application. You can call kPreLaunch and kPostLaunch in the CFM-68K runtime environment, but the routines do nothing.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 MARCH 1997