mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Instance cleanup (#7738)
* Cleaned up freerdp::autodetect * Deprecate freerdp::input * Deprecated freerdp::update * Deprecated freerdp::settings * Deprecated freerdp::autodetect * Removed rdpTransport::settings * Deprecated freerdp_per::update|settings|autodetect * Fixed mac client and server compilation * Fixed windows compilation * Added deprecation warnings * Fixed initialization of structs. * Fixed android build * Fixed freerdp_client_context_new const correctness * Fixed checks for android implementation Replaced checks with assertions where appropriate * Fixed checks for windows client Replaced checks with assertions where appropriate * Fixed proxy client pointer dereference
This commit is contained in:
@@ -141,8 +141,9 @@ static BOOL tf_pre_connect(freerdp* instance)
|
||||
rdpSettings* settings;
|
||||
|
||||
WINPR_ASSERT(instance);
|
||||
WINPR_ASSERT(instance->context);
|
||||
|
||||
settings = instance->settings;
|
||||
settings = instance->context->settings;
|
||||
WINPR_ASSERT(settings);
|
||||
|
||||
/* Optional OS identifier sent to server */
|
||||
@@ -159,7 +160,7 @@ static BOOL tf_pre_connect(freerdp* instance)
|
||||
|
||||
/* Load all required plugins / channels / libraries specified by current
|
||||
* settings. */
|
||||
if (!freerdp_client_load_addins(instance->context->channels, instance->settings))
|
||||
if (!freerdp_client_load_addins(instance->context->channels, settings))
|
||||
return FALSE;
|
||||
|
||||
/* TODO: Any code your client requires */
|
||||
@@ -176,20 +177,28 @@ static BOOL tf_pre_connect(freerdp* instance)
|
||||
*/
|
||||
static BOOL tf_post_connect(freerdp* instance)
|
||||
{
|
||||
rdpContext* context;
|
||||
|
||||
if (!gdi_init(instance, PIXEL_FORMAT_XRGB32))
|
||||
return FALSE;
|
||||
|
||||
context = instance->context;
|
||||
WINPR_ASSERT(context);
|
||||
WINPR_ASSERT(context->update);
|
||||
|
||||
/* With this setting we disable all graphics processing in the library.
|
||||
*
|
||||
* This allows low resource (client) protocol parsing.
|
||||
*/
|
||||
freerdp_settings_set_bool(instance->settings, FreeRDP_DeactivateClientDecoding, TRUE);
|
||||
instance->update->BeginPaint = tf_begin_paint;
|
||||
instance->update->EndPaint = tf_end_paint;
|
||||
instance->update->PlaySound = tf_play_sound;
|
||||
instance->update->DesktopResize = tf_desktop_resize;
|
||||
instance->update->SetKeyboardIndicators = tf_keyboard_set_indicators;
|
||||
instance->update->SetKeyboardImeStatus = tf_keyboard_set_ime_status;
|
||||
if (!freerdp_settings_set_bool(context->settings, FreeRDP_DeactivateClientDecoding, TRUE))
|
||||
return FALSE;
|
||||
|
||||
context->update->BeginPaint = tf_begin_paint;
|
||||
context->update->EndPaint = tf_end_paint;
|
||||
context->update->PlaySound = tf_play_sound;
|
||||
context->update->DesktopResize = tf_desktop_resize;
|
||||
context->update->SetKeyboardIndicators = tf_keyboard_set_indicators;
|
||||
context->update->SetKeyboardImeStatus = tf_keyboard_set_ime_status;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -228,7 +237,9 @@ static DWORD WINAPI tf_client_thread_proc(LPVOID arg)
|
||||
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = { 0 };
|
||||
BOOL rc = freerdp_connect(instance);
|
||||
|
||||
if (instance->settings->AuthenticationOnly)
|
||||
WINPR_ASSERT(instance->context);
|
||||
WINPR_ASSERT(instance->context->settings);
|
||||
if (instance->context->settings->AuthenticationOnly)
|
||||
{
|
||||
result = freerdp_get_last_error(instance->context);
|
||||
freerdp_abort_connect(instance);
|
||||
|
||||
Reference in New Issue
Block a user