ReactOS  0.4.15-dev-994-ga9f6032
hook.c File Reference
#include <user32.h>
Include dependency graph for hook.c:

Go to the source code of this file.

Classes

struct  _NOTIFYEVENT
 

Typedefs

typedef struct _NOTIFYEVENT NOTIFYEVENT
 
typedef struct _NOTIFYEVENTPNOTIFYEVENT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
static DWORD FASTCALL GetMaskFromEvent (DWORD Event)
 
static HHOOK FASTCALL IntSetWindowsHook (int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId, BOOL bAnsi)
 
VOID FASTCALL IntNotifyWinEvent (DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD flags)
 
BOOL WINAPI CallMsgFilterA (LPMSG lpMsg, int nCode)
 
BOOL WINAPI CallMsgFilterW (LPMSG lpMsg, int nCode)
 
LRESULT WINAPI CallNextHookEx (HHOOK Hook, int Code, WPARAM wParam, LPARAM lParam)
 
HHOOK WINAPI SetWindowsHookW (int idHook, HOOKPROC lpfn)
 
HHOOK WINAPI SetWindowsHookA (int idHook, HOOKPROC lpfn)
 
BOOL WINAPI DeregisterShellHookWindow (HWND hWnd)
 
BOOL WINAPI RegisterShellHookWindow (HWND hWnd)
 
BOOL WINAPI UnhookWindowsHook (int nCode, HOOKPROC pfnFilterProc)
 
VOID WINAPI NotifyWinEvent (DWORD event, HWND hwnd, LONG idObject, LONG idChild)
 
HWINEVENTHOOK WINAPI SetWinEventHook (UINT eventMin, UINT eventMax, HMODULE hmodWinEventProc, WINEVENTPROC pfnWinEventProc, DWORD idProcess, DWORD idThread, UINT dwFlags)
 
BOOL WINAPI IsWinEventHookInstalled (DWORD event)
 
HHOOK WINAPI SetWindowsHookExA (int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
 
HHOOK WINAPI SetWindowsHookExW (int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
 
static BOOL ClientLoadLibrary (PUNICODE_STRING pstrLibName, PUNICODE_STRING pstrInitFunc, BOOL bUnload, BOOL bApiHook)
 
NTSTATUS WINAPI User32CallClientLoadLibraryFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallHookProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallEventProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 

Typedef Documentation

◆ NOTIFYEVENT

◆ PNOTIFYEVENT

Function Documentation

◆ CallMsgFilterA()

BOOL WINAPI CallMsgFilterA ( LPMSG  lpMsg,
int  nCode 
)

Definition at line 149 of file hook.c.

152 {
153  MSG Msg;
154  if ( NtCurrentTeb()->Win32ThreadInfo &&
156  {
157  if ( lpMsg->message & ~WM_MAXIMUM )
158  {
160  return FALSE;
161  }
162  RtlCopyMemory(&Msg, lpMsg, sizeof(MSG));
163  return NtUserCallMsgFilter( &Msg, nCode);
164  }
165  return FALSE;
166 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BOOL NTAPI NtUserCallMsgFilter(LPMSG msg, INT code)
Definition: message.c:2379
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WH_MSGFILTER
Definition: winuser.h:29
struct @1610 Msg[]
#define FALSE
Definition: types.h:117
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define SetLastError(x)
Definition: compat.h:500
#define WM_MAXIMUM
Definition: undocuser.h:62
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
UINT message
Definition: winuser.h:3090
#define WH_SYSMSGFILTER
Definition: winuser.h:36

◆ CallMsgFilterW()

BOOL WINAPI CallMsgFilterW ( LPMSG  lpMsg,
int  nCode 
)

Definition at line 174 of file hook.c.

177 {
178  MSG Msg;
179  if ( NtCurrentTeb()->Win32ThreadInfo &&
181  {
182  if ( lpMsg->message & ~WM_MAXIMUM )
183  {
185  return FALSE;
186  }
187  RtlCopyMemory(&Msg, lpMsg, sizeof(MSG));
188  return NtUserCallMsgFilter( &Msg, nCode);
189  }
190  return FALSE;
191 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BOOL NTAPI NtUserCallMsgFilter(LPMSG msg, INT code)
Definition: message.c:2379
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WH_MSGFILTER
Definition: winuser.h:29
struct @1610 Msg[]
#define FALSE
Definition: types.h:117
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define SetLastError(x)
Definition: compat.h:500
#define WM_MAXIMUM
Definition: undocuser.h:62
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
UINT message
Definition: winuser.h:3090
#define WH_SYSMSGFILTER
Definition: winuser.h:36

◆ CallNextHookEx()

LRESULT WINAPI CallNextHookEx ( HHOOK  Hook,
int  Code,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 199 of file hook.c.

204 {
206  DWORD Flags, Save;
207  PHOOK pHook, phkNext;
208  LRESULT lResult = 0;
209 
211 
212  if (!ClientInfo->phkCurrent) return 0;
213 
214  pHook = DesktopPtrToUser(ClientInfo->phkCurrent);
215 
216  if (!pHook->phkNext) return 0; // Nothing to do....
217 
218  phkNext = DesktopPtrToUser(pHook->phkNext);
219 
220  if ( phkNext->HookId == WH_CALLWNDPROC ||
221  phkNext->HookId == WH_CALLWNDPROCRET)
222  {
223  Save = ClientInfo->dwHookData;
224  Flags = ClientInfo->CI_flags & CI_CURTHPRHOOK;
225 // wParam: If the message was sent by the current thread/process, it is
226 // nonzero; otherwise, it is zero.
227  if (wParam) ClientInfo->CI_flags |= CI_CURTHPRHOOK;
228  else ClientInfo->CI_flags &= ~CI_CURTHPRHOOK;
229 
230  if (phkNext->HookId == WH_CALLWNDPROC)
231  {
232  PCWPSTRUCT pCWP = (PCWPSTRUCT)lParam;
233 
234  NtUserMessageCall( pCWP->hwnd,
235  pCWP->message,
236  pCWP->wParam,
237  pCWP->lParam,
238  (ULONG_PTR)&lResult,
240  phkNext->Ansi);
241  }
242  else
243  {
245 
246  ClientInfo->dwHookData = pCWPR->lResult;
247 
248  NtUserMessageCall( pCWPR->hwnd,
249  pCWPR->message,
250  pCWPR->wParam,
251  pCWPR->lParam,
252  (ULONG_PTR)&lResult,
254  phkNext->Ansi);
255  }
256  ClientInfo->CI_flags ^= ((ClientInfo->CI_flags ^ Flags) & CI_CURTHPRHOOK);
257  ClientInfo->dwHookData = Save;
258  }
259  else
260  lResult = NtUserCallNextHookEx(Code, wParam, lParam, pHook->Ansi);
261 
262  return lResult;
263 }
struct tagCWPSTRUCT * PCWPSTRUCT
WPARAM wParam
Definition: winuser.h:2994
struct tagHOOK * phkNext
Definition: ntuser.h:218
struct tagCWPRETSTRUCT * PCWPRETSTRUCT
LPARAM lParam
Definition: winuser.h:2993
#define GetWin32ClientInfo()
Definition: ntuser.h:320
LRESULT APIENTRY NtUserCallNextHookEx(int Code, WPARAM wParam, LPARAM lParam, BOOL Ansi)
Definition: hook.c:1371
WPARAM wParam
Definition: combotst.c:138
uint32_t ULONG_PTR
Definition: typedefs.h:65
CLIENT_DATA ClientInfo
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
static int Save(const char **args)
Definition: vfdcmd.c:1851
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define Code
Definition: deflate.h:80
#define FNID_CALLWNDPROCRET
Definition: ntuser.h:839
int HookId
Definition: ntuser.h:219
BOOLEAN Ansi
Definition: ntuser.h:228
unsigned long DWORD
Definition: ntddk_ex.h:95
LPARAM lParam
Definition: winuser.h:3000
WPARAM wParam
Definition: winuser.h:3001
UINT message
Definition: winuser.h:3002
#define WH_CALLWNDPROC
Definition: winuser.h:34
#define CI_CURTHPRHOOK
Definition: ntuser.h:281
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
#define FNID_CALLWNDPROC
Definition: ntuser.h:838
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT lResult
Definition: winuser.h:2992
LPARAM lParam
Definition: combotst.c:139

◆ ClientLoadLibrary()

static BOOL ClientLoadLibrary ( PUNICODE_STRING  pstrLibName,
PUNICODE_STRING  pstrInitFunc,
BOOL  bUnload,
BOOL  bApiHook 
)
static

Definition at line 430 of file hook.c.

435 {
437  PVOID pInitFunction;
439  ANSI_STRING InitFuncName;
440  BOOL bResult = FALSE;
441 
442  TRACE("ClientLoadLibrary: pid: %d, strLibraryName: %S, "
443  "strInitFuncName: %S, bUnload: %d, bApiHook:%d\n",
445  pstrLibName->Buffer,
446  pstrInitFunc->Buffer,
447  bUnload,
448  bApiHook);
449 
450  /* Check if we have to load the module */
451  if (bUnload == FALSE)
452  {
453  ASSERT(pstrLibName->Buffer != NULL);
454 
455  /* Load it */
456  hLibrary = LoadLibrary(pstrLibName->Buffer);
457  if (hLibrary == 0)
458  {
459  return FALSE;
460  }
461 
462  if (!bApiHook)
463  {
464  /* There is nothing more to do for a global hook*/
465  return TRUE;
466  }
467 
468  /* Initialize the user api hook */
469  ASSERT(pstrInitFunc->Buffer);
470  Status = RtlUnicodeStringToAnsiString(&InitFuncName,
471  pstrInitFunc,
472  TRUE);
473  if (!NT_SUCCESS(Status))
474  {
476  return FALSE;
477  }
478 
479  /* Get the address of the initialization routine */
480  pInitFunction = GetProcAddress(hLibrary, InitFuncName.Buffer);
481  if (pInitFunction)
482  {
483  /* Call the initialization routine */
484  bResult = InitUserApiHook(hLibrary, (USERAPIHOOKPROC)pInitFunction);
485  }
486 
487  RtlFreeAnsiString(&InitFuncName);
488 
489  /* In case of error unload the library */
490  if (bResult == FALSE)
491  {
493  }
494  }
495  else
496  {
497  /* Cleanup user api hook before unloading */
498  if (bApiHook)
499  {
502 
503  /* Check if we can we unload it now */
504  if (!bResult)
505  {
506  /* Return success because we are going to free
507  the library in EndUserApiHook*/
508  return TRUE;
509  }
510  }
511  else
512  {
513  /* Get the library handle from the name */
514  hLibrary = GetModuleHandle(pstrLibName->Buffer);
515  if (hLibrary == NULL)
516  {
517  return FALSE;
518  }
519  }
520 
521  bResult = FreeLibrary(hLibrary);
522  }
523 
524  return bResult;
525 }
#define LoadLibrary
Definition: winbase.h:3702
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
BOOL WINAPI ClearUserApiHook(HINSTANCE hInstance)
Definition: usrapihk.c:193
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:362
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InitUserApiHook(HINSTANCE hInstance, USERAPIHOOKPROC pfn)
Definition: usrapihk.c:255
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:496
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Status
Definition: gdiplustypes.h:24
HMODULE hLibrary
Definition: odbccp32.c:12
#define GetModuleHandle
Definition: winbase.h:3667
#define GetProcAddress(x, y)
Definition: compat.h:501
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158

Referenced by User32CallClientLoadLibraryFromKernel().

◆ DeregisterShellHookWindow()

BOOL WINAPI DeregisterShellHookWindow ( HWND  hWnd)

Definition at line 295 of file hook.c.

296 {
298 }
HWND hWnd
Definition: settings.c:17
EXTINLINE BOOL NtUserxDeregisterShellHookWindow(HWND hWnd)
Definition: ntwrapper.h:731

◆ GetMaskFromEvent()

static DWORD FASTCALL GetMaskFromEvent ( DWORD  Event)
static

Definition at line 46 of file hook.c.

47 {
48  DWORD Ret = 0;
49 
50  if ( Event > EVENT_OBJECT_STATECHANGE )
51  {
52  if ( Event == EVENT_OBJECT_LOCATIONCHANGE ) return SRV_EVENT_LOCATIONCHANGE;
53  if ( Event == EVENT_OBJECT_NAMECHANGE ) return SRV_EVENT_NAMECHANGE;
54  if ( Event == EVENT_OBJECT_VALUECHANGE ) return SRV_EVENT_VALUECHANGE;
55  return SRV_EVENT_CREATE;
56  }
57 
58  if ( Event == EVENT_OBJECT_STATECHANGE ) return SRV_EVENT_STATECHANGE;
59 
60  Ret = SRV_EVENT_RUNNING;
61 
62  if ( Event < EVENT_SYSTEM_MENUSTART ) return SRV_EVENT_CREATE;
63 
64  if ( Event <= EVENT_SYSTEM_MENUPOPUPEND )
65  {
66  Ret = SRV_EVENT_MENU;
67  }
68  else
69  {
70  if ( Event <= EVENT_CONSOLE_CARET-1 ) return SRV_EVENT_CREATE;
71  if ( Event <= EVENT_CONSOLE_END_APPLICATION ) return SRV_EVENT_END_APPLICATION;
72  if ( Event != EVENT_OBJECT_FOCUS ) return SRV_EVENT_CREATE;
73  }
74  return Ret;
75 }
#define SRV_EVENT_STATECHANGE
Definition: ntuser.h:1039
#define SRV_EVENT_CREATE
Definition: ntuser.h:1041
#define SRV_EVENT_NAMECHANGE
Definition: ntuser.h:1037
#define SRV_EVENT_MENU
Definition: ntuser.h:1034
#define SRV_EVENT_END_APPLICATION
Definition: ntuser.h:1035
#define SRV_EVENT_RUNNING
Definition: ntuser.h:1036
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SRV_EVENT_LOCATIONCHANGE
Definition: ntuser.h:1040
#define SRV_EVENT_VALUECHANGE
Definition: ntuser.h:1038

Referenced by IntNotifyWinEvent(), IsWinEventHookInstalled(), and NotifyWinEvent().

◆ IntNotifyWinEvent()

VOID FASTCALL IntNotifyWinEvent ( DWORD  event,
HWND  hwnd,
LONG  idObject,
LONG  idChild,
DWORD  flags 
)

Definition at line 113 of file hook.c.

120 {
121  NOTIFYEVENT ne;
122  ne.event = event;
123  ne.idObject = idObject;
124  ne.idChild = idChild;
125  ne.flags = flags;
128 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
PSERVERINFO gpsi
Definition: main.c:27
EXTINLINE VOID NtUserxNotifyWinEvent(HWND hWnd, PVOID ne)
Definition: ntwrapper.h:721
GLbitfield flags
Definition: glext.h:7161
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
Definition: hook.c:46
struct _cl_event * event
Definition: glext.h:7739
DWORD dwInstalledEventHooks
Definition: ntuser.h:1024

◆ IntSetWindowsHook()

static HHOOK FASTCALL IntSetWindowsHook ( int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hMod,
DWORD  dwThreadId,
BOOL  bAnsi 
)
static

Definition at line 80 of file hook.c.

86 {
88  UNICODE_STRING USModuleName;
89 
90  if (NULL != hMod)
91  {
92  if (0 == GetModuleFileNameW(hMod, ModuleName, MAX_PATH))
93  {
94  return NULL;
95  }
96  RtlInitUnicodeString(&USModuleName, ModuleName);
97  }
98  else
99  {
100  RtlInitUnicodeString(&USModuleName, NULL);
101  }
102 
103  return NtUserSetWindowsHookEx(hMod, &USModuleName, dwThreadId, idHook, lpfn, bAnsi);
104 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1274
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
HHOOK APIENTRY NtUserSetWindowsHookEx(HINSTANCE Mod, PUNICODE_STRING UnsafeModuleName, DWORD ThreadId, int HookId, HOOKPROC HookProc, BOOL Ansi)
Definition: hook.c:1441
#define MAX_PATH
Definition: compat.h:34
DWORD dwThreadId
Definition: fdebug.c:31
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by SetWindowsHookA(), SetWindowsHookExA(), SetWindowsHookExW(), and SetWindowsHookW().

◆ IsWinEventHookInstalled()

BOOL WINAPI IsWinEventHookInstalled ( DWORD  event)

Definition at line 389 of file hook.c.

391 {
392  if ((PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo)
393  {
395  }
396  return FALSE;
397 }
PSERVERINFO gpsi
Definition: main.c:27
#define FALSE
Definition: types.h:117
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
Definition: hook.c:46
struct _cl_event * event
Definition: glext.h:7739
DWORD dwInstalledEventHooks
Definition: ntuser.h:1024
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

◆ NotifyWinEvent()

VOID WINAPI NotifyWinEvent ( DWORD  event,
HWND  hwnd,
LONG  idObject,
LONG  idChild 
)

Definition at line 325 of file hook.c.

331 {
332 // "Servers call NotifyWinEvent to announce the event to the system after the
333 // event has occurred; they must never notify the system of an event before
334 // the event has occurred." msdn on NotifyWinEvent.
335  if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(event)) // Check to see.
336  NtUserNotifyWinEvent(event, hwnd, idObject, idChild);
337 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
PSERVERINFO gpsi
Definition: main.c:27
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
Definition: hook.c:46
struct _cl_event * event
Definition: glext.h:7739
DWORD dwInstalledEventHooks
Definition: ntuser.h:1024
VOID NTAPI NtUserNotifyWinEvent(DWORD Event, HWND hWnd, LONG idObject, LONG idChild)
Definition: event.c:255

Referenced by init_procs(), and MessageBoxProc().

◆ RegisterShellHookWindow()

BOOL WINAPI RegisterShellHookWindow ( HWND  hWnd)

Definition at line 305 of file hook.c.

306 {
308 }
HWND hWnd
Definition: settings.c:17
EXTINLINE BOOL NtUserxRegisterShellHookWindow(HWND hWnd)
Definition: ntwrapper.h:736

◆ SetWindowsHookA()

HHOOK WINAPI SetWindowsHookA ( int  idHook,
HOOKPROC  lpfn 
)

Definition at line 283 of file hook.c.

284 {
286  return IntSetWindowsHook(idHook, lpfn, NULL, ThreadId, TRUE);
287 // return NtUserSetWindowsHookAW(idHook, lpfn, TRUE);
288 }
#define PtrToUint(p)
Definition: basetsd.h:85
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
unsigned long DWORD
Definition: ntddk_ex.h:95
static HHOOK FASTCALL IntSetWindowsHook(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId, BOOL bAnsi)
Definition: hook.c:80
HANDLE UniqueThread
Definition: compat.h:574
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

◆ SetWindowsHookExA()

HHOOK WINAPI SetWindowsHookExA ( int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hMod,
DWORD  dwThreadId 
)

Definition at line 404 of file hook.c.

409 {
410  return IntSetWindowsHook(idHook, lpfn, hMod, dwThreadId, TRUE);
411 }
#define TRUE
Definition: types.h:120
static HHOOK FASTCALL IntSetWindowsHook(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId, BOOL bAnsi)
Definition: hook.c:80
DWORD dwThreadId
Definition: fdebug.c:31

◆ SetWindowsHookExW()

HHOOK WINAPI SetWindowsHookExW ( int  idHook,
HOOKPROC  lpfn,
HINSTANCE  hMod,
DWORD  dwThreadId 
)

Definition at line 419 of file hook.c.

424 {
425  return IntSetWindowsHook(idHook, lpfn, hMod, dwThreadId, FALSE);
426 }
#define FALSE
Definition: types.h:117
static HHOOK FASTCALL IntSetWindowsHook(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId, BOOL bAnsi)
Definition: hook.c:80
DWORD dwThreadId
Definition: fdebug.c:31

◆ SetWindowsHookW()

HHOOK WINAPI SetWindowsHookW ( int  idHook,
HOOKPROC  lpfn 
)

Definition at line 271 of file hook.c.

272 {
274  return IntSetWindowsHook(idHook, lpfn, NULL, ThreadId, FALSE);
275 // return NtUserSetWindowsHookAW(idHook, lpfn, FALSE);
276 }
#define PtrToUint(p)
Definition: basetsd.h:85
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
unsigned long DWORD
Definition: ntddk_ex.h:95
static HHOOK FASTCALL IntSetWindowsHook(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId, BOOL bAnsi)
Definition: hook.c:80
HANDLE UniqueThread
Definition: compat.h:574
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

◆ SetWinEventHook()

HWINEVENTHOOK WINAPI SetWinEventHook ( UINT  eventMin,
UINT  eventMax,
HMODULE  hmodWinEventProc,
WINEVENTPROC  pfnWinEventProc,
DWORD  idProcess,
DWORD  idThread,
UINT  dwFlags 
)

Definition at line 344 of file hook.c.

353 {
355  UNICODE_STRING USModuleName;
356  PUNICODE_STRING pusmodName;
357 
358  RtlInitUnicodeString(&USModuleName, NULL);
359 
360  if ((hmodWinEventProc != NULL) && (dwFlags & WINEVENT_INCONTEXT))
361  {
362  if (0 == GetModuleFileNameW(hmodWinEventProc, ModuleName, MAX_PATH))
363  {
364  return NULL;
365  }
366  RtlInitUnicodeString(&USModuleName, ModuleName);
367  pusmodName = &USModuleName;
368  }
369  else
370  {
371  pusmodName = NULL;
372  }
373 
374  return NtUserSetWinEventHook(eventMin,
375  eventMax,
376  hmodWinEventProc,
377  pusmodName,
378  pfnWinEventProc,
379  idProcess,
380  idThread,
381  dwFlags);
382 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1274
smooth NULL
Definition: ftsmooth.c:416
HWINEVENTHOOK NTAPI NtUserSetWinEventHook(UINT eventMin, UINT eventMax, HMODULE hmodWinEventProc, PUNICODE_STRING puString, WINEVENTPROC lpfnWinEventProc, DWORD idProcess, DWORD idThread, UINT dwflags)
Definition: event.c:287
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define WINEVENT_INCONTEXT
Definition: winable.h:35
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by init_procs().

◆ UnhookWindowsHook()

BOOL WINAPI UnhookWindowsHook ( int  nCode,
HOOKPROC  pfnFilterProc 
)

Definition at line 315 of file hook.c.

316 {
317  return NtUserxUnhookWindowsHook(nCode, pfnFilterProc);
318 }
EXTINLINE BOOL NtUserxUnhookWindowsHook(int nCode, HOOKPROC pfnFilterProc)
Definition: ntwrapper.h:701

◆ User32CallClientLoadLibraryFromKernel()

NTSTATUS WINAPI User32CallClientLoadLibraryFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 528 of file hook.c.

529 {
530  BOOL bResult;
532 
533  /* Retireve the callback parameters */
534  Argument = (PCLIENT_LOAD_LIBRARY_ARGUMENTS)Arguments;
535  if(Argument->strLibraryName.Buffer != NULL)
536  {
537  Argument->strLibraryName.Buffer = (PWCHAR)((ULONG_PTR)Argument->strLibraryName.Buffer + (ULONG_PTR)Argument);
538  }
539  if(Argument->strInitFuncName.Buffer != NULL)
540  {
541  Argument->strInitFuncName.Buffer = (PWCHAR)((ULONG_PTR)Argument->strInitFuncName.Buffer + (ULONG_PTR)Argument);
542  }
543 
544  /* Call the implementation of the callback */
545  bResult = ClientLoadLibrary(&Argument->strLibraryName,
546  &Argument->strInitFuncName,
547  Argument->Unload,
548  Argument->ApiHook);
549 
550  return ZwCallbackReturn(&bResult, sizeof(HINSTANCE), STATUS_SUCCESS);
551 }
uint16_t * PWCHAR
Definition: typedefs.h:56
UNICODE_STRING strInitFuncName
Definition: callback.h:123
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static BOOL ClientLoadLibrary(PUNICODE_STRING pstrLibName, PUNICODE_STRING pstrInitFunc, BOOL bUnload, BOOL bApiHook)
Definition: hook.c:430
struct _CLIENT_LOAD_LIBRARY_ARGUMENTS * PCLIENT_LOAD_LIBRARY_ARGUMENTS
#define ULONG_PTR
Definition: config.h:101
UNICODE_STRING strLibraryName
Definition: callback.h:122
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ User32CallEventProcFromKernel()

NTSTATUS WINAPI User32CallEventProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 795 of file hook.c.

796 {
798  WINEVENTPROC Proc;
800  DWORD len;
801  HMODULE mod = NULL;
802  BOOL Loaded = FALSE;
803 
804  Common = (PEVENTPROC_CALLBACK_ARGUMENTS) Arguments;
805 
806  Proc = Common->Proc;
807 
808  if (Common->offPfn && Common->Mod)
809  { // Validate the module again.
810  if (!(len = GetModuleFileNameW((HINSTANCE)Common->Mod, module, MAX_PATH)) || len >= MAX_PATH)
811  {
812  ERR("Error check for module!\n");
813  Common->Mod = 0;
814  }
815 
816  if (Common->Mod && !(mod = GetModuleHandleW(module)))
817  {
818  TRACE("Reloading Event Module.\n");
820  {
821  ERR("Failed to load Event Module.\n");
822  }
823  else
824  {
825  Loaded = TRUE; // Free it only when loaded.
826  }
827  }
828 
829  if (mod)
830  {
831  TRACE("Loading Event Module. %S\n",module);
832  Proc = (WINEVENTPROC)((char *)mod + Common->offPfn);
833  }
834  }
835 
836  Proc(Common->hook,
837  Common->event,
838  Common->hwnd,
839  Common->idObject,
840  Common->idChild,
841  Common->dwEventThread,
842  Common->dwmsEventTime);
843 
844  if (Loaded) FreeLibrary(mod);
845 
847 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
struct _EVENTPROC_CALLBACK_ARGUMENTS * PEVENTPROC_CALLBACK_ARGUMENTS
#define TRUE
Definition: types.h:120
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:339
Definition: fs_rec.h:186
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
VOID(CALLBACK * WINEVENTPROC)(HWINEVENTHOOK, DWORD, HWND, LONG, LONG, DWORD, DWORD)
Definition: winable.h:68
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:496
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:110
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
return STATUS_SUCCESS
Definition: btrfs.c:3014
static int mod
Definition: i386-dis.c:1273

◆ User32CallHookProcFromKernel()

NTSTATUS WINAPI User32CallHookProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 554 of file hook.c.

555 {
557  CREATESTRUCTW *pCsw = NULL;
558  CBT_CREATEWNDW *pCbtCreatewndw = NULL;
559  PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra = NULL;
560  KBDLLHOOKSTRUCT KeyboardLlData, *pKeyboardLlData;
561  MSLLHOOKSTRUCT MouseLlData, *pMouseLlData;
562  MSG *pcMsg, *pMsg;
563  PMOUSEHOOKSTRUCT pMHook;
564  CWPSTRUCT *pCWP;
565  CWPRETSTRUCT *pCWPR;
566  PRECTL prl;
567  LPCBTACTIVATESTRUCT pcbtas;
568  HOOKPROC Proc;
569  WPARAM wParam = 0;
570  LPARAM lParam = 0;
571  LRESULT Result = 0;
572  BOOL Hit = FALSE, Loaded = FALSE;
573  HMODULE mod = NULL;
575 
576  Common = (PHOOKPROC_CALLBACK_ARGUMENTS) Arguments;
577 
578  Proc = Common->Proc;
579  // HookProc Justin Case module is from another process.
580  if (Common->offPfn && Common->Mod)
581  {
582  if (!(mod = GetModuleHandleW((LPCWSTR)Common->ModuleName)))
583  {
584  TRACE("Reloading Hook Module.\n");
586  {
587  ERR("Failed to load Hook Module.\n");
588  }
589  else
590  {
591  Loaded = TRUE; // Free it only when loaded.
592  }
593  }
594  if (mod)
595  {
596  TRACE("Loading Hook Module. %S\n",Common->ModuleName);
597  Proc = (HOOKPROC)((char *)mod + Common->offPfn);
598  }
599  }
600 
601  switch(Common->HookId)
602  {
603  case WH_CBT:
604  {
605  //ERR("WH_CBT: Code %d\n", Common->Code);
606  switch(Common->Code)
607  {
608  case HCBT_CREATEWND:
609  CbtCreatewndExtra = (PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS)
610  ((PCHAR) Common + Common->lParam);
611 
612  pCbtCreatewndw = (CBT_CREATEWNDW*)HeapAlloc(GetProcessHeap(), 0, sizeof(CBT_CREATEWNDW));
613  RtlCopyMemory(pCbtCreatewndw, CbtCreatewndExtra, sizeof(CBT_CREATEWNDW));
614 
615  pCsw = (CREATESTRUCTW*)HeapAlloc(GetProcessHeap(), 0, sizeof(CREATESTRUCTW));
616  RtlCopyMemory(pCsw, &CbtCreatewndExtra->Cs, sizeof(CREATESTRUCTW));
617 
618  pCbtCreatewndw->lpcs = pCsw;
619  pCbtCreatewndw->hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
620  wParam = Common->wParam;
621  lParam = (LPARAM) pCbtCreatewndw;
622  //ERR("HCBT_CREATEWND: hWnd %p Csw %p Name %p Class %p\n", Common->wParam, pCsw, pCsw->lpszName, pCsw->lpszClass);
623  break;
624  case HCBT_CLICKSKIPPED:
625  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
626  lParam = (LPARAM) pMHook;
627  wParam = Common->wParam;
628  break;
629  case HCBT_MOVESIZE:
630  prl = (PRECTL)((PCHAR) Common + Common->lParam);
631  lParam = (LPARAM) prl;
632  wParam = Common->wParam;
633  break;
634  case HCBT_ACTIVATE:
635  //ERR("HCBT_ACTIVATE: hwnd %p\n",Common->wParam);
636  pcbtas = (LPCBTACTIVATESTRUCT)((PCHAR) Common + Common->lParam);
637  lParam = (LPARAM) pcbtas;
638  wParam = Common->wParam;
639  break;
640  case HCBT_KEYSKIPPED: /* The rest SEH support */
641  case HCBT_MINMAX:
642  case HCBT_SETFOCUS:
643  case HCBT_SYSCOMMAND:
644  case HCBT_DESTROYWND:
645  case HCBT_QS:
646  wParam = Common->wParam;
647  lParam = Common->lParam;
648  break;
649  default:
650  if (Loaded) FreeLibrary(mod);
651  ERR("HCBT_ not supported = %d\n", Common->Code);
653  }
654 
655  if (Proc)
656  {
657  _SEH2_TRY
658  {
659  Result = Proc(Common->Code, wParam, lParam);
660  }
662  {
663  Hit = TRUE;
664  }
665  _SEH2_END;
666  }
667  else
668  {
669  ERR("Null Proc! Common = 0x%x, Proc = 0x%x\n",Common,Proc);
670  }
671  switch(Common->Code)
672  {
673  case HCBT_CREATEWND:
674  CbtCreatewndExtra->WndInsertAfter = pCbtCreatewndw->hwndInsertAfter;
675  CbtCreatewndExtra->Cs.x = pCbtCreatewndw->lpcs->x;
676  CbtCreatewndExtra->Cs.y = pCbtCreatewndw->lpcs->y;
677  CbtCreatewndExtra->Cs.cx = pCbtCreatewndw->lpcs->cx;
678  CbtCreatewndExtra->Cs.cy = pCbtCreatewndw->lpcs->cy;
679  HeapFree(GetProcessHeap(), 0, pCsw);
680  HeapFree(GetProcessHeap(), 0, pCbtCreatewndw);
681  break;
682  }
683  break;
684  }
685  case WH_KEYBOARD_LL:
686  //ERR("WH_KEYBOARD_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
687  pKeyboardLlData = (PKBDLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
688  RtlCopyMemory(&KeyboardLlData, pKeyboardLlData, sizeof(KBDLLHOOKSTRUCT));
689  Result = Proc(Common->Code, Common->wParam, (LPARAM) &KeyboardLlData);
690  break;
691  case WH_MOUSE_LL:
692  //ERR("WH_MOUSE_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
693  pMouseLlData = (PMSLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
694  RtlCopyMemory(&MouseLlData, pMouseLlData, sizeof(MSLLHOOKSTRUCT));
695  Result = Proc(Common->Code, Common->wParam, (LPARAM) &MouseLlData);
696  break;
697  case WH_MOUSE: /* SEH support */
698  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
699  _SEH2_TRY
700  {
701  Result = Proc(Common->Code, Common->wParam, (LPARAM) pMHook);
702  }
704  {
705  Hit = TRUE;
706  }
707  _SEH2_END;
708  break;
709  case WH_CALLWNDPROC:
710  {
711  PCWP_Struct pcwps = (PCWP_Struct)Common;
712  CWPSTRUCT *pCWPT = &pcwps->cwps;
713  pCWP = HeapAlloc(GetProcessHeap(), 0, Common->lParamSize + sizeof(CWPSTRUCT));
714  RtlCopyMemory(pCWP, pCWPT, sizeof(CWPSTRUCT));
715 // ERR("WH_CALLWNDPROC: Code %d, wParam %d msg %d\n",Common->Code,Common->wParam,pCWP->message);
716  /* If more memory is reserved, then lParam is a pointer.
717  * Size of the buffer is stocked in the lParam member, and its content
718  * is at the end of the argument buffer */
719  if ( Common->lParamSize )
720  {
721  pCWP->lParam = (LPARAM)((PCHAR)pCWP + sizeof(CWPSTRUCT));
722  RtlCopyMemory( (PCHAR)pCWP + sizeof(CWPSTRUCT), &pcwps->Extra, Common->lParamSize );
723  }
724  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWP);
725  HeapFree(GetProcessHeap(), 0, pCWP);
726  }
727  break;
728  case WH_CALLWNDPROCRET:
729  /* Almost the same as WH_CALLWNDPROC */
730  {
731  PCWPR_Struct pcwprs = (PCWPR_Struct)Common;
732  CWPRETSTRUCT *pCWPRT = &pcwprs->cwprs;
733  pCWPR = HeapAlloc(GetProcessHeap(), 0, Common->lParamSize + sizeof(CWPRETSTRUCT));
734  RtlCopyMemory(pCWPR, pCWPRT, sizeof(CWPSTRUCT));
735  if ( Common->lParamSize )
736  {
737  pCWPR->lParam = (LPARAM)((PCHAR)pCWPR + sizeof(CWPRETSTRUCT));
738  RtlCopyMemory( (PCHAR)pCWPR + sizeof(CWPRETSTRUCT), &pcwprs->Extra, Common->lParamSize );
739  }
740  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWPR);
741  HeapFree(GetProcessHeap(), 0, pCWPR);
742  }
743  break;
744  case WH_MSGFILTER: /* All SEH support */
745  case WH_SYSMSGFILTER:
746  case WH_GETMESSAGE:
747  pMsg = (PMSG)((PCHAR) Common + Common->lParam);
748  pcMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSG));
749  RtlCopyMemory(pcMsg, pMsg, sizeof(MSG));
750 // ERR("pMsg %d pcMsg %d\n",pMsg->message, pcMsg->message);
751  _SEH2_TRY
752  {
753  Result = Proc(Common->Code, Common->wParam, (LPARAM) pcMsg);
754  }
756  {
757  Hit = TRUE;
758  }
759  _SEH2_END;
760  if (!Hit && Common->HookId == WH_GETMESSAGE)
761  RtlCopyMemory(pMsg, pcMsg, sizeof(MSG));
762  HeapFree( GetProcessHeap(), 0, pcMsg );
763  break;
764  case WH_KEYBOARD:
765  case WH_SHELL:
766  Result = Proc(Common->Code, Common->wParam, Common->lParam);
767  break;
768  case WH_FOREGROUNDIDLE: /* <-- SEH support */
769  _SEH2_TRY
770  {
771  Result = Proc(Common->Code, Common->wParam, Common->lParam);
772  }
774  {
775  Hit = TRUE;
776  }
777  _SEH2_END;
778  break;
779  default:
780  if (Loaded) FreeLibrary(mod);
781  ERR("WH_ not supported = %d\n", Common->HookId);
783  }
784  if (Hit)
785  {
786  ERR("Hook Exception! Id: %d, Code %d, Proc 0x%x\n",Common->HookId,Common->Code,Proc);
788  }
789  if (Loaded) FreeLibrary(mod);
790  Common->Result = Result;
791  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
792 }
#define WH_MOUSE
Definition: winuser.h:37
signed char * PCHAR
Definition: retypes.h:7
#define HCBT_CLICKSKIPPED
Definition: winuser.h:61
struct tagCWPSTRUCT CWPSTRUCT
#define HCBT_SYSCOMMAND
Definition: winuser.h:63
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define WH_GETMESSAGE
Definition: winuser.h:33
#define HCBT_CREATEWND
Definition: winuser.h:58
struct RECTL * PRECTL
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TRUE
Definition: types.h:120
LPCREATESTRUCTW lpcs
Definition: winuser.h:2950
struct tagCWP_Struct * PCWP_Struct
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WH_MSGFILTER
Definition: winuser.h:29
struct _HOOKPROC_CALLBACK_ARGUMENTS * PHOOKPROC_CALLBACK_ARGUMENTS
LONG NTSTATUS
Definition: precomp.h:26
#define WH_SHELL
Definition: winuser.h:40
CWPSTRUCT cwps
Definition: callback.h:79
LPARAM lParam
Definition: winuser.h:2993
struct tagCBT_CREATEWNDW CBT_CREATEWNDW
UINT_PTR WPARAM
Definition: windef.h:207
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:339
WPARAM wParam
Definition: combotst.c:138
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2874
Definition: fs_rec.h:186
_SEH2_TRY
Definition: create.c:4226
#define HCBT_KEYSKIPPED
Definition: winuser.h:62
HWND hwndInsertAfter
Definition: winuser.h:2951
#define WH_FOREGROUNDIDLE
Definition: winuser.h:41
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
struct tagCWPRETSTRUCT CWPRETSTRUCT
#define WH_MOUSE_LL
Definition: winuser.h:44
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HCBT_DESTROYWND
Definition: winuser.h:59
PBYTE Extra[4]
Definition: callback.h:80
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LONG_PTR LPARAM
Definition: windef.h:208
struct tagCREATESTRUCTW CREATESTRUCTW
#define WH_CBT
Definition: winuser.h:35
struct tagMOUSEHOOKSTRUCT * PMOUSEHOOKSTRUCT
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
CWPRETSTRUCT cwprs
Definition: callback.h:86
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:496
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WH_KEYBOARD_LL
Definition: winuser.h:43
LPARAM lParam
Definition: winuser.h:3000
PBYTE Extra[4]
Definition: callback.h:87
#define HCBT_QS
Definition: winuser.h:57
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
struct tagCWPR_Struct * PCWPR_Struct
#define WH_CALLWNDPROC
Definition: winuser.h:34
struct tagCBTACTIVATESTRUCT * LPCBTACTIVATESTRUCT
#define HCBT_MINMAX
Definition: winuser.h:56
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
struct tagMSG * PMSG
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define WH_KEYBOARD
Definition: winuser.h:32
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
struct tagMSLLHOOKSTRUCT * PMSLLHOOKSTRUCT
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define WH_SYSMSGFILTER
Definition: winuser.h:36
LPARAM lParam
Definition: combotst.c:139
struct tagKBDLLHOOKSTRUCT * PKBDLLHOOKSTRUCT
#define HeapFree(x, y, z)
Definition: compat.h:483
struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS * PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
static int mod
Definition: i386-dis.c:1273

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )