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); }