Commit Graph

903 Commits

Author SHA1 Message Date
akallabeth
3115c1e28d Merge pull request #3783 from chipitsine/master
fix several defects found by cppcheck
2017-02-20 13:07:12 +01:00
Martin Fleisz
c325ec5325 Merge pull request #3780 from akallabeth/win_compile_fix
Win compile fix
2017-02-17 13:22:51 +01:00
Ilya Shipitsin
0673bddf63 resolve trivial issues found by cppcheck
[server/shadow/X11/x11_shadow.c:511]: (error) Uninitialized variable: x
[server/shadow/X11/x11_shadow.c:512]: (error) Uninitialized variable: y
2017-02-17 17:21:18 +05:00
Armin Novak
f8d22c00d6 Fixed compiler warnings and uninitialized data. 2017-02-17 11:17:45 +01:00
Ilya Shipitsin
251727586d resolve a typo found by cppcheck
[server/Windows/wf_mirage.c:319]: (error) Invalid number of character '(' when these macros are defined: ''.
[server/Windows/wf_mirage.c:319]: (error) Invalid number of character '(' when these macros are defined: 'DFMIRAGE_LEAN'.
[server/Windows/wf_mirage.c:319]: (error) Invalid number of character '(' when these macros are defined: '_WIN64'.
2017-02-17 14:54:31 +05:00
Abhineet-Ayan-Verma
999cc22cdd Fixed undefined behavior in wf_peer_main_loop function
Undefined behavior on "wfPeerContext *context", as it is accessed before being initialized or assigned. Fixed.
2017-02-15 15:56:44 +05:30
Martin Fleisz
c2eacd3b31 Build: Use correct pdb names when installing with symbols 2017-01-31 13:32:51 +01:00
Ilya Shipitsin
12f5368819 make cppcheck even more happier:
[channels/tsmf/client/gstreamer/tsmf_X11.c:317] -> [channels/tsmf/client/gstreamer/tsmf_X11.c:322]: (warning) Either the condition '!decoder' is redundant or there is possible null pointer dereference: decoder.
[channels/tsmf/client/gstreamer/tsmf_X11.c:470] -> [channels/tsmf/client/gstreamer/tsmf_X11.c:475]: (warning) Either the condition '!decoder' is redundant or there is possible null pointer dereference: decoder.
[channels/tsmf/client/gstreamer/tsmf_X11.c:472] -> [channels/tsmf/client/gstreamer/tsmf_X11.c:475]: (warning) Either the condition '!decoder' is redundant or there is possible null pointer dereference: decoder.
[channels/tsmf/client/tsmf_media.c:179] -> [channels/tsmf/client/tsmf_media.c:181]: (warning) Either the condition '!stream' is redundant or there is possible null pointer dereference: stream.
[client/Windows/wf_cliprdr.c:2219] -> [client/Windows/wf_cliprdr.c:2222]: (warning) Either the condition '!formatDataResponse' is redundant or there is possible null pointer dereference: formatDataResponse
[client/Windows/wf_cliprdr.c:2445] -> [client/Windows/wf_cliprdr.c:2448]: (warning) Either the condition '!fileContentsResponse' is redundant or there is possible null pointer dereference: fileContentsResponse.
[client/X11/xf_cliprdr.c:911] -> [client/X11/xf_cliprdr.c:913]: (warning) Either the condition '!clipboard' is redundant or there is possible null pointer dereference: clipboard.
[client/X11/xf_graphics.c:504] -> [client/X11/xf_graphics.c:506]: (warning) Either the condition '!xfc' is redundant or there is possible null pointer dereference: xfc.
[libfreerdp/core/transport.c:861] -> [libfreerdp/core/transport.c:863]: (warning) Either the condition '!transport' is redundant or there is possible null pointer dereference: transport.
[server/shadow/shadow_server.c:777] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:778] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:779] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:781] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:782] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:783] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:784] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:785] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:787] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
[server/shadow/shadow_server.c:789] -> [server/shadow/shadow_server.c:791]: (warning) Either the condition '!server' is redundant or there is possible null pointer dereference: server.
2017-01-26 14:44:19 +05:00
Ilya Shipitsin
102913e808 make cppcheck a bit happier:
[channels/printer/client/printer_cups.c:103]: (error) Resource leak: fp
[server/Mac/mf_event.c:195]: (error) Memory leak: event_queue
[server/shadow/shadow_capture.c:233]: (error) Memory leak: capture
[winpr/libwinpr/sspi/test/TestSchannel.c:440]: (error) Memory leak: lpTokenIn
[winpr/libwinpr/thread/argv.c:198]: (error) Memory leak: lpEscapedChars
[winpr/libwinpr/utils/sam.c:312]: (error) Memory leak: entry
2017-01-25 17:09:25 +05:00
Bernhard Miklautz
f37e9a0adc Merge pull request #3664 from realjiangms/fix_gfx_ack
Server/shadow: Fix handling for gfx acknowledge according to spec
2017-01-23 13:49:25 +01:00
Bernhard Miklautz
2a6bac64ae Fix typos in man pages. 2017-01-17 13:25:47 +01:00
Bernhard Miklautz
d817469b78 Install man pages
* man pages are only build/installed if WITH_MANPAGES is enabled
* create a new cmake function install_freerdp_man to unified install man
  pages
* install all man pages using the new function
* update the nightly packages accordingly
2017-01-16 11:34:32 +01:00
Bernhard Miklautz
38e0bce772 shadow-cli: add initial man page 2017-01-16 11:11:59 +01:00
Bernhard Miklautz
d98f11705e shadow server: add more error messages 2017-01-16 11:11:59 +01:00
Bernhard Miklautz
bbb6bf6b43 Include major version number in library names
Currently it is not possible to cleanly install multiple major version
of FreeRDP concurrently as some of the development libraries (.so files)
files can conflict.

This change renames all libraries to include the major version number in
the library name to fix this limitation.

The list of changed libraries:

libwinpr-tools.so -> libwinpr-tools2.so
libwinpr.so -> libwinpr2.so
libfreerdp.so -> libfreerdp2.so
libfreerdp-client.so -> libfreerdp-client2.so
libfreerdp-shadow.so -> libfreerdp-shadow2.so
libfreerdp-server.so ->  libfreerdp-server2.so
libfreerdp-shadow-subsystem.so -> libfreerdp-shadow-subsystem2.so
libuwac.so -> libuwac0.so

As the library names have changed, projects that use FreeRDP will need to
update their dependencies. -
If pkg-config or cmake find modules are used, reconfiguration might be
sufficient.

Fixes #3460
2017-01-16 11:11:58 +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
zihao.jiang
25381a2984 Server/shadow: Fix handling for gfx acknowledge according to spec:
[MS-RDPEGFX]:
3.2.5.13  Processing an RDPGFX_FRAME_ACKNOWLEDGE_PDU message
If the queueDepth field is less than 0xFFFFFFFF, the server MUST expect that
RDPGFX_FRAME_ACKNOWLEDGE_PDU messages will continue to be sent by the client.
Furthermore, if the queueDepth field is in the range 0x00000001 to 0xFFFFFFFE the server SHOULD
use this value to determine how far the client is lagging in terms of graphics decoding and then
attempt to throttle the graphics frame rate accordingly.
If the queueDepth field is set to SUSPEND_FRAME_ACKNOWLEDGEMENT (0xFFFFFFFF), the server
MUST clear the Unacknowledged Frames (section 3.2.1.2) ADM element and MUST NOT expect any
further RDPGFX_FRAME_ACKNOWLEDGE_PDU messages from the client. In this mode, the server
MUST NOT wait or block on unacknowledged frames (as the
RDPGFX_FRAME_ACKNOWLEDGE_PDU message is not sent by the client) and MUST assume that
the client is able to decode graphics data at a rate faster than it is receiving frames.

On the other hand, RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU SHOULD only be used for informational and debugging
purposes and should not be taken into account.
2016-12-10 02:53:21 +08:00
Norbert Federa
c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
zihao.jiang
ddc326d6d3 Fix server side code to be aware of rereadEvent 2016-10-27 23:43:09 +08:00
David Fort
043243f43c Merge pull request #3560 from akallabeth/gfx_10_2
Gfx 10.2 caps and deactivate GDI unsupported functions
2016-10-21 09:29:51 +02:00
akallabeth
a6f41176fc Merge pull request #3364 from hardening/limit_frames
Limit the time passed in transport check loop
2016-10-20 12:53:23 +02:00
Armin Novak
39b624a211 GFX: support 10.2 stack. 2016-10-16 10:42:46 +02:00
David Fort
f92860de87 Applied astyle formatting 2016-10-14 15:12:48 +02:00
David Fort
5b080359a9 sample-server: add a "local only" option to just listen on an UNIX socket
This makes things nicer for tests that don't need internet access.
2016-10-14 15:12:48 +02:00
Armin Novak
8ef1808191 Adjusted non X11 implementations. 2016-10-14 12:50:04 +02:00
Armin Novak
9c50e1a635 Replaced _VF formats with copy flags. 2016-10-14 10:36:52 +02:00
akallabeth
9adc13297b Merge pull request #3497 from realjiangms/fix_gfx_win10
server/shadow: Fix black screen with win10 mstsc
2016-10-14 10:12:27 +02:00
zihao.jiang
3fb92ae2ec server/shadow: Fix black screen with win10
Request full screen update on RDPGFX_CAPS_ADVERTISE_PDU. Win10 client seems to clean the screen after gfx channel opened. If there happens to be no screen update from server, we will get black screen in mstsc client.
2016-10-11 13:25:07 +08:00
Armin Novak
cf2ec62d59 Reformatted file. 2016-10-10 12:10:29 +02:00
Armin Novak
bc39f28a95 Fixed regression from rebase. 2016-10-10 12:07:27 +02:00
Armin Novak
649d270ccd Fixed GDI_RGN->null initialization. 2016-10-06 13:43:15 +02:00
Armin Novak
2db04736ac Fixed memory leak. 2016-10-06 13:43:15 +02:00
Armin Novak
9a1c60885c Unified RFX server color format. 2016-10-06 13:43:15 +02:00
Armin Novak
9ab04711fa Fixed shadow server color encoding. 2016-10-06 13:43:12 +02:00
Armin Novak
f2bb83e28d Fixed rebase related issues. 2016-10-06 13:43:11 +02:00
Armin Novak
22ddec810b Moved pre and post channel hooks. 2016-10-06 13:43:10 +02:00
Armin Novak
44b8756617 Warning fixes. 2016-10-06 13:43:10 +02:00
Armin Novak
35bf9e6731 Fixed missing mac server symbols. 2016-10-06 13:43:10 +02:00
Armin Novak
0c551808a3 Fixed gdi_init for windows server. 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
016f3a408b xxx. 2016-10-06 13:42:59 +02:00
Armin Novak
df35c135d1 Fixed color conversion, unified GFX and updated API. 2016-10-06 13:42:58 +02:00
zihao.jiang
2c00240a17 server/shadow: Fix regression with rdp8.0
Shadow server crash with rdp8.0 with gfx enabled.
Root Cause: rdp8.0 is not support in shadow gfx and rdpgfx_caps_advertise returns an error. However setChannelError crashs because context->errorDescription is NULL
1. Fix shadow gfx to handle rdp8.0
2. Initialize context->errorDescription for server side new-context
2016-08-29 02:50:09 +08:00
zihao.jiang
92ca9851d2 rdpgfx/server: Fix for windows10 clients
1. Fix order of gfx reset and new-surface. Windows10 client will show black screen with this issue(FreeRDP itself is dramatically immune to this issue)
2. Handle RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU for FPS control
2016-08-21 01:59:40 +08:00
zihao.jiang
5d4e9a2c87 rdpgfx/server: More minor fix 2016-08-20 01:36:37 +08:00
zihao.jiang
a15b8fff66 rdpgfx/server: Minor fix: allow configurable codec parameter 2016-08-07 20:15:39 +08:00
zihao.jiang
2b6bd2626d rdpgfx: various fixes according to comments
1. Fix stream leak in rdpgfx
2. Make src data const in zgfx. Harden zgfx to be independent to byte order
3. Fix written bytes return value in channel write
4. Add check for return value in shadow_client.c
5. Add gfx callback to send surface command with frame marker pdu.
6. Check remain length for recv subroutine
7. Fix compile errors
2016-08-07 20:15:39 +08:00
zihao.jiang
746a754244 rdpgfx: Implementation for server side channel
server/shadow: support h264 codec with gfx channel
2016-08-07 20:14:33 +08:00
Marc-André Moreau
14cb6d33c6 freerdp: make modifications to NLA server-side fixes according to PR comments 2016-07-22 09:06:07 -04:00
Marc-André Moreau
801dc0f826 freerdp: add configurable NTLM SAM file option for server-side NLA 2016-07-21 18:58:24 -04:00
Marc-André Moreau
1ffbd774e9 freerdp: fix sending of TLS alert on NLA failure, add better handling of server-side NLA in shadow server 2016-07-21 17:53:20 -04:00
Bernhard Miklautz
9daf129c63 Merge pull request #3371 from realjiangms/fix_x11_shadow_race
Server/shadow: Protect X operations on shared subystem X11 display with X11 display lock
2016-05-30 19:25:20 +02:00
zihao.jiang
42279834bb Server/shadow: Protect X operations on shared subystem X11 display with X11 display lock 2016-05-26 00:20:37 +08:00
Bernhard Miklautz
17c125d986 Merge pull request #3369 from realjiangms/fix_mouseback_2796
Server/shadow: Fix issue 2796. Mouse cursor draw back issue
2016-05-25 17:25:07 +02:00
zihao.jiang
9f4465ebbc Server/shadow: Fix issue 2796. Mouse cursor draw back issue 2016-05-25 23:08:36 +08:00
akallabeth
cf127ebfb9 Merge pull request #3357 from realjiangms/fix_rdpsnd_race
shadow/rdpsnd: Fix race condition in rdpsnd channel server.
2016-05-23 16:21:49 +02:00
zihao.jiang
444b678e71 shadow/rdpsnd: Fix race condition in rdpsnd channel server. The output buffer and format parameters are not protected. This cause some data inconsistence if rdpsnd has own thread 2016-05-22 22:13:32 +08:00
rinov
c42edd9260 Update mf_mountain_lion.c
Remove duplicate return statement in mf_mlion_stop_getting_screen_updates()
This change is no impact anywhere.
2016-05-20 01:17:49 +09:00
Armin Novak
eacf2b542e Fixed memory leaks. 2016-05-12 10:01:30 +02:00
Bernhard Miklautz
59fbfdb24b Add library libwinpr-tools
libwinpr-tools is a replacement for winpr-makecert-tool.a. Currently
it's basically the same as winpr-makecert-tool.a but in future
functionality that doesn't fit directly in winpr will be added here.
2016-05-03 14:42:08 +02:00
Bernhard Miklautz
783807229d build: add missing dependencies
Add all missing dependencies found with --no-undefined. Since
dependencies aren't exported anymore (if not required) it is no necessary
to explicitly list all required libraries.
2016-04-07 15:10:00 +02:00
Bernhard Miklautz
9e8c6c99b6 First shot on fixing over linking
If a target is linked against libraries with cmake
(target_link_libraries) and the libraries are not marked as PRIVATE
they are "exported" and in case a other target is linked against this
target it is also linked against *all* (not private) libraries.

Without declaring private libraries PRIVATE a lot of over linking
(linking against unneeded libraries) was done.
2016-03-29 18:14:34 +02:00
Armin Novak
36cbf1b583 Fixed error handling for channel load failures. 2016-03-14 13:13:43 +01:00
Martin Fleisz
66ae3f2c77 Merge pull request #3177 from akallabeth/codec_reset_fix
Fixed codec reset, now resetting resolution too.
2016-03-11 11:22:59 +01:00
Norbert Federa
ef4b29e5b3 ConvertFromUnicode fixes and misc hardening
- Added missing ConvertFromUnicode checks
- If ConvertToUnicode allocates memory, guarantee the null termination
  similar to ConvertFromUnicode's implementation
- Fixed some TestUnicodeConversion.c CTest return values
- Added some CTests for ConvertFromUnicode and ConvertToUnicode
- Misc code and protocol hardening fixes in the surrounding code regions
  that have been touched
2016-03-03 16:56:19 +01:00
Jakub Adam
9f0b14f8bd shadow/subsystem: fix pkgconfig file
Add freerdp-shadow-subsystem to 'libs' in order to avoid undefined
reference to shadow_subsystem_set_entry_builtin at runtime.

Remove cyclic dependency on itself.
2016-03-02 14:58:12 +01:00
Armin Novak
ce8f3f2539 Fixed context reset of sample server. 2016-03-02 14:46:33 +01:00
Armin Novak
09e957f717 Fixed broken check. 2016-03-02 14:46:33 +01:00
Armin Novak
2e110c7f35 Fixed codec reset, now resetting resolution too.
H264 and others require the surface resolution to work properly.
This initializes the codecs and the resolution on reset.
2016-03-02 14:46:33 +01:00
Bernhard Miklautz
e02af8287e Merge pull request #3160 from akallabeth/stream_fixes
Stream fixes
2016-03-01 16:44:19 +01:00
Norbert Federa
b4b8239bf6 Merge pull request #3176 from bmiklautz/shadow_subsystem
Export shadow subsystem
2016-02-29 17:39:18 +01:00
Bernhard Miklautz
25506348d0 Merge pull request #3168 from akallabeth/visibility_fixes
Fixed default visibility.
2016-02-29 16:59:58 +01:00
Bernhard Miklautz
1b926f8740 build: export freerdp-shadow
pkg-config and cmake find package
2016-02-29 16:22:24 +01:00
Bernhard Miklautz
f15c050d1f shadow/subsystem: fix windows build
* add dependency to freerdp-client
* add version information to freerdp-shadow-cli
2016-02-29 16:02:13 +01:00
Armin Novak
c182be093d Removed module.def from build config. 2016-02-29 15:24:07 +01:00
Armin Novak
68c402ac58 Removed windows module.def files.
All symbols exported from libraries are declared
using *_API defines.
2016-02-29 15:18:47 +01:00
Armin Novak
b69047064a Replaced stream manipulation with EnsureCapacity. 2016-02-29 12:54:31 +01:00
zihao.jiang
176ad52bd5 server/shadow: Export API to set built-in subsystem modules for freerdp-shadow-subsystem 2016-02-28 13:51:19 +08:00
Armin Novak
11c442562a Fixed dupliace FREERDP_API declarations. 2016-02-27 11:36:34 +01: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
e79eee2bb1 Fixed Stream API misuse. 2016-02-25 20:01:12 +01:00
Jakub Adam
db44d277df server/shadow: Build libraries for shadow subsystems
Commit 60ae27b0 decoupled subsystem implementations and shadow framework
core by moving subsystem specific code right into freerdp-shadow-cli.
This, however, doesn't allow applications that would like to link
libfreerdp-shadow, in order to embed RDP shadow server, to reuse also
the subsystem module.

3rd party developers now have to either provide their own subsystem code
(copied from FreeRDP sources or written from scratch) or be limited to
usaging freerdp-shadow-cli executable, which doesn't expose all
functions of the shadow server library (e.g. enumeration of available
monitors).

This change moves the shadow subsystem out of the executable into new
freerdp-shadow-subsystem library, which freerdp-shadow-cli and
potentially other applications can link to.
2016-02-23 17:58:41 +01:00
Armin Novak
cbf2892ccc Implemented temporary certificate accept.
Certificates can now be accepted temporarily.
The callbacks for certificate validation have been
modified to extend the information presented to the user.
2016-02-05 02:04:57 +01:00
Norbert Federa
24a2f2ad8d appropriate names in server & client cmake exports 2016-02-03 13:37:35 +01:00
Armin Novak
96bf6fc89e Fixed inverted check. 2016-02-03 12:46:02 +01:00
Armin Novak
c2d2ead7d1 Fixed error check. 2016-02-03 11:43:01 +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
Bernhard Miklautz
25363c05d6 update .gitignore files
* add missing entries
2016-01-12 17:32:32 +01:00
zihao.jiang
60ae27b00a server/shadow: Completely decouple subsystem implementations and shadow framework internal details.
It will be completely possible to implement subsystem with only include/freerdp/server/shadow.h and libfreerdp-shadow.

Details as following:
1. Exported surface structure as subsystem implementations deeply depend on it to send image update
2. Export capture APIs. They are actually indepent APIs to help compare and calculate image difference.
3. Introduce API to trigger client frame update. Conceal details in subsystem->updateEvent
4. Pass client to client callbacks. Subsystem implementation may need to know 'which client' send the interaction event as well as the authentication request.
Add this support in callback definition before anyone really use shadow framework APIs to implement a custom subsystem.
Also added callback for client capability exchange
5. Remove X11_ShadowSubsystem Mac_ShadowSubsystem Win_ShadowSubsystem from libfreerdp-shadow.
Discard FREERDP_API mark on ShadowSubsystemEntry functions and make them be compiled together with shadow.c in CMakeLists.txt.
This is required from PR #2751.
Now subsystem implementations and shadow.c could be regarded as an example for shadow framework.
2016-01-01 03:13:52 +08:00
Armin Novak
6ed43cd6ec Updated pdb file locations.
Now supporting generators NMake and Visual Studio.
2015-12-15 12:08:35 +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
Hardening
7b5051c873 Merge pull request #2913 from realjiangms/shadow_fix_align
Server/Shadow: Fix invalid ALIGN in shadow_client_send_bitmap_update
2015-12-14 17:21:58 +01:00
Bernhard Miklautz
d73c4898c1 Add build-config.h
build-config.h should contain configure/compile time settings that are
relevant for projects that use FreeRDP.

For example the compiled in plugin search paths.
2015-11-09 15:54:22 +01:00
zihao.jiang
50e5837c0f Server/Shadow: Fix Authentication in shadow_client.c.
Currently if username or password is not set, the authentication is always failed because the authentication callback is never tried.
Fix to always give a chance to try the subsystem authentication callback even if username / password is not set.
2015-10-05 22:34:58 +08:00
zihao.jiang
86a3b30d25 Server/Shadow: Fix invalid ALIGN in shadow_client_send_bitmap_update 2015-10-05 22:33:38 +08:00
Martin Fleisz
affe82cae8 Merge pull request #2890 from realjiangms/shadow_fix_memory_leak
server: Fix several memory leak found while running valgrind on freerdp-shadow
2015-09-17 10:33:43 +02:00
zihao.jiang
f21749ac07 server: Fix several memory leak while running valgrind on freerdp-shadow 2015-09-17 01:02:22 +08:00
Armin Novak
2a6318b8c5 Fixed zero length allocation. 2015-09-01 12:25:44 +02:00
Marc-André Moreau
a700d1d02d Merge pull request #2716 from realjiangms/shadow_xor_pointer
server/shadow: Fix alpha pointer message so that it allows pixel with both 'xor' and 'and'
2015-08-27 10:20:18 -04:00
Marc-André Moreau
97c38e7d8c Merge pull request #2739 from realjiangms/shadow_resize
server/shadow: Enhancement regarding the screen and resolution - addresize support and fix subRect feature
2015-08-27 10:19:25 -04:00
Marc-André Moreau
fdac05b967 Merge pull request #2798 from psumbera/master
This array is so big that it eats whole stack for the thread and makes
2015-08-27 10:15:29 -04:00
Martin Haimberger
52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Martin Haimberger
2862109337 Merge remote-tracking branch 'upstream/master' into mh-channel-fix
Conflicts:
	channels/smartcard/client/smartcard_main.c
	channels/smartcard/client/smartcard_operations.c
2015-07-30 07:29:12 -07:00
Petr Sumbera
903e484fed Removes unused (big big) array. Adds ifdef for debug stuff. 2015-07-22 08:51:09 -07:00
Petr Sumbera
24ff3f256d This array is so big that it eats whole stack for the thread and makes
the process dump core on some systems (e.g. Solaris).
2015-07-21 09:26:21 -07:00
Bernhard Miklautz
bfdf025e88 Merge pull request #2751 from realjiangms/shadow_fix_compile_error_win
server/shadow: Fix compile error on win32.
2015-07-20 17:23:23 +02: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
MartinHaimberger
b06d83ba80 Merge pull request #2766 from akallabeth/snprintf_to_sprintf_s
Replaced snprintf with sprintf_s
2015-07-15 09:47:43 +02:00
Bernhard Miklautz
68e8569110 winpr/synch: remove the dependency on winsock.h
winsock.h pulls in a lot of defines and dependencies that are not
required and partially unwanted in winpr's core (for parts that are not
related to network). In order to get rid of this dependency and have an
independent defines for extended winpr functions the WINPR_FD_* defines
are used internally (and for exposed functions). Where required, like in
WSAEventSelect, the FD_* is mapped to WINPR_FD_*.
2015-07-14 11:39:41 +02:00
Armin Novak
cf9f975341 Replaced snprintf with sprintf_s 2015-07-03 13:26:15 +02:00
Armin Novak
40a7f2c995 Added missing include breaking windows build. 2015-07-03 12:46:28 +02:00
MartinHaimberger
282f15795d Merge pull request #2762 from akallabeth/handle_write_event
Add write event support to HANDLE
2015-07-03 11:36:00 +02:00
Armin Novak
82da97e606 Updated sample server.
* Added new command line argument --port to allow starting the
  sample server on a port different than default 3389.
* Using GetKnownSubPath now to determine location of temporary
  directory for server socket.
* Using distinct server socket files for each port.
2015-07-03 10:04:24 +02:00
Armin Novak
d18b0fbeb4 Handle API updated. 2015-07-03 09:52:52 +02:00
zihao.jiang
491978b0e3 server/shadow: Enhancement regarding the screen and resolution - add resize support and fix subRect feature
Detail fixes:
1. Add resize support in shadow framework layer
2. Enhance X11 implementation to detect desktop resolution change
3. Fix the subRect feature.
It seems not completely finished and it looks incompatible in different source code.
Fix it to be consistent in all source code as following:
a. The subRect is only awared in framework layer, subsystem implementation should not be aware of it. It only take effect at shadow_client and corresponding shadow_input.
b. The screen and surface should only represent a monitor screen. They don't need to consider subRect feature.
4. A lobby should be alternative image shown to client when the client is not 'mayView'.
We don't need to have seperate lobby for each client, move it into server structure as 'another surface'
5. Fix display handle leak in enum monitor of X11
6. Suppress BadMatch Error while capturing the image
2015-07-01 23:57:20 +08:00
Norbert Federa
1c43a6e115 Merge pull request #2738 from bmiklautz/ffuncs
hardening: check fread and fwrite return values
2015-07-01 13:02:32 +02:00
Bernhard Miklautz
798df32fd9 Integrate pull request feedback
* unify fwrite usage - set nmemb to 1 and the size to the size to write.
2015-07-01 12:22:32 +02:00
zihao.jiang
7a59f09ecf server/shadow: Fix compile error on win32. 2015-07-01 01:36:23 +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
zihao.jiang
2673a77905 server/shadow: Fix alpha pointer message so that it allows pixel with both 'xor' and 'and'.
Integrate idea from @bmiklautz: make convert_alpha_pointer_data function as common
2015-06-28 22:16:29 +08:00
zihao.jiang
457413727f server/shadow: Fix alpha pointer message so that it allows pixel with both 'xor' and 'and'.
Original pointer alpha update message is too specific for x11 implementation.
It doesn't allow pointer alpha mask with both 'xor' color and 'and' mask, e.g.: the 'edit' pointer in windows text box.

1. Move shadow_client_convert_alpha_pointer_data to x11 implementation as it is specific for x11.
2. Update message definition to be more generic: to accept 'xor/and' mask directly.
Implementation of subsystem can implement its own way to convert pointer mask data.
3. Fixed fault handling to free the resource allocated.
2015-06-28 22:16:29 +08:00
Bernhard Miklautz
1cee185e3c hardening: check fread and fwrite return values 2015-06-26 20:38:30 +02:00
Armin Novak
e8bfa29bd2 Replaced registry keys with cmake defines. 2015-06-24 14:02:48 +02:00
Martin Fleisz
ccf5ba3194 Merge pull request #2717 from realjiangms/shadow_encoder_fps
server/shadow: shadow encoder related enhancement/fix.
2015-06-24 09:22:55 +02:00
Armin Novak
89eac97d0e Fixed uninitialized value. 2015-06-23 12:09:42 +02:00
zihao.jiang
e00655c3c2 server/shadow: shadow encoder related enhancement/fix.
1. Export fps related API so that subsystem implementation no longer need to know about details in encoder structure.
2. Discard frameList dictionary.
The 'value' in this dictionary is never used and not properly free'ed when client is disconnected.
The dictionary was used to calculate 'inflight' frame count. Once an ACK is received from client, an item in the dictionary is removed.
We then calculate 'inflight' frame by the count of the items in the dictionary.
However, some rdp clients (win7 mstsc) skips frame ACK if it is inactive, ACK of some frame would actually never arrive.
We actually don't need the dictionary. We only need to record the latest acknowledged frame id, and the difference between last sent frame id is the inflight frame count.
3. Minor fix in default fps calculation. encoder->frameAck is wrongly used as integer while it's actually bool flag.
2015-06-23 14:36:53 +08:00
Bernhard Miklautz
06502e6a91 misc: integrate pull request feedback 2015-06-22 19:24:30 +02: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
Marc-André Moreau
d10203c2a2 Merge pull request #2699 from realjiangms/shadow_connect_disconnect
server/shadow: add connect/disconnect anchor in subsystem callback
2015-06-22 09:38:46 -04: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
b9853f87eb channel encomsp hardend 2015-06-18 03:04:32 -07:00
Martin Haimberger
e5d5cd3c94 hardend cliprdr
hardend cliprdr server and client
also updated all callbacks in the server and client
implementations
2015-06-18 03:04:31 -07:00
Martin Haimberger
156f86e487 hardend channel audin 2015-06-18 03:04:31 -07:00
zihao.jiang
2335a307cb server/shadow: integrate comment from @hardening
Return directly at subsystem->ClientConnect
Also change to argument to accept shadow_client instead of freerdp_peer
2015-06-16 00:43:17 +08:00
zihao.jiang
15707363fb server/shadow: Integrate comment from @hardening: use switch to handle different message id. 2015-06-15 23:54:30 +08: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
b169dfd930 server/shadow: add connect/disconnect anchor in subsystem callback
Other implementation of subsystem may want to track connect/disconnect of each client
2015-06-14 22:15: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
Norbert Federa
202a931125 server/shadow: prevent memcopy of NULL area 2015-06-08 16:34:45 +02:00
Norbert Federa
677be4d113 server/shadow: resuscitate shadow server
shadow_client_refresh_rect returned FALSE if the areas parameter
was NULL. It may only do so if the count parameter is > 0.
2015-06-08 15:55:11 +02:00
Marc-André Moreau
608174cba6 Merge pull request #2649 from xhaakon/cross-monitor-subrect
shadow_screen: allow sub-rectangle to span multiple monitors
2015-06-02 09:15:29 -04:00
David FORT
12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Hardening
dbb67cdf7f Merge pull request #2642 from hardening/shadow_fix
Specify to skip compression with remoteFx frames
2015-05-28 22:58:15 +02:00
Jakub Adam
dea741fca9 shadow_screen: allow sub-rectangle to span multiple monitors
When we share a sub-rectangle of our desktop, allow it to span over
multiple monitors. Previously it was possible to export an area larger
than one display, however the contents were always cropped to
the boundaries of the selected monitor and the rest was visible for
the client only as a black area .
2015-05-25 14:19:34 +02:00
Marc-André Moreau
36cb1e6dc9 Merge pull request #2639 from awakecoding/master
WLog, server-side rdpdr, remote assistance, byteswap, etc
2015-05-22 14:30:11 -04:00