return TRUE;
}
+static BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* key, UINT32* result)
+{
+ int val;
+
+ val = IniFile_GetKeyValueInt(ini, section, key);
+ if ((val < 0) || (val > UINT32_MAX))
+ {
+ WLog_ERR(TAG, "pf_config_get_uint32(): invalid value %d for section '%s', key '%s'!", val, section, key);
+ return FALSE;
+ }
+
+ *result = (UINT32) val;
+ return TRUE;
+}
+
static BOOL pf_config_load_server(wIniFile* ini, proxyConfig* config)
{
config->Host = _strdup(CONFIG_GET_STR(ini, "Server", "Host"));
config->GFX = CONFIG_GET_BOOL(ini, "Channels", "GFX");
config->DisplayControl = CONFIG_GET_BOOL(ini, "Channels", "DisplayControl");
config->Clipboard = CONFIG_GET_BOOL(ini, "Channels", "Clipboard");
+
return TRUE;
}
return TRUE;
}
+static BOOL pf_config_load_clipboard(wIniFile* ini, proxyConfig* config)
+{
+ config->TextOnly = CONFIG_GET_BOOL(ini, "Clipboard", "TextOnly");
+
+ if (!pf_config_get_uint32(ini, "Clipboard", "MaxTextLength", &config->MaxTextLength))
+ return FALSE;
+
+ return TRUE;
+}
+
static BOOL pf_config_load_filters(wIniFile* ini, proxyConfig* config)
{
UINT32 index;
if (!pf_config_load_filters(ini, config))
goto out;
+ if (!pf_config_load_clipboard(ini, config))
+ goto out;
+
ok = TRUE;
out:
IniFile_Free(ini);