Commit Graph

1088 Commits

Author SHA1 Message Date
Armin Novak
f62c658e17 [winpr] Make Stream_SafeSeek log a failure 2023-01-24 10:16:55 +01:00
akallabeth
92d3e3c64a [winpr] use WINPR_ prefix for conditional includes 2023-01-10 17:38:00 +01:00
David Fort
9e3bc8e3af wtsapi: add new kind of query to retrieve the open status 2022-12-27 11:02:29 +01:00
Armin Novak
b917dbad32 [winpr,stream] add length check helper 2022-12-22 15:09:03 +01:00
akallabeth
784becd946 [winpr,image] add winpr_bitmap_write_ex
Added a helper function writing a bitmap from an image that has a stride
that is not width * <bytes per pixel>
2022-12-16 11:03:13 +01:00
akallabeth
37ab25e19d Fixed all Wdocumentation warnings 2022-12-12 14:24:55 +01:00
akallabeth
bf0ce5bf3a [winpr,sspi] Fixed const correctness of API
sspi_GetAuthIdentityVersion and sspi_GetAuthIdentityFlags do not
modify, make arguments const
Same is true for sspi_GetAuthIdentityUserDomainW,
sspi_GetAuthIdentityUserDomainA, sspi_GetAuthIdentityPasswordA and
sspi_GetAuthIdentityPasswordW
2022-12-09 15:58:26 +01:00
akallabeth
fb6c48bcc3 [winpr] define WINPR_ASSERT to assert
If WITH_VERBOSE_WINPR_ASSERT is not set define WINPR_ASSERT to be the
normal C assert
2022-12-09 11:09:38 +01:00
Armin Novak
074f28073a [winpr,sspi] enable negotiate by default 2022-12-08 11:07:00 +01:00
Armin Novak
2784d54d6f Deprecate MultiByteToWideChar and WideCharToMultiByte 2022-11-28 10:42:36 +01:00
Armin Novak
6f2d7f94cf Deprecate ConvertFromUnicode and ConvertToUnicode 2022-11-28 10:42:36 +01:00
Armin Novak
2aefa9418d [winpr,stream] Added functions to read/write utf-8
* Stream_Write_UTF16_String_From_UTF8 writes a UTF-8 string to a
      stream in UTF-16 encoding
    * Stream_Read_UTF16_String_To_UTF8 reads a UTF-16 encoded string
      from the stream and returns it in UTF-8 encoding
2022-11-28 10:42:36 +01:00
Armin Novak
0fb8c9e87e [winpr,crt] Added ConvertMszWCharNToUtf8* 2022-11-28 10:42:36 +01:00
akallabeth
4f7114a140 [winpr,crt] Added ConvertMszUtf8NToWChar*
A conversion function that can handle multistrings (e.g. each element is
'\0' delimited, termination is '\0\0')
2022-11-28 10:42:36 +01:00
akallabeth
5c91c30a18 [winpr,crt] Added new unicode conversion functions
* Added functions converting WCHAR to/from UTF-8 with given buffers
  and proper size_t arguments to have a centralized check for
  integer overflows on RDP deserialization
* Added allocating functions converting WCHAR to/from UTF-8 as
  convenience
2022-11-28 10:42:36 +01:00
akallabeth
5ae159303f [winpr,crt] Added unicode conversion backends
* Support apple with NSString
* Support android via JNI
* Split ICU to own file
2022-11-28 10:42:36 +01:00
akallabeth
113290c35c [winpr,string] Use size_t arguments
* Use size_t arguments for ByteSwapUnicode, ConvertLineEndingToLF
  and ConvertLineEndingToCRLF
* Simplify code of line conversion functions
2022-11-28 10:42:36 +01:00
Armin Novak
7b95014157 [winpr,crypto] Split crypto header renamed
* Renamed custom winpr crypto function header
* Added compatiblity header
2022-11-23 09:39:56 +01:00
Armin Novak
d03f230426 [winpr,crypto] Split headers
Split windows API emulation from custom functions
Including both might yield issues with OpenSSL headers
2022-11-21 13:27:08 +01:00
Armin Novak
43eccb6247 [winpr,io] removed unused unimplemented functions 2022-11-21 09:16:54 +01:00
Mike Gilbert
3053543068 winpr/string.h: #include <stdio.h> for snprintf
Fixes failure with -Werror=implicit-function-declaration.

```
FAILED: libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o
/usr/bin/ccache /usr/bin/cc -DEXT_PATH=\"/usr/local/lib64/freerdp3/extensions\" -DFREERDP_EXPORTS -DNDEBUG -DWITH_OPENSSL -DWITH_VERBOSE_WINPR_ASSERT -DWITH_WAYLAND -DWITH_X11 -DWITH_XKBFILE -D_FILE_OFFSET_BITS=64 -Dfreerdp_EXPORTS -I/home/floppym/src/FreeRDP/winpr/include -I/home/floppym/src/FreeRDP/build/winpr/include -I/home/floppym/src/FreeRDP/build -I/home/floppym/src/FreeRDP/build/include -I/home/floppym/src/FreeRDP/include -Werror=implicit-function-declaration -fPIC -Wall -fvisibility=hidden -Wimplicit-function-declaration -Wredundant-decls -fno-omit-frame-pointer -O3 -DNDEBUG -flto=auto -fno-fat-lto-objects -fPIC -std=gnu11 -MD -MT libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o -MF libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o.d -o libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o -c /home/floppym/src/FreeRDP/libfreerdp/core/state.c
In file included from /home/floppym/src/FreeRDP/libfreerdp/core/state.c:24:
/home/floppym/src/FreeRDP/libfreerdp/core/state.c: In function ‘state_run_result_string’:
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: error: implicit declaration of function ‘snprintf’ [-Werror=implicit-function-declaration]
  186 | #define _snprintf snprintf
      |                   ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
   67 |         _snprintf(buffer, buffersize, "%s [%d]", name, status);
      |         ^~~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:25:1: note: include ‘<stdio.h>’ or provide a declaration of ‘snprintf’
   24 | #include <winpr/string.h>
  +++ |+#include <stdio.h>
   25 |
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: warning: incompatible implicit declaration of built-in function ‘snprintf’ [-Wbuiltin-declaration-mismatch]
  186 | #define _snprintf snprintf
      |                   ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
   67 |         _snprintf(buffer, buffersize, "%s [%d]", name, status);
      |         ^~~~~~~~~
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: note: include ‘<stdio.h>’ or provide a declaration of ‘snprintf’
  186 | #define _snprintf snprintf
      |                   ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
   67 |         _snprintf(buffer, buffersize, "%s [%d]", name, status);
      |         ^~~~~~~~~
cc1: some warnings being treated as errors
```

Bug: https://bugs.gentoo.org/881695
2022-11-18 06:43:11 +01:00
akallabeth
d71174d091 [winpr, crt] Added wcsstr implementation 2022-11-14 09:28:22 +01:00
akallabeth
ed57dd37b9 Added function _wcsncmp
* Compare WCHAR strings up to n characters
2022-11-14 09:28:22 +01:00
Armin Novak
dbb1889a54 Removed unused BipBuffer 2022-10-27 10:39:25 +02:00
akallabeth
22dce52d15 Add function winpr_MoveFileEx 2022-10-25 13:58:05 +02:00
Armin Novak
2a181c19c5 Added missing include 2022-10-19 20:33:17 +02:00
fifthdegree
e847f159a6 Try to use the smartcard key name Windows uses
Windows expects the containerName field in TSSmartCardCreds to be what
it would use for a smartcard key's name. Try to accomodate that (at
least for PIV and GIDS cards).
2022-10-19 18:55:38 +02:00
akallabeth
3a5fb5e3a3 Added replacement MD5 implementation 2022-10-19 08:17:11 +02:00
akallabeth
309a6bea77 Added replacement MD4 implementation 2022-10-19 08:17:11 +02:00
David Fort
f76c14c256 fix smartcard logon with smartcard emulation
When smartcard emulation was enabled we were dumping the key and cert to
temporary files for PKINIT call, but they were deleted before we have
actually done the PKINIT. This patch fixes it.

It also add debug statement for the listing of smartcard keys / certs.

This also fixes the listing of smartcard on certain windows configurations
were we have to force NCRYPT_SILENT when doing a NCryptOpenKey.
2022-10-13 12:03:58 +02:00
Marc-André Moreau
27a865af74 Add Negotiate SSPI authentication module filtering 2022-10-12 22:07:45 +02:00
Marc-André Moreau
eadbb15741 run clang-format 2022-09-30 19:33:12 +02:00
Marc-André Moreau
3224a43ee3 use SecurityFunctionTable version 3 with SetCredentialsAttributes function pointer 2022-09-30 19:33:12 +02:00
Marc-André Moreau
c7af6fabe0 add SetCredentialsAttribute to SecurityFunctionTable 2022-09-30 19:33:12 +02:00
Marc-André Moreau
61e5bdec6a add missing SSPI credential attribute IDs and structs 2022-09-30 19:33:12 +02:00
Marc-André Moreau
23f66f3987 add KDC URL to internal SSPI Kerberos settings 2022-09-30 19:33:12 +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
David Fort
c5c2e37f6d
More winpr fixes (#8255)
* Fix build with mingw

4a71cab2e7 broke wf_events.c.
The drive channel was not building because of missing definitions.

* winpr: make functions return False when not implemented
2022-09-28 16:07:04 +02:00
Kang Lin
195b98a9a9 WinPR::Clipboard: Refactor synthetic file
rename posix.c to synthetic_file.c
2022-09-26 14:01:20 +02:00
akallabeth
d2ab631c40
Test uri fix (#8232)
* Fixed TestUri unit test

* Make proper unit test out of the test function
* Add proper test cases

* Replace FindFirstFileA with FindFirstFileW for addins

This allows addin paths to contain unicode symbols.

* Fixed parse_uri_to_local_file definition

* Move to common clipboard.c file
* Move to header file so it can be included in test case

* Added WINPR_LOCAL for test builds

This macro exports internal functions in case of a unit test build
This way unit tests can access these without other workarounds.

* Fixed typo in function name is_dos_driver

* Cleaned up FindFirstFileW call

Use a wrapper function to convert to unicode and call the function

* Cleaned up BUILD_TESTING and EXPORT_ALL_SYMBOLS

* EXPORT_ALL_SYMBOLS now does as the name implies and exports all
  non static functions/variables from the library.
* BUILD_TESTING now only sets the defines for test code and
  activates EXPORT_ALL_SYMBOLS to allow tests to access internal
  code

* Fixed windows client warnings

* disable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
2022-09-26 11:22:02 +02:00
David Fort
ccffa8dfa2 winpr: add a function to export timer file descriptor
The equivalent exist for Events, and it happens that sometime you also need to access
the internal file descriptor associated with a timer.
2022-09-23 09:04:45 +02:00
David Fort
ee9c9e7c48 Remove duplicated definitions for file constants 2022-09-21 09:03:45 +02:00
David Fort
3dcc4f4024 fix build for mingw-clang 2022-09-21 09:03:45 +02:00
fifthdegree
7901a26a16
Kerberos User 2 User support (#8070)
* add support for 64-bit big-endian encoding

* kerberos: drop reliance on gssapi and add user 2 user support

* Fix local variable declared in the middle of the function body

* kerberos: add ccache server option

Co-authored-by: fifthdegree <fifthdegree@protonmail.com>
Co-authored-by: David Fort <contact@hardening-consulting.com>
2022-08-17 12:25:26 +02:00
David Fort
1f08cb9a7d
Drdynvc needs love (#8059)
* winpr: add lock operation on HashTables

* drdynvc: change the listeners array for a hashtable and other micro cleanups

* logonInfo: drop warning that is shown at every connection

Let's avoid this log, we can't do anything if at Microsoft they don't respect
their own specs.

* rdpei: fix terminate of rdpei

* drdynvc: implement the channel list with a hashtable by channelId
2022-07-26 12:53:41 +02:00
fifthdegree
5f3bc5842a nla: use winpr asn1 library 2022-07-26 09:38:53 +02:00
Armin Novak
36c7c0320b Fixed review comments 2022-07-07 17:31:49 +02:00
fifthdegree
2a3c92b4cc spnego: use winpr asn.1 library 2022-07-07 17:31:49 +02:00
Pascal Nowack
43b609cd6c winpr/clipboard: Allow overriding ValidFileNameComponent call
When using the wClipboard API, the connected peer might not be on the
Windows platform, where further filename restriction exists.
As a result, it is currently not possible to use the wClipboard API,
when intending to allow filenames, containing characters like ':'.

So, add a callback to the wClipboardDelegate, which is set to the
ValidFileNameComponent call by default.
This callback can be overridden by the API user, when it is known, that
there is no need to impose very strict filename restrictions.
2022-07-07 07:45:26 +00:00
David Fort
168117e85b winpr: fix encoding of octetString containers and add required functions for SPNego 2022-07-05 15:04:01 +02:00
akallabeth
05b339b0b1 Added strndup replacement 2022-07-04 14:31:08 +02:00
David Fort
bddb71230e winpr asn1: fixes and more features
This patches adds support for octet string containers that are used by SPNego
(a subfield is contained in an octet string record).
It also adds a performance test to test reallocations in asn1 encoder.
It fixes reallocation problems for both chunks and containers.
2022-07-01 09:43:01 +02:00
David Fort
cbda255dcd winpr: add some ASN1 parsing functions
This patch implements ASN1 parsing in WinPR, as we need it in SSPI packages.
2022-07-01 07:51:31 +02:00
akallabeth
7faf18d9dd Updated flags required by [MS-RDPERP] 2022-06-29 11:41:45 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
fifthdegree
c51348a33b fixes 2022-06-21 10:27:17 +02:00
fifthdegree
e66b99f8dc deprecate old hash callback field 2022-06-21 10:27:17 +02:00
fifthdegree
6d3aa52496 set SAM file and hash callback on credential rather than context 2022-06-21 10:27:17 +02:00
fifthdegree
eeece1a027 server-side kerberos (and some fixes) 2022-06-21 10:27:17 +02:00
fifthdegree
1c012b09b8 implement proper SPNEGO negotiation 2022-06-21 10:27:17 +02:00
akallabeth
f25261e271 Unifiy string append functions 2022-06-17 08:41:46 +02:00
Marc-André Moreau
1d5c0be5ec Add settings to load a custom SSPI shared library module 2022-06-01 15:16:12 +02:00
akallabeth
4c452a96c4 Fixed broken #define guards 2022-05-12 11:36:01 +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
David Fort
a612ca4ba2 winpr: fix unitary test when CreateProcess is CreateProcessW
As the second argument of CreateProcessW is modified to split with spaces and so
this can not be a const arg.
2022-05-05 13:11:18 +02:00
akallabeth
6ce3499e13
Settings getter tests (#7869)
* Added tests for freerdp_[static|dynamic]_collection_* functions

* Added settings unit test for clone functions

* Fix argument for winpr_RAND and winpr_RAND_pseudo

Using void* eliminates all assumptions of which type the buffer is.
This eliminates unnecessary warnings.
2022-05-02 11:39:38 +02:00
akallabeth
9330559d24 Defined and use _write 2022-04-29 14:27:44 +02:00
akallabeth
00b00ea521 Added unwind.h support 2022-04-29 14:27:44 +02:00
akallabeth
860f44f762 CMake check_include and struct cleanup
Move to WinPR what should be there.
2022-04-29 14:27:44 +02:00
akallabeth
d63817640f Fixed ArrayList_SetItem, return success 2022-04-28 12:37:19 +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
Armin Novak
2dc98adb62 Updated _wcschr and _wcsrchr to match MSDN spec 2022-04-27 19:42:04 +02:00
Armin Novak
5482607b15 Added Stream_PointerAs
This macro allows retrieving the stream pointer casted to correct
type.
2022-04-27 19:42:04 +02:00
Armin Novak
08035be41b Added missing WINPR_API 2022-04-25 16:06:34 +02:00
akallabeth
74c1a006e9 Fixed format string for Stream_CheckAndLogRequiredLength
__LINE__ requires %d and not %PRIuz
2022-04-23 10:10:09 +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
David Fort
f232562d8b smartcard: take in account the module path for listing smartcards
The PKCS1 module was taken only for the kerberos part.
Also make as exported the winpr_NCryptOpenStorageProviderEx function.
2022-04-15 09:06:09 +02:00
akallabeth
47bd162065 Added function sspi_SetAuthIdentityW 2022-03-28 15:52:59 +02:00
akallabeth
905609381f Unified sspi_FreeAuthIdentity 2022-03-28 15:52:59 +02:00
Zhengyi Fu
e62aaff319 winpr: add GetFileInformationByHandle 2022-03-24 13:40:31 +01:00
Mike Gabriel
d337ea9c16 winpr/{libwinpr/thread/thread.c,include/winpr/thread.h}: Keep DumpThreadHandles as a symbol even if WITH_DEBUG_THREADS is OFF. 2022-03-08 09:16:10 +01:00
Armin Novak
d1f8c00f7b Fixed duplicated symbols 2022-03-03 11:26:48 +01:00
Armin Novak
6ed50b4b1d Refactored WinPR includes 2022-03-03 11:26:48 +01:00
Armin Novak
001c505572 Const corrected function sspi_CopyAuthIdentity 2022-02-24 14:48:46 +01:00
Armin Novak
f4572b082a Use typedef struct definition for sspi types 2022-02-24 08:52:25 +01:00
David Fort
0435b5a65d Implement smartcard logon 2022-02-24 08:52:25 +01:00
David Fort
310f2047bf fix build with mingw 7 2022-02-24 08:52:25 +01:00
Armin Novak
99d63ea89e Fixed missing static and WINPR_API 2022-02-24 08:52:25 +01:00
David Fort
cb351a099d Enable smartcard NLA logon 2022-02-24 08:52:25 +01:00
David Fort
a563a6836b winpr: ncrypt add a property to retrieve the PKCS11 slotId 2022-02-24 08:52:25 +01:00
akallabeth
f568d70d52 Fixed guards 2022-02-18 08:38:28 +01:00
Armin Novak
bf9f1eccc1 Fixed issued with mingw build 2022-02-18 08:38:28 +01:00
Armin Novak
5f8ab14f3f Cleaned up registry value reading, added warnings 2022-02-15 13:43:36 +00: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
77580466ae Removed cached wlog pointer 2022-02-01 11:04:32 +00:00
Armin Novak
1c2bf9f031 Made HRESULT_FROM_WIN32 a static inline 2022-02-01 11:04:32 +00:00
Armin Novak
ccaf3c938c Added Stream_ConstPointer 2022-02-01 10:25:37 +00:00
Armin Novak
10e40147fb Fixed various const warnings 2022-02-01 10:25:37 +00:00
Armin Novak
a40467b3b0 Added Stream_ConstBuffer function 2022-02-01 10:25:37 +00:00
Armin Novak
02896b0656 Fixed warnings from WLOG_ASSERT 2022-02-01 08:48:21 +01:00
Armin Novak
ca30e749e9 Fixed unused-but-set-variable and reserved identifier warnings 2022-02-01 08:48:21 +01:00
Armin Novak
bc08ebc01c Corrected const arguments for wStream functions
Functions only extracting values now use const for wStream argument
2022-01-31 16:13:06 +01:00
Armin Novak
6fc260b285 Fixed integer range warnings, added tests 2022-01-31 16:13:06 +01:00
Armin Novak
d4e557122b Fixed constant definitions
Define signed values instead of raw values
2022-01-31 16:13:06 +01:00
Armin Novak
92c3fd5d59 Fixed unnecessary cast in headers 2022-01-31 16:13:06 +01:00
Armin Novak
0feee85952 Fixed cast warnings due to defines 2022-01-31 16:13:06 +01:00
Armin Novak
03e454d7d0 Fixed missing brace 2022-01-31 15:55:10 +01:00
Armin Novak
e7913b4720 Fixed some reserved names 2022-01-31 15:55:10 +01:00
akallabeth
e6e6ed5dbd Cleaned up PubSub
* Callback arguments now const
* Fixed missing includes
2022-01-19 09:24:57 +01:00
David Fort
130f191392 winpr: fix some string constant in ncrypt and add reader property
Some WCHAR string constant were wrong (missing \x00 at the end).
The commit also implements the NCRYPT_READER_PROPERTY property in the pkcs11 provider.
2022-01-17 16:27:53 +01:00
David Fort
eb53b9913a winpr: interpret the scope paramater in NCryptEnumKeys
Although the official documentation claims that pszScope parameter shall be set to
NULL. In practice setting it to \\.\<reader name>\ allows to filter on the corresponding
reader.
2022-01-17 16:27:53 +01:00
Marc-André Moreau
55be5f8bb0 Fix Windows Unicode handling of environment variables 2022-01-11 12:32:14 +01:00
David Fort
599bc18f33 winpr: fix bcrypt.h string constants 2022-01-10 11:02:45 +01:00
David Fort
bfe8b464be winpr: fix and enhance ncrypt
This patch adds the NCryptEnumStorageProviders function.
It also fixes strings bugs with the compiler taking the WCHAR "Micro" string
M\x00i\x00c\x00r\x00o\x00 as
M\x00i\x0c\x00r\x00o\x00, and so generating unexpected behaviours. The solution is
to split string constants when you hit a character that is a valid hex number, so
that the compiler doesn't interpret i\x00c\x00 (ic in WCHARs) as i\x0c\x00 (weird
string).
2022-01-10 11:02:45 +01:00
Armin Novak
98348ef62a Removed ndr.h from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
ed9cc8c1cc Removed heap module from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
4f0f8e9f8c Removed credentials module from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
5365b2f5f0 Removed midl.c|h from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
3de6af34ed Removed unused module winhttp 2021-12-23 14:27:12 +01:00
Armin Novak
379aeed24e Removed unimplemented credui module 2021-12-23 14:27:12 +01:00
Armin Novak
a713d5417e Remove unimplemented wnd module 2021-12-23 14:27:12 +01:00
Armin Novak
b30f8886b2 Fixed LinkedList const correctness 2021-12-15 13:36:15 +01:00
David Fort
d4020e2328 winpr: implement ncrypt API
This implements the emulation for the ncrypt API and more specifically the smartcard
provider so that we can list available keys and certificates using pkcs11-helper.
2021-12-14 14:12:01 +01:00
David Fort
a6cadd6f97 winpr: fix compilation for mingw
Depending on the version of mingw some export macro aren't always defined.
2021-12-14 14:12:01 +01:00
akallabeth
d1adfd5ecc Fixed check for TARGET_OS_IPHONE and TARGET_OS_WATCH 2021-11-25 12:25:18 +01:00
David Fort
67986ea298 Fix compilation with mingw
This patch addresses some issues when compiling against mingw. With these changes
FreeRDP can be compiled out-of-the box on a Ubuntu 20.04.
2021-11-15 09:23:16 +01:00
Armin Novak
68eb6e4afc Drop ASN1 module stub
Not implemented, just creates confusion.
2021-11-02 15:13:20 +01:00
Armin Novak
319b0e1b7e Queue_Enqueue const argument
By default use const for the object enqueued.
If a `fnObjectNew` function is set, it is copied anyway.
For the case without cast away the const internally.
2021-10-18 16:09:13 +02:00
akallabeth
3ccb96d52f Fixed #7350: Warnings with Stream_StaticInit
* Properly initialize the stream buffer
* Add Stream_StaticConstInit accepting a const buffer
* Modify API to return a pointer to the stream initialized
2021-10-14 12:11:16 +02:00
Armin Novak
439ec62cff Hide implementation of certain stream functions 2021-10-06 09:49:07 +02:00
Armin Novak
18a3fcf2fc Updated wStream API and added torough checks
* Do length/capacity checks in every read/write/seek function
  if WINPR_ASSERT is defined.
* Ensure s->pointer is valid, e.g. within s->buffer + s->capacity
  (Stream_Rewind, Stream_Seek, ...)
* Add return values to Stream_Set* functions so inalid arguments
  can be reported to the caller
* Deprecated problematic stream manipulation functions
  (Stream_SetBuffer, Stream_SetPointer, Stream_SetCapacity)
* Ensure length/capacity functions never return a value larger
  than the actual length/capacity
2021-10-06 09:49:07 +02:00
akallabeth
cb5ccec212 Cleaned up some possible race conditions with threads
* ExitThread no longer NORETURN, this eases handling of threads.
* Fixed a (rare) race condition when starting a thread
* Made global thread_list optional (you lose the exit code from
  ExitThread)
2021-09-20 10:59:59 +02:00
akallabeth
76979a47fb Added new CMake option to dump event handles in use 2021-09-20 10:59:59 +02:00
akallabeth
d80b418bbc Added object copy support to queue
* Added object copy support to Queue_Enqueue
* Added Queue_Discard to clear the top of the queue
* Added some doxygen for queue functions.
2021-09-20 10:59:59 +02:00
Armin Novak
0fe1e2359e Fixed all reserved-id-macro warnings 2021-09-10 08:16:25 +02:00
Armin Novak
ba0da04217 Fixed compilation warnings and duplicate defines 2021-09-09 08:53:20 +02:00
Armin Novak
9f0eff604e Silence GCC reserved-id-macro warnings in compatibility header 2021-09-09 08:53:20 +02:00
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
fbae9ba88c Added LoadLibraryX and LoadLibraryExX
These functions take a UTF8 string and load a library with
LoadLibraryW under windows.
2021-09-03 08:29:15 +02:00
Armin Novak
737f5a2036 Fixed argument const correctness 2021-08-27 13:21:02 +02:00
akallabeth
f1bde376b1
Raw channel send (#7255)
* Added raw channel data write function

* Use nego_set_state

* Added ArrayList_ForEachAP

* Provide va_copy for older VS compilers
2021-08-26 16:17:51 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Armin Novak
cbb06a7c17 Fixed DsParse implementations and tests
* Implemented DsMakeSpnW
* Removed unimplemented DsCrackSpnA and DsCrackSpnW
2021-08-24 10:45:57 +02:00
Armin Novak
af0ce13d8a Removed not implemented module 2021-08-24 10:45:57 +02:00
Fabrice Fontaine
0976cce458 winpr/include/winpr/file.h: fix build on uclibc
Include stdio.h to fix the following build failure with uclibc raised
since version 2.4.0 and
eb6777ea69:

In file included from /tmp/instance-0/output-1/build/freerdp-2.4.0/winpr/libwinpr/utils/lodepng/lodepng.c:30:
/tmp/instance-0/output-1/build/freerdp-2.4.0/winpr/include/winpr/file.h:524:11: error: unknown type name 'FILE'
 WINPR_API FILE* winpr_fopen(const char* path, const char* mode);
           ^~~~

Fixes:
 - http://autobuild.buildroot.org/results/31e770a330158035e24b7b952bec0030138482b7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-08-01 09:37:24 +02:00
akallabeth
534d30beb3
No deprecated (#7107)
* Removed cmake options disabling compiler warnings

* Added deprecation compile options

* Fixed android client use of deprecated symbols

* Removed obsolete callback
2021-06-22 14:39:10 +02:00
akallabeth
b453d5e40e Fixed rdtk, uwac and winpr standalone builds 2021-06-22 08:54:18 +02:00
Armin Novak
09cf11ecf0 WinPR: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
Armin Novak
2e0d1cc33c Fixed integer warnings, fixed data types 2021-06-17 10:35:22 +02:00