sys7.1-doc-wip/Interfaces/AIncludes/Processes.a
2019-07-27 22:37:48 +08:00

240 lines
7.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
; File: Processes.a
;
; Contains: Assembly Interface for Process Manager API
;
; Written by: David Harrison
;
; Copyright: © 1989-91 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <25> 8/15/91 MH change include 'SysEqu.a' to INCLUDE ...
; <24> 8/15/91 MH remove one commentless semi-colon
; <23> 6/14/91 JL Checked in official MPW 3.2ƒ version. Equated theMsgEvent to $10
; - evtBlkSize is in SysEqu.a: must be included.
; <22> 2/1/91 DFH stb,WS#DFH-910131c:Removed Process Mgr defined AppleEvent codes.
; They belong in {AIncludes}AppleEvents.a, which does not exist.
; <21> 1/30/91 gbm sab, #38: Change the already including this file variable to
; all uppercase (for security reasons)
; <20> 1/16/91 JDR (dba) Moved the Process Mgr error numbers into the Errors
; interface file. Including SysEqu.a for the evtBlkSize.
; <19> 1/15/91 DFH (VL) Add record REC/ENDR templates for existing records.
; <18> 9/4/90 JT Added modeUseTextEditServices to the list of process state
; flags.
; <17> 8/28/90 DFH Correct capitalization of highLongOfPSN and lowLongOfPSN
; <16> 7/19/90 DFH Removed launchIsAutomatic and modeAutomatic.
; <15> 7/16/90 DFH LaunchParamBlockRec and ProcessInfoRec now use FSSpec instead of
; name/vrefnum/dirid.
; <13> 5/8/90 DFH Fixed GetFrontProcess glue.
; <12> 4/27/90 GM prevent redefinition errors by avoiding multiple inclusion.
; <11> 4/16/90 DFH Added AppleEvent definitions. Changed Launch param constant
; for extended length to be the actual value rather than a bias.
; <10> 3/21/90 DFH Renamed new SIZE flags.
; <9> 3/21/90 DFH Added modeHLEventCompatible, modeNetHLEventCompatible, and modeStationeryAware.
;
; 1.2 DFH 03/12/90 Added launchAppParameters
; 1.1 ngk 12/01/1989 Added LaunchApplication and new error codes
; 1.0 CCH 10/16/1989 Adding to EASE.
;___________________________________________________________________________
IF &TYPE('__INCLUDINGPROCESSES__') = 'UNDEFINED' THEN
__INCLUDINGPROCESSES__ SET 1
IF &TYPE('__INCLUDINGSYSEQU__') = 'UNDEFINED' THEN
INCLUDE 'SysEqu.a'
ENDIF
;__________________________________________________________________________________
; Process Serial Number (PSN)
;__________________________________________________________________________________
; various reserved process serial numbers
kNoProcess EQU 0 ; no process at all
kSystemProcess EQU 1 ; the system
kCurrentProcess EQU 2 ; the switched-in process
; record definition
ProcessSerialNumber RECORD 0
highLongOfPSN DS.L 1 ; the upper half
lowLongOfPSN DS.L 1 ; the lower half
size EQU *
ENDR
; record definition (old style definition)
highLongOfPSN EQU 0
lowLongOfPSN EQU 4
;__________________________________________________________________________________
; parameter block passed in the _Launch trap.
;__________________________________________________________________________________
; flags for launchControlFlags field
launchContinue EQU $4000
launchNoFileFlags EQU $0800
launchUseMinimum EQU $0400
launchDontSwitch EQU $0200
launchAllow24Bit EQU $0100
launchInhibitDaemon EQU $0080
; format of buffer pointed to by launchAppParameters
AppParameters RECORD 0
theMsgEvent DS.B $10 ; (evtBlkSize) a HighLevelEvent record
eventRefCon DS.L 1 ; refcon for the high-level event
messageLength DS.L 1 ; number of bytes in messageBuffer
messageBuffer EQU * ; start of message for the high level event
size EQU *
ENDR
; format of buffer pointed to by launchAppParameters (old style definition)
theMsgEvent EQU 0
eventRefCon EQU 16
messageLength EQU 20
messageBuffer EQU 24
; parameter block itself
LaunchParamBlockRec RECORD 0
reserved1 DS.L 1
reserved2 DS.W 1
launchBlockID DS.W 1 ; { = extendedBlock }
launchEPBLength DS.L 1 ; { = extendedBlockLen }
launchFileFlags DS.W 1
launchControlFlags DS.W 1
launchAppSpec DS.L 1
launchProcessSN DS ProcessSerialNumber
launchPreferredSize DS.L 1
launchMinimumSize DS.L 1
launchAvailableSize DS.L 1
launchAppParameters DS.L 1
size EQU *
extendedBlockLen EQU size-launchFileFlags
ENDR
; parameter block itself (old style definition)
launchBlockID EQU 6
launchEPBLength EQU 8
launchFileFlags EQU 12
launchControlFlags EQU 14
launchAppSpec EQU 16
launchProcessSN EQU 20
launchPreferredSize EQU 28
launchMinimumSize EQU 32
launchAvailableSize EQU 36
launchAppParameters EQU 40
SIZEOF_LAUNCHPARAMBLOCKREC EQU 44
extendedBlockLen EQU SIZEOF_LAUNCHPARAMBLOCKREC - launchFileFlags
; set launchBlockID to extendedBlock to specify that extensions exist
; set launchEPBLength to extendedBlockLen for compatibility
extendedBlock EQU 19523
;__________________________________________________________________________________
; Definition of the information block returned by _GetProcessInformation.
;__________________________________________________________________________________
; bits in the processMode field
modeDeskAccessory EQU $00020000
modeMultiLaunch EQU $00010000
modeNeedSuspendResume EQU $00004000
modeCanBackground EQU $00001000
modeDoesActivateOnFGSwitch EQU $00000800
modeOnlyBackground EQU $00000400
modeGetFrontClicks EQU $00000200
modeGetAppDiedMsg EQU $00000100
mode32BitCompatible EQU $00000080
modeHighLevelEventAware EQU $00000040
modeLocalAndRemoteHLEvents EQU $00000020
modeStationeryAware EQU $00000010
modeUseTextEditServices EQU $00000008
; record returned by GetProcessInformation
ProcessInfoRec RECORD 0
processInfoLength DS.L 1
processName DS.L 1
processNumber DS ProcessSerialNumber
processType DS.L 1
processSignature DS.L 1
processMode DS.L 1
processLocation DS.L 1
processSize DS.L 1
processFreeMem DS.L 1
processLauncher DS ProcessSerialNumber
processLaunchDate DS.L 1
processActiveTime DS.L 1
processAppSpec DS.L 1
size EQU *
ENDR
; record returned by GetProcessInformation (old style definition)
processInfoLength EQU 0
processName EQU 4
processNumber EQU 8
processType EQU 16
processSignature EQU 20
processMode EQU 24
processLocation EQU 28
processSize EQU 32
processFreeMem EQU 36
processLauncher EQU 40
processLaunchDate EQU 48
processActiveTime EQU 52
processAppSpec EQU 56
;__________________________________________________________________________________
; trap macros
;__________________________________________________________________________________
MACRO
_LaunchApplication
_Launch
ENDM
MACRO
_LaunchDeskAccessory
MOVE.W #$36,-(SP)
_OSDispatch
ENDM
MACRO
_GetCurrentProcess
MOVE.W #$37,-(SP)
_OSDispatch
ENDM
MACRO
_GetFrontProcess
PEA $FFFFFFFF
MOVE.W #$39,-(SP)
_OSDispatch
ENDM
MACRO
_GetNextProcess
MOVE.W #$38,-(SP)
_OSDispatch
ENDM
MACRO
_GetProcessInformation
MOVE.W #$3A,-(SP)
_OSDispatch
ENDM
MACRO
_SetFrontProcess
MOVE.W #$3B,-(SP)
_OSDispatch
ENDM
MACRO
_WakeUpProcess
MOVE.W #$3C,-(SP)
_OSDispatch
ENDM
MACRO
_SameProcess
MOVE.W #$3D,-(SP)
_OSDispatch
ENDM
ENDIF ; ...already included