1285 Commits

Author SHA1 Message Date
Armin Novak
b724ba546d [checks,return] fix various unchecked return values 2026-03-03 09:40:27 +01:00
Armin Novak
e6fca2c021 [winpr,stream] Fix Stream_SetPosition return checks 2026-03-02 11:37:20 +01:00
Armin Novak
92ab55c5e1 [winpr,stream] Add Stream_ResetPosition
A helper function that does not require return checks, in contrast to
Stream_SetPosition, which might fail.
2026-03-01 06:11:59 +01:00
Armin Novak
822257bf7c [c23,winpr] replace NULL with nullptr 2026-02-26 21:16:48 +01:00
Armin Novak
b1d401a84e [winpr,platform] add nullptr fallback for pre C23 2026-02-26 13:43:51 +01:00
Armin Novak
0531803808 [warnings] make function declaration names consistent
Use the same parameter names for declaration and implementation.
2026-02-26 10:35:25 +01:00
Armin Novak
e6c17b13cd [winpr,platform] fix WINPR_ATTR_MALLOC for older GCC 2026-02-26 09:05:29 +01:00
Armin Novak
208bcbd153 [winpr] Add initializer functions
* Add initializer for wStream
* Add initializer for ASN1 decoder
2026-02-25 19:39:24 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
88e8c843f9 [winpr,platform] fall back to attribute for GCC
GCC does not like [[nodiscard]] on function pointers. Fall back to
attribute(warn_unused_result) syntax, which does seem to work.
2026-02-25 11:51:12 +01:00
Armin Novak
e9723d1b61 [attributes] update attribute definitions
* support C++
* support C23
* replace __inline et al with C11 inline
2026-02-25 11:51:11 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
Armin Novak
3c84d08518 [winpr,platform] add C++ guards for macros
define attributes when included from C++ code
2026-02-24 17:14:56 +01:00
Armin Novak
c1d0653c87 [winpr,platform] fix C23 checks
https://en.cppreference.com/w/c/language/attributes.html has a nice
overview of attributes and when they were introduced. Adjust macro
checks accordingly.
2026-02-24 17:14:40 +01:00
Armin Novak
a9be86ecfa [winpr,platform] add C23 [[nodiscard]] 2026-02-24 16:10:05 +01:00
Armin Novak
262dade595 [cmake] Define WINPR_DEFINE_ATTR_NODISCARD
* Do not define WINPR_ATTR_NODISCARD if WINPR_DEFINE_ATTR_NODISCARD is
  not defined.
* Define WINPR_DEFINE_ATTR_NODISCARD via CMake to enable this for
  internal use only
2026-02-20 09:01:54 +01:00
Armin Novak
d48452faf3 [winpr,utils] Add Queue_Capacity 2026-02-18 15:43:40 +01:00
Armin Novak
b78cb455cb [winpr,queue] improve queue management
* Fix Queue_EnsureCapacity reallocation handling, ensure queue->tail is
  properly updated.
* Fix allocation behaviour, use growthFactor * 32 as block size.
* Add doxygen for Queue_New
2026-02-18 15:43:39 +01:00
Armin Novak
57dfd75231 [winpr,utils] add MessageQueue_Capacity 2026-02-18 14:26:03 +01:00
Armin Novak
399d92f26e [winpr] mark function pointers [[nodiscard]] 2026-02-15 23:57:23 +01:00
Armin Novak
5f7f1672ff [winpr,utils] add application details getter/setter
* Allow an application to set a vendor/product/version namespace to search
  for configuration files/settings/...
* Replace all WINPR_VENDOR_STRING et al macros with these getters
2026-01-29 22:47:40 +01:00
Armin Novak
81d6ed2784 [winpr,path] modify GetCombinedPath
Allow the subPath argument to be a format string with variadic
arguments. This allows to generate a subPath on the fly. This change is
API compatible.
2026-01-29 22:47:30 +01:00
Armin Novak
ba07955689 [client,sdl] handle clipboard events in SdlContext 2026-01-27 15:22:40 +01:00
akallabeth
b5b451e35b Merge pull request #12192 from akallabeth/nodiscard
[winpr,platform] drop C23 [[nodiscard]]
2026-01-27 13:17:49 +01:00
Armin Novak
f443c1bc6f [winpr,platform] drop C23 [[nodiscard]]
In WINPR_ATTR_NODISCARD drop the C23 [[nodiscard]] until we figure out
how to avoid compiler errors on fedora/gcc 15
2026-01-27 12:59:22 +01:00
akallabeth
cf63326799 [winpr,platform] fix duplicate deprecation define 2026-01-27 12:15:03 +01:00
akallabeth
1e4c1cd526 [winpr] mark all WINPR_ATTR_MALLOC also nodiscard 2026-01-26 13:39:41 +01:00
akallabeth
7d943a9c21 [documentation] fix a few doxygen warnings 2026-01-25 09:38:33 +01:00
akallabeth
2501c274f5 [winpr,platform] add WINPR_ATTR_NODISCARD macro
* add macro WINPR_ATTR_NODISCARD
* adjust C-23 checks for macros according to
  https://en.cppreference.com/w/c/language/attributes.html
2026-01-23 17:13:54 +01:00
Armin Novak
efe920c705 [winpr,platform] make WINPR_DEPRECATED_VAR more verbose
explicitly state [deprecated] in the compiler warning to make it more
visible why the warning was emitted.
2026-01-21 16:41:26 +01:00
akallabeth
afc204df03 [winpr,wlog] mark WLog_Print_dbg_tag printf style
Add proper compiler attributes to WLog_Print_dbg_tag so the compiler can
warn about format string violations
2026-01-16 11:36:55 +01:00
akallabeth
14897e1bba [winpr,nt] FSInformationClass2Tag parameter
Use UINT32 as input parameter as we might have an invalid value not
contained in the FILE_INFORMATION_CLASS enum
2026-01-09 09:24:24 +01:00
akallabeth
f7f0dd2ba4 [winpr,secapi] document KERB_LOGON_SUBMIT_TYPE
* Add _WIN32_WINNT version defines for enum values
* define KerbInvalidValue for windows
2026-01-09 09:24:21 +01:00
Armin Novak
5e72694954 [winpr,secapi] remove reserved identifier 2026-01-08 11:07:38 +01:00
Armin Novak
4b277189ee [winpr,cast] use temporary variable in WINPR_ASSERTING_INT_CAST
avoid calling C++ functions twice by storing the input variable
2026-01-07 11:29:03 +01:00
akallabeth
acf04f1087 [winpr,platform] add C11 thread_local support 2025-12-10 15:22:54 +01:00
David Fort
65bb6c59fc rdpear: handle basic NTLM commands and fix server-side
This patch adds the handling of basic NTLM commands. Because there's some mysterious
4 zero bytes after pickle header in Kerberos packets, not present in NTLM commands, the
patch also had to rework a bit the packet parsing / forging.

The patch also addresses a server-side bug when parsing supplemental creds, if the client
was sending an empty list, we were considering this as an error.

And finally we also implement the parsing of MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL.
This breaks the public API, anyway this was basically unused (as not parsed before) and
the previous API was wrong as what we receive is MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL
not MSV1_0_SUPPLEMENTAL_CREDENTIAL, so I guess the API breakage is ok.
2025-12-04 11:31:09 +01:00
akallabeth
ce87165719 [c,attributes] mark functions with attirbute malloc 2025-11-07 11:20:39 +01:00
akallabeth
3db117283a [winpr,print] mark function WINPR_ATTR_MALLOC 2025-10-28 11:14:01 +01:00
akallabeth
0dd6d838bb [winpr,json] add WINPR_JSON_AddIntegerToObject
This function adds a integer value (in contrast to real values with
WINPR_JSON_AddNumberToObject) to a JSON object.
2025-10-28 11:13:44 +01:00
akallabeth
74648eb3a9 [c,standard] use C99 inline 2025-09-26 11:29:26 +02:00
Armin Novak
8f8cd89f69 [winpr,json] add jansson support
* Split JSON implementations in separate files
* Simplify JSON detection
* Add jansson implementation
2025-09-25 15:09:28 +02:00
Armin Novak
75787a62de [winpr,json] fix json-c case insensitive object get 2025-09-23 12:33:31 +02:00
akallabeth
a7c4a1a022 [winpr,platform] add macro to disable deprecations 2025-09-02 09:04:39 +02:00
akallabeth
2552408b8a [api] fix missing C++ guards 2025-08-29 12:25:32 +02:00
akallabeth
df89b04424 [winpr,wlog] Add specialized text log functions
The generic WLog_PrintMessage(VA) functions lack proper checks of the
supplied format strings.
Add WLog_PrintTextMessage(VA) functions that do compile time checks of
supplied format strings to uncover usage errors early and use them in
the logger macros.
2025-08-13 15:07:51 +02:00
akallabeth
6284bba9f0 [clang-tidy] fix various warnings
* silence tidy warnings for public API symbols (we can't fix these for
  compatibility reasons)
* fix issues with casting
2025-08-11 14:11:40 +02:00
David Fort
4f909a36a5 winpr: re-introduce the credentials module
The credential module from FreeRDP2 was removed, but sometime you still need to
have support for Cred[Marshal|Unmarshal]Credential especially when it's a
smartcard logon and that the cert sha1 is encoded using these functions.
2025-07-10 16:07:01 +02:00
akallabeth
ef6b4efdf4 [winpr,file] fix definition of winpr_CreateFile 2025-06-05 13:55:01 +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