Updated user32-GetMouseMovePointsEx patchset

Thanks Ryan for the updated patch/

As Ryan pointed out.  Mount & Blade II requires that last point
to be different from the point or else it cannot workout what direction
the mouse moved.

This would need some sort of server side cache of mouse movements which
this function could ask for.
This commit is contained in:
Alistair Leslie-Hughes 2020-04-02 14:21:15 +11:00
parent 56b4eed468
commit e8abb98858
2 changed files with 29 additions and 25 deletions

View File

@ -5915,9 +5915,9 @@ fi
# | * dlls/user32/input.c
# |
if test "$enable_user32_GetMouseMovePointsEx" -eq 1; then
patch_apply user32-GetMouseMovePointsEx/0001-user32-Semi-stub-GetMouseMovePointsEx.patch
patch_apply user32-GetMouseMovePointsEx/0001-user32-Partially-implement-GetMouseMovePointsEx.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "user32: Semi-stub GetMouseMovePointsEx.", 1 },';
printf '%s\n' '+ { "Ryan S. Northrup (RyNo)", "user32: Semi-stub GetMouseMovePointsEx.", 2 },';
) >> "$patchlist"
fi

View File

@ -1,18 +1,17 @@
From 021f0888f1d8282229ad10dbcd1ced5ef21a266b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 2 Apr 2020 12:01:34 +1100
Subject: [PATCH] user32: Semi-stub GetMouseMovePointsEx.
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
Based off patch by Ryan S. Northrup.
---
dlls/user32/input.c | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
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 97a5ada922e..e7dbe544f55 100644
index 0325e2ce3d..bf029093bf 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -1298,7 +1298,10 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
@@ -1268,7 +1268,12 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
* Success: count of point set in the buffer
* Failure: -1
*/
@ -21,10 +20,12 @@ index 97a5ada922e..e7dbe544f55 100644
+{
+ 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);
@@ -1310,10 +1313,37 @@ int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOI
@@ -1280,10 +1285,40 @@ int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOI
return -1;
}
@ -34,37 +35,40 @@ index 97a5ada922e..e7dbe544f55 100644
+ 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;
+ }
+
+ if (!count)
+ return 0;
+
- 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) {
+ /* The supplied point must be part of the output. */
+ ptout[1].x = ptin->x;
+ ptout[1].y = ptin->y;
+ 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);
+ }
- SetLastError(ERROR_POINT_NOT_FOUND);
- return -1;
+
+ last_x = pos.x;
+ last_y = pos.y;
+
+ return count > 1 ? 2 : 1;
}
/***********************************************************************
--
2.25.1
2.24.1