Author: mjmartin
Date: Sun May  2 18:40:05 2010
New Revision: 47082
URL: 
http://svn.reactos.org/svn/reactos?rev=47082&view=rev
Log:
[win32k]
- co_UserDestroyWindow: ThreadInfo->pDeskInfo->hShell holds the hWnd of the Shells
Desktop Window. Set it to NULL if that windows is being destroyed. Fixes bug #4902.
Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sun May  2 18:40:05
2010
@@ -2619,6 +2619,7 @@
    BOOLEAN isChild;
    PWND Wnd;
    HWND hWnd;
+   PTHREADINFO ti;
    ASSERT_REFS_CO(Window); // FIXME: temp hack?
@@ -2661,6 +2662,21 @@
       Window->pti->MessageQueue->FocusWindow = NULL;
    if (Window->pti->MessageQueue->CaptureWindow == Window->hSelf)
       Window->pti->MessageQueue->CaptureWindow = NULL;
+
+   /*
+    * Check if this window is the Shell's Desktop Window. If so set hShellWindow to
NULL
+    */
+
+   ti = PsGetCurrentThreadWin32Thread();
+
+   if ((ti != NULL) & (ti->pDeskInfo != NULL))
+   {
+      if (ti->pDeskInfo->hShellWindow == hWnd)
+      {
+         DPRINT1("Destroying the ShellWindow!\n");
+         ti->pDeskInfo->hShellWindow = NULL;
+      }
+   }
    IntDereferenceMessageQueue(Window->pti->MessageQueue);