Author: jimtabor
Date: Sat Jun 27 22:36:29 2009
New Revision: 41642
URL:
http://svn.reactos.org/svn/reactos?rev=41642&view=rev
Log:
- Implement the rest of the HCBT_ support.
Modified:
trunk/reactos/dll/win32/user32/windows/hook.c
trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
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 Jun 27 22:36:29 2009
@@ -414,15 +414,17 @@
CBT_CREATEWNDW CbtCreatewndw;
CREATESTRUCTA Csa;
CBT_CREATEWNDA CbtCreatewnda;
- PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra;
- WPARAM wParam;
- LPARAM lParam;
+ PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra = NULL;
+ WPARAM wParam = 0;
+ LPARAM lParam = 0;
PKBDLLHOOKSTRUCT KeyboardLlData;
PMSLLHOOKSTRUCT MouseLlData;
PMSG Msg;
PMOUSEHOOKSTRUCT MHook;
PCWPSTRUCT CWP;
PCWPRETSTRUCT CWPR;
+ PRECTL prl;
+ LPCBTACTIVATESTRUCT pcbtas;
Common = (PHOOKPROC_CALLBACK_ARGUMENTS) Arguments;
@@ -430,39 +432,59 @@
{
case WH_CBT:
switch(Common->Code)
- {
+ {
case HCBT_CREATEWND:
CbtCreatewndExtra = (PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS)
((PCHAR) Common + Common->lParam);
Csw = CbtCreatewndExtra->Cs;
if (NULL != CbtCreatewndExtra->Cs.lpszName)
- {
+ {
Csw.lpszName = (LPCWSTR)((PCHAR) CbtCreatewndExtra
+ (ULONG) CbtCreatewndExtra->Cs.lpszName);
- }
+ }
if (0 != HIWORD(CbtCreatewndExtra->Cs.lpszClass))
- {
+ {
Csw.lpszClass = (LPCWSTR)((PCHAR) CbtCreatewndExtra
+ LOWORD((ULONG)
CbtCreatewndExtra->Cs.lpszClass));
- }
+ }
wParam = Common->wParam;
if (Common->Ansi)
- {
+ {
memcpy(&Csa, &Csw, sizeof(CREATESTRUCTW));
CbtCreatewnda.lpcs = &Csa;
CbtCreatewnda.hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
lParam = (LPARAM) &CbtCreatewnda;
- }
+ }
else
- {
+ {
CbtCreatewndw.lpcs = &Csw;
CbtCreatewndw.hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
lParam = (LPARAM) &CbtCreatewndw;
- }
+ }
break;
+ case HCBT_CLICKSKIPPED:
+ MHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
+ lParam = (LPARAM) MHook;
+ break;
+ case HCBT_MOVESIZE:
+ prl = (PRECTL)((PCHAR) Common + Common->lParam);
+ lParam = (LPARAM) prl;
+ break;
+ case HCBT_ACTIVATE:
+ pcbtas = (LPCBTACTIVATESTRUCT)((PCHAR) Common + Common->lParam);
+ lParam = (LPARAM) pcbtas;
+ break;
+ case HCBT_KEYSKIPPED:
+ case HCBT_MINMAX:
+ case HCBT_SETFOCUS:
+ case HCBT_SYSCOMMAND:
+ case HCBT_DESTROYWND:
+ case HCBT_QS:
+ break;
default:
+ ERR("HCBT_ not supported = %d\n", Common->Code);
return ZwCallbackReturn(NULL, 0, STATUS_NOT_SUPPORTED);
- }
+ }
if (Common->Proc)
Result = Common->Proc(Common->Code, wParam, lParam);
@@ -472,11 +494,11 @@
}
switch(Common->Code)
- {
+ {
case HCBT_CREATEWND:
CbtCreatewndExtra->WndInsertAfter = CbtCreatewndw.hwndInsertAfter;
break;
- }
+ }
break;
case WH_KEYBOARD_LL:
KeyboardLlData = (PKBDLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] Sat Jun 27
22:36:29 2009
@@ -391,6 +391,25 @@
}
}
break;
+
+ case HCBT_MOVESIZE:
+ ArgumentLength += sizeof(RECTL);
+ break;
+ case HCBT_ACTIVATE:
+ ArgumentLength += sizeof(CBTACTIVATESTRUCT);
+ break;
+ case HCBT_CLICKSKIPPED:
+ ArgumentLength += sizeof(MOUSEHOOKSTRUCT);
+ break;
+/* ATM pass on */
+ case HCBT_KEYSKIPPED:
+ case HCBT_MINMAX:
+ case HCBT_SETFOCUS:
+ case HCBT_SYSCOMMAND:
+/* These types pass through. */
+ case HCBT_DESTROYWND:
+ case HCBT_QS:
+ break;
default:
DPRINT1("Trying to call unsupported CBT hook %d\n", Code);
return 0;
@@ -481,6 +500,18 @@
*((WCHAR *) Extra) = L'\0';
}
break;
+ case HCBT_CLICKSKIPPED:
+ RtlCopyMemory(Extra, (PVOID) lParam, sizeof(MOUSEHOOKSTRUCT));
+ Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+ break;
+ case HCBT_MOVESIZE:
+ RtlCopyMemory(Extra, (PVOID) lParam, sizeof(RECTL));
+ Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+ break;
+ case HCBT_ACTIVATE:
+ RtlCopyMemory(Extra, (PVOID) lParam, sizeof(CBTACTIVATESTRUCT));
+ Common->lParam = (LPARAM) (Extra - (PCHAR) Common);
+ break;
}
break;
case WH_KEYBOARD_LL:
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sat Jun 27 22:36:29
2009
@@ -2430,13 +2430,10 @@
IntDereferenceMessageQueue(Window->MessageQueue);
/* Call hooks */
-#if 0 /* FIXME */
-
- if (co_HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hwnd, 0, TRUE))
+ if (co_HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) Window->hSelf, 0))
{
return FALSE;
}
-#endif
IntEngWindowChanged(Window, WOC_DELETE);
isChild = (0 != (Wnd->Style & WS_CHILD));