user32: Add RAWINPUT parameter to __wine_send_input.

And send_hardware_message.

This makes it possible to use __wine_send_input to send extended input
data, such as HID device notifications and WM_INPUT messages carrying
HID reports.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-04-09 13:11:33 +02:00 committed by Alexandre Julliard
parent 11ae0ade89
commit 123c17aa92
12 changed files with 19 additions and 19 deletions

View file

@ -119,9 +119,9 @@ BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret )
*
* Internal SendInput function to allow the graphics driver to inject real events.
*/
BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input )
BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput )
{
NTSTATUS status = send_hardware_message( hwnd, input, 0 );
NTSTATUS status = send_hardware_message( hwnd, input, rawinput, 0 );
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
@ -210,7 +210,7 @@ UINT WINAPI SendInput( UINT count, LPINPUT inputs, int size )
update_mouse_coords( &input );
/* fallthrough */
case INPUT_KEYBOARD:
status = send_hardware_message( 0, &input, SEND_HWMSG_INJECTED );
status = send_hardware_message( 0, &input, NULL, SEND_HWMSG_INJECTED );
break;
case INPUT_HARDWARE:
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );

View file

@ -3227,7 +3227,7 @@ static BOOL send_message( struct send_message_info *info, DWORD_PTR *res_ptr, BO
/***********************************************************************
* send_hardware_message
*/
NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags )
NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags )
{
struct user_key_state_info *key_state_info = get_user_thread_info()->key_state;
struct send_message_info info;

View file

@ -834,5 +834,5 @@
# All functions must be prefixed with '__wine_' (for internal functions)
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
#
@ cdecl __wine_send_input(long ptr)
@ cdecl __wine_send_input(long ptr ptr)
@ cdecl __wine_set_pixel_format(long long)

View file

@ -263,7 +263,7 @@ extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
extern DWORD get_input_codepage( void ) DECLSPEC_HIDDEN;
extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) DECLSPEC_HIDDEN;
extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags ) DECLSPEC_HIDDEN;
extern LRESULT MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;

View file

@ -680,7 +680,7 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags )
input.u.ki.time = 0;
input.u.ki.dwExtraInfo = 0;
__wine_send_input( hwnd, &input );
__wine_send_input( hwnd, &input, NULL );
}
/***********************************************************************

View file

@ -521,7 +521,7 @@ static int process_events( DWORD mask )
}
SERVER_END_REQ;
}
__wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input );
__wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input, NULL );
}
break;
@ -535,7 +535,7 @@ static int process_events( DWORD mask )
event->data.kbd.input.u.ki.wVk, event->data.kbd.input.u.ki.wVk,
event->data.kbd.input.u.ki.wScan );
update_keyboard_lock_state( event->data.kbd.input.u.ki.wVk, event->data.kbd.lock_state );
__wine_send_input( 0, &event->data.kbd.input );
__wine_send_input( 0, &event->data.kbd.input, NULL );
break;
default:

View file

@ -1427,10 +1427,10 @@ void macdrv_im_set_text(const macdrv_event *event)
{
input.ki.wScan = chars[i];
input.ki.dwFlags = KEYEVENTF_UNICODE;
__wine_send_input(hwnd, &input);
__wine_send_input(hwnd, &input, NULL);
input.ki.dwFlags = KEYEVENTF_UNICODE | KEYEVENTF_KEYUP;
__wine_send_input(hwnd, &input);
__wine_send_input(hwnd, &input, NULL);
}
}

View file

@ -929,7 +929,7 @@ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, DWORD fl
input.ki.time = time;
input.ki.dwExtraInfo = 0;
__wine_send_input(hwnd, &input);
__wine_send_input(hwnd, &input, NULL);
}

View file

@ -165,7 +165,7 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags,
input.mi.time = time;
input.mi.dwExtraInfo = 0;
__wine_send_input(top_level_hwnd, &input);
__wine_send_input(top_level_hwnd, &input, NULL);
}

View file

@ -1148,7 +1148,7 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD f
input.u.ki.time = time;
input.u.ki.dwExtraInfo = 0;
__wine_send_input( hwnd, &input );
__wine_send_input( hwnd, &input, NULL );
}

View file

@ -659,7 +659,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
sync_window_cursor( window );
last_cursor_change = input->u.mi.time;
}
__wine_send_input( hwnd, input );
__wine_send_input( hwnd, input, NULL );
return;
}
@ -699,7 +699,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
__wine_send_input( hwnd, input );
__wine_send_input( hwnd, input, NULL );
}
#ifdef SONAME_LIBXCURSOR
@ -1669,7 +1669,7 @@ void move_resize_window( HWND hwnd, int dir )
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.u.mi.time = GetTickCount();
input.u.mi.dwExtraInfo = 0;
__wine_send_input( hwnd, &input );
__wine_send_input( hwnd, &input, NULL );
}
while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
@ -1900,7 +1900,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
TRACE( "pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy, dx, dy );
input.type = INPUT_MOUSE;
__wine_send_input( 0, &input );
__wine_send_input( 0, &input, NULL );
return TRUE;
}

View file

@ -4406,7 +4406,7 @@ static inline BOOL WINAPI SetRectEmpty(LPRECT rect)
WORD WINAPI SYSTEM_KillSystemTimer( WORD );
#ifdef __WINESRC__
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input );
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput );
#endif
#ifdef __cplusplus