Jump to content

CallHook hook: Difference between revisions

From NikiWiki
No edit summary
 
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
From comp.os.os2.programmer.misc:
From comp.os.os2.programmer.misc:


I recently came across this interesting bit of information
I recently came across this interesting bit of information (in "OS/2 for PowerPC API Addendum, of all places):
(in "OS/2 for PowerPC API Addendum, of all places):


-----------------------------------------------------------
  /*******************************************/
  /*******************************************/
  /* This hook is called for debugging      */
  /* This hook is called for debugging      */
Line 10: Line 8:
  /* procedure is about to be called.        */
  /* procedure is about to be called.        */
  /*******************************************/
  /*******************************************/
 
  #define INCL_xxx
  #define INCL_xxx
  #include <os2.h>
  #include <os2.h>
HMQ      Current;  /* Message-queue handle associated with the current thread. */
HMQ      Created;  /* Message-queue handle created by the installing thread. */
PID      Pid;      /* Process identity of the installing thread. */
TID      Tid;      /* Thread identity of the installing thread. */
SHORT    HookType;  /* Hook type. */
PROC    HookProc;  /* Address of the hook procedure that is about to be called. */
BOOL    f;        /* Indicates whether or not the hook HookProc should be called: */
f = CallHook(Current, Created, Pid, Tid, HookType, HookProc);


HMQ      Current;  /*  Message-queue handle associated with the current thread. */
I could really use this function. I have just one little problem, I have no idea what the HK_ constant for this one might be. Before I resort to trial & error, does anyone know what the constant might be?
HMQ      Created;  /*  Message-queue handle created by the installing thread. */
PID      Pid;      /*  Process identity of the installing thread. */
TID      Tid;      /*  Thread identity of the installing thread. */
SHORT    HookType;  /*  Hook type. */
PROC    HookProc;  /*  Address of the hook procedure that is about to be called. */
BOOL    f;        /*  Indicates whether or not the hook HookProc should be called: */


f = CallHook(Current, Created, Pid, Tid, HookType,
And just in case someone thinks this was OS/2 PPC specific, there is a symbol called CALLCALLHOOKHOOK in PMWIN.SYM (at least some old version of PMWIN.SYM) along with CALLINPUTHOOK, CALLSENDMSGHOOK etc. so I'm almost certain this functionality has been in OS/2 for quite a while.
      HookProc);
-----------------------------------------------------------
 
I could really use this function. I have just one little problem,
I have no idea what the HK_ constant for this one might be. Before
I resort to trial & error, does anyone know what the constant might be?
 
And just in case someone thinks this was OS/2 PPC specific, there
is a symbol called CALLCALLHOOKHOOK in PMWIN.SYM (at least some old
version of PMWIN.SYM) along with CALLINPUTHOOK, CALLSENDMSGHOOK etc.
so I'm almost certain this functionality has been in OS/2 for quite
a while.  
 
------------------------------------------------------------


Answer:
Answer:
 
#define HK_CALLHOOK                13
#define HK_CALLHOOK                13

Latest revision as of 06:22, 20 November 2018

From comp.os.os2.programmer.misc:

I recently came across this interesting bit of information (in "OS/2 for PowerPC API Addendum, of all places):

/*******************************************/
/* This hook is called for debugging       */
/* purposes, whenever any other hook       */
/* procedure is about to be called.        */
/*******************************************/

#define INCL_xxx
#include <os2.h>

HMQ      Current;   /* Message-queue handle associated with the current thread. */
HMQ      Created;   /* Message-queue handle created by the installing thread. */
PID      Pid;       /* Process identity of the installing thread. */
TID      Tid;       /* Thread identity of the installing thread. */
SHORT    HookType;  /* Hook type. */
PROC     HookProc;  /* Address of the hook procedure that is about to be called. */
BOOL     f;         /* Indicates whether or not the hook HookProc should be called: */

f = CallHook(Current, Created, Pid, Tid, HookType, HookProc);

I could really use this function. I have just one little problem, I have no idea what the HK_ constant for this one might be. Before I resort to trial & error, does anyone know what the constant might be?

And just in case someone thinks this was OS/2 PPC specific, there is a symbol called CALLCALLHOOKHOOK in PMWIN.SYM (at least some old version of PMWIN.SYM) along with CALLINPUTHOOK, CALLSENDMSGHOOK etc. so I'm almost certain this functionality has been in OS/2 for quite a while.

Answer:

#define HK_CALLHOOK                 13