- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
Half of the tests expects strings in little endian byte order, half of
the tests expects byte order based on a current architecture, so it
obviously can't work on big endian machines. Wide char strings use
always little endian encoding since commit f722dc5. Use only strings
in little endian to make the tests endian-independent.
All WCHAR strings are stored as little endian after commit 12dfc5e9,
therefor CharUpperBuffW and CharLowerBuffW have to be changed appropriately
in order to fix NTLM authentication.
https://github.com/FreeRDP/FreeRDP/issues/2520
Unicode conversions doesn't work on big endian machines currently.
The strings are stored as little endian. Use conversion macros from
endian.h to load and store the data properly.
Let's use wide char strings always as little endian. It seems that
Windows API also always expects data to be little endian, so it
makes sense to require wide char strings as little endian also.
The patches fixes transformations between UTF8 and UTF16 only, which are
used by freerdp. UTF32 transformations are not used by freerdp.
https://github.com/FreeRDP/FreeRDP/issues/2520
- 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
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.
* _aligned_offset_recalloc did ignore the nmemb element
therefore only *one* element was allocated
* in case memblock was NULL the allocated memory
wasn't zeroed
* restructure realloc and recalloc to check if the memory was initially
created aligned before allocating a new segment