diff --git a/client/Windows/CMakeLists.txt b/client/Windows/CMakeLists.txt index 200c7b6ec..312f75db4 100644 --- a/client/Windows/CMakeLists.txt +++ b/client/Windows/CMakeLists.txt @@ -38,6 +38,11 @@ add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS}) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client) +set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS + MONOLITHIC ${MONOLITHIC_BUILD} + MODULE winpr + MODULES winpr-crt winpr-credui winpr-utils) + set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} MODULE freerdp diff --git a/client/Windows/wfreerdp.c b/client/Windows/wfreerdp.c index ba01b10df..132074349 100644 --- a/client/Windows/wfreerdp.c +++ b/client/Windows/wfreerdp.c @@ -41,7 +41,6 @@ #include #include -#include #include #include @@ -526,33 +525,6 @@ BOOL wf_check_fds(freerdp* instance) return TRUE; } -int wf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data) -{ - void* entry = NULL; - rdpChannels* channels = (rdpChannels*) user_data; - - entry = freerdp_channels_client_find_static_entry("VirtualChannelEntry", name); - - if (entry) - { - if (freerdp_channels_client_load(channels, settings, entry, plugin_data) == 0) - { - printf("loading channel %s (static)\n", name); - return 1; - } - } - - printf("loading channel %s (plugin)\n", name); - freerdp_channels_load_plugin(channels, settings, name, plugin_data); - - return 1; -} - -int wf_process_client_args(rdpSettings* settings, const char* opt, const char* val, void* user_data) -{ - return 0; -} - int wfreerdp_run(freerdp* instance) { MSG msg; @@ -791,7 +763,6 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine //while (1) { int status; - int arg_parse_result; data = (thread_data*) malloc(sizeof(thread_data)); ZeroMemory(data, sizeof(thread_data)); @@ -802,24 +773,18 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (freerdp_detect_new_command_line_syntax(__argc, __argv)) { - printf("Using new command-line syntax\n"); - - status = freerdp_client_parse_command_line_arguments(instance->context->argc,instance->context->argv, instance->settings); - arg_parse_result = status; + status = freerdp_client_parse_command_line_arguments(__argc, __argv, instance->settings); freerdp_client_load_addins(instance->context->channels, instance->settings); } else { - arg_parse_result = freerdp_parse_args(instance->settings, __argc, __argv, - wf_process_plugin_args, instance->context->channels, wf_process_client_args, NULL); + freerdp_client_print_command_line_help(__argc, __argv); } - if (arg_parse_result < 0) + if (status < 0) { - if (arg_parse_result == FREERDP_ARGS_PARSE_FAILURE) - printf("failed to parse arguments.\n"); - + printf("failed to parse arguments.\n"); #ifdef _DEBUG system("pause"); #endif diff --git a/client/common/cmdline.c b/client/common/cmdline.c index f3ef7e076..78a44d9f2 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -112,7 +112,7 @@ int freerdp_client_print_version() return 1; } -int freerdp_client_print_command_line_help() +int freerdp_client_print_command_line_help(int argc, char** argv) { char* str; int length; @@ -123,7 +123,7 @@ int freerdp_client_print_command_line_help() printf("See www.freerdp.com for more information\n"); printf("\n"); - printf("Usage: xfreerdp [file] [options] [/v:[:port]]\n"); + printf("Usage: %s [file] [options] [/v:[:port]]\n", argv[0]); printf("\n"); printf("Syntax:\n"); @@ -451,7 +451,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin if (status == COMMAND_LINE_STATUS_PRINT_HELP) { - freerdp_client_print_command_line_help(); + freerdp_client_print_command_line_help(argc, argv); return COMMAND_LINE_STATUS_PRINT_HELP; } else if (status == COMMAND_LINE_STATUS_PRINT_VERSION) diff --git a/include/freerdp/client/cmdline.h b/include/freerdp/client/cmdline.h index 968215d52..71301934f 100644 --- a/include/freerdp/client/cmdline.h +++ b/include/freerdp/client/cmdline.h @@ -27,6 +27,7 @@ FREERDP_API BOOL freerdp_detect_new_command_line_syntax(int argc, char* argv[]); FREERDP_API int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettings* settings); FREERDP_API int freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings); +FREERDP_API int freerdp_client_print_command_line_help(int argc, char** argv); #endif /* FREERDP_CLIENT_CMDLINE */ diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 9b1ef48b2..152ea23dd 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -374,8 +374,14 @@ int transport_write(rdpTransport* transport, STREAM* s) void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount) { #ifdef _WIN32 - rfds[*rcount] = transport->tcp->wsa_event; + rfds[*rcount] = transport->TcpIn->wsa_event; (*rcount)++; + + if (transport->SplitInputOutput) + { + rfds[*rcount] = transport->TcpOut->wsa_event; + (*rcount)++; + } #else rfds[*rcount] = (void*)(long)(transport->TcpIn->sockfd); (*rcount)++; @@ -398,7 +404,7 @@ int transport_check_fds(rdpTransport** ptransport) rdpTransport* transport = *ptransport; #ifdef _WIN32 - WSAResetEvent(transport->tcp->wsa_event); + WSAResetEvent(transport->TcpIn->wsa_event); #endif wait_obj_clear(transport->recv_event); diff --git a/libfreerdp/core/tsg.c b/libfreerdp/core/tsg.c index fe7ce2900..68b61b3ff 100644 --- a/libfreerdp/core/tsg.c +++ b/libfreerdp/core/tsg.c @@ -1114,13 +1114,14 @@ int tsg_read(rdpTsg* tsg, BYTE* data, UINT32 length) { int status; int CopyLength; - rpcconn_common_hdr_t* header; rdpRpc* rpc = tsg->rpc; DEBUG_TSG("tsg_read: %d, pending: %d", length, tsg->PendingPdu); if (tsg->PendingPdu) { + rpcconn_common_hdr_t* header; + header = (rpcconn_common_hdr_t*) rpc->buffer; CopyLength = (tsg->BytesAvailable > length) ? length : tsg->BytesAvailable; @@ -1136,8 +1137,11 @@ int tsg_read(rdpTsg* tsg, BYTE* data, UINT32 length) } else { + rpcconn_response_hdr_t* header; + status = rpc_recv_pdu(rpc); - rpcconn_response_hdr_t* header = (rpcconn_response_hdr_t*) rpc->buffer; + + header = (rpcconn_response_hdr_t*) rpc->buffer; if (!rpc_get_stub_data_info(rpc, rpc->buffer, &tsg->StubOffset, &tsg->StubLength)) { diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index c83993f9f..5c0301808 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -562,7 +562,9 @@ BOOL tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname) free(certificate_data); } +#ifndef _WIN32 free(common_name); +#endif return verification_status; }