You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against 44cb53bb37d3c40ea90aec6e35a9c08326b6e848.
This commit is contained in:
@@ -1,120 +0,0 @@
|
||||
From db0ad0a517ca74f0b166d515eb9fdb15d06d695a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Fri, 19 Mar 2021 14:16:16 +0100
|
||||
Subject: [PATCH] hidclass.sys: Use __wine_send_input to send device
|
||||
notifications.
|
||||
|
||||
This currently does nothing, because winedevice.exe isn't associated
|
||||
with any desktop, and the INPUT_HARDWARE messages are dropped.
|
||||
|
||||
In this specific case, when INPUT type is INPUT_HARDWARE and hi.uMsg is
|
||||
WM_INPUT_DEVICE_CHANGE, the RAWINPUT structure usage is a non-standard
|
||||
extension for Wine internal usage:
|
||||
|
||||
* header.wParam contains the message GIDC_ARRIVAL / GIDC_REMOVAL wparam,
|
||||
|
||||
* hid.bRawData contains two bytes, which are the HID device UsagePage
|
||||
and Usage bytes, instead of a real HID report.
|
||||
|
||||
This will let us use the same entry point and structures to send device
|
||||
notifications as for the HID reports in the future (which will be sent
|
||||
with INPUT_HARDWARE type / WM_INPUT uMsg instead).
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
---
|
||||
dlls/hidclass.sys/Makefile.in | 2 +-
|
||||
dlls/hidclass.sys/pnp.c | 38 +++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 39 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in
|
||||
index 4b1e9338eb4..09281c118b4 100644
|
||||
--- a/dlls/hidclass.sys/Makefile.in
|
||||
+++ b/dlls/hidclass.sys/Makefile.in
|
||||
@@ -1,6 +1,6 @@
|
||||
MODULE = hidclass.sys
|
||||
IMPORTLIB = hidclass
|
||||
-IMPORTS = hal ntoskrnl
|
||||
+IMPORTS = hal ntoskrnl user32
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
|
||||
index de6f409a16b..9a1dcee192b 100644
|
||||
--- a/dlls/hidclass.sys/pnp.c
|
||||
+++ b/dlls/hidclass.sys/pnp.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "ddk/hidtypes.h"
|
||||
#include "ddk/wdm.h"
|
||||
#include "regstr.h"
|
||||
+#include "winuser.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/asm.h"
|
||||
#include "wine/list.h"
|
||||
@@ -97,6 +98,9 @@ static UINT32 alloc_rawinput_handle(void)
|
||||
return InterlockedIncrement(&counter);
|
||||
}
|
||||
|
||||
+/* make sure bRawData can hold two bytes without requiring additional allocation */
|
||||
+C_ASSERT(offsetof(RAWINPUT, data.hid.bRawData[2]) < sizeof(RAWINPUT));
|
||||
+
|
||||
static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_pdo)
|
||||
{
|
||||
WCHAR device_id[MAX_DEVICE_ID_LEN], instance_id[MAX_DEVICE_ID_LEN];
|
||||
@@ -159,6 +163,8 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
|
||||
WCHAR pdo_name[255];
|
||||
USAGE page, usage;
|
||||
NTSTATUS status;
|
||||
+ RAWINPUT rawinput;
|
||||
+ INPUT input;
|
||||
INT i;
|
||||
|
||||
status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, fdo, NULL, 0, &attr, sizeof(attr));
|
||||
@@ -247,6 +253,23 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
|
||||
sizeof(HID_XFER_PACKET) + pdo_ext->u.pdo.preparsed_data->caps.InputReportByteLength);
|
||||
|
||||
HID_StartDeviceThread(child_pdo);
|
||||
+
|
||||
+ rawinput.header.dwType = RIM_TYPEHID;
|
||||
+ rawinput.header.dwSize = offsetof(RAWINPUT, data.hid.bRawData[2]);
|
||||
+ rawinput.header.hDevice = ULongToHandle(pdo_ext->u.pdo.rawinput_handle);
|
||||
+ rawinput.header.wParam = GIDC_ARRIVAL;
|
||||
+ rawinput.data.hid.dwCount = 1;
|
||||
+ rawinput.data.hid.dwSizeHid = 2;
|
||||
+ rawinput.data.hid.bRawData[0] = pdo_ext->u.pdo.preparsed_data->caps.UsagePage;
|
||||
+ rawinput.data.hid.bRawData[1] = pdo_ext->u.pdo.preparsed_data->caps.Usage;
|
||||
+
|
||||
+ input.type = INPUT_HARDWARE;
|
||||
+ input.u.hi.uMsg = WM_INPUT_DEVICE_CHANGE;
|
||||
+ input.u.hi.wParamH = (WORD)(rawinput.header.dwSize >> 16);
|
||||
+ input.u.hi.wParamL = (WORD)(rawinput.header.dwSize >> 0);
|
||||
+ __wine_send_input(0, &input, &rawinput);
|
||||
+
|
||||
+ fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||
}
|
||||
|
||||
static NTSTATUS fdo_pnp(DEVICE_OBJECT *device, IRP *irp)
|
||||
@@ -409,6 +432,21 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
|
||||
case IRP_MN_REMOVE_DEVICE:
|
||||
{
|
||||
IRP *queued_irp;
|
||||
+ RAWINPUT rawinput;
|
||||
+ INPUT input;
|
||||
+
|
||||
+ rawinput.header.dwType = RIM_TYPEHID;
|
||||
+ rawinput.header.dwSize = offsetof(RAWINPUT, data.hid.bRawData[0]);
|
||||
+ rawinput.header.hDevice = ULongToHandle(ext->u.pdo.rawinput_handle);
|
||||
+ rawinput.header.wParam = GIDC_REMOVAL;
|
||||
+ rawinput.data.hid.dwCount = 0;
|
||||
+ rawinput.data.hid.dwSizeHid = 0;
|
||||
+
|
||||
+ input.type = INPUT_HARDWARE;
|
||||
+ input.u.hi.uMsg = WM_INPUT_DEVICE_CHANGE;
|
||||
+ input.u.hi.wParamH = (WORD)(rawinput.header.dwSize >> 16);
|
||||
+ input.u.hi.wParamL = (WORD)(rawinput.header.dwSize >> 0);
|
||||
+ __wine_send_input(0, &input, &rawinput);
|
||||
|
||||
IoSetDeviceInterfaceState(&ext->u.pdo.link_name, FALSE);
|
||||
if (ext->u.pdo.is_mouse)
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,123 +0,0 @@
|
||||
From 281b7628ea550071eab3b0c933b02ff67a3b215d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Mon, 22 Mar 2021 17:55:50 +0100
|
||||
Subject: [PATCH] server: Add rawinput union to hw_input_t / INPUT_HARDWARE.
|
||||
|
||||
When msg is WM_INPUT_DEVICE_CHANGE.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
---
|
||||
server/protocol.def | 42 ++++++++++++++++++++++++------------------
|
||||
server/trace.c | 23 +++++++++++++++++++++++
|
||||
2 files changed, 47 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 617818f622d..9539169f1ff 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -289,30 +289,32 @@ struct hw_msg_source
|
||||
unsigned int origin; /* source origin (IMO_* values) */
|
||||
};
|
||||
|
||||
+union rawinput
|
||||
+{
|
||||
+ int type;
|
||||
+ struct
|
||||
+ {
|
||||
+ int type; /* RIM_TYPEKEYBOARD */
|
||||
+ unsigned int message; /* message generated by this rawinput event */
|
||||
+ unsigned short vkey; /* virtual key code */
|
||||
+ unsigned short scan; /* scan code */
|
||||
+ } kbd;
|
||||
+ struct
|
||||
+ {
|
||||
+ int type; /* RIM_TYPEMOUSE */
|
||||
+ int x; /* x coordinate */
|
||||
+ int y; /* y coordinate */
|
||||
+ unsigned int data; /* mouse data */
|
||||
+ } mouse;
|
||||
+};
|
||||
+
|
||||
struct hardware_msg_data
|
||||
{
|
||||
lparam_t info; /* extra info */
|
||||
unsigned int hw_id; /* unique id */
|
||||
unsigned int flags; /* hook flags */
|
||||
struct hw_msg_source source; /* message source */
|
||||
- union
|
||||
- {
|
||||
- int type;
|
||||
- struct
|
||||
- {
|
||||
- int type; /* RIM_TYPEKEYBOARD */
|
||||
- unsigned int message; /* message generated by this rawinput event */
|
||||
- unsigned short vkey; /* virtual key code */
|
||||
- unsigned short scan; /* scan code */
|
||||
- } kbd;
|
||||
- struct
|
||||
- {
|
||||
- int type; /* RIM_TYPEMOUSE */
|
||||
- int x; /* x coordinate */
|
||||
- int y; /* y coordinate */
|
||||
- unsigned int data; /* mouse data */
|
||||
- } mouse;
|
||||
- } rawinput;
|
||||
+ union rawinput rawinput; /* rawinput message data */
|
||||
};
|
||||
|
||||
struct callback_msg_data
|
||||
@@ -357,6 +359,10 @@ typedef union
|
||||
int type; /* INPUT_HARDWARE */
|
||||
unsigned int msg; /* message code */
|
||||
lparam_t lparam; /* message param */
|
||||
+ union
|
||||
+ {
|
||||
+ union rawinput rawinput; /* WM_INPUT_DEVICE_CHANGE msg */
|
||||
+ } data;
|
||||
} hw;
|
||||
} hw_input_t;
|
||||
|
||||
diff --git a/server/trace.c b/server/trace.c
|
||||
index 44bc8d8ee6f..ce21ae4fe4f 100644
|
||||
--- a/server/trace.c
|
||||
+++ b/server/trace.c
|
||||
@@ -409,6 +409,24 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data )
|
||||
}
|
||||
}
|
||||
|
||||
+static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
|
||||
+{
|
||||
+ switch (rawinput->type)
|
||||
+ {
|
||||
+ case RIM_TYPEMOUSE:
|
||||
+ fprintf( stderr, "%s{type=MOUSE,x=%d,y=%d,data=%08x}", prefix, rawinput->mouse.x,
|
||||
+ rawinput->mouse.y, rawinput->mouse.data );
|
||||
+ break;
|
||||
+ case RIM_TYPEKEYBOARD:
|
||||
+ fprintf( stderr, "%s{type=KEYBOARD,message=%04x,vkey=%04hx,scan=%04hx}", prefix,
|
||||
+ rawinput->kbd.message, rawinput->kbd.vkey, rawinput->kbd.scan );
|
||||
+ break;
|
||||
+ default:
|
||||
+ fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type );
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||
{
|
||||
switch (input->type)
|
||||
@@ -429,6 +447,11 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||
case INPUT_HARDWARE:
|
||||
fprintf( stderr, "%s{type=HARDWARE,msg=%04x", prefix, input->hw.msg );
|
||||
dump_uint64( ",lparam=", &input->hw.lparam );
|
||||
+ switch (input->hw.msg)
|
||||
+ {
|
||||
+ case WM_INPUT_DEVICE_CHANGE:
|
||||
+ dump_rawinput( ",rawinput=", &input->hw.data.rawinput );
|
||||
+ }
|
||||
fputc( '}', stderr );
|
||||
break;
|
||||
default:
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,96 +0,0 @@
|
||||
From 6b794622488eb83f6ede9d62a14f413660a2623a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Mon, 22 Mar 2021 18:28:38 +0100
|
||||
Subject: [PATCH] server: Add RIM_TYPEHID type / hid member to rawinput union.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
---
|
||||
server/protocol.def | 8 ++++++++
|
||||
server/trace.c | 38 ++++++++++++++++++++++----------------
|
||||
2 files changed, 30 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 9539169f1ff..f97b966719c 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -306,6 +306,14 @@ union rawinput
|
||||
int y; /* y coordinate */
|
||||
unsigned int data; /* mouse data */
|
||||
} mouse;
|
||||
+ struct
|
||||
+ {
|
||||
+ int type; /* RIM_TYPEHID */
|
||||
+ unsigned int device; /* rawinput device index */
|
||||
+ unsigned int param; /* rawinput message param */
|
||||
+ unsigned int length; /* HID report length */
|
||||
+ /* followed by length bytes of HID report data */
|
||||
+ } hid;
|
||||
};
|
||||
|
||||
struct hardware_msg_data
|
||||
diff --git a/server/trace.c b/server/trace.c
|
||||
index ce21ae4fe4f..3d24cec0133 100644
|
||||
--- a/server/trace.c
|
||||
+++ b/server/trace.c
|
||||
@@ -409,6 +409,22 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data )
|
||||
}
|
||||
}
|
||||
|
||||
+static void dump_varargs_bytes( const char *prefix, data_size_t size )
|
||||
+{
|
||||
+ const unsigned char *data = cur_data;
|
||||
+ data_size_t len = min( 1024, size );
|
||||
+
|
||||
+ fprintf( stderr, "%s{", prefix );
|
||||
+ while (len > 0)
|
||||
+ {
|
||||
+ fprintf( stderr, "%02x", *data++ );
|
||||
+ if (--len) fputc( ',', stderr );
|
||||
+ }
|
||||
+ if (size > 1024) fprintf( stderr, "...(total %u)", size );
|
||||
+ fputc( '}', stderr );
|
||||
+ remove_data( size );
|
||||
+}
|
||||
+
|
||||
static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
|
||||
{
|
||||
switch (rawinput->type)
|
||||
@@ -421,6 +437,12 @@ static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
|
||||
fprintf( stderr, "%s{type=KEYBOARD,message=%04x,vkey=%04hx,scan=%04hx}", prefix,
|
||||
rawinput->kbd.message, rawinput->kbd.vkey, rawinput->kbd.scan );
|
||||
break;
|
||||
+ case RIM_TYPEHID:
|
||||
+ fprintf( stderr, "%s{type=HID,device=%04x,param=%04x,length=%u", prefix,
|
||||
+ rawinput->hid.device, rawinput->hid.param, rawinput->hid.length );
|
||||
+ dump_varargs_bytes( ",report=", rawinput->hid.length );
|
||||
+ fputc( '}', stderr );
|
||||
+ break;
|
||||
default:
|
||||
fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type );
|
||||
break;
|
||||
@@ -580,22 +602,6 @@ static void dump_varargs_user_handles( const char *prefix, data_size_t size )
|
||||
remove_data( size );
|
||||
}
|
||||
|
||||
-static void dump_varargs_bytes( const char *prefix, data_size_t size )
|
||||
-{
|
||||
- const unsigned char *data = cur_data;
|
||||
- data_size_t len = min( 1024, size );
|
||||
-
|
||||
- fprintf( stderr,"%s{", prefix );
|
||||
- while (len > 0)
|
||||
- {
|
||||
- fprintf( stderr, "%02x", *data++ );
|
||||
- if (--len) fputc( ',', stderr );
|
||||
- }
|
||||
- if (size > 1024) fprintf( stderr, "...(total %u)", size );
|
||||
- fputc( '}', stderr );
|
||||
- remove_data( size );
|
||||
-}
|
||||
-
|
||||
static void dump_varargs_string( const char *prefix, data_size_t size )
|
||||
{
|
||||
fprintf( stderr, "%s\"%.*s\"", prefix, (int)size, (const char *)cur_data );
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,47 +0,0 @@
|
||||
From dcd1d9ab1462b49093465e3e4117419b63778799 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Mon, 22 Mar 2021 18:11:27 +0100
|
||||
Subject: [PATCH] user32: Send WM_INPUT_DEVICE_CHANGE / RAWINPUT to the server.
|
||||
|
||||
Expect INPUT/INPUT_HARDWARE to be followed with RAWINPUT, when uMsg is
|
||||
WM_INPUT_DEVICE_CHANGE. This is for internal __wine_send_input calls
|
||||
only, as we ignore INPUT_HARDWARE in SendInput.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
---
|
||||
dlls/user32/message.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
|
||||
index f87ef9fb3af..f11aaa4144d 100644
|
||||
--- a/dlls/user32/message.c
|
||||
+++ b/dlls/user32/message.c
|
||||
@@ -3267,6 +3267,25 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
|
||||
case INPUT_HARDWARE:
|
||||
req->input.hw.msg = input->u.hi.uMsg;
|
||||
req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH );
|
||||
+ switch (input->u.hi.uMsg)
|
||||
+ {
|
||||
+ case WM_INPUT_DEVICE_CHANGE:
|
||||
+ req->input.hw.data.rawinput.type = rawinput->header.dwType;
|
||||
+ switch (rawinput->header.dwType)
|
||||
+ {
|
||||
+ case RIM_TYPEHID:
|
||||
+ assert( rawinput->data.hid.dwCount <= 1 );
|
||||
+ req->input.hw.data.rawinput.hid.device = HandleToUlong( rawinput->header.hDevice );
|
||||
+ req->input.hw.data.rawinput.hid.param = rawinput->header.wParam;
|
||||
+ req->input.hw.data.rawinput.hid.length = rawinput->data.hid.dwSizeHid;
|
||||
+ if (rawinput->data.hid.dwSizeHid)
|
||||
+ wine_server_add_data( req, rawinput->data.hid.bRawData, rawinput->data.hid.dwSizeHid );
|
||||
+ break;
|
||||
+ default:
|
||||
+ assert( 0 );
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
if (key_state_info) wine_server_set_reply( req, key_state_info->state,
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From cb2f3ed7057e769dda746b65464b364edb447c32 Mon Sep 17 00:00:00 2001
|
||||
From df872d2e07d188439a3fbe938a2d9c53c6e3d3a7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Wed, 7 Apr 2021 12:17:09 +0200
|
||||
Subject: [PATCH] server: Track known HID rawinput devices on addition and
|
||||
@@ -12,7 +12,7 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
1 file changed, 49 insertions(+)
|
||||
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index ca2f898492b..033e4e30b66 100644
|
||||
index ca2f898492b..becfb8b94c6 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -1656,6 +1656,42 @@ static struct thread *get_foreground_thread( struct desktop *desktop, user_handl
|
||||
@@ -65,13 +65,13 @@ index ca2f898492b..033e4e30b66 100644
|
||||
+ switch (input->hw.msg)
|
||||
+ {
|
||||
+ case WM_INPUT_DEVICE_CHANGE:
|
||||
+ if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
+ input->hw.data.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
+ insert_hid_rawinput_device( input->hw.data.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
+ if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
+ input->hw.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
+ insert_hid_rawinput_device( input->hw.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
+
|
||||
+ if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
+ input->hw.data.rawinput.hid.param == GIDC_REMOVAL)
|
||||
+ remove_hid_rawinput_device( input->hw.data.rawinput.hid.device );
|
||||
+ if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
+ input->hw.rawinput.hid.param == GIDC_REMOVAL)
|
||||
+ remove_hid_rawinput_device( input->hw.rawinput.hid.device );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From aec62828c1b4daee79e452e749eb215deb40425a Mon Sep 17 00:00:00 2001
|
||||
From 3f576ac591f515a621da1d706c85030c94fc39b3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Wed, 7 Apr 2021 12:17:40 +0200
|
||||
Subject: [PATCH] server: Implement WM_INPUT_DEVICE_CHANGE message dispatch.
|
||||
@@ -11,10 +11,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
3 files changed, 56 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
|
||||
index f11aaa4144d..54fcdc4588c 100644
|
||||
index 148b35f8caf..9af33c3291e 100644
|
||||
--- a/dlls/user32/message.c
|
||||
+++ b/dlls/user32/message.c
|
||||
@@ -2288,11 +2288,14 @@ static void accept_hardware_message( UINT hw_id )
|
||||
@@ -2289,11 +2289,14 @@ static void accept_hardware_message( UINT hw_id )
|
||||
static BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data )
|
||||
{
|
||||
struct rawinput_thread_data *thread_data = rawinput_thread_data();
|
||||
@@ -33,7 +33,7 @@ index f11aaa4144d..54fcdc4588c 100644
|
||||
msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt );
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2612,7 +2615,7 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar
|
||||
@@ -2613,7 +2616,7 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar
|
||||
/* hardware messages are always in physical coords */
|
||||
context = SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
|
||||
|
||||
@@ -43,10 +43,10 @@ index f11aaa4144d..54fcdc4588c 100644
|
||||
else if (is_keyboard_message( msg->message ))
|
||||
ret = process_keyboard_message( msg, hw_id, hwnd_filter, first, last, remove );
|
||||
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
|
||||
index ba11a121bc5..99481ffae3d 100644
|
||||
index f2d64ccc23b..d95d29d7656 100644
|
||||
--- a/dlls/user32/rawinput.c
|
||||
+++ b/dlls/user32/rawinput.c
|
||||
@@ -428,7 +428,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
|
||||
@@ -468,7 +468,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
|
||||
TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
|
||||
i, devices[i].usUsagePage, devices[i].usUsage,
|
||||
devices[i].dwFlags, devices[i].hwndTarget);
|
||||
@@ -56,7 +56,7 @@ index ba11a121bc5..99481ffae3d 100644
|
||||
|
||||
d[i].usage_page = devices[i].usUsagePage;
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index e71d9207e1a..9fe009b5cfe 100644
|
||||
index 3712f79df3e..3f48e0aabdc 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -1464,7 +1464,7 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru
|
||||
@@ -195,17 +195,17 @@ index e71d9207e1a..9fe009b5cfe 100644
|
||||
+ msg_data = &raw_msg.data;
|
||||
+ msg_data->info = 0;
|
||||
+ msg_data->flags = 0;
|
||||
+ msg_data->rawinput = input->hw.data.rawinput;
|
||||
+ msg_data->rawinput = input->hw.rawinput;
|
||||
+
|
||||
if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.data.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
insert_hid_rawinput_device( input->hw.data.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
insert_hid_rawinput_device( input->hw.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
|
||||
+ enum_processes( queue_rawinput_message, &raw_msg );
|
||||
+
|
||||
if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.data.rawinput.hid.param == GIDC_REMOVAL)
|
||||
remove_hid_rawinput_device( input->hw.data.rawinput.hid.device );
|
||||
if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.rawinput.hid.param == GIDC_REMOVAL)
|
||||
remove_hid_rawinput_device( input->hw.rawinput.hid.device );
|
||||
+
|
||||
+ if (raw_msg.foreground) release_object( raw_msg.foreground );
|
||||
return;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 9c6c0fb4a36ccf59313dbf0eff887c41c1749eb5 Mon Sep 17 00:00:00 2001
|
||||
From 018a5cdacc44e5ff883a1d4f62705bf466d8d62c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 23 Mar 2021 10:42:07 +0100
|
||||
Subject: [PATCH] server: Implement WM_INPUT / RIM_TYPEHID message dispatch.
|
||||
@@ -10,28 +10,27 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
|
||||
---
|
||||
dlls/user32/message.c | 1 +
|
||||
dlls/user32/rawinput.c | 22 ++++++++++++++++++++--
|
||||
server/protocol.def | 2 +-
|
||||
server/queue.c | 25 ++++++++++++++++++-------
|
||||
server/trace.c | 1 +
|
||||
5 files changed, 41 insertions(+), 10 deletions(-)
|
||||
4 files changed, 40 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
|
||||
index 54fcdc4588c..f986b71953a 100644
|
||||
index 9af33c3291e..e21ebf9d4d8 100644
|
||||
--- a/dlls/user32/message.c
|
||||
+++ b/dlls/user32/message.c
|
||||
@@ -3272,6 +3272,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
|
||||
@@ -3283,6 +3283,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
|
||||
req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH );
|
||||
switch (input->u.hi.uMsg)
|
||||
{
|
||||
+ case WM_INPUT:
|
||||
case WM_INPUT_DEVICE_CHANGE:
|
||||
req->input.hw.data.rawinput.type = rawinput->header.dwType;
|
||||
req->input.hw.rawinput.type = rawinput->header.dwType;
|
||||
switch (rawinput->header.dwType)
|
||||
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
|
||||
index a43021ceac9..c40b685be50 100644
|
||||
index d95d29d7656..f28bde339eb 100644
|
||||
--- a/dlls/user32/rawinput.c
|
||||
+++ b/dlls/user32/rawinput.c
|
||||
@@ -373,6 +373,22 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms
|
||||
@@ -371,6 +371,22 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms
|
||||
rawinput->data.keyboard.Message = msg_data->rawinput.kbd.message;
|
||||
rawinput->data.keyboard.ExtraInformation = msg_data->info;
|
||||
}
|
||||
@@ -54,7 +53,7 @@ index a43021ceac9..c40b685be50 100644
|
||||
else
|
||||
{
|
||||
FIXME("Unhandled rawinput type %#x.\n", msg_data->rawinput.type);
|
||||
@@ -566,7 +582,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size,
|
||||
@@ -564,7 +580,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size,
|
||||
struct hardware_msg_data *msg_data;
|
||||
struct rawinput_thread_data *thread_data;
|
||||
RAWINPUT *rawinput;
|
||||
@@ -63,7 +62,7 @@ index a43021ceac9..c40b685be50 100644
|
||||
BOOL is_wow64;
|
||||
int i;
|
||||
|
||||
@@ -626,7 +642,9 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size,
|
||||
@@ -624,7 +640,9 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size,
|
||||
data->header.dwSize - sizeof(RAWINPUTHEADER));
|
||||
data->header.dwSize += overhead;
|
||||
data = NEXTRAWINPUTBLOCK(data);
|
||||
@@ -74,21 +73,8 @@ index a43021ceac9..c40b685be50 100644
|
||||
}
|
||||
|
||||
if (count == 0 && next_size == 0) *data_size = 0;
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index c9a0b53dfea..ce137caaea8 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -358,7 +358,7 @@ typedef union
|
||||
lparam_t lparam; /* message param */
|
||||
union
|
||||
{
|
||||
- union rawinput rawinput; /* WM_INPUT_DEVICE_CHANGE msg */
|
||||
+ union rawinput rawinput; /* WM_INPUT and WM_INPUT_DEVICE_CHANGE msg */
|
||||
} data;
|
||||
} hw;
|
||||
} hw_input_t;
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index 248157ca7da..a411d0af8d2 100644
|
||||
index 55bcded3aff..52627015584 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -2044,6 +2044,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
|
||||
@@ -112,21 +98,21 @@ index 248157ca7da..a411d0af8d2 100644
|
||||
msg_data = &raw_msg.data;
|
||||
msg_data->info = 0;
|
||||
msg_data->flags = 0;
|
||||
msg_data->rawinput = input->hw.data.rawinput;
|
||||
msg_data->rawinput = input->hw.rawinput;
|
||||
|
||||
- if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
- if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
+ if (input->hw.msg == WM_INPUT_DEVICE_CHANGE &&
|
||||
+ input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.data.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
insert_hid_rawinput_device( input->hw.data.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
+ input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.rawinput.hid.param == GIDC_ARRIVAL)
|
||||
insert_hid_rawinput_device( input->hw.rawinput.hid.device, get_req_data(), get_req_data_size() );
|
||||
|
||||
enum_processes( queue_rawinput_message, &raw_msg );
|
||||
|
||||
- if (input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
- if (input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
+ if (input->hw.msg == WM_INPUT_DEVICE_CHANGE &&
|
||||
+ input->hw.data.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.data.rawinput.hid.param == GIDC_REMOVAL)
|
||||
remove_hid_rawinput_device( input->hw.data.rawinput.hid.device );
|
||||
+ input->hw.rawinput.type == RIM_TYPEHID &&
|
||||
input->hw.rawinput.hid.param == GIDC_REMOVAL)
|
||||
remove_hid_rawinput_device( input->hw.rawinput.hid.device );
|
||||
|
||||
@@ -3371,16 +3380,18 @@ DECL_HANDLER(get_rawinput_buffer)
|
||||
{
|
||||
@@ -161,16 +147,16 @@ index 248157ca7da..a411d0af8d2 100644
|
||||
free_message( msg );
|
||||
|
||||
diff --git a/server/trace.c b/server/trace.c
|
||||
index c6bdbb1139c..30aa979a20e 100644
|
||||
index e40f0769a35..1fd32c8ab5f 100644
|
||||
--- a/server/trace.c
|
||||
+++ b/server/trace.c
|
||||
@@ -456,6 +456,7 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||
@@ -440,6 +440,7 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
|
||||
dump_uint64( ",lparam=", &input->hw.lparam );
|
||||
switch (input->hw.msg)
|
||||
{
|
||||
+ case WM_INPUT:
|
||||
case WM_INPUT_DEVICE_CHANGE:
|
||||
dump_rawinput( ",rawinput=", &input->hw.data.rawinput );
|
||||
dump_rawinput( ",rawinput=", &input->hw.rawinput );
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,2 +1,4 @@
|
||||
Fixes: [50506] WM_INPUT messages are not received for HID devices registered with RegisterRawInputDevices
|
||||
Depends: loader-KeyboardLayouts
|
||||
# In the process of upstreaming.
|
||||
Disabled: true
|
||||
|
Reference in New Issue
Block a user