[Win32k]
authorJames Tabor <james.tabor@reactos.org>
Sun, 3 Oct 2010 19:18:19 +0000 (19:18 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sun, 3 Oct 2010 19:18:19 +0000 (19:18 +0000)
- Fixed ValidateTimerCallback, always returning true and just spinning in the loop.
- Add one more process information flag with a point type and capturing the hit test in desktop structure.

svn path=/trunk/; revision=48970

reactos/subsystems/win32/win32k/include/timer.h
reactos/subsystems/win32/win32k/include/win32.h
reactos/subsystems/win32/win32k/ntuser/message.c
reactos/subsystems/win32/win32k/ntuser/ntstubs.c
reactos/subsystems/win32/win32k/ntuser/timer.c

index 9b2b07f..e857402 100644 (file)
@@ -32,7 +32,7 @@ BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window);
 BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer);
 UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
 PTIMER FASTCALL FindSystemTimer(PMSG);
-BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM);
+BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM);
 VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
 UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
 BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);
index 5de6139..63dfba7 100644 (file)
@@ -25,6 +25,7 @@
 #define W32PF_SCREENSAVER             0x00200000
 #define W32PF_IDLESCREENSAVER         0x00400000
 #define W32PF_ICONTITLEREGISTERED     0x10000000
+#define W32PF_DPIAWARE                0x20000000
 // ReactOS
 #define W32PF_NOWINDOWGHOSTING       (0x01000000)
 #define W32PF_MANUALGUICHECK         (0x02000000)
@@ -93,6 +94,7 @@ typedef struct _THREADINFO
     HANDLE              hEventQueueClient;
     PKEVENT             pEventQueueServer;
     LIST_ENTRY          PtiLink;
+    POINT               ptLast;
 
     CLIENTTHREADINFO    cti;  // Used only when no Desktop or pcti NULL.
   /* ReactOS */
index 1d7a0b3..efa88eb 100644 (file)
@@ -394,7 +394,7 @@ IntDispatchMessage(PMSG pMsg)
   {
      if (pMsg->message == WM_TIMER)
      {
-        if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),Window,pMsg->wParam,pMsg->lParam))
+        if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),pMsg->lParam))
         {
            KeQueryTickCount(&TickCount);
            Time = MsqCalculateMessageTime(&TickCount);
@@ -963,13 +963,15 @@ MessageFound:
       }
 
 MsgExit:
+      pti->rpdesk->htEx = HitTest; /* Now set the capture hit. */
+
       if ( ISITHOOKED(WH_MOUSE) && IS_MOUSE_MESSAGE(Msg->Msg.message))
       {
-          if(!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg))
-                 {
-                         return FALSE;
-                 }
-         }
+          if (!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg))
+          {
+             return FALSE;
+          }
+      }
 
       if ( ISITHOOKED(WH_KEYBOARD) && IS_KBD_MESSAGE(Msg->Msg.message))
       {
index 8c128fe..3219a95 100644 (file)
@@ -1125,20 +1125,11 @@ NtUserValidateTimerCallback(
     LPARAM lParam)
 {
   BOOL Ret = FALSE;
-  PWINDOW_OBJECT Window = NULL;
 
   UserEnterShared();
 
-  if (hWnd)
-  {
-     Window = UserGetWindowObject(hWnd);
-     if (!Window || !Window->Wnd)
-        goto Exit;
-  }
+  Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), lParam);
 
-  Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), Window, wParam, lParam);
-
-Exit:
   UserLeave();
   return Ret;
 }
index 2f4e218..74bfe76 100644 (file)
@@ -167,11 +167,10 @@ FindSystemTimer(PMSG pMsg)
 BOOL
 FASTCALL
 ValidateTimerCallback(PTHREADINFO pti,
-                      PWINDOW_OBJECT Window,
-                      WPARAM wParam,
                       LPARAM lParam)
 {
   PLIST_ENTRY pLE;
+  BOOL Ret = FALSE;
   PTIMER pTmr = FirstpTmr;
 
   if (!pTmr) return FALSE;
@@ -180,18 +179,18 @@ ValidateTimerCallback(PTHREADINFO pti,
   do
   {
     if ( (lParam == (LPARAM)pTmr->pfn) &&
-         (pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
+        !(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
          (pTmr->pti->ppi == pti->ppi) )
+    {
+       Ret = TRUE;
        break;
-
+    }
     pLE = pTmr->ptmrList.Flink;
     pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
   } while (pTmr != FirstpTmr);
   TimerLeave();
 
-  if (!pTmr) return FALSE;
-
-  return TRUE;
+  return Ret;
 }
 
 UINT_PTR FASTCALL
@@ -616,8 +615,7 @@ NtUserSetSystemTimer(
 
    DPRINT("Enter NtUserSetSystemTimer\n");
 
-   // This is wrong, lpTimerFunc is NULL!
-   RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM));
+   RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM));
 
 CLEANUP:
    DPRINT("Leave NtUserSetSystemTimer, ret=%i\n", _ret_);