Commit Graph

339 Commits

Author SHA1 Message Date
Armin Novak
f1e7cc0d48 [rdpdr] unify header read/write 2023-01-10 11:49:38 +01:00
Armin Novak
58c4517700 [rdpdr] improved debug log 2023-01-10 11:49:38 +01:00
Armin Novak
37454c7420 [utils] improve rdpdr packet dump 2022-12-22 15:09:03 +01:00
akallabeth
06c070fc4d [gfx] moved rdpgfx_get_codec_id_string to utils
the gfx related stringify helpers are nice to have outside the channel
too so that meaningful logmessages can be written.
2022-12-18 15:14:30 +01:00
Armin Novak
58bc1ee4c9 [smartcard] fix multi string conversion 2022-12-02 15:08:09 +01:00
Armin Novak
dc077eed78 [utils] fix smartcard string list conversion 2022-12-02 15:08:09 +01:00
akallabeth
66dad5deae fixed review issues
* Overallocation in unicode functions
* Removed useless statements
* Fixed loop indices
2022-11-28 10:42:36 +01:00
akallabeth
7bf8b46726 [smartcard] Use multistring convertion functions 2022-11-28 10:42:36 +01:00
akallabeth
5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00
Armin Novak
8de60f9472 Fixed -Wextra-semi-stmt 2022-11-21 10:12:31 +01:00
Armin Novak
f9faf3d3d5 Unified synthetic file cleanup 2022-10-28 08:22:43 +02:00
Armin Novak
a7a8e7ee8d Fixed read/write of filedescriptorw times 2022-10-28 08:22:43 +02:00
akallabeth
43c5289928 Replaced memset/ZeroMemory with initializer
* Addes WINPR_ASSERT on many occations
* Replaced memset with array initializer
* Replaced ZeroMemory with array initializer
2022-10-14 12:11:01 +02: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
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
03e20cb541 Clean up pcap capture module 2022-06-23 07:45:55 +02:00
Armin Novak
fcb2d7c60d Fixed double free by implicit fallthrough (#7974) 2022-06-20 15:39:20 +02:00
akallabeth
44582f821b Added utility module for string functions 2022-06-17 08:41:46 +02:00
David Fort
094cc7ca77 utils: add implementation of POD(primitive object data) arrays
This allows to have simple array of primitive types with basic utility functions.
2022-05-30 14:05:41 +02:00
akallabeth
ec699f6c75 scanbuild fixes 2022-04-28 12:37:19 +02:00
akallabeth
cc3e28f2f1 Fixed -Wdocumentation errors 2022-04-28 11:24:51 +02:00
akallabeth
2dfc1ddb12 Removed obsolete trio 2022-04-28 10:49:09 +02:00
akallabeth
667b471686 Fixed cast-quality warnings 2022-04-28 09:17:20 +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
59925674a5 Fixed compilation warnings in cliprdr_utils 2022-03-28 14:59:30 +02:00
Armin Novak
c6924cb126 Moved clipboard utils to core library, fixes #6760 2022-03-28 14:59:30 +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
David Fort
44c82cd929 Fixes various akallabeth remarks 2022-02-24 08:52:25 +01:00
David Fort
cb351a099d Enable smartcard NLA logon 2022-02-24 08:52:25 +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
akallabeth
a337031b24
Cache Emulate_IsConfigured result (#7569)
* Cache Emulate_IsConfigured result

The check is used very often, so this caching reduces necessary
allocations.

* Fix winpr_HexLogDump

Abort function early if the log message is to be discarded due to
the log level being inactive.

* Use common logger for rdpdr message

Co-authored-by: Martin Fleisz <martin.fleisz@thincast.com>
2022-01-21 13:24:20 +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
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
Alexandru Bagu
95cb4672b3 fix build issues for VS2010 2021-10-20 08:35:16 +02:00
Alexandru Bagu
07ea60e960 add optional support for win32 console
* add option to build as console by using WITH_WIN_CONSOLE
* add passphrase read from stdin for Win32
* fix windows authentication with stdin password
* allow redirected stdin to be used for stdin input
* flush stdout to help with automation
* use stdin when /from-stdin is present
* add error log for stdin flag but stdin redirected
2021-10-20 08:35:16 +02:00
Armin Novak
5eea7fc12d WINPR_UNUSED argc, argv for unit tests 2021-08-24 10:45:57 +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
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
a3a89a43f7 Fix intialization, remove some unused variables. 2021-04-28 17:11:31 +02:00
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
Armin Novak
87e89bc719 Fixed pcap capture function const correctness 2021-01-18 09:41:13 +01:00
akallabeth
cf49e4bfa8 Added stack trace on signal. 2020-11-10 10:17:56 +01:00
akallabeth
3ac7bb5d6a Fixed pcap cleanup 2020-06-22 11:51:38 +02:00
Armin Novak
3de666a80e Improve signal handler printout. 2020-03-04 08:22:56 +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
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
Armin Novak
210b40a54f Removed msusb from library. 2019-11-22 10:33:39 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
e4386e147a Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
d2e1248b09 Fixed profiler API
* Duplicate the name internally to avoid issues with stack
* Made API opaque and removed direct dereferencing of struct.
2018-11-16 09:32:15 +01:00
Armin Novak
987ca5ec6a Fixed another bunch of warnings. 2018-10-24 14:36:12 +02:00
Armin Novak
ae765430e9 Fixed #4647: nsc_context_free must not access possibly uninitialized fields. 2018-05-15 13:41:45 +02:00
Bernhard Miklautz
52fbfb7b12 fix clang warnings, directly include wtypes.h (#4097)
* build: clang use -Wno-unused-command-line-argument

With clang 5.0 builds are quite noisy otherwise.

* Directly include wtypes.h

Directly include winpr/wtypes.h where _fseeki64 or _ftelli64 is used.

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: parentheses-equality

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: tautological-compare

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning:
incompatible pointer types passing 'size_t *' (aka 'unsigned
long *') to parameter of type 'UINT32 *' (aka 'unsigned int *')
[-Wincompatible-pointer-types]
2017-08-29 09:09:38 +02:00
Armin Novak
c3d4b7d262 fseeko and ftello for 64bit file support. 2017-08-14 08:42:49 +02:00
Armin Novak
09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
Norbert Federa
fa2086686b some performance fixes
- draw only the updated region in the gdi and x11 surface bits implementation
- don't repeatedly call IsProcessorFeaturePresentEx in rfx rlgr decoder
- fix ugly and unaligned profiler print layout and remove an unnecessary value
2017-03-27 20:14:13 +02:00
Armin Novak
ef4515a674 Added FPS in profiler print. 2017-02-14 16:02:11 +01:00
Bernhard Miklautz
3a4e1adee7 utils: remove unnecessary debug message.
Change the level from info to debug as it's nothing a regular users
would have interest in.
2017-01-16 11:11:58 +01:00
Norbert Federa
9359ae8ee9 fix format specifier in profiler_print 2016-12-19 10:01:18 +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
Armin Novak
943e295714 WLog using C99 compatible variadic macros. 2016-10-07 14:05:27 +02:00
Armin Novak
fb36121ba9 Added signal handler for android. 2016-10-06 13:43:07 +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
Bernhard Miklautz
1cee185e3c hardening: check fread and fwrite return values 2015-06-26 20:38:30 +02: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
c228860082 ringbuffer: add option to enable/disable debugging
Add option WITH_DEBUG_RINGBUFFER to enable/disable ringbuffer debugging
at compile time.

Even if it is possible to filter specific wlog tags it's not yet
possible to exclude one or more and ringbuffer adds massive debugging
output if enabled and WLOG_LEVEL is set to DEBUG.
2015-02-03 15:28:05 +01:00
Bernhard Miklautz
c70293aa60 Fix clang compiler warnings 2015-01-16 00:41:57 +01:00
Marc-André Moreau
98cd697cad libfreerdp-utils: add ringbuffer debug output 2015-01-14 13:15:57 -05:00
Marc-André Moreau
ddedc574f3 freerdp: remove tcp, uds utils 2014-11-12 14:06:34 -05:00
Marc-André Moreau
8c98cbc247 libfreerdp-utils: remove old time utils 2014-11-12 13:45:03 -05:00
Marc-André Moreau
986dae429b freerdp: remove deprecated svc_plugin.c utils 2014-11-12 13:34:07 -05:00
Marc-André Moreau
0e7c95c421 freerdp: remove deprecated eventing system 2014-11-12 13:18:18 -05:00
Marc-André Moreau
589c21d819 libfreerdp-utils: remove rail utils 2014-11-12 10:18:53 -05:00
Marc-André Moreau
ee7299ec3f channels/tsmf: remove dependency on deprecated eventing system 2014-11-10 16:33:34 -05:00
Marc-André Moreau
a6bb185760 channels/tsmf: add new callback interface 2014-11-07 18:33:45 -05:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Bernhard Miklautz
0313ca3622 libfreerdp: always build "MONOLITHIC"
"libfreerdp" consisted of multiple (small) single libraries. If the cmake
option MONOLITHIC was used only one library was build combining all of
the libfreerdp-* libraries.
The only exceptions to this are libfreerdp-server and libfreerdp-client these
are build as separate libraries.

This commit obsoltes non-monolithic builds and makes monolithic builds
the default. The cmake option MONOLITHIC is also removed.
2014-09-12 00:19:53 +02:00
erbth
cbc8b3a7e1 Merge branch 'egfx' of https://github.com/awakecoding/freerdp into egfx_new
Conflicts:
	channels/drdynvc/client/dvcman.c
	include/freerdp/codec/h264.h
	libfreerdp/codec/h264.c		after this merge h264 doesn't work anymore!!
	libfreerdp/utils/svc_plugin.c
2014-09-08 16:56:45 +02:00
Marc-André Moreau
f14b0e0195 libfreerdp-codec: cleanup h264 decoder 2014-09-05 19:11:03 -04:00
Marc-André Moreau
033e75467b Merge branch 'master' of github.com:awakecoding/FreeRDP into egfx 2014-09-05 17:29:35 -04:00
Marc-André Moreau
320b1d35ed libwinpr-utils: centralize bitmap utils 2014-09-03 16:20:50 -04:00
Vic Lee
551ee0566a channels: fix memory leak in stream pools. 2014-08-28 23:16:32 +08:00
Armin Novak
d0c5d9bb9e Fixed missing include. 2014-08-11 09:49:57 +02:00
Armin Novak
784696c1cd Fixed missing includes and invalid replacement. 2014-08-11 09:38:08 +02:00
Armin Novak
bcb5f90ee6 Replaced perror with DEBUG_WARN 2014-08-11 09:19:23 +02:00
erbth
a8257b5201 fixed some memory leaks arround DVC and RDPEGFX 2014-08-08 15:19:49 +02:00
Armin Novak
eecc8e2333 Removed debug.c 2014-08-07 21:38:11 +02:00
Armin Novak
a27706d129 Fixed missing includes. 2014-08-07 18:25:43 +02:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00
Bernhard Miklautz
8c318da7b1 fix compiler warnings 2014-07-29 05:22:29 +02:00
Armin Novak
ad3255354d Added WITH_LIBRARY_VERSIONING, allowing to build shared libraries without
SOVERSION information. (required by Android)
2014-07-11 11:53:58 +02:00
Bernhard Miklautz
6a49bcfe40 winpr: always build "monolitic"
winpr is now always build as single library.
The build option MONOLITHIC_BUILD doesn't influence this behavior anymore.

The only exception is winpr-makecert-tool which is still build as extra
library.

This obsoletes complex_libraries for winpr.
2014-07-10 11:10:58 +02:00
Hardening
bf53f044bd Fix missing include 2014-07-04 15:18:50 +02:00
Hardening
7238bedd26 Link utils against winsocks 2014-07-03 17:53:02 +02:00
Hardening
542811291c Use poll() instead of select() when available
select() has the major drawback that it cannot handle file descriptor
that are bigger than 1024. This patch makes use of poll() instead of
select() when poll() support is available.
2014-07-03 15:26:49 +02:00
Marc-André Moreau
78d3c82798 xfreerdp: fix multiple egfx-related memory leaks 2014-06-20 13:52:13 -04:00