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: Processes
Chapter 2 - Process Manager / Process Manager Reference
Data Structures


Process Information Record

The GetProcessInformation function returns information in a process information record, which is defined by the ProcessInfoRec data type.

TYPE ProcessInfoRec =
   RECORD
      processInfoLength:   LongInt;       {length of process info record}
      processName:         StringPtr;     {name of this process}
      processNumber:       ProcessSerialNumber;
                                          {psn of this process}
      processType:         LongInt;       {file type of application file}
      processSignature:    OSType;        {signature of application file}
      processMode:         LongInt;       {'SIZE' resource flags}
      processLocation:     Ptr;           {address of partition}
      processSize:         LongInt;       {partition size}
      processFreeMem:      LongInt;       {free bytes in heap}
      processLauncher:     ProcessSerialNumber;
                                          {process that launched this one}
      processLaunchDate:   LongInt;       {time when launched}
      processActiveTime:   LongInt;       {accumulated CPU time}
      processAppSpec:      FSSpecPtr;     {location of the file}
   END;
Field Description
processInfoLength
The number of bytes in the process information record. For compatibility, you should specify the length of the record in this field.

processName
The name of the application or desk accessory. For applications, this field contains the name of the application as designated by the user at the time the application was opened. For example, for foreground applications, the processName field contains the name as it appears in the Application menu. For desk accessories, the processName field contains the name of the 'DRVR' resource. You must specify NIL in the processName field if you do not want the application name or the desk accessory name returned. Otherwise, you should allocate at least 32 bytes of storage for the string pointed to by the processName field. Note that the processName field specifies the name of either the application or the 'DRVR' resource, whereas the processAppSpec field specifies the location of the file.

processNumber
The process serial number. The process serial number is a 64-bit number; the meaning of these bits is internal to the Process Manager. You should not attempt to interpret the value of the process serial number.

processType
The file type of the application, generally 'APPL' for applications and 'appe' for background-only applications launched at startup. If the process is a desk accessory, this field specifies the type of the file containing the 'DRVR' resource.

processSignature
The signature of the file containing the application or the 'DRVR' resource (for example, the signature of the TeachText application is 'ttxt').

processMode
Process mode flags. These flags indicate whether the process is an application or desk accessory. For applications, this field also returns information specified in the application's 'SIZE' resource. This information is returned as flags. You can refer to these flags by using these constants:

                  CONST
                     modeDeskAccessory             = $00020000;
                     modeMultiLaunch               = $00010000;
                     modeNeedSuspendResume         = $00004000;
                     modeCanBackground             = $00001000;
                     modeDoesActivateOnFGSwitch    = $00000800;
                     modeOnlyBackground            = $00000400;
                     modeGetFrontClicks            = $00000200;
                     modeGetAppDiedMsg             = $00000100;
                     mode32BitCompatible           = $00000080;
                     modeHighLevelEventAware       = $00000040;
                     modeLocalAndRemoteHLEvents    = $00000020;
                     modeStationeryAware           = $00000010;
                     modeUseTextEditServices       = $00000008;
processLocation
The beginning address of the application partition.

processSize
The number of bytes in the application partition (including the heap, stack, and A5 world).

processFreeMem
The number of free bytes in the application heap.

processLauncher
The process serial number of the process that launched the application or desk accessory. If the original launcher of the process is no longer open, this field contains the constant kNoProcess.

processLaunchDate
The value of the Ticks global variable at the time that the process was launched.

processActiveTime
The accumulated time, in ticks, during which the process has used the CPU, including both foreground and background processing time.

processAppSpec
The address of a file specification record that stores the location of the file containing the application or 'DRVR' resource. You should specify NIL in the processAppSpec field if you do not want the FSSpec record of the file returned.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996