HP3000-L Archives

March 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Zoltak <[log in to unmask]>
Reply To:
John Zoltak <[log in to unmask]>
Date:
Fri, 27 Mar 1998 08:53:38 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (92 lines)
I just happened to have written something like that a week ago. This one
traps calls to IPCRECV and displays the parameters then calls the real
IPCRECV, but it demonstrates the way to call by plabel in C. You need to
create a prototype for the call that you want to make with the proper
parameters.

John Zoltak
North American Mfg Co

#pragma intrinsic_file "sysintr.pub.sys"
#pragma intrinsic HPGETPROCPLABEL
#pragma intrinsic HPDEBUG

struct _status_word {
   short error_num;
   short subsys_num;
};

typedef union {
   struct _status_word decode;
   int    word;
} t_mpe_status;


static int IPCRECV_PLABEL = -1;

/* this is the prototype for the real IPCRECV by plabel */
void (*realIPCRECV) (int vcdesc,
             char ^data,
             int *dlen,
             int *flags,
             int *opt,
             int *result );

void IPCRECV(int vcdesc,
             char ^data,
             int *dlen,
             int *flags,
             int *opt,
             int *result )
{
   char proc[32];

   if (IPCRECV_PLABEL == -1) {
      strcpy(proc,"%IPCRECV%");
      HPGETPROCPLABEL(proc, &IPCRECV_PLABEL);
      printf("Address of IPCRECV Loaded!\n");
   };

   realIPCRECV = (void*) IPCRECV_PLABEL;

   printf("IPCRECV Called!\n");
   printf("VCDesc=%d, data=%lx, dlen=%d, flags=0x%x, result=%d\n",
           vcdesc, data, *dlen, flags, *result);

   realIPCRECV(vcdesc, data, dlen, flags, opt, result);

   printf("VCDesc=%d, dlen=%d, flags=0x%x, result=%d\n",
           vcdesc, *dlen, flags, *result);
}

> -----Original Message-----
> From: Gary L. Biggs [SMTP:[log in to unmask]]
> Sent: Thursday, March 26, 1998 7:00 PM
> To:   [log in to unmask]
> Subject:      [HP3000-L] Dynamic Procedure Calls to routines in
> XL.PUB.SYS
>
> It looks like I need to place some dynamic V/PLUS procedure calls for
> a
> project I'm working on. Unfortunately, the HP Documentation for
> HPGETPROCPLABEL shows examples for PASCAL, not C.
>
> Can anyone send me an example of how one might dynamically load
> something like DEBUG or VOPENTERM with HPGETPROCPLABEL
> and then call it from HP C?
>
> I know there was quite a discussion about just this type of 'Hooking'
> before
> IPROF, but all my mail from back then is in the trash.
>
> Thanx....
>
>
>
> Gary L. Biggs, N5TTO
> [log in to unmask]
> Interex SIG Allbase Chair
>
> "Abandon all hope, Ye who Inter(net) here" --
> Dante, over the portal(router) to Hell

ATOM RSS1 RSS2