pClientContext* pc;
rdpContext* ps;
- if (!gdi_init(instance, PIXEL_FORMAT_XRGB32))
- return FALSE;
-
context = instance->context;
settings = instance->settings;
update = instance->update;
pc = (pClientContext*) context;
+ ps = (rdpContext*) pc->pdata->ps;
+
+ if (!proxy_data_set_connection_info(pc->pdata, ps->settings, settings))
+ {
+ WLog_ERR(TAG, "proxy_data_set_connection_info failed!");
+ return FALSE;
+ }
+
+ if (!gdi_init(instance, PIXEL_FORMAT_XRGB32))
+ return FALSE;
if (!pf_register_pointer(context->graphics))
return FALSE;
}
pf_client_register_update_callbacks(update);
- ps = (rdpContext*) pc->pdata->ps;
proxy_server_reactivate(ps, context);
return TRUE;
}
return pdata;
}
-BOOL proxy_data_set_connection_info(proxyData* pdata, rdpSettings* clientSettings,
- const char* target)
+/* sets connection info values using the settings of both server & client */
+BOOL proxy_data_set_connection_info(proxyData* pdata, rdpSettings* ps, rdpSettings* pc)
{
- if (!(pdata->info->TargetHostname = _strdup(target)))
+ if (!(pdata->info->TargetHostname = _strdup(pc->ServerHostname)))
goto out_fail;
- if (!(pdata->info->ClientHostname = _strdup(clientSettings->ClientHostname)))
+ if (!(pdata->info->Username = _strdup(pc->Username)))
goto out_fail;
- if (!(pdata->info->Username = _strdup(clientSettings->Username)))
+ if (!(pdata->info->ClientHostname = _strdup(ps->ClientHostname)))
goto out_fail;
return TRUE;
BOOL init_p_server_context(freerdp_peer* client);
rdpContext* p_client_context_create(rdpSettings* clientSettings);
proxyData* proxy_data_new();
-BOOL proxy_data_set_connection_info(proxyData* pdata, rdpSettings* clientSettings,
- const char* target);
+BOOL proxy_data_set_connection_info(proxyData* pdata, rdpSettings* ps, rdpSettings* pc);
void proxy_data_free(proxyData* pdata);
#endif /* FREERDP_SERVER_PROXY_PFCONTEXT_H */
return FALSE;
}
- if (!proxy_data_set_connection_info(pdata, client->settings, pc->settings->ServerHostname))
- {
- WLog_ERR(TAG, "proxy_data_set_connection_info failed!");
- return FALSE;
- }
-
pf_server_rdpgfx_init(ps);
pf_server_disp_init(ps);