Commit Graph

739 Commits

Author SHA1 Message Date
Bernhard Miklautz
97edeca204 Merge pull request #2874 from akallabeth/stdtypes
Using stdint.h and stdbool.h for type definitions
2015-12-17 16:37:54 +01:00
Armin Novak
d25855b287 Added comment to generated defines. 2015-12-17 16:25:16 +01:00
Armin Novak
33500b400d Removed obsolete wtypes.h 2015-12-17 13:30:41 +01:00
Armin Novak
ef23b4568c Renamed HAVE_STDXX_H in public header. 2015-12-17 13:15:00 +01:00
Armin Novak
f8565b8b75 Generating wtypes.h now with used defines. 2015-12-17 12:01:52 +01:00
Armin Novak
120e5e2d43 Moved header detection defines to config.h 2015-12-17 11:28:03 +01:00
Armin Novak
864f06b161 Added missing include. 2015-12-17 10:59:59 +01:00
Armin Novak
d339b986de Fixed broken #if #endif. 2015-12-14 14:18:51 +01:00
Armin Novak
533e14745e Fixed broken objective C detection. 2015-12-14 14:18:51 +01:00
Armin Novak
ff24885ff3 Fixed mixup of type defines. 2015-12-14 14:18:51 +01:00
Armin Novak
6e69caad9f Disabled definition of BOOL for objective C 2015-12-14 14:18:50 +01:00
Armin Novak
63894eb4e7 Using stdint.h and stdbool.h for type definitions
When stdint.h or stdbool.h are detected, use these
standard types for definitions in wtypes.h
2015-12-14 14:18:50 +01:00
Armin Novak
19744f3bb8 Added additional file functions and tests. 2015-12-09 18:29:16 +01:00
Armin Novak
d0e3528c8e Added winpr_strerror function. 2015-12-09 18:27:37 +01:00
Armin Novak
a04f1f8fc5 Added missing _snprintf define. 2015-12-09 18:27:05 +01:00
Marc-André Moreau
8cc799f599 libwinpr-synch: fix non-Win32 build 2015-11-26 09:43:23 -05:00
Marc-André Moreau
c0c9c9353e winpr: more Win32 fixes 2015-11-25 14:41:32 -05:00
Marc-André Moreau
2f5d159448 winpr: fix WinXP backwards compatibility 2015-11-25 13:46:10 -05:00
ilammy
4b67513f3c winpr/clipboard: add CF_RAW clipboard format ID
This fixed-ID format is aleady used and supported implicitly by
wClipboard, so we are just codifying its ID for the client use.
2015-11-14 19:03:10 +02:00
Bernhard Miklautz
bff63b3ee2 wlog: cleanup API includes
Only include necessary header files.
2015-11-10 16:29:09 +01:00
Bernhard Miklautz
07417599ce wlog: rework, cleanup and stabilize API
* only expose necessary functions and types in header
* don't expose appender internals
* add generic function WLog_ConfigureAppender to have the possibility
  to configure appender specific settings
* detect appender availability if WLog_SetLogAppenderType or
  WLog_Appender_New return FALSE or NULL respectively the appender isn't
  available or the initialization failed. This is very useful for the
  use with optional appenders.
* add Free to the appender interface. At the time of the Free the
  appender is known and available so it can be called directly (instead
  of calling the right function according to the type)
* make all appender internal function static
* all appenders return the generic wLogAppender type now. Typecasts
  are internally done where necessary this abstracts the appenders more
  cleanly
2015-11-09 18:25:45 +01:00
David FORT
5fbf26acf2 Add an UDP appender to wLog
This appender allows to receive the logs over a network connection using UDP packets.
You can see the logs using a listening netcat, for example: nc -ul 127.0.0.1 20000.
2015-11-04 18:11:19 +01:00
Hardening
3d6e1fb418 Merge pull request #2951 from bmiklautz/friday
Misc fixes
2015-11-02 10:50:16 +01:00
David FORT
2a8de84342 Take in account @bmiklautz remarks
* I have added a function to set the journal identifier
* the appender name has been changed from SYSTEMD to JOURNALD
2015-11-01 21:34:03 +01:00
David FORT
9ea301983d Adds a systemd journal appender 2015-10-30 14:50:14 +01:00
David FORT
0cf2a0e50b Don't include config.h in public headers
In fact we don't need the ifdefery in public headers, so don't include unneeded
config.h file.
2015-10-29 10:32:58 +01:00
David FORT
382993d4d5 Include config.h file when needed 2015-10-27 21:45:26 +01:00
Bernhard Miklautz
c70559d128 winpr API: add EnvironmentBlockToEnvpA
* expose EnvironmentBlockToEnvpA
* cleanup includes in process.c
* removed unused "flag" variable in _CreateProcessExA
* make ProcessHandleCloseHandle static
2015-10-23 18:38:42 +02:00
David FORT
720c879661 Add a wLog syslog appender 2015-10-22 10:37:49 +02:00
Martin Haimberger
b2398b3a9a wlog: fixed return values
wlog used to return an int but the only meaning
of the return value was:

 * negative ... error
 * 0 or positive ... success

but the positve returned value was 1 or some id of some
subsystem, nothing meaningful for the caller.

For a more meaningful returnvalue we now use BOOL.

If something goes wrong FALSE is returned.
2015-10-21 01:11:06 -07:00
Marc-André Moreau
6ab29da576 libwinpr-crypto: fix error checking 2015-10-13 09:43:26 -04:00
Marc-André Moreau
87780a850d Merge branch 'master' of github.com:FreeRDP/FreeRDP into mbedtls 2015-10-09 15:58:50 -04:00
Marc-André Moreau
4f769866d7 winpr: make clean non-OpenSSL build possible (without schannel, makecert) 2015-10-09 15:57:41 -04:00
Marc-André Moreau
82afb0f1ee libwinpr-crypto: add generic digest API and OpenSSL compatible key derivation 2015-10-09 15:23:15 -04:00
Marc-André Moreau
54292f29ea libwinpr-crypto: add generic cipher API with OpenSSL/mbedtls support 2015-10-09 12:15:31 -04:00
Marc-André Moreau
5bff1d0fdf libwinpr-crypto: add rand and RC4 functions with OpenSSL/mbedtls 2015-10-08 16:26:37 -04:00
Marc-André Moreau
7521ecd759 libwinpr-crypto: add basic hashing and HMAC support with OpenSSL/mbedTLS 2015-10-08 13:58:55 -04:00
Martin Fleisz
912cd96321 Merge pull request #2887 from FreeRDP/mh-file-api-extension
winpr/file: extend API
2015-09-15 15:57:56 +02:00
Marc-André Moreau
2c3c6930c3 Merge pull request #2888 from awakecoding/master
fix ARM64 data type portability
2015-09-15 09:12:00 -04:00
Bernhard Miklautz
074854735f winpr/file: extend API
Add function GetFileHandleForFileDescriptor to get
a file handle for a valid file descriptor.
2015-09-15 02:16:36 -07:00
Marc-André Moreau
01b52d08d7 winpr: fix ARM64 data type portability 2015-09-14 14:34:24 -04:00
MartinHaimberger
735383b7f5 Merge pull request #2877 from bmiklautz/filehandling
winpr/file refactoring and regular file support
2015-09-14 17:15:50 +02:00
Armin Novak
e685f13e0b Added ORIENTATION_PREFERENCE from WinUser.h. 2015-09-10 13:26:37 +02:00
Bernhard Miklautz
0d9dfb974d winpr/file: integrate pull request feedback
* simplify RemoveDirectory
* move std handle function into an extern C block
2015-09-10 11:50:10 +02:00
Bernhard Miklautz
6b52a2e5cc winpr/file: initial regular file support
Add initial support for "regular" files. First implemented call is
GetStdHandle to get stdin/stdout/stderr.
2015-09-09 16:47:03 +02:00
Bernhard Miklautz
1a0253ef93 winpr/handle: define WINPR_FD_ on all platforms 2015-07-14 12:21:24 +02:00
Bernhard Miklautz
68e8569110 winpr/synch: remove the dependency on winsock.h
winsock.h pulls in a lot of defines and dependencies that are not
required and partially unwanted in winpr's core (for parts that are not
related to network). In order to get rid of this dependency and have an
independent defines for extended winpr functions the WINPR_FD_* defines
are used internally (and for exposed functions). Where required, like in
WSAEventSelect, the FD_* is mapped to WINPR_FD_*.
2015-07-14 11:39:41 +02:00
Armin Novak
6243a9374b Added write event support to handle functions.
Allows the WinPR HANDLE functions WaitForSingleObject and
WaitForMultipleObjects to signal in case of write events.
This is used by CreateFileDescriptor and SetEventFileDescriptor,
which got an API change accomodating for this new feature.
2015-07-03 09:29:18 +02:00
Armin Novak
7dc96c412f Added convenience function winpr_log_backtrace. 2015-07-03 09:22:02 +02:00
Bernhard Miklautz
1b8dd139a9 cmd line: add missing checks
* strdup
* some allocs
2015-06-22 19:23:57 +02:00
David FORT
7c3f8f33ab Fixes for malloc / calloc + other fixes
This patch contains:

* checks for malloc return value + treat callers;
* modified malloc() + ZeroMemory() to calloc();
* misc fixes of micro errors seen during the code audit:
** some invalid checks in gcc.c, also there were some possible
integer overflow. This is interesting because at the end the data are parsed
and freed directly, so it's a vulnerability in some kind of dead code (at least
useless);
** fixed usage of GetComputerNameExA with just one call, when 2 were used
in misc places. According to MSDN GetComputerNameA() is supposed to return
an error when called with NULL;
** there were a bug in the command line parsing of shadow;
** in freerdp_dynamic_channel_collection_add() the size of array was multiplied
by 4 instead of 2 on resize
2015-06-22 19:21:47 +02: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
Bernhard Miklautz
bf73f4e4f1 Fix unchecked strdups
* add missing checks
* adapt function return values where necessary
* add initial test for settings
2015-06-22 19:09:59 +02:00
Vic Lee
2e11eac79a Merge pull request #2675 from akallabeth/path_make_path
Added PathMakePath function.
2015-06-18 02:43:47 +00:00
Vic Lee
145fc10412 Merge pull request #2687 from akallabeth/known_hosts_v2
Store SSL fingerprints with host and port
2015-06-12 12:52:53 +00:00
Vic Lee
ad4cdf8810 winpr: add high-precision GetTickCountPrecise for Windows. 2015-06-11 15:11:19 +08:00
Armin Novak
d6e1a0a25f Added StrSep function. 2015-06-09 15:32:50 +02:00
Armin Novak
db7753bc8b Added RemoveDirectoryA, clean up test directories. 2015-06-09 13:16:28 +02:00
Armin Novak
7403cdc60c Added PathMakePath function. 2015-06-09 13:16:28 +02:00
Norbert Federa
77769f10b6 winpr: fixed HRESULT & SCODE types, added a ctest
- HRESULT was unsigned which means that until now all usages of the
  SUCCEDED(hr) and FAILED(hr) macros never detected any errors
- Also fixed the (unused) SCODE typedef
- Added new ctest TestTypes
2015-06-02 19:52:52 +02:00
David FORT
12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Bernhard Miklautz
f9c7e03044 winpr: add intrin.h
Exposing lzcnt in crt.h might causes compiler errors (redefinition) with
recent versions of gcc (>=4.9) when winpr is included in other projects.
As lzcnt isn't part of crt according to MSDN and also shouldn't be
exported by default it was moved to intrin.h.

The related test was also moved to the top level directory of winpr.
2015-05-26 16:41:29 +02:00
Marc-André Moreau
c64be497b8 libwinpr-utils: update backtrace utils 2015-05-21 13:25:35 -04:00
Marc-André Moreau
7e1dbd505b Merge branch 'awakecoding' of https://github.com/vworkspace/FreeRDP
Conflicts:
	channels/rdpdr/server/rdpdr_main.c
2015-05-20 11:40:48 -04:00
Marc-André Moreau
29d14773c8 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	client/Windows/wf_client.c
	libfreerdp/common/assistance.c
2015-05-20 10:12:24 -04:00
Bernhard Miklautz
81568ff03a Merge pull request #2596 from akallabeth/wlog_default_out_fix
Wlog console output to stderr
2015-05-08 00:49:41 +02:00
Clive Stevens
75865b5c3b Fix bitstream reading
The bounds checks where previously incorrect
2015-05-06 15:37:11 +01:00
Armin Novak
c375071b5d Console logging to stdout and stderr
With this patch the default for the console logger
changes to writing to stdout for TRACE, DEBUG and INFO
messages and stderr for WARNING, ERROR and FATAL messages.
2015-05-06 10:56:30 +02:00
Marc-André Moreau
dbcc972605 libwinpr-crt: make fallback byteswap macros type safe 2015-04-23 14:22:20 -04: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
David FORT
0cf17ef98c Complement gitignore files with new generated files 2015-04-01 11:13:05 +02:00
Hardening
bdb975afe8 Merge pull request #2510 from akallabeth/build_date
Added version and build info functions
2015-03-30 19:14:59 +02:00
Armin Novak
0adab13719 Now returning const char* 2015-03-30 18:09:02 +02:00
Armin Novak
8f228163a8 Added version and build info functions
Added functions to get
 * Version String
 * Build Time String
 * Git Revision String
and appropriate tests.
2015-03-30 17:51:29 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Marc-André Moreau
f226c27fb0 libwinpr-utils: improve BipBuffer 2015-03-13 20:22:21 -04:00
Marc-André Moreau
34181949e6 libwinpr-utils: update BipBuffer 2015-03-13 18:37:48 -04:00
Marc-André Moreau
afdd55fa81 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-03-13 15:30:31 -04:00
ivan-83
7b3a552988 + audin OSS support (un tested now)
+ add: COMMAND_LINE_IGN_UNKNOWN_KEYWORD flag for CommandLineParseArgumentsA to ignory unknown keys without fail
+ add: lot of WLog_DBG() in drdynvc, add function names in existing
* change: error text in rdpsnd OSS
* fix: dev in rdpsnd does not work
* fix/change: audio-dev renamed to dev and now work in audin
* fix dynamic channels now work again
2015-03-13 01:28:44 +03:00
Marc-André Moreau
1222da4a86 libwinpr-utils: initial BipBuffer implementation 2015-03-12 16:34:48 -04:00
Mike McDonald
aa6a737fbb Added the shell function GetUserProfileDirectory to WinPR. 2015-03-04 16:56:48 -05:00
Marc-André Moreau
a6c292742e libwinpr-winsock: implement interface listing with WSAIoctl 2015-02-18 13:35:33 -05:00
Bernhard Miklautz
0b902eeb5d wtsapi: add WTSStartRemoteControlSessionEx
WTSStartRemoteControlSession doesn't allow to specify additional flags
therefore add a new extended version WTSStartRemoteControlSessionEx
with an additional "flags" parameter.

The following flags are defined:

REMOTECONTROL_FLAG_DISABLE_KEYBOARD - disable keyboard input
REMOTECONTROL_FLAG_DISABLE_MOUSE    - disable mouse input
REMOTECONTROL_FLAG_DISABLE_INPUT    - disable input (keyboard and mouse)
2015-02-16 12:16:54 +01:00
Norbert Federa
6f3a07d510 winpr: stream ctest and missing read/peek types 2015-02-12 18:13:06 +01:00
Martin Haimberger
256b420afc wtsapi: extended wtsapi
- added missing definitions for session change notification
- extended wtsapi to allow remote logon and logoff against the wtsapi (this allows remote wtsapi usage)
2015-02-09 06:30:18 -08:00
Marc-André Moreau
3a906caa4a freerdp: add event handle usage instead of file descriptors 2015-01-29 22:57:58 -05:00
Marc-André Moreau
5bf8b1509e libfreerdp-core: improve socket BIO handling 2015-01-28 13:46:17 -05:00
Armin Novak
5075aec5a2 Added function WTSErrorToString to get a string from an error code. 2015-01-20 11:03:21 +01:00
Marc-André Moreau
9ebc67ba02 channels/smartcard: cleanup SCardControl 2014-12-22 16:25:59 -05:00
Martin Fleisz
441632310a Merge pull request #2110 from akallabeth/winpr_backtrace_windows
Winpr backtrace windows
2014-12-04 15:03:37 +01:00
Armin Novak
fb482bbf98 Fixed missing extern C 2014-12-01 13:03:46 +01:00
Armin Novak
6de22298d0 Added callback appender for wlog. 2014-11-16 12:20:48 +01:00
Bernhard Miklautz
4a453d4b9f winpr: fix build with visual studio < 2012
_COM_Outptr_ was introduced in visual studio 2012.
2014-11-12 18:09:55 +01:00
Armin Novak
cff721f23b Fixed broken cliprdr TAG definition.
Added WINPR_API for backtrace functions.
2014-11-12 09:17:47 +01:00
Armin Novak
a6eff65259 Fixed ExitThread, now running pthread_exit and setting event. 2014-10-27 11:28:13 +01:00
Armin Novak
c846379e60 Removed noreturn from ExitThread, does not conform to http://msdn.microsoft.com/en-us/library/windows/desktop/ms682659%28v=vs.85%29.aspx and crashes FreeRDP. 2014-10-27 11:23:16 +01:00
Armin Novak
c304f457cf Implemented thread handling for WaitForMultipleObjects.
Implemented thread specific functions.
2014-10-27 11:23:15 +01:00
Marc-André Moreau
f01bb56ac5 channels/cliprdr: add missing clipboard data format definitions 2014-10-23 18:33:10 -04:00
Mike McDonald
95a72a182c Fix to header file. __builtin_bswap16 is only available on GCC v4.8 (or higher). 2014-10-20 15:59:54 -04:00
Marc-André Moreau
83ecddd6c1 xfreerdp: replace cliprdr to wire format conversion 2014-10-17 20:40:11 -04:00
Marc-André Moreau
0e4659403f libwinpr-clipboard: add basic clipboard synthesizers 2014-10-17 18:23:07 -04:00
Marc-André Moreau
c27888ed72 libwinpr-clipboard: initial clipboard synthetic format support 2014-10-17 16:45:36 -04:00
Marc-André Moreau
d98ce1a819 libwinpr-clipboard: initial commit 2014-10-17 15:19:05 -04:00
Marc-André Moreau
334dec3c1f winpr: add pragma pack, bitmap + clipboard definitions 2014-10-16 21:45:47 -04:00
Marc-André Moreau
f6b3b24c22 winpr: add new line ending, utf16 byte order swap functions 2014-10-16 18:07:44 -04:00
Marc-André Moreau
020436db79 libwinpr-handle: fix dummy DuplicateHandle implementation 2014-10-11 12:34:45 -04:00
Marc-André Moreau
ed99c63070 winpr: fix DECLSPEC_EXPORT on Windows 2014-10-10 20:34:17 -04:00
Marc-André Moreau
8ef4c14a6d libwinpr-environment: fix extended functions 2014-10-10 19:16:51 -04:00
Marc-André Moreau
e49cfe05a8 winpr: windows build fixes 2014-10-10 18:59:05 -04:00
Marc-André Moreau
11ae267518 libfreerdp-core: expose new API to allow FreeRDS virtual channel hooking 2014-10-10 16:11:42 -04:00
Marc-André Moreau
8865077b40 libwinpr-winsock: minor improvements 2014-10-09 20:27:42 -04:00
Marc-André Moreau
b01ef89b3d libwinpr-utils: improve HashTable flexibility, add proper string support 2014-10-09 16:46:55 -04:00
Marc-André Moreau
914e498a38 winpr-winsock: add missing INVALID_SOCKET definition 2014-10-08 20:52:04 -04:00
Marc-André Moreau
d5cbadee9d libwinpr-utils: improve .ini file parser 2014-10-02 18:45:53 -04:00
Marc-André Moreau
2841fa32af winpr: fix header conflict with internal X11 definitions 2014-10-01 15:33:01 -04:00
Marc-André Moreau
abd87ace55 rdtk: initial commit 2014-09-29 16:08:08 -04:00
Marc-André Moreau
1c34583407 libwinpr-utils: add png support 2014-09-28 11:02:39 -04:00
Emmanuel Ledoux
275a1b9bc4 winpr-comm: fixed set_baud_rate()/get_baud_rate() functions in comm_serial_sys.c (the issue came from a wrong extrapolation of the COMMPROP's MaxBaud field)
winpr-comm: got rid of SERIAL_BAUD_* values which are identical to BAUD_* ones
2014-09-16 11:21:01 +02:00
Armin Novak
19bbab3078 Reformatted header with astyle 2.03, fixing extern "C" scope inentation. 2014-09-11 12:39:02 +02:00
Armin Novak
a15df299e9 Removed last remainig printf. 2014-09-09 16:32:23 +02:00
Armin Novak
26887de257 Fixed arguments for WLog_Print in logging macros. 2014-09-09 16:32:22 +02:00
Armin Novak
b22b897389 Reformatted changed files. 2014-09-09 16:32:22 +02:00
Armin Novak
6baf98dcda Moved logging defines to main logger. 2014-09-09 16:32:04 +02:00
Armin Novak
3e21e570b8 Added recursion detection to WLog.
Dump functions now expect TAG and level as arguments.
2014-09-09 16:31:46 +02:00
Armin Novak
c32c48fbb6 Added recursion guard to logging functions. 2014-09-09 16:30:52 +02:00
Marc-André Moreau
fd7b9669a5 libfreerdp-codec: improve progressive unit tests 2014-09-03 18:47:02 -04:00
Marc-André Moreau
320b1d35ed libwinpr-utils: centralize bitmap utils 2014-09-03 16:20:50 -04:00
Marc-André Moreau
1a8c763309 Merge branch 'shadow' of github.com:awakecoding/FreeRDP 2014-08-18 17:06:13 -04:00
Marc-André Moreau
065d6f0c99 Merge pull request #2010 from hardening/list_return_value
Make LinkedList return errors when something fails
2014-08-18 13:05:18 -04:00
Armin Novak
e700dc6818 Winpr stacktrace header. 2014-08-14 10:37:48 +02:00
Marc-André Moreau
e4a4aa4d3a Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow
Conflicts:
	channels/encomsp/client/encomsp_main.c
	libfreerdp/core/tcp.c
	libfreerdp/crypto/certificate.c
	server/Windows/CMakeLists.txt
	server/X11/xf_cursor.c
	server/X11/xf_input.c
	server/X11/xf_interface.c
	server/X11/xf_monitors.c
	server/X11/xf_peer.c
2014-08-11 19:22:33 -04:00
Marc-André Moreau
87fd839a35 libfreerdp-codec: cleanup and fix __lzcnt on Windows 2014-08-11 18:48:42 -04:00
Marc-André Moreau
edde16e9d5 libwinpr-synch: add initial synchronization barrier implementation 2014-08-08 17:34:30 -04:00
Marc-André Moreau
22d3b6c74b libfreerdp-codec: remove old RemoteFX RLGR implementation in favour of faster one 2014-08-05 21:41:58 -04:00
Marc-André Moreau
3895c930a3 Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow 2014-08-05 09:56:12 -04:00
Marc-André Moreau
51f6ffd2ba libfreerdp-codec: improve rfx progressive RLGR1 implementation 2014-08-02 22:26:05 -04:00
Hardening
ff95b9aafa Make LinkedList return errors when something fails 2014-07-31 10:38:59 +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
d8b858811f shadow: initial windows server-side connectivity 2014-07-17 21:15:22 -04:00
Marc-André Moreau
19c25cf2b4 winpr-pool: fix header on non-Windows 2014-07-17 17:34:51 -04:00
Marc-André Moreau
e6f4754ed3 winpr: improve windows builds across visual studio versions and toolsets 2014-07-17 15:11:04 -04:00
Emmanuel Ledoux
80f641c38a winpr-comm, serial: excluded Android platforms as well 2014-07-04 17:40:06 +02:00
Emmanuel Ledoux
7bbeff3427 winpr-comm: made its current implementation verific specific to __linux__ since it was done on top of NTTY. 2014-07-04 16:16:26 +02:00
Emmanuel Ledoux
9217de3bb1 winpr-utils: WLog_PrintMessageVA, include stdarg.h from wlog.h instead of wlog.c 2014-07-04 14:52:13 +02:00
Emmanuel Ledoux
300a511672 winpr-utils: exported WLog_PrintMessageVA() and defined WLog_PrintVA() in order to be then able to wrap wlog messages in another variadic function. 2014-07-02 15:37:13 +02:00
Emmanuel Ledoux
9fc225ac5d Merge branch 'ports'
Conflicts:
	channels/serial/client/serial_tty.c
2014-06-30 17:22:15 +02:00
Marc-André Moreau
c156006195 Merge branch 'master' of github.com:awakecoding/FreeRDP into egfx 2014-06-23 11:55:27 -04:00
Marc-André Moreau
78d3c82798 xfreerdp: fix multiple egfx-related memory leaks 2014-06-20 13:52:13 -04:00
Emmanuel Ledoux
f454a5c0c8 winpr-handle: CloseHandle(), added ability to register some callback functions
winpr-comm: implemented CommCloseHandle()
2014-06-19 19:07:45 +02:00
Emmanuel Ledoux
d38a323526 winpr-comm, winpr-file: better initialization of the static variables 2014-06-19 12:03:36 +02:00
Marc-André Moreau
3aac5ec897 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-06-18 16:12:54 -04:00
Marc-André Moreau
948d137426 libwinpr-sspi: add support for passing NTLMv2 hash 2014-06-18 16:02:13 -04:00
Marc-André Moreau
e272bc923e libwinpr-sspi: fix server-side NTLM authentication against NTLMv2 without key exchange 2014-06-18 14:42:35 -04:00
Emmanuel Ledoux
e6c82f99d5 serial: ability to setup the server serial driver thanks to a third parameter on the command line 2014-06-18 18:20:21 +02:00
Emmanuel Ledoux
62d893b2bd winpr-comm: implemented IOCTL_SERIAL_RESET_DEVICE 2014-06-17 17:49:06 +02:00
Emmanuel Ledoux
9fc0e6eccc winpr-comm: CommReadFile and CommWriteFile are now protected by a mutex
winpr-comm: implemented IOCTL_SERIAL_IMMEDIATE_CHAR
2014-06-17 16:34:20 +02:00
Emmanuel Ledoux
34c3654faf winpr-comm: implemented IOCTL_SERIAL_CONFIG_SIZE 2014-06-17 15:19:16 +02:00
Emmanuel Ledoux
0db3d9dbb0 winpr-comm: cleaning up code, focused on indentation and whitespaces 2014-06-16 19:18:45 +02:00
Mario Reja
45f9a72975 Added define guards for _rotl and related bit rotation functions, which collided with function definitions in x86intrin.h 2014-06-13 14:25:28 +03:00
Marc-André Moreau
adbfcf53ea libwinpr-sspi: fix failing test 2014-06-10 18:09:51 -04:00
Marc-André Moreau
a7de9e5ac9 Merge branch 'master' of github.com:awakecoding/FreeRDP into sspi
Conflicts:
	winpr/include/winpr/timezone.h
	winpr/libwinpr/timezone/timezone.c
2014-06-10 16:40:58 -04:00
Marc-André Moreau
1b93dca6c0 libwinpr-sspi: add support for querying user+domain and setting NTLM hash 2014-06-10 16:38:16 -04:00
Marc-André Moreau
20464a08ee winpr: remove installable config.h header 2014-06-10 08:24:20 -04:00
Marc-André Moreau
a37c6bb653 libwinpr-sspi: fix build on Linux 2014-06-07 16:46:32 -04:00
Marc-André Moreau
576e0c4d1a libwinpr-sspi: fix exporting of SSPI API 2014-06-07 14:43:02 -04:00
Alessandro Pilotti
7d2f96e84f Fixes timezone API definition issues on Windows
GetDynamicTimeZoneInformation, SetDynamicTimeZoneInformation and
GetTimeZoneInformationForYear are provided by the Windows SDK accordingly
with ethe MSDN cocumentation for SDK with versions above 7.1A.

Those functions are incorrectly included by the 7.1A SDK if _WIN32_WINNT
>= 0x0501 instead of _WIN32_WINNT >= 0x0600.

The issue arises when building with an XP compatible toolset (e.g.
v120_xp).
2014-06-07 20:11:32 +03:00
Marc-André Moreau
a07f616895 libwinpr-sspi: improve link interface 2014-06-07 10:50:51 -04:00
Marc-André Moreau
1b5a2340d2 libwinpr-sspi: even more code hardening 2014-06-07 00:17:11 -04:00
Marc-André Moreau
220f885774 libwinpr-sspi: code hardening 2014-06-06 17:20:34 -04:00
Marc-André Moreau
c5a1a8ac27 libwinpr-sspi: fix native sspi build 2014-06-05 22:10:08 -04:00
Marc-André Moreau
abd475060c libwinpr-winsock: fix build on Windows 2014-06-01 21:52:33 -04:00
Marc-André Moreau
1172596d59 libwinpr-winsock: initial winsock implementation 2014-06-01 15:04:28 -04:00
Marc-André Moreau
1ddd6c5e0d libwinpr-utils: add WLog support for Win32 debugger console output 2014-05-31 10:10:19 -04:00
Marc-André Moreau
357b9197a8 libwinpr-timezone: fix build on Windows 2014-05-29 21:29:24 -04:00
Marc-André Moreau
e5a77c3105 libwinpr-utils: add support for fine grained wlog filter 2014-05-29 15:23:15 -04:00
Marc-André Moreau
e33d7321bb libwinpr-timezone: stub functions 2014-05-29 11:58:53 -04:00
Marc-André Moreau
af6fb83d3b libwinpr-utils: extend wlog prefix format 2014-05-28 10:38:32 -04:00
Emmanuel Ledoux
1e9e8b68bf winpr-comm: got IOCTL_SERIAL_GET_DTRRTS 2014-05-28 11:39:10 +02:00
Emmanuel Ledoux
9796224936 - winpr-comm: got a finalized version of IOCTL_SERIAL_WAIT_ON_MASK
- serial: cleaning up the code
2014-05-27 11:33:10 +02:00
Emmanuel Ledoux
13e10c5de9 winpr-comm: identified the ioctl 0x00220034 as IOCTL_USBPRINT_GET_1284_ID (support not yet implemented) 2014-05-26 16:31:56 +02:00
Marc-André Moreau
c866d19bd4 winpr-crt: fix bit rotation macros 2014-05-23 14:00:46 -04:00
Emmanuel Ledoux
5dc21b5604 winpr-comm: renamed waitMask WaitEventMask
winpr-comm: removed ReadIrpQueue
2014-05-23 15:55:44 +02:00
Emmanuel Ledoux
4feafcc40d winpr-comm: got IOCTL_SERIAL_SET_XOFF and IOCTL_SERIAL_SET_XON 2014-05-23 13:04:43 +02:00
Emmanuel Ledoux
ee268a92ee serial: got a thread per IRP
winpr-comm: got IOCTL_SERIAL_GET_COMMSTATUS, IOCTL_SERIAL_SET_BREAK_ON and IOCTL_SERIAL_SET_BREAK_OFF
winpr-comm: tcdrain called by CommWriteFile() :(
2014-05-23 12:27:09 +02:00
Marc-André Moreau
19b25a792e winpr-crt: add bit rotation functions 2014-05-22 16:31:14 -04:00
Marc-André Moreau
146305f9b2 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-05-22 13:59:25 -04:00
Martin Haimberger
535d7668a7 fixed missing extern C for cpp in makecert.h 2014-05-22 01:28:01 -07:00
Emmanuel Ledoux
baf4896a38 serial: got rid of most the warning message with MAKE_BUILD_TYPE=Release
winpr-comm: consolidated _set_handflow()/_get_handflow()
winpr-comm: introduced a permissive mode
winpr-comm: implementation of IOCTL_SERIAL_WAIT_ON_MASK still in progress
2014-05-19 16:53:57 +02:00
Emmanuel Ledoux
8179affea9 winpr-comm: got IOCTL_SERIAL_PURGE 2014-05-14 21:21:31 +02:00
Emmanuel Ledoux
6cc44ff112 winpr-comm: got IOCTL_SERIAL_SET_QUEUE_SIZE 2014-05-14 17:30:29 +02:00
Emmanuel Ledoux
4243928c2e winpr-comm: fixed _set_lines() / _clear_lines()
winpr-comm: got IOCTL_SERIAL_SET_WAIT_MASK / IOCTL_SERIAL_GET_WAIT_MASK and a non-blocking version of IOCTL_SERIAL_WAIT_ON_MASK
2014-05-14 16:29:10 +02:00
Emmanuel Ledoux
4c743de69c winpr-comm: got IOCTL_SERIAL_SET_TIMEOUTS / IOCTL_SERIAL_GET_TIMEOUTS
serial redirection: use of winpr-comm's functions and not serial_tty.* anymore
2014-05-12 17:33:56 +02:00
Marc-André Moreau
0bcb3eb63d libwinpr-locale: fix inclusion of stdarg.h 2014-05-10 17:31:42 -04:00
Marc-André Moreau
b8d60d5715 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-05-10 10:59:56 -04:00
Marc-André Moreau
ee282a931b freerdp: fix build warnings on Windows 2014-05-10 09:50:36 -04:00
Marc-André Moreau
fb3662c7e2 winpr: fix ranlib missing symbols warnings on OS X 2014-05-09 22:44:19 -04:00
Hardening
50f1f0df6f Add some const modifiers
This allows these functions to be used with const buffers.
2014-05-09 22:36:50 +02:00
Marc-André Moreau
bbc9fc4393 freerdp: add more vendor options 2014-05-09 12:25:05 -04:00