G
Greg Shaw
All,
Hi there! This is my first post, so hello everybody. I've been banging
my head against the wall writing my first C++ program which calls a
Guardian Procedure, on a HP NonStop (Tandem) machine. I have RTFM good
and hard with no success, tried various syntax blags, and asked around
at my place of work, and no-one can help, so I thought I'd ask you
lot. And yes, I have tried running it in debug using INSPECT, but when
trying to STEP IN to the call to the Guardian procedure, the source is
not available so I can't follow what's going on.
The task I set myself was the most basic one - wrap up in C++ a nice
safe Guardian procedure which can't do any damage. I chose
PROCESS_GETINFO_ . I ended up putting loads of cout statements at the
end of the program just so I can see everything - a more useful
version would be supplying So, can anyone tell me why the program
below results in this response (return code 2 is Parameter error) from
the NonStop, please?
returnCode is 2
processHandle is 8003de8
*processHandle is 0
errorDetail is 8003e08
*errorDetail is 1
============================================
// process_getinfo_.cpp
//
// A first attempt to write C++ which calls a Guardian procedure.
// inclusion guard:
#ifndef MY_PROCESS_GETINFO
#define MY_PROCESS_GETINFO
// Begin
#include < cextdecs(PROCESS_GETINFO_)>
#include <iostream>
using std::cout;
using std::endl;
int main()
{
short returnCode=0;
short *processHandle = new short[10];
for (int i = 0; i<10 ; i++ )
{
processHandle = '\0';
}
short *errorDetail = new short[1];
errorDetail[0] = '\0';
cout << "\nHello. This is designed to use C++ to call the" << endl;
cout << "Guardian procedure PROCESS_GETINFO_ with no processhandle"
<< endl;
cout << "argument - so designed to return the processhandle of the"
<< endl;
cout << "caller, plus any error information. Good luck...." << endl;
returnCode = PROCESS_GETINFO_ (processHandle // [ short
*processhandle ] /*i,o 1 */
,// [ char *proc-
fname ] /* o 2 */
,// [ short maxlen ] /
* o 2 */
,// [ short *proc-
fname-len ] /* o 3 */
,// [ short
*priority ] /* i 4 */
,// [ short *mom’s-
processhandle ] /*i 5 */
,// [ char
*hometerm ] /* i 6 */
,// [ short maxlen ] /
* i 6 */
,// [ short *hometerm-
len ] /* i 7 */
,// [ long long
*process-time ]/* i 8 */
,// [ short *creator-
access-id ]/*i 9 */
,// [ short *process-
access-id ]/*i 10 */
,// [ short *gmom’s-
processhandle ]/* i11 */
,// [ short *jobid ] /
* i 12 */
,// [ char *program-
file ] /* i 13 */
,// [ short maxlen ] /
* i 13 */
,// [ short *program-
len ] /* i 14 */
,// [ char *swap-
file ] /* i 15 */
,// [ short maxlen ] /
* i 15 */
,// [ short *swap-
len ] /* i 16 */
, errorDetail // [ short *error-
detail ] /* i 17 */
,// [ short *proc-
type ] /* i 18 */
,// [ __int32_t *oss-
pid ] /* i 19*/;
);
cout << endl;
cout << "returnCode is " << returnCode << endl;
cout << "processHandle is " << processHandle << endl;
cout << "*processHandle is " << *processHandle << endl;
cout << "errorDetail is " << errorDetail << endl;
cout << "*errorDetail is " << *errorDetail << endl;
cout << endl;
cout << "That's all for now, Mr Guardian programmer." << endl;
delete [] processHandle;
delete [] errorDetail;
return 0;
}
// End inclusion guard
#endif
Hi there! This is my first post, so hello everybody. I've been banging
my head against the wall writing my first C++ program which calls a
Guardian Procedure, on a HP NonStop (Tandem) machine. I have RTFM good
and hard with no success, tried various syntax blags, and asked around
at my place of work, and no-one can help, so I thought I'd ask you
lot. And yes, I have tried running it in debug using INSPECT, but when
trying to STEP IN to the call to the Guardian procedure, the source is
not available so I can't follow what's going on.
The task I set myself was the most basic one - wrap up in C++ a nice
safe Guardian procedure which can't do any damage. I chose
PROCESS_GETINFO_ . I ended up putting loads of cout statements at the
end of the program just so I can see everything - a more useful
version would be supplying So, can anyone tell me why the program
below results in this response (return code 2 is Parameter error) from
the NonStop, please?
returnCode is 2
processHandle is 8003de8
*processHandle is 0
errorDetail is 8003e08
*errorDetail is 1
============================================
// process_getinfo_.cpp
//
// A first attempt to write C++ which calls a Guardian procedure.
// inclusion guard:
#ifndef MY_PROCESS_GETINFO
#define MY_PROCESS_GETINFO
// Begin
#include < cextdecs(PROCESS_GETINFO_)>
#include <iostream>
using std::cout;
using std::endl;
int main()
{
short returnCode=0;
short *processHandle = new short[10];
for (int i = 0; i<10 ; i++ )
{
processHandle = '\0';
}
short *errorDetail = new short[1];
errorDetail[0] = '\0';
cout << "\nHello. This is designed to use C++ to call the" << endl;
cout << "Guardian procedure PROCESS_GETINFO_ with no processhandle"
<< endl;
cout << "argument - so designed to return the processhandle of the"
<< endl;
cout << "caller, plus any error information. Good luck...." << endl;
returnCode = PROCESS_GETINFO_ (processHandle // [ short
*processhandle ] /*i,o 1 */
,// [ char *proc-
fname ] /* o 2 */
,// [ short maxlen ] /
* o 2 */
,// [ short *proc-
fname-len ] /* o 3 */
,// [ short
*priority ] /* i 4 */
,// [ short *mom’s-
processhandle ] /*i 5 */
,// [ char
*hometerm ] /* i 6 */
,// [ short maxlen ] /
* i 6 */
,// [ short *hometerm-
len ] /* i 7 */
,// [ long long
*process-time ]/* i 8 */
,// [ short *creator-
access-id ]/*i 9 */
,// [ short *process-
access-id ]/*i 10 */
,// [ short *gmom’s-
processhandle ]/* i11 */
,// [ short *jobid ] /
* i 12 */
,// [ char *program-
file ] /* i 13 */
,// [ short maxlen ] /
* i 13 */
,// [ short *program-
len ] /* i 14 */
,// [ char *swap-
file ] /* i 15 */
,// [ short maxlen ] /
* i 15 */
,// [ short *swap-
len ] /* i 16 */
, errorDetail // [ short *error-
detail ] /* i 17 */
,// [ short *proc-
type ] /* i 18 */
,// [ __int32_t *oss-
pid ] /* i 19*/;
);
cout << endl;
cout << "returnCode is " << returnCode << endl;
cout << "processHandle is " << processHandle << endl;
cout << "*processHandle is " << *processHandle << endl;
cout << "errorDetail is " << errorDetail << endl;
cout << "*errorDetail is " << *errorDetail << endl;
cout << endl;
cout << "That's all for now, Mr Guardian programmer." << endl;
delete [] processHandle;
delete [] errorDetail;
return 0;
}
// End inclusion guard
#endif