mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[WIN32K]
- Fix a few usages of UserSetCursor - Defer the actual freeing of cursor resources to when the object is freed for real. CORE-7575 svn path=/trunk/; revision=64879
This commit is contained in:
@@ -47,6 +47,8 @@ IntDestroyCurIconObject(PVOID Object);
|
||||
VOID FASTCALL
|
||||
IntCleanupCurIconCache(PPROCESSINFO Win32Process);
|
||||
|
||||
void FreeCurIconObject(PVOID Object);
|
||||
|
||||
#else
|
||||
|
||||
typedef struct tagCURICON_PROCESS
|
||||
|
||||
@@ -150,7 +150,19 @@ IntCreateCurIconHandle(BOOLEAN Animated)
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
IntDestroyCurIconObject(PVOID Object)
|
||||
IntDestroyCurIconObject(
|
||||
_In_ PVOID Object)
|
||||
{
|
||||
PCURICON_OBJECT CurIcon = Object;
|
||||
|
||||
/* We just mark the handle as being destroyed.
|
||||
* Deleting all the stuff will be deferred to the actual struct free. */
|
||||
return UserDeleteObject(CurIcon->head.h, TYPE_CURSOR);
|
||||
}
|
||||
|
||||
void
|
||||
FreeCurIconObject(
|
||||
_In_ PVOID Object)
|
||||
{
|
||||
PCURICON_OBJECT CurIcon = Object;
|
||||
|
||||
@@ -220,7 +232,8 @@ IntDestroyCurIconObject(PVOID Object)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
/* Finally free the thing */
|
||||
FreeProcMarkObject(CurIcon);
|
||||
}
|
||||
|
||||
VOID FASTCALL
|
||||
|
||||
@@ -675,13 +675,17 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
|
||||
{
|
||||
UserShowCursor( FALSE );
|
||||
#ifdef NEW_CURSORICON
|
||||
UserSetCursor(OldCursor, FALSE);
|
||||
OldCursor = UserSetCursor(OldCursor, FALSE);
|
||||
#else
|
||||
IntSetCursor( hOldCursor );
|
||||
#endif
|
||||
}
|
||||
#ifdef NEW_CURSORICON
|
||||
UserDereferenceObject(DragCursor);
|
||||
/* It could be that the cursor was already changed while we were proceeding,
|
||||
* so we must unreference whatever cursor was current at the time we restored the old one.
|
||||
* Maybe it is DragCursor, but maybe it is another one and DragCursor got already freed.
|
||||
*/
|
||||
UserDereferenceObject(OldCursor);
|
||||
#else
|
||||
IntDestroyCursor( hDragCursor, FALSE );
|
||||
#endif
|
||||
|
||||
@@ -662,9 +662,15 @@ DesktopWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lRe
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#ifdef NEW_CURSORICON
|
||||
pcurNew->CURSORF_flags |= CURSORF_CURRENT;
|
||||
#endif
|
||||
pcurOld = UserSetCursor(pcurNew, FALSE);
|
||||
if (pcurOld)
|
||||
{
|
||||
#ifdef NEW_CURSORICON
|
||||
pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
|
||||
#endif
|
||||
UserDereferenceObject(pcurOld);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@@ -761,7 +761,8 @@ UserChangeDisplaySettings(
|
||||
ulResult = PDEVOBJ_bSwitchMode(ppdev, pdm);
|
||||
|
||||
/* Restore mouse pointer, no hooks called */
|
||||
UserSetCursor(pvOldCursor, TRUE);
|
||||
pvOldCursor = UserSetCursor(pvOldCursor, TRUE);
|
||||
ASSERT(pvOldCursor == NULL);
|
||||
|
||||
/* Check for failure */
|
||||
if (!ulResult)
|
||||
|
||||
@@ -168,7 +168,7 @@ static PVOID AllocProcMarkObject(
|
||||
return ObjHead;
|
||||
}
|
||||
|
||||
static void FreeProcMarkObject(
|
||||
void FreeProcMarkObject(
|
||||
_In_ PVOID Object)
|
||||
{
|
||||
PPROCESSINFO ppi = ((PPROCMARKHEAD)Object)->ppi;
|
||||
@@ -221,7 +221,7 @@ static const struct
|
||||
#ifndef NEW_CURSORICON
|
||||
{ AllocProcMarkObject, /*UserCursorCleanup*/NULL, FreeProcMarkObject }, /* TYPE_CURSOR */
|
||||
#else
|
||||
{ AllocProcMarkObject, IntDestroyCurIconObject, FreeProcMarkObject }, /* TYPE_CURSOR */
|
||||
{ AllocProcMarkObject, IntDestroyCurIconObject, FreeCurIconObject }, /* TYPE_CURSOR */
|
||||
#endif
|
||||
{ AllocSysObject, /*UserSetWindowPosCleanup*/NULL, FreeSysObject }, /* TYPE_SETWINDOWPOS */
|
||||
{ AllocDeskThreadObject, IntRemoveHook, FreeDeskThreadObject }, /* TYPE_HOOK */
|
||||
|
||||
@@ -56,4 +56,6 @@ UserDerefObjectCo(PVOID obj)
|
||||
UserDereferenceObject(obj);
|
||||
}
|
||||
|
||||
void FreeProcMarkObject(_In_ PVOID Object);
|
||||
|
||||
/* EOF */
|
||||
|
||||
Reference in New Issue
Block a user