Author: jimtabor
Date: Mon Oct 25 01:37:14 2010
New Revision: 49269
URL:
http://svn.reactos.org/svn/reactos?rev=49269&view=rev
Log:
[Win32k]
- Fix typos found by Mephisto on IRC, also add some debug prints in SetWindowsHookEx to
see what hooks are installed.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
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] Mon Oct 25
01:37:14 2010
@@ -503,7 +503,7 @@
RtlCopyMemory( &CbtCreatewndExtra->Cs, CbtCreateWnd->lpcs,
sizeof(CREATESTRUCTW) );
CbtCreatewndExtra->WndInsertAfter = CbtCreateWnd->hwndInsertAfter;
Extra = (PCHAR) (CbtCreatewndExtra + 1);
- CbtCreatewndExtra->Cs.lpszClass = ClassName.Buffer; // if Atom
+ CbtCreatewndExtra->Cs.lpszClass = CbtCreateWnd->lpcs->lpszClass;
// if Atom
if (Ansi)
{
@@ -517,7 +517,7 @@
}
else
{
- if (asWindowName.Buffer)
+ if (WindowName.Buffer)
RtlCopyMemory(Extra, WindowName.Buffer, WindowName.Length);
CbtCreatewndExtra->Cs.lpszName = (LPCWSTR) (Extra - (PCHAR)
CbtCreatewndExtra);
Extra += WindowName.Length;
@@ -526,7 +526,7 @@
Extra += sizeof(WCHAR);
}
- if (!IS_ATOM(ClassName.Buffer))
+ if (!IS_ATOM(CbtCreateWnd->lpcs->lpszClass))
{
if (Ansi)
{
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] Mon Oct 25 01:37:14
2010
@@ -1178,6 +1178,7 @@
HookId == WH_MOUSE_LL ||
HookId == WH_SYSMSGFILTER)
{
+ DPRINT1("Local hook installing Global HookId: %d\n",HookId);
/* these can only be global */
SetLastWin32Error(ERROR_GLOBAL_ONLY_HOOK);
RETURN( NULL);
@@ -1196,6 +1197,7 @@
if ( pti->rpdesk != ptiCurrent->rpdesk) // gptiCurrent->rpdesk)
{
+ DPRINT1("Local hook wrong desktop HookId: %d\n",HookId);
SetLastWin32Error(ERROR_ACCESS_DENIED);
RETURN( NULL);
}
@@ -1212,6 +1214,7 @@
HookId == WH_FOREGROUNDIDLE ||
HookId == WH_CALLWNDPROCRET) )
{
+ DPRINT1("Local hook needs hMod HookId: %d\n",HookId);
SetLastWin32Error(ERROR_HOOK_NEEDS_HMOD);
RETURN( NULL);
}
@@ -1245,6 +1248,7 @@
HookId == WH_FOREGROUNDIDLE ||
HookId == WH_CALLWNDPROCRET) )
{
+ DPRINT1("Global hook needs hMod HookId: %d\n",HookId);
SetLastWin32Error(ERROR_HOOK_NEEDS_HMOD);
RETURN( NULL);
}
@@ -1376,6 +1380,7 @@
else
Hook->offPfn = 0;
+ DPRINT1("Installing: HookId %d Global %s\n", HookId, !ThreadId ?
"TRUE" : "FALSE");
RETURN( Handle);
CLEANUP: