Commit Graph

542 Commits

Author SHA1 Message Date
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