Пример #1
0
BOOL freerds_peer_post_connect(freerdp_peer* client)
{
	UINT32 ColorDepth;
	UINT32 DesktopWidth;
	UINT32 DesktopHeight;
	rdpSettings* settings;
	rdsConnection* connection;

	settings = client->settings;
	connection = (rdsConnection*) client->context;

	fprintf(stderr, "Client %s is connected", client->hostname);

	if (client->settings->AutoLogonEnabled)
	{
		fprintf(stderr, " and wants to login automatically as %s\\%s",
			client->settings->Domain ? client->settings->Domain : "",
			client->settings->Username);
	}
	fprintf(stderr, "\n");

	DesktopWidth = settings->DesktopWidth;
	DesktopHeight = settings->DesktopHeight;
	ColorDepth = settings->ColorDepth;

	fprintf(stderr, "Client requested desktop: %dx%dx%d\n",
		settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth);

	//if ((DesktopWidth % 4) != 0)
	//	DesktopWidth += (DesktopWidth % 4);

	//if ((DesktopHeight % 4) != 0)
	//	DesktopHeight += (DesktopHeight % 4);

	if ((DesktopWidth != settings->DesktopWidth) || (DesktopHeight != settings->DesktopHeight)
			|| (ColorDepth != settings->ColorDepth))
	{
		fprintf(stderr, "Resizing desktop to %dx%dx%d\n", DesktopWidth, DesktopHeight, ColorDepth);

		settings->DesktopWidth = DesktopWidth;
		settings->DesktopHeight = DesktopHeight;
		settings->ColorDepth = ColorDepth;

		client->update->DesktopResize(client->update->context);

		return TRUE;
	}

	freerds_channels_post_connect(connection);

	connection->encoder = freerds_bitmap_encoder_new(settings->DesktopWidth,
			settings->DesktopHeight, settings->ColorDepth);

	return TRUE;
}
Пример #2
0
int freerds_connection_init(rdsConnection* connection, rdpSettings* settings)
{
	connection->id = app_context_get_connectionid();
	connection->settings = settings;

	connection->bytesPerPixel = 4;

	connection->encoder = freerds_bitmap_encoder_new(settings->DesktopWidth,
			settings->DesktopHeight, settings->ColorDepth);

	connection->FrameList = ListDictionary_New(TRUE);

	return 0;
}