Implemented NtUserGetAncestor with GA_ROOT flag, stops winhello from crashing when...
authorJurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
Tue, 3 Jun 2003 15:43:57 +0000 (15:43 +0000)
committerJurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
Tue, 3 Jun 2003 15:43:57 +0000 (15:43 +0000)
svn path=/trunk/; revision=4828

reactos/subsys/win32k/ntuser/window.c

index 2732684..f31bf1a 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: window.c,v 1.51 2003/05/31 08:51:58 gvg Exp $
+/* $Id: window.c,v 1.52 2003/06/03 15:43:57 jvangael Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -94,6 +94,29 @@ NtUserGetAncestor(HWND hWnd, UINT Flags)
 
       return(hParent);
     }
+  else if (Flags & GA_ROOT)
+  {
+         PWINDOW_OBJECT Window;
+         PWINDOW_OBJECT pChainEnumerator;
+         HWND hRoot;
+
+         Window = W32kGetWindowObject(hWnd);
+         if(Window == NULL)
+         {
+                 return(NULL);
+         }
+
+         pChainEnumerator = Window;
+         while(pChainEnumerator->Parent != NULL)
+         {
+                 pChainEnumerator = pChainEnumerator->Parent;
+         }
+
+         hRoot = pChainEnumerator->Self;
+         W32kReleaseWindowObject(Window);
+
+         return(hRoot);
+  }      
   else
     {
       UNIMPLEMENTED;