File:  [OS/2 SDKs] / os232sdk / toolkt20 / c / samples / spy / spyhk32.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:26:30 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1990, HEAD
Microsoft OS/2 SDK 2.0 05-30-1990

/* Maximum HWNDS, we will watch */
#define MAXHWNDS    100
#define MAXMSGCNT   50  /* size of Message queue */
#define MAXSTRACE   5   /* Max number of levels we will traceback */
#define CALLSTOSKIP 3   /* How many levels of calls to skip */

/*
 * Define message structure for spy to hold
 */
typedef struct _QMSGSPY {
    USHORT      fs;         /* Flags */
    QMSG        qmsg;       /* The message */
    BOOL        fMP1Valid;  /* Is the extra bytes valid? */
    SHORT       cbDataMP1;  /* Num extra bytes of information for MP1 */
    BOOL        fMP2Valid;  /* Is the extra bytes valid? */
    SHORT       cbDataMP2;  /* Num extra bytes of information for MP2 */
    PID         pidSend;    /* Process ID of the sender */
    TID         tidSend;    /* Thread ID of the sender */
    UCHAR       *rgData;    /* Pointer to additional information for message */
    UCHAR       bMPType;    /* Type of message information retrieved */
} QMSGSPY;

typedef QMSGSPY *PQMSGSPY;


/* Define the HOOKS options word bits */
#define SPYH_INPUT      0x0001
#define SPYH_SENDMSG    0x0002
#define SPYH_JOURNALR   0x0004

/*
 * Define the types of data that the hook will return for message types
 * Note: We have a max of 8 types each for MP1 and MP2 and that currently
 * can be defined with a Byte for each message
 */
#define MPT_NORMAL      0x00
#define MPT_SWP         0x01
#define MPT_RECTL       0x02
#define MPT_WNDPRMS     0x03
#define MPT_QMSG        0x04
#define MP_ENABLED      0x80

#define MP_MASK         0x07

#define MPTS(mp1,mp2)   ((UCHAR)mp2 << 3 | (UCHAR)mp1)


/*
** The value 0x300 is the last+1 message number used by PMWIN for
** it's private use.
*/
#define	MAXMSGFILTER		0x0300
#define	MAXMSGFILTERBYTES	0x0300
/*
** Private pmwin message used to get the current task's focus
*/
#define	WM_QUERYTASKFOCUS	0x0058

/* SPYHOOK library API functions */
BOOL EXPENTRY SpyInitializeHook (void);
BOOL EXPENTRY SpyTerminateHook (void);
BOOL EXPENTRY SpyInstallHook( HAB, HMQ, USHORT);
BOOL EXPENTRY SpyReleaseHook( BOOL );
BOOL EXPENTRY SpyHookOnOrOff( BOOL);
BOOL EXPENTRY SpySetWindowList(SHORT, HWND *);
SHORT EXPENTRY SpyGetWindowList(SHORT, HWND *);
BOOL EXPENTRY SpySetQueueList(SHORT, HMQ *);
SHORT EXPENTRY SpyGetQueueList(SHORT, HMQ *);
BOOL EXPENTRY SpySetMessageList(UCHAR *, BOOL);
BOOL EXPENTRY SpyFWindowInList(HWND, BOOL);
BOOL EXPENTRY SpySetAllFrameOpt(BOOL);
BOOL EXPENTRY SpySetAllWindowOpt (BOOL);

BOOL EXPENTRY SpyGetNextMessage(PQMSGSPY, PSZ, SHORT, LONG);

/* API's For trying to get info symbol information from other PID */
// Define some PID Intersept types
typedef struct _pit {
    PID     pid;        // Which process are we trying to trap on
    USHORT  usPIT;      // What type of data are we looking for
    ULONG   ulInfo;     // Pointer for data to look for;
    char    *pvoidData; // Pointer to information found;
    USHORT  cbData;     // Number of bytes found;
    MRESULT mresult;    // result of call;
} PIT;

#define PIT_SYMBOL      1   /* Get symbol information */
#define PIT_ACCEL       2   /* Get Accelerator table information */
BOOL EXPENTRY SpySetPIDIntercept(PID, USHORT, ULONG);
USHORT EXPENTRY SpyGetPIDInterceptData(PVOID, USHORT, PMRESULT);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.