Author: jimtabor
Date: Sun Apr  3 02:14:14 2011
New Revision: 51237

URL: http://svn.reactos.org/svn/reactos?rev=51237&view=rev
Log:
[Win32k]
- Fix the return checks for  co_MsqWaitForNewMessages, now the wait_idle test 
no longer randomly crash, also tested the testkbd check from bug 3212. Setup 
co_MsqWaitForNewMessages to act like get message, checking QS bits and 
dispatching send messages if queued.
- Added desktop hit test data point, now the new track mouse timer code works. 
Not yet committed.

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/message.c
    trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/message.c?rev=51237&r1=51236&r2=51237&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sun Apr 
 3 02:14:14 2011
@@ -857,6 +857,10 @@
 
             return FALSE;
         }
+        if (Status == STATUS_USER_APC || Status == STATUS_TIMEOUT)
+        {
+           return FALSE;
+        }
     }
     while ( TRUE );
 
@@ -946,7 +950,9 @@
                                                Window,
                                                MsgFilterMin,
                                                MsgFilterMax);
-           if ( !NT_SUCCESS(Status) )
+           if ( !NT_SUCCESS(Status) ||
+                Status == STATUS_USER_APC ||
+                Status == STATUS_TIMEOUT )
            {
               Present = -1;
               break;

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c?rev=51237&r1=51236&r2=51237&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Sun 
Apr  3 02:14:14 2011
@@ -193,6 +193,7 @@
 {
    LARGE_INTEGER LargeTickCount;
    MSLLHOOKSTRUCT MouseHookData;
+   PDESKTOP pDesk;
    PWND pwnd, pwndDesktop;
 
    KeQueryTickCount(&LargeTickCount);
@@ -254,6 +255,9 @@
               IntPtInWindow(pwnd, Msg->pt.x, Msg->pt.y))
            {
                Msg->hwnd = pwnd->head.h;
+               pDesk = pwnd->head.rpdesk;
+               pDesk->htEx = HTCLIENT;
+               pDesk->spwndTrack = pwnd;
                break;
            }
        }
@@ -1030,8 +1034,6 @@
     }
 
     /* message is accepted now (but may still get dropped) */
-
-    pti->rpdesk->htEx = hittest; /* Now set the capture hit. */
 
     event.message = msg->message;
     event.time    = msg->time;
@@ -1351,8 +1353,20 @@
 co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
                          UINT MsgFilterMin, UINT MsgFilterMax)
 {
-   NTSTATUS ret;
-
+   PTHREADINFO pti;
+   NTSTATUS ret = STATUS_SUCCESS;
+   
+   pti = MessageQueue->Thread->Tcb.Win32Thread;
+
+   while ( co_MsqDispatchOneSentMessage(MessageQueue) );
+
+   if (pti->pcti->fsWakeBits & pti->pcti->fsChangeBits )
+   {
+      return ret;
+   }
+
+   pti->pClientInfo->cSpins = 0;
+   IdlePing();
    UserLeaveCo();
    ret = KeWaitForSingleObject(MessageQueue->NewMessages,
                               Executive,
@@ -1360,6 +1374,7 @@
                               FALSE, 
                               NULL);
    UserEnterCo();
+   IdlePong();
    return ret;
 }
 


Reply via email to