Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 62
Retrieving Information From a Process Handle
FILENAME_TO_PROCESSHANDLE_ and PROCESSHANDLE_TO_FILENAME_
procedures to convert between process handles and process file names.
Retrieving Information From a Process Handle
To retrieve information from a process handle, use the
PROCESSHANDLE_DECOMPOSE_ procedure. This procedure allows you to extract
the following information:
CPU number (cpu parameter)
PIN (pin parameter)
Node number (nodenumber parameter)
Node name (nodename parameter) and the node-name length (nlen parameter)
Process name (procname parameter) and the process-name length (plen
parameter)
Verification sequence number (seqno parameter)
To use the PROCESSHANDLE_DECOMPOSE_ procedure, you need to supply the
process handle that you want to take apart and return variables for the information you
need.
The following example retrieves all the above information from a process handle:
MAX^NODENAME^LEN := 8;
MAX^PNAME^LEN := 5;
ERROR := PROCESSHANDLE_DECOMPOSE_(PROCESS^HANDLE,
CPU,
PIN,
NODE^NUMBER,
NODENAME:MAX^NODENAME^LEN,
NODENAME^LENGTH,
PROCESS^NAME:MAX^PNAME^LEN,
PROCESS^NAME^LENGTH,
SEQUENCE^NUMBER);
Converting Between Process Handles and Process File Names
The following paragraphs describe how to use system procedure calls to convert
named or unnamed process file names into process handles and how to convert
process handles into process file names.
For a description of the syntax for a process file name, refer to Section 2, Using the
File System.
Converting a Process File Name Into a Process Handle
To convert a process file name into a process handle, use the
FILENAME_TO_PROCESSHANDLE_ procedure. This procedure works for named