[PATCH 4/7] user32: Add helper for input drivers to submit native rawinput msgs.
Derek Lesho
dereklesho52 at gmail.com
Tue Jun 25 22:32:06 CDT 2019
Signed-off-by: Derek Lesho <dereklesho52 at Gmail.com>
---
dlls/user32/input.c | 29 +++++++++++++++++++++++++++++
dlls/user32/user32.spec | 1 +
include/winuser.h | 1 +
3 files changed, 31 insertions(+)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 8b2ae805aa..f7ef1c3be2 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -33,6 +33,7 @@
#include <assert.h>
#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
#include "ntstatus.h"
#define WIN32_NO_STATUS
@@ -129,6 +130,34 @@ BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input )
return !status;
}
+BOOL CDECL __wine_send_raw_input( const RAWINPUT *raw_input )
+{
+ NTSTATUS status;
+
+ SERVER_START_REQ( send_rawinput_message )
+ {
+ req->input.type = raw_input->header.dwType;
+ switch (raw_input->header.dwType)
+ {
+ case RIM_TYPEMOUSE:
+ if (raw_input->data.mouse.usFlags || raw_input->data.mouse.ulRawButtons
+ || raw_input->data.mouse.ulExtraInformation)
+ WARN("Unhandled parameters");
+
+ req->input.mouse.x = raw_input->data.mouse.lLastX;
+ req->input.mouse.y = raw_input->data.mouse.lLastY;
+ req->input.mouse.button_flags = raw_input->data.mouse.u.s.usButtonFlags;
+ req->input.mouse.button_data = raw_input->data.mouse.u.s.usButtonData;
+ break;
+ }
+ status = wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ if (status) SetLastError( RtlNtStatusToDosError(status) );
+ return !status;
+}
+
/***********************************************************************
* update_mouse_coords
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index d5b8597d8e..7103b86055 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -832,4 +832,5 @@
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
#
@ cdecl __wine_send_input(long ptr)
+@ cdecl __wine_send_raw_input(ptr)
@ cdecl __wine_set_pixel_format(long long)
diff --git a/include/winuser.h b/include/winuser.h
index 3cffaa19ac..5d8774b6e6 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4354,6 +4354,7 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD );
#ifdef __WINESRC__
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input );
+WINUSERAPI BOOL CDECL __wine_send_raw_input( const RAWINPUT *raw_input );
#endif
#ifdef __cplusplus
--
2.21.0
More information about the wine-devel
mailing list