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


GetCurrentProcess

Use the GetCurrentProcess function to get information about the current process,
if any.

FUNCTION GetCurrentProcess (VAR PSN: ProcessSerialNumber): OSErr;
PSN
On output, the process serial number of the current process.
DESCRIPTION
The GetCurrentProcess function returns, in the PSN parameter, the process serial number of the process that is currently running, that is, the one currently accessing the CPU. This is the application associated with the CurrentA5 global variable. This application can be running in either the foreground or the background.

Applications can use this function to find their own process serial number. Drivers can use this function to find the process serial number of the current process. You can use the returned process serial number in other Process Manager routines.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the GetCurrentProcess function are
Trap macro Selector
_OSDispatch$0037

RESULT CODE
noErr0No error


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996