Commit Graph

159 Commits

Author SHA1 Message Date
Rene Rheaume
5f9c36da5d * Use futimens that is POSIX-compliant and compatible with uclibc instead of futimes.
* Borrowed eventfd_read and eventfd_write from bionic for uclibc compatibility (uclibc headers are broken unfortunately). Bionic and
FreeRDP are both under the Apache 2.0 license.
2014-08-06 22:06:01 -04:00
Bernhard Miklautz
a124f6a7c6 fix comment style
// to /* */
2014-07-29 05:22:30 +02:00
Bernhard Miklautz
a9eed46e38 Fix warnings found in Xcode 2014-07-29 05:22:30 +02:00
Bernhard Miklautz
b8415af0d8 Fix compiler warnings.
This commit is based on pull request #1493
2014-07-29 05:22:29 +02:00
Norbert Federa
cdcdec99bc OpenSSL thread safety
freerdp/winpr had the following issues:
* The non reentrant SSL_library_init() was called concurrently (crash)
* Missing code/api to set the eventually required OpenSSL static and dynamic locking callbacks
* Missing code/api to free the application-global or thread-local OpenSSL data and tables

This commit creates two new winpr functions:

BOOL winpr_InitializeSSL(DWORD flags):

Use the flag WINPR_SSL_INIT_ALREADY_INITIALIZED if you want to tell winpr that
your application has already initialized OpenSSL.
If required use the flag WINPR_SSL_INIT_ENABLE_LOCKING to tell winpr that it
should set the OpenSSL static and dynamic locking callbacks.
Otherwise just call it with the flag WINPR_SSL_INIT_DEFAULT.

The recommended way is that your application calls this function once before
any threads are created. However, in order to support lazy OpenSSL library
initialization winpr_InitializeSSL() can also safely be called multiple times
and concurrently because it uses the new InitOnceExecuteOnce() function to
guarantee that the initialization is only performed successfully once during
the life time of the calling process.

BOOL winpr_CleanupSSL(DWORD flags):

If you create a thread that uses SSL you should call this function before the
thread returns using the flag WINPR_SSL_CLEANUP_THREAD in order to clean up
the thread-local OpenSSL data and tables.
Call the function with the flag WINPR_SSL_CLEANUP_GLOBAL before terminating
your application.

Note: This commit only replaced the current occurences of the
SSL_load_error_strings(); SSL_library_init(); pairs in the freerdp source
with winpr_InitializeSSL(). None of the server or client applications has been
changed according to the recommended usage described above (TBDL).
2014-07-28 21:55:57 +02:00
Norbert Federa
fae8f6fbf2 winpr/sync: Added InitOnceExecuteOnce plus CTest 2014-07-24 21:12:59 +02:00
Marc-André Moreau
e6f4754ed3 winpr: improve windows builds across visual studio versions and toolsets 2014-07-17 15:11:04 -04:00
Norbert Federa
6b47229563 Merge pull request #1955 from nfedera/fix-2014-07-10-02
winpr: CloseHandle did not release the thread TCB
2014-07-11 16:35:12 +02:00
Norbert Federa
aac57e7e72 winpr: CloseHandle did not release the thread TCB
This resulted in huge memory leaks - 8MB per thread, depending on
the system's default stack size.
The leak happend even if CloseHandle() was correctly used to "detach"
the thread but WaitForSingleObject was never called.
2014-07-10 12:28:35 +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
f09076e4d2 Add a guard on nCount with MAXIMUM_WAIT_OBJECTS + cosmetic fixes 2014-07-07 14:50:05 +02:00
Hardening
4bb910fec5 Fixed a typo 2014-07-04 22:14:04 +02:00
Hardening
16681cc91a Fix header inclusion 2014-07-04 16:11:19 +02:00
Hardening
4b3dc22a79 Fix missing include for macOS 2014-07-04 15:29:21 +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
ad8f031a88 Merge pull request #1864 from MartinHaimberger/namedpipefix
fixed introduced winpr bug in namedpipes
2014-05-26 08:10:28 -04:00
Martin Haimberger
c958f81016 fixed introduced winpr bug in namedpipes
Bug was introduced by 5e09e37d42
2014-05-26 03:04:22 -07:00
Marc-André Moreau
ae368549ad freerdp: fix compilation on Windows 2014-05-22 14:42:05 -04:00
Marc-André Moreau
4bac8374de Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-05-21 11:17:58 -04:00
Marc-André Moreau
472c231876 Merge pull request #1826 from Hobby-Student/master
fix FreeBSD compile errors
2014-05-21 10:53:47 -04:00
Marc-André Moreau
fb3662c7e2 winpr: fix ranlib missing symbols warnings on OS X 2014-05-09 22:44:19 -04:00
Marc-André Moreau
c1d727e9cd freerdp: fix type build warnings 2014-05-09 15:44:49 -04:00
Marc-André Moreau
a202fe4057 freerdp: fix several type related warnings 2014-05-08 18:02:02 -04:00
Hobby-Student
18d70c6cda FreeBSD compile errors - add comments 2014-05-01 15:24:11 +02:00
Hobby-Student
7c8e1681cc FreeBSD compile errors - fix typo 2014-05-01 15:17:54 +02:00
Hobby-Student
03315cebe8 FreeBSD compile errors 2014-05-01 15:09:35 +02:00
Zhang Zhaolong
88760cbd83 libwinpr: fix memory leak in case TimerQueue is NULL. 2014-04-26 11:36:35 +08:00
Bernhard Miklautz
b817e92e5e cmake: mark required libraries for export 2014-04-23 10:16:02 +02:00
Marc-André Moreau
14b75d1b27 libfreerdp-core: fix build warnings and windows broken build 2014-03-25 15:19:52 -04:00
Benoît LeBlanc
557c082458 Merge branch 'master' of git://github.com/awakecoding/FreeRDP 2014-03-05 16:35:22 -05:00
Marc-André Moreau
fb2428309c mfreerdp: apply fixes from mac-audio branch 2014-03-03 16:57:43 -05:00
Marc-André Moreau
a143a70114 libfreerdp-core: link against libwinpr-wtsapi, dynamically register proper WtsApi implementation in FreeRDS 2014-02-16 20:41:19 -05:00
Hardening
13fc57fa86 Fix GetEventFileDescriptor() with server NamedPipe
The GetEventFileDescriptor() function was not returning the correct
file descriptor with the server HANDLE.
2014-02-07 15:18:17 +01:00
Benoît LeBlanc
53f2b8511d Merge branch 'master' of git://github.com/awakecoding/FreeRDP 2014-02-06 12:13:39 -05:00
Marc-André Moreau
c799db6855 libwinpr-synch: fix linker error 2014-02-05 13:09:25 -05:00
Benoît LeBlanc
9d929469d2 Merge branch 'master' of git://github.com/awakecoding/FreeRDP
# By Marc-André Moreau (27) and others
# Via Marc-André Moreau
* 'master' of git://github.com/awakecoding/FreeRDP: (48 commits)
  afreerdp: fix build on Android
  libwinpr-wtsapi: include wtsapi32.h on Windows
  wfreerdp: fix target exporting
  wfreerdp: fix building against OpenSSL with MONOLITHIC_BUILD and shared libraries
  wfreerdp: fix test build issues
  libwinpr-crypto: implement CryptProtectMemory/CryptUnprotectMemory
  libwinpr-memory: add missing definitions
  libwinpr-memory: start stubbing
  Increased size of stream on GCC conference create request from 512 to 1024.  For large numbers of static virtual channels, the stream was being overflowed and was causing crashes.
  Fixes to process new command line options (autodetect, heartbeat, multitransport), join the MCS message channel and process auto-detect PDUs during the connection sequence.
  wfreerdp: fix build against static openssl library
  winpr-hash: fix building against openssl in static mode
  libfreerdp-gdi: fix invalidation of region with line drawing
  mfreerdp: fix hungarian keyboard '0' and 'i' key inversion
  Fixes build issue on Windows
  libwinpr-synch: add active/inactive linked list for timer queue
  libwinpr-synch: improve timer queue implementation
  libwinpr-synch: make use of head's expiration time in timer queue
  libwinpr-synch: make use of timespec for timer queue
  libwinpr-synch: improve timer queue implementation
  ...

Conflicts:
	client/common/CMakeLists.txt
2014-02-04 11:37:40 -05:00
Benoît LeBlanc
04734d8f37 ts_add_ms: replaced while() that could result in infinite lock 2014-02-04 11:35:16 -05:00
Marc-André Moreau
fab61ba946 afreerdp: fix build on Android 2014-02-03 16:03:43 -05:00
Marc-André Moreau
ae2a51fdc5 Merge branch 'master' of https://github.com/FreeRDP/FreeRDP 2014-01-28 22:58:18 -05:00
Alessandro Pilotti
9d6dcab3c6 Fixes build issue on Windows
Solves the following build issue:

error C2373: 'InitializeCriticalSectionEx' : redefinition;
different type modifiers
2014-01-28 01:09:14 +02:00
Marc-André Moreau
eb38b9f1e1 libwinpr-synch: add active/inactive linked list for timer queue 2014-01-27 10:37:38 -05:00
Marc-André Moreau
159f539ef2 libwinpr-synch: improve timer queue implementation 2014-01-26 21:56:07 -05:00
Marc-André Moreau
1f394eb81d libwinpr-synch: make use of head's expiration time in timer queue 2014-01-26 20:49:48 -05:00
Marc-André Moreau
3616b19290 libwinpr-synch: make use of timespec for timer queue 2014-01-26 20:39:13 -05:00
Marc-André Moreau
2e45ad143f libwinpr-synch: improve timer queue implementation 2014-01-26 17:21:12 -05:00
Marc-André Moreau
656766ca2e libwinpr-synch: start implementing timer queue 2014-01-26 12:37:38 -05:00
Marc-André Moreau
d5fcd78b65 libwinpr-synch: fix build on OS X 2014-01-26 00:06:27 -05:00
Marc-André Moreau
d2405a25f8 libwinpr-synch: initial waitable timer asynchronous procedure callback support 2014-01-24 22:44:23 -05:00
Marc-André Moreau
9a4fb396da libwinpr-synch: add unit test for waitable timer asynchronous procedure calls 2014-01-24 18:08:06 -05:00
Marc-André Moreau
fab0cd2779 libwinpr-synch: stub timer queues 2014-01-24 17:48:55 -05:00