Commit f393ab26 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Zero-initialize rawinput_message structures before passing them to…

server: Zero-initialize rawinput_message structures before passing them to queue_rawinput_message() (Valgrind). Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 50f889fd
...@@ -1793,12 +1793,12 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons ...@@ -1793,12 +1793,12 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
if ((foreground = get_foreground_thread( desktop, win ))) if ((foreground = get_foreground_thread( desktop, win )))
{ {
memset( &raw_msg, 0, sizeof(raw_msg) );
raw_msg.foreground = foreground; raw_msg.foreground = foreground;
raw_msg.desktop = desktop; raw_msg.desktop = desktop;
raw_msg.source = source; raw_msg.source = source;
raw_msg.time = time; raw_msg.time = time;
raw_msg.message = WM_INPUT; raw_msg.message = WM_INPUT;
raw_msg.hid_report = NULL;
msg_data = &raw_msg.data; msg_data = &raw_msg.data;
msg_data->info = input->mouse.info; msg_data->info = input->mouse.info;
...@@ -1930,12 +1930,12 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c ...@@ -1930,12 +1930,12 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
if ((foreground = get_foreground_thread( desktop, win ))) if ((foreground = get_foreground_thread( desktop, win )))
{ {
memset( &raw_msg, 0, sizeof(raw_msg) );
raw_msg.foreground = foreground; raw_msg.foreground = foreground;
raw_msg.desktop = desktop; raw_msg.desktop = desktop;
raw_msg.source = source; raw_msg.source = source;
raw_msg.time = time; raw_msg.time = time;
raw_msg.message = WM_INPUT; raw_msg.message = WM_INPUT;
raw_msg.hid_report = NULL;
msg_data = &raw_msg.data; msg_data = &raw_msg.data;
msg_data->info = input->kbd.info; msg_data->info = input->kbd.info;
...@@ -2001,12 +2001,10 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ ...@@ -2001,12 +2001,10 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
{ {
case WM_INPUT: case WM_INPUT:
case WM_INPUT_DEVICE_CHANGE: case WM_INPUT_DEVICE_CHANGE:
raw_msg.foreground = NULL; memset( &raw_msg, 0, sizeof(raw_msg) );
raw_msg.desktop = NULL;
raw_msg.source = source; raw_msg.source = source;
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 = NULL;
if (input->hw.rawinput.type == RIM_TYPEHID) if (input->hw.rawinput.type == RIM_TYPEHID)
{ {
...@@ -2021,9 +2019,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ ...@@ -2021,9 +2019,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
} }
msg_data = &raw_msg.data; msg_data = &raw_msg.data;
msg_data->info = 0;
msg_data->size = sizeof(*msg_data) + report_size; msg_data->size = sizeof(*msg_data) + report_size;
msg_data->flags = 0;
msg_data->rawinput = input->hw.rawinput; msg_data->rawinput = input->hw.rawinput;
enum_processes( queue_rawinput_message, &raw_msg ); enum_processes( queue_rawinput_message, &raw_msg );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment