From eadf4036e7ccfcb98e7347b16b473b745b28a5e1 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 30 Mar 2012 23:27:21 +0200 Subject: [PATCH 1/3] wfreerdp: handle invalid command line arguments in a slightly more elegant way --- client/Windows/wfreerdp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/Windows/wfreerdp.c b/client/Windows/wfreerdp.c index b0f4f6a83..7c1d79144 100644 --- a/client/Windows/wfreerdp.c +++ b/client/Windows/wfreerdp.c @@ -684,12 +684,25 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine //while (1) { + int arg_parse_result; + data = (thread_data*) xzalloc(sizeof(thread_data)); data->instance = instance; - freerdp_parse_args(instance->settings, __argc, __argv, + arg_parse_result = freerdp_parse_args(instance->settings, __argc, __argv, wf_process_plugin_args, instance->context->channels, wf_process_client_args, NULL); + if (arg_parse_result < 0) + { + if (arg_parse_result == FREERDP_ARGS_PARSE_FAILURE) + printf("failed to parse arguments.\n"); + +#ifdef _DEBUG + system("pause"); +#endif + exit(-1); + } + if (CreateThread(NULL, 0, thread_func, data, 0, NULL) != 0) g_thread_count++; } From bf39645039a58628f85145edbe2297eba91cefcb Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 30 Mar 2012 23:28:03 +0200 Subject: [PATCH 2/3] wfreerdp: fix typo in incomplete keyboard refactorings --- client/Windows/wf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index 22bbebe45..89edbd0e1 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -97,7 +97,7 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) rdp_scancode = RDP_SCANCODE_RSHIFT; } - freerdp_input_send_keyboard_event_2(input, !(flags & LLKHF_UP), rdp_scancode); + freerdp_input_send_keyboard_event_2(input, !(p->flags & LLKHF_UP), rdp_scancode); if (p->vkCode == VK_CAPITAL) DEBUG_KBD("caps lock is processed on client side too to toggle caps lock indicator"); From 5ada0a43ec1e748e33061dc1ee8d612a0b6f2565 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 30 Mar 2012 23:28:07 +0200 Subject: [PATCH 3/3] codec: export mppc functions so it can be build on windows --- include/freerdp/codec/mppc_dec.h | 14 +++++++------- include/freerdp/codec/mppc_enc.h | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/freerdp/codec/mppc_dec.h b/include/freerdp/codec/mppc_dec.h index 060a2c904..55b7d6a74 100644 --- a/include/freerdp/codec/mppc_dec.h +++ b/include/freerdp/codec/mppc_dec.h @@ -44,12 +44,12 @@ struct rdp_mppc_dec uint8* history_ptr; }; -int decompress_rdp(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); -int decompress_rdp_4(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); -int decompress_rdp_5(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); -int decompress_rdp_6(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); -int decompress_rdp_61(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); -struct rdp_mppc_dec* mppc_dec_new(void); -void mppc_dec_free(struct rdp_mppc_dec* dec); +FREERDP_API int decompress_rdp(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); +FREERDP_API int decompress_rdp_4(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); +FREERDP_API int decompress_rdp_5(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); +FREERDP_API int decompress_rdp_6(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); +FREERDP_API int decompress_rdp_61(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen); +FREERDP_API struct rdp_mppc_dec* mppc_dec_new(void); +FREERDP_API void mppc_dec_free(struct rdp_mppc_dec* dec); #endif diff --git a/include/freerdp/codec/mppc_enc.h b/include/freerdp/codec/mppc_enc.h index 7bd231767..1160b3dbd 100644 --- a/include/freerdp/codec/mppc_enc.h +++ b/include/freerdp/codec/mppc_enc.h @@ -41,10 +41,10 @@ struct rdp_mppc_enc uint16* hash_table; }; -boolean compress_rdp(struct rdp_mppc_enc* enc, uint8* srcData, int len); -boolean compress_rdp_4(struct rdp_mppc_enc* enc, uint8* srcData, int len); -boolean compress_rdp_5(struct rdp_mppc_enc* enc, uint8* srcData, int len); -struct rdp_mppc_enc* mppc_enc_new(int protocol_type); -void mppc_enc_free(struct rdp_mppc_enc* enc); +FREERDP_API boolean compress_rdp(struct rdp_mppc_enc* enc, uint8* srcData, int len); +FREERDP_API boolean compress_rdp_4(struct rdp_mppc_enc* enc, uint8* srcData, int len); +FREERDP_API boolean compress_rdp_5(struct rdp_mppc_enc* enc, uint8* srcData, int len); +FREERDP_API struct rdp_mppc_enc* mppc_enc_new(int protocol_type); +FREERDP_API void mppc_enc_free(struct rdp_mppc_enc* enc); #endif