Commit Graph

838 Commits

Author SHA1 Message Date
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