Commit Graph

103 Commits

Author SHA1 Message Date
Norbert Federa
c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Armin Novak
a3fd9bf5af Fixed warnings. 2016-10-06 13:43:10 +02:00
Martin Fleisz
71765b72e3 Merge pull request #3284 from ondrejholy/endianness
Endianness fixes
2016-08-25 08:17:52 +02:00
Norbert Federa
62d73dcb75 winpr: fix PathMakePathA and TestWLog
PathMakePathA:
- This function had an endless loop if no native delimiter was in the string
- Use SHCreateDirectoryExA on Windows
- Replaced old code with a new implementation

TestWLog:
- Windows has no "/tmp" by default
- Use GetKnownPath(KNOWN_PATH_TEMP) for the WLog "outputfilepath"
2016-06-13 19:19:28 +02:00
Ondrej Holy
44ce6b02ed winpr/stream: Make TestStream endian-independent
The TestStream_PeekAndRead expects LE byte order and consequently
fails on BE. Change the test to be endian-independent.
2016-05-31 16:04:16 +02:00
Norbert Federa
e8c4910e2e fix segfaults casused by size_t format specifier
win32/msvc cc does not recognize the %z format specifier which caused
invalid references and segfaults on win32.
Until FreeRDP gets format specifier macros we'll cast size_t to
unsigned long and use the %lu specifier.

Also simplified winpr_backtrace_symbols() a little bit and fixed it
to allocate the correct amount of bytes for the return buffer.
2016-05-27 15:55:28 +02:00
Armin Novak
a79072a87c Added tests for remaining stream functions. 2016-03-01 12:58:09 +01:00
Armin Novak
035f127081 Added get_build_config functions. 2016-01-28 14:26:50 +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
Bernhard Miklautz
ab05a79c21 winpr/stream: don't allow 0-size streams 2015-10-23 18:38:41 +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
Armin Novak
c6c43d5f06 Writing failure to stderr. 2015-06-02 17:54:27 +02:00
Armin Novak
1c3b38f58b Fixed image test. 2015-06-02 17:53:16 +02:00
Armin Novak
2a3cd74c02 Fixed image test. 2015-06-02 15:17:54 +02:00
David FORT
12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Martin Haimberger
951a2d2210 stream: check stream_new in winpr and libfreerdp
also fixed a few things
2015-05-29 04:46:50 -07:00
Marc-André Moreau
5526348079 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-05-21 13:29:59 -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
Hardening
f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Marc-André Moreau
87bb3aa6e0 wfreerdp: fix build 2015-05-07 13:35:39 -04:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Hardening
6cd7713e12 Merge pull request #2544 from bmiklautz/boolenization
change return types of callbacks to BOOL
2015-04-22 11:01:27 +02:00
Bernhard Miklautz
c9ee30a815 TestStream: set function parameters to void 2015-04-21 14:25:59 +02:00
Bernhard Miklautz
61473923e4 TestStream: fix compiler warning
Remove unnecessary argument from read function call.
2015-04-21 14:16:33 +02:00
Armin Novak
7990ea6371 Added proper bitmap and png image test. 2015-04-19 12:29:28 +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
8e521e7aee Fixed return value in test. 2015-03-30 18:18:14 +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
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +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
Marc-André Moreau
34181949e6 libwinpr-utils: update BipBuffer 2015-03-13 18:37:48 -04:00
Marc-André Moreau
1222da4a86 libwinpr-utils: initial BipBuffer implementation 2015-03-12 16:34:48 -04:00
Norbert Federa
6f3a07d510 winpr: stream ctest and missing read/peek types 2015-02-12 18:13:06 +01:00
Bernhard Miklautz
c70293aa60 Fix clang compiler warnings 2015-01-16 00:41:57 +01: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
1b6cb6349e Added unit test for callback wlog appender. 2014-11-16 13:59:12 +01:00
Armin Novak
56f087dfbc Fixed commented include. 2014-11-12 09:16:55 +01:00
Armin Novak
cbf70a3d75 Fixed missing include in unit test. 2014-11-12 09:16:55 +01:00
Armin Novak
f09aec878e Added unit test for backtrace. 2014-11-12 09:16:54 +01: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
d5cbadee9d libwinpr-utils: improve .ini file parser 2014-10-02 18:45:53 -04:00
Marc-André Moreau
c5a0c7e97a libwinpr-utils: add simple image loading/writing test 2014-09-28 11:14:30 -04:00
Marc-André Moreau
1c34583407 libwinpr-utils: add png support 2014-09-28 11:02:39 -04:00
Bernhard Miklautz
417707e4b7 winpr-utils: extend LinkedList test 2014-09-24 13:03:46 +02:00
Armin Novak
a15df299e9 Removed last remainig printf. 2014-09-09 16:32:23 +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
Marc-André Moreau
a202fe4057 freerdp: fix several type related warnings 2014-05-08 18:02:02 -04:00
Marc-André Moreau
64b550e18f libwinpr-utils: fix .ini parser whitespace trimming 2014-03-25 00:32:05 -04:00
Marc-André Moreau
43031d6b66 libwinpr-utils: improve .ini file parser 2014-03-24 22:41:30 -04:00