Author: jimtabor
Date: Fri Jun 26 06:10:52 2009
New Revision: 41617
URL:
http://svn.reactos.org/svn/reactos?rev=41617&view=rev
Log:
- Fix breakage when in HCBT_CREATEWND callback.
Modified:
trunk/reactos/dll/win32/user32/windows/hook.c
trunk/reactos/subsystems/win32/win32k/include/win32.h
trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
trunk/reactos/subsystems/win32/win32k/ntuser/hook.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] Fri Jun 26 06:10:52 2009
@@ -412,10 +412,8 @@
LRESULT Result;
CREATESTRUCTW Csw;
CBT_CREATEWNDW CbtCreatewndw;
- UNICODE_STRING UString;
CREATESTRUCTA Csa;
CBT_CREATEWNDA CbtCreatewnda;
- ANSI_STRING AString;
PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra;
WPARAM wParam;
LPARAM lParam;
@@ -451,18 +449,6 @@
if (Common->Ansi)
{
memcpy(&Csa, &Csw, sizeof(CREATESTRUCTW));
- if (NULL != Csw.lpszName)
- {
- RtlInitUnicodeString(&UString, Csw.lpszName);
- RtlUnicodeStringToAnsiString(&AString, &UString, TRUE);
- Csa.lpszName = AString.Buffer;
- }
- if (0 != HIWORD(Csw.lpszClass))
- {
- RtlInitUnicodeString(&UString, Csw.lpszClass);
- RtlUnicodeStringToAnsiString(&AString, &UString, TRUE);
- Csa.lpszClass = AString.Buffer;
- }
CbtCreatewnda.lpcs = &Csa;
CbtCreatewnda.hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
lParam = (LPARAM) &CbtCreatewnda;
@@ -478,22 +464,17 @@
return ZwCallbackReturn(NULL, 0, STATUS_NOT_SUPPORTED);
}
- Result = Common->Proc(Common->Code, wParam, lParam);
+ if (Common->Proc)
+ Result = Common->Proc(Common->Code, wParam, lParam);
+ else
+ {
+ ERR("Common = 0x%x, Proc = 0x%x\n",Common,Common->Proc);
+ }
switch(Common->Code)
{
case HCBT_CREATEWND:
- if (Common->Ansi)
- {
- if (0 != HIWORD(Csa.lpszClass))
- {
- RtlFreeHeap(GetProcessHeap(), 0, (LPSTR) Csa.lpszClass);
- }
- if (NULL != Csa.lpszName)
- {
- RtlFreeHeap(GetProcessHeap(), 0, (LPSTR) Csa.lpszName);
- }
- }
+ CbtCreatewndExtra->WndInsertAfter = CbtCreatewndw.hwndInsertAfter;
break;
}
break;
Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Fri Jun 26 06:10:52
2009
@@ -43,6 +43,7 @@
UINT cPaintsReady; /* Count of paints pending. */
UINT cTimersReady; /* Count of timers pending. */
ULONG fsHooks;
+ PHOOK sphkCurrent;
LIST_ENTRY PtiLink;
CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL.
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] Fri Jun 26
06:10:52 2009
@@ -346,7 +346,7 @@
PHOOKPROC_CALLBACK_ARGUMENTS Common;
CBT_CREATEWNDW *CbtCreateWnd =NULL;
PCHAR Extra;
- PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra ;
+ PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra = NULL;
UNICODE_STRING WindowName;
UNICODE_STRING ClassName;
PANSI_STRING asWindowName;
@@ -546,6 +546,14 @@
return 0;
}
+ if (HookId == WH_CBT && Code == HCBT_CREATEWND)
+ {
+ if (CbtCreatewndExtra)
+ {
+ CbtCreateWnd->hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
+ }
+ }
+
if (Argument) IntCbFreeMemory(Argument);
return Result;
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] Fri Jun 26 06:10:52
2009
@@ -529,7 +529,7 @@
case HCBT_CREATEWND: /* Handle Ansi? */
Size = sizeof(CBT_CREATEWND);
- /* What shall we do? Size +=
sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS); same ass CREATESTRUCTEX */
+ /* What shall we do? Size +=
sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS); same as CREATESTRUCTEX */
break;
default:
@@ -845,9 +845,9 @@
DPRINT1("HOOK HCBT_CREATEWND write ERROR!\n");
}
/* The next call handles the structures. */
- if (!BadChk)
- {
-// lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
+ if (!BadChk && Hook->Proc)
+ {
+ lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
}
break;
}