[WIN32K]
[reactos.git] / subsystems / win32 / win32k / include / hook.h
1 #pragma once
2
3 #define HOOK_THREAD_REFERENCED (0x1)
4 #define NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
5 #define HOOKID_TO_INDEX(HookId) (HookId - WH_MINHOOK)
6 #define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
7 #define ISITHOOKED(HookId) (((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks & HOOKID_TO_FLAG(HookId))
8
9 typedef struct tagHOOKTABLE
10 {
11 LIST_ENTRY Hooks[NB_HOOKS]; /* array of hook chains */
12 UINT Counts[NB_HOOKS]; /* use counts for each hook chain */
13 } HOOKTABLE, *PHOOKTABLE;
14
15 typedef struct tagEVENTHOOK
16 {
17 THROBJHEAD head;
18 LIST_ENTRY Chain; /* Event chain entry */
19 UINT eventMin;
20 UINT eventMax;
21 DWORD idProcess;
22 DWORD idThread;
23 WINEVENTPROC Proc; /* Event function */
24 ULONG Flags; /* Some internal flags */
25 ULONG_PTR offPfn;
26 INT ihmod;
27 } EVENTHOOK, *PEVENTHOOK;
28
29 typedef struct tagEVENTTABLE
30 {
31 LIST_ENTRY Events;
32 UINT Counts;
33 } EVENTTABLE, *PEVENTTABLE;
34
35 LRESULT FASTCALL co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam);
36 LRESULT FASTCALL co_EVENT_CallEvents(DWORD, HWND, UINT_PTR, LONG_PTR);
37 VOID FASTCALL HOOK_DestroyThreadHooks(PETHREAD Thread);
38 PHOOK FASTCALL IntGetHookObject(HHOOK);
39 PHOOK FASTCALL IntGetNextHook(PHOOK Hook);
40 LRESULT FASTCALL UserCallNextHookEx( PHOOK pHook, int Code, WPARAM wParam, LPARAM lParam, BOOL Ansi);
41
42 /* EOF */