Author: jgardou
Date: Sat Jul 26 15:41:33 2014
New Revision: 63742
URL:
http://svn.reactos.org/svn/reactos?rev=63742&view=rev
Log:
[WIN32K]
- Avoid useless casts
- Add a few debug prints
- Add sanity check
Modified:
trunk/reactos/win32ss/gdi/eng/engobjects.h
trunk/reactos/win32ss/gdi/eng/engwindow.c
Modified: trunk/reactos/win32ss/gdi/eng/engobjects.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engobjects…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] Sat Jul 26 15:41:33 2014
@@ -85,6 +85,7 @@
ULONG RectCount;
RECTL* Rects;
} CLIPGDI, *PCLIPGDI;
+C_ASSERT(FIELD_OFFSET(CLIPGDI, ClipObj) == FIELD_OFFSET(CLIPGDI, WndObj.coClient));
// HACK, until we use the original structure
#define XCLIPOBJ CLIPGDI
Modified: trunk/reactos/win32ss/gdi/eng/engwindow.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engwindow.…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engwindow.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engwindow.c [iso-8859-1] Sat Jul 26 15:41:33 2014
@@ -18,11 +18,9 @@
VOID
FASTCALL
IntEngWndCallChangeProc(
- IN WNDOBJ *pwo,
- IN FLONG flChanged)
-{
- XCLIPOBJ* Clip = CONTAINING_RECORD(pwo, XCLIPOBJ, WndObj);
-
+ _In_ XCLIPOBJ *Clip,
+ _In_ FLONG flChanged)
+{
if (Clip->ChangeProc == NULL)
{
return;
@@ -35,15 +33,14 @@
return;
}
+ TRACE("Calling WNDOBJCHANGEPROC (0x%p), Changed = 0x%x\n",
+ Clip->ChangeProc, flChanged);
+
/* Call the WNDOBJCHANGEPROC */
if (flChanged == WOC_CHANGED)
- {
- pwo = NULL;
- }
-
- TRACE("Calling WNDOBJCHANGEPROC (0x%p), Changed = 0x%x\n",
- Clip->ChangeProc, flChanged);
- Clip->ChangeProc(pwo, flChanged);
+ Clip->ChangeProc(NULL, flChanged);
+ else
+ Clip->ChangeProc(&Clip->WndObj, flChanged);
}
/*
@@ -112,30 +109,25 @@
_In_ PWND Window,
_In_ FLONG flChanged)
{
- PPROPERTY pprop;
- XCLIPOBJ *Current;
- HWND hWnd;
+ XCLIPOBJ *Clip;
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
- hWnd = Window->head.h;
- pprop = IntGetProp(Window, AtomWndObj);
- if (!pprop)
+ Clip = UserGetProp(Window, AtomWndObj);
+ if (!Clip)
{
return;
}
- Current = (XCLIPOBJ *)pprop->Data;
- if ( gcountPWO &&
- Current &&
- Current->Hwnd == hWnd &&
- Current->WndObj.pvConsumer != NULL )
+
+ ASSERT(Clip->Hwnd == Window->head.h);
+ if (Clip->WndObj.pvConsumer != NULL)
{
/* Update the WNDOBJ */
switch (flChanged)
{
case WOC_RGN_CLIENT:
/* Update the clipobj and client rect of the WNDOBJ */
- IntEngWndUpdateClipObj(Current, Window);
+ IntEngWndUpdateClipObj(Clip, Window);
break;
case WOC_DELETE:
@@ -144,12 +136,12 @@
}
/* Call the change proc */
- IntEngWndCallChangeProc(&Current->WndObj, flChanged);
+ IntEngWndCallChangeProc(Clip, flChanged);
/* HACK: Send WOC_CHANGED after WOC_RGN_CLIENT */
if (flChanged == WOC_RGN_CLIENT)
{
- IntEngWndCallChangeProc(&Current->WndObj, WOC_CHANGED);
+ IntEngWndCallChangeProc(Clip, WOC_CHANGED);
}
}
}
@@ -218,7 +210,7 @@
IntSetProp(Window, AtomWndObj, Clip);
++gcountPWO;
- TRACE("EngCreateWnd: SUCCESS!\n");
+ TRACE("EngCreateWnd: SUCCESS: %p!\n", WndObjUser);
RETURN( WndObjUser);
@@ -315,6 +307,7 @@
IN WNDOBJ *pwo,
IN PVOID pvConsumer)
{
+ XCLIPOBJ* Clip = CONTAINING_RECORD(pwo, XCLIPOBJ, WndObj);
BOOL Hack;
TRACE("WNDOBJ_vSetConsumer: pwo = 0x%p, pvConsumer = 0x%p\n", pwo,
pvConsumer);
@@ -333,9 +326,9 @@
if (Hack)
{
FIXME("Is this hack really needed?\n");
- IntEngWndCallChangeProc(pwo, WOC_RGN_CLIENT);
- IntEngWndCallChangeProc(pwo, WOC_CHANGED);
- IntEngWndCallChangeProc(pwo, WOC_DRAWN);
+ IntEngWndCallChangeProc(Clip, WOC_RGN_CLIENT);
+ IntEngWndCallChangeProc(Clip, WOC_CHANGED);
+ IntEngWndCallChangeProc(Clip, WOC_DRAWN);
}
}