server: Stop using hardware_msg_data in rawinput_message.
This commit is contained in:
parent
f86cca3897
commit
c8bf3ba2da
3 changed files with 40 additions and 45 deletions
|
@ -284,7 +284,7 @@ union rawinput
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
unsigned int device;
|
unsigned int device;
|
||||||
unsigned int param;
|
unsigned int wparam;
|
||||||
unsigned int usage;
|
unsigned int usage;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
|
@ -6512,7 +6512,7 @@ union generic_reply
|
||||||
|
|
||||||
/* ### protocol_version begin ### */
|
/* ### protocol_version begin ### */
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 790
|
#define SERVER_PROTOCOL_VERSION 791
|
||||||
|
|
||||||
/* ### protocol_version end ### */
|
/* ### protocol_version end ### */
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ union rawinput
|
||||||
{
|
{
|
||||||
int type; /* RIM_TYPEHID */
|
int type; /* RIM_TYPEHID */
|
||||||
unsigned int device; /* rawinput device index */
|
unsigned int device; /* rawinput device index */
|
||||||
unsigned int param; /* rawinput message param */
|
unsigned int wparam; /* rawinput message wparam */
|
||||||
unsigned int usage; /* HID device usage */
|
unsigned int usage; /* HID device usage */
|
||||||
unsigned int count; /* HID report count */
|
unsigned int count; /* HID report count */
|
||||||
unsigned int length; /* HID report length */
|
unsigned int length; /* HID report length */
|
||||||
|
|
|
@ -1789,7 +1789,9 @@ struct rawinput_message
|
||||||
struct hw_msg_source source;
|
struct hw_msg_source source;
|
||||||
unsigned int time;
|
unsigned int time;
|
||||||
unsigned int message;
|
unsigned int message;
|
||||||
struct hardware_msg_data data;
|
lparam_t info;
|
||||||
|
unsigned int flags;
|
||||||
|
union rawinput rawinput;
|
||||||
const void *hid_report;
|
const void *hid_report;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1800,16 +1802,17 @@ static int queue_rawinput_message( struct process* process, void *arg )
|
||||||
const struct rawinput_device *device = NULL;
|
const struct rawinput_device *device = NULL;
|
||||||
struct desktop *target_desktop = NULL, *desktop = NULL;
|
struct desktop *target_desktop = NULL, *desktop = NULL;
|
||||||
struct thread *target_thread = NULL, *foreground = NULL;
|
struct thread *target_thread = NULL, *foreground = NULL;
|
||||||
|
struct hardware_msg_data *msg_data;
|
||||||
struct message *msg;
|
struct message *msg;
|
||||||
data_size_t report_size;
|
data_size_t report_size;
|
||||||
int wparam = RIM_INPUT;
|
int wparam = RIM_INPUT;
|
||||||
|
|
||||||
if (raw_msg->data.rawinput.type == RIM_TYPEMOUSE)
|
if (raw_msg->rawinput.type == RIM_TYPEMOUSE)
|
||||||
device = process->rawinput_mouse;
|
device = process->rawinput_mouse;
|
||||||
else if (raw_msg->data.rawinput.type == RIM_TYPEKEYBOARD)
|
else if (raw_msg->rawinput.type == RIM_TYPEKEYBOARD)
|
||||||
device = process->rawinput_kbd;
|
device = process->rawinput_kbd;
|
||||||
else
|
else
|
||||||
device = find_rawinput_device( process, raw_msg->data.rawinput.hid.usage );
|
device = find_rawinput_device( process, raw_msg->rawinput.hid.usage );
|
||||||
if (!device) return 0;
|
if (!device) return 0;
|
||||||
|
|
||||||
if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && !(device->flags & RIDEV_DEVNOTIFY)) return 0;
|
if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && !(device->flags & RIDEV_DEVNOTIFY)) return 0;
|
||||||
|
@ -1829,23 +1832,24 @@ static int queue_rawinput_message( struct process* process, void *arg )
|
||||||
wparam = RIM_INPUTSINK;
|
wparam = RIM_INPUTSINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (raw_msg->data.rawinput.type != RIM_TYPEHID || !raw_msg->hid_report) report_size = 0;
|
if (raw_msg->rawinput.type != RIM_TYPEHID || !raw_msg->hid_report) report_size = 0;
|
||||||
else report_size = raw_msg->data.size - sizeof(raw_msg->data);
|
else report_size = raw_msg->rawinput.hid.count * raw_msg->rawinput.hid.length;
|
||||||
|
|
||||||
if (!(msg = alloc_hardware_message( raw_msg->data.info, raw_msg->source, raw_msg->time, report_size )))
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
|
if (!(msg = alloc_hardware_message( raw_msg->info, raw_msg->source, raw_msg->time, report_size ))) goto done;
|
||||||
msg->win = device->target;
|
msg->win = device->target;
|
||||||
msg->msg = raw_msg->message;
|
msg->msg = raw_msg->message;
|
||||||
msg->wparam = wparam;
|
msg->wparam = wparam;
|
||||||
msg->lparam = 0;
|
msg->lparam = 0;
|
||||||
memcpy( msg->data, &raw_msg->data, sizeof(raw_msg->data) );
|
|
||||||
if (report_size) memcpy( (struct hardware_msg_data *)msg->data + 1, raw_msg->hid_report, report_size );
|
|
||||||
|
|
||||||
if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && raw_msg->data.rawinput.type == RIM_TYPEHID)
|
msg_data = msg->data;
|
||||||
|
msg_data->flags = raw_msg->flags;
|
||||||
|
msg_data->rawinput = raw_msg->rawinput;
|
||||||
|
if (report_size) memcpy( msg_data + 1, raw_msg->hid_report, report_size );
|
||||||
|
|
||||||
|
if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && raw_msg->rawinput.type == RIM_TYPEHID)
|
||||||
{
|
{
|
||||||
msg->wparam = raw_msg->data.rawinput.hid.param;
|
msg->wparam = raw_msg->rawinput.hid.wparam;
|
||||||
msg->lparam = raw_msg->data.rawinput.hid.device;
|
msg->lparam = raw_msg->rawinput.hid.device;
|
||||||
}
|
}
|
||||||
|
|
||||||
queue_hardware_message( desktop, msg, 1 );
|
queue_hardware_message( desktop, msg, 1 );
|
||||||
|
@ -1924,14 +1928,12 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
|
||||||
raw_msg.time = time;
|
raw_msg.time = time;
|
||||||
raw_msg.message = WM_INPUT;
|
raw_msg.message = WM_INPUT;
|
||||||
|
|
||||||
msg_data = &raw_msg.data;
|
raw_msg.info = input->mouse.info;
|
||||||
msg_data->info = input->mouse.info;
|
raw_msg.flags = flags;
|
||||||
msg_data->size = sizeof(*msg_data);
|
raw_msg.rawinput.type = RIM_TYPEMOUSE;
|
||||||
msg_data->flags = flags;
|
raw_msg.rawinput.mouse.x = x - desktop->cursor.x;
|
||||||
msg_data->rawinput.type = RIM_TYPEMOUSE;
|
raw_msg.rawinput.mouse.y = y - desktop->cursor.y;
|
||||||
msg_data->rawinput.mouse.x = x - desktop->cursor.x;
|
raw_msg.rawinput.mouse.data = input->mouse.data;
|
||||||
msg_data->rawinput.mouse.y = y - desktop->cursor.y;
|
|
||||||
msg_data->rawinput.mouse.data = input->mouse.data;
|
|
||||||
|
|
||||||
enum_processes( queue_rawinput_message, &raw_msg );
|
enum_processes( queue_rawinput_message, &raw_msg );
|
||||||
release_object( foreground );
|
release_object( foreground );
|
||||||
|
@ -2062,14 +2064,12 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
|
||||||
raw_msg.time = time;
|
raw_msg.time = time;
|
||||||
raw_msg.message = WM_INPUT;
|
raw_msg.message = WM_INPUT;
|
||||||
|
|
||||||
msg_data = &raw_msg.data;
|
raw_msg.info = input->kbd.info;
|
||||||
msg_data->info = input->kbd.info;
|
raw_msg.flags = input->kbd.flags;
|
||||||
msg_data->size = sizeof(*msg_data);
|
raw_msg.rawinput.type = RIM_TYPEKEYBOARD;
|
||||||
msg_data->flags = input->kbd.flags;
|
raw_msg.rawinput.kbd.message = message_code;
|
||||||
msg_data->rawinput.type = RIM_TYPEKEYBOARD;
|
raw_msg.rawinput.kbd.vkey = vkey;
|
||||||
msg_data->rawinput.kbd.message = message_code;
|
raw_msg.rawinput.kbd.scan = input->kbd.scan;
|
||||||
msg_data->rawinput.kbd.vkey = vkey;
|
|
||||||
msg_data->rawinput.kbd.scan = input->kbd.scan;
|
|
||||||
|
|
||||||
enum_processes( queue_rawinput_message, &raw_msg );
|
enum_processes( queue_rawinput_message, &raw_msg );
|
||||||
release_object( foreground );
|
release_object( foreground );
|
||||||
|
@ -2117,10 +2117,8 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
|
||||||
unsigned int origin, const hw_input_t *input )
|
unsigned int origin, const hw_input_t *input )
|
||||||
{
|
{
|
||||||
struct hw_msg_source source = { IMDT_UNAVAILABLE, origin };
|
struct hw_msg_source source = { IMDT_UNAVAILABLE, origin };
|
||||||
struct hardware_msg_data *msg_data;
|
|
||||||
struct rawinput_message raw_msg;
|
struct rawinput_message raw_msg;
|
||||||
struct message *msg;
|
struct message *msg;
|
||||||
data_size_t report_size = 0;
|
|
||||||
|
|
||||||
switch (input->hw.msg)
|
switch (input->hw.msg)
|
||||||
{
|
{
|
||||||
|
@ -2131,21 +2129,18 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
|
||||||
raw_msg.time = get_tick_count();
|
raw_msg.time = get_tick_count();
|
||||||
raw_msg.message = input->hw.msg;
|
raw_msg.message = input->hw.msg;
|
||||||
raw_msg.hid_report = get_req_data();
|
raw_msg.hid_report = get_req_data();
|
||||||
report_size = input->hw.hid.length * input->hw.hid.count;
|
if (input->hw.hid.length * input->hw.hid.count != get_req_data_size())
|
||||||
if (report_size != get_req_data_size())
|
|
||||||
{
|
{
|
||||||
set_error( STATUS_INVALID_PARAMETER );
|
set_error( STATUS_INVALID_PARAMETER );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_data = &raw_msg.data;
|
raw_msg.rawinput.hid.type = RIM_TYPEHID;
|
||||||
msg_data->size = sizeof(*msg_data) + report_size;
|
raw_msg.rawinput.hid.device = input->hw.hid.device;
|
||||||
msg_data->rawinput.hid.type = RIM_TYPEHID;
|
raw_msg.rawinput.hid.wparam = input->hw.wparam;
|
||||||
msg_data->rawinput.hid.device = input->hw.hid.device;
|
raw_msg.rawinput.hid.usage = input->hw.hid.usage;
|
||||||
msg_data->rawinput.hid.param = input->hw.wparam;
|
raw_msg.rawinput.hid.count = input->hw.hid.count;
|
||||||
msg_data->rawinput.hid.usage = input->hw.hid.usage;
|
raw_msg.rawinput.hid.length = input->hw.hid.length;
|
||||||
msg_data->rawinput.hid.count = input->hw.hid.count;
|
|
||||||
msg_data->rawinput.hid.length = input->hw.hid.length;
|
|
||||||
|
|
||||||
enum_processes( queue_rawinput_message, &raw_msg );
|
enum_processes( queue_rawinput_message, &raw_msg );
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue