mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
libfreerdp-core: cleanup GatewayUsageMethod setting
This commit is contained in:
parent
9e859ad11f
commit
3ee6494d36
@ -863,40 +863,7 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
|
|||||||
freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname);
|
freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname);
|
||||||
|
|
||||||
if (~file->GatewayUsageMethod)
|
if (~file->GatewayUsageMethod)
|
||||||
{
|
freerdp_set_gateway_usage_method(settings, settings->GatewayUsageMethod);
|
||||||
freerdp_set_param_uint32(settings, FreeRDP_GatewayUsageMethod, file->GatewayUsageMethod);
|
|
||||||
|
|
||||||
if (file->GatewayUsageMethod == TSC_PROXY_MODE_NONE_DIRECT)
|
|
||||||
{
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
||||||
}
|
|
||||||
else if (file->GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
|
|
||||||
{
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
||||||
}
|
|
||||||
else if (file->GatewayUsageMethod == TSC_PROXY_MODE_DETECT)
|
|
||||||
{
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, TRUE);
|
|
||||||
}
|
|
||||||
else if (file->GatewayUsageMethod == TSC_PROXY_MODE_DEFAULT)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* This corresponds to "Automatically detect RD Gateway server settings",
|
|
||||||
* which means the client attempts to use gateway group policy settings
|
|
||||||
* http://technet.microsoft.com/en-us/library/cc770601.aspx
|
|
||||||
*/
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
||||||
}
|
|
||||||
else if (file->GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
|
|
||||||
{
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (~file->PromptCredentialOnce)
|
if (~file->PromptCredentialOnce)
|
||||||
freerdp_set_param_bool(settings, FreeRDP_GatewayUseSameCredentials, file->PromptCredentialOnce);
|
freerdp_set_param_bool(settings, FreeRDP_GatewayUseSameCredentials, file->PromptCredentialOnce);
|
||||||
|
@ -1378,6 +1378,8 @@ FREERDP_API void freerdp_target_net_addresses_free(rdpSettings* settings);
|
|||||||
FREERDP_API void freerdp_performance_flags_make(rdpSettings* settings);
|
FREERDP_API void freerdp_performance_flags_make(rdpSettings* settings);
|
||||||
FREERDP_API void freerdp_performance_flags_split(rdpSettings* settings);
|
FREERDP_API void freerdp_performance_flags_split(rdpSettings* settings);
|
||||||
|
|
||||||
|
FREERDP_API void freerdp_set_gateway_usage_method(rdpSettings* settings, UINT32 GatewayUsageMethod);
|
||||||
|
|
||||||
FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id);
|
FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id);
|
||||||
FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param);
|
FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param);
|
||||||
|
|
||||||
|
@ -582,6 +582,42 @@ void freerdp_performance_flags_split(rdpSettings* settings)
|
|||||||
settings->DisableThemes = (settings->PerformanceFlags & PERF_DISABLE_THEMING) ? TRUE : FALSE;
|
settings->DisableThemes = (settings->PerformanceFlags & PERF_DISABLE_THEMING) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void freerdp_set_gateway_usage_method(rdpSettings* settings, UINT32 GatewayUsageMethod)
|
||||||
|
{
|
||||||
|
freerdp_set_param_uint32(settings, FreeRDP_GatewayUsageMethod, GatewayUsageMethod);
|
||||||
|
|
||||||
|
if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DIRECT)
|
||||||
|
{
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
||||||
|
}
|
||||||
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
|
||||||
|
{
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
||||||
|
}
|
||||||
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DETECT)
|
||||||
|
{
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, TRUE);
|
||||||
|
}
|
||||||
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DEFAULT)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This corresponds to "Automatically detect RD Gateway server settings",
|
||||||
|
* which means the client attempts to use gateway group policy settings
|
||||||
|
* http://technet.microsoft.com/en-us/library/cc770601.aspx
|
||||||
|
*/
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
||||||
|
}
|
||||||
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
|
||||||
|
{
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
||||||
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Partially Generated Code
|
* Partially Generated Code
|
||||||
*/
|
*/
|
||||||
|
@ -554,14 +554,10 @@ int rpc_client_new(rdpRpc* rpc)
|
|||||||
{
|
{
|
||||||
RpcClient* client = NULL;
|
RpcClient* client = NULL;
|
||||||
|
|
||||||
client = (RpcClient*) malloc(sizeof(RpcClient));
|
client = (RpcClient*) calloc(1, sizeof(RpcClient));
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
client->Thread = CreateThread(NULL, 0,
|
|
||||||
(LPTHREAD_START_ROUTINE) rpc_client_thread,
|
|
||||||
rpc, CREATE_SUSPENDED, NULL);
|
|
||||||
|
|
||||||
client->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
client->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
client->PduSentEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
client->PduSentEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
@ -592,18 +588,20 @@ int rpc_client_new(rdpRpc* rpc)
|
|||||||
|
|
||||||
int rpc_client_start(rdpRpc* rpc)
|
int rpc_client_start(rdpRpc* rpc)
|
||||||
{
|
{
|
||||||
ResumeThread(rpc->client->Thread);
|
rpc->client->Thread = CreateThread(NULL, 0,
|
||||||
|
(LPTHREAD_START_ROUTINE) rpc_client_thread,
|
||||||
|
rpc, 0, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rpc_client_stop(rdpRpc* rpc)
|
int rpc_client_stop(rdpRpc* rpc)
|
||||||
{
|
{
|
||||||
if (rpc->client->SynchronousReceive == FALSE)
|
if (rpc->client->Thread)
|
||||||
{
|
{
|
||||||
SetEvent(rpc->client->StopEvent);
|
SetEvent(rpc->client->StopEvent);
|
||||||
|
|
||||||
WaitForSingleObject(rpc->client->Thread, INFINITE);
|
WaitForSingleObject(rpc->client->Thread, INFINITE);
|
||||||
|
rpc->client->Thread = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc_client_free(rpc);
|
rpc_client_free(rpc);
|
||||||
|
@ -387,6 +387,7 @@ rdpSettings* freerdp_settings_new(DWORD flags)
|
|||||||
settings->MultifragMaxRequestSize = 0xFFFF;
|
settings->MultifragMaxRequestSize = 0xFFFF;
|
||||||
|
|
||||||
settings->GatewayUseSameCredentials = FALSE;
|
settings->GatewayUseSameCredentials = FALSE;
|
||||||
|
settings->GatewayBypassLocal = TRUE;
|
||||||
|
|
||||||
settings->FastPathInput = TRUE;
|
settings->FastPathInput = TRUE;
|
||||||
settings->FastPathOutput = TRUE;
|
settings->FastPathOutput = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user