ReactOS  0.4.13-dev-100-gc8611ae
mouse.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * PURPOSE: Mouse functions
5  * FILE: win32ss/user/ntuser/mouse.c
6  * PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7  * Rafal Harabien (rafalh@reactos.org)
8  */
9 
10 #include <win32k.h>
11 DBG_DEFAULT_CHANNEL(UserInput);
12 
13 MOUSEMOVEPOINT gMouseHistoryOfMoves[64];
15 
16 /*
17  * UserGetMouseButtonsState
18  *
19  * Returns bitfield of MK_* flags used in mouse messages
20  */
23 {
24  WORD wRet = 0;
25 
27 
30 
31  return wRet;
32 }
33 
34 /*
35  * UserProcessMouseInput
36  *
37  * Process raw mouse input data
38  */
39 VOID NTAPI
41 {
42  MOUSEINPUT mi;
43 
44  /* Convert MOUSE_INPUT_DATA to MOUSEINPUT. First init all fields. */
45  mi.dx = mid->LastX;
46  mi.dy = mid->LastY;
47  mi.mouseData = 0;
48  mi.dwFlags = 0;
49  mi.time = 0;
50  mi.dwExtraInfo = mid->ExtraInformation;
51 
52  /* Mouse position */
53  if (mi.dx != 0 || mi.dy != 0)
55 
56  /* Flags for absolute move */
57  if (mid->Flags & MOUSE_MOVE_ABSOLUTE)
59  if (mid->Flags & MOUSE_VIRTUAL_DESKTOP)
61 
62  /* Left button */
67 
68  /* Middle button */
73 
74  /* Right button */
79 
80  /* Note: Next buttons use mouseData field so they cannot be sent in one call */
81 
82  /* Button 4 */
84  {
86  mi.mouseData |= XBUTTON1;
87  }
88  if (mid->ButtonFlags & MOUSE_BUTTON_4_UP)
89  {
91  mi.mouseData |= XBUTTON1;
92  }
93 
94  /* If mouseData is used by button 4, send input and clear mi */
96  {
98  RtlZeroMemory(&mi, sizeof(mi));
99  }
100 
101  /* Button 5 */
102  if (mid->ButtonFlags & MOUSE_BUTTON_5_DOWN)
103  {
104  mi.mouseData |= XBUTTON2;
106  }
107  if (mid->ButtonFlags & MOUSE_BUTTON_5_UP)
108  {
109  mi.mouseData |= XBUTTON2;
111  }
112 
113  /* If mouseData is used by button 5, send input and clear mi */
115  {
117  RtlZeroMemory(&mi, sizeof(mi));
118  }
119 
120  /* Mouse wheel */
121  if (mid->ButtonFlags & MOUSE_WHEEL)
122  {
123  mi.mouseData = mid->ButtonData;
125  }
126 
127  /* If something has changed, send input to user */
128  if (mi.dwFlags)
130 }
131 
132 /*
133  * IntFixMouseInputButtons
134  *
135  * Helper function for supporting mouse button swap function
136  */
137 DWORD
139 {
140  DWORD dwNewFlags;
141 
142  if (!gspv.bMouseBtnSwap)
143  return dwFlags;
144 
145  /* Buttons other than left and right are not affected */
146  dwNewFlags = dwFlags & ~(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP |
148 
149  /* Swap buttons */
151  dwNewFlags |= MOUSEEVENTF_RIGHTDOWN;
153  dwNewFlags |= MOUSEEVENTF_RIGHTUP;
155  dwNewFlags |= MOUSEEVENTF_LEFTDOWN;
157  dwNewFlags |= MOUSEEVENTF_LEFTUP;
158 
159  return dwNewFlags;
160 }
161 
162 /*
163  * UserSendMouseInput
164  *
165  * Process mouse input from input devices and SendInput API
166  */
167 BOOL NTAPI
169 {
170  POINT ptCursor;
171  PSYSTEM_CURSORINFO pCurInfo;
172  MSG Msg;
173  DWORD dwFlags;
174 
175  ASSERT(pmi);
176 
177  pCurInfo = IntGetSysCursorInfo();
178  ptCursor = gpsi->ptCursor;
180 
182 
183  if (pmi->dwFlags & MOUSEEVENTF_MOVE)
184  {
185  /* Mouse has changes position */
186  if (!(pmi->dwFlags & MOUSEEVENTF_ABSOLUTE))
187  {
188  /* Relative move */
189  ptCursor.x += pmi->dx;
190  ptCursor.y += pmi->dy;
191  }
192  else if (pmi->dwFlags & MOUSEEVENTF_VIRTUALDESK)
193  {
194  /* Absolute move in virtual screen units */
195  ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 16;
196  ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 16;
197  }
198  else
199  {
200  /* Absolute move in primary monitor units */
201  ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXSCREEN) >> 16;
202  ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYSCREEN) >> 16;
203  }
204  }
205 
206  /* Init message fields */
207  Msg.wParam = UserGetMouseButtonsState();
208  Msg.lParam = MAKELPARAM(ptCursor.x, ptCursor.y);
209  Msg.pt = ptCursor;
210  Msg.time = pmi->time;
211  if (!Msg.time)
212  {
213  Msg.time = EngGetTickCount32();
214  }
215 
216  /* Do GetMouseMovePointsEx FIFO. */
222  gcMouseHistoryOfMoves = 0; // 0 - 63 is 64, FIFO forwards.
223 
224  /* Update cursor position */
226  {
227  UserSetCursorPos(ptCursor.x, ptCursor.y, bInjected, pmi->dwExtraInfo, TRUE);
228  }
229 
230  /* Left button */
232  {
234  Msg.message = WM_LBUTTONDOWN;
235  pCurInfo->ButtonsDown |= MK_LBUTTON;
236  Msg.wParam |= MK_LBUTTON;
237  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
238  }
239  else if (dwFlags & MOUSEEVENTF_LEFTUP)
240  {
242  Msg.message = WM_LBUTTONUP;
243  pCurInfo->ButtonsDown &= ~MK_LBUTTON;
244  Msg.wParam &= ~MK_LBUTTON;
245  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
246  }
247 
248  /* Middle button */
250  {
252  Msg.message = WM_MBUTTONDOWN;
253  pCurInfo->ButtonsDown |= MK_MBUTTON;
254  Msg.wParam |= MK_MBUTTON;
255  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
256  }
257  else if (dwFlags & MOUSEEVENTF_MIDDLEUP)
258  {
260  Msg.message = WM_MBUTTONUP;
261  pCurInfo->ButtonsDown &= ~MK_MBUTTON;
262  Msg.wParam &= ~MK_MBUTTON;
263  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
264  }
265 
266  /* Right button */
268  {
270  Msg.message = WM_RBUTTONDOWN;
271  pCurInfo->ButtonsDown |= MK_RBUTTON;
272  Msg.wParam |= MK_RBUTTON;
273  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
274  }
275  else if (dwFlags & MOUSEEVENTF_RIGHTUP)
276  {
278  Msg.message = WM_RBUTTONUP;
279  pCurInfo->ButtonsDown &= ~MK_RBUTTON;
280  Msg.wParam &= ~MK_RBUTTON;
281  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
282  }
283 
286  {
287  /* Fail because both types of events use the mouseData field */
288  WARN("Invalid flags!\n");
289  return FALSE;
290  }
291 
292  /* X-Button (4 or 5) */
294  {
295  Msg.message = WM_XBUTTONDOWN;
296  if (pmi->mouseData & XBUTTON1)
297  {
298  SET_KEY_DOWN(gafAsyncKeyState, VK_XBUTTON1, TRUE);
299  pCurInfo->ButtonsDown |= MK_XBUTTON1;
300  Msg.wParam |= MAKEWPARAM(MK_XBUTTON1, XBUTTON1);
301  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
302  }
303  if (pmi->mouseData & XBUTTON2)
304  {
305  SET_KEY_DOWN(gafAsyncKeyState, VK_XBUTTON2, TRUE);
306  pCurInfo->ButtonsDown |= MK_XBUTTON2;
307  Msg.wParam |= MAKEWPARAM(MK_XBUTTON2, XBUTTON2);
308  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
309  }
310  }
311  else if (dwFlags & MOUSEEVENTF_XUP)
312  {
313  Msg.message = WM_XBUTTONUP;
314  if(pmi->mouseData & XBUTTON1)
315  {
316  SET_KEY_DOWN(gafAsyncKeyState, VK_XBUTTON1, FALSE);
317  pCurInfo->ButtonsDown &= ~MK_XBUTTON1;
318  Msg.wParam &= ~MK_XBUTTON1;
319  Msg.wParam |= MAKEWPARAM(0, XBUTTON2);
320  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
321  }
322  if (pmi->mouseData & XBUTTON2)
323  {
324  SET_KEY_DOWN(gafAsyncKeyState, VK_XBUTTON2, FALSE);
325  pCurInfo->ButtonsDown &= ~MK_XBUTTON2;
326  Msg.wParam &= ~MK_XBUTTON2;
327  Msg.wParam |= MAKEWPARAM(0, XBUTTON2);
328  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
329  }
330  }
331 
332  /* Mouse wheel */
334  {
335  Msg.message = WM_MOUSEWHEEL;
336  Msg.wParam = MAKEWPARAM(pCurInfo->ButtonsDown, pmi->mouseData);
337  co_MsqInsertMouseMessage(&Msg, bInjected, pmi->dwExtraInfo, TRUE);
338  }
339 
340  return TRUE;
341 }
342 
343 VOID
344 FASTCALL
346  PDESKTOP pDesk)
347 {
348  /* Generate a leave message */
349  if (pDesk->dwDTFlags & DF_TME_LEAVE)
350  {
351  UINT uMsg = (pDesk->htEx != HTCLIENT) ? WM_NCMOUSELEAVE : WM_MOUSELEAVE;
352  UserPostMessage(UserHMGetHandle(pDesk->spwndTrack), uMsg, 0, 0);
353  }
354  /* Kill the timer */
355  if (pDesk->dwDTFlags & DF_TME_HOVER)
357 
358  /* Reset state */
359  pDesk->dwDTFlags &= ~(DF_TME_LEAVE|DF_TME_HOVER);
360  pDesk->spwndTrack = NULL;
361 }
362 
363 BOOL
364 FASTCALL
366  LPTRACKMOUSEEVENT lpEventTrack)
367 {
368  PDESKTOP pDesk;
369  PTHREADINFO pti;
370 
372  pDesk = pti->rpdesk;
373 
374  /* Always cleared with size set and return true. */
375  RtlZeroMemory(lpEventTrack , sizeof(TRACKMOUSEEVENT));
376  lpEventTrack->cbSize = sizeof(TRACKMOUSEEVENT);
377 
378  if (pDesk->dwDTFlags & (DF_TME_LEAVE | DF_TME_HOVER) &&
379  pDesk->spwndTrack &&
380  pti->MessageQueue == pDesk->spwndTrack->head.pti->MessageQueue)
381  {
382  if (pDesk->htEx != HTCLIENT)
383  lpEventTrack->dwFlags |= TME_NONCLIENT;
384 
385  if (pDesk->dwDTFlags & DF_TME_LEAVE)
386  lpEventTrack->dwFlags |= TME_LEAVE;
387 
388  if (pDesk->dwDTFlags & DF_TME_HOVER)
389  {
390  lpEventTrack->dwFlags |= TME_HOVER;
391  lpEventTrack->dwHoverTime = pDesk->dwMouseHoverTime;
392  }
393  lpEventTrack->hwndTrack = UserHMGetHandle(pDesk->spwndTrack);
394  }
395  return TRUE;
396 }
397 
398 BOOL
399 FASTCALL
401  LPTRACKMOUSEEVENT lpEventTrack)
402 {
403  PDESKTOP pDesk;
404  PTHREADINFO pti;
405  PWND pWnd;
406  POINT point;
407 
409  pDesk = pti->rpdesk;
410 
411  if (!(pWnd = UserGetWindowObject(lpEventTrack->hwndTrack)))
412  return FALSE;
413 
414  if ( pDesk->spwndTrack != pWnd ||
415  (pDesk->htEx != HTCLIENT) ^ !!(lpEventTrack->dwFlags & TME_NONCLIENT) )
416  {
417  if ( lpEventTrack->dwFlags & TME_LEAVE && !(lpEventTrack->dwFlags & TME_CANCEL) )
418  {
419  UserPostMessage( lpEventTrack->hwndTrack,
421  0, 0);
422  }
423  TRACE("IntTrackMouseEvent spwndTrack %p pwnd %p\n", pDesk->spwndTrack, pWnd);
424  return TRUE;
425  }
426 
427  /* Tracking spwndTrack same as pWnd */
428  if (lpEventTrack->dwFlags & TME_CANCEL) // Canceled mode.
429  {
430  if (lpEventTrack->dwFlags & TME_LEAVE)
431  pDesk->dwDTFlags &= ~DF_TME_LEAVE;
432 
433  if (lpEventTrack->dwFlags & TME_HOVER)
434  {
435  if (pDesk->dwDTFlags & DF_TME_HOVER)
436  { // Kill hover timer.
438  pDesk->dwDTFlags &= ~DF_TME_HOVER;
439  }
440  }
441  }
442  else // Not Canceled.
443  {
444  if (lpEventTrack->dwFlags & TME_LEAVE)
445  pDesk->dwDTFlags |= DF_TME_LEAVE;
446 
447  if (lpEventTrack->dwFlags & TME_HOVER)
448  {
449  pDesk->dwDTFlags |= DF_TME_HOVER;
450 
451  if (!lpEventTrack->dwHoverTime || lpEventTrack->dwHoverTime == HOVER_DEFAULT)
452  pDesk->dwMouseHoverTime = gspv.iMouseHoverTime; // use the system default hover time-out.
453  else
454  pDesk->dwMouseHoverTime = lpEventTrack->dwHoverTime;
455  // Start timer for the hover period.
457  // Get windows thread message points.
458  point = pWnd->head.pti->ptLast;
459  // Set desktop mouse hover from the system default hover rectangle.
464  point.y + gspv.iMouseHoverHeight / 2);
465  }
466  }
467  return TRUE;
468 }
469 
470 BOOL
471 APIENTRY
473  LPTRACKMOUSEEVENT lpEventTrack)
474 {
475  TRACKMOUSEEVENT SafeTME;
476  BOOL bRet = FALSE;
477 
478  TRACE("Enter NtUserTrackMouseEvent\n");
479 
480  _SEH2_TRY
481  {
482  ProbeForRead(lpEventTrack, sizeof(TRACKMOUSEEVENT), 1);
483  RtlCopyMemory(&SafeTME, lpEventTrack, sizeof(TRACKMOUSEEVENT));
484  }
486  {
488  _SEH2_YIELD(return FALSE);
489  }
490  _SEH2_END;
491 
492  if (SafeTME.cbSize != sizeof(TRACKMOUSEEVENT))
493  {
495  return FALSE;
496  }
497 
498  if (SafeTME.dwFlags & ~(TME_CANCEL | TME_QUERY | TME_NONCLIENT | TME_LEAVE | TME_HOVER) )
499  {
501  return FALSE;
502  }
503 
505 
506  if (SafeTME.dwFlags & TME_QUERY)
507  {
508  bRet = IntQueryTrackMouseEvent(&SafeTME);
509  _SEH2_TRY
510  {
511  ProbeForWrite(lpEventTrack, sizeof(TRACKMOUSEEVENT), 1);
512  RtlCopyMemory(lpEventTrack, &SafeTME, sizeof(TRACKMOUSEEVENT));
513  }
515  {
517  bRet = FALSE;
518  }
519  _SEH2_END;
520  }
521  else
522  {
523  bRet = IntTrackMouseEvent(&SafeTME);
524  }
525 
526  TRACE("Leave NtUserTrackMouseEvent, ret=%i\n", bRet);
527  UserLeave();
528  return bRet;
529 }
530 
531 DWORD
532 APIENTRY
534  UINT cbSize,
535  LPMOUSEMOVEPOINT lpptIn,
536  LPMOUSEMOVEPOINT lpptOut,
537  int nBufPoints,
538  DWORD resolution)
539 {
540  MOUSEMOVEPOINT Safeppt;
541  //BOOL Hit;
542  INT iRet = -1;
543 
544  TRACE("Enter NtUserGetMouseMovePointsEx\n");
545 
546  if ((cbSize != sizeof(MOUSEMOVEPOINT)) || (nBufPoints < 0) || (nBufPoints > 64))
547  {
549  return (DWORD)-1;
550  }
551 
552  if (!lpptIn || (!lpptOut && nBufPoints))
553  {
555  return (DWORD)-1;
556  }
557 
558  _SEH2_TRY
559  {
560  ProbeForRead(lpptIn, cbSize, 1);
561  RtlCopyMemory(&Safeppt, lpptIn, cbSize);
562  }
564  {
566  _SEH2_YIELD(return (DWORD)-1);
567  }
568  _SEH2_END;
569 
570  UserEnterShared();
571 
572  // http://msdn.microsoft.com/en-us/library/ms646259(v=vs.85).aspx
573  // This explains the math issues in transforming points.
574  iRet = gcMouseHistoryOfMoves; // FIFO is forward so retrieve backward.
575  //Hit = FALSE;
576  do
577  {
578  if (Safeppt.x == 0 && Safeppt.y == 0)
579  break; // No test.
580  // Finds the point, it returns the last nBufPoints prior to and including the supplied point.
581  if (gMouseHistoryOfMoves[iRet].x == Safeppt.x && gMouseHistoryOfMoves[iRet].y == Safeppt.y)
582  {
583  if (Safeppt.time) // Now test time and it seems to be absolute.
584  {
585  if (Safeppt.time == gMouseHistoryOfMoves[iRet].time)
586  {
587  //Hit = TRUE;
588  break;
589  }
590  else
591  {
592  if (--iRet < 0) iRet = 63;
593  continue;
594  }
595  }
596  //Hit = TRUE;
597  break;
598  }
599  if (--iRet < 0) iRet = 63;
600  }
601  while (iRet != gcMouseHistoryOfMoves);
602 
603  switch(resolution)
604  {
605  case GMMP_USE_DISPLAY_POINTS:
606  if (nBufPoints)
607  {
608  _SEH2_TRY
609  {
610  ProbeForWrite(lpptOut, cbSize, 1);
611  }
613  {
615  iRet = -1;
616  _SEH2_YIELD(goto cleanup);
617  }
618  _SEH2_END;
619  }
620  iRet = nBufPoints;
621  break;
622  case GMMP_USE_HIGH_RESOLUTION_POINTS:
623  break;
624  default:
626  iRet = -1;
627  }
628 
629 cleanup:
630  TRACE("Leave NtUserGetMouseMovePointsEx, ret=%i\n", iRet);
631  UserLeave();
632  return (DWORD)iRet;
633 }
#define WM_MBUTTONUP
Definition: winuser.h:1759
BYTE gafAsyncKeyState[256 *2/8]
Definition: keyboard.c:13
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
#define MOUSEEVENTF_LEFTDOWN
Definition: winuser.h:1170
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:241
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1181
DWORD htEx
Definition: desktop.h:32
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID FASTCALL co_MsqInsertMouseMessage(MSG *Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
Definition: msgqueue.c:580
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define TME_NONCLIENT
Definition: commctrl.h:4953
#define MOUSEEVENTF_ABSOLUTE
Definition: winuser.h:1180
#define MK_SHIFT
Definition: winuser.h:2323
#define MOUSE_MIDDLE_BUTTON_DOWN
Definition: ntddmou.h:50
#define MOUSE_LEFT_BUTTON_DOWN
Definition: ntddmou.h:46
PWND spwndTrack
Definition: desktop.h:31
#define ID_EVENT_SYSTIMER_MOUSEHOVER
Definition: timer.h:27
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define MK_LBUTTON
Definition: winuser.h:2321
long x
Definition: polytest.cpp:48
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1028
#define VK_LBUTTON
Definition: winuser.h:2144
BOOL bMouseBtnSwap
Definition: sysparams.h:82
#define MOUSEEVENTF_WHEEL
Definition: winuser.h:1178
#define MOUSEEVENTF_XDOWN
Definition: winuser.h:1176
#define EngGetTickCount32()
Definition: eng.h:43
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define MOUSE_WHEEL
Definition: ntddmou.h:56
#define MK_MBUTTON
Definition: winuser.h:2325
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WARN(fmt,...)
Definition: debug.h:111
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:573
#define DF_TME_LEAVE
Definition: desktop.h:48
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct @1567 Msg[]
static MONITORINFO mi
Definition: win.c:7331
#define MOUSEEVENTF_MIDDLEDOWN
Definition: winuser.h:1174
#define MOUSEEVENTF_MIDDLEUP
Definition: winuser.h:1175
BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pmi, BOOL bInjected)
Definition: mouse.c:168
WORD FASTCALL UserGetMouseButtonsState(VOID)
Definition: mouse.c:22
INT iMouseHoverHeight
Definition: sysparams.h:86
#define FASTCALL
Definition: nt_native.h:50
BOOL UserSetCursorPos(INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
Definition: cursoricon.c:238
struct _DESKTOP * rpdesk
Definition: win32.h:91
PSERVERINFO gpsi
Definition: main.c:27
int32_t INT
Definition: typedefs.h:56
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
POINTL point
Definition: edittest.c:50
RECT rcMouseHover
Definition: desktop.h:33
LONG y
Definition: windef.h:315
DWORD APIENTRY NtUserGetMouseMovePointsEx(UINT cbSize, LPMOUSEMOVEPOINT lpptIn, LPMOUSEMOVEPOINT lpptOut, int nBufPoints, DWORD resolution)
Definition: mouse.c:533
_SEH2_TRY
Definition: create.c:4250
#define MOUSEEVENTF_VIRTUALDESK
Definition: winuser.h:1179
USHORT Flags
Definition: ntddmou.h:78
INT iMouseHoverWidth
Definition: sysparams.h:85
#define SM_CXSCREEN
Definition: winuser.h:949
#define ERROR_NOACCESS
Definition: winerror.h:578
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define VK_RBUTTON
Definition: winuser.h:2145
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SET_KEY_DOWN(ks, vk, down)
Definition: input.h:100
#define MOUSE_BUTTON_4_DOWN
Definition: ntddmou.h:52
DWORD dwDTFlags
Definition: desktop.h:12
#define WM_MOUSELEAVE
Definition: commctrl.h:4946
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define MOUSE_BUTTON_4_UP
Definition: ntddmou.h:53
#define VK_SHIFT
Definition: winuser.h:2156
THRDESKHEAD head
Definition: ntuser.h:659
BOOL FASTCALL IntQueryTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:365
VOID CALLBACK SystemTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: timer.c:280
PPROCESSINFO gppiInputProvider
Definition: ntuser.c:16
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_POINT_NOT_FOUND
Definition: winerror.h:693
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define MK_RBUTTON
Definition: winuser.h:2322
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1029
#define WM_RBUTTONDOWN
Definition: winuser.h:1755
#define MOUSE_BUTTON_5_UP
Definition: ntddmou.h:55
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:180
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define SM_CYSCREEN
Definition: winuser.h:950
#define TRACE(s)
Definition: solgame.cpp:4
INT gcMouseHistoryOfMoves
Definition: mouse.c:14
struct _THREADINFO * PTHREADINFO
Definition: ntwin32.h:6
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
static LPMOUSEMOVEPOINT
Definition: input.c:87
#define TMRF_SYSTEM
Definition: timer.h:20
ULONG ExtraInformation
Definition: ntddmou.h:89
#define TME_QUERY
Definition: commctrl.h:4954
unsigned short WORD
Definition: ntddk_ex.h:93
SPIVALUES gspv
Definition: sysparams.c:17
PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID)
Definition: cursoricon.c:187
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:314
#define MOUSE_LEFT_BUTTON_UP
Definition: ntddmou.h:47
#define MOUSE_MIDDLE_BUTTON_UP
Definition: ntddmou.h:51
#define MOUSE_RIGHT_BUTTON_DOWN
Definition: ntddmou.h:48
#define WM_RBUTTONUP
Definition: winuser.h:1756
ULONG_PTR dwExtraInfo
Definition: winable.h:44
USHORT ButtonData
Definition: ntddmou.h:83
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
DWORD dwMouseHoverTime
Definition: desktop.h:34
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
INT iMouseHoverTime
Definition: sysparams.h:87
USHORT ButtonFlags
Definition: ntddmou.h:82
struct tagTRACKMOUSEEVENT TRACKMOUSEEVENT
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MOUSEEVENTF_LEFTUP
Definition: winuser.h:1171
#define HOVER_DEFAULT
Definition: commctrl.h:4957
#define DF_TME_HOVER
Definition: desktop.h:47
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
#define MOUSEEVENTF_RIGHTUP
Definition: winuser.h:1173
BOOL APIENTRY NtUserTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:472
Definition: ntuser.h:657
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
_SEH2_END
Definition: create.c:4424
#define TME_HOVER
Definition: commctrl.h:4951
#define TME_CANCEL
Definition: commctrl.h:4955
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1169
#define TME_LEAVE
Definition: commctrl.h:4952
#define WM_LBUTTONUP
Definition: winuser.h:1753
#define WM_MBUTTONDOWN
Definition: winuser.h:1758
DWORD mouseData
Definition: winable.h:41
unsigned int UINT
Definition: ndis.h:50
#define MOUSEEVENTF_XUP
Definition: winuser.h:1177
#define MK_CONTROL
Definition: winuser.h:2324
DWORD IntFixMouseInputButtons(DWORD dwFlags)
Definition: mouse.c:138
MOUSEMOVEPOINT gMouseHistoryOfMoves[64]
Definition: mouse.c:13
#define VK_CONTROL
Definition: winuser.h:2157
DWORD time
Definition: winable.h:43
DWORD dwFlags
Definition: winuser.h:3729
VOID FASTCALL IntRemoveTrackMouseEvent(PDESKTOP pDesk)
Definition: mouse.c:345
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define WM_NCMOUSELEAVE
Definition: winuser.h:1818
#define MOUSE_RIGHT_BUTTON_UP
Definition: ntddmou.h:49
#define IS_KEY_DOWN(ks, vk)
Definition: input.h:98
char * cleanup(char *str)
Definition: wpickclick.c:99
#define MOUSE_BUTTON_5_DOWN
Definition: ntddmou.h:54
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
#define HTCLIENT
Definition: winuser.h:2429
#define MOUSE_MOVE_ABSOLUTE
Definition: ntddmou.h:68
DWORD dwFlags
Definition: winable.h:42
VOID NTAPI UserProcessMouseInput(PMOUSE_INPUT_DATA mid)
Definition: mouse.c:40
#define VK_MBUTTON
Definition: winuser.h:2147
DBG_DEFAULT_CHANNEL(UserInput)
BOOL FASTCALL IntTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:400
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define MOUSEEVENTF_RIGHTDOWN
Definition: winuser.h:1172
#define APIENTRY
Definition: api.h:79
#define MOUSE_VIRTUAL_DESKTOP
Definition: ntddmou.h:69