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