Commit Graph

191 Commits

Author SHA1 Message Date
Armin Novak
5f10ae9599 [channels,rdpdr] fix IRP handling
* clean up IRP creation
* Properly handle each IRP, call irp->Complete or irp->Discard only once
  for each IRP
* For each channel split IRP handling, one function prepares the data
  and a single evaluate function later calls irp->Complete or irp->Discard
2026-02-17 16:38:31 +01:00
Armin Novak
bf99266c2e [channels,warnings] properly handle function return 2026-02-16 09:18:38 +01:00
Armin Novak
8cd987dacd [channels,serial] fix unintialized variable on jump 2026-01-14 10:37:17 +01:00
akallabeth
675c20f08f [channels,serial] explicitly lock serial->IrpThreads 2026-01-13 09:39:33 +01:00
akallabeth
b35aa3614d [channels,serial] lock list dictionary
prevent sync problems for list dictionary
2026-01-12 09:03:45 +01:00
akallabeth
e99e33aea8 [channels,serial] fix use after free 2026-01-12 09:03:36 +01:00
Armin Novak
df44b4a493 [clang,warnings] fix Wjump-misses-init 2026-01-08 11:32:34 +01:00
akallabeth
65f18983ed [warnings] Fix format string errors
* Fix casts of format string arguments (%p requires void*)
* Fix format string to match type of arguments
2025-08-13 15:09:48 +02:00
Armin Novak
07e39ede20 [winpr,file] Add winpr_CreateFile wrapper
Allows creation of a file HANDLE from a utf-8 name
2025-06-05 11:58:47 +02:00
Armin Novak
b3605bd3da [channels,rdpdr] assert Completion callback 2025-03-26 16:58:11 +01:00
Armin Novak
d4cde0b8e0 [winpr,comm] fix serial port redirection
* Unify ioctl logging
* Fix device reset calls
* Unify TIOCGICOUNT calls, only use them if they are supported
* Fix XOn/XOff support
* Fix modem status flags
2025-02-26 15:53:28 +01:00
akallabeth
3092313d49 [channes,rdpdr] use NTSTATUS for IoStatus
the IoStatus will hold NTSTATUS values but is defined unsigned in
[MS-RDPEFS] whereas NTSTATUS is defined as signed integer. Ignore the
spec here and just treat it as signed (eliminates warnings and twos
complement will ensure the values are equal in bit representation)
2025-01-07 10:11:21 +01:00
akallabeth
be3ba1c425 [warnings,channels] fix integer casts 2024-12-25 13:29:07 +01:00
akallabeth
ac9cf26bce [cmake] fix define_channel_options
* fix usage of default value
* fix defaults of channels
* unify to single CMake function define_channel_options
2024-12-17 16:29:32 +01:00
akallabeth
83f2f21ad3 [warnigns] fix lots of bugprone warnings
* update-settings-tests: properly cast types in getter/setter
* wtypes: fix PHANDLE definition
* wStream: fix INT64 write function warnings
* Simplify HANDLE copy in channels, just assign after proper cast
2024-12-06 09:15:48 +01:00
akallabeth
faae38120c [cmake,format] reformat all cmake files 2024-11-27 20:41:48 +01:00
stephanebill
4f2afa8c47 spell check with codespell 2024-11-20 16:53:40 -05:00
akallabeth
dcf5a8e28c [warnings] fix -Wswitch-default 2024-10-31 11:42:24 +01:00
akallabeth
bb242b9a89 [return checks] fix use of WaitForSingleObject 2024-09-16 08:22:37 +02:00
akallabeth
965d231e49 [return checks] fix use of CloseHandle 2024-09-16 08:22:31 +02:00
akallabeth
4d2197eab0 [return checks] fix use of TerminateThread 2024-09-16 06:48:11 +02:00
akallabeth
fe6d861a5c [channels] fix VCAPITYPE for all channel entry points 2024-09-03 17:26:58 +02:00
akallabeth
bd637c6cd1 [warnings] fix various clang-tidy warnings 2024-08-29 17:13:50 +02:00
akallabeth
387dabc4dd [channels,serial] add CMake messages
Inform user about platforms that do not support serial redirection
2024-08-26 13:26:15 +02:00
akallabeth
1ec18ce827 [channels,serial] default to off on APPLE 2024-08-26 13:23:09 +02:00
akallabeth
d08e44d883 [channels,serial] only build on linux
* Guard by CMake
* Remove code #ifdef to ease porting
2024-08-26 13:18:52 +02:00
akallabeth
eb7d8fdeb0 [channels,serial] improve command line parsing
* Gracefully exit on invalid serial driver
* Gracefully exit on onvalid serial port flags
2024-08-26 12:37:03 +02:00
akallabeth
0b21fddef6 [channels,serial] improve IRP processing logging 2024-08-26 12:37:01 +02:00
akallabeth
1ca069c771 [channels,serial] fix IrpThread handling
* Proper terminated threads cleanup
* Proper remaining threads termination on close
2024-08-26 12:35:54 +02:00
akallabeth
348ddf61c0 [channels,serial] delay IRP thread start
wait until irp_thread_func has completed before starting the thread.
This prevents a race condition when accessing the IRP structure which is
freed up once the thread terminates.
2024-08-26 12:35:51 +02:00
akallabeth
652c5310f2 [channel,serial] cleanup code
* WINPR_ASSERT arugments
* remove use of restricted keywords (variables/functions starting with _)
* Better logging and error checks
2024-08-26 12:23:04 +02:00
akallabeth
776083234b [warnings] fix unused-but-set-variable 2024-07-23 09:14:19 +02:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +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
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
bd7f0ecd24 [collections] fix ListDictionary usage 2023-07-05 08:46:00 +02:00
akallabeth
63d4da2d0d [winpr,collections] ListDictionary_GetKeys 2023-06-27 15:05:43 +02:00
akallabeth
ac39e8aac2 [winpr,collections] ListDictionary_Count 2023-06-27 15:05:43 +02:00
Armin Novak
970f0c54e8 [stream] use const correct Stream_Pointer access 2023-06-08 08:09:33 +02:00
Armin Novak
a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
akallabeth
c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +01:00
Armin Novak
b25234da66 [channels] Abort event wain on abortEvent 2022-12-09 12:30:14 +01:00
Armin Novak
a57c480b29 [channel,rdpdr] proper queue cleanup for rdpdr 2022-12-02 15:08:09 +01: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
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
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
3c72cc3306 Refactored rdpdr and dependent channels
* Move parsing code to core library
* Move definitions to public API to allow access from outside
* Move smartcard related parsing to core library
2022-01-11 12:34:43 +01:00