mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
fix referencing bug (ros crashed during setup if mousemove) in co_WinPosSearchChildren
svn path=/trunk/; revision=17809
This commit is contained in:
parent
3a98addd02
commit
f5449547b6
|
@ -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); \
|
DPRINT1("obj 0x%x dereffed to %i refs\n",_obj_, USER_BODY_TO_HEADER(_obj_)->RefCount-1); \
|
||||||
ObmDereferenceObject2(_obj_); \
|
ObmDereferenceObject2(_obj_); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ObmDereferenceObject(_obj_) ObmDereferenceObject2(_obj_)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu);
|
||||||
|
|
||||||
|
|
||||||
VOID FASTCALL ObmReferenceObject(PVOID obj);
|
VOID FASTCALL ObmReferenceObject(PVOID obj);
|
||||||
BOOL FASTCALL ObmDereferenceObject(PVOID obj);
|
BOOL FASTCALL ObmDereferenceObject2(PVOID obj);
|
||||||
|
|
||||||
PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
|
PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
|
||||||
PVOID FASTCALL
|
PVOID FASTCALL
|
||||||
|
|
|
@ -773,7 +773,7 @@ MessageFound:
|
||||||
USHORT HitTest;
|
USHORT HitTest;
|
||||||
|
|
||||||
UserRefObjectCo(MsgWindow);
|
UserRefObjectCo(MsgWindow);
|
||||||
|
|
||||||
if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
|
if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
|
||||||
/* FIXME - check message filter again, if the message doesn't match anymore,
|
/* FIXME - check message filter again, if the message doesn't match anymore,
|
||||||
search again */
|
search again */
|
||||||
|
@ -782,7 +782,7 @@ MessageFound:
|
||||||
/* eat the message, search again */
|
/* eat the message, search again */
|
||||||
goto CheckMessages;
|
goto CheckMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ThreadQueue->CaptureWindow == NULL)
|
if(ThreadQueue->CaptureWindow == NULL)
|
||||||
{
|
{
|
||||||
co_IntSendHitTestMessages(ThreadQueue, &Msg->Msg);
|
co_IntSendHitTestMessages(ThreadQueue, &Msg->Msg);
|
||||||
|
|
|
@ -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);
|
PUSER_OBJECT_HEADER hdr = USER_BODY_TO_HEADER(obj);
|
||||||
|
|
||||||
|
|
|
@ -1483,20 +1483,23 @@ PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* wine server: child_window_from_point
|
||||||
|
|
||||||
|
Caller must dereference the "returned" Window
|
||||||
|
*/
|
||||||
static
|
static
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
co_WinPosSearchChildren(
|
co_WinPosSearchChildren(
|
||||||
PWINDOW_OBJECT ScopeWin,
|
PWINDOW_OBJECT ScopeWin,
|
||||||
PUSER_MESSAGE_QUEUE OnlyHitTests,
|
PUSER_MESSAGE_QUEUE OnlyHitTests,
|
||||||
POINT *Point,
|
POINT *Point,
|
||||||
PWINDOW_OBJECT* Window,
|
PWINDOW_OBJECT* Window,
|
||||||
USHORT *HitTest
|
USHORT *HitTest
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT Current;
|
PWINDOW_OBJECT Current;
|
||||||
HWND *List, *phWnd;
|
HWND *List, *phWnd;
|
||||||
|
|
||||||
ASSERT_REFS_CO(ScopeWin);
|
ASSERT_REFS_CO(ScopeWin);
|
||||||
|
|
||||||
if ((List = IntWinListChildren(ScopeWin)))
|
if ((List = IntWinListChildren(ScopeWin)))
|
||||||
|
@ -1517,24 +1520,24 @@ co_WinPosSearchChildren(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IntPtInWindow(Current, Point->x, Point->y))
|
if (!IntPtInWindow(Current, Point->x, Point->y))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*Window) UserDerefObject(*Window);
|
||||||
*Window = Current;
|
*Window = Current;
|
||||||
|
UserRefObject(*Window);
|
||||||
|
|
||||||
if (Current->Style & WS_MINIMIZE)
|
if (Current->Style & WS_MINIMIZE)
|
||||||
{
|
{
|
||||||
*HitTest = HTCAPTION;
|
*HitTest = HTCAPTION;
|
||||||
UserRefObject(Current);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Current->Style & WS_DISABLED)
|
if (Current->Style & WS_DISABLED)
|
||||||
{
|
{
|
||||||
*HitTest = HTERROR;
|
*HitTest = HTERROR;
|
||||||
UserRefObject(Current);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1561,13 +1564,12 @@ co_WinPosSearchChildren(
|
||||||
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
|
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserRefObject(Current);
|
|
||||||
UserDerefObjectCo(Current);
|
UserDerefObjectCo(Current);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ExFreePool(List);
|
ExFreePool(List);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wine: WINPOS_WindowFromPoint */
|
/* wine: WINPOS_WindowFromPoint */
|
||||||
|
|
Loading…
Reference in a new issue