2011-07-01 04:31:07 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Client
|
2011-07-07 21:37:48 +04:00
|
|
|
* RDP Settings
|
2011-07-01 04:31:07 +04:00
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Jay Sorg
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2011-07-22 08:52:57 +04:00
|
|
|
#include "config.h"
|
2011-07-21 06:05:12 +04:00
|
|
|
#include "capabilities.h"
|
2011-07-07 21:37:48 +04:00
|
|
|
#include <freerdp/utils/memory.h>
|
|
|
|
|
2011-07-22 08:52:57 +04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2011-07-07 21:37:48 +04:00
|
|
|
#include <freerdp/settings.h>
|
2012-01-31 02:47:55 +04:00
|
|
|
#include <freerdp/utils/file.h>
|
2011-07-07 21:37:48 +04:00
|
|
|
|
2011-12-01 02:40:36 +04:00
|
|
|
static const char client_dll[] = "C:\\Windows\\System32\\mstscax.dll";
|
2011-07-10 20:10:24 +04:00
|
|
|
|
2011-09-29 09:03:07 +04:00
|
|
|
rdpSettings* settings_new(void* instance)
|
2011-07-07 21:37:48 +04:00
|
|
|
{
|
|
|
|
rdpSettings* settings;
|
|
|
|
|
|
|
|
settings = (rdpSettings*) xzalloc(sizeof(rdpSettings));
|
|
|
|
|
|
|
|
if (settings != NULL)
|
|
|
|
{
|
2011-09-29 09:03:07 +04:00
|
|
|
settings->instance = instance;
|
|
|
|
|
2011-07-07 21:37:48 +04:00
|
|
|
settings->width = 1024;
|
|
|
|
settings->height = 768;
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->workarea = false;
|
|
|
|
settings->fullscreen = false;
|
|
|
|
settings->grab_keyboard = true;
|
|
|
|
settings->decorations = true;
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->rdp_version = 7;
|
2011-07-07 21:37:48 +04:00
|
|
|
settings->color_depth = 16;
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->nla_security = true;
|
|
|
|
settings->tls_security = true;
|
|
|
|
settings->rdp_security = true;
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->client_build = 2600;
|
2011-07-08 23:32:06 +04:00
|
|
|
settings->kbd_type = 0;
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->kbd_subtype = 0;
|
2011-07-08 23:32:06 +04:00
|
|
|
settings->kbd_fn_keys = 0;
|
2011-12-20 03:17:04 +04:00
|
|
|
settings->kbd_layout = 0;
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->encryption = false;
|
2012-02-10 23:25:50 +04:00
|
|
|
settings->salted_checksum = false;
|
2011-08-18 20:17:13 +04:00
|
|
|
settings->port = 3389;
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->desktop_resize = true;
|
2011-07-08 08:37:25 +04:00
|
|
|
|
|
|
|
settings->performance_flags =
|
|
|
|
PERF_DISABLE_FULLWINDOWDRAG |
|
|
|
|
PERF_DISABLE_MENUANIMATIONS |
|
|
|
|
PERF_DISABLE_WALLPAPER;
|
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->auto_reconnection = true;
|
2011-07-25 21:42:14 +04:00
|
|
|
|
2011-07-20 00:30:05 +04:00
|
|
|
settings->encryption_method = ENCRYPTION_METHOD_NONE;
|
|
|
|
settings->encryption_level = ENCRYPTION_LEVEL_NONE;
|
2011-07-09 00:05:30 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->authentication = true;
|
|
|
|
|
|
|
|
settings->order_support[NEG_DSTBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_PATBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_SCRBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_DRAWNINEGRID_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MULTIDSTBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MULTIPATBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MULTISCRBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = true;
|
|
|
|
settings->order_support[NEG_LINETO_INDEX] = true;
|
|
|
|
settings->order_support[NEG_POLYLINE_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MEMBLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_MEM3BLT_INDEX] = true;
|
|
|
|
settings->order_support[NEG_SAVEBITMAP_INDEX] = true;
|
|
|
|
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
|
|
|
|
settings->order_support[NEG_FAST_INDEX_INDEX] = true;
|
|
|
|
settings->order_support[NEG_FAST_GLYPH_INDEX] = true;
|
|
|
|
settings->order_support[NEG_POLYGON_SC_INDEX] = true;
|
|
|
|
settings->order_support[NEG_POLYGON_CB_INDEX] = true;
|
|
|
|
settings->order_support[NEG_ELLIPSE_SC_INDEX] = true;
|
|
|
|
settings->order_support[NEG_ELLIPSE_CB_INDEX] = true;
|
|
|
|
|
|
|
|
settings->color_pointer = true;
|
|
|
|
settings->large_pointer = true;
|
2011-12-20 21:09:53 +04:00
|
|
|
settings->pointer_cache_size = 20;
|
2011-12-13 04:57:24 +04:00
|
|
|
settings->sound_beeps = true;
|
2011-12-16 21:04:09 +04:00
|
|
|
settings->disable_wallpaper = false;
|
|
|
|
settings->disable_full_window_drag = false;
|
|
|
|
settings->disable_menu_animations = false;
|
|
|
|
settings->disable_theming = false;
|
2011-12-16 21:14:16 +04:00
|
|
|
settings->connection_type = 0;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->draw_gdi_plus = false;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->frame_marker = false;
|
|
|
|
settings->bitmap_cache_v3 = false;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->bitmap_cache = true;
|
|
|
|
settings->persistent_bitmap_cache = false;
|
2012-01-14 23:42:36 +04:00
|
|
|
settings->bitmapCacheV2CellInfo = xzalloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
|
2011-07-25 21:42:14 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->refresh_rect = true;
|
|
|
|
settings->suppress_output = true;
|
2011-11-11 23:02:59 +04:00
|
|
|
|
2011-12-15 02:08:22 +04:00
|
|
|
settings->glyph_cache = true;
|
2011-08-21 22:16:53 +04:00
|
|
|
settings->glyphSupportLevel = GLYPH_SUPPORT_NONE;
|
2012-01-14 23:42:36 +04:00
|
|
|
settings->glyphCache = xzalloc(sizeof(GLYPH_CACHE_DEFINITION) * 10);
|
|
|
|
settings->fragCache = xnew(GLYPH_CACHE_DEFINITION);
|
2011-08-21 22:16:53 +04:00
|
|
|
settings->glyphCache[0].cacheEntries = 254;
|
|
|
|
settings->glyphCache[0].cacheMaximumCellSize = 4;
|
|
|
|
settings->glyphCache[1].cacheEntries = 254;
|
|
|
|
settings->glyphCache[1].cacheMaximumCellSize = 4;
|
|
|
|
settings->glyphCache[2].cacheEntries = 254;
|
|
|
|
settings->glyphCache[2].cacheMaximumCellSize = 8;
|
|
|
|
settings->glyphCache[3].cacheEntries = 254;
|
|
|
|
settings->glyphCache[3].cacheMaximumCellSize = 8;
|
|
|
|
settings->glyphCache[4].cacheEntries = 254;
|
|
|
|
settings->glyphCache[4].cacheMaximumCellSize = 16;
|
|
|
|
settings->glyphCache[5].cacheEntries = 254;
|
|
|
|
settings->glyphCache[5].cacheMaximumCellSize = 32;
|
|
|
|
settings->glyphCache[6].cacheEntries = 254;
|
|
|
|
settings->glyphCache[6].cacheMaximumCellSize = 64;
|
|
|
|
settings->glyphCache[7].cacheEntries = 254;
|
|
|
|
settings->glyphCache[7].cacheMaximumCellSize = 128;
|
|
|
|
settings->glyphCache[8].cacheEntries = 254;
|
|
|
|
settings->glyphCache[8].cacheMaximumCellSize = 256;
|
|
|
|
settings->glyphCache[9].cacheEntries = 64;
|
2011-12-13 04:57:24 +04:00
|
|
|
settings->glyphCache[9].cacheMaximumCellSize = 256;
|
2012-01-14 23:42:36 +04:00
|
|
|
settings->fragCache->cacheEntries = 256;
|
|
|
|
settings->fragCache->cacheMaximumCellSize = 256;
|
2011-08-21 22:16:53 +04:00
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->offscreen_bitmap_cache = true;
|
2011-08-06 00:56:40 +04:00
|
|
|
settings->offscreen_bitmap_cache_size = 7680;
|
|
|
|
settings->offscreen_bitmap_cache_entries = 100;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
|
|
|
settings->draw_nine_grid_cache_size = 2560;
|
|
|
|
settings->draw_nine_grid_cache_entries = 256;
|
2011-07-21 06:05:12 +04:00
|
|
|
|
2011-07-27 03:14:11 +04:00
|
|
|
settings->client_dir = xstrdup(client_dll);
|
2011-07-10 20:10:24 +04:00
|
|
|
|
2011-08-15 01:05:34 +04:00
|
|
|
settings->num_icon_caches = 3;
|
|
|
|
settings->num_icon_cache_entries = 12;
|
|
|
|
|
2011-08-21 06:57:38 +04:00
|
|
|
settings->vc_chunk_size = CHANNEL_CHUNK_LENGTH;
|
|
|
|
|
|
|
|
settings->multifrag_max_request_size = 0x200000;
|
|
|
|
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->fastpath_input = true;
|
|
|
|
settings->fastpath_output = true;
|
2011-08-16 10:37:11 +04:00
|
|
|
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->uniconv = freerdp_uniconv_new();
|
|
|
|
gethostname(settings->client_hostname, sizeof(settings->client_hostname) - 1);
|
2011-11-19 21:19:16 +04:00
|
|
|
settings->mouse_motion = true;
|
2012-01-14 23:42:36 +04:00
|
|
|
|
|
|
|
settings->client_auto_reconnect_cookie = xnew(ARC_CS_PRIVATE_PACKET);
|
|
|
|
settings->server_auto_reconnect_cookie = xnew(ARC_SC_PRIVATE_PACKET);
|
|
|
|
|
|
|
|
settings->client_time_zone = xnew(TIME_ZONE_INFO);
|
|
|
|
settings->server_random = xnew(rdpBlob);
|
|
|
|
settings->server_certificate = xnew(rdpBlob);
|
2012-01-31 02:47:55 +04:00
|
|
|
|
|
|
|
freerdp_detect_paths(settings);
|
2011-07-07 21:37:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
void settings_free(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
if (settings != NULL)
|
|
|
|
{
|
2011-07-08 08:37:25 +04:00
|
|
|
freerdp_uniconv_free(settings->uniconv);
|
2011-07-22 08:52:57 +04:00
|
|
|
xfree(settings->hostname);
|
|
|
|
xfree(settings->username);
|
|
|
|
xfree(settings->password);
|
|
|
|
xfree(settings->domain);
|
|
|
|
xfree(settings->shell);
|
|
|
|
xfree(settings->directory);
|
2011-08-20 14:22:14 +04:00
|
|
|
xfree(settings->ip_address);
|
2011-07-22 08:52:57 +04:00
|
|
|
xfree(settings->client_dir);
|
2011-08-19 09:35:29 +04:00
|
|
|
xfree(settings->cert_file);
|
|
|
|
xfree(settings->privatekey_file);
|
2012-01-14 23:42:36 +04:00
|
|
|
freerdp_blob_free(settings->server_random);
|
|
|
|
freerdp_blob_free(settings->server_certificate);
|
|
|
|
xfree(settings->server_random);
|
|
|
|
xfree(settings->server_certificate);
|
2012-01-25 19:45:21 +04:00
|
|
|
xfree(settings->rdp_key_file);
|
2011-09-05 22:02:52 +04:00
|
|
|
certificate_free(settings->server_cert);
|
2012-01-14 23:42:36 +04:00
|
|
|
xfree(settings->client_auto_reconnect_cookie);
|
|
|
|
xfree(settings->server_auto_reconnect_cookie);
|
|
|
|
xfree(settings->client_time_zone);
|
|
|
|
xfree(settings->bitmapCacheV2CellInfo);
|
|
|
|
xfree(settings->glyphCache);
|
|
|
|
xfree(settings->fragCache);
|
2012-01-25 19:45:21 +04:00
|
|
|
key_free(settings->server_key);
|
2012-02-02 03:42:20 +04:00
|
|
|
xfree(settings->config_path);
|
|
|
|
xfree(settings->current_path);
|
|
|
|
xfree(settings->development_path);
|
2011-07-07 21:37:48 +04:00
|
|
|
xfree(settings);
|
|
|
|
}
|
|
|
|
}
|