Author: mjansen
Date: Sat Sep 24 14:15:23 2016
New Revision: 72794
URL:
http://svn.reactos.org/svn/reactos?rev=72794&view=rev
Log:
[MSGINA] Prevent an infinite loop in ShellDimScreen. CORE-12028
Modified:
trunk/reactos/dll/win32/msgina/dimmedwindow.cpp
Modified: trunk/reactos/dll/win32/msgina/dimmedwindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/dimmedwin…
==============================================================================
--- trunk/reactos/dll/win32/msgina/dimmedwindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/dimmedwindow.cpp [iso-8859-1] Sat Sep 24 14:15:23 2016
@@ -104,7 +104,7 @@
{
MSG msg;
- while (!IsWindowVisible(m_hwnd))
+ while (!IsWindowVisible(m_hwnd) && IsWindow(m_hwnd))
{
while (::PeekMessage(&msg, m_hwnd, 0, 0, PM_REMOVE))
{
@@ -261,6 +261,15 @@
pWindow->WaitForInit();
+ if (!IsWindow(pWindow->Wnd()))
+ {
+ refcount = pWindow->AddRef();
+ while (refcount)
+ refcount = pWindow->Release();
+
+ return E_FAIL;
+ }
+
_SEH2_TRY
{
hr = pWindow->QueryInterface(IID_IUnknown, pUnknown);