[ros-diffs] [gadamopoulos] 44591: [win32k] - Don't store LastChild in WINDOW_OBJECT

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Mon Dec 14 23:58:03 CET 2009


Author: gadamopoulos
Date: Mon Dec 14 23:58:03 2009
New Revision: 44591

URL: http://svn.reactos.org/svn/reactos?rev=44591&view=rev
Log:
[win32k]
- Don't store LastChild in WINDOW_OBJECT

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/window.c
    trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/window.c?rev=44591&r1=44590&r2=44591&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Mon Dec 14 23:58:03 2009
@@ -1060,11 +1060,6 @@
       /* link after WndPrevSibling */
       if ((Wnd->spwndNext = WndPrevSibling->spwndNext))
          Wnd->spwndNext->spwndPrev = Wnd;
-      else if ((Parent = Wnd->spwndParent))
-      {
-         if(Parent->LastChild == WndPrevSibling)
-            Parent->LastChild = Wnd;
-      }
       Wnd->spwndPrev->spwndNext = Wnd;
    }
    else
@@ -1075,7 +1070,6 @@
          Wnd->spwndNext->spwndPrev = Wnd;
       else if (Parent)
       {
-         Parent->LastChild = Wnd;
          Parent->spwndChild = Wnd;
          return;
       }
@@ -1276,8 +1270,6 @@
 
    if (Wnd->spwndNext)
       Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
-   else if (WndParent && WndParent->LastChild == Wnd)
-      WndParent->LastChild = Wnd->spwndPrev;
 
    if (Wnd->spwndPrev)
       Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
@@ -1956,7 +1948,6 @@
 
    Window->OwnerThread = PsGetCurrentThread();
    Window->spwndChild = NULL;
-   Window->LastChild = NULL;
    Window->spwndPrev = NULL;
    Window->spwndNext = NULL;
 
@@ -2290,7 +2281,13 @@
       {
          PWINDOW_OBJECT PrevSibling;
 
-         PrevSibling = ParentWindow->LastChild;
+         PrevSibling = ParentWindow->spwndChild;
+
+         if(PrevSibling)
+         {
+            while (PrevSibling->spwndNext)
+               PrevSibling = PrevSibling->spwndNext;
+         }
 
          /* link window as bottom sibling */
          IntLinkWindow(Window, ParentWindow, PrevSibling /*prev sibling*/);
@@ -3698,8 +3695,16 @@
       case GW_HWNDLAST:
          if((Parent = Window->spwndParent))
          {
-            if (Parent->LastChild)
-               hWndResult = Parent->LastChild->hSelf;
+            if (Parent->spwndChild)
+            {
+               Window = Parent->spwndChild;
+               if(Window)
+               {
+                  while(Window->spwndNext)
+                     Window = Window->spwndNext;
+               }
+               hWndResult = Window->hSelf;
+            }
          }
          break;
 

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c?rev=44591&r1=44590&r2=44591&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Mon Dec 14 23:58:03 2009
@@ -1002,10 +1002,17 @@
          }
          else if (WinPos.hwndInsertAfter == HWND_BOTTOM)
          {
-            if(ParentWindow->LastChild)
+            if(ParentWindow->spwndChild)
             {
-               UserReferenceObject(ParentWindow->LastChild);
-               InsertAfterWindow = ParentWindow->LastChild;
+               InsertAfterWindow = ParentWindow->spwndChild;
+
+               if(InsertAfterWindow)
+               {
+                  while (InsertAfterWindow->spwndNext)
+                     InsertAfterWindow = InsertAfterWindow->spwndNext;
+               }
+
+               UserReferenceObject(InsertAfterWindow);
             }
             else
                InsertAfterWindow = NULL;




More information about the Ros-diffs mailing list