window parent handle -> pointer adaptions
authorGunnar Dalsnes <hardon@online.no>
Tue, 6 Sep 2005 14:19:03 +0000 (14:19 +0000)
committerGunnar Dalsnes <hardon@online.no>
Tue, 6 Sep 2005 14:19:03 +0000 (14:19 +0000)
svn path=/trunk/; revision=17698

reactos/subsys/win32k/include/userfuncs.h
reactos/subsys/win32k/ntuser/painting.c
reactos/subsys/win32k/ntuser/vis.c
reactos/subsys/win32k/ntuser/windc.c

index e63c27e..574c023 100644 (file)
@@ -1,6 +1,11 @@
 #ifndef _WIN32K_USERFUNCS_H\r
 #define _WIN32K_USERFUNCS_H\r
 \r
+//currently unused\r
+#define ASSERT_REFS(obj) \r
+\r
+#define UserReferenceWindowObjectCo(o) IntReferenceWindowObject(o)\r
+#define UserDereferenceWindowObjectCo(o) IntReleaseWindowObject(o)\r
 \r
 extern PUSER_HANDLE_TABLE gHandleTable;\r
 \r
index 2c5d0f2..d02e84a 100644 (file)
@@ -405,20 +405,18 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
 BOOL FASTCALL
 IntIsWindowDrawable(PWINDOW_OBJECT Window)
 {
-   PWINDOW_OBJECT Old, Wnd = Window;
+   PWINDOW_OBJECT Wnd = Window;
 
-   IntReferenceWindowObject(Wnd);
    do
    {
       if (!(Wnd->Style & WS_VISIBLE) ||
           ((Wnd->Style & WS_MINIMIZE) && (Wnd != Window)))
       {
-         IntReleaseWindowObject(Wnd);
          return FALSE;
       }
-      Old = Wnd;
-      Wnd = IntGetParentObject(Wnd);
-      IntReleaseWindowObject(Old);
+
+      Wnd = Wnd->Parent;
+      
    } while(Wnd);
 
    return TRUE;
index ae7a490..1b3e86b 100644 (file)
@@ -77,7 +77,7 @@ VIS_ComputeVisibleRegion(
     */
 
    PreviousWindow = Window;
-   CurrentWindow = IntGetParentObject(Window);
+   CurrentWindow = Window->Parent;
    while (CurrentWindow)
    {
       if (!(CurrentWindow->Style & WS_VISIBLE))
@@ -113,8 +113,7 @@ VIS_ComputeVisibleRegion(
       }
 
       PreviousWindow = CurrentWindow;
-      CurrentWindow = IntGetParentObject(CurrentWindow);
-      IntReleaseWindowObject(PreviousWindow);
+      CurrentWindow = CurrentWindow->Parent;
    }
 
    if (ClipChildren)
@@ -159,19 +158,23 @@ co_VIS_WindowLayoutChanged(
    HRGN Temp;
    PWINDOW_OBJECT Parent;
 
+   ASSERT_REFS(Window);
+
    Temp = NtGdiCreateRectRgn(0, 0, 0, 0);
    NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY);
 
-   Parent = IntGetParentObject(Window);
+   Parent = Window->Parent;
    if(Parent)
    {
       NtGdiOffsetRgn(Temp,
                      Window->WindowRect.left - Parent->ClientRect.left,
                      Window->WindowRect.top - Parent->ClientRect.top);
-     co_UserRedrawWindow(Parent, NULL, Temp,
+                     
+      UserReferenceWindowObjectCo(Parent);
+      co_UserRedrawWindow(Parent, NULL, Temp,
                      RDW_FRAME | RDW_ERASE | RDW_INVALIDATE |
                      RDW_ALLCHILDREN);
-     IntReleaseWindowObject(Parent);
+      UserDereferenceWindowObjectCo(Parent);
    }
    NtGdiDeleteObject(Temp);
 }
index ca578c5..caae710 100644 (file)
@@ -278,7 +278,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
    {
       PWINDOW_OBJECT Parent;
 
-      Parent = IntGetParentObject(Window);
+      Parent = Window->Parent;
       if(!Parent)
       {
         hRgnVisible = NULL;
@@ -430,7 +430,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
       Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
     }
 
-  Parent = (Window ? IntGetParentObject(Window) : NULL);
+  Parent = (Window ? Window->Parent : NULL);
 
   if (NULL == Window || !(Window->Style & WS_CHILD) || NULL == Parent)
     {
@@ -450,9 +450,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
         }
     }
 
-  if(Parent)
-    IntReleaseWindowObject(Parent);
-
   DcxFlags = Flags & DCX_CACHECOMPAREMASK;
 
   if (Flags & DCX_CACHE)