- Needed to reference the previous window handle. This prevents the window object from becoming zero during it's own demise when posting send messages.

- See bug 3490.

svn path=/trunk/; revision=34408
This commit is contained in:
James Tabor 2008-07-10 11:27:53 +00:00
parent 326c138e1b
commit 69b39dc05f

View file

@ -60,14 +60,17 @@ co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
VOID FASTCALL
co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
{
USER_REFERENCE_ENTRY Ref;
PWINDOW_OBJECT Window;
USER_REFERENCE_ENTRY Ref, RefPrev;
PWINDOW_OBJECT Window, WindowPrev = NULL;
if ((Window = UserGetWindowObject(hWnd)))
{
{
UserRefObjectCo(Window, &Ref);
WindowPrev = UserGetWindowObject(hWndPrev);
if (WindowPrev) UserRefObjectCo(WindowPrev, &RefPrev);
/* Send palette messages */
if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
{
@ -91,11 +94,11 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
Window->Wnd->Owner->hWndLastActive = hWnd;
}
if (Window && hWndPrev)
if (Window && WindowPrev)
{
PWINDOW_OBJECT cWindow;
HWND *List, *phWnd;
HANDLE OldTID = IntGetWndThreadId(UserGetWindowObject(hWndPrev));
HANDLE OldTID = IntGetWndThreadId(WindowPrev);
HANDLE NewTID = IntGetWndThreadId(Window);
DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID);
@ -126,6 +129,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
ExFreePool(List);
}
}
UserDerefObjectCo(WindowPrev); // Now allow the previous window to die.
}
UserDerefObjectCo(Window);