diff --git a/include/freerdp/peer.h b/include/freerdp/peer.h index d8dde1a21..3f2e2ddc5 100644 --- a/include/freerdp/peer.h +++ b/include/freerdp/peer.h @@ -88,7 +88,6 @@ struct rdp_freerdp_peer int sockfd; char hostname[50]; - rdpInput* input; rdpUpdate* update; rdpSettings* settings; rdpAutoDetect* autodetect; diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index f7b8b5a9e..aade53404 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -926,17 +926,16 @@ BOOL freerdp_peer_context_new(freerdp_peer* client) if (!(rdp = rdp_new(context))) goto fail_rdp; - client->input = rdp->input; client->update = rdp->update; client->settings = rdp->settings; client->autodetect = rdp->autodetect; context->rdp = rdp; - context->input = client->input; + context->input = rdp->input; context->update = client->update; context->settings = client->settings; context->autodetect = client->autodetect; client->update->context = context; - client->input->context = context; + context->input->context = context; client->autodetect->context = context; update_register_server_callbacks(client->update); autodetect_register_server_callbacks(client->autodetect); diff --git a/server/Mac/mf_peer.c b/server/Mac/mf_peer.c index 17c683eac..5f0535c47 100644 --- a/server/Mac/mf_peer.c +++ b/server/Mac/mf_peer.c @@ -351,11 +351,11 @@ static void* mf_peer_main_loop(void* arg) client->settings->RefreshRect = FALSE; client->PostConnect = mf_peer_post_connect; client->Activate = mf_peer_activate; - client->input->SynchronizeEvent = mf_peer_synchronize_event; - client->input->KeyboardEvent = mf_input_keyboard_event; // mf_peer_keyboard_event; - client->input->UnicodeKeyboardEvent = mf_peer_unicode_keyboard_event; - client->input->MouseEvent = mf_input_mouse_event; - client->input->ExtendedMouseEvent = mf_input_extended_mouse_event; + client->context->input->SynchronizeEvent = mf_peer_synchronize_event; + client->context->input->KeyboardEvent = mf_input_keyboard_event; // mf_peer_keyboard_event; + client->context->input->UnicodeKeyboardEvent = mf_peer_unicode_keyboard_event; + client->context->input->MouseEvent = mf_input_mouse_event; + client->context->input->ExtendedMouseEvent = mf_input_extended_mouse_event; // client->update->RefreshRect = mf_peer_refresh_rect; client->update->SuppressOutput = mf_peer_suppress_output; client->Initialize(client); diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 75cf63aba..7cd4037b7 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -917,11 +917,15 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) client->settings->RefreshRect = TRUE; client->PostConnect = tf_peer_post_connect; client->Activate = tf_peer_activate; - client->input->SynchronizeEvent = tf_peer_synchronize_event; - client->input->KeyboardEvent = tf_peer_keyboard_event; - client->input->UnicodeKeyboardEvent = tf_peer_unicode_keyboard_event; - client->input->MouseEvent = tf_peer_mouse_event; - client->input->ExtendedMouseEvent = tf_peer_extended_mouse_event; + + WINPR_ASSERT(client->context); + WINPR_ASSERT(client->context->input); + client->context->input->SynchronizeEvent = tf_peer_synchronize_event; + client->context->input->KeyboardEvent = tf_peer_keyboard_event; + client->context->input->UnicodeKeyboardEvent = tf_peer_unicode_keyboard_event; + client->context->input->MouseEvent = tf_peer_mouse_event; + client->context->input->ExtendedMouseEvent = tf_peer_extended_mouse_event; + client->update->RefreshRect = tf_peer_refresh_rect; client->update->SuppressOutput = tf_peer_suppress_output; client->settings->MultifragMaxRequestSize = 0xFFFFFF; /* FIXME */ diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index f01865908..748398199 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -262,11 +262,11 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) client->PostConnect = wf_peer_post_connect; client->Activate = wf_peer_activate; client->Logon = wf_peer_logon; - client->input->SynchronizeEvent = wf_peer_synchronize_event; - client->input->KeyboardEvent = wf_peer_keyboard_event; - client->input->UnicodeKeyboardEvent = wf_peer_unicode_keyboard_event; - client->input->MouseEvent = wf_peer_mouse_event; - client->input->ExtendedMouseEvent = wf_peer_extended_mouse_event; + client->context->input->SynchronizeEvent = wf_peer_synchronize_event; + client->context->input->KeyboardEvent = wf_peer_keyboard_event; + client->context->input->UnicodeKeyboardEvent = wf_peer_unicode_keyboard_event; + client->context->input->MouseEvent = wf_peer_mouse_event; + client->context->input->ExtendedMouseEvent = wf_peer_extended_mouse_event; if (!client->Initialize(client)) goto fail_client_initialize; @@ -281,10 +281,10 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam) if (wfi->input_disabled) { WLog_INFO(TAG, "client input is disabled"); - client->input->KeyboardEvent = wf_peer_keyboard_event_dummy; - client->input->UnicodeKeyboardEvent = wf_peer_unicode_keyboard_event_dummy; - client->input->MouseEvent = wf_peer_mouse_event_dummy; - client->input->ExtendedMouseEvent = wf_peer_extended_mouse_event_dummy; + client->context->input->KeyboardEvent = wf_peer_keyboard_event_dummy; + client->context->input->UnicodeKeyboardEvent = wf_peer_unicode_keyboard_event_dummy; + client->context->input->MouseEvent = wf_peer_mouse_event_dummy; + client->context->input->ExtendedMouseEvent = wf_peer_extended_mouse_event_dummy; } if (!(context->socketEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index b62c7dd45..9e64b2b89 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -81,7 +81,7 @@ static void pf_client_on_activated(void* ctx, ActivatedEventArgs* e) LOG_INFO(TAG, pc, "client activated, registering server input callbacks"); /* Register server input/update callbacks only after proxy client is fully activated */ - pf_server_register_input_callbacks(peer->input); + pf_server_register_input_callbacks(peer->context->input); pf_server_register_update_callbacks(peer->update); } diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 0c0b78eeb..5b22adfb5 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -2072,6 +2072,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) context = (rdpContext*)client; peer = context->peer; WINPR_ASSERT(peer); + WINPR_ASSERT(peer->context); settings = peer->settings; WINPR_ASSERT(settings); @@ -2080,7 +2081,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg) peer->PostConnect = shadow_client_post_connect; peer->Activate = shadow_client_activate; peer->Logon = shadow_client_logon; - shadow_input_register_callbacks(peer->input); + shadow_input_register_callbacks(peer->context->input); rc = peer->Initialize(peer); WINPR_ASSERT(rc);