Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=36873 Signed-off-by: Myah Caron qsniyg@protonmail.com --- So far, this is the only salvagable part of a patchset I was working on to implement GetMouseMovePointsEx.
Though I haven't tested this yet, according to what I understood from MSDN, the list of points is stored in user space, not kernel space:
The GetMouseMovePointsEx function will return points that eventually were dispatched not only to the calling thread but also to other threads.
My current belief (please correct me if you have any better ideas!) is that a separate internal wine message will be needed to implement it, as I was unable to abuse any of the existing ones to add this functionality (none contained all necessary fields).
Regarding this patch, the tests check the following:
- The last 64 points - The last 32 points after 32 points - Same, but with an explicit timestamp - Same, after a new point with the same coordinates have been added - Same, but using the timestamp for the new point
dlls/user32/tests/input.c | 127 +++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 1809c147cbd..302e16c0eb3 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1477,10 +1477,12 @@ static void test_GetMouseMovePointsEx(void) { #define BUFLIM 64 #define MYERROR 0xdeadbeef - int count, retval; + int count, retval, last_error; + DWORD old_time, new_time; MOUSEMOVEPOINT in; MOUSEMOVEPOINT out[200]; POINT point; + int i, j, expected;
/* Get a valid content for the input struct */ if(!GetCursorPos(&point)) { @@ -1605,6 +1607,129 @@ static void test_GetMouseMovePointsEx(void) ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == MYERROR, "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+ old_time = GetTickCount(); + for (i = 0; i < 64; i++) { + SetCursorPos((i+1)*2, (i+1)); + } + + count = 64; + in.x = (63+1)*2; + in.y = (63+1); + in.time = 0; + + SetLastError(MYERROR); + retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS); + last_error = GetLastError(); + todo_wine ok(retval == 64, "expected GetMouseMovePointsEx to succeed, got %d\n", retval); + if (retval == -1) { + ok(last_error == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", last_error); + } else { + for (i = 0; i < retval; i++) { + j = retval - i - 1; + + expected = (i + 1) * 2; + ok(out[j].x == expected, "expected [%d].x = %d, got %d\n", j, expected, out[j].x); + + expected = i + 1; + ok(out[j].y == expected, "expected [%d].y = %d, got %d\n", j, expected, out[j].y); + } + } + + in.x = (31+1)*2; + in.y = (31+1); + in.time = 0; + + SetLastError(MYERROR); + retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS); + last_error = GetLastError(); + todo_wine ok(retval == 32, "expected GetMouseMovePointsEx to succeed, got %d\n", retval); + if (retval == -1) { + ok(last_error == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", last_error); + } else { + for (i = 0; i < retval; i++) { + j = retval - i - 1; + + expected = (i + 1) * 2; + ok(out[j].x == expected, "expected [%d].x = %d, got %d\n", j, expected, out[j].x); + + expected = i + 1; + ok(out[j].y == expected, "expected [%d].y = %d, got %d\n", j, expected, out[j].y); + } + } + + in.time = old_time; + + SetLastError(MYERROR); + retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS); + last_error = GetLastError(); + todo_wine ok(retval == 32, "expected GetMouseMovePointsEx to succeed, got %d\n", retval); + if (retval == -1) { + ok(last_error == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", last_error); + } else { + for (i = 0; i < retval; i++) { + j = retval - i - 1; + + expected = (i + 1) * 2; + ok(out[j].x == expected, "expected [%d].x = %d, got %d\n", j, expected, out[j].x); + + expected = i + 1; + ok(out[j].y == expected, "expected [%d].y = %d, got %d\n", j, expected, out[j].y); + } + } + + Sleep(2); + + SetCursorPos(in.x, in.y); + new_time = GetTickCount(); + + SetLastError(MYERROR); + retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS); + last_error = GetLastError(); + todo_wine ok(retval == 31, "expected GetMouseMovePointsEx to succeed, got %d\n", retval); + if (retval == -1) { + ok(last_error == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", last_error); + } else { + for (i = 0; i < retval; i++) { + j = retval - i - 1; + + expected = (i + 2) * 2; + ok(out[j].x == expected, "expected [%d].x = %d, got %d\n", j, expected, out[j].x); + + expected = i + 2; + ok(out[j].y == expected, "expected [%d].y = %d, got %d\n", j, expected, out[j].y); + } + } + + in.time = new_time; + + SetLastError(MYERROR); + retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS); + last_error = GetLastError(); + todo_wine ok(retval == 64, "expected GetMouseMovePointsEx to succeed, got %d\n", retval); + if (retval == -1) { + ok(last_error == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", last_error); + } else { + for (i = 0; i < retval; i++) { + j = retval - i - 1; + + if (j == 0) + expected = in.x; + else if (j == 63) + expected = 4; + else + expected = (i + 2) * 2; + ok(out[j].x == expected, "expected [%d].x = %d, got %d\n", j, expected, out[j].x); + + if (j == 0) + expected = in.y; + else if (j == 63) + expected = 2; + else + expected = i + 2; + ok(out[j].y == expected, "expected [%d].y = %d, got %d\n", j, expected, out[j].y); + } + } + #undef BUFLIM #undef MYERROR } -- 2.28.0
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=78586
Your paranoid android.
=== w2008s64 (32 bit report) ===
user32: input.c:1665: Test failed: expected GetMouseMovePointsEx to succeed, got -1 input.c:1688: Test failed: expected GetMouseMovePointsEx to succeed, got -1
=== w8 (32 bit report) ===
user32: input.c:1665: Test failed: expected GetMouseMovePointsEx to succeed, got -1 input.c:1688: Test failed: expected GetMouseMovePointsEx to succeed, got -1
=== w1064v1809 (64 bit report) ===
user32: input.c:1665: Test failed: expected GetMouseMovePointsEx to succeed, got -1 input.c:1688: Test failed: expected GetMouseMovePointsEx to succeed, got -1
=== w10pro64_ja (64 bit report) ===
user32: input.c:1302: Test failed: Wrong set pos: (99,100) input.c:1322: Test failed: GetCursorPos: (99,100)