Author: jimtabor
Date: Sat Apr 12 14:19:30 2008
New Revision: 32928
URL:
http://svn.reactos.org/svn/reactos?rev=32928&view=rev
Log:
More work on hooks.
Modified:
trunk/reactos/dll/win32/user32/user32.def
trunk/reactos/dll/win32/user32/windows/hook.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
Modified: trunk/reactos/dll/win32/user32/user32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/user32.de…
==============================================================================
--- trunk/reactos/dll/win32/user32/user32.def [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/user32.def [iso-8859-1] Sat Apr 12 14:19:30 2008
@@ -691,7 +691,7 @@
TranslateMDISysAccel@8
TranslateMessage@4
TranslateMessageEx@8
-UnhookWinEvent@4
+UnhookWinEvent@4=NtUserUnhookWinEvent@4
UnhookWindowsHook@8
UnhookWindowsHookEx@4
UnionRect@12
Modified: trunk/reactos/dll/win32/user32/windows/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/h…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/hook.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/hook.c [iso-8859-1] Sat Apr 12 14:19:30 2008
@@ -211,14 +211,13 @@
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
STDCALL
UnhookWindowsHook ( int nCode, HOOKPROC pfnFilterProc )
{
- UNIMPLEMENTED;
- return FALSE;
+ return NtUserCallTwoParam(nCode, (DWORD)pfnFilterProc,
TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK);
}
/*
@@ -233,11 +232,11 @@
LONG idChild
)
{
- UNIMPLEMENTED;
-}
-
-/*
- * @unimplemented
+ NtUserNotifyWinEvent(event, hwnd, idObject, idChild);
+}
+
+/*
+ * @implemented
*/
HWINEVENTHOOK
STDCALL
@@ -251,19 +250,30 @@
UINT dwFlags
)
{
- UNIMPLEMENTED;
- return FALSE;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-UnhookWinEvent ( HWINEVENTHOOK hWinEventHook )
-{
- UNIMPLEMENTED;
- return FALSE;
+ WCHAR ModuleName[MAX_PATH];
+ UNICODE_STRING USModuleName;
+
+ if ((hmodWinEventProc != NULL) && (dwFlags & WINEVENT_INCONTEXT))
+ {
+ if (0 == GetModuleFileNameW(hmodWinEventProc, ModuleName, MAX_PATH))
+ {
+ return NULL;
+ }
+ RtlInitUnicodeString(&USModuleName, ModuleName);
+ }
+ else
+ {
+ RtlInitUnicodeString(&USModuleName, NULL);
+ }
+
+ return NtUserSetWinEventHook(eventMin,
+ eventMax,
+ hmodWinEventProc,
+ &USModuleName,
+ pfnWinEventProc,
+ idProcess,
+ idThread,
+ dwFlags);
}
/*
@@ -274,10 +284,11 @@
IsWinEventHookInstalled(
DWORD event)
{
- UNIMPLEMENTED;
+ if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
+ {
+ }
return FALSE;
}
-
/*
* @unimplemented
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Sat Apr 12 14:19:30 2008
@@ -2233,7 +2233,7 @@
WORD NTAPI
NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewVal);
-DWORD
+HWINEVENTHOOK
NTAPI
NtUserSetWinEventHook(
UINT eventMin,
@@ -2330,7 +2330,7 @@
DWORD
NTAPI
NtUserUnhookWinEvent(
- DWORD Unknown0);
+ HWINEVENTHOOK hWinEventHook);
BOOL
NTAPI
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Sat Apr 12 14:19:30
2008
@@ -697,7 +697,7 @@
END_CLEANUP;
}
-DWORD
+HWINEVENTHOOK
STDCALL
NtUserSetWinEventHook(
UINT eventMin,
@@ -765,7 +765,7 @@
DWORD
STDCALL
NtUserUnhookWinEvent(
- DWORD Unknown0)
+ HWINEVENTHOOK hWinEventHook)
{
UNIMPLEMENTED