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
Routines / Getting Process Information


GetProcessInformation

Use the GetProcessInformation function to get information about a specific process.

FUNCTION GetProcessInformation (PSN: ProcessSerialNumber; 
                                 VAR info: ProcessInfoRec): OSErr;
PSN
The process serial number of a process. This number should be a valid process serial number returned from LaunchApplication, GetNextProcess, GetFrontProcess, GetCurrentProcess, or else a high-level event. You can use the constant kCurrentProcess to get information about the current process.
info
A record containing information about the specified process.
DESCRIPTION
The GetProcessInformation function returns, in a process information record, information about the specified process. The information returned in the info parameter includes the application's name as it appears in the Application menu, the type and signature of the application, the address of the application partition, the number of bytes in the application partition, the number of free bytes in the application heap, the application that launched the application, the time at which the application was launched, and the location of the application file. See "Getting Information About Other Processes" on page 2-5 for the structure of the process information record.

The GetProcessInformation function also returns information about the application's 'SIZE' resource and indicates whether the process is an application or a desk accessory.

You need to specify values for the processInfoLength, processName, and processAppSpec fields of the process information record. Specify the length of the process information record in the processInfoLength field. If you do not want information returned in the processName and processAppSpec fields, specify NIL for these fields. Otherwise, allocate at least 32 bytes of storage for the string pointed to by the processName field and, in the processAppSpec field, specify a pointer to an FSSpec record.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the GetProcessInformation function are
Trap macro Selector
_OSDispatch$003A

SPECIAL CONSIDERATIONS
Do not call GetProcessInformation at interrupt time.

RESULT CODES
noErr0No error
paramErr-50Process serial number is invalid


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996