Commit d60708a1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserGetMouseMovePointsEx implementation from user32.

parent dc03ca3b
......@@ -1218,73 +1218,6 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
}
/***********************************************************************
* 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.@)
*/
BOOL WINAPI EnableMouseInPointer(BOOL enable)
......
......@@ -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
......
......@@ -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;
}
......@@ -115,6 +115,7 @@ static void * const syscalls[] =
NtUserGetKeyboardLayout,
NtUserGetKeyboardState,
NtUserGetLayeredWindowAttributes,
NtUserGetMouseMovePointsEx,
NtUserGetObjectInformation,
NtUserGetOpenClipboardWindow,
NtUserGetProcessWindowStation,
......
......@@ -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()
......
......@@ -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 ) \
......
......@@ -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 );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment