Commit a018d850 authored by Noomen Hamza's avatar Noomen Hamza Committed by Alexandre Julliard

Rewrite the ShowOwnedPopups function with a safety algorithm.

parent 13409b32
...@@ -2641,15 +2641,20 @@ void WINAPI ShowOwnedPopups16( HWND16 owner, BOOL16 fShow ) ...@@ -2641,15 +2641,20 @@ void WINAPI ShowOwnedPopups16( HWND16 owner, BOOL16 fShow )
*/ */
BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow ) BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
{ {
WND *pWnd; UINT totalChild=0, count=0;
pWnd = WIN_LockWndPtr(pWndDesktop->child);
while (pWnd) WND **pWnd = WIN_BuildWinArray(WIN_GetDesktop(), 0, &totalChild);
if (!pWnd) return TRUE;
for (; count < totalChild; count++)
{ {
if (pWnd->owner && (pWnd->owner->hwndSelf == owner) && if (pWnd[count]->owner && (pWnd[count]->owner->hwndSelf == owner) && (pWnd[count]->dwStyle & WS_POPUP))
(pWnd->dwStyle & WS_POPUP)) SendMessageA(pWnd[count]->hwndSelf, WM_SHOWWINDOW, fShow ? SW_SHOW : SW_HIDE,IsIconic(owner) ? SW_PARENTOPENING : SW_PARENTCLOSING);
ShowWindow( pWnd->hwndSelf, fShow ? SW_SHOW : SW_HIDE );
WIN_UpdateWndPtr(&pWnd,pWnd->next);
} }
WIN_ReleaseDesktop();
WIN_ReleaseWinArray(pWnd);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment