I am trying to come up with a way to selectively disable MPE/iX commands from
within programs. The method must work on 3rd party products as well as in
house
utilities (which may or may not have source code). The only concession is that
the method only has to work for NM programs (although I might have to do it for
CM programs later).
As far as I can tell, there are 3 ways of doing this, and they are (in order of
completeness):
method 1.
Buy the AIF:Procedure Exits product from HP. Not really an option, but it
would work:)
method 2.
Modify all programs to call new intrinsics. This can be done by modifying
the
executable code, as long as the intrinsic names were the same length. Then
the new intrinsics would be put into a special XL and after my special
preprocessing, either the MPE/iX command would be ignored or executed by
calling the original intrinsic.
For example:
1. Change all calls to HPCICOMMAND to call HZCICOMMAND in program A.A.A
2. Put a HZCICOMMAND in a file called HZXL.PUB.SYS.
3. Lookup command in a special authorization file.
3. Have HZCICOMMAND write the command to a special logfile.
4. HZCICOMMAND would then call HPCICOMMAND directly.
The user would run the program with RUN A.A.A;XL='HZXL.PUB.SYS'. If
he did not, then he would get an unresolved externals which is acceptable.
If the user did not know about HZXL.PUB.SYS, he could still run the
program like this: RUN A.A.A;UNSAT=TERMINATE.
I know that I could put the HZCICOMMAND intrinsic in the system NL, but since
this requires a system restart, that is really not an option. Unless someone
knows how to modify the NL online:)
method 3.
Create a fake HPCICOMMAND and COMMAND intrinsic that does the preprocessing.
After the preprocessing is done, call the real HPCICOMMAND or COMMAND
intrinsic. They can be found by using the HPGETPROCPLABEL intrinsic.
For example:
1. Put HPCICOMMAND in HZXL.PUB.SYS.
2. Lookup command in a special authorization file.
3. Have HZCICOMMAND write the command to a special logfile.
4. HZCICOMMAND finds PLABEL of NL.PUB.SYS/HPCICOMMAND via HPGETPROCPLABEL.
5. Call PLABEL.
The user would run the program with RUN A.A.A;XL='HZXL.PUB.SYS'. If
he did not, then the commands would work normally. Although this is not
what I want, atleast it does not disable a utility. This method is
attractive because it doesn't require changing programs and that it can
be implemented with command files and therefore can be disabled easily.
Personally, I prefer method 2, but I would like to see what is involved in
method 3. I have a working version in Pascal, but am unsure how to call a
function by PLABEL from within C. As usual, the only examples I can find from
HP are in FORTRAN, PASCAL and COBOL.
Thank you in advance and please forgive typos, grammaticos and any other 'o's I
might have messed up (Listening to J.Hendrix while typing can be hazardous to
your typing:))
-------------------------------------------------------------------
Michael P. Smith [log in to unmask]
HP Systems Programmer [log in to unmask]
Hertz Corporation, Oklahoma City, OK
-------------------------------------------------------------------
'Be a team player, it diffuses the blame' - Dilbert
-------------------------------------------------------------------
The views and opinions expressed in this document are expressly
my own. So get off the couch, I obviously need more help than you.
|