void freerds_peer_context_new(freerdp_peer* client, rdsConnection* context) { rdpSettings* settings = client->settings; settings->OsMajorType = OSMAJORTYPE_UNIX; settings->OsMinorType = OSMINORTYPE_PSEUDO_XSERVER; settings->ColorDepth = 32; settings->RemoteFxCodec = TRUE; settings->BitmapCacheV3Enabled = TRUE; settings->FrameMarkerCommandEnabled = TRUE; settings->SurfaceFrameMarkerEnabled = TRUE; freerds_connection_init(context, settings); context->client = client; context->vcm = WTSOpenServerA((LPSTR) client->context); }
void test_peer_context_new(freerdp_peer* client, testPeerContext* context) { context->rfx_context = rfx_context_new(TRUE); context->rfx_context->mode = RLGR3; context->rfx_context->width = SAMPLE_SERVER_DEFAULT_WIDTH; context->rfx_context->height = SAMPLE_SERVER_DEFAULT_HEIGHT; rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_R8G8B8); context->nsc_context = nsc_context_new(); nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_R8G8B8); context->s = Stream_New(NULL, 65536); context->icon_x = -1; context->icon_y = -1; context->vcm = WTSOpenServerA((LPSTR) client->context); }
BOOL wf_peer_context_new(freerdp_peer* client, wfPeerContext* context) { if (!(context->info = wf_info_get_instance())) return FALSE; context->vcm = WTSOpenServerA((LPSTR) client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) return FALSE; if (!wf_info_peer_register(context->info, context)) { WTSCloseServer(context->vcm); context->vcm = NULL; return FALSE; } return TRUE; }
BOOL test_peer_context_new(freerdp_peer* client, testPeerContext* context) { if (!(context->rfx_context = rfx_context_new(TRUE))) goto fail_rfx_context; context->rfx_context->mode = RLGR3; context->rfx_context->width = SAMPLE_SERVER_DEFAULT_WIDTH; context->rfx_context->height = SAMPLE_SERVER_DEFAULT_HEIGHT; rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_R8G8B8); if (!(context->nsc_context = nsc_context_new())) goto fail_nsc_context; nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_R8G8B8); if (!(context->s = Stream_New(NULL, 65536))) goto fail_stream_new; context->icon_x = -1; context->icon_y = -1; context->vcm = WTSOpenServerA((LPSTR) client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; return TRUE; fail_open_server: context->vcm = NULL; Stream_Free(context->s, TRUE); context->s = NULL; fail_stream_new: nsc_context_free(context->nsc_context); context->nsc_context = NULL; fail_nsc_context: rfx_context_free(context->rfx_context); context->rfx_context = NULL; fail_rfx_context: return FALSE; }
/* Called when we have a new peer connecting */ BOOL mf_peer_context_new(freerdp_peer* client, mfPeerContext* context) { if (!(context->info = mf_info_get_instance())) return FALSE; if (!(context->rfx_context = rfx_context_new(TRUE))) goto fail_rfx_context; context->rfx_context->mode = RLGR3; context->rfx_context->width = client->settings->DesktopWidth; context->rfx_context->height = client->settings->DesktopHeight; rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8); //if (!(context->nsc_context = nsc_context_new())) // goto fail_nsc_context; //nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_B8G8R8A8); if (!(context->s = Stream_New(NULL, 0xFFFF))) goto fail_stream_new; context->vcm = WTSOpenServerA((LPSTR) client->context); if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; mf_info_peer_register(context->info, context); return TRUE; fail_open_server: Stream_Free(context->s, TRUE); context->s = NULL; fail_stream_new: rfx_context_free(context->rfx_context); context->rfx_context = NULL; fail_rfx_context: return FALSE; }
BOOL shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* client) { rdpSettings* settings; rdpShadowServer* server; const wObject cb = { NULL, NULL, NULL, shadow_client_free_queued_message, NULL }; server = (rdpShadowServer*) peer->ContextExtra; client->server = server; client->subsystem = server->subsystem; settings = peer->settings; settings->ColorDepth = 32; settings->NSCodec = TRUE; settings->RemoteFxCodec = TRUE; settings->BitmapCacheV3Enabled = TRUE; settings->FrameMarkerCommandEnabled = TRUE; settings->SurfaceFrameMarkerEnabled = TRUE; settings->SupportGraphicsPipeline = FALSE; settings->DrawAllowSkipAlpha = TRUE; settings->DrawAllowColorSubsampling = TRUE; settings->DrawAllowDynamicColorFidelity = TRUE; settings->CompressionLevel = PACKET_COMPR_TYPE_RDP6; settings->RdpSecurity = TRUE; settings->TlsSecurity = TRUE; settings->NlaSecurity = FALSE; if (!(settings->CertificateFile = _strdup(server->CertificateFile))) goto fail_cert_file; if (!(settings->PrivateKeyFile = _strdup(server->PrivateKeyFile))) goto fail_privkey_file; if (!(settings->RdpKeyFile = _strdup(settings->PrivateKeyFile))) goto fail_rdpkey_file; if (server->ipcSocket) { settings->LyncRdpMode = TRUE; settings->CompressionEnabled = FALSE; } client->inLobby = TRUE; client->mayView = server->mayView; client->mayInteract = server->mayInteract; if (!InitializeCriticalSectionAndSpinCount(&(client->lock), 4000)) goto fail_client_lock; region16_init(&(client->invalidRegion)); client->vcm = WTSOpenServerA((LPSTR) peer->context); if (!client->vcm || client->vcm == INVALID_HANDLE_VALUE) goto fail_open_server; if (!(client->MsgQueue = MessageQueue_New(&cb))) goto fail_message_queue; if (!(client->encoder = shadow_encoder_new(client))) goto fail_encoder_new; if (ArrayList_Add(server->clients, (void*) client) >= 0) return TRUE; shadow_encoder_free(client->encoder); client->encoder = NULL; fail_encoder_new: MessageQueue_Free(client->MsgQueue); client->MsgQueue = NULL; fail_message_queue: WTSCloseServer((HANDLE) client->vcm); client->vcm = NULL; fail_open_server: DeleteCriticalSection(&(client->lock)); fail_client_lock: free(settings->RdpKeyFile); settings->RdpKeyFile = NULL; fail_rdpkey_file: free(settings->PrivateKeyFile); settings->PrivateKeyFile = NULL; fail_privkey_file: free(settings->CertificateFile); settings->CertificateFile = NULL; fail_cert_file: return FALSE; }
void wf_peer_context_new(freerdp_peer* client, wfPeerContext* context) { context->info = wf_info_get_instance(); context->vcm = WTSOpenServerA((LPSTR) client->context); wf_info_peer_register(context->info, context); }