Don't crash when a mouse message doesn't fall inside a window.

svn path=/trunk/; revision=3687
This commit is contained in:
David Welch
2002-11-01 11:29:58 +00:00
parent 6072415050
commit cb8ac201ad
3 changed files with 14 additions and 5 deletions
+3 -3
View File
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mouse.c,v 1.14 2002/10/31 00:03:30 dwelch Exp $
/* $Id: mouse.c,v 1.15 2002/11/01 11:29:57 dwelch Exp $
*
* PROJECT: ReactOS kernel
* PURPOSE: Mouse
@@ -141,8 +141,8 @@ MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1,
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
}
if ((mouse_x + mouse_width >= HazardX1) && (mouse_x <= HazardX2) &&
(mouse_y + mouse_height >= HazardY1) && (mouse_y <= HazardY2))
if (((mouse_x + mouse_width) >= HazardX1) && (mouse_x <= HazardX2) &&
((mouse_y + mouse_height) >= HazardY1) && (mouse_y <= HazardY2))
{
SurfGDI->MovePointer(SurfObj, -1, -1, &MouseRect);
SafetySwitch = TRUE;
+6 -1
View File
@@ -1,4 +1,4 @@
/* $Id: msgqueue.c,v 1.6 2002/10/31 00:03:31 dwelch Exp $
/* $Id: msgqueue.c,v 1.7 2002/11/01 11:29:58 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -112,6 +112,11 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
*HitTest = WinPosWindowFromPoint(ScopeWin, Message->Msg.pt, &Window);
if (Window == NULL)
{
ExFreePool(Message);
return(FALSE);
}
if (Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
{
ExAcquireFastMutex(&Window->MessageQueue->Lock);
+5 -1
View File
@@ -1,4 +1,4 @@
/* $Id: winpos.c,v 1.6 2002/10/31 00:03:31 dwelch Exp $
/* $Id: winpos.c,v 1.7 2002/11/01 11:29:58 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -813,6 +813,10 @@ WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT WinPoint,
return(HitTest);
}
if ((*Window) == NULL)
{
return(HTNOWHERE);
}
if ((*Window)->MessageQueue == PsGetWin32Thread()->MessageQueue)
{
HitTest = W32kSendMessage((*Window)->Self, WM_NCHITTEST, 0,