diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 3de25f4218a..7349d865f01 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -1217,73 +1217,6 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) return TRUE; } -/*********************************************************************** - * GetMouseMovePointsEx [USER32] - * - * RETURNS - * Success: count of point set in the buffer - * Failure: -1 - */ -int WINAPI GetMouseMovePointsEx( UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOINT ptout, int count, DWORD resolution ) -{ - cursor_pos_t *pos, positions[64]; - int copied; - unsigned int i; - - - TRACE( "%d, %p, %p, %d, %d\n", size, ptin, ptout, count, resolution ); - - if ((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > ARRAY_SIZE( positions ))) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return -1; - } - - if (!ptin || (!ptout && count)) - { - SetLastError( ERROR_NOACCESS ); - return -1; - } - - if (resolution != GMMP_USE_DISPLAY_POINTS) - { - FIXME( "only GMMP_USE_DISPLAY_POINTS is supported for now\n" ); - SetLastError( ERROR_POINT_NOT_FOUND ); - return -1; - } - - SERVER_START_REQ( get_cursor_history ) - { - wine_server_set_reply( req, &positions, sizeof(positions) ); - if (wine_server_call_err( req )) return -1; - } - SERVER_END_REQ; - - for (i = 0; i < ARRAY_SIZE( positions ); i++) - { - pos = &positions[i]; - if (ptin->x == pos->x && ptin->y == pos->y && (!ptin->time || ptin->time == pos->time)) - break; - } - - if (i == ARRAY_SIZE( positions )) - { - SetLastError( ERROR_POINT_NOT_FOUND ); - return -1; - } - - for (copied = 0; copied < count && i < ARRAY_SIZE( positions ); copied++, i++) - { - pos = &positions[i]; - ptout[copied].x = pos->x; - ptout[copied].y = pos->y; - ptout[copied].time = pos->time; - ptout[copied].dwExtraInfo = pos->info; - } - - return copied; -} - /*********************************************************************** * EnableMouseInPointer (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 2b022d931aa..0e9d98164b5 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -349,7 +349,7 @@ @ stdcall GetMessageW(ptr long long long) @ stdcall GetMonitorInfoA(long ptr) @ stdcall GetMonitorInfoW(long ptr) -@ stdcall GetMouseMovePointsEx(long ptr ptr long long) +@ stdcall GetMouseMovePointsEx(long ptr ptr long long) NtUserGetMouseMovePointsEx @ stdcall GetNextDlgGroupItem(long long long) @ stdcall GetNextDlgTabItem(long long long) # @ stub GetNextQueueWindow diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index e1c8595ac07..bc3cd17a29e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -698,3 +698,67 @@ BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id ) return ret; } + +/*********************************************************************** + * NtUserGetMouseMovePointsEx (win32u.@) + */ +int WINAPI NtUserGetMouseMovePointsEx( UINT size, MOUSEMOVEPOINT *ptin, MOUSEMOVEPOINT *ptout, + int count, DWORD resolution ) +{ + cursor_pos_t *pos, positions[64]; + int copied; + unsigned int i; + + + TRACE( "%d, %p, %p, %d, %d\n", size, ptin, ptout, count, resolution ); + + if ((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > ARRAY_SIZE( positions ))) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return -1; + } + + if (!ptin || (!ptout && count)) + { + SetLastError( ERROR_NOACCESS ); + return -1; + } + + if (resolution != GMMP_USE_DISPLAY_POINTS) + { + FIXME( "only GMMP_USE_DISPLAY_POINTS is supported for now\n" ); + SetLastError( ERROR_POINT_NOT_FOUND ); + return -1; + } + + SERVER_START_REQ( get_cursor_history ) + { + wine_server_set_reply( req, &positions, sizeof(positions) ); + if (wine_server_call_err( req )) return -1; + } + SERVER_END_REQ; + + for (i = 0; i < ARRAY_SIZE( positions ); i++) + { + pos = &positions[i]; + if (ptin->x == pos->x && ptin->y == pos->y && (!ptin->time || ptin->time == pos->time)) + break; + } + + if (i == ARRAY_SIZE( positions )) + { + SetLastError( ERROR_POINT_NOT_FOUND ); + return -1; + } + + for (copied = 0; copied < count && i < ARRAY_SIZE( positions ); copied++, i++) + { + pos = &positions[i]; + ptout[copied].x = pos->x; + ptout[copied].y = pos->y; + ptout[copied].time = pos->time; + ptout[copied].dwExtraInfo = pos->info; + } + + return copied; +} diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 26471718e51..e07fdcc6953 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -115,6 +115,7 @@ static void * const syscalls[] = NtUserGetKeyboardLayout, NtUserGetKeyboardState, NtUserGetLayeredWindowAttributes, + NtUserGetMouseMovePointsEx, NtUserGetObjectInformation, NtUserGetOpenClipboardWindow, NtUserGetProcessWindowStation, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 47e352c2f27..7ae65b09279 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -956,7 +956,7 @@ @ stub NtUserGetMenuIndex @ stub NtUserGetMenuItemRect @ stub NtUserGetMessage -@ stub NtUserGetMouseMovePointsEx +@ stdcall -syscall NtUserGetMouseMovePointsEx(long ptr ptr long long) @ stdcall -syscall NtUserGetObjectInformation(long long long long ptr) @ stub NtUserGetOemBitmapSize @ stdcall -syscall NtUserGetOpenClipboardWindow() diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index d97563427ce..9a267025527 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -101,6 +101,7 @@ SYSCALL_ENTRY( NtUserGetKeyState ) \ SYSCALL_ENTRY( NtUserGetKeyboardState ) \ SYSCALL_ENTRY( NtUserGetLayeredWindowAttributes ) \ + SYSCALL_ENTRY( NtUserGetMouseMovePointsEx ) \ SYSCALL_ENTRY( NtUserGetObjectInformation ) \ SYSCALL_ENTRY( NtUserGetOpenClipboardWindow ) \ SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 39f54ae82ba..1c667889252 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -263,3 +263,14 @@ NTSTATUS WINAPI wow64_NtUserSetKeyboardState( UINT *args ) return NtUserSetKeyboardState( state ); } + +NTSTATUS WINAPI wow64_NtUserGetMouseMovePointsEx( UINT *args ) +{ + UINT size = get_ulong( &args ); + MOUSEMOVEPOINT *ptin = get_ptr( &args ); + MOUSEMOVEPOINT *ptout = get_ptr( &args ); + int count = get_ulong( &args ); + DWORD resolution = get_ulong( &args ); + + return NtUserGetMouseMovePointsEx( size, ptin, ptout, count, resolution ); +}