The conversion macros don't work properly if input data doesn't point
to BYTE. Cast the input data to BYTE to avoid unexpected behavior and
to simplify usage of the macros.
https://github.com/FreeRDP/FreeRDP/issues/2520
There is a bug which causes that higher byte and lower byte contain
first byte of data and second byte of data is lost. The patch fixes
it similarly as it is done in Stream_Read_UINT16.
https://github.com/FreeRDP/FreeRDP/issues/2520
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.
On Windows we seem to have to load the TestLibrary[AB] test libraries
from in same folder the test executable runs.
Also removed the empty RemoveDllDirectory, SetDefaultDllDirectories,
AddDllDirectory tests and the redundant FreeLibrary test.
TestLibrary now works and succeeds on Win32.
sadasd
- PathCchFindExtensionA had an off-by-one error when verifying the
required null termination
- TestPathCchFindExtension used unicode strings when testing the
*A (ASCII) functions
- The PathAllocCombineW implementation (which is still buggy has
hell) used strlen to calculate the lenght of unicode strings
TestPath now succeeds on WIN32
GetLastError() was not always checked for ERROR_PIPE_CONNECTED which
indicates success if ConnectNamePipe returns FALSE.
TestPipe now also succeeds on Win32
TestSynchTimerQueue:
- fixed race condition
TestSynchWaitableTimerAPC:
- Use WaitForSingleObjectEx since the thread must be in an alterable state
TestSynch is now expected to succeed on WIN32
- Mutex is recursive on Windows; as a consequence we have to use
the pthread PTHREAD_MUTEX_RECURSIVE type
- Adapt MutexCloseHandle accordingly
- ReleaseMutex returned TRUE even if pthread_mutex_unlock failed
- Fixed and improved the TestSynchMutex ctest
SetEventFileDescriptor overrides the internal file descriptor of the
event but didn't close it. Now if the descriptor is closed if it isn't
marked as attached.
libwinpr-tools is a replacement for winpr-makecert-tool.a. Currently
it's basically the same as winpr-makecert-tool.a but in future
functionality that doesn't fit directly in winpr will be added here.
comm tests require a serial device for testing. If the test environment
isn't available the tests will return errors therefore the tests are
now disabled per default. They can be (re-)enabled by using the cmake
option BUILD_COMM_TESTS.
If a target is linked against libraries with cmake
(target_link_libraries) and the libraries are not marked as PRIVATE
they are "exported" and in case a other target is linked against this
target it is also linked against *all* (not private) libraries.
Without declaring private libraries PRIVATE a lot of over linking
(linking against unneeded libraries) was done.
In commit 12bd0ec8 ("winpr: BUMP the API version to 1.2") it was stated
that the intention was to allow multiple winpr versions to be installed
in parallel.
However, it's not sufficient to change just the *minor* version of the
library. The soname is still 'libwinpr.so.1', and thus we still can't
coexist with earlier versions — in particular, we can't install FreeRDP2
in parallel with existing distribution packages of earlier versions.
Bump the soname so it does actually work
- Added missing ConvertFromUnicode checks
- If ConvertToUnicode allocates memory, guarantee the null termination
similar to ConvertFromUnicode's implementation
- Fixed some TestUnicodeConversion.c CTest return values
- Added some CTests for ConvertFromUnicode and ConvertToUnicode
- Misc code and protocol hardening fixes in the surrounding code regions
that have been touched
ConvertToUnicode can't be used if the destination is a static buffer.
StandardName and DaylightName were invalid and timezone
redirection didn't work.
This regression was introduced with PR #3151
When nothing is declared, only export symbols defined
with WINPR_API or FREERDP_API defined.
Override this setting if BUILD_TESTING to allow tests
access to internal functions usually not exposed.
This is required that the exported cmake find module can be
differentiated from the "old" one. This allows it to have
multiple winpr API version installed in parallel.
find_package should now be used with an explicit version number
set like:
find_package(WinPR 1.2 REQUIRED)