Author: jimtabor Date: Sat Apr 12 16:07:40 2008 New Revision: 32932
URL: http://svn.reactos.org/svn/reactos?rev=32932&view=rev Log: More hook removal and cleanup.
Modified: trunk/reactos/dll/win32/user32/user32.def trunk/reactos/dll/win32/user32/windows/hook.c
Modified: trunk/reactos/dll/win32/user32/user32.def URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/user32.def... ============================================================================== --- trunk/reactos/dll/win32/user32/user32.def [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/user32.def [iso-8859-1] Sat Apr 12 16:07:40 2008 @@ -693,7 +693,7 @@ TranslateMessageEx@8 UnhookWinEvent@4=NtUserUnhookWinEvent@4 UnhookWindowsHook@8 -UnhookWindowsHookEx@4 +UnhookWindowsHookEx@4=NtUserUnhookWindowsHookEx@4 UnionRect@12 UnloadKeyboardLayout@4=NtUserUnloadKeyboardLayout@4 UnlockWindowStation@4
Modified: trunk/reactos/dll/win32/user32/windows/hook.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/ho... ============================================================================== --- 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 16:07:40 2008 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ +/* * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -70,113 +70,6 @@ if ( Event != EVENT_OBJECT_FOCUS ) return SRV_EVENT_CREATE; } return Ret; -} - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -BOOL -STDCALL -UnhookWindowsHookEx( - HHOOK Hook) -{ - return NtUserUnhookWindowsHookEx(Hook); -} -#if 0 -BOOL -STDCALL -CallMsgFilter( - LPMSG lpMsg, - int nCode) -{ - UNIMPLEMENTED; - return FALSE; -} -#endif - - -/* - * @implemented - */ -BOOL -STDCALL -CallMsgFilterA( - LPMSG lpMsg, - int nCode) -{ - BOOL ret = FALSE; - - if (nCode != HCBT_CREATEWND) ret = NtUserCallMsgFilter((LPMSG) lpMsg, nCode); - else - { - UNICODE_STRING usBuffer; - CBT_CREATEWNDA *cbtcwA = (CBT_CREATEWNDA *)lpMsg->lParam; - CBT_CREATEWNDW cbtcwW; - CREATESTRUCTW csW; - MSG Msg; - - Msg.hwnd = lpMsg->hwnd; - Msg.message = lpMsg->message; - Msg.time = lpMsg->time; - Msg.pt = lpMsg->pt; - Msg.wParam = lpMsg->wParam; - - cbtcwW.lpcs = &csW; - cbtcwW.hwndInsertAfter = cbtcwA->hwndInsertAfter; - csW = *(CREATESTRUCTW *)cbtcwA->lpcs; - - if (HIWORD(cbtcwA->lpcs->lpszName)) - { - RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszName); - csW.lpszName = usBuffer.Buffer; - } - if (HIWORD(cbtcwA->lpcs->lpszClass)) - { - RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszClass); - csW.lpszClass = usBuffer.Buffer; - } - Msg.lParam =(LPARAM) &cbtcwW; - - ret = NtUserCallMsgFilter((LPMSG)&Msg, nCode); - - lpMsg->time = Msg.time; - lpMsg->pt = Msg.pt; - - cbtcwA->hwndInsertAfter = cbtcwW.hwndInsertAfter; - if (HIWORD(csW.lpszName)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszName ); - if (HIWORD(csW.lpszClass)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszClass ); - } - return ret; -} - - -/* - * @implemented - */ -BOOL -STDCALL -CallMsgFilterW( - LPMSG lpMsg, - int nCode) -{ - return NtUserCallMsgFilter((LPMSG) lpMsg, nCode); -} - - -/* - * @unimplemented - */ -LRESULT -STDCALL -CallNextHookEx( - HHOOK Hook, - int Code, - WPARAM wParam, - LPARAM lParam) -{ - return NtUserCallNextHookEx(Hook, Code, wParam, lParam); }
static @@ -206,6 +99,103 @@ }
return NtUserSetWindowsHookEx(hMod, &USModuleName, dwThreadId, idHook, lpfn, bAnsi); +} + + +/* FUNCTIONS *****************************************************************/ + +#if 0 +BOOL +STDCALL +CallMsgFilter( + LPMSG lpMsg, + int nCode) +{ + UNIMPLEMENTED; + return FALSE; +} +#endif + +/* + * @implemented + */ +BOOL +STDCALL +CallMsgFilterA( + LPMSG lpMsg, + int nCode) +{ + BOOL ret = FALSE; + + if (nCode != HCBT_CREATEWND) ret = NtUserCallMsgFilter((LPMSG) lpMsg, nCode); + else + { + UNICODE_STRING usBuffer; + CBT_CREATEWNDA *cbtcwA = (CBT_CREATEWNDA *)lpMsg->lParam; + CBT_CREATEWNDW cbtcwW; + CREATESTRUCTW csW; + MSG Msg; + + Msg.hwnd = lpMsg->hwnd; + Msg.message = lpMsg->message; + Msg.time = lpMsg->time; + Msg.pt = lpMsg->pt; + Msg.wParam = lpMsg->wParam; + + cbtcwW.lpcs = &csW; + cbtcwW.hwndInsertAfter = cbtcwA->hwndInsertAfter; + csW = *(CREATESTRUCTW *)cbtcwA->lpcs; + + if (HIWORD(cbtcwA->lpcs->lpszName)) + { + RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszName); + csW.lpszName = usBuffer.Buffer; + } + if (HIWORD(cbtcwA->lpcs->lpszClass)) + { + RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszClass); + csW.lpszClass = usBuffer.Buffer; + } + Msg.lParam =(LPARAM) &cbtcwW; + + ret = NtUserCallMsgFilter((LPMSG)&Msg, nCode); + + lpMsg->time = Msg.time; + lpMsg->pt = Msg.pt; + + cbtcwA->hwndInsertAfter = cbtcwW.hwndInsertAfter; + if (HIWORD(csW.lpszName)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszName ); + if (HIWORD(csW.lpszClass)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszClass ); + } + return ret; +} + + +/* + * @implemented + */ +BOOL +STDCALL +CallMsgFilterW( + LPMSG lpMsg, + int nCode) +{ + return NtUserCallMsgFilter((LPMSG) lpMsg, nCode); +} + + +/* + * @unimplemented + */ +LRESULT +STDCALL +CallNextHookEx( + HHOOK Hook, + int Code, + WPARAM wParam, + LPARAM lParam) +{ + return NtUserCallNextHookEx(Hook, Code, wParam, lParam); }
/*