The OpenVMS Wizard will assume that "crash" here means that the code
fails at run-time, and that the code probably fails with an access
violation (ACCVIO) error. (When posting, a complete and concise example
and the exact message(s) received can be quite useful -- otherwise, the
Wizard must guess at the error and at the problem, and might well guess
incorrectly.)
The itemcode argument is passed by reference, not value.
When the process name and resultant string arguments are not required,
specify them as zero -- and not as the address of a zero-length constant
string.
Here is an example of calling lib$getjpi:
#include <jpidef.h>
#include <lib$routines.h>
#include <ssdef.h>
#include <stsdef.h>
main()
{
int InputPid, OutputPid, RetStat;
unsigned short int RetLen;
InputPid = 0;
RetStat = lib$getjpi( &JPI$_PID,
&InputPid,
0,
&OutputPid,
0,
&RetLen );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
return SS$_NORMAL;
}