fix referencing bug (ros crashed during setup if mousemove) in co_WinPosSearchChildren

svn path=/trunk/; revision=17809
This commit is contained in:
Gunnar Dalsnes 2005-09-11 21:05:32 +00:00
parent 3a98addd02
commit f5449547b6
4 changed files with 17 additions and 14 deletions

View file

@ -14,9 +14,10 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu);
DPRINT1("obj 0x%x dereffed to %i refs\n",_obj_, USER_BODY_TO_HEADER(_obj_)->RefCount-1); \
ObmDereferenceObject2(_obj_); \
}
#endif
#define ObmDereferenceObject(_obj_) ObmDereferenceObject2(_obj_)
@ -59,7 +60,7 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu);
VOID FASTCALL ObmReferenceObject(PVOID obj);
BOOL FASTCALL ObmDereferenceObject(PVOID obj);
BOOL FASTCALL ObmDereferenceObject2(PVOID obj);
PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
PVOID FASTCALL

View file

@ -773,7 +773,7 @@ MessageFound:
USHORT HitTest;
UserRefObjectCo(MsgWindow);
if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
/* FIXME - check message filter again, if the message doesn't match anymore,
search again */
@ -782,7 +782,7 @@ MessageFound:
/* eat the message, search again */
goto CheckMessages;
}
if(ThreadQueue->CaptureWindow == NULL)
{
co_IntSendHitTestMessages(ThreadQueue, &Msg->Msg);

View file

@ -275,7 +275,7 @@ VOID FASTCALL ObmReferenceObject(PVOID obj)
}
BOOL FASTCALL ObmDereferenceObject(PVOID obj)
BOOL FASTCALL ObmDereferenceObject2(PVOID obj)
{
PUSER_OBJECT_HEADER hdr = USER_BODY_TO_HEADER(obj);

View file

@ -1483,20 +1483,23 @@ PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
}
#endif
/* wine server: child_window_from_point
Caller must dereference the "returned" Window
*/
static
VOID FASTCALL
co_WinPosSearchChildren(
PWINDOW_OBJECT ScopeWin,
PUSER_MESSAGE_QUEUE OnlyHitTests,
POINT *Point,
PWINDOW_OBJECT* Window,
PWINDOW_OBJECT* Window,
USHORT *HitTest
)
{
PWINDOW_OBJECT Current;
HWND *List, *phWnd;
ASSERT_REFS_CO(ScopeWin);
if ((List = IntWinListChildren(ScopeWin)))
@ -1517,24 +1520,24 @@ co_WinPosSearchChildren(
continue;
}
if (!IntPtInWindow(Current, Point->x, Point->y))
if (!IntPtInWindow(Current, Point->x, Point->y))
{
continue;
continue;
}
if (*Window) UserDerefObject(*Window);
*Window = Current;
UserRefObject(*Window);
if (Current->Style & WS_MINIMIZE)
{
*HitTest = HTCAPTION;
UserRefObject(Current);
break;
}
if (Current->Style & WS_DISABLED)
{
*HitTest = HTERROR;
UserRefObject(Current);
break;
}
@ -1561,13 +1564,12 @@ co_WinPosSearchChildren(
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
}
UserRefObject(Current);
UserDerefObjectCo(Current);
break;
}
ExFreePool(List);
}
}
}
/* wine: WINPOS_WindowFromPoint */