Merge branch 'master' of github.com:awakecoding/FreeRDP into smartcard
This commit is contained in:
commit
95f9dadbb3
@ -863,40 +863,7 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
|
||||
freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname);
|
||||
|
||||
if (~file->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);
|
||||
}
|
||||
}
|
||||
freerdp_set_gateway_usage_method(settings, settings->GatewayUsageMethod);
|
||||
|
||||
if (~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_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 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;
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
|
@ -554,14 +554,10 @@ int rpc_client_new(rdpRpc* rpc)
|
||||
{
|
||||
RpcClient* client = NULL;
|
||||
|
||||
client = (RpcClient*) malloc(sizeof(RpcClient));
|
||||
client = (RpcClient*) calloc(1, sizeof(RpcClient));
|
||||
|
||||
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->PduSentEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
|
||||
@ -592,16 +588,21 @@ int rpc_client_new(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;
|
||||
}
|
||||
|
||||
int rpc_client_stop(rdpRpc* rpc)
|
||||
{
|
||||
SetEvent(rpc->client->StopEvent);
|
||||
|
||||
WaitForSingleObject(rpc->client->Thread, INFINITE);
|
||||
if (rpc->client->Thread)
|
||||
{
|
||||
SetEvent(rpc->client->StopEvent);
|
||||
WaitForSingleObject(rpc->client->Thread, INFINITE);
|
||||
rpc->client->Thread = NULL;
|
||||
}
|
||||
|
||||
rpc_client_free(rpc);
|
||||
|
||||
|
@ -387,6 +387,7 @@ rdpSettings* freerdp_settings_new(DWORD flags)
|
||||
settings->MultifragMaxRequestSize = 0xFFFF;
|
||||
|
||||
settings->GatewayUseSameCredentials = FALSE;
|
||||
settings->GatewayBypassLocal = TRUE;
|
||||
|
||||
settings->FastPathInput = TRUE;
|
||||
settings->FastPathOutput = TRUE;
|
||||
|
@ -5,6 +5,7 @@ set(MODULE_PREFIX "TEST_CRT")
|
||||
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
||||
|
||||
set(${MODULE_PREFIX}_TESTS
|
||||
TestTypes.c
|
||||
TestAlignment.c
|
||||
TestString.c
|
||||
TestUnicodeConversion.c)
|
||||
|
111
winpr/libwinpr/crt/test/TestTypes.c
Normal file
111
winpr/libwinpr/crt/test/TestTypes.c
Normal file
@ -0,0 +1,111 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/windows.h>
|
||||
|
||||
#define EXPECTED_SIZEOF_BYTE 1
|
||||
#define EXPECTED_SIZEOF_BOOLEAN 1
|
||||
#define EXPECTED_SIZEOF_CHAR 1
|
||||
#define EXPECTED_SIZEOF_UCHAR 1
|
||||
#define EXPECTED_SIZEOF_INT8 1
|
||||
#define EXPECTED_SIZEOF_UINT8 1
|
||||
#define EXPECTED_SIZEOF_INT16 2
|
||||
#define EXPECTED_SIZEOF_UINT16 2
|
||||
#define EXPECTED_SIZEOF_WORD 2
|
||||
#define EXPECTED_SIZEOF_WCHAR 2
|
||||
#define EXPECTED_SIZEOF_SHORT 2
|
||||
#define EXPECTED_SIZEOF_USHORT 2
|
||||
#define EXPECTED_SIZEOF_BOOL 4
|
||||
#define EXPECTED_SIZEOF_INT 4
|
||||
#define EXPECTED_SIZEOF_UINT 4
|
||||
#define EXPECTED_SIZEOF_INT32 4
|
||||
#define EXPECTED_SIZEOF_UINT32 4
|
||||
#define EXPECTED_SIZEOF_DWORD 4
|
||||
#define EXPECTED_SIZEOF_DWORD32 4
|
||||
#define EXPECTED_SIZEOF_LONG 4
|
||||
#define EXPECTED_SIZEOF_LONG32 4
|
||||
#define EXPECTED_SIZEOF_INT64 8
|
||||
#define EXPECTED_SIZEOF_UINT64 8
|
||||
#define EXPECTED_SIZEOF_DWORD64 8
|
||||
#define EXPECTED_SIZEOF_DWORDLONG 8
|
||||
#define EXPECTED_SIZEOF_LONG64 8
|
||||
#define EXPECTED_SIZEOF_ULONGLONG 8
|
||||
#define EXPECTED_SIZEOF_LUID 8
|
||||
#define EXPECTED_SIZEOF_FILETIME 8
|
||||
#define EXPECTED_SIZEOF_LARGE_INTEGER 8
|
||||
#define EXPECTED_SIZEOF_ULARGE_INTEGER 8
|
||||
#define EXPECTED_SIZEOF_GUID 16
|
||||
#define EXPECTED_SIZEOF_SYSTEMTIME 16
|
||||
#define EXPECTED_SIZEOF_SIZE_T sizeof(void*)
|
||||
#define EXPECTED_SIZEOF_INT_PTR sizeof(void*)
|
||||
#define EXPECTED_SIZEOF_UINT_PTR sizeof(void*)
|
||||
#define EXPECTED_SIZEOF_DWORD_PTR sizeof(void*)
|
||||
#define EXPECTED_SIZEOF_LONG_PTR sizeof(void*)
|
||||
#define EXPECTED_SIZEOF_ULONG_PTR sizeof(void*)
|
||||
|
||||
#define TEST_SIZEOF_TYPE(_name) \
|
||||
if (sizeof(_name) != EXPECTED_SIZEOF_ ##_name) { \
|
||||
fprintf(stderr, "sizeof(%s) mismatch: Actual: %d, Expected: %d\n", \
|
||||
#_name, sizeof(_name), EXPECTED_SIZEOF_ ##_name); \
|
||||
status = -1; \
|
||||
}
|
||||
|
||||
int TestTypes(int argc, char* argv[])
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
TEST_SIZEOF_TYPE(INT8)
|
||||
TEST_SIZEOF_TYPE(UINT8)
|
||||
|
||||
TEST_SIZEOF_TYPE(BYTE)
|
||||
TEST_SIZEOF_TYPE(BOOLEAN)
|
||||
TEST_SIZEOF_TYPE(CHAR)
|
||||
TEST_SIZEOF_TYPE(UCHAR)
|
||||
|
||||
TEST_SIZEOF_TYPE(INT16)
|
||||
TEST_SIZEOF_TYPE(UINT16)
|
||||
|
||||
TEST_SIZEOF_TYPE(WORD)
|
||||
TEST_SIZEOF_TYPE(WCHAR)
|
||||
TEST_SIZEOF_TYPE(SHORT)
|
||||
TEST_SIZEOF_TYPE(USHORT)
|
||||
|
||||
TEST_SIZEOF_TYPE(BOOL)
|
||||
|
||||
TEST_SIZEOF_TYPE(INT)
|
||||
TEST_SIZEOF_TYPE(UINT)
|
||||
TEST_SIZEOF_TYPE(DWORD)
|
||||
TEST_SIZEOF_TYPE(DWORD32)
|
||||
TEST_SIZEOF_TYPE(LONG)
|
||||
TEST_SIZEOF_TYPE(LONG32)
|
||||
|
||||
TEST_SIZEOF_TYPE(INT32)
|
||||
TEST_SIZEOF_TYPE(UINT32)
|
||||
|
||||
TEST_SIZEOF_TYPE(INT64)
|
||||
TEST_SIZEOF_TYPE(UINT64)
|
||||
|
||||
TEST_SIZEOF_TYPE(DWORD64)
|
||||
TEST_SIZEOF_TYPE(DWORDLONG)
|
||||
|
||||
TEST_SIZEOF_TYPE(LONG64)
|
||||
TEST_SIZEOF_TYPE(ULONGLONG)
|
||||
|
||||
TEST_SIZEOF_TYPE(LUID)
|
||||
TEST_SIZEOF_TYPE(FILETIME)
|
||||
TEST_SIZEOF_TYPE(LARGE_INTEGER)
|
||||
TEST_SIZEOF_TYPE(ULARGE_INTEGER)
|
||||
|
||||
TEST_SIZEOF_TYPE(GUID)
|
||||
TEST_SIZEOF_TYPE(SYSTEMTIME)
|
||||
|
||||
TEST_SIZEOF_TYPE(SIZE_T)
|
||||
TEST_SIZEOF_TYPE(INT_PTR)
|
||||
TEST_SIZEOF_TYPE(UINT_PTR)
|
||||
TEST_SIZEOF_TYPE(DWORD_PTR)
|
||||
TEST_SIZEOF_TYPE(LONG_PTR)
|
||||
TEST_SIZEOF_TYPE(ULONG_PTR)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user