diff options
Diffstat (limited to 'libfreerdp/common')
-rw-r--r-- | libfreerdp/common/settings.c | 38 | ||||
-rw-r--r-- | libfreerdp/common/settings_getters.c | 14 | ||||
-rw-r--r-- | libfreerdp/common/settings_str.h | 4 | ||||
-rw-r--r-- | libfreerdp/common/test/CMakeLists.txt | 15 |
4 files changed, 55 insertions, 16 deletions
diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 34712c8..3beba43 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -237,6 +237,33 @@ BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device) return TRUE; } +BOOL freerdp_device_collection_del(rdpSettings* settings, const RDPDR_DEVICE* device) +{ + WINPR_ASSERT(settings); + + if (!device) + return FALSE; + + const UINT32 count = settings->DeviceCount; + for (size_t x = 0; x < count; x++) + { + const RDPDR_DEVICE* cur = settings->DeviceArray[x]; + if (cur == device) + { + for (size_t y = x + 1; y < count; y++) + { + RDPDR_DEVICE* next = settings->DeviceArray[y]; + settings->DeviceArray[y - 1] = next; + } + settings->DeviceArray[count - 1] = NULL; + settings->DeviceCount--; + return TRUE; + } + } + + return FALSE; +} + RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, const char* name) { RDPDR_DEVICE* device = NULL; @@ -392,6 +419,9 @@ fail: void freerdp_device_free(RDPDR_DEVICE* device) { + if (!device) + return; + union { RDPDR_DEVICE* dev; @@ -403,8 +433,6 @@ void freerdp_device_free(RDPDR_DEVICE* device) } cnv; cnv.dev = device; - if (!cnv.dev) - return; switch (device->Type) { @@ -1166,8 +1194,10 @@ BOOL freerdp_settings_set_value_for_name(rdpSettings* settings, const char* name case RDP_SETTINGS_TYPE_BOOL: { - BOOL val = _strnicmp(value, "TRUE", 5) == 0; - if (!val && _strnicmp(value, "FALSE", 6) != 0) + const BOOL val = (_strnicmp(value, "TRUE", 5) == 0) || (_strnicmp(value, "ON", 5) == 0); + const BOOL nval = + (_strnicmp(value, "FALSE", 6) == 0) || (_strnicmp(value, "OFF", 6) == 0); + if (!val && !nval) return parsing_fail(name, "BOOL", value); return freerdp_settings_set_bool(settings, (FreeRDP_Settings_Keys_Bool)index, val); } diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index ecec044..88f1fcb 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -105,6 +105,9 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, FreeRDP_Settings_Key case FreeRDP_AutoReconnectionEnabled: return settings->AutoReconnectionEnabled; + case FreeRDP_AutoReconnectionPacketSupported: + return settings->AutoReconnectionPacketSupported; + case FreeRDP_BitmapCacheEnabled: return settings->BitmapCacheEnabled; @@ -252,6 +255,9 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, FreeRDP_Settings_Key case FreeRDP_GatewayHttpUseWebsockets: return settings->GatewayHttpUseWebsockets; + case FreeRDP_GatewayIgnoreRedirectionPolicy: + return settings->GatewayIgnoreRedirectionPolicy; + case FreeRDP_GatewayRpcTransport: return settings->GatewayRpcTransport; @@ -712,6 +718,10 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, FreeRDP_Settings_Keys_Bool settings->AutoReconnectionEnabled = cnv.c; break; + case FreeRDP_AutoReconnectionPacketSupported: + settings->AutoReconnectionPacketSupported = cnv.c; + break; + case FreeRDP_BitmapCacheEnabled: settings->BitmapCacheEnabled = cnv.c; break; @@ -908,6 +918,10 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, FreeRDP_Settings_Keys_Bool settings->GatewayHttpUseWebsockets = cnv.c; break; + case FreeRDP_GatewayIgnoreRedirectionPolicy: + settings->GatewayIgnoreRedirectionPolicy = cnv.c; + break; + case FreeRDP_GatewayRpcTransport: settings->GatewayRpcTransport = cnv.c; break; diff --git a/libfreerdp/common/settings_str.h b/libfreerdp/common/settings_str.h index a3c71fb..27939bd 100644 --- a/libfreerdp/common/settings_str.h +++ b/libfreerdp/common/settings_str.h @@ -50,6 +50,8 @@ static const struct settings_str_entry settings_map[] = { { FreeRDP_AutoLogonEnabled, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_AutoLogonEnabled" }, { FreeRDP_AutoReconnectionEnabled, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_AutoReconnectionEnabled" }, + { FreeRDP_AutoReconnectionPacketSupported, FREERDP_SETTINGS_TYPE_BOOL, + "FreeRDP_AutoReconnectionPacketSupported" }, { FreeRDP_BitmapCacheEnabled, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_BitmapCacheEnabled" }, { FreeRDP_BitmapCachePersistEnabled, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_BitmapCachePersistEnabled" }, @@ -114,6 +116,8 @@ static const struct settings_str_entry settings_map[] = { { FreeRDP_GatewayHttpTransport, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_GatewayHttpTransport" }, { FreeRDP_GatewayHttpUseWebsockets, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_GatewayHttpUseWebsockets" }, + { FreeRDP_GatewayIgnoreRedirectionPolicy, FREERDP_SETTINGS_TYPE_BOOL, + "FreeRDP_GatewayIgnoreRedirectionPolicy" }, { FreeRDP_GatewayRpcTransport, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_GatewayRpcTransport" }, { FreeRDP_GatewayUdpTransport, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_GatewayUdpTransport" }, { FreeRDP_GatewayUseSameCredentials, FREERDP_SETTINGS_TYPE_BOOL, diff --git a/libfreerdp/common/test/CMakeLists.txt b/libfreerdp/common/test/CMakeLists.txt index c1f871b..da832a8 100644 --- a/libfreerdp/common/test/CMakeLists.txt +++ b/libfreerdp/common/test/CMakeLists.txt @@ -8,7 +8,7 @@ set(${MODULE_PREFIX}_TESTS TestAddinArgv.c TestCommonAssistance.c) -set(${MODULE_PREFIX}_FUZZERS +set(FUZZERS TestFuzzCommonAssistanceParseFileBuffer.c TestFuzzCommonAssistanceBinToHexString.c TestFuzzCommonAssistanceHexStringToBin.c) @@ -21,17 +21,8 @@ add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) target_link_libraries(${MODULE_NAME} freerdp winpr) -if (BUILD_FUZZERS) - foreach(test ${${MODULE_PREFIX}_FUZZERS}) - get_filename_component(TestName ${test} NAME_WE) - add_executable(${TestName} ${test}) - # Use PUBLIC to force 'fuzzer_config' for all dependent targets. - target_link_libraries(${TestName} PUBLIC freerdp winpr fuzzer_config) - add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName}) - set_target_properties(${TestName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") - add_dependencies(fuzzers ${TestName}) - endforeach() -endif (BUILD_FUZZERS) +include (AddFuzzerTest) +add_fuzzer_test("${FUZZERS}" "freerdp winpr") set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") |