CallHook hook

From NikiWiki
Jump to: navigation, search

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