Commit Graph

154 Commits

Author SHA1 Message Date
Armin Novak
68a77b8156 [channels,cups] use PDF printer on mac os sonoma
apple removed postscript support, so switch to PDF printer if running on
mac os sonoma (14) or newer. Requires windows 10 or newer or a custom
PDF printer driver
2023-11-16 15:43:51 +01:00
Armin Novak
57b4f3df20 [channels,cups] add debug logging for failures 2023-11-16 15:43:51 +01:00
Armin Novak
f5d9c5f815 [channels,cups] remove support for CUPS < 2.0 2023-11-16 15:43:51 +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
ad51c6a0f5 [channels,printer] default CUPS to being enabled
* printer support now enabled by default unless iOS or ANDROID is build.
* Move cups library detection to printer module
2023-08-25 13:54:29 +02:00
Armin Novak
045fcedd12 [channels,printer] fix backend load function
changed the signature of the backend loader function. the previous
version casted the allocated pointer to UINT which might not be able to
hold a pointer.
2023-07-28 12:24:22 +02:00
Armin Novak
970f0c54e8 [stream] use const correct Stream_Pointer access 2023-06-08 08:09:33 +02:00
akallabeth
fc78064ec3 [warnings] fix -Wunused-variable 2023-05-24 08:24:32 +02:00
akallabeth
516668d02b [fclose] ensure no invalid pointers are passed.
fclose has undefined behaviour for NULL pointers, so check for these.
2023-04-28 07:39:35 +02:00
Armin Novak
9005e1edfb [channels,printer] fix printer_save_default_config 2023-04-24 10:58:01 +02:00
Martin Fleisz
ecb4712a10 channels: Check return value of EnumPrinters 2023-03-23 17:40:08 +01:00
Armin Novak
b54d2c1db3 [channels] removed duplicate includes 2023-03-15 08:22:23 +01:00
akallabeth
a5b42f0f84 [includes] untangled circular includes 2023-03-15 08:22:23 +01:00
akallabeth
c054666311 [channels] simplified channel subsystem linking 2023-03-01 08:18:34 +01:00
akallabeth
c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +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
David PHAM-VAN
f2e14d68eb Replace backslashes with underscores in printer names 2022-11-21 08:04:10 +01:00
Simon Nivault
82b58325a3 Add switch to declare printer as default or not 2022-09-20 13:25:05 +02:00
Simon Nivault
8d97215881 Enable auto default printer detection only for enum printer 2022-09-20 13:25:05 +02:00
Simon Nivault
06827774b6
Manage default printer for the win backend (#8177)
* printer_win: Retrieve default printer name

* printer_win: Declare the local default printer as default

* printer_cups: Retrieve default printer name

* printer_cups: Declare the local default printer as default
2022-09-09 09:13:37 +02:00
Martin Fleisz
152c96032d channel/printer: Fix return type for localtime_s on Windows 2022-07-21 15:59:43 +02:00
akallabeth
7bc276ba04 Added WINPR_ASSERT to printer client channel
Assure all function calls have valid arguments.
2022-06-24 13:20:28 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
90ce22283d Replaced direct settings access with getter/setter 2022-06-23 07:45:55 +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
akallabeth
ec699f6c75 scanbuild fixes 2022-04-28 12:37:19 +02:00
akallabeth
1dcc5a180a Fixed warnings 2022-04-28 11:24:51 +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
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
akallabeth
b0c4bb5e86 Used proper format string for wide print size_t 2022-01-19 09:24:57 +01:00
Armin Novak
e80c24e837 Fix printer backend reference count 2021-11-18 14:17:25 +01:00
Armin Novak
8c74de191c Fix printer reference count 2021-11-16 08:27:24 +01:00
Armin Novak
239a3872d2 Fixed cups default printer. 2021-11-16 08:27:24 +01:00
Armin Novak
422b684957 Ensure default printer for windows backend. 2021-11-16 08:27:24 +01:00
Armin Novak
46d524cbc7 windows printer cleanup 2021-11-16 08:27:24 +01:00
Alexandru Bagu
3280363b66 fix call to localtime_s 2021-11-02 08:34:23 +01:00
Armin Novak
7d80c74e97 Cleaned up RDPDR channel interhitance
* All channels inheriting from RDPDR_DRIVE base struct
* Add functions to create/free a new device of a type
* Fixed settings array resize code, prevent 0 sizes
2021-10-18 09:21:02 +02:00
Armin Novak
8a74bdb371 Fixed cast warning 2021-07-29 15:09:53 +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
Simon Nivault
c40ca6bc28 Fixed win printer 2021-06-21 11:32:57 +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
akallabeth
b494a193db Refactored certificate API:
* Proper encapsulation
* known_hosts2 backend extended (storing PEM)
* New backend storing each host certificate in a file
2021-05-11 08:00:18 +02:00
Ondrej Holy
892cbe3261 Fix various memory leaks reported by Coverity
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.

Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
2021-04-27 14:25:20 +02:00
akallabeth
d0dacf6336
Parse on a copy of the argument string for printer (#6860)
If done on original the wrong backend is loaded on autoreconnect
2021-03-04 15:49:05 +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