Commit Graph

242 Commits

Author SHA1 Message Date
Armin Novak
67be5258ad Exposing NLA functions to impersonate and revert context. 2019-03-08 10:10:43 +01:00
Armin Novak
7d89ea22d4 Unified initialization of OrderSupport
Added a library internal function freerdp_settings_set_default_order_support
which initializes the OrderSupport array of settings.
Now clients no longer need to set this up on their own, if they
do not implement their own hardware accelerated order processing.
2018-11-23 10:11:50 +01:00
Armin Novak
666ef4ab34 Fix #4864: Register pointer cache after PostConnect is called
With #4950 client side pointer implementation was made optional.
This addresses an issue that each client had to call
pointer_cache_register_callbacks on its own.
2018-11-20 09:49:39 +01:00
David Fort
040d14b673
Merge pull request #4869 from akallabeth/clear_fix
Fix #4868: Separate codec reset from initial setup
2018-09-24 09:46:33 +02:00
rbarnett
5d3e76bd80 Replace cryptic names; move the disconnect ultimatum reasons enum into public API and rename; remove setter 2018-09-19 09:36:39 -05:00
Armin Novak
13e59b5d6a Fix #4868: Allow empty bands data. 2018-09-19 14:18:29 +02:00
rbarnett
8458266183 Store the disconnect provider ulimatum reason in a new field in struct rdp_context and move the test for a logoff reason to xf_client.c 2018-09-18 15:31:10 -05:00
Armin Novak
fad20be6e6 Fixed missing includes. 2018-08-27 14:34:42 +02:00
Armin Novak
7a6b8a04b9 Fixed channel reconnect after redirect. 2018-07-13 13:11:38 +02:00
Armin Novak
f617d0d3c1 Moved automatic reconnect after timeout to freerdp_connect. 2018-07-10 14:09:43 +02:00
Armin Novak
7a39dcd7e2 Updated reconnect to handle cases where PostConnect was not called
freerdp_reconnect might be called after a freerdp_connect failed due
to a TCP timeout waiting for user input.
In such cases we need to know if PostConect was already called and
do that if not.
2018-07-10 12:04:27 +02:00
Armin Novak
0d1895e4e7 Fixed async input return value check. 2018-07-09 17:45:50 +02:00
Armin Novak
35cd438eca Added enum for client connection state. 2018-06-25 09:25:27 +02:00
Armin Novak
273655a850 Follow up fix for #4631
Remember the callback state to avoid calling reerdp_channels_post_connect
before the corresponding client callback has benn called.
This might happen during redirection and reconnection.
2018-06-18 10:44:35 +02:00
Armin Novak
685f5a8d20 Do not clear last error if not reconnecting. 2018-04-11 10:06:11 +02:00
Armin Novak
7af9ba9171 Refactored reconnect and redirect API
Reconnect and redirect share the same code on disconnect.
Move that to a single function and export it as it may be required
to terminate the session properly before reconnect is called.
2018-04-09 14:04:30 +02:00
Armin Novak
0a7691de58 Fixed channel (dis)connect on redirect or reconnect. 2018-04-09 11:26:12 +02:00
Armin Novak
f840150a54 Fixed missing return value checks. 2018-04-04 13:24:32 +02:00
Armin Novak
1f7d33a2f2 Fixed read/write of surface bits command.
The optional field exBitmapDataHeader of TS_ BITMAP_DATA_EX was ignored.
Read and expose the data (currently unused)
2018-03-01 11:38:59 +01:00
Armin Novak
990b8c23a9 Fixed PubSub function pointer casts. 2018-02-14 11:00:52 +01:00
David Fort
191b8f950f Fix for #4330
Since ec027bf dynamic resolution is broken when used with egfx. Before that commit
we were tracking a server sent resize by setting a DesktopResize callback. This callback
is called when the desktop is resized by the server. Anyway the problem was that when this
callback is called, the activation sequence is not always completed, which were leading to
some freeze with 2012r2 servers (sending packets before the sequence is finished).
So with the faulty commit, we are tracking server resizes by subscribing to the Actived
event, that is called at the end of a reactivation sequence, so we're sure to not send packets
when not fully activated.
Anyway the issue that shows on (#4330) is that when you use egfx, no reactivation sequence happens,
the server only sends a ResetGraphics message with the new size, and so we miss the resized event.
This fix introduces a new GraphicsReset event, makes the display channel subscribe to that event,
and react accordingly.
2017-12-23 13:50:54 +01:00
Martin Fleisz
ec027bf46c
Merge pull request #4318 from hardening/display_improvement
Dynamic resolution improvements
2017-12-20 13:43:22 +01:00
David Fort
2a6c9e1b87 Add an activated event and a Timer event
Added an event that is triggered when the activation sequence is finished.
We also define a timer event that is neat to have for regular operation.
2017-12-19 15:21:15 +01:00
Armin Novak
7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00
Armin Novak
4fe12b0ea3 Fix #4247: warnings introduced with #3904 2017-11-20 10:18:15 +01:00
Brent Collins
e47123f05a Do not initialize SSL in freerdp_context_new, it is too early to detect the fips enabled flag
and is redundant since it is initialized later before actually using SSL.
2017-11-17 12:43:07 +01:00
Armin Novak
ce00f4dd8f Silence WLog_ERR messages if last error is set. 2017-11-06 14:02:22 +01:00
Armin Novak
d119745d97 String representation of logon_error_info 2017-03-02 18:09:51 +01:00
Norbert Federa
71ce3378da Merge pull request #3665 from realjiangms/fix_ssl_add_all_digests
Winpr/openssl: Fix digests initialization in multi-thread
2017-01-13 09:46:14 +01:00
zihao.jiang
a505a6cd27 Winpr/openssl: Fix digests initialization in multi-thread
SSL functions like OpenSSL_add_all_digests should be invoked at very beginning as they are not MT safe.
If not we might meet double free exception as following:

 #0  0x00007f23ddd71c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #1  0x00007f23ddd75028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #2  0x00007f23dddae2a4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #3  0x00007f23dddba55e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #4  0x00007f23dc6ecfcd in CRYPTO_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #5  0x00007f23dc6ef8d1 in OBJ_NAME_add () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #6  0x00007f23dc77dcd8 in EVP_add_digest () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #7  0x00007f23dc782321 in OpenSSL_add_all_digests () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #8  0x00007f23c781da28 in winpr_openssl_get_evp_md (md=4) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:52
 #9  0x00007f23c781dccb in winpr_Digest_Init (ctx=0x7f22d064d470, md=<optimized out>) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:344
 #10 0x00007f23d486139b in security_salted_mac_signature (rdp=0x7f23859f5a20, data=0x7f238542d4fb "\004\204\022\004", length=4743, encryption=<optimized out>, output=0x7
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/security.c:378
 #11 0x00007f23d488d73f in fastpath_send_update_pdu (fastpath=<optimized out>, updateCode=4 '\004', s=0x7f23859f5f40, skipCompression=true)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/fastpath.c:1076
 #12 0x00007f23d4891c4f in update_send_surface_frame_bits (context=0x7f23859f5540, cmd=0x7f22b2ffcc80, first=true, last=true, frameId=6)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/update.c:1041

Related reports: https://rt.openssl.org/Ticket/Display.html?id=2216&user=guest&pass=guest
2016-12-28 03:48:40 +08:00
Armin Novak
ece9491932 Printing a warning if a error is overwritten. 2016-12-19 14:13:36 +01:00
Norbert Federa
f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Norbert Federa
c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Marc-André Moreau
dee76617d9 channels: remove thread-local storage usage 2016-11-15 11:41:01 -05:00
Marc-André Moreau
70c4646722 channels: restore global tables for initHandle, openHandle mappings instead of thread local storage 2016-11-14 15:23:05 -05:00
Armin Novak
6276f3d39a Added log messages for invalid function call. 2016-10-27 14:36:48 +02:00
Armin Novak
d1a28c59f7 Fixed uninitialized variable. 2016-10-13 16:57:51 +02:00
Armin Novak
3220b15730 Added missing event handle. 2016-10-06 13:43:12 +02:00
Armin Novak
f2d7766db6 Moved common async input handling to core library. 2016-10-06 13:43:12 +02:00
Armin Novak
b8b84473a3 Fixed post disconnect hook. 2016-10-06 13:43:12 +02:00
Armin Novak
22ddec810b Moved pre and post channel hooks. 2016-10-06 13:43:10 +02:00
Armin Novak
122f25eb60 Fixed channel cleanup. 2016-10-06 13:43:09 +02:00
Armin Novak
d35823cf69 Moved channel init code to core library. 2016-10-06 13:43:09 +02:00
Armin Novak
dadc5262ae Removed static channel variables.
Global static variables do not work, if more than one instance
of an RDP client is running in the same process space.
Removed the varaibles where possible and replaced them with
thread local storage where necessary.
2016-10-06 13:43:09 +02:00
Marc-André Moreau
9211f44e46 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2016-03-15 20:19:15 -04:00
Martin Fleisz
b2d24a4dd2 freerdp: Fix possible crash when setting error info in server-mode 2016-03-14 15:27:15 +01:00
Marc-André Moreau
3cbd7c08f7 freerdp: fix freerdp_connect possible incorrect status code 2016-03-11 14:42:16 -05:00
Armin Novak
1036f1e296 Fixed default visibility.
When nothing is declared, only export symbols defined
with WINPR_API or FREERDP_API defined.
Override this setting if BUILD_TESTING to allow tests
access to internal functions usually not exposed.
2016-02-26 19:44:14 +01:00
Armin Novak
24c93e4de7 Resetting abortEvent only on connect and reconnect. 2016-02-23 16:32:47 +01:00
Armin Novak
cdadb58f93 Function freerdp_set_error_info fix
The public function did not wrap rdp_set_error_info.
2016-02-04 11:40:42 +01:00
MartinHaimberger
83b706c4be Merge pull request #3092 from akallabeth/get_build_config
Added get_build_config functions.
2016-01-28 15:23:24 +01:00
Armin Novak
035f127081 Added get_build_config functions. 2016-01-28 14:26:50 +01:00
Armin Novak
5542fef75d Resetting abort event on freerdp_connect. 2016-01-18 10:08:12 +01:00
MartinHaimberger
d971116457 Merge pull request #2765 from akallabeth/connect_abort
Connect abort and unified TCP connect
2015-09-07 10:05:24 +02:00
Armin Novak
01496f474f Fixed error handling for rdp_client_connect fail. 2015-09-05 16:26:29 +02:00
Armin Novak
188fe4ed2b Removed rdp disconnect, using unified abortEvent instead. 2015-09-05 14:57:30 +02:00
Armin Novak
3b8043264f Resetting channel error on connect. 2015-09-03 13:46:17 +02:00
Armin Novak
893e7a35a8 Fixed broken cleanup code. 2015-08-31 09:13:15 +02:00
Armin Novak
c3a1f56f77 Resetting signals on freerdp_connect. 2015-08-27 15:53:37 +02:00
Armin Novak
fda56c0dbb Added missing NULL pointer checks. 2015-08-27 15:33:06 +02:00
Armin Novak
4cfd7a48cd Aborting transport layer now if requested. 2015-08-27 15:33:06 +02:00
Armin Novak
e6c23cb534 Implemented Async TCP connect with abort event
* Implemented unified freerdp_tcp_connect_timeout with connect abort.
* Implemented unified freerdp_tcp_connect_multi with connect abort.
* Added connect abort to freerdp_tcp_connect.
* Added freerdp_abort_connect and abortEvent.
2015-08-27 15:33:06 +02:00
Martin Haimberger
52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Martin Haimberger
6ab0187d84 Merge remote-tracking branch 'upstream/master' into mh-channel
Conflicts:
	channels/audin/client/oss/audin_oss.c
	channels/drive/client/drive_main.c
	channels/printer/client/printer_cups.c
	channels/printer/client/printer_main.c
	channels/rail/client/rail_main.c
	channels/rdpgfx/client/rdpgfx_main.c
	channels/rdpsnd/client/oss/rdpsnd_oss.c
	channels/remdesk/client/remdesk_main.c
	channels/remdesk/server/remdesk_main.c
	channels/tsmf/client/tsmf_media.c
2015-07-15 01:57:07 -07:00
Martin Haimberger
b8c110d19b introduced channel error reporting system
The rdpContext gets an event which will
get set if an error occoured in a channel.

If a thread or a void callback has to report an
error it will get signaled by this system.
2015-07-15 00:50:35 -07:00
Bernhard Miklautz
ff8d172a12 core: use error instead of debug
When the function would return with an error print an error message
instead of a debug message
2015-06-23 11:15:13 +02:00
ivan-83
307d22ca11 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 23:48:07 +03:00
ivan-83
3912172fc8 + tsmf: OSS initial suppot (not work yet)
* tsmf: fix video playback on FreeBSD (proper shared object name)
* tsmf: renamed args: audio->sys, audio-dev->dev
* audin: OSS fix, now it work
* cmdline: add syntax help for /audin, /rdpsnd, /tsmf
* add debug messages
2015-05-27 23:22:36 +03:00
ivan-83
0fda0eb0de Code style changed. 2015-05-27 22:59:57 +03:00
ivan-83
1009268158 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 22:57:10 +03:00
ivan-83
94a7abd2af + tsmf: OSS initial suppot (not work yet)
* tsmf: fix video playback on FreeBSD (proper shared object name)
* tsmf: renamed args: audio->sys, audio-dev->dev
* audin: OSS fix, now it work
* cmdline: add syntax help for /audin, /rdpsnd, /tsmf
* add debug messages
2015-05-27 22:54:13 +03:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Armin Novak
d98e485ac0 Fixed some type mismatches. 2015-04-21 12:35:55 +02:00
Armin Novak
d3336340ba Add *get_event_handles handle count, return check. 2015-04-21 12:24:50 +02:00
Martin Haimberger
9c0d275548 transport: added function to get bytes written
added function to get written bytes on transport.
This is needed to get a more accurate bandwidth
management.
2015-04-14 03:49:01 -07:00
Armin Novak
eedf45583a Using sprintf_s now. 2015-03-30 18:17:07 +02:00
Armin Novak
0adab13719 Now returning const char* 2015-03-30 18:09:02 +02:00
Armin Novak
cf941304b3 Fixed windows _snprintf. 2015-03-30 18:05:46 +02:00
Armin Novak
8f228163a8 Added version and build info functions
Added functions to get
 * Version String
 * Build Time String
 * Git Revision String
and appropriate tests.
2015-03-30 17:51:29 +02:00
Marc-André Moreau
851626f296 Merge pull request #2492 from bmiklautz/malloc_wrap
Fix compiler warnings and code hardening
2015-03-30 09:35:36 -04:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Armin Novak
48d8058f9b fixed log message arguments. 2015-03-19 11:11:43 +01:00
Armin Novak
56dc61cc06 Added error name and string functions.
Added new functions allowing to get a string representation of an error code
and a description of the error for connect and base error classes.
2015-03-19 11:05:16 +01:00
Marc-André Moreau
0e57706de5 libfreerdp-core: cleanup connect error codes, fix Win32 NLA 2015-02-17 21:01:27 -05:00
Marc-André Moreau
991f7b347d libfreerdp-core: further abstract multiple connections used internally by tsg from rdpTransport 2015-02-15 10:06:17 -05:00
Armin Novak
c66d0ccff8 Fixed codecs_free 2015-02-09 17:35:41 +01:00
Armin Novak
e162784e34 Fixed resource cleanup on disconnect. 2015-02-09 17:33:43 +01:00
Marc-André Moreau
fa06c4d401 libfreerdp-core: improve reconnection 2015-02-06 14:21:26 -05:00
Marc-André Moreau
82d58086db xfreerdp: partial reconnect fixes 2015-02-05 17:01:56 -05:00
Marc-André Moreau
7c6948cd5c xfreerdp: make use of freerdp_get_event_handles 2015-01-30 09:47:02 -05:00
Marc-André Moreau
3a906caa4a freerdp: add event handle usage instead of file descriptors 2015-01-29 22:57:58 -05:00
Marc-André Moreau
620694c10a Merge pull request #2301 from akallabeth/disconnect_fix
Disconnect / Reconnect fix
2015-01-14 08:56:54 -05:00
Martin Haimberger
bba342a6be added set_error_info function
if an error_info is set, a TS_SET_ERROR_INFO_PDU
will be sent to the client on disconnect with
the error_info
2015-01-13 08:09:36 -08:00
Armin Novak
524e4635fd Fixed typos.
gdi_free now done on disconnect.
2015-01-13 12:00:51 +01:00
Armin Novak
e3df1d3d5b Fixed freerdp_disconnect and freerdp_reconnect. 2015-01-12 13:44:34 +01:00
Norbert Federa
25f66d2e6d xfreerdp: added smart sizing, mt gesture fixes
- removed setting ScalingFactor
- added settings SmartSizingWidth and SmartSizingHeight
- changed option /smart-sizing to optionally support <width>x<height>
- consolidated transformation of input event coordinates
- rdp8 gfx ignored scaling and panning offsets: fixed
- never resize window on panning/pinching
- simplified keyboard multitouch gesture debugging emulation
- disabled keyboard multitouch gesture emulation debug code via define
2014-12-01 11:56:44 +01:00
Vic Lee
152d525a05 libfreerdp-core: server-side auto-detect feature. 2014-10-29 00:49:49 +08:00
erbth
58c392e72e Added lock key synchronization to wfreerdp 2014-10-03 16:27:47 +02:00