2011-07-01 04:31:07 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
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.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:09:01 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2011-07-22 08:52:57 +04:00
|
|
|
#include "config.h"
|
2012-08-15 01:09:01 +04:00
|
|
|
#endif
|
|
|
|
|
2012-02-17 09:58:30 +04:00
|
|
|
#include "certificate.h"
|
2011-07-21 06:05:12 +04:00
|
|
|
#include "capabilities.h"
|
2012-08-15 01:09:01 +04:00
|
|
|
|
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
|
|
|
|
|
2012-10-09 07:42:01 +04:00
|
|
|
#include <winpr/crt.h>
|
|
|
|
#include <winpr/registry.h>
|
|
|
|
|
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
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
#define REG_QUERY_DWORD_VALUE(_key, _subkey, _type, _value, _size, _result) \
|
|
|
|
_size = sizeof(DWORD); \
|
|
|
|
if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*) &_value, &_size) == ERROR_SUCCESS) \
|
|
|
|
_result = _value
|
|
|
|
|
|
|
|
#define REG_QUERY_BOOL_VALUE(_key, _subkey, _type, _value, _size, _result) \
|
|
|
|
_size = sizeof(DWORD); \
|
|
|
|
if (RegQueryValueEx(_key, _subkey, NULL, &_type, (BYTE*) &_value, &_size) == ERROR_SUCCESS) \
|
|
|
|
_result = _value ? TRUE : FALSE
|
|
|
|
|
2012-07-25 04:46:21 +04:00
|
|
|
void settings_client_load_hkey_local_machine(rdpSettings* settings)
|
2012-06-16 01:06:26 +04:00
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
LONG status;
|
|
|
|
DWORD dwType;
|
|
|
|
DWORD dwSize;
|
|
|
|
DWORD dwValue;
|
|
|
|
|
2012-07-25 04:46:21 +04:00
|
|
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("DesktopWidth"), dwType, dwValue, dwSize, settings->width);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("DesktopHeight"), dwType, dwValue, dwSize, settings->height);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Fullscreen"), dwType, dwValue, dwSize, settings->fullscreen);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("ColorDepth"), dwType, dwValue, dwSize, settings->color_depth);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("KeyboardType"), dwType, dwValue, dwSize, settings->kbd_type);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("KeyboardSubType"), dwType, dwValue, dwSize, settings->kbd_subtype);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("KeyboardFunctionKeys"), dwType, dwValue, dwSize, settings->kbd_fn_keys);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("KeyboardLayout"), dwType, dwValue, dwSize, settings->kbd_layout);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("NlaSecurity"), dwType, dwValue, dwSize, settings->nla_security);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("TlsSecurity"), dwType, dwValue, dwSize, settings->tls_security);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("RdpSecurity"), dwType, dwValue, dwSize, settings->rdp_security);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("BitmapCache"), dwType, dwValue, dwSize, settings->bitmap_cache);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("OffscreenBitmapCache"), dwType, dwValue, dwSize, settings->offscreen_bitmap_cache);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheSize"), dwType, dwValue, dwSize, settings->offscreen_bitmap_cache_size);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheEntries"), dwType, dwValue, dwSize, settings->offscreen_bitmap_cache_entries);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client\\BitmapCacheV2"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("NumCells"), dwType, dwValue, dwSize, settings->bitmapCacheV2NumCells);
|
|
|
|
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cell0NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[0].numEntries);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Cell0Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[0].persistent);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cell1NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[1].numEntries);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Cell1Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[1].persistent);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cell2NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[2].numEntries);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Cell2Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[2].persistent);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cell3NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[3].numEntries);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Cell3Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[3].persistent);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cell4NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[4].numEntries);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("Cell4Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[4].persistent);
|
|
|
|
|
2012-10-12 23:47:51 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("AllowCacheWaitingList"), dwType, dwValue, dwSize, settings->allow_cache_waiting_list);
|
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
|
|
|
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client\\GlyphCache"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
|
|
|
|
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("SupportLevel"), dwType, dwValue, dwSize, settings->glyphSupportLevel);
|
|
|
|
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache0NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[0].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache0MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[0].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache1NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[1].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache1MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[1].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache2NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[2].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache2MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[2].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache3NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[3].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache3MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[3].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache4NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[4].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache4MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[4].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache5NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[5].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache5MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[5].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache6NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[6].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache6MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[6].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache7NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[7].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache7MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[7].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache8NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[8].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache8MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[8].cacheMaximumCellSize);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache9NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[9].cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("Cache9MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[9].cacheMaximumCellSize);
|
|
|
|
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("FragCacheNumEntries"), dwType, dwValue, dwSize, settings->fragCache->cacheEntries);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("FragCacheMaxCellSize"), dwType, dwValue, dwSize, settings->fragCache->cacheMaximumCellSize);
|
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
|
|
|
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client\\PointerCache"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
|
|
|
|
|
|
|
if (status == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("LargePointer"), dwType, dwValue, dwSize, settings->large_pointer);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("ColorPointer"), dwType, dwValue, dwSize, settings->color_pointer);
|
|
|
|
REG_QUERY_DWORD_VALUE(hKey, _T("PointerCacheSize"), dwType, dwValue, dwSize, settings->pointer_cache_size);
|
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
2012-06-16 01:06:26 +04:00
|
|
|
}
|
|
|
|
|
2012-07-25 04:46:21 +04:00
|
|
|
void settings_server_load_hkey_local_machine(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
LONG status;
|
|
|
|
DWORD dwType;
|
|
|
|
DWORD dwSize;
|
|
|
|
DWORD dwValue;
|
|
|
|
|
|
|
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Server"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
|
|
|
|
|
|
|
if (status != ERROR_SUCCESS)
|
|
|
|
return;
|
|
|
|
|
2012-10-11 22:59:01 +04:00
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("NlaSecurity"), dwType, dwValue, dwSize, settings->nla_security);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("TlsSecurity"), dwType, dwValue, dwSize, settings->tls_security);
|
|
|
|
REG_QUERY_BOOL_VALUE(hKey, _T("RdpSecurity"), dwType, dwValue, dwSize, settings->rdp_security);
|
2012-07-25 04:46:21 +04:00
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
|
|
|
|
void settings_load_hkey_local_machine(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
if (settings->server_mode)
|
|
|
|
settings_server_load_hkey_local_machine(settings);
|
|
|
|
else
|
|
|
|
settings_client_load_hkey_local_machine(settings);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2012-07-25 04:46:21 +04:00
|
|
|
/* Server instances are NULL */
|
|
|
|
|
|
|
|
if (!settings->instance)
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->server_mode = TRUE;
|
2012-07-25 04:46:21 +04:00
|
|
|
|
2011-07-07 21:37:48 +04:00
|
|
|
settings->width = 1024;
|
|
|
|
settings->height = 768;
|
2012-10-09 10:31:28 +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;
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->nla_security = TRUE;
|
|
|
|
settings->tls_security = TRUE;
|
|
|
|
settings->rdp_security = TRUE;
|
|
|
|
settings->security_layer_negotiation = TRUE;
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->client_build = 2600;
|
2012-03-30 23:37:39 +04:00
|
|
|
settings->kbd_type = 4; /* @msdn{cc240510} 'IBM enhanced (101- or 102-key) keyboard' */
|
2011-07-08 08:37:25 +04:00
|
|
|
settings->kbd_subtype = 0;
|
2012-03-30 23:37:39 +04:00
|
|
|
settings->kbd_fn_keys = 12;
|
2011-12-20 03:17:04 +04:00
|
|
|
settings->kbd_layout = 0;
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->encryption = FALSE;
|
|
|
|
settings->salted_checksum = TRUE;
|
2011-08-18 20:17:13 +04:00
|
|
|
settings->port = 3389;
|
2012-10-09 10:31:28 +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;
|
|
|
|
|
2012-10-09 10:31:28 +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
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->authentication = TRUE;
|
|
|
|
settings->authentication_only = FALSE;
|
|
|
|
settings->from_stdin = FALSE;
|
2011-11-19 21:19:16 +04:00
|
|
|
|
2012-04-03 04:38:58 +04:00
|
|
|
settings->received_caps = xzalloc(32);
|
|
|
|
settings->order_support = xzalloc(32);
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
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;
|
2011-11-19 21:19:16 +04:00
|
|
|
|
2012-04-03 04:38:58 +04:00
|
|
|
settings->client_hostname = xzalloc(32);
|
|
|
|
settings->client_product_id = xzalloc(32);
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->color_pointer = TRUE;
|
|
|
|
settings->large_pointer = TRUE;
|
2011-12-20 21:09:53 +04:00
|
|
|
settings->pointer_cache_size = 20;
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->sound_beeps = TRUE;
|
|
|
|
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
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->draw_gdi_plus = FALSE;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->frame_marker = FALSE;
|
|
|
|
settings->bitmap_cache_v3 = FALSE;
|
2011-07-21 09:56:48 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->bitmap_cache = TRUE;
|
|
|
|
settings->persistent_bitmap_cache = FALSE;
|
2012-10-12 23:47:51 +04:00
|
|
|
settings->allow_cache_waiting_list = TRUE;
|
2012-10-11 22:59:01 +04:00
|
|
|
|
|
|
|
settings->bitmapCacheV2NumCells = 5;
|
2012-01-14 23:42:36 +04:00
|
|
|
settings->bitmapCacheV2CellInfo = xzalloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
|
2012-10-11 22:59:01 +04:00
|
|
|
settings->bitmapCacheV2CellInfo[0].numEntries = 600;
|
|
|
|
settings->bitmapCacheV2CellInfo[0].persistent = FALSE;
|
|
|
|
settings->bitmapCacheV2CellInfo[1].numEntries = 600;
|
|
|
|
settings->bitmapCacheV2CellInfo[1].persistent = FALSE;
|
|
|
|
settings->bitmapCacheV2CellInfo[2].numEntries = 2048;
|
|
|
|
settings->bitmapCacheV2CellInfo[2].persistent = FALSE;
|
|
|
|
settings->bitmapCacheV2CellInfo[3].numEntries = 4096;
|
|
|
|
settings->bitmapCacheV2CellInfo[3].persistent = FALSE;
|
|
|
|
settings->bitmapCacheV2CellInfo[4].numEntries = 2048;
|
|
|
|
settings->bitmapCacheV2CellInfo[4].persistent = FALSE;
|
2011-07-25 21:42:14 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->refresh_rect = TRUE;
|
|
|
|
settings->suppress_output = TRUE;
|
2011-11-11 23:02:59 +04:00
|
|
|
|
2012-10-12 23:47:51 +04:00
|
|
|
settings->glyphSupportLevel = GLYPH_SUPPORT_FULL;
|
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
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->offscreen_bitmap_cache = TRUE;
|
2011-08-06 00:56:40 +04:00
|
|
|
settings->offscreen_bitmap_cache_size = 7680;
|
2012-06-27 03:52:38 +04:00
|
|
|
settings->offscreen_bitmap_cache_entries = 2000;
|
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
|
|
|
|
2012-10-09 07:42:01 +04:00
|
|
|
settings->client_dir = _strdup(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;
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
settings->fastpath_input = TRUE;
|
|
|
|
settings->fastpath_output = TRUE;
|
2011-08-16 10:37:11 +04:00
|
|
|
|
2012-05-11 11:34:51 +04:00
|
|
|
settings->frame_acknowledge = 2;
|
|
|
|
|
2012-05-15 17:33:19 +04:00
|
|
|
gethostname(settings->client_hostname, 31);
|
|
|
|
settings->client_hostname[31] = 0;
|
2012-10-09 10:31:28 +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);
|
2012-01-31 02:47:55 +04:00
|
|
|
|
|
|
|
freerdp_detect_paths(settings);
|
2012-06-16 01:06:26 +04:00
|
|
|
|
|
|
|
settings_load_hkey_local_machine(settings);
|
2011-07-07 21:37:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
void settings_free(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
if (settings != NULL)
|
|
|
|
{
|
2012-10-09 07:21:26 +04:00
|
|
|
free(settings->hostname);
|
|
|
|
free(settings->username);
|
|
|
|
free(settings->password);
|
|
|
|
free(settings->domain);
|
|
|
|
free(settings->shell);
|
|
|
|
free(settings->directory);
|
|
|
|
free(settings->ip_address);
|
|
|
|
free(settings->client_dir);
|
|
|
|
free(settings->cert_file);
|
|
|
|
free(settings->privatekey_file);
|
|
|
|
free(settings->received_caps);
|
|
|
|
free(settings->order_support);
|
|
|
|
free(settings->client_hostname);
|
|
|
|
free(settings->client_product_id);
|
|
|
|
free(settings->server_random);
|
|
|
|
free(settings->server_certificate);
|
|
|
|
free(settings->rdp_key_file);
|
2011-09-05 22:02:52 +04:00
|
|
|
certificate_free(settings->server_cert);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(settings->client_auto_reconnect_cookie);
|
|
|
|
free(settings->server_auto_reconnect_cookie);
|
|
|
|
free(settings->client_time_zone);
|
|
|
|
free(settings->bitmapCacheV2CellInfo);
|
|
|
|
free(settings->glyphCache);
|
|
|
|
free(settings->fragCache);
|
2012-01-25 19:45:21 +04:00
|
|
|
key_free(settings->server_key);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(settings->config_path);
|
|
|
|
free(settings->current_path);
|
|
|
|
free(settings->development_path);
|
|
|
|
free(settings);
|
2011-07-07 21:37:48 +04:00
|
|
|
}
|
|
|
|
}
|