user32: Send WM_INPUT_DEVICE_CHANGE / RAWINPUT to the server.

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-05-06 12:57:33 +02:00 committed by Alexandre Julliard
parent 37c7923a31
commit 44cb53bb37
1 changed files with 29 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "dbt.h" #include "dbt.h"
#include "dde.h" #include "dde.h"
#include "imm.h" #include "imm.h"
#include "hidusage.h"
#include "ddk/imm.h" #include "ddk/imm.h"
#include "wine/server.h" #include "wine/server.h"
#include "user_private.h" #include "user_private.h"
@ -3233,6 +3234,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
struct send_message_info info; struct send_message_info info;
int prev_x, prev_y, new_x, new_y; int prev_x, prev_y, new_x, new_y;
INT counter = global_key_state_counter; INT counter = global_key_state_counter;
USAGE hid_usage_page, hid_usage;
NTSTATUS ret; NTSTATUS ret;
BOOL wait; BOOL wait;
@ -3242,6 +3244,15 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
info.flags = 0; info.flags = 0;
info.timeout = 0; info.timeout = 0;
if (input->type == INPUT_HARDWARE && rawinput->header.dwType == RIM_TYPEHID)
{
if (input->u.hi.uMsg == WM_INPUT_DEVICE_CHANGE)
{
hid_usage_page = ((USAGE *)rawinput->data.hid.bRawData)[0];
hid_usage = ((USAGE *)rawinput->data.hid.bRawData)[1];
}
}
SERVER_START_REQ( send_hardware_message ) SERVER_START_REQ( send_hardware_message )
{ {
req->win = wine_server_user_handle( hwnd ); req->win = wine_server_user_handle( hwnd );
@ -3267,6 +3278,24 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
case INPUT_HARDWARE: case INPUT_HARDWARE:
req->input.hw.msg = input->u.hi.uMsg; req->input.hw.msg = input->u.hi.uMsg;
req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH ); 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.rawinput.type = rawinput->header.dwType;
switch (rawinput->header.dwType)
{
case RIM_TYPEHID:
assert( rawinput->data.hid.dwCount <= 1 );
req->input.hw.rawinput.hid.device = HandleToUlong( rawinput->header.hDevice );
req->input.hw.rawinput.hid.param = rawinput->header.wParam;
req->input.hw.rawinput.hid.usage_page = hid_usage_page;
req->input.hw.rawinput.hid.usage = hid_usage;
break;
default:
assert( 0 );
break;
}
}
break; break;
} }
if (key_state_info) wine_server_set_reply( req, key_state_info->state, if (key_state_info) wine_server_set_reply( req, key_state_info->state,