Commit Graph

1443 Commits

Author SHA1 Message Date
Armin Novak
72fcbc59d8 Use settings setter 2022-07-06 12:01:23 +02:00
akallabeth
3a6ee1155d Shadow XDamage define guards 2022-07-05 09:37:22 +02:00
akallabeth
cb96e6143d Fixed -Wshadow warnings 2022-06-30 10:49:02 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
b542598834 Fixed function pointer type mismatch 2022-06-23 07:45:55 +02:00
akallabeth
90ce22283d Replaced direct settings access with getter/setter 2022-06-23 07:45:55 +02:00
akallabeth
650a275ceb Added new client callback LoadChannels and freerdp_client_load_channels
Split channel loading from PreConnect as it might be necessary to
reinitialize channels on redirect
2022-06-23 07:45:55 +02:00
akallabeth
03e20cb541 Clean up pcap capture module 2022-06-23 07:45:55 +02:00
fifthdegree
8f7be42540 return check 2022-06-21 10:27:17 +02:00
fifthdegree
eeece1a027 server-side kerberos (and some fixes) 2022-06-21 10:27:17 +02:00
akallabeth
f44554e16d
Added proxy module callbacks for session init and started (#7976) 2022-06-20 13:02:25 +02:00
David Fort
aff8fdac26 proxy: correctly handle dynamic channel fragmentation
This big patch fixes fragmentation handling in the dynamic channel. We used to
have a single state to handle fragmentation at the main dynamic channel level, but
in fact packets can be fragmented per sub channel. So we have to maintain a fragmentation
state per sub channel, this involve treating dynamic and static channels differentely
(so the size of the patch that has to implement state tracking per dynamic channels).
2022-06-17 08:38:57 +02:00
David Fort
cfe80694da proxy: add fixed user/domain/passwd
This adds a User, Domain and Password parameter in the Target section of the configuration
to specify and use a fixed backend user, domain or password (overriding the one
passed by the front user).
2022-06-15 14:05:45 +02:00
akallabeth
1cc06dc3a5 Fixed mac compilation warnings 2022-06-03 08:51:40 +02:00
akallabeth
1aacf504a1 Increase C standard to C11 2022-06-03 08:51:40 +02:00
akallabeth
a0ca2b4a6e Add LTO settings 2022-06-03 08:51:40 +02:00
akallabeth
46ccf6d0d7
Fixed RDPGFX_CAPVERSION_106 according to errata (#7924)
The [MS-RDPEGFX] spec is not really sure which value to use, so we
just announce both, the one from the spec and the one from errata.
2022-05-25 13:11:29 +02:00
akallabeth
2677ca0aaf
Always call HOOK_TYPE_CLIENT_UNINIT_CONNECT in pf_client_thread_proc (#7920) 2022-05-25 09:45:31 +02:00
Armin Novak
40f5578206 Add GFX 10.7 capsets 2022-05-24 10:08:53 +02:00
Martin Fleisz
8a06ed9299 proxy: Reset stream position before length check 2022-05-19 09:23:32 +02:00
Martin Fleisz
ed53038daa proxy: Add handling of server caps when in rdpdr client running state 2022-05-19 09:23:32 +02:00
David Fort
77413f49b2 winpr: rework alignment functions
_align_XXX functions aren't widely available depending on the C runtime. That causes
problems with mingw where we can easily have some runtime mixes (which lead to mysterious
segfaults most of the time). This patch introduce winpr_aligned_XXX functions that will
either use the function available, or use an emulation layer.
2022-05-12 11:36:01 +02:00
Alex Wilson
9591dd1f0d shadow: convert incoming key scancode to DWORD before |= KBDEXT
KBDEXT is 0x100, so if we |= it onto a UINT8 it actually does
nothing, making us interpret all scancodes as if they're
non-extended.
2022-05-05 08:41:09 +02:00
akallabeth
0422cf9892 Fixed invalid argument types 2022-04-29 14:38:41 +02:00
akallabeth
ec699f6c75 scanbuild fixes 2022-04-28 12:37:19 +02:00
akallabeth
667b471686 Fixed cast-quality warnings 2022-04-28 09:17:20 +02:00
akallabeth
fb90ac280a Refactored color.h
* Remove implementations from header
* Rename functions to be FreeRDP specific
* Add deprecation define for old names
* Fixed missing includes
2022-04-28 08:40:47 +02:00
akallabeth
73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
akallabeth
37d0a9e2b7 Assert function pointers in proxy 2022-04-15 12:13:03 +02:00
akallabeth
eda7cf785b Fixed compilation warnings, added some asserts 2022-04-15 09:06:09 +02:00
David Fort
63d0d3e4cf proxy: rework proxy channel treatments for statefull drdynvc
The rework introduce a stateful dynamic channel treatment, so that we can take early decisions
for data packet (dropping all the current packet or pass it), but also reassemble important
packets like channel creation.
2022-04-15 09:06:09 +02:00
akallabeth
752ac3b479
Fix #7793: Do not expose internal input API (#7794)
* Fixed GetFileInformationByHandle initializers

* Fix #7793: Do not expose internal input API

Slow-Path input uses UINT16 for scancodes on wire, but only the
lower byte is actually used. (the extended fields are sent in
keyboardFlags field)
Hide this implementation detail and adjust the API to use UINT8
for the code instead just like the corresponding Fast-Path PDU

* Added a warning for problematic slow path keyCodes
2022-04-13 09:34:05 +02:00
David Fort
a152dec687 proxy: correctly use the RemoteApp flag
The flag was forcing the remoteApp usage when set, while all the other equivalent
flags just enable the feature. This patch fixes that, so now setting RemoteApp = TRUE
just enables the front client to do remoteApps.
2022-04-12 08:05:28 +02:00
Armin Novak
944e14ab82 Fixed mac peer context functions 2022-04-06 10:25:41 +02:00
akallabeth
00adf1a6a0 Fixed leak in shadow_client_logon 2022-03-28 15:52:59 +02:00
akallabeth
54938efc77 Removed function pointer casts 2022-03-28 15:52:32 +02:00
akallabeth
770bc14d18 Cleaned up rdpSettings use in server 2022-03-28 15:52:32 +02:00
akallabeth
14568872a9
Instance cleanup (#7738)
* Cleaned up freerdp::autodetect

* Deprecate freerdp::input

* Deprecated freerdp::update

* Deprecated freerdp::settings

* Deprecated freerdp::autodetect

* Removed rdpTransport::settings

* Deprecated freerdp_per::update|settings|autodetect

* Fixed mac client and server compilation

* Fixed windows compilation

* Added deprecation warnings

* Fixed initialization of structs.

* Fixed android build

* Fixed freerdp_client_context_new const correctness

* Fixed checks for android implementation

Replaced checks with assertions where appropriate

* Fixed checks for windows client

Replaced checks with assertions where appropriate

* Fixed proxy client pointer dereference
2022-03-23 13:18:35 +01:00
akallabeth
a685d90ccd Fixed integer cast warnings 2022-03-18 07:50:54 +01:00
akallabeth
fa59c4b705 Fixed compile warnings 2022-03-18 07:50:54 +01:00
Armin Novak
71aac852d6 Remove async-input from clients 2022-03-08 15:37:19 +01:00
Armin Novak
46e0adda93 Removed HAVE_CONFIG_H uses 2022-03-03 11:26:48 +01:00
Armin Novak
4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak
b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
akallabeth
64f47848c9
Proxy fixes (#7686)
* Fixed a memory leak in server side NLA auth

* Fixed #7675: Pass channel packets directly
2022-03-02 09:13:41 +01:00
Armin Novak
fd027d1bf0 Removed BUILTIN_CHANNELS
Building client channels out of tree does not work reliable as the
dependencies can not be easily split. (exceptions may be simple ones
as echo channel)
It does complicate the build system and code though, so remove this
for maintainability reasons.
2022-02-23 10:43:46 +01:00
Armin Novak
3bb36f4caa Fixed clang-scanbuild warnings 2022-02-22 16:15:05 +01:00
Armin Novak
f03059e718 Extended AINPUT API:
* Each event now has a timestamp
* Relative and absolute events are sent simultaneously
* Added a flag indicating relative events are available
2022-02-22 09:44:13 +01:00
akallabeth
7641710f60 Use a client/common context component
* Allows moving common client code from specific client to a
  generic client/common implementation
2022-02-22 09:44:13 +01:00
akallabeth
c4e14f7fd6 Added Advanced Input Channel support to sample server 2022-02-22 09:44:13 +01:00
Armin Novak
80a352366f Fixed windows shadow warnings 2022-02-18 08:38:28 +01:00
Armin Novak
21d8bab08d Fixed mingw build 2022-02-18 08:38:28 +01:00
Armin Novak
3a609fb920 Fixed mingw build warnings 2022-02-18 08:38:28 +01:00
akallabeth
8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
David Fort
46eb50df2c proxy: improve channel treatment
This PR introduces per channel context so that we can speed up operations like
retrieving the channel name from its id, or knowing what shall be done for a
packet (no config ACL recomputation at each packet).
2022-02-04 08:44:22 +00:00
Armin Novak
cefb4e1237 Use freerdp_settings_set and _strdup 2022-02-02 13:43:31 +00:00
Armin Novak
a40467b3b0 Added Stream_ConstBuffer function 2022-02-01 10:25:37 +00:00
Armin Novak
a403848e61 Fixed const/type warnings 2022-02-01 08:48:21 +01:00
akallabeth
8560803211 Removed BITMAP_UPDATE::count use 2022-01-27 10:52:02 +01:00
Armin Novak
9c7ec3888a Added deprecation to *get_fds functions 2022-01-21 08:59:09 +01:00
akallabeth
724c6f8192
Proxy cleanups (#7568)
* Fixed C++ issues with proxy context

* Added freerdp_settings_get_string_writable

* Define WITH_PROXY_EMULATE_SMARTCARD in config.h
2022-01-20 11:12:36 +01:00
akallabeth
e6e6ed5dbd Cleaned up PubSub
* Callback arguments now const
* Fixed missing includes
2022-01-19 09:24:57 +01:00
Armin Novak
5b2cb753bb Fix access to wrong variable in sample server 2022-01-18 11:24:23 +01:00
Armin Novak
1fedd36f65 Fixed proxy compilation issues after rdpUpdate refactoring 2022-01-18 11:24:23 +01:00
Armin Novak
f1adfb0e5c Added client redirect to proxy demo module 2022-01-11 12:34:43 +01:00
Armin Novak
4e6e5be654 Added proxy intercept channels
* New configuration to intercept certain channels
* Added rdpdr intercept implementation
2022-01-11 12:34:43 +01:00
Armin Novak
fd5ac4eed0 Cleaned up wnd.h includes 2021-12-23 14:27:12 +01:00
akallabeth
88f4e72853 Added WITH_RDTK to disable rdtk build 2021-12-15 13:36:15 +01:00
Armin Novak
41d03143b8 Always call HOOK_TYPE_CLIENT_LOGIN_FAILURE if NLA failed 2021-11-03 11:12:00 +01:00
Armin Novak
149b9bf2cc Fixed StreamStaticInit warnings. 2021-10-18 10:53:05 +02:00
Armin Novak
73fbbcf0fb Fixed const warnings 2021-10-14 13:04:59 +02:00
akallabeth
a4be45dd5d
Fixed proxy to string functions (#7333) 2021-10-07 10:25:59 +02:00
Armin Novak
18a3fcf2fc Updated wStream API and added torough checks
* Do length/capacity checks in every read/write/seek function
  if WINPR_ASSERT is defined.
* Ensure s->pointer is valid, e.g. within s->buffer + s->capacity
  (Stream_Rewind, Stream_Seek, ...)
* Add return values to Stream_Set* functions so inalid arguments
  can be reported to the caller
* Deprecated problematic stream manipulation functions
  (Stream_SetBuffer, Stream_SetPointer, Stream_SetCapacity)
* Ensure length/capacity functions never return a value larger
  than the actual length/capacity
2021-10-06 09:49:07 +02:00
akallabeth
32994b02f5
Fix pf_server_new: pass own copy of proxyConfig (#7328)
* Fix pf_server_new: pass own copy of proxyConfig

The lifecycle of proxyConfig passed to pf_server_new is unknown,
so pass proxyServer->config copy to modules.

* Early free parsed proxyConfig
2021-10-06 09:17:59 +02:00
Alexandru Bagu
7f7bf2d731 Remove passthrough channel name limit 2021-10-05 09:40:53 +02:00
Alexandru Bagu
1f4ae26a6f add missing filter type strings
* fixes crash that happens while debugging the proxy
2021-10-05 09:32:21 +02:00
akallabeth
03a9ca80c8
Refactor proxy (#7312)
* Added hidden transport dump and replay options

* Added settings to enable transport dump and replay
* Added check in freerdp_connect to skip authentication on
  dump replay

* Fixed proxy issues

* Proper shutdown handling
* Uninitialized variables
* Skip proxy-client channels, initialize from peer channels and
  config
* Filter static channels like dynamic ones
* Added proxy module filtering from config data (channels, input, ...)

* Removed oboslete proxy decoding related files

* Added defines for RDPECAM channel

* Added proxy config options:

* VideoRedirection
* CameraRedirection

* Fixed duplicate channel free
2021-09-23 14:52:03 +02:00
akallabeth
e4cd8674d7
Win proxy fix (#7311)
* Do not change warning level for MSVC builds

* Fixed windows PDB paths.
2021-09-22 16:00:00 +02:00
Armin Novak
fceb108fc5 Fixed comments and duplicate checks. 2021-09-20 10:59:59 +02:00
akallabeth
695e38398d Refactored proxy
* Removed unnecessary global data lists
* Improved error handling
* Do not initialize channel code in passthrough mode
2021-09-20 10:59:59 +02:00
akallabeth
4d23bc9372
Added proxy input state sync (#7282)
The proxy server component might receive input related events
before the proxy client has established the connection to the
target machine.
With this change, the current keyboard state is cached and sent
to the target when it is ready. All input events received before
the target is ready are discarded.
2021-09-10 10:39:07 +02:00
Armin Novak
673fb46836 Fixed uninitialized warnings 2021-09-10 08:16:25 +02:00
Armin Novak
0fe1e2359e Fixed all reserved-id-macro warnings 2021-09-10 08:16:25 +02:00
Armin Novak
210c56d0fb Options to specify sfreerdp-server cert and private key 2021-09-10 08:16:25 +02:00
Armin Novak
ba0da04217 Fixed compilation warnings and duplicate defines 2021-09-09 08:53:20 +02:00
Armin Novak
5bd096cfc2 Fixed client context cleanup 2021-09-09 08:53:20 +02:00
Armin Novak
680dc81bad Added dump option for proxy config. 2021-09-09 08:53:20 +02:00
Armin Novak
3afd147bc0 Use wStream in pf_client_receive_channel_data_hook 2021-09-09 08:53:20 +02:00
Armin Novak
4463e5eda9 Added config dump function, improved resource cleanup 2021-09-09 08:53:20 +02:00
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
f7c7211aad Fixed compilation warnings 2021-09-09 08:53:20 +02:00
Armin Novak
4cc0fbca33 Proxy client cleanups
* Use proper maximum handle defines
* Gracefully handle out of memory instead of assert
2021-09-09 08:53:20 +02:00
Armin Novak
4e44003832 Expose dynamic channel PDU types 2021-09-09 08:53:20 +02:00
Armin Novak
5a2231172c Updated copyright for proxy 2021-09-09 08:53:20 +02:00
Armin Novak
976c3c2ab9 Refactored proxy and proxy-modules:
* Split out proxy headers and moved to public API to allow external
  modules to be built.
* Split proxy into proxy library and proxy binary. The library
  can be used by other applications and provides a simple API
* Improved channel passthrough, now all channels including dynamic
  channels work.
* Extended module API to hook more events, improved module samples
* Cleaned up proxy code, removed global static variables used,
  added WINPR_ASSERT
2021-09-09 08:53:20 +02:00
akallabeth
c2f1562a4b Removed freerdp_peer::input 2021-09-09 08:36:01 +02:00
akallabeth
83104fda9c Updated sample-server
* Refactored code to remove global static variables
* Added better error checks and WINPR_ASSERT
2021-09-06 10:11:14 +02:00
Armin Novak
bc9ef8327e Fixed #5382: Remove checked in test certificates
The sample servers did have checked in test certificates.
Remove them and let the user generate them when required.
2021-09-04 18:01:30 +02:00
Armin Novak
737f5a2036 Fixed argument const correctness 2021-08-27 13:21:02 +02:00
Armin Novak
413dcd3c28 Fixed RDPSND_CHANNEL_NAME
RDPSND channel is special, as it has many names.
(e.g. static channel, dynamic channel and UDP one.
Use RDPSND_CHANNEL_NAME to identify the module name instad of
RDPSND_DVC_CHANNEL_NAME
2021-08-25 13:40:47 +02:00
Armin Novak
64d675a728 Fixed warnings in shadow server. 2021-08-25 10:54:24 +02:00
Armin Novak
054f0ea260 Use defines instad of channel names 2021-08-25 10:54:24 +02:00
akallabeth
617293e0d3
Cleanups (#7239)
* Use freerdp_settings_* for shadow and sample server

* Added freerdp_peer_set_local_and_hostname

* Code cleanups and WINPR_ASSERT

* Code cleanups

* Use CHANNEL_NAME_LEN where appropriate
* Use temporary variables in loop instead of direct array access
2021-08-24 14:09:40 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Armin Novak
610396e197 Fixed compilation warnings
Try to get the number of warnings down
2021-08-02 10:28:06 +02:00
Armin Novak
61b46adaf1 Fixed WITH_WINPR_VERBOSE_ASSERT compile flag
* Compile flag was not always set
* Fix broken WINPR_ASSERT usages detected
2021-07-29 15:09:53 +02:00
akallabeth
7dfdd248ee
Monitor coordinates are exclusive (#7145)
* Monitor coordinates are exclusive

* Remove force override of shadow resolution.

The client might ignore the server requested values, in that case
retry
2021-07-07 11:54:01 +02:00
akallabeth
30520ff5e0 Fixed surface width 2021-07-02 09:53:24 +02:00
akallabeth
2ac12c558a Added option to allow planar topdown encoding. 2021-07-02 09:53:24 +02:00
akallabeth
be88fa6705 Fixed surface buffer alignment 2021-07-02 09:53:24 +02:00
akallabeth
645cc8bb69 Use variable surfaceId 2021-07-02 09:53:24 +02:00
akallabeth
2101aadceb Fixed missing assertions and default color depth 2021-07-02 09:53:24 +02:00
akallabeth
5a85a824d2 Used settings getter/setter for NSCodec 2021-07-01 11:56:17 +02:00
akallabeth
6deb65175f Added GFX planar and rfx encoder to shadow 2021-07-01 11:56:17 +02:00
akallabeth
bd256b91bc Fixed disabling of AVC444 mode if requested 2021-07-01 11:56:17 +02:00
akallabeth
4ce3063b16 WINPR_ASSERT shadow client 2021-07-01 11:56:17 +02:00
akallabeth
3ac50697a0 Added RDPGFX_CODECID_UNCOMPRESSED path to shadow 2021-06-30 15:59:07 +02:00
akallabeth
242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
Armin Novak
4622c58332 Added extended shadow support for mouse and unicode 2021-06-29 13:48:14 +02:00
Armin Novak
98ed05ff5c Added PROGRESSIVE codec to shadow 2021-06-28 16:51:27 +02:00
akallabeth
8eff825971 Fixed CMake Targets file for server lib 2021-06-25 10:47:00 +02:00
akallabeth
534d30beb3
No deprecated (#7107)
* Removed cmake options disabling compiler warnings

* Added deprecation compile options

* Fixed android client use of deprecated symbols

* Removed obsolete callback
2021-06-22 14:39:10 +02:00
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
akallabeth
b453d5e40e Fixed rdtk, uwac and winpr standalone builds 2021-06-22 08:54:18 +02:00
Armin Novak
ea78e33d17 server: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
Armin Novak
299c962b28 Fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
5fb59a23a9 Fixed lots of compilation warnings and type mismatches 2021-06-16 15:21:56 +02:00
Armin Novak
1fd72ded43 Fixed compilation warnings 2021-06-16 14:26:06 +02:00
Armin Novak
3042010770 Fixed warnings in sample server 2021-06-16 14:26:06 +02:00
Armin Novak
ccfe0c129e Removed checks already done by WINPR_ASSERT 2021-06-16 11:46:42 +02:00
Armin Novak
216f65336e Fixed HashTable and ArrayList use errors 2021-06-16 11:46:42 +02:00
Armin Novak
d6c84c28fb Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
2021-06-16 11:46:42 +02:00
Armin Novak
a1c8e4cf85 Refactored ArrayList_Add to conform to other functions 2021-06-16 11:46:42 +02:00
Armin Novak
880c603c26 Renamed HashTable_Add to HashTable_Insert
* Since the changes break HashTable_Add rename it so that it will
  not fail silently
2021-06-16 11:46:42 +02:00
Armin Novak
cb642699c8 Modified HashTable API to be opaque
* Reuse wObject function pointers
* Add missing getters/setters
* Clean up return types, const correctness of arguments
2021-06-16 11:46:42 +02:00
Armin Novak
d36d94766e Replaced assert with WINPR_ASSERT 2021-06-14 09:37:07 +02:00
akallabeth
6b36c6d417
Replace fopen and path functions with wrappers (#7043)
Functions like fopen, PathFileExists, PathMakePath need to call
the wide character versions on windows for utf-8 support.
2021-05-31 11:42:03 +02:00
Biswapriyo Nath
c0c9eb5908 Check MINGW32 for duplicate type declaration. 2021-05-25 09:41:44 +02:00
Biswapriyo Nath
37bbf9d218 CMake: Install DLLs in bin folder.
In Win32 platform, executables and runtime libraries need to be in one folder.
2021-05-25 09:41:44 +02:00
Armin Novak
6f2c6625e4 Added FREERDP/WINPR prefix to define GIT_REVISION 2021-05-18 13:37:34 +02:00
Biswapriyo Nath
a3a89a43f7 Fix intialization, remove some unused variables. 2021-04-28 17:11:31 +02:00
Armin Novak
8cd61a01ff Refactored shadow argument parsing
* Remove global struct
* Add logger options
2021-04-16 17:06:27 +02:00
sss
4a2514b58d
reverted olf signature for rfx_context_new 2021-03-30 11:03:15 +03:00
sss
6b76ac9545 Revert "Revert "allow to use in single threaded mode" (#6864)"
This reverts commit f7465af44f.
2021-03-26 11:50:45 +01:00
akallabeth
fd902fb345
Win fixes multiple warnings + YUV decoder crash (#6873)
* Fixed conditional reading of regisrty values.

* Fixed sign warnings

* Removed use of deprecated settings functions

* added missing include

* Removed unused functions.

* Refactored registry reading functions

* Fixed TCHAR preprocessor for printf

* Fixed compilation warnings.

* Added bounding rectangle check for multithreadded yuv decoder

* Ensure yuv step calculation height is always >0

* Deactivate multithreadded YUV decoder until artifacts are fixed.
2021-03-08 12:48:22 +01:00
akallabeth
f7465af44f
Revert "allow to use in single threaded mode" (#6864)
This reverts commit bee2e1526d.
2021-03-05 13:02:38 +01:00
akallabeth
f346793970 Refactored encoder functions to return changed areas 2021-03-01 11:52:07 +01:00
akallabeth
50acf72615 Refactored H264 encoding/decoding
Use YUV primitives now for all H264 operations
2021-03-01 11:52:07 +01:00
sss
6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
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
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
akallabeth
e3445eefab Fixed progressive decoding without subbanddiff 2020-12-15 14:47:05 +01:00
Armin Novak
c20afa3524 Fixed #6646 2020-12-09 12:09:32 +01:00
akallabeth
66dc4cc9ee Fixed compilation warnings. 2020-11-10 08:53:43 +01:00
akallabeth
dc392dea3e Fixed #6560: Missing return value. 2020-11-09 17:24:27 +01:00
akallabeth
6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01:00
akallabeth
f282c55c7a Added clipboard CB_HUGE_FILE_SUPPORT_ENABLED flag 2020-09-29 09:03:49 +02:00
kubistika
5daba89e83 server: proxy: add more info on proxy logs 2020-09-21 14:16:31 +03:00
Kobi Mizrachi
67cfcb0af6 server: proxy: implement external routing 2020-09-18 09:51:12 +02:00
Armin Novak
57de0aebb5 Refactored socket warning fixes to be more readable. 2020-08-10 16:39:19 +02:00
Armin Novak
57b405ca26 Fixed compilation warnings. 2020-08-10 12:14:11 +02:00
Kobi Mizrachi
763f7ae2c8 server: proxy: add extern C for c++ plugins 2020-07-08 11:31:41 +02:00
Kobi Mizrachi
cc9ef8f74e server: proxy: rail: Fix rail handshake flags sync issue at reconnect 2020-07-07 15:31:57 +03:00
Kobi Mizrachi
b2d15eedc9 server: proxy: proxy rdp heartbeats 2020-07-07 09:57:53 +02:00
Kobi Mizrachi
2ae7c2a6d4 server: proxy: fix race issue
Proxy server might receive input updates while client side being
redirected (and reset), then a heap-after-free might occur. To solve
this, we register server input/update callbacks only after client is
fully activated.
2020-07-06 09:14:44 +02:00
Kobi Mizrachi
6e1581443b server: proxy: rename SessionCapture.Enabled -> GFXSettings.DecodeGFX 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
564b784ebc server: proxy: do not start client if post connect hook failed 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
0bf225ec60 server: proxy: capture: send sid in SessionInfo 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
181f2ba846 server: proxy: remove unused struct members 2020-06-22 12:37:53 +02:00
akallabeth
6d86e20e1e Fixed double free 2020-06-22 11:51:38 +02:00
akallabeth
e1e0f965e8 Fixed compilation issue with shadow pam code 2020-06-16 14:02:49 +02:00
Martin Fleisz
67369dad55
Merge pull request #6237 from akallabeth/shadow_surface_lock
Fixed surface locking for shadow server.
2020-06-16 11:28:12 +02:00
akallabeth
a38d6c53a6 Fixed surface locking for shadow server. 2020-06-16 11:18:17 +02:00
Martin Fleisz
5a09e12ec5
Merge pull request #6239 from akallabeth/shadow_auth_log
Improve X11 shadow authentication reason failure log
2020-06-16 11:17:57 +02:00
Kubistika
0cf764f170 server: proxy: cap plugin: fix var and func declaration 2020-06-05 09:22:26 +02:00
Kobi Mizrachi
19809bf338 server: proxy: implement session capture plugin 2020-06-05 09:22:26 +02:00
Kobi Mizrachi
44c50ff1d5 server: proxy: remove old session capture code 2020-06-05 09:22:26 +02:00
akallabeth
e66ee477c0 Improve X11 shadow authentication reason failure log 2020-05-27 11:53:28 +02:00
Kobi Mizrachi
6269243091 server: proxy: print server host ip on new conn (for clustering info) 2020-05-20 10:36:42 +03:00
Kobi Mizrachi
7d48a587d2 server: proxy: prepare for exporting gfx capture to a module 2020-05-20 10:31:51 +03:00
Kobi Mizrachi
715c3f293a server: proxy: vc hook: check if proxy client is not null 2020-05-19 14:43:30 +03:00
Kobi Mizrachi
215e41b4ee server: proxy: config: fix comma separated list parsing 2020-05-19 14:42:59 +03:00
Kobi Mizrachi
9de59051f6 server: proxy: refactor 2020-05-19 14:42:26 +03:00
Kobi Mizrachi
d28ad95fbe server: proxy: use peer load balance info when host is fetched from config 2020-05-12 12:43:08 +02:00
Kobi Mizrachi
de0802a352 server: proxy: Register signal handler after modules finished loading.
This prevents a race where the signal handler free's structs that
modules use while initializing.
2020-05-11 09:11:29 +02:00
Kobi Mizrachi
00c25eada0 server: proxy: print version and buildconfig on startup 2020-05-11 09:11:29 +02:00
Kentaro Hayashi
148f3c675d Fixed typos (Otherweise)
Otherweise ->
Otherw ise
      ^
2020-05-10 16:35:20 +09:00
akallabeth
cbee45aace Fixed clipboard 'called with invalid type' warning 2020-05-06 13:31:57 +02:00
Linus Heckemann
5ce0ab909f
shadow_server: allow specifying IP addresses to listen on (#6050)
* shadow_server: allow specifying IP addresses to listen on

This allows using IPv6 as well as listening only on specific
interfaces. Additionally, it enables listening on local and TCP
sockets simultaneously.

* listener: log address with square brackets

This disambiguates IPv6 addresses.

* shadow_server: check error on each socket binding

* Refactored shadow /bind-address for 2.0 compiatibility.

* Made /ipc-socket and /bind-address incompatible arguments.

* Fixed shadow /bind-address handling and description

* Allow multiple bind addresses for shadow server.

Co-authored-by: akallabeth <akallabeth@posteo.net>
2020-05-05 08:35:19 +02:00
Armin Novak
24bd601f8d Fixed data type warnings 2020-04-11 09:43:14 +02:00
Norbert Federa
e3b3b52f6a server: fix surface command types
- Legacy RemoteFX is encapsulated in a "Stream Surface Bits Command" (CMDTYPE_STREAM_SURFACE_BITS)
- NSCodec is encapsulated in a "Set Surface Bits Command" (CMDTYPE_SET_SURFACE_BITS)

References:
- MS-RDPRFX 3.1.8.3.1 RemoteFX Stream / Encode Message Sequencing
- MS-RDPNSC 2.2.2 NSCodec Compressed Bitmap Stream
2020-04-03 14:35:58 +02:00
akallabeth
88ad9ca56b Fix sending/receiving surface bits command.
* Pass on proper command type to application
* On send let the server implementation decide to send
   2.2.9.2.1 Set Surface Bits Command (TS_SURFCMD_SET_SURF_BITS) or
   2.2.9.2.2 Stream Surface Bits Command (TS_SURFCMD_STREAM_SURF_BITS)
Thanks to @viniciusjarina for tracing the issue down.
2020-04-03 12:00:53 +02:00
Kobi Mizrachi
3b673be378 server: proxy: fix wrong log level used in pf_modules_run_filter 2020-03-12 08:36:05 +01:00
Kobi Mizrachi
1484d0ac48 server: proxy: removed unnecessary cast after #5955 2020-03-12 08:36:05 +01:00
Kobi Mizrachi
73445e1462 server: proxy: use config path from argv if provided 2020-03-12 08:36:05 +01:00
Armin Novak
eca32456bb Removed unused function 2020-03-10 14:04:53 +01:00
Armin Novak
3ba66db99d Unify pReceiveChannelData and psPeerReceiveChannelData
Fix definitions of the two function pointers.
Use and definition did not match, fix that.
Will create warnings in external projects
2020-03-10 12:21:14 +01:00
Armin Novak
d5b5088eac Fixed misinterpretation of SendChannelData
SendChannelData was defined with a return value of type int, but
used as BOOL everywhere. Fix the definition to match use.
2020-03-10 12:21:14 +01:00
Armin Novak
cffbbacccd Default proxy modules to OFF
The proxy module sample is c++ 11 which some older build targets
do not like. Deactivate this by default.
2020-03-09 09:16:41 +01:00
Armin Novak
a6d0b67ca6 Set C++ standard for proxy demo target 2020-03-09 09:03:19 +01:00
Armin Novak
83348ef98f CMake options to compile without proxy or shadow
* Added WITH_SHADOW (default ON) to compile without shadow server
* Added WITH_PROXY (default ON) to compile without proxy server
2020-03-09 08:50:40 +01:00
Armin Novak
d7ba252cd7 Fixed arguments for peer->ReceiveChannelData 2020-03-04 14:52:19 +01:00
Armin Novak
0f729d2b2c Fixed conversion and return checks.
* Fix some missing argument checks for function pointer implementations
* Fix broken return value check for client->SendChannelData
* Updated const correctness for function pointer implementations
2020-03-04 14:44:03 +01:00
Armin Novak
d7da4b7e00 Removed function pointer casts for shadow. 2020-03-03 13:02:22 +01:00
Armin Novak
829497b313 Made CHANNEL_TSMF optional and deprecated. 2020-02-26 13:56:43 +01:00
Kobi Mizrachi
b574876986 server: proxy: client: change ClientFree->ContextFree 2020-02-26 11:47:01 +01:00
Kobi Mizrachi
079871ac65 server: proxy: support static vc passthrough 2020-02-26 11:47:01 +01:00
Armin Novak
436b68e416 Fixed #5895: cast warnings. 2020-02-19 10:21:43 +01:00
Martin Fleisz
e304428a5f
Merge pull request #5857 from akallabeth/scanbuild_fixes
Scanbuild fixes
2020-02-12 10:16:54 +01:00
Kobi Mizrachi
4823f41274 server: proxy: improve logs 2020-02-10 09:37:54 +01:00
Kobi Mizrachi
8c8e5e4239 server: proxy: show indicative log on bind failure. 2020-01-27 07:57:45 +01:00
Armin Novak
5ba7061a18 Fixed type of index variables. 2020-01-23 10:12:12 +01:00
Armin Novak
d67cea9b1a Fixed NULL dereference. 2020-01-23 10:09:23 +01:00
Kobi Mizrachi
18be45eca1 server: proxy: specify which modules to load in config 2020-01-22 14:18:21 +01:00
Kobi Mizrachi
6d3f658983 server: proxy: add an indicative log listener->Open fails. fixes #5850 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
c0cc676a4e server: proxy: pf_client.c: remove unused includes 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
92c3f76809 server: proxy: disconnect all active sessions on shutdown 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
424e73a895 server: proxy: modules_init: create modules dir if not exists 2020-01-21 11:43:13 +01:00
Kobi Mizrachi
9d82f5305a server: proxy: update config.ini 2020-01-21 11:43:13 +01:00
Kobi Mizrachi
ab3a096353 server: proxy: fix race condition when between client thread and server update thread 2020-01-15 11:23:14 +02:00
Kobi Mizrachi
15909af766 server: proxy: fix pf_modules_init 2020-01-14 10:40:49 +01:00
David Fort
0cc3af2282
Merge pull request #5796 from akallabeth/rdp_10_7_large_pointers
Added RDP 10.7 large pointer support
2020-01-14 10:17:13 +01:00
Kobi Mizrachi
e3728c1822 server: proxy: do not compile modules by default 2020-01-14 07:58:47 +01:00
Kobi Mizrachi
706e13c312 server: proxy: shutdown gracefully 2020-01-14 07:58:47 +01:00
Kobi Mizrachi
b2fad50cd3 server: proxy: rewrite modules API
* Add support for C++ plugins.
* Seperate between a "module" and a "plugin": a module is a shared
library that exposes a function called "proxy_module_entry_point". This
function gets a parameter to `proxyPluginsManager*`, which can be used to
register plugins.
* Refine the API of the modules infrastructure:
 * use proxyData* instead of rdpContext* when firing a hook or calling a filter.
 * use clearer names.
* Instead of having to specify a path for each module to be loaded in
the configuration, the proxy now loads modules from specificed
directory, using the CMAKE variable PROXY_PLUGINDIR.
* Add an option to specify required plugins: plugins that the proxy
wouldn't start without having them fully loaded.
2020-01-14 07:58:47 +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
47ca28b5c3 server: proxy: fix leak in pf_context_copy_settings 2020-01-13 13:41:44 +01:00
Kobi Mizrachi
ca2e578acc server: proxy: add a unique id to each session and improve logs 2020-01-08 11:59:34 +01:00
Kobi Mizrachi
ab3a72f825 server: proxy: move peer initialization to seperate function 2020-01-08 11:59:34 +01:00
Kobi Mizrachi
77ca7ac2ad server: proxy: make fallback to tls configurable 2020-01-08 07:58:03 +01:00
David Fort
31a4e2ad8b
Merge pull request #5745 from akallabeth/urbdrc_rewrite
Urbdrc rewrite
2020-01-06 09:23:45 +01:00
Armin Novak
182d0ce548 Added RDP 10.7 large pointer support
* Implements [MS-RDPBCGR] version 51 large pointer support.
* Logs unknown large pointer capability flags as warning.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2019-12-19 09:53:40 +01:00
Kobi Mizrachi
2e1d719ab1 server: proxy: proxy keyboard leds and imei 2019-12-17 15:33:11 +01:00
Bernhard Miklautz
814771eed5
Merge pull request #5778 from akallabeth/shadow_warnings
Added warning to win shadow server
2019-12-16 09:57:16 +01:00
Mati Shabtay
97606edeee proxy: Implement RAIL support in proxy 2019-12-12 11:10:44 +01:00
Armin Novak
e6ff9e3efa Added warning to win shadow server
Currently the windows shadow server does not support authentication.
Log that fact so everyone using it is notified on each login.
2019-12-12 09:20:30 +01:00
Armin Novak
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
Armin Novak
15ad496bba Cleaned up server sample audin channel use. 2019-11-22 10:56:21 +01:00
kubistika
09648834a0 server: proxy: fix sync issue in gfx opening 2019-11-12 12:45:01 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Martin Fleisz
bc39b32d20
Merge pull request #5685 from akallabeth/multi_instance_arg_parse
COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
2019-11-06 09:09:22 +01:00
Martin Fleisz
5b6663fe3a
Merge pull request #5689 from akallabeth/cleanups
Cleanups
2019-11-05 15:28:02 +01:00
akallabeth
acad36465d Fix #5693: Add missing link to gfx client channel library 2019-11-02 09:57:03 +01:00
kubistika
59ba044ccd server: proxy: client: always do NLA fallback 2019-10-31 11:26:13 +02:00
Armin Novak
f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
kubistika
d5245e1263 server: proxy: export config utils functions to be used by modules 2019-10-28 13:31:10 +01:00
kubistika
160446e093 server: proxy: stop loading session captures config if it is disabled 2019-10-28 13:31:10 +01:00
Armin Novak
10ce60ade1 Use COMMAND_LINE_ARGUMENT_A copy also in shadow server code. 2019-10-28 13:30:05 +01:00
Armin Novak
0c87eaee4d COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
Remove the old global structs as the parser modifies them. When using
multiple instances in the same process space this could break parsing.
2019-10-28 13:30:05 +01:00
kubistika
ab2b288f87 server: proxy: refactor config loader 2019-10-24 12:57:48 +02:00