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


SameProcess

Use the SameProcess function to determine whether two process serial numbers specify the same process.

FUNCTION SameProcess (PSN1, PSN2: ProcessSerialNumber; 
                        VAR result: Boolean): OSErr;
PSN1
A process serial number.
PSN2
A process serial number.
result
A Boolean value that indicates whether the process serial numbers passed in PSN1 and PSN2 refer to the same process.
DESCRIPTION
The SameProcess function compares two process serial numbers and determines whether they refer to the same process. If the process serial numbers specified in the PSN1 and PSN2 parameters refer to the same process, the SameProcess function returns TRUE in the result parameter; otherwise, it returns FALSE in the result parameter.

Do not attempt to compare two process serial numbers by any means other than the SameProcess function, because the interpretation of the bits in a process serial number is internal to the Process Manager.

The values of PSN1 and PSN2 must be valid process serial numbers returned from LaunchApplication, GetNextProcess, GetFrontProcess, GetCurrentProcess, or a high-level event. You can also use the constant kCurrentProcess to refer to the current process.

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

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


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996