Although drivers should accept NULL masks and colors for cursors, at least

two don't and crash. So let's not pass NULL.

svn path=/trunk/; revision=8141
This commit is contained in:
Gé van Geldorp 2004-02-10 23:40:01 +00:00
parent 5ef2c3bbef
commit 76414f84fd

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: cursoricon.c,v 1.46 2004/02/01 15:45:41 gvg Exp $ */ /* $Id: cursoricon.c,v 1.47 2004/02/10 23:40:01 gvg Exp $ */
#undef WIN32_LEAN_AND_MEAN #undef WIN32_LEAN_AND_MEAN
@ -143,12 +143,16 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
if (!NewCursor && (CurInfo->CurrentCursorObject || ForceChange)) if (!NewCursor && (CurInfo->CurrentCursorObject || ForceChange))
{ {
ExAcquireFastMutex(SurfGDI->DriverLock); if (NULL != CurInfo->CurrentCursorObject && CurInfo->ShowingCursor)
SurfGDI->PointerStatus = SurfGDI->SetPointerShape(SurfObj, NULL, NULL, NULL, {
0, 0, CurInfo->x, CurInfo->y, /* Remove the cursor if it was displayed */
&PointerRect, SPS_CHANGE); ExAcquireFastMutex(SurfGDI->DriverLock);
ExReleaseFastMutex(SurfGDI->DriverLock); SurfGDI->MovePointer(SurfObj, -1, -1, &PointerRect);
SetPointerRect(CurInfo, &PointerRect); ExReleaseFastMutex(SurfGDI->DriverLock);
SetPointerRect(CurInfo, &PointerRect);
}
SurfGDI->PointerStatus = SPS_ACCEPT_NOEXCLUDE;
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */ CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
CurInfo->ShowingCursor = 0; CurInfo->ShowingCursor = 0;