wine-staging/patches/user32-GetMouseMovePointsEx/0001-user32-Partially-implement-GetMouseMovePointsEx.patch

75 lines
2.3 KiB
Diff
Raw Normal View History

From 9df9c77fe5f5fef1e22cf46e780de5eca8ffd274 Mon Sep 17 00:00:00 2001
From: "Ryan S. Northrup (RyNo)" <northrup@yellowapple.us>
Date: Wed, 1 Apr 2020 19:59:53 -0700
Subject: [PATCH v2] user32: Semi-stub GetMouseMovePointsEx
---
dlls/user32/input.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 0325e2ce3d..bf029093bf 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -1268,7 +1268,12 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
* Success: count of point set in the buffer
* Failure: -1
*/
-int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOINT ptout, int count, DWORD res) {
+int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOINT ptout, int count, DWORD res)
+{
+ POINT pos;
+ static BOOL once;
+ static INT last_x = 0;
+ static INT last_y = 0;
if((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > 64)) {
SetLastError(ERROR_INVALID_PARAMETER);
@@ -1280,10 +1285,40 @@ int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOI
return -1;
}
- FIXME("(%d %p %p %d %d) stub\n", size, ptin, ptout, count, res);
+ if (!once++)
+ FIXME("(%d %p %p %d %d) semi-stub\n", size, ptin, ptout, count, res);
+ else
+ TRACE("(%d %p %p %d %d) semi-stub\n", size, ptin, ptout, count, res);
+
+ TRACE(" ptin: %d %d\n", ptin->x, ptin->y);
+
+ if (res == GMMP_USE_HIGH_RESOLUTION_POINTS)
+ {
+ WARN("GMMP_USE_HIGH_RESOLUTION_POINTS not supported");
+ SetLastError(ERROR_POINT_NOT_FOUND);
+ return -1;
+ }
- SetLastError(ERROR_POINT_NOT_FOUND);
- return -1;
+ GetCursorPos(&pos);
+
+ ptout[0].x = pos.x;
+ ptout[0].y = pos.y;
+ ptout[0].time = GetTickCount();
+ ptout[0].dwExtraInfo = 0;
+ TRACE(" ptout[0]: %d %d\n", pos.x, pos.y);
+
+ if (count > 1) {
+ ptout[1].x = last_x;
+ ptout[1].y = last_y;
+ ptout[1].time = GetTickCount();
+ ptout[1].dwExtraInfo = 0;
+ TRACE(" ptout[1]: %d %d\n", last_x, last_y);
+ }
+
+ last_x = pos.x;
+ last_y = pos.y;
+
+ return count > 1 ? 2 : 1;
}
/***********************************************************************
--
2.24.1