From 91e196a64f92334e9db3a82f52130b34cf56f90a Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sun, 2 May 2010 16:40:05 +0000 Subject: [PATCH] [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. svn path=/trunk/; revision=47082 --- reactos/subsystems/win32/win32k/ntuser/window.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index 822c8c55285..f22c6dce047 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -2619,6 +2619,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) BOOLEAN isChild; PWND Wnd; HWND hWnd; + PTHREADINFO ti; ASSERT_REFS_CO(Window); // FIXME: temp hack? @@ -2662,6 +2663,21 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) 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); IntEngWindowChanged(Window, WOC_DELETE);