Author: jimtabor
Date: Mon Feb 2 06:22:26 2015
New Revision: 66149
URL:
http://svn.reactos.org/svn/reactos?rev=66149&view=rev
Log:
[Win32ss]
- Fix SeaMonkey crash while restarting the web browser.
Modified:
trunk/reactos/win32ss/user/ntuser/painting.c
trunk/reactos/win32ss/user/ntuser/painting.h
Modified: trunk/reactos/win32ss/user/ntuser/painting.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Mon Feb 2 06:22:26 2015
@@ -942,47 +942,49 @@
FASTCALL
IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
{
- PFLASHDATA pfData;
+ DWORD FlashState;
+ UINT uCount = pfwi->uCount;
BOOL Activate = FALSE, Ret = FALSE;
- pfData = UserGetProp(pWnd, AtomFlashWndState);
- if (!pfData)
- {
- pfData = ExAllocatePoolWithTag(NonPagedPool, sizeof(FLASHDATA), USERTAG_WINDOW);
-
- pfData->FlashState = 0;
- pfData->uCount = pfwi->uCount;
-
- IntSetProp(pWnd, AtomFlashWndState, (HANDLE) pfData);
- }
-
- if (pfData->FlashState == FLASHW_FINISHED)
+ ASSERT(pfwi);
+
+ FlashState = (DWORD)UserGetProp(pWnd, AtomFlashWndState);
+
+ if (FlashState == FLASHW_FINISHED)
{
// Cycle has finished, kill timer and set this to Stop.
- pfData->FlashState |= FLASHW_KILLSYSTIMER;
+ FlashState |= FLASHW_KILLSYSTIMER;
pfwi->dwFlags = FLASHW_STOP;
}
else
{
- if (pfData->FlashState)
+ if (FlashState)
{
if (pfwi->dwFlags == FLASHW_SYSTIMER)
{
- // Called from system timer, restore flags.
- pfwi->dwFlags = pfData->FlashState;
+ // Called from system timer, restore flags, counts and state.
+ pfwi->dwFlags = LOWORD(FlashState);
+ uCount = HIWORD(FlashState);
+ FlashState = MAKELONG(LOWORD(FlashState),0);
}
- }
- else
+ else
+ {
+ // Clean out the trash! Fix SeaMonkey crash after restart.
+ FlashState = 0;
+ }
+ }
+
+ if (FlashState == 0)
{ // First time in cycle, setup flash state.
if ( pWnd->state & WNDS_ACTIVEFRAME ||
(pfwi->dwFlags & FLASHW_CAPTION && pWnd->style &
(WS_BORDER|WS_DLGFRAME)))
{
- pfData->FlashState = FLASHW_STARTED|FLASHW_ACTIVE;
+ FlashState = FLASHW_STARTED|FLASHW_ACTIVE;
}
}
// Set previous window state.
- Ret = !!(pfData->FlashState & FLASHW_ACTIVE);
+ Ret = !!(FlashState & FLASHW_ACTIVE);
if ( pfwi->dwFlags & FLASHW_TIMERNOFG &&
gpqForeground == pWnd->head.pti->MessageQueue )
@@ -1002,7 +1004,7 @@
}
else
{
- Activate = (pfData->FlashState & FLASHW_ACTIVE) == 0;
+ Activate = (FlashState & FLASHW_ACTIVE) == 0;
}
if ( pfwi->dwFlags == FLASHW_STOP || pfwi->dwFlags & FLASHW_CAPTION )
@@ -1019,31 +1021,29 @@
if ( pfwi->dwFlags == FLASHW_STOP )
{
- if (pfData->FlashState & FLASHW_KILLSYSTIMER)
+ if (FlashState & FLASHW_KILLSYSTIMER)
{
IntKillTimer(pWnd, ID_EVENT_SYSTIMER_FLASHWIN, TRUE);
}
IntRemoveProp(pWnd, AtomFlashWndState);
-
- ExFreePoolWithTag(pfData, USERTAG_WINDOW);
}
else
{ // Have a count and started, set timer.
- if ( pfData->uCount )
- {
- pfData->FlashState |= FLASHW_COUNT;
-
- if (!(Activate ^ !!(pfData->FlashState & FLASHW_STARTED)))
- pfData->uCount--;
-
- if (!(pfData->FlashState & FLASHW_KILLSYSTIMER))
+ if ( uCount )
+ {
+ FlashState |= FLASHW_COUNT;
+
+ if (!(Activate ^ !!(FlashState & FLASHW_STARTED)))
+ uCount--;
+
+ if (!(FlashState & FLASHW_KILLSYSTIMER))
pfwi->dwFlags |= FLASHW_TIMER;
}
if (pfwi->dwFlags & FLASHW_TIMER)
{
- pfData->FlashState |= FLASHW_KILLSYSTIMER;
+ FlashState |= FLASHW_KILLSYSTIMER;
IntSetTimer( pWnd,
ID_EVENT_SYSTIMER_FLASHWIN,
@@ -1052,17 +1052,19 @@
TMRF_SYSTEM );
}
- if (pfData->FlashState & FLASHW_COUNT && pfData->uCount == 0)
+ if (FlashState & FLASHW_COUNT && uCount == 0)
{
// Keep spinning? Nothing else to do.
- pfData->FlashState = FLASHW_FINISHED;
+ FlashState = FLASHW_FINISHED;
}
else
{
// Save state and flags so this can be restored next time through.
- pfData->FlashState ^= (pfData->FlashState ^ -!!(Activate)) &
FLASHW_ACTIVE;
- pfData->FlashState ^= (pfData->FlashState ^ pfwi->dwFlags) &
(FLASHW_MASK & ~FLASHW_TIMER);
- }
+ FlashState ^= (FlashState ^ -!!(Activate)) & FLASHW_ACTIVE;
+ FlashState ^= (FlashState ^ pfwi->dwFlags) & (FLASHW_MASK &
~FLASHW_TIMER);
+ }
+ FlashState = MAKELONG(LOWORD(FlashState),uCount);
+ IntSetProp(pWnd, AtomFlashWndState, (HANDLE) FlashState);
}
return Ret;
}
Modified: trunk/reactos/win32ss/user/ntuser/painting.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/painting.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/painting.h [iso-8859-1] Mon Feb 2 06:22:26 2015
@@ -7,11 +7,6 @@
#define FLASHW_COUNT 0x00002000
#define FLASHW_KILLSYSTIMER 0x00004000
#define FLASHW_ACTIVE 0x00008000
-
-typedef struct _FLASHDATA{
- DWORD FlashState;
- UINT uCount;
-} FLASHDATA, *PFLASHDATA;
BOOL FASTCALL co_UserRedrawWindow(PWND Wnd, const RECTL* UpdateRect, PREGION UpdateRgn,
ULONG Flags);
VOID FASTCALL IntInvalidateWindows(PWND Window, PREGION Rgn, ULONG Flags);