Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 59
Getting Process Information
OPTIONS := 1;
DO
BEGIN
ERROR := PROCESS_GETPAIRINFO_(!process^handle!,
PROCESS^NAME:MAXLEN,
NAME^LENGTH,
!primary^processhandle!,
!backup^processhandle!,
SEARCH^INDEX,
!ancestor^processhandle!,
NODE^NAME:NODENAME^LENGTH,
OPTIONS);
CASE ERROR OF
BEGIN
2 -> BEGIN
! Process parameter error
.
.
END;
3 -> BEGIN
! Process bounds error
.
.
END;
10 -> BEGIN
! Process error: unable to communicate with node
.
.
END;
OTHERWISE
BEGIN
IF ERROR <> 8 THEN
BEGIN
! Process the name returned in NAME^LENGTH
.
.
END;
END;
END
UNTIL ERROR = 8;
Setting the search-index parameter to 0D causes the PROCESS_GETPAIRINFO_
procedure to search for a process name and return that name in PROCESS^NAME.
The next time through the loop, it returns the next process name, and so on, until it has
listed all process names on the specified node. The procedure returns an error value
of 8 when it has completed the search.