mirror of
https://github.com/reactos/reactos.git
synced 2024-08-18 17:37:02 +00:00
[WIN32K]
- Call IntDestroyCurIconObject instead of explicitly destroying the handle. CORE-7575 svn path=/trunk/; revision=64915
This commit is contained in:
parent
6e51ca263b
commit
f0e276168d
|
@ -644,40 +644,36 @@ NtUserDestroyCursor(
|
||||||
_In_ BOOL bForce)
|
_In_ BOOL bForce)
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
PCURICON_OBJECT CurIcon = NULL;
|
||||||
|
|
||||||
TRACE("Enter NtUserDestroyCursorIcon (%p, %u)\n", hCurIcon, bForce);
|
TRACE("Enter NtUserDestroyCursorIcon (%p, %u)\n", hCurIcon, bForce);
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
|
CurIcon = UserGetCurIconObject(hCurIcon);
|
||||||
|
if (!CurIcon)
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
if (!bForce)
|
if (!bForce)
|
||||||
{
|
{
|
||||||
/* Maybe we have good reasons not to destroy this object */
|
/* Maybe we have good reasons not to destroy this object */
|
||||||
PCURICON_OBJECT CurIcon = UserGetCurIconObject(hCurIcon);
|
|
||||||
ULONG Flags;
|
|
||||||
if (!CurIcon)
|
|
||||||
{
|
|
||||||
ret = FALSE;
|
|
||||||
goto leave;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurIcon->head.ppi != PsGetCurrentProcessWin32Process())
|
if (CurIcon->head.ppi != PsGetCurrentProcessWin32Process())
|
||||||
{
|
{
|
||||||
/* No way, you're not touching my cursor */
|
/* No way, you're not touching my cursor */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
UserDereferenceObject(CurIcon);
|
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
Flags = CurIcon->CURSORF_flags;
|
if (CurIcon->CURSORF_flags & CURSORF_CURRENT)
|
||||||
UserDereferenceObject(CurIcon);
|
|
||||||
|
|
||||||
if (Flags & CURSORF_CURRENT)
|
|
||||||
{
|
{
|
||||||
WARN("Trying to delete current cursor!\n");
|
WARN("Trying to delete current cursor!\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Flags & CURSORF_LRSHARED)
|
if (CurIcon->CURSORF_flags & CURSORF_LRSHARED)
|
||||||
{
|
{
|
||||||
WARN("Trying to delete shared cursor.\n");
|
WARN("Trying to delete shared cursor.\n");
|
||||||
/* This one is not an error */
|
/* This one is not an error */
|
||||||
|
@ -687,9 +683,11 @@ NtUserDestroyCursor(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Destroy the handle */
|
/* Destroy the handle */
|
||||||
ret = UserDeleteObject(hCurIcon, TYPE_CURSOR);
|
ret = IntDestroyCurIconObject(CurIcon);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
|
if (CurIcon)
|
||||||
|
UserDereferenceObject(CurIcon);
|
||||||
TRACE("Leave NtUserDestroyCursorIcon, ret=%i\n", ret);
|
TRACE("Leave NtUserDestroyCursorIcon, ret=%i\n", ret);
|
||||||
UserLeave();
|
UserLeave();
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue