From: James Tabor Date: Thu, 22 Oct 2015 09:05:56 +0000 (+0000) Subject: [Win32k] X-Git-Tag: ReactOS-0.4.0~416 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=27cd9042b5129b46d3fcd87c2ee1900951f48944 [Win32k] - Fix flashing windows and cleanup code. See CORE-10384. svn path=/trunk/; revision=69639 --- diff --git a/reactos/win32ss/user/ntuser/painting.c b/reactos/win32ss/user/ntuser/painting.c index 0403d5f77c3..631cc02e6fc 100644 --- a/reactos/win32ss/user/ntuser/painting.c +++ b/reactos/win32ss/user/ntuser/painting.c @@ -1327,7 +1327,7 @@ IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi) // Set previous window state. Ret = !!(FlashState & FLASHW_ACTIVE); - if ( pfwi->dwFlags & FLASHW_TIMERNOFG && + if ( (pfwi->dwFlags & FLASHW_TIMERNOFG) == FLASHW_TIMERNOFG && gpqForeground == pWnd->head.pti->MessageQueue ) { // Flashing until foreground, set this to Stop. @@ -1636,30 +1636,27 @@ NtUserFlashWindowEx(IN PFLASHWINFO pfwi) { PWND pWnd; FLASHWINFO finfo = {0}; - BOOL Ret = TRUE; + BOOL Ret = FALSE; UserEnterExclusive(); _SEH2_TRY { - ProbeForRead(pfwi, sizeof(FLASHWINFO), sizeof(ULONG)); + ProbeForRead(pfwi, sizeof(FLASHWINFO), 1); RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO)); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { SetLastNtError(_SEH2_GetExceptionCode()); - Ret = FALSE; + _SEH2_YIELD(goto Exit); } _SEH2_END - if (!Ret) goto Exit; - - if (!( pWnd = (PWND)UserGetObject(gHandleTable, finfo.hwnd, TYPE_WINDOW)) || + if (!( pWnd = ValidateHwndNoErr(finfo.hwnd)) || finfo.cbSize != sizeof(FLASHWINFO) || finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) ) { EngSetLastError(ERROR_INVALID_PARAMETER); - Ret = FALSE; goto Exit; }