Commit Graph

21 Commits

Author SHA1 Message Date
Bernhard Miklautz
aa2709a999 winpr: create a specific winpr nt file handle
There exist two definitions of WINPR_FILE: in file/ and in nt/.
Both are different definitions used differently. Therefore split them
into WINPR_FILE and WINPR_NT_FILE.
2016-01-12 16:10:25 +01:00
David FORT
16d36e3083 A malloc() pass on WinPR
This patch treats remaining non-checked mallocs. And changes to calloc in places
where it makes sense
2015-06-22 19:10:00 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Bernhard Miklautz
850de59b55 winpr: add checks for *alloc
Add missing checks if memory allocation was successful. Also adapt
caller(s) when possible.
2015-04-08 11:34:37 +02:00
Marc-André Moreau
398eab35d4 libwinpr-wtsapi: add Win32 winsta.dll-based VC implementation 2014-10-13 10:55:11 -04: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
Bernhard Miklautz
b817e92e5e cmake: mark required libraries for export 2014-04-23 10:16:02 +02:00
Bernhard Miklautz
2b6b4a6685 updated file headers 2013-12-04 11:44:22 +01:00
Marc-André Moreau
55565e056c freerdp: export targets 2013-10-28 23:06:39 -04:00
Marc-André Moreau
5fb65101e9 libwinpr-nt: make test successfully call NtCreateFile on Windows 2013-10-23 19:32:32 -04:00
Marc-André Moreau
e2fe00fd37 libwinpr-nt: load and make use of original Rtl* functions on Windows 2013-10-23 18:57:41 -04:00
Marc-André Moreau
1de70aa064 libwinpr-nt: dynamically load original NtCreateFile functions on Windows, extend tests 2013-10-23 18:15:10 -04:00
Marc-André Moreau
ebc096f2b2 libwinpr-nt: fix conflict for NtCreateFile on Windows 2013-10-22 21:38:16 -04:00
Marc-André Moreau
888812eaa0 libwinpr-nt: stub more of the native file API 2013-10-22 20:47:29 -04:00
Norbert Federa
6f9a8dbc1e winpr: greatly improved NtCurrentTeb performance
Use pthread_setspecific/pthread_getspecific to store/retrieve the thread
environment block (TEB). Use pthread_once to trigger the creation of that
data from within NtCurrentTeb.
This allows us to get rid of the process environment block stuff which
was only used to provide serialized access to a thread table in order to
retrieve the TEB.

NtCurrentTeb is currently only as a per-thread storage location for the
last error value used by SetLastError and GetLastError.

Also made the TestErrorSetLastError CTest a bit more demanding.
It makes sure the 4 threads run for at least 2 seconds.
Each thread constantly calls SetLastError with a random value and checks
if GetLastError returns the same value again. The total amount of
these iterations is calculated in order to measure the performance.

This change increases the NtCurrentTeb performance by roughly 50% on
linux and by several thousand percent (yes) on Mac OS X.

Thanks for watching.
2013-10-11 19:34:23 +02:00
Marc-André Moreau
e8a8c1cf7f winpr: fix crashing tests 2013-09-19 14:17:00 -04:00
Marc-André Moreau
0c17eb1a23 winpr: fix unit tests on Windows 2013-09-19 13:50:00 -04:00
Marc-André Moreau
8f1aceac6a libwinpr-nt: add missing link dependency 2013-09-16 17:49:16 -04:00
Marc-André Moreau
c1625c1ead libwinpr-wtsapi: start implementation, extend NtApi 2013-08-22 19:20:59 -04:00
Marc-André Moreau
d5679889f3 libwinpr-nt: start implementing core NTDLL functions 2013-08-22 13:30:44 -04:00
Marc-André Moreau
68ec10a9d9 libwinpr-nt: implement NtCurrentTeb() 2013-08-22 10:18:38 -04:00