Commit Graph

241 Commits

Author SHA1 Message Date
Gluzskiy Alexandr bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
Kobi Mizrachi 004c2f49e4 rail: server: add API to set railHandshakeExflags 2020-07-07 15:31:20 +03:00
Kobi Mizrachi ec06a98e84 rail: server: rename rail_send_pdu -> rail_server_send_pdu 2020-07-06 10:32:59 +03:00
Kobi Mizrachi 5438b94c97 rail_common.c: Fix rail_get_order_type_string 2020-07-06 08:46:14 +03:00
Kobi Mizrachi c3b28e8bce rail: server: mark rail_send_pdu as static function 2020-07-06 08:27:13 +03:00
akallabeth 9909ed57ae Fixed rails debug string warnings. 2020-05-20 15:10:07 +02:00
Armin Novak d2aef75004 Fix #5852: handle CHANNEL_EVENT_WRITE_CANCELLED
When channels are cleaned up OpenHandle is most of the time
already 0. Ignore the argument checks for
CHANNEL_EVENT_WRITE_CANCELLED and CHANNEL_EVENT_WRITE_COMPLETE
only check where actually required (CHANNEL_EVENT_DATA_RECEIVED)
2020-01-29 08:52:25 +01:00
Kobi Mizrachi 29dee84a2b rail/server: rename rdpContext to rdpcontext
Fixes a compilation error when mixing c++ and c code.
2020-01-14 07:58:47 +01:00
Kobi Mizrachi 7af2483626 rail: keep extendedSpiSupported flag synced 2019-12-12 11:10:44 +01:00
Kobi Mizrachi 5565b366b0 rail: stream size checks and rail_read_sysparam_order fixes 2019-12-12 11:10:44 +01:00
Armin Novak 2d3d882de9 Stream size checks for rail_write_sysparam_order
Ensure the stream is large enough to hold the data
in rail_write_sysparam_order, rail_write_high_contrast and
rail_write_filterkeys.
2019-12-12 11:10:44 +01:00
Mati Shabtay 4dacb57f6f rail server: implement channel code for rail server
* Split common functionality from client code
* Clean up client code and use proper defines for constants
* Implements the channel code to read/write server side
  messages.
2019-12-12 11:10:44 +01:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak 75ed12f1f0 Fixed userdata pointer and CHANNEL_EVENT_WRITE_CANCELLED message. 2019-11-06 13:01:43 +01:00
Armin Novak 1bcb799560 Listen to CHANNEL_EVENT_WRITE_CANCELLED and emit if queue is cleared. 2019-11-06 13:01:43 +01:00
Armin Novak 1b78b59926 Fixed #4809: Properly process CHANNEL_EVENT_WRITE_COMPLETE 2019-11-06 13:01:43 +01:00
Armin Novak 09d14a2462 Fixed VirtualChannelWriteEx error case leaks. 2019-11-06 13:01:43 +01:00
Martin Fleisz 583045e2e5 rail: Update to latest spec version 28.0 2019-10-02 14:51:45 +02:00
Martin Fleisz b80a26f82c rail: Fixes incorrect setting of TS_RAIL_EXEC_FLAG_FILE
The TS_RAIL_EXEC_FLAG should only be set if ExeOrFile refers to a file
path. If we don't supply a published app name (using ||) but the name of
an application (i.e. notepad.exe) this flag was incorrectly set causing
an remote app execution error (error 5 - file not found).
2019-07-09 08:21:45 +02:00
David Fort 6563bc28c4 rail: added verbose logs (#5402)
* rail: added verbose logs

* rail: fix buffer initialisation in debug message
2019-05-23 12:15:26 +02:00
Armin Novak 8666d7e59b Fixed mapping of new client sysparam values. 2019-05-15 15:25:04 +02:00
Armin Novak a2834ae233 Fixed rails set_caretwidth 2019-05-09 12:28:27 +02:00
Armin Novak 2cc714a57d Updated RAILS implementation
* Implement new messages and callbacks
* Announce most recent channel features
* Added settings to configure flags to announce
2019-05-08 17:25:15 +02:00
Martin Fleisz 25fc56a625
Merge pull request #5260 from akallabeth/rail_spec_update
Rail spec update
2019-04-29 11:27:26 +02:00
Armin Novak 5e42c8943d Fixed typo in RAIL_ZORDER_SYNC 2019-04-26 13:14:30 +02:00
Mati Shabtay e1ef302a8d rail_orders.c: Fix wrong callback call on server handshake ex recv (#5345) 2019-04-25 10:55:24 +02:00
Armin Novak aacf5bddc4 Updated rail channel, supporting all new messages. 2019-02-19 15:04:11 +01:00
Armin Novak e500abc092 Fixed rail_string_to_unicode_string size calculation. 2018-11-14 11:03:59 +01:00
Armin Novak 93846c801a Allow empty rail strings. 2018-09-25 09:54:47 +02:00
Armin Novak 5819946b84 Fixed rail unicode string conversion and const correctness. 2018-09-14 10:04:16 +02:00
Armin Novak 114abad767 Removed use of strcpy. 2018-08-27 14:34:09 +02:00
Ondrej Holy 865ee84ab5 channels/rail: Fix leak found by covscan
leaked_storage: Variable "s" going out of scope leaks the storage it points to.
2018-08-22 13:35:43 +02:00
Armin Novak a716dc244c Removed duplicate resource free. 2018-06-18 10:23:57 +02:00
Armin Novak fb032f91b7 Fixed uninitialized value. 2018-05-04 12:36:18 +02:00
David Fort 8cba201999
Merge pull request #4548 from akallabeth/autoreconnect_fix
Autoreconnect fix
2018-04-27 09:39:30 +02:00
Bernhard Miklautz c0afb8bd6b
Merge pull request #4322 from akallabeth/rail_fixes
Rail fixes for GFX mode
2018-04-11 10:49:44 +02:00
Armin Novak 1761a66b5e Fixed channel duplicate disconnect handling 2018-04-09 11:26:36 +02:00
Armin Novak e0d112d548 Removed all calls to WLog_Init and WLog_Uninit
Since the calls are no longer required remove their usage.
2018-04-03 13:06:41 +02:00
Armin Novak 2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
Armin Novak 4dd0ccd703 Added argument checks. 2018-01-08 13:21:00 +01:00
Armin Novak 674fae5ce6 Refactored function visibility. 2018-01-08 13:17:49 +01:00
David Fort 158840429d micro code style changes 2017-12-23 10:26:25 +01:00
Armin Novak 523a881663 Channels with a context must free it themselves. 2017-07-28 08:39:51 +02:00
Armin Novak 8b9e3fa51e Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
weizhenwei 3b52a60d31 remove useless NULL pointer check before free 2017-06-23 09:21:16 +08:00
weizhenwei 61b24bf0b3 add NULL pointer check and set freed pointers to NULL afterward 2017-06-22 17:53:51 +08:00
weizhenwei fa1c65b656 refactor to remove duplicate code and replace free+malloc with realloc 2017-06-22 10:21:20 +08:00
weizhenwei 2d56e22e9e refactor on redundant code copy 2017-06-21 22:07:07 +08:00
weizhenwei bcd8ddef59 fix compile error on win64.vs2010 platform 2017-06-21 15:43:41 +08:00
weizhenwei 46b841be13 fix memory leak on rail_virtual_channel_event_data_received() -> StreamNew() 2017-06-21 15:26:28 +08:00
weizhenwei 7e5b766f78 fix memory leak at rail_client_execute() 2017-06-21 15:26:28 +08:00
weizhenwei ccdaf15a75 fix memroy leak on rail_recv_exec_result_order() execResult 2017-06-21 15:26:27 +08:00
Armin Novak b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Armin Novak 9f19da798c Added attach/detach support for channels. 2016-12-19 17:07:01 +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
Martin Haimberger 7fe28a8a78 virtualChannel: removed static variable usage from
VirtualChannelApi
2016-11-23 04:17:56 -08:00
Martin Haimberger 5c4fb88a58 rail: using new VirtualChannelEx api 2016-11-23 01:24:57 -08: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 9f5da483dc Reformatted files touched in last 2 commits. 2016-10-06 13:43:12 +02:00
Armin Novak 64590e7e89 Set pEntryPointsEx->ppInterface NULL on error. 2016-10-06 13:43:12 +02:00
Armin Novak 88a3b8dd76 Initializing channel context in each thread. 2016-10-06 13:43:12 +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
Armin Novak 2dbc1a0b87 Reverted WTS API changes. 2016-03-14 13:19:08 +01:00
Armin Novak 36cbf1b583 Fixed error handling for channel load failures. 2016-03-14 13:13:43 +01:00
Bernhard Miklautz 6fa3608111 cleanup cmake exports and pkg-config files
With this commit the "exported" components (usable with pkg-config and
cmake find module package)
* winpr - winpr library and headers
* freerdp - core library and headers
* freerdp-client - client specific library
* freerdp-server - server specific library
* rdtk - rdtk headers and library

To allow the installation of multiple different version (different major
number) the include files were moved into the respective sub folder:
freerdp -> freerdp{MAJOR}/freerdp (currently freerdp2/freerdp/)
winpr -> winpr{MAJOR}/winpr (currently winrp1/winpr/)
rdtk -> rdpk{MAJOR}/rdtk (currently rdtk0/rdtk/

The generated pkg-config and cmake find modules now also include the major
version number. Currently the following pkg-config are generated and
installed.
* winpr1
* freerdp2
* freerdp-server2
* freerdp-client2
* rdtk0

As cmake is able to handle multiple versions out of the box the
following can be used to find a specific module:

find_package(WinPR)
find_package(FreeRDP)
find_package(FreeRDP-Server)
find_package(FreeRDP-Client)
find_package(RdTk)

As cmake doesn't automatically resolve dependencies for packages it is
necessary to manually include the requirements. For example if
FreeRDP-Client is required WinPR and FreeRDP need to be included
(find_package) as well.

This commit also fixes the installation when STATIC_CHANNELS are built.
WITH STATIC_CHANNELS all channels are linked into libfreerdp-client, for
this all channels are generated as linker archive and linked together in
the final step. Before the intermediate linker archives were, although
not required and useful, installed. Same applies for server side
channels.
2016-01-12 17:32:33 +01:00
Armin Novak cb958ba9c6 Added pdb files to package target.
Fixed name collision with freerdp-shadow targets.
2015-12-15 12:07:21 +01:00
Martin Haimberger 52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Martin Haimberger 65fd259610 misc fixes:
fixed all bugs from the review
checking all WaitFor*Object/s calls
2015-07-30 06:49:21 -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
Martin Haimberger 6e4e1c2773 Merge remote-tracking branch 'upstream/master' into mh-stream-fix
Conflicts:
	client/Windows/wf_cliprdr.c
2015-06-18 03:06:40 -07:00
Martin Haimberger d7636d0e28 channel rail hardend 2015-06-18 03:04:32 -07:00
David FORT 12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
David FORT 6fb3f390a0 Fixed functions that return BOOLs 2015-05-19 13:48:57 +02:00
Hardening f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Norbert Federa 1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Zhang Zhaolong e675a41705 rail: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 11:17:52 +08:00
Armin Novak cadd2675f6 Fixed variable initialisation and cleanup. 2015-01-20 12:31:30 +01:00
Armin Novak bbacca6db2 Added CHANNEL_EVENT_DISCONNECTED handling.
Additional error checks and logging.
2015-01-20 11:55:50 +01:00
Marc-André Moreau 27a8e50e60 channels: fix drdynvc, patch memory leaks 2014-12-27 15:20:29 -05:00
Marc-André Moreau f7e52c5e09 channels/rail: remove dependency on svc_plugin.c 2014-11-12 10:43:02 -05:00
Marc-André Moreau 589c21d819 libfreerdp-utils: remove rail utils 2014-11-12 10:18:53 -05:00
Marc-André Moreau 68c9e68400 channels/rail: remove dependency on deprecated eventing system 2014-11-12 09:46:04 -05:00
Marc-André Moreau b2f7c488ab xfreerdp: cleanup and fix RemoteApp 2014-11-11 16:35:30 -05:00
Armin Novak 059374457d Removed library prefix override. 2014-09-17 11:27:11 +02:00
Armin Novak b1e9ffb655 Using wlog for channel logging now.
Fixed compiler warnings and broken callback in urbdrc.
2014-09-15 08:48:46 +02:00
Bernhard Miklautz 0313ca3622 libfreerdp: always build "MONOLITHIC"
"libfreerdp" consisted of multiple (small) single libraries. If the cmake
option MONOLITHIC was used only one library was build combining all of
the libfreerdp-* libraries.
The only exceptions to this are libfreerdp-server and libfreerdp-client these
are build as separate libraries.

This commit obsoltes non-monolithic builds and makes monolithic builds
the default. The cmake option MONOLITHIC is also removed.
2014-09-12 00:19:53 +02:00
Armin Novak 66b8905ac6 Using special log defines for channels now. 2014-08-11 09:12:01 +02:00
Armin Novak b252009d36 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:49 +02:00
Marc-André Moreau 53639dea0b channels: reduce dependency on svc_plugin.h 2014-06-11 15:09:28 -04:00
Armin Novak 15ce8c0552 Updated plugins to use new svc_plugin and OnDataReceived API. 2014-06-11 14:42:32 +02:00
Zhang Zhaolong 69296ce3bd wfreerdp: build fix. 2014-03-04 13:54:25 +08:00
Marc-André Moreau 82b922a70d channels: rename custom CHANNEL_ENTRY_POINTS_EX to CHANNEL_ENTRY_POINTS_FREERDP to fix conflict 2014-02-16 17:38:59 -05:00
Marc-André Moreau 5ff847a6e6 wfreerdp: fix multiple warnings 2014-02-10 01:06:11 -05:00
Marc-André Moreau 4d6f3b6de4 libfreerdp-client: fix bug in pInterface channel registration 2013-12-05 16:55:28 -05:00
Marc-André Moreau 37450da55d cmake: fix exporting of targets on pre-2.8.11 2013-10-29 14:47:40 -04:00
Marc-André Moreau 55565e056c freerdp: export targets 2013-10-28 23:06:39 -04:00
Marc-André Moreau 3cd5652c7d libfreerdp-core: fix asynchronous queueing of RemoteApp messages 2013-10-22 16:28:23 -04:00
Marc-André Moreau 1a9f86738b channels/rail: improve callback interface 2013-10-20 21:59:03 -04:00