30 if (
Event > EVENT_OBJECT_STATECHANGE )
44 if (
Event <= EVENT_SYSTEM_MENUPOPUPEND )
63 TRACE(
"SetSrvEventMask 1\n");
64 for (
event = EventMin;
event <= EventMax;
event++)
66 if ((
event >= EVENT_SYSTEM_SOUND &&
event <= EVENT_SYSTEM_MINIMIZEEND) ||
67 (
event >= EVENT_CONSOLE_CARET &&
event <= EVENT_CONSOLE_END_APPLICATION) ||
68 (
event >= EVENT_OBJECT_CREATE &&
event <= EVENT_OBJECT_ACCELERATORCHANGE))
72 if (
event > EVENT_SYSTEM_MINIMIZEEND &&
event < EVENT_CONSOLE_CARET)
74 event = EVENT_CONSOLE_CARET-1;
77 if (
event > EVENT_CONSOLE_END_APPLICATION &&
event < EVENT_OBJECT_CREATE )
79 event = EVENT_OBJECT_CREATE-1;
82 if (
event > EVENT_OBJECT_ACCELERATORCHANGE &&
event < EVENT_MAX)
131 TRACE(
"IntRemoveEvent pEH %p\n", pEH);
160 TRACE(
"Dispatch Event 0x%lx, idObject %uI hwnd %p\n",
event, idObject,
hwnd);
199 pti = pWnd->
head.pti;
208 ListEntry = ListEntry->
Flink;
302 TRACE(
"NtUserSetWinEventHook hmod %p, pfn %p\n", hmodWinEventProc, lpfnWinEventProc);
318 if (eventMin > eventMax)
324 if (!lpfnWinEventProc)
332 if (!hmodWinEventProc)
334 ERR(
"Hook needs a module\n");
338 if (puString ==
NULL)
340 ERR(
"Dll not found\n");
347 TRACE(
"Out of Context\n");
348 hmodWinEventProc = 0;
387 if (hmodWinEventProc !=
NULL)
389 pEH->
offPfn = (
ULONG_PTR)((
char *)lpfnWinEventProc - (
char *)hmodWinEventProc);
391 pEH->
Proc = lpfnWinEventProc;
395 pEH->
Proc = lpfnWinEventProc;
#define UlongToHandle(ul)
#define DBG_DEFAULT_CHANNEL(ch)
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
#define EngGetTickCount32()
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define InitializeListHead(ListHead)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
struct tagEVENTHOOK * PEVENTHOOK
#define UserHMGetHandle(obj)
#define SRV_EVENT_VALUECHANGE
#define SRV_EVENT_NAMECHANGE
#define SRV_EVENT_END_APPLICATION
#define SRV_EVENT_LOCATIONCHANGE
#define SRV_EVENT_STATECHANGE
#define UserHMSetHandle(obj, handle)
#define SRV_EVENT_RUNNING
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
#define ExFreePoolWithTag(_P, _T)
static _In_ DWORD dwflags
static HWINEVENTHOOK(WINAPI *pSetWinEventHook)(DWORD
VOID FASTCALL MsqPostMessage(PTHREADINFO pti, MSG *Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent, LONG_PTR ExtraInfo)
unsigned __int3264 UINT_PTR
NTSTATUS NTAPI PsLookupThreadByThreadId(IN HANDLE ThreadId, OUT PETHREAD *Thread)
PVOID NTAPI PsGetThreadWin32Thread(IN PETHREAD Thread)
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
VOID FASTCALL UserLeave(VOID)
VOID FASTCALL UserEnterExclusive(VOID)
static __inline VOID UserDerefObjectCo(PVOID obj)
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
struct _LIST_ENTRY * Flink
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
PWND FASTCALL UserGetWindowObject(HWND hWnd)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
LRESULT APIENTRY co_IntCallEventProc(HWINEVENTHOOK hook, DWORD event, HWND hWnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime, WINEVENTPROC Proc, INT Mod, ULONG_PTR offPfn)
VOID APIENTRY NtUserNotifyWinEvent(DWORD Event, HWND hWnd, LONG idObject, LONG idChild)
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
BOOLEAN IntRemoveEvent(PVOID Object)
static PEVENTTABLE GlobalEvents
static LRESULT FASTCALL IntCallLowLevelEvent(PEVENTHOOK pEH, DWORD event, HWND hwnd, LONG idObject, LONG idChild, LONG idThread)
struct _EVENTPACK EVENTPACK
HWINEVENTHOOK APIENTRY NtUserSetWinEventHook(UINT eventMin, UINT eventMax, HMODULE hmodWinEventProc, PUNICODE_STRING puString, WINEVENTPROC lpfnWinEventProc, DWORD idProcess, DWORD idThread, UINT dwflags)
LRESULT APIENTRY co_EVENT_CallEvents(DWORD event, HWND hwnd, UINT_PTR idObject, LONG_PTR idChild)
BOOL APIENTRY NtUserUnhookWinEvent(HWINEVENTHOOK hWinEventHook)
struct _EVENTPACK * PEVENTPACK
static VOID FASTCALL IntSetSrvEventMask(UINT EventMin, UINT EventMax)
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
BOOL FASTCALL UserDereferenceObject(PVOID Object)
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
PUSER_HANDLE_TABLE gHandleTable
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
VOID(CALLBACK * WINEVENTPROC)(HWINEVENTHOOK, DWORD, HWND, LONG, LONG, DWORD, DWORD)
#define WINEVENT_INCONTEXT
#define WINEVENT_SKIPOWNPROCESS
#define WINEVENT_SKIPOWNTHREAD
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
#define ERROR_INVALID_FILTER_PROC
#define ERROR_INVALID_THREAD_ID
#define ERROR_HOOK_NEEDS_HMOD
#define ERROR_DLL_NOT_FOUND
#define ERROR_INVALID_HOOK_FILTER
_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
_Out_ PCLIENT_ID ClientId
#define ObDereferenceObject