Commit Graph

88 Commits

Author SHA1 Message Date
akallabeth 566d4cf637
[stream] fix sign issues with stream API use 2024-10-29 15:50:07 +01:00
akallabeth 11b7633dc0
[channels] use Stream_BufferAs
For WTSVirtualChannelRead and WTSVirtualChannelWrite use Stream_BufferAs
to cast to correct type.
2024-10-01 10:28:13 +02:00
akallabeth 586f40631f
[warnings] fix shorten-64-to-32 2024-09-17 16:13:48 +02:00
akallabeth 965d231e49
[return checks] fix use of CloseHandle 2024-09-16 08:22:31 +02:00
akallabeth 7d67b8e204
[return checks] fix use of SetEvent 2024-09-16 06:47:58 +02:00
akallabeth 8b6091a007
[winpr,wtsapi] improve API usage
* Mark WTSVirtualChannelOpen and WTSVirtualChannelOpenEx with
  WINPR_ATTR_MALLOC to enforce compiler checks for resource cleanup
* Fix unused result warnings, use the result or cast to (void) where not
  requierd
2024-09-14 21:29:31 +02:00
akallabeth fe6d861a5c
[channels] fix VCAPITYPE for all channel entry points 2024-09-03 17:26:58 +02:00
akallabeth 9c9d74e920
[warnings] fix redundant casts 2024-08-29 12:03:09 +02:00
Mikhail Kashin 5c471974ba [channels,disp] fix typo in monitor->height 2024-08-05 23:54:08 +03:00
akallabeth 2831d2f5ec
[cmake] fix add_channel_client and add_channel_server
only add the channels if they are activated (e.g. both,
CHANNEL_<NAME> and CHANNEL_<NAME>_CLIENT or CHANNEL_<NAME>_SERVER are
defined)
2024-06-11 11:39:25 +02:00
akallabeth d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth 0e44b2c674 [clang-tidy] clang-analyzer-unix.Malloc 2024-02-15 11:49:16 +01:00
akallabeth 0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth 207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
akallabeth ba8cf8cf21 [build] fix Wmismatched-deallocator warnings
With custom malloc function attributes the fail path in the _New
functions produces warnings due to allocator mismatches. Silence them.
2024-02-05 08:16:55 +01:00
akallabeth ceb7bd1d41 [warnings] fixed clang build warnings 2023-11-24 18:19:03 +01:00
akallabeth bb5345c60e [freerdp,api] add FREERDP_ENTRY_POINT
C requires prototypes or compilers will complain about them missing. Our
library entry points do not have such, therefore add the macro
FREERDP_ENTRY_POINT which declares the function prototype automatically
before the function.
2023-08-25 14:36:05 +02:00
akallabeth cf9777cd92 [channels] simplified server linking 2023-03-01 08:18:34 +01:00
akallabeth c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +01:00
Armin Novak 641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
akallabeth 075506f6c8 [winpr,stream] use new Stream_CheckAndLogRequiredLength* 2023-01-25 14:27:32 +01:00
akallabeth 1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
David Fort 3478051f15 dynamic channels: mutualize things for listeners and plugins
The same code is copied in all dynamic channels to create a plugin, have a listener,
and manage the channel lifecycle. This patch does a mutualization effort so that channels
only have to code things that are specific to them.
2022-07-07 12:21:23 +00:00
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
David Fort e389210673 client channels: mutualize common types between dynamic channels
Most dynamic channels share the same copied and pasted code for the XXX_CHANNEL_CALLBACK
and XXX_LISTENER_CALLBACK types. This patch introduce GENERIC_CHANNEL_CALLBACK and
GENERIC_LISTENER_CALLBACK that fits for most channels and discard custom type definitions.
2022-06-15 14:04:58 +02:00
Pascal Nowack 9d627e0df2 channels/server: Add APIs for DVCs to get notified of channel id
This allows server implementations to watch these channel ids for their
creation statuses.
2022-06-08 15:26:51 +02:00
akallabeth 962c5c3ef0 Fixed dead store warnings 2022-04-28 12:37:19 +02:00
akallabeth ec699f6c75 scanbuild fixes 2022-04-28 12:37:19 +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
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
Martin Fleisz 1371970783 disp: Remove wrong assert 2022-02-25 11:57:28 +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 0c7e6c3c2d Refactored disp channel
* Assert all input parameters
* Use DISP_CHANNEL_NAME define for channel name
2022-02-22 11:29:56 +01:00
Pascal Nowack b2d0c42cbb server/disp: Sanitize optional physical monitor size values
The server sided handling of the display control channel currently
treats the physical monitor size values as obligatory values.
When the physical monitor size is invalid according to the
documentation, it is supposed to be ignored.
However, this is currently not done, leading to an abort of the display
control channel handling, when using Remmina, as Remmina does not submit
physical-monitor- widths and -heights.

Fix this issue by sanitizing the physical monitor size values, instead
of handling them as obligatory values, where both the physical with and
the physical height must be constrained to the values in the
documentation.
2022-02-22 10:55:22 +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
Armin Novak 83f56bd565 Cleanup disp_send_display_control_monitor_layout_pdu 2021-12-17 10:06:54 +01:00
Steve Pronovost e452467cd3 Fix protocol violation in Display Control Virtual Channel Extension
Length field of DISPLAYCONTROL_HEADER must include the size of the header
itself. See MS-RDPEDISP 2.2.1.1 DISPLAYCONTROL_HEADER.
2021-10-21 13:11:21 +02:00
Armin Novak 96cf17a45b Replaced (IWTSPlugin*) casts with struct address return 2021-10-07 16:22:04 +02:00
akallabeth 7b7e2d6f32 Prefer constant division over multiplication for length checks 2021-09-21 08:55:22 +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
Ilya Shipitsin b62da2cbcc channels/disp/client/disp_main.c: fix possible null pointer dereference
found by cppcheck

channels/disp/client/disp_main.c:340:7: warning:
Either the condition 'if(disp&&disp->listener_callback)' is redundant or
there is possible null pointer dereference: disp. [nullPointerRedundantCheck]
2020-10-02 09:58:03 +02:00
Armin Novak 75aab487e2 Added duplicate initialization check for plugins. 2020-08-10 16:17:44 +02:00
akallabeth 64ad42b95b Fixed DestroyListener arguments and call order 2020-05-13 17:11:17 +02:00
akallabeth 2f5e5359f6 Destroy channel listeners on terminate 2020-05-12 11:40:42 +02:00
Kobi Mizrachi 2d9a50fafb fix memory leaks in disp server and gfx.c 2020-01-13 13:41:44 +01:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak da48b4eb8d Made disp channel internal functions static. 2019-10-28 09:31:50 +01:00
Kobi d9366df448 RDPEDISP server side implementation (#5414)
* libfreerdp: Add RDPEDISP server implementation

* server/proxy: Add RDPEDISP support
2019-06-11 16:13:42 +02:00
David Fort 80dab90f1a disp: implement dynamic resolution for X11
If the display channel is available we use it to allow the user to resize the
xfreerdp window. When the window is resized we announce a new monitor layout and
the server reacts by doing a reactivation sequence to the new size.
The minimum window size is limited to 300x300 as 2012 servers crash horribly
if we send them a smaller layout.
2017-12-14 15:13:11 +01:00