Author: jimtabor
Date: Fri Nov  8 13:28:43 2013
New Revision: 60884

URL: http://svn.reactos.org/svn/reactos?rev=60884&view=rev
Log:
- Fix the broken references.

Modified:
    trunk/reactos/win32ss/user/ntuser/msgqueue.c

Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgqueue.c?rev=60884&r1=60883&r2=60884&view=diff
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.c        [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.c        [iso-8859-1] Fri Nov  8 
13:28:43 2013
@@ -631,7 +631,11 @@
        }
        else
        {
-           //if (!IntGetCaptureWindow()) ptiLastInput = pti;
+           if (!IntGetCaptureWindow())
+           {
+             // ERR("ptiLastInput is set\n");
+             // ptiLastInput = pti; // Once this is set during Reboot or 
Shutdown, this prevents the exit window having foreground.
+           }
            TRACE("Posting mouse message to hwnd=%p!\n", UserHMGetHandle(pwnd));
            MsqPostMessage(pti, Msg, TRUE, QS_MOUSEBUTTON, 0);
        }
@@ -1104,8 +1108,6 @@
    {
       PVOID WaitObjects[3];
 
-      ObReferenceObject(ptirec->pEThread);
-
       WaitObjects[0] = &CompletionEvent;       // Wait 0
       WaitObjects[1] = pti->pEventQueueServer; // Wait 1
       WaitObjects[2] = ptirec->pEThread;       // Wait 2
@@ -1162,14 +1164,10 @@
             TRACE("MsqSendMessage timed out 2\n");
             break;
          }
-         /*if (WaitStatus == STATUS_WAIT_1)
+         // Receiving thread passed on and left us hanging with issues still 
pending.
+         if ( WaitStatus == STATUS_WAIT_2 )
          {
-            ERR("Event hit\n");
-         }*/
-         // Receiving thread passed on and left us hanging with issues still 
pending.
-         if (WaitStatus == STATUS_WAIT_2)
-         {
-            ERR("Thread woken up dead!\n");
+            ERR("Receiving Thread woken up dead!\n");
             Entry = pti->DispatchingMessagesHead.Flink;
             while (Entry != &pti->DispatchingMessagesHead)
             {
@@ -1189,11 +1187,10 @@
             ;
       }
       while (NT_SUCCESS(WaitStatus) && WaitStatus == STATUS_WAIT_1);
-      ObDereferenceObject(ptirec->pEThread);
    }
 
    if(WaitStatus != STATUS_TIMEOUT)
-      *uResult = (STATUS_WAIT_0 == WaitStatus ? Result : -1);
+      if (uResult) *uResult = (STATUS_WAIT_0 == WaitStatus ? Result : -1);
 
    return WaitStatus;
 }


Reply via email to