Fix incorrect usage of S_FALSE which was used to indicate errors
although it is a HRESULT success code.
Make this function behave like the Windows 8 implementation and
the according MSDN specification.
- return E_INVALIDARG instead of S_FALSE if pszPath is NULL
- return E_INVALIDARG instead of S_FALSE if pszMore is NULL
- return E_INVALIDARG if cchPath is zero
- return E_INVALIDARG if cchPath is greater than PATHCCH_MAX_CCH
- return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) if the combined
path size exceeds cchPath (this is the same HRESULT which the Windows
implementation returns in this case and which is referred to as
PATHCCH_E_FILENAME_TOO_LONG on msdn)
Also extended/fixed the TestPathCchAppend ctest
And again S_FALSE was incorrectly used to indicate an error.
Fix this and be more compatible to the Windows 8 implementation of
this function:
- return E_INVALIDARG instead of S_FALSE if pszPath is NULL
- return E_INVALIDARG instead of S_FALSE if cchPath < 4
- return E_INVALIDARG if cchPath > PATHCCH_MAX_CCH
- allow stripping of "\\?\c:" and don't require "\\?\c:\"
- verify that the character at the drive letter position is
actually an alphabetic character
- since the passed pszPath must not necessarily be null terminated
and we always have enough space after the memmove we can always
ensure the null termination of the stripped result
Also extended/fixed the TestPathCchStripPrefixctest
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE
Also extended/fixed the corresponding ctest
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE
Also extended/fixed the corresponding ctest
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE
Also extended/fixed the corresponding ctest
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.
The ntlm_construct_challenge_target_info function can potentially pass NULL as
argument to the ntlm_av_pair_add function (for example DnsDomainName.Buffer).
This NULL finally lands in the CopyMemory (which is macro to the memcpy(3)
function) which can't handle NULL.
- added the unit test: TestThreadExitThread
- fix: ensure thread_list to be up to date before to call ExitThread()
- possibly resolved: Problems with serial redirection #2389