From dfb39c98492e69a2dc4a6da1cb7bf472b4eeb60d Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Fri, 7 Oct 2011 20:23:24 +0000 Subject: [PATCH] [WIN32K] - Do not call UserSetCursor in MsqCleanupMessageQueue because it uses current thread queue instead of queue in cleanup (they can be different). See issue #6530 for more details. svn path=/trunk/; revision=54051 --- reactos/subsystems/win32/win32k/main/dllmain.c | 2 -- reactos/subsystems/win32/win32k/ntuser/msgqueue.c | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/reactos/subsystems/win32/win32k/main/dllmain.c b/reactos/subsystems/win32/win32k/main/dllmain.c index 4733276714b..51efcc4ec69 100644 --- a/reactos/subsystems/win32/win32k/main/dllmain.c +++ b/reactos/subsystems/win32/win32k/main/dllmain.c @@ -399,8 +399,6 @@ Win32kThreadCallback(struct _ETHREAD *Thread, /* Do now some process cleanup that requires a valid win32 thread */ if(ptiCurrent->ppi->cThreads == 0) { - UserSetCursor(NULL, TRUE); - /* Check if we have registered the user api hook */ if(ptiCurrent->ppi == ppiUahServer) { diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index 3a4a9d49e23..a3a125457eb 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -2094,9 +2094,19 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) { PCURICON_OBJECT pCursor = MessageQueue->CursorObject; - /* Change to another cursor if we going to dereference current one */ + /* Change to another cursor if we going to dereference current one + Note: we can't use UserSetCursor because it uses current thread + message queue instead of queue given for cleanup */ if (IntGetSysCursorInfo()->CurrentCursorObject == pCursor) - UserSetCursor(NULL, TRUE); + { + HDC hdcScreen; + + /* Get the screen DC */ + hdcScreen = IntGetScreenDC(); + if (hdcScreen) + GreMovePointer(hdcScreen, -1, -1); + IntGetSysCursorInfo()->CurrentCursorObject = NULL; + } UserDereferenceObject(pCursor); }