Commit Graph

40 Commits

Author SHA1 Message Date
zihao.jiang
f21749ac07 server: Fix several memory leak while running valgrind on freerdp-shadow 2015-09-17 01:02:22 +08:00
zihao.jiang
c7b598bc4d server/shadow: Fix incorrect handle of makecert_context_process.
Also fix another typo for makecert_context_set_output_file_name
2015-06-29 02:16:31 +08:00
David FORT
7c3f8f33ab Fixes for malloc / calloc + other fixes
This patch contains:

* checks for malloc return value + treat callers;
* modified malloc() + ZeroMemory() to calloc();
* misc fixes of micro errors seen during the code audit:
** some invalid checks in gcc.c, also there were some possible
integer overflow. This is interesting because at the end the data are parsed
and freed directly, so it's a vulnerability in some kind of dead code (at least
useless);
** fixed usage of GetComputerNameExA with just one call, when 2 were used
in misc places. According to MSDN GetComputerNameA() is supposed to return
an error when called with NULL;
** there were a bug in the command line parsing of shadow;
** in freerdp_dynamic_channel_collection_add() the size of array was multiplied
by 4 instead of 2 on resize
2015-06-22 19:21:47 +02:00
Bernhard Miklautz
bf73f4e4f1 Fix unchecked strdups
* add missing checks
* adapt function return values where necessary
* add initial test for settings
2015-06-22 19:09:59 +02:00
Marc-André Moreau
750e752d45 Merge pull request #2697 from realjiangms/shadow_audio
Shadow server: fix channel disposal and add audio support. fix message mechanism in client
2015-06-22 09:52:53 -04:00
Marc-André Moreau
82179c7d8b Merge pull request #2698 from realjiangms/shadow_stand_alone
server/shadow: Decouple shadow_subsystem and subsystem implementation detail.
2015-06-22 09:39:17 -04:00
zihao.jiang
131f030e0e server/shadow: Decouple shadow_subsystem and subsystem implementation detail.
Make shadow_subsystem standalone so that others can implement customized shadow server with shadow library.
2015-06-14 22:20:47 +08:00
zihao.jiang
8485d866d4 This is originally to add audio support. Several fixes included:
1. Introduce message queue in shadow client. No longer use subsytem->MsgPipe->out to deliver message to clients.
We used to use subsytem->MsgPipe->out for messages which need to be sent to client. But it's not correct. Only one client would get the message if multiple client exists
This problem make the fix in PR #2643 incomplete.
Introduced reference count based solution to release resource taken by the message.
Also added APIs for client message delivery.
Also fixed msg pipe in subsystem to clean resource when destroyed.
2. Discard unused StopEvent in client. We actually use quit message instead.
3. Enhance disposal of channels.
Free context for remdesk and encomsp channels. The original fix only stop the threads, but doesn't release resource.
Dispose channels earlier. The channels are built on client->vcm. Disposing channels after client->vcm is closed cause unknown behavior.
Original fix is #2644
4. Start to add audio support.
2015-06-14 21:45:52 +08:00
Armin Novak
7403cdc60c Added PathMakePath function. 2015-06-09 13:16:28 +02:00
David FORT
12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Jakub Adam
9e60246a8c Don't dispose shadow server before all clients have disconnected
Ensure all client threads are disconnected before we stop the server
thread and thus make it available for deletion. We do this because
shadow_client_context_free() accesses rdpShadowServer structure, which
we have to keep alive as long as it is needed.

Calling shadow_client_context_free() after shadow_server_stop() and
shadow_server_free() were called may have caused an application crash.
2015-05-22 13:56:57 +02:00
Norbert Federa
82843f0700 server/shadow: added missing error message 2015-05-07 17:42:01 +02:00
Norbert Federa
f9f59cd29b Fix unchecked CreateDirectory calls 2015-05-07 13:28:13 +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
65a4c6e1fc Changed listener callback arguments and return. 2015-04-21 15:57:25 +02:00
Armin Novak
6e213bc61b Modified GetEventHandles of listener
Now using nCount as in and out argument.
When called, set nCount to the number of available handles.
This value is checked and an error returned, if not enough
handles are available.
2015-04-21 12:09:44 +02:00
Petr Sumbera
17df42e4b5 Fixes some build issues on Solaris 11. 2015-02-02 08:48:54 -08:00
Marc-André Moreau
abd87ace55 rdtk: initial commit 2014-09-29 16:08:08 -04:00
Marc-André Moreau
169a9c83ee shadow: initial font rendering 2014-09-29 14:07:48 -04:00
Marc-André Moreau
6eeace868b shadow: start bitmap font loader 2014-09-28 21:41:12 -04:00
Marc-André Moreau
668aa17a22 shadow: add X11 PAM authentication 2014-09-26 19:03:48 -04:00
Marc-André Moreau
7ef55ab9b7 shadow: improve subsystem structure 2014-09-18 15:43:11 -04:00
Marc-André Moreau
527638c691 shadow: delay subsystem initialization for monitor enumeration 2014-09-18 13:06:49 -04:00
Marc-André Moreau
a77279fb4c shadow: fix and improve config path detection 2014-09-18 10:06:59 -04:00
Marc-André Moreau
e84e7928e3 server/shadow: split into library + executable 2014-09-17 21:18:47 -04:00
Marc-André Moreau
6afd621d4c Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow
Conflicts:
	server/Mac/mf_audin.c
	server/Mac/mf_event.c
	server/Mac/mf_info.c
	server/Mac/mf_mountain_lion.c
	server/Mac/mf_peer.c
	server/Mac/mf_rdpsnd.c
	server/Mac/mfreerdp.c
	server/shadow/CMakeLists.txt
2014-09-17 20:15:01 -04:00
Armin Novak
5b5791c8d7 Using wlog for server now. 2014-09-15 08:55:00 +02:00
Marc-André Moreau
e1e8da9490 shadow: add ability to share rectangle within monitor 2014-09-10 16:27:24 -04:00
Marc-André Moreau
34756850e4 shadow: add ability to select monitor to share 2014-09-10 14:58:14 -04:00
Marc-André Moreau
ca90650336 shadow: fix race conditions 2014-08-15 18:12:53 -04:00
Marc-André Moreau
df146fe70d shadow: fix RDP security 2014-08-15 13:50:22 -04:00
Marc-André Moreau
97cd85803d shadow: initial WDS working setup 2014-08-14 13:10:43 -04:00
Marc-André Moreau
d9d9bf3609 shadow: start detecting invalid regions manually 2014-08-06 17:51:38 -04:00
Marc-André Moreau
9838200068 libfreerdp-core: fix unix domain socket support 2014-08-06 12:08:00 -04:00
Marc-André Moreau
c45ddc783e shadow: improve DXGI 1.2 error checking 2014-07-18 17:26:21 -04:00
Marc-André Moreau
d8b858811f shadow: initial windows server-side connectivity 2014-07-17 21:15:22 -04:00
Marc-André Moreau
a732045c91 wfreerdp-server: restore Win8 DXGI 1.2 support 2014-07-17 18:27:40 -04:00
Marc-André Moreau
58d83c9c1e shadow: stub Mac subsystem 2014-07-15 23:01:56 -04:00
Marc-André Moreau
78520d5141 shadow: add basic server-side encomsp server 2014-07-15 16:34:15 -04:00