freerdp_assistance_encrypt_pass_stub:
  875|    328|{
  876|    328|	BOOL rc = 0;
  877|    328|	size_t cbPasswordW = 0;
  878|    328|	size_t cbPassStubW = 0;
  879|    328|	BYTE PasswordHash[WINPR_MD5_DIGEST_LENGTH] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    328|	{                      \
  |  |   85|    328|	} /** @since version 3.24.0 */
  ------------------
  880|    328|	WINPR_RC4_CTX* rc4Ctx = nullptr;
  881|    328|	BYTE* pbIn = nullptr;
  882|    328|	BYTE* pbOut = nullptr;
  883|    328|	BYTE* res = nullptr;
  884|    328|	WCHAR* PasswordW = ConvertUtf8ToWCharAlloc(password, &cbPasswordW);
  885|    328|	WCHAR* PassStubW = ConvertUtf8ToWCharAlloc(passStub, &cbPassStubW);
  886|       |
  887|    328|	cbPasswordW = cbPasswordW * sizeof(WCHAR);
  888|    328|	cbPassStubW = cbPassStubW * sizeof(WCHAR);
  889|    328|	const size_t EncryptedSize = cbPassStubW + 4;
  890|       |
  891|    328|	if (!PasswordW || !PassStubW)
  ------------------
  |  Branch (891:6): [True: 0, False: 328]
  |  Branch (891:20): [True: 80, False: 248]
  ------------------
  892|     80|		goto fail;
  893|       |
  894|    248|	if (!winpr_Digest(WINPR_MD_MD5, (BYTE*)PasswordW, cbPasswordW, (BYTE*)PasswordHash,
  ------------------
  |  Branch (894:6): [True: 0, False: 248]
  ------------------
  895|    248|	                  sizeof(PasswordHash)))
  896|      0|		goto fail;
  897|       |
  898|    248|	pbIn = (BYTE*)calloc(1, EncryptedSize);
  899|    248|	pbOut = (BYTE*)calloc(1, EncryptedSize);
  900|       |
  901|    248|	if (!pbIn || !pbOut)
  ------------------
  |  Branch (901:6): [True: 0, False: 248]
  |  Branch (901:15): [True: 0, False: 248]
  ------------------
  902|      0|		goto fail;
  903|       |
  904|    248|	WINPR_ASSERT(cbPasswordW <= UINT32_MAX);
  ------------------
  |  |   76|    248|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    248|	do                                                                                             \
  |  |  |  |   61|    248|	{                                                                                              \
  |  |  |  |   62|    248|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    248|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    248|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    248|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    248|                                                                                                   \
  |  |  |  |   70|    248|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    248|	do                                                      \
  |  |  |  |  |  |   32|    248|	{                                                       \
  |  |  |  |  |  |   33|    248|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    248|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    248|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    248|                                                                                                   \
  |  |  |  |   72|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    248|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    248|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    248|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  905|    248|	winpr_Data_Write_UINT32(pbIn, (UINT32)cbPassStubW);
  906|    248|	CopyMemory(&pbIn[4], PassStubW, cbPassStubW);
  ------------------
  |  |  123|    248|#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
  ------------------
  907|    248|	rc4Ctx = winpr_RC4_New(PasswordHash, sizeof(PasswordHash));
  908|       |
  909|    248|	if (!rc4Ctx)
  ------------------
  |  Branch (909:6): [True: 0, False: 248]
  ------------------
  910|      0|	{
  911|      0|		WLog_ERR(TAG, "winpr_Cipher_New failure");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  912|      0|		goto fail;
  913|      0|	}
  914|       |
  915|    248|	rc = winpr_RC4_Update(rc4Ctx, EncryptedSize, pbIn, pbOut);
  916|       |
  917|    248|	if (!rc)
  ------------------
  |  Branch (917:6): [True: 0, False: 248]
  ------------------
  918|      0|	{
  919|      0|		WLog_ERR(TAG, "winpr_Cipher_Update failure");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  920|      0|		goto fail;
  921|      0|	}
  922|    248|	res = pbOut;
  923|    328|fail:
  924|    328|	winpr_RC4_Free(rc4Ctx);
  925|    328|	free(PasswordW);
  926|    328|	free(PassStubW);
  927|    328|	free(pbIn);
  928|    328|	if (!res)
  ------------------
  |  Branch (928:6): [True: 80, False: 248]
  ------------------
  929|     80|		free(pbOut);
  930|    248|	else
  931|    248|		*pEncryptedSize = EncryptedSize;
  932|    328|	return res;
  933|    248|}
freerdp_assistance_hex_string_to_bin:
 1029|    460|{
 1030|    460|	BYTE* buffer = nullptr;
 1031|    460|	if (!str || !size)
  ------------------
  |  Branch (1031:6): [True: 0, False: 460]
  |  Branch (1031:14): [True: 0, False: 460]
  ------------------
 1032|      0|		return nullptr;
 1033|    460|	*size = 0;
 1034|    460|	const size_t length = strlen(str);
 1035|    460|	buffer = calloc(length, sizeof(BYTE));
 1036|    460|	if (!buffer)
  ------------------
  |  Branch (1036:6): [True: 0, False: 460]
  ------------------
 1037|      0|		return nullptr;
 1038|    460|	const size_t rc = winpr_HexStringToBinBuffer(str, length, buffer, length);
 1039|    460|	if (rc == 0)
  ------------------
  |  Branch (1039:6): [True: 1, False: 459]
  ------------------
 1040|      1|	{
 1041|      1|		free(buffer);
 1042|      1|		return nullptr;
 1043|      1|	}
 1044|    459|	*size = rc;
 1045|    459|	return buffer;
 1046|    460|}
freerdp_assistance_parse_file_buffer:
 1211|  2.13k|{
 1212|  2.13k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.13k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.13k|	do                                                                                             \
  |  |  |  |   61|  2.13k|	{                                                                                              \
  |  |  |  |   62|  2.13k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.13k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.13k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.13k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.13k|                                                                                                   \
  |  |  |  |   70|  2.13k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.13k|	do                                                      \
  |  |  |  |  |  |   32|  2.13k|	{                                                       \
  |  |  |  |  |  |   33|  2.13k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.13k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.13k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.13k|                                                                                                   \
  |  |  |  |   72|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.13k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.13k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.13k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1213|  2.13k|	if (!password)
  ------------------
  |  Branch (1213:6): [True: 0, False: 2.13k]
  ------------------
 1214|      0|	{
 1215|      0|		WLog_WARN(TAG, "empty password supplied");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1216|      0|	}
 1217|       |
 1218|  2.13k|	if (!cbuffer || (size == 0))
  ------------------
  |  Branch (1218:6): [True: 0, False: 2.13k]
  |  Branch (1218:18): [True: 0, False: 2.13k]
  ------------------
 1219|      0|	{
 1220|      0|		WLog_WARN(TAG, "no data supplied [%p, %" PRIuz "]",
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1221|      0|		          WINPR_CXX_COMPAT_CAST(const void*, cbuffer), size);
 1222|      0|		return -1;
 1223|      0|	}
 1224|       |
 1225|  2.13k|	char* abuffer = strndup(cbuffer, size);
 1226|  2.13k|	const size_t len = strnlen(cbuffer, size);
 1227|  2.13k|	if (len == size)
  ------------------
  |  Branch (1227:6): [True: 0, False: 2.13k]
  ------------------
 1228|      0|		WLog_WARN(TAG, "Input data not '\\0' terminated");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1229|       |
 1230|  2.13k|	if (!abuffer)
  ------------------
  |  Branch (1230:6): [True: 0, False: 2.13k]
  ------------------
 1231|      0|		return -1;
 1232|       |
 1233|  2.13k|	const int rc = freerdp_assistance_parse_file_buffer_int(file, abuffer, len + 1, password);
 1234|  2.13k|	free(abuffer);
 1235|  2.13k|	return rc;
 1236|  2.13k|}
freerdp_assistance_file_new:
 1407|  2.13k|{
 1408|  2.13k|	if (!winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT))
  ------------------
  |  |   27|  2.13k|#define WINPR_SSL_INIT_DEFAULT 0x00
  ------------------
  |  Branch (1408:6): [True: 0, False: 2.13k]
  ------------------
 1409|      0|		return nullptr;
 1410|       |
 1411|  2.13k|	rdpAssistanceFile* file = calloc(1, sizeof(rdpAssistanceFile));
 1412|  2.13k|	if (!file)
  ------------------
  |  Branch (1412:6): [True: 0, False: 2.13k]
  ------------------
 1413|      0|		return nullptr;
 1414|       |
 1415|  2.13k|	file->MachineAddresses = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.13k|#define FALSE false
  ------------------
 1416|  2.13k|	file->MachinePorts = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.13k|#define FALSE false
  ------------------
 1417|  2.13k|	file->MachineUris = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.13k|#define FALSE false
  ------------------
 1418|       |
 1419|  2.13k|	if (!file->MachineAddresses || !file->MachinePorts || !file->MachineUris)
  ------------------
  |  Branch (1419:6): [True: 0, False: 2.13k]
  |  Branch (1419:33): [True: 0, False: 2.13k]
  |  Branch (1419:56): [True: 0, False: 2.13k]
  ------------------
 1420|      0|		goto fail;
 1421|       |
 1422|  2.13k|	if (!setup_string(file->MachineAddresses) || !setup_string(file->MachineUris))
  ------------------
  |  Branch (1422:6): [True: 0, False: 2.13k]
  |  Branch (1422:47): [True: 0, False: 2.13k]
  ------------------
 1423|      0|		goto fail;
 1424|       |
 1425|  2.13k|	return file;
 1426|       |
 1427|      0|fail:
 1428|      0|	WINPR_PRAGMA_DIAG_PUSH
 1429|      0|	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
 1430|      0|	freerdp_assistance_file_free(file);
 1431|      0|	WINPR_PRAGMA_DIAG_POP
 1432|      0|	return nullptr;
 1433|  2.13k|}
freerdp_assistance_file_free:
 1436|  2.13k|{
 1437|  2.13k|	if (!file)
  ------------------
  |  Branch (1437:6): [True: 0, False: 2.13k]
  ------------------
 1438|      0|		return;
 1439|       |
 1440|  2.13k|	update_password(file, nullptr);
 1441|  2.13k|	update_connectionstring2(file, nullptr, 0);
 1442|  2.13k|	free(file->filename);
 1443|  2.13k|	free(file->Username);
 1444|  2.13k|	free(file->LHTicket);
 1445|  2.13k|	free(file->RCTicket);
 1446|  2.13k|	free(file->PassStub);
 1447|  2.13k|	free(file->ConnectionString1);
 1448|  2.13k|	free(file->EncryptedLHTicket);
 1449|  2.13k|	free(file->RASessionId);
 1450|  2.13k|	free(file->RASpecificParams);
 1451|  2.13k|	free(file->RASpecificParams2);
 1452|  2.13k|	free(file->EncryptedPassStub);
 1453|       |
 1454|  2.13k|	ArrayList_Free(file->MachineAddresses);
 1455|  2.13k|	ArrayList_Free(file->MachinePorts);
 1456|  2.13k|	ArrayList_Free(file->MachineUris);
 1457|  2.13k|	free(file);
 1458|  2.13k|}
assistance.c:freerdp_assistance_parse_file_buffer_int:
 1178|  2.13k|{
 1179|  2.13k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.13k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.13k|	do                                                                                             \
  |  |  |  |   61|  2.13k|	{                                                                                              \
  |  |  |  |   62|  2.13k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.13k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.13k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.13k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.13k|                                                                                                   \
  |  |  |  |   70|  2.13k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.13k|	do                                                      \
  |  |  |  |  |  |   32|  2.13k|	{                                                       \
  |  |  |  |  |  |   33|  2.13k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.13k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.13k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.13k|                                                                                                   \
  |  |  |  |   72|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.13k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.13k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.13k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1180|  2.13k|	WINPR_ASSERT(buffer);
  ------------------
  |  |   76|  2.13k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.13k|	do                                                                                             \
  |  |  |  |   61|  2.13k|	{                                                                                              \
  |  |  |  |   62|  2.13k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.13k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.13k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.13k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.13k|                                                                                                   \
  |  |  |  |   70|  2.13k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.13k|	do                                                      \
  |  |  |  |  |  |   32|  2.13k|	{                                                       \
  |  |  |  |  |  |   33|  2.13k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.13k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.13k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.13k|                                                                                                   \
  |  |  |  |   72|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.13k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.13k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.13k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1181|  2.13k|	WINPR_ASSERT(size > 0);
  ------------------
  |  |   76|  2.13k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.13k|	do                                                                                             \
  |  |  |  |   61|  2.13k|	{                                                                                              \
  |  |  |  |   62|  2.13k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.13k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.13k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.13k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.13k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.13k|                                                                                                   \
  |  |  |  |   70|  2.13k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.13k|	do                                                      \
  |  |  |  |  |  |   32|  2.13k|	{                                                       \
  |  |  |  |  |  |   33|  2.13k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.13k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.13k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.13k|                                                                                                   \
  |  |  |  |   72|  2.13k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.13k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.13k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.13k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|       |
 1183|  2.13k|	if (!update_password(file, password))
  ------------------
  |  Branch (1183:6): [True: 0, False: 2.13k]
  ------------------
 1184|      0|		return -1;
 1185|       |
 1186|  2.13k|	char* uploadinfo = nullptr;
 1187|  2.13k|	size_t uploadinfosize = 0;
 1188|  2.13k|	if (freerdp_assistance_consume_input_and_get_element(buffer, size, "UPLOADINFO", &uploadinfo,
  ------------------
  |  Branch (1188:6): [True: 1.28k, False: 851]
  ------------------
 1189|  2.13k|	                                                     &uploadinfosize))
 1190|  1.28k|		return freerdp_assistance_parse_uploadinfo(file, uploadinfo, uploadinfosize);
 1191|       |
 1192|    851|	size_t elen = 0;
 1193|    851|	const char* estr =
 1194|    851|	    freerdp_assistance_contains_element(buffer, size, "E", &elen, nullptr, nullptr);
 1195|    851|	if (!estr || (elen == 0))
  ------------------
  |  Branch (1195:6): [True: 167, False: 684]
  |  Branch (1195:15): [True: 0, False: 684]
  ------------------
 1196|    167|	{
 1197|    167|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Neither UPLOADINFO nor <E> found");
  ------------------
  |  |  348|    167|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1198|    167|		return -1;
 1199|    167|	}
 1200|    684|	if (!update_connectionstring2(file, estr, elen))
  ------------------
  |  Branch (1200:6): [True: 0, False: 684]
  ------------------
 1201|      0|		return -1;
 1202|       |
 1203|    684|	if (!freerdp_assistance_parse_connection_string2(file))
  ------------------
  |  Branch (1203:6): [True: 223, False: 461]
  ------------------
 1204|    223|		return -1;
 1205|       |
 1206|    461|	return 1;
 1207|    684|}
assistance.c:freerdp_assistance_consume_input_and_get_element:
  624|  4.12k|{
  625|  4.12k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|  4.12k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.12k|	do                                                                                             \
  |  |  |  |   61|  4.12k|	{                                                                                              \
  |  |  |  |   62|  4.12k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.12k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.12k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.12k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.12k|                                                                                                   \
  |  |  |  |   70|  4.12k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.12k|	do                                                      \
  |  |  |  |  |  |   32|  4.12k|	{                                                       \
  |  |  |  |  |  |   33|  4.12k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.12k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.12k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.12k|                                                                                                   \
  |  |  |  |   72|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.12k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.12k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.12k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|  4.12k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|  4.12k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.12k|	do                                                                                             \
  |  |  |  |   61|  4.12k|	{                                                                                              \
  |  |  |  |   62|  4.12k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.12k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.12k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.12k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.12k|                                                                                                   \
  |  |  |  |   70|  4.12k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.12k|	do                                                      \
  |  |  |  |  |  |   32|  4.12k|	{                                                       \
  |  |  |  |  |  |   33|  4.12k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.12k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.12k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.12k|                                                                                                   \
  |  |  |  |   72|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.12k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.12k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.12k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|  4.12k|	WINPR_ASSERT(element);
  ------------------
  |  |   76|  4.12k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.12k|	do                                                                                             \
  |  |  |  |   61|  4.12k|	{                                                                                              \
  |  |  |  |   62|  4.12k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.12k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.12k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.12k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.12k|                                                                                                   \
  |  |  |  |   70|  4.12k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.12k|	do                                                      \
  |  |  |  |  |  |   32|  4.12k|	{                                                       \
  |  |  |  |  |  |   33|  4.12k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.12k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.12k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.12k|                                                                                                   \
  |  |  |  |   72|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.12k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.12k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.12k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|  4.12k|	WINPR_ASSERT(elen);
  ------------------
  |  |   76|  4.12k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.12k|	do                                                                                             \
  |  |  |  |   61|  4.12k|	{                                                                                              \
  |  |  |  |   62|  4.12k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.12k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.12k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.12k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.12k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.12k|                                                                                                   \
  |  |  |  |   70|  4.12k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.12k|	do                                                      \
  |  |  |  |  |  |   32|  4.12k|	{                                                       \
  |  |  |  |  |  |   33|  4.12k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.12k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.12k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.12k|                                                                                                   \
  |  |  |  |   72|  4.12k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.12k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.12k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.12k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|       |
  630|  4.12k|	size_t len = 0;
  631|  4.12k|	size_t dlen = 0;
  632|  4.12k|	char* data = nullptr;
  633|  4.12k|	char* tag = freerdp_assistance_contains_element(input, ilen, key, &len, &data, &dlen);
  634|  4.12k|	if (!tag)
  ------------------
  |  Branch (634:6): [True: 1.04k, False: 3.08k]
  ------------------
  635|  1.04k|		return FALSE;
  ------------------
  |  |  122|  1.04k|#define FALSE false
  ------------------
  636|       |
  637|  3.08k|	char* end = data + dlen;
  638|  3.08k|	*tag = '\0';
  639|  3.08k|	*end = '\0';
  640|  3.08k|	*element = data;
  641|  3.08k|	*elen = dlen + 1;
  642|  3.08k|	return TRUE;
  ------------------
  |  |  126|  3.08k|#define TRUE true
  ------------------
  643|  4.12k|}
assistance.c:freerdp_assistance_parse_uploadinfo:
 1055|  1.28k|{
 1056|  1.28k|	const char escalated[9] = { 'E', 's', 'c', 'a', 'l', 'a', 't', 'e', 'd' };
 1057|  1.28k|	const size_t esclen = sizeof(escalated);
 1058|  1.28k|	const char* typestr = nullptr;
 1059|  1.28k|	size_t typelen = 0;
 1060|       |
 1061|  1.28k|	if (!uploadinfo || (uploadinfosize == 0))
  ------------------
  |  Branch (1061:6): [True: 0, False: 1.28k]
  |  Branch (1061:21): [True: 0, False: 1.28k]
  ------------------
 1062|      0|		return -1;
 1063|       |
 1064|  1.28k|	const size_t ulen = strnlen(uploadinfo, uploadinfosize);
 1065|  1.28k|	if (ulen == uploadinfosize)
  ------------------
  |  Branch (1065:6): [True: 0, False: 1.28k]
  ------------------
 1066|      0|	{
 1067|      0|		WLog_WARN(TAG, "UPLOADINFOR string is not '\\0' terminated");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1068|      0|		return -1;
 1069|      0|	}
 1070|       |
 1071|  1.28k|	if (!freerdp_assistance_parse_attr(&typestr, &typelen, "TYPE", uploadinfo))
  ------------------
  |  Branch (1071:6): [True: 3, False: 1.27k]
  ------------------
 1072|      3|		return -1;
 1073|       |
 1074|  1.27k|	if ((typelen != esclen) || (strncmp(typestr, escalated, esclen) != 0))
  ------------------
  |  Branch (1074:6): [True: 66, False: 1.21k]
  |  Branch (1074:29): [True: 75, False: 1.13k]
  ------------------
 1075|    141|	{
 1076|    141|		WLog_ERR(TAG,
  ------------------
  |  |  348|    141|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1077|    141|		         "Failed to parse ASSISTANCE file: Missing or invalid UPLOADINFO TYPE '%s' [%" PRIuz
 1078|    141|		         "]",
 1079|    141|		         typestr, typelen);
 1080|    141|		return -1;
 1081|    141|	}
 1082|       |
 1083|  1.13k|	char* uploaddata = nullptr;
 1084|  1.13k|	size_t uploaddatasize = 0;
 1085|  1.13k|	if (!freerdp_assistance_consume_input_and_get_element(uploadinfo, ulen, "UPLOADDATA",
  ------------------
  |  Branch (1085:6): [True: 11, False: 1.12k]
  ------------------
 1086|  1.13k|	                                                      &uploaddata, &uploaddatasize))
 1087|     11|		return -1;
 1088|       |
 1089|       |	/* Parse USERNAME */
 1090|  1.12k|	if (!freerdp_assistance_parse_attr_str(&file->Username, "USERNAME", uploaddata))
  ------------------
  |  Branch (1090:6): [True: 1, False: 1.12k]
  ------------------
 1091|      1|		return -1;
 1092|       |
 1093|       |	/* Parse LHTICKET */
 1094|  1.12k|	if (!freerdp_assistance_parse_attr_str(&file->LHTicket, "LHTICKET", uploaddata))
  ------------------
  |  Branch (1094:6): [True: 3, False: 1.12k]
  ------------------
 1095|      3|		return -1;
 1096|       |
 1097|       |	/* Parse RCTICKET */
 1098|  1.12k|	if (!freerdp_assistance_parse_attr_str(&file->RCTicket, "RCTICKET", uploaddata))
  ------------------
  |  Branch (1098:6): [True: 2, False: 1.11k]
  ------------------
 1099|      2|		return -1;
 1100|       |
 1101|       |	/* Parse RCTICKETENCRYPTED */
 1102|  1.11k|	if (!freerdp_assistance_parse_attr_bool(&file->RCTicketEncrypted, "RCTICKETENCRYPTED",
  ------------------
  |  Branch (1102:6): [True: 1, False: 1.11k]
  ------------------
 1103|  1.11k|	                                        uploaddata))
 1104|      1|		return -1;
 1105|       |
 1106|       |	/* Parse PassStub */
 1107|  1.11k|	if (!freerdp_assistance_parse_attr_str(&file->PassStub, "PassStub", uploaddata))
  ------------------
  |  Branch (1107:6): [True: 3, False: 1.11k]
  ------------------
 1108|      3|		return -1;
 1109|       |
 1110|  1.11k|	if (file->PassStub)
  ------------------
  |  Branch (1110:6): [True: 284, False: 831]
  ------------------
 1111|    284|	{
 1112|    284|		const char* amp = "&amp;";
 1113|    284|		char* passtub = strstr(file->PassStub, amp);
 1114|    633|		while (passtub)
  ------------------
  |  Branch (1114:10): [True: 349, False: 284]
  ------------------
 1115|    349|		{
 1116|    349|			const char* end = passtub + 5;
 1117|    349|			const size_t len = strlen(end);
 1118|    349|			memmove(&passtub[1], end, len + 1);
 1119|    349|			passtub = strstr(passtub, amp);
 1120|    349|		}
 1121|    284|	}
 1122|       |
 1123|       |	/* Parse DtStart */
 1124|  1.11k|	if (!freerdp_assistance_parse_attr_uint32(&file->DtStart, "DtStart", uploaddata))
  ------------------
  |  Branch (1124:6): [True: 4, False: 1.11k]
  ------------------
 1125|      4|		return -1;
 1126|       |
 1127|       |	/* Parse DtLength */
 1128|  1.11k|	if (!freerdp_assistance_parse_attr_uint32(&file->DtLength, "DtLength", uploaddata))
  ------------------
  |  Branch (1128:6): [True: 5, False: 1.10k]
  ------------------
 1129|      5|		return -1;
 1130|       |
 1131|       |	/* Parse L (LowSpeed) */
 1132|  1.10k|	if (!freerdp_assistance_parse_attr_bool(&file->LowSpeed, "L", uploaddata))
  ------------------
  |  Branch (1132:6): [True: 1, False: 1.10k]
  ------------------
 1133|      1|		return -1;
 1134|       |
 1135|  1.10k|	file->Type = (file->LHTicket) ? 2 : 1;
  ------------------
  |  Branch (1135:15): [True: 460, False: 645]
  ------------------
 1136|  1.10k|	int status = 0;
 1137|       |
 1138|  1.10k|	switch (file->Type)
 1139|  1.10k|	{
 1140|    460|		case 2:
  ------------------
  |  Branch (1140:3): [True: 460, False: 645]
  ------------------
 1141|    460|		{
 1142|    460|			file->EncryptedLHTicket = freerdp_assistance_hex_string_to_bin(
 1143|    460|			    file->LHTicket, &file->EncryptedLHTicketLength);
 1144|       |
 1145|    460|			if (!freerdp_assistance_decrypt2(file))
  ------------------
  |  Branch (1145:8): [True: 460, False: 0]
  ------------------
 1146|    460|				status = -1;
 1147|    460|		}
 1148|    460|		break;
 1149|       |
 1150|    645|		case 1:
  ------------------
  |  Branch (1150:3): [True: 645, False: 460]
  ------------------
 1151|    645|		{
 1152|    645|			if (!freerdp_assistance_parse_connection_string1(file))
  ------------------
  |  Branch (1152:8): [True: 317, False: 328]
  ------------------
 1153|    317|				status = -1;
 1154|    645|		}
 1155|    645|		break;
 1156|       |
 1157|      0|		default:
  ------------------
  |  Branch (1157:3): [True: 0, False: 1.10k]
  ------------------
 1158|      0|			return -1;
 1159|  1.10k|	}
 1160|       |
 1161|  1.10k|	if (status < 0)
  ------------------
  |  Branch (1161:6): [True: 777, False: 328]
  ------------------
 1162|    777|	{
 1163|    777|		WLog_ERR(TAG, "freerdp_assistance_parse_connection_string1 failure: %d", status);
  ------------------
  |  |  348|    777|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1164|    777|		return -1;
 1165|    777|	}
 1166|       |
 1167|    328|	file->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub(file->password, file->PassStub,
 1168|    328|	                                                               &file->EncryptedPassStubLength);
 1169|       |
 1170|    328|	if (!file->EncryptedPassStub)
  ------------------
  |  Branch (1170:6): [True: 80, False: 248]
  ------------------
 1171|     80|		return -1;
 1172|       |
 1173|    248|	return 1;
 1174|    328|}
assistance.c:freerdp_assistance_parse_attr:
  423|  32.1k|{
  424|  32.1k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  32.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  32.1k|	do                                                                                             \
  |  |  |  |   61|  32.1k|	{                                                                                              \
  |  |  |  |   62|  32.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  32.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  32.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  32.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  32.1k|                                                                                                   \
  |  |  |  |   70|  32.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  32.1k|	do                                                      \
  |  |  |  |  |  |   32|  32.1k|	{                                                       \
  |  |  |  |  |  |   33|  32.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  32.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  32.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  32.1k|                                                                                                   \
  |  |  |  |   72|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  32.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  32.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  32.1k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 32.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|  32.1k|	WINPR_ASSERT(plength);
  ------------------
  |  |   76|  32.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  32.1k|	do                                                                                             \
  |  |  |  |   61|  32.1k|	{                                                                                              \
  |  |  |  |   62|  32.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  32.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  32.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  32.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  32.1k|                                                                                                   \
  |  |  |  |   70|  32.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  32.1k|	do                                                      \
  |  |  |  |  |  |   32|  32.1k|	{                                                       \
  |  |  |  |  |  |   33|  32.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  32.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  32.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  32.1k|                                                                                                   \
  |  |  |  |   72|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  32.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  32.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  32.1k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 32.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  426|  32.1k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|  32.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  32.1k|	do                                                                                             \
  |  |  |  |   61|  32.1k|	{                                                                                              \
  |  |  |  |   62|  32.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  32.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  32.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  32.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  32.1k|                                                                                                   \
  |  |  |  |   70|  32.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  32.1k|	do                                                      \
  |  |  |  |  |  |   32|  32.1k|	{                                                       \
  |  |  |  |  |  |   33|  32.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  32.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  32.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  32.1k|                                                                                                   \
  |  |  |  |   72|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  32.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  32.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  32.1k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 32.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|       |
  428|  32.1k|	*opt = nullptr;
  429|  32.1k|	*plength = 0;
  430|  32.1k|	if (!tag)
  ------------------
  |  Branch (430:6): [True: 0, False: 32.1k]
  ------------------
  431|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  432|       |
  433|  32.1k|	char bkey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  32.1k|	{                      \
  |  |   85|  32.1k|	} /** @since version 3.24.0 */
  ------------------
  434|  32.1k|	const int rc = _snprintf(bkey, sizeof(bkey), "%s=\"", key);
  ------------------
  |  |  251|  32.1k|#define _snprintf snprintf
  ------------------
  435|  32.1k|	WINPR_ASSERT(rc > 0);
  ------------------
  |  |   76|  32.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  32.1k|	do                                                                                             \
  |  |  |  |   61|  32.1k|	{                                                                                              \
  |  |  |  |   62|  32.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  32.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  32.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  32.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  32.1k|                                                                                                   \
  |  |  |  |   70|  32.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  32.1k|	do                                                      \
  |  |  |  |  |  |   32|  32.1k|	{                                                       \
  |  |  |  |  |  |   33|  32.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  32.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  32.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  32.1k|                                                                                                   \
  |  |  |  |   72|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  32.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  32.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  32.1k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 32.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|  32.1k|	WINPR_ASSERT((size_t)rc < sizeof(bkey));
  ------------------
  |  |   76|  32.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  32.1k|	do                                                                                             \
  |  |  |  |   61|  32.1k|	{                                                                                              \
  |  |  |  |   62|  32.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  32.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  32.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  32.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  32.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  32.1k|                                                                                                   \
  |  |  |  |   70|  32.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  32.1k|	do                                                      \
  |  |  |  |  |  |   32|  32.1k|	{                                                       \
  |  |  |  |  |  |   33|  32.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  32.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  32.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 32.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  32.1k|                                                                                                   \
  |  |  |  |   72|  32.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  32.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  32.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  32.1k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 32.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|  32.1k|	if ((rc <= 0) || ((size_t)rc >= sizeof(bkey)))
  ------------------
  |  Branch (437:6): [True: 0, False: 32.1k]
  |  Branch (437:19): [True: 0, False: 32.1k]
  ------------------
  438|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  439|       |
  440|  32.1k|	const char* p = strstr(tag, bkey);
  441|  32.1k|	if (!p)
  ------------------
  |  Branch (441:6): [True: 23.8k, False: 8.28k]
  ------------------
  442|  23.8k|		return TRUE;
  ------------------
  |  |  126|  23.8k|#define TRUE true
  ------------------
  443|       |
  444|  8.28k|	p += strlen(bkey);
  445|  8.28k|	const char* q = strchr(p, '"');
  446|       |
  447|  8.28k|	if (!q)
  ------------------
  |  Branch (447:6): [True: 92, False: 8.19k]
  ------------------
  448|     92|	{
  449|     92|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field '%s=%s'",
  ------------------
  |  |  348|     92|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  450|     92|		         key, p);
  451|     92|		return FALSE;
  ------------------
  |  |  122|     92|#define FALSE false
  ------------------
  452|     92|	}
  453|       |
  454|  8.19k|	if (p > q)
  ------------------
  |  Branch (454:6): [True: 0, False: 8.19k]
  ------------------
  455|      0|	{
  456|      0|		WLog_ERR(TAG,
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  457|      0|		         "Failed to parse ASSISTANCE file: ConnectionString2 invalid field "
  458|      0|		         "order for '%s'",
  459|      0|		         key);
  460|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  461|      0|	}
  462|  8.19k|	const size_t length = WINPR_ASSERTING_INT_CAST(size_t, q - p);
  ------------------
  |  |  112|  8.19k|	__extension__({                                                                             \
  |  |  113|  8.19k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  8.19k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  8.19k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  8.19k|	do                                                                                             \
  |  |  |  |  |  |   61|  8.19k|	{                                                                                              \
  |  |  |  |  |  |   62|  8.19k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  8.19k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  8.19k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  8.19k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  8.19k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  8.19k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  8.19k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  8.19k|                                                                                                   \
  |  |  |  |  |  |   70|  8.19k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  8.19k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  8.19k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  8.19k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 8.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  8.19k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  8.19k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 8.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  8.19k|                                                                                                   \
  |  |  |  |  |  |   72|  8.19k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  8.19k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  8.19k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  8.19k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 8.19k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  8.19k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  8.19k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  8.19k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  8.19k|	do                                                                                             \
  |  |  |  |  |  |   61|  8.19k|	{                                                                                              \
  |  |  |  |  |  |   62|  8.19k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  8.19k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  8.19k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  8.19k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  8.19k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  8.19k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  8.19k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  8.19k|                                                                                                   \
  |  |  |  |  |  |   70|  8.19k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  8.19k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  8.19k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  29.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.51k, False: 2.67k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.51k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 2.67k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 2.67k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  8.19k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  8.19k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 8.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  8.19k|                                                                                                   \
  |  |  |  |  |  |   72|  8.19k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  8.19k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  8.19k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  8.19k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 8.19k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  8.19k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  8.19k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  8.19k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  8.19k|	})
  ------------------
  463|  8.19k|	*opt = p;
  464|  8.19k|	*plength = length;
  465|       |
  466|  8.19k|	return TRUE;
  ------------------
  |  |  126|  8.19k|#define TRUE true
  ------------------
  467|  8.19k|}
assistance.c:freerdp_assistance_parse_attr_str:
  470|  5.93k|{
  471|  5.93k|	const char* copt = nullptr;
  472|  5.93k|	size_t size = 0;
  473|  5.93k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (473:6): [True: 52, False: 5.87k]
  ------------------
  474|     52|		return FALSE;
  ------------------
  |  |  122|     52|#define FALSE false
  ------------------
  475|  5.87k|	return update_option(opt, copt, size);
  476|  5.93k|}
assistance.c:update_option:
  100|  5.87k|{
  101|  5.87k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  5.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  5.87k|	do                                                                                             \
  |  |  |  |   61|  5.87k|	{                                                                                              \
  |  |  |  |   62|  5.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  5.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  5.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  5.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  5.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  5.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  5.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  5.87k|                                                                                                   \
  |  |  |  |   70|  5.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  5.87k|	do                                                      \
  |  |  |  |  |  |   32|  5.87k|	{                                                       \
  |  |  |  |  |  |   33|  5.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 5.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  5.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  5.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 5.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  5.87k|                                                                                                   \
  |  |  |  |   72|  5.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  5.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  5.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  5.87k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 5.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|  5.87k|	free(*opt);
  103|  5.87k|	*opt = nullptr;
  104|       |
  105|  5.87k|	if (!val && (len != 0))
  ------------------
  |  Branch (105:6): [True: 4.46k, False: 1.41k]
  |  Branch (105:14): [True: 0, False: 4.46k]
  ------------------
  106|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  107|  5.87k|	else if (!val && (len == 0))
  ------------------
  |  Branch (107:11): [True: 4.46k, False: 1.41k]
  |  Branch (107:19): [True: 4.46k, False: 0]
  ------------------
  108|  4.46k|		return TRUE;
  ------------------
  |  |  126|  4.46k|#define TRUE true
  ------------------
  109|  1.41k|	*opt = strndup(val, len);
  110|  1.41k|	return *opt != nullptr;
  111|  5.87k|}
assistance.c:freerdp_assistance_parse_attr_bool:
  479|  2.22k|{
  480|  2.22k|	const char* copt = nullptr;
  481|  2.22k|	size_t size = 0;
  482|       |
  483|  2.22k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  2.22k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.22k|	do                                                                                             \
  |  |  |  |   61|  2.22k|	{                                                                                              \
  |  |  |  |   62|  2.22k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.22k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.22k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.22k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.22k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.22k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.22k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.22k|                                                                                                   \
  |  |  |  |   70|  2.22k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.22k|	do                                                      \
  |  |  |  |  |  |   32|  2.22k|	{                                                       \
  |  |  |  |  |  |   33|  2.22k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.22k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.22k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.22k|                                                                                                   \
  |  |  |  |   72|  2.22k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.22k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.22k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.22k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  2.22k|	*opt = FALSE;
  ------------------
  |  |  122|  2.22k|#define FALSE false
  ------------------
  485|       |
  486|  2.22k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (486:6): [True: 2, False: 2.22k]
  ------------------
  487|      2|		return FALSE;
  ------------------
  |  |  122|      2|#define FALSE false
  ------------------
  488|  2.22k|	if (size != 1)
  ------------------
  |  Branch (488:6): [True: 2.20k, False: 15]
  ------------------
  489|  2.20k|		return TRUE;
  ------------------
  |  |  126|  2.20k|#define TRUE true
  ------------------
  490|       |
  491|     15|	*opt = (copt[0] == '1');
  492|     15|	return TRUE;
  ------------------
  |  |  126|     15|#define TRUE true
  ------------------
  493|  2.22k|}
assistance.c:freerdp_assistance_parse_attr_uint32:
  496|  12.7k|{
  497|  12.7k|	const char* copt = nullptr;
  498|  12.7k|	size_t size = 0;
  499|       |
  500|  12.7k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  12.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  12.7k|	do                                                                                             \
  |  |  |  |   61|  12.7k|	{                                                                                              \
  |  |  |  |   62|  12.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  12.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  12.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  12.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  12.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  12.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  12.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  12.7k|                                                                                                   \
  |  |  |  |   70|  12.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  12.7k|	do                                                      \
  |  |  |  |  |  |   32|  12.7k|	{                                                       \
  |  |  |  |  |  |   33|  12.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  12.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  12.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  12.7k|                                                                                                   \
  |  |  |  |   72|  12.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  12.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  12.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  12.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|  12.7k|	*opt = 0;
  502|       |
  503|  12.7k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (503:6): [True: 18, False: 12.6k]
  ------------------
  504|     18|		return FALSE;
  ------------------
  |  |  122|     18|#define FALSE false
  ------------------
  505|       |
  506|  12.6k|	char buffer[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  12.6k|	{                      \
  |  |   85|  12.6k|	} /** @since version 3.24.0 */
  ------------------
  507|  12.6k|	if ((!copt && (size > 0)) || (size >= sizeof(buffer)))
  ------------------
  |  Branch (507:7): [True: 11.3k, False: 1.32k]
  |  Branch (507:16): [True: 0, False: 11.3k]
  |  Branch (507:31): [True: 40, False: 12.6k]
  ------------------
  508|     40|	{
  509|     40|		WLog_WARN(TAG, "Invalid UINT32 string '%s' [%" PRIuz "]", copt, size);
  ------------------
  |  |  346|     40|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  510|     40|		return FALSE;
  ------------------
  |  |  122|     40|#define FALSE false
  ------------------
  511|     40|	}
  512|       |
  513|  12.6k|	if (size > 0)
  ------------------
  |  Branch (513:6): [True: 865, False: 11.7k]
  ------------------
  514|    865|		strncpy(buffer, copt, size);
  515|       |
  516|  12.6k|	errno = 0;
  517|  12.6k|	unsigned long val = strtoul(buffer, nullptr, 0);
  518|       |
  519|  12.6k|	if ((errno != 0) || (val > UINT32_MAX))
  ------------------
  |  Branch (519:6): [True: 1, False: 12.6k]
  |  Branch (519:22): [True: 82, False: 12.5k]
  ------------------
  520|     83|	{
  521|     83|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Invalid value %s", buffer);
  ------------------
  |  |  348|     83|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  522|     83|		return FALSE;
  ------------------
  |  |  122|     83|#define FALSE false
  ------------------
  523|     83|	}
  524|       |
  525|  12.5k|	*opt = (UINT32)val;
  526|       |
  527|  12.5k|	return TRUE;
  ------------------
  |  |  126|  12.5k|#define TRUE true
  ------------------
  528|  12.6k|}
assistance.c:freerdp_assistance_decrypt2:
  936|    460|{
  937|    460|	BOOL rc = FALSE;
  ------------------
  |  |  122|    460|#define FALSE false
  ------------------
  938|    460|	int status = 0;
  939|    460|	size_t cbPasswordW = 0;
  940|    460|	size_t cchOutW = 0;
  941|    460|	WINPR_CIPHER_CTX* aesDec = nullptr;
  942|    460|	WCHAR* PasswordW = nullptr;
  943|    460|	BYTE* pbIn = nullptr;
  944|    460|	BYTE* pbOut = nullptr;
  945|    460|	size_t cbOut = 0;
  946|    460|	size_t cbIn = 0;
  947|    460|	size_t cbFinal = 0;
  948|    460|	BYTE DerivedKey[WINPR_AES_BLOCK_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    460|	{                      \
  |  |   85|    460|	} /** @since version 3.24.0 */
  ------------------
  949|    460|	BYTE InitializationVector[WINPR_AES_BLOCK_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    460|	{                      \
  |  |   85|    460|	} /** @since version 3.24.0 */
  ------------------
  950|    460|	BYTE PasswordHash[WINPR_SHA1_DIGEST_LENGTH] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    460|	{                      \
  |  |   85|    460|	} /** @since version 3.24.0 */
  ------------------
  951|       |
  952|    460|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  953|       |
  954|    460|	if (!file->password)
  ------------------
  |  Branch (954:6): [True: 0, False: 460]
  ------------------
  955|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  956|       |
  957|    460|	PasswordW = ConvertUtf8ToWCharAlloc(file->password, &cbPasswordW);
  958|    460|	if (!PasswordW)
  ------------------
  |  Branch (958:6): [True: 0, False: 460]
  ------------------
  959|      0|	{
  960|      0|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Conversion from UCS2 to UTF8 failed");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  961|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  962|      0|	}
  963|       |
  964|    460|	cbPasswordW = cbPasswordW * sizeof(WCHAR);
  965|       |
  966|    460|	if (!winpr_Digest(WINPR_MD_SHA1, (BYTE*)PasswordW, cbPasswordW, PasswordHash,
  ------------------
  |  Branch (966:6): [True: 0, False: 460]
  ------------------
  967|    460|	                  sizeof(PasswordHash)))
  968|      0|		goto fail;
  969|       |
  970|    460|	if (!freerdp_assistance_crypt_derive_key_sha1(PasswordHash, sizeof(PasswordHash), DerivedKey,
  ------------------
  |  Branch (970:6): [True: 0, False: 460]
  ------------------
  971|    460|	                                              sizeof(DerivedKey)))
  972|      0|		goto fail;
  973|       |
  974|    460|	aesDec =
  975|    460|	    winpr_Cipher_NewEx(WINPR_CIPHER_AES_128_CBC, WINPR_DECRYPT, DerivedKey, sizeof(DerivedKey),
  976|    460|	                       InitializationVector, sizeof(InitializationVector));
  977|       |
  978|    460|	if (!aesDec)
  ------------------
  |  Branch (978:6): [True: 0, False: 460]
  ------------------
  979|      0|		goto fail;
  980|       |
  981|    460|	cbOut = cbFinal = 0;
  982|    460|	cbIn = file->EncryptedLHTicketLength;
  983|    460|	pbIn = file->EncryptedLHTicket;
  984|    460|	pbOut = (BYTE*)calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2);
  ------------------
  |  |  205|    460|#define WINPR_AES_BLOCK_SIZE 16
  ------------------
  985|       |
  986|    460|	if (!pbOut)
  ------------------
  |  Branch (986:6): [True: 0, False: 460]
  ------------------
  987|      0|		goto fail;
  988|       |
  989|    460|	if (!winpr_Cipher_Update(aesDec, pbIn, cbIn, pbOut, &cbOut))
  ------------------
  |  Branch (989:6): [True: 0, False: 460]
  ------------------
  990|      0|		goto fail;
  991|       |
  992|    460|	if (!winpr_Cipher_Final(aesDec, pbOut + cbOut, &cbFinal))
  ------------------
  |  Branch (992:6): [True: 191, False: 269]
  ------------------
  993|    191|	{
  994|    191|		WLog_ERR(TAG, "winpr_Cipher_Final failure");
  ------------------
  |  |  348|    191|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  995|    191|		goto fail;
  996|    191|	}
  997|       |
  998|    269|	cbOut += cbFinal;
  999|    269|	cbFinal = 0;
 1000|       |
 1001|    269|	union
 1002|    269|	{
 1003|    269|		const WCHAR* wc;
 1004|    269|		const BYTE* b;
 1005|    269|	} cnv;
 1006|       |
 1007|    269|	cnv.b = pbOut;
 1008|    269|	cchOutW = cbOut / sizeof(WCHAR);
 1009|       |
 1010|    269|	if (!update_connectionstring2_wchar(file, cnv.wc, cchOutW))
  ------------------
  |  Branch (1010:6): [True: 94, False: 175]
  ------------------
 1011|     94|	{
 1012|     94|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Conversion from UCS2 to UTF8 failed");
  ------------------
  |  |  348|     94|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1013|     94|		goto fail;
 1014|     94|	}
 1015|       |
 1016|    175|	if (!freerdp_assistance_parse_connection_string2(file))
  ------------------
  |  Branch (1016:6): [True: 175, False: 0]
  ------------------
 1017|    175|		goto fail;
 1018|       |
 1019|      0|	rc = TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
 1020|    460|fail:
 1021|    460|	winpr_Cipher_Free(aesDec);
 1022|    460|	free(PasswordW);
 1023|    460|	free(pbOut);
 1024|    460|	WLog_DBG(TAG, "freerdp_assistance_parse_connection_string2: %d", status);
  ------------------
  |  |  342|    460|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1025|    460|	return rc;
 1026|      0|}
assistance.c:freerdp_assistance_crypt_derive_key_sha1:
  219|    460|{
  220|    460|	BOOL rc = FALSE;
  ------------------
  |  |  122|    460|#define FALSE false
  ------------------
  221|    460|	BYTE pad1[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    460|	{                      \
  |  |   85|    460|	} /** @since version 3.24.0 */
  ------------------
  222|    460|	BYTE pad2[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    460|	{                      \
  |  |   85|    460|	} /** @since version 3.24.0 */
  ------------------
  223|       |
  224|    460|	if (hashLength == 0)
  ------------------
  |  Branch (224:6): [True: 0, False: 460]
  ------------------
  225|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  226|       |
  227|    460|	memset(pad1, 0x36, sizeof(pad1));
  228|    460|	memset(pad2, 0x5C, sizeof(pad2));
  229|       |
  230|  9.66k|	for (size_t i = 0; i < hashLength; i++)
  ------------------
  |  Branch (230:21): [True: 9.20k, False: 460]
  ------------------
  231|  9.20k|	{
  232|  9.20k|		pad1[i] ^= hash[i];
  233|  9.20k|		pad2[i] ^= hash[i];
  234|  9.20k|	}
  235|       |
  236|    460|	BYTE* buffer = (BYTE*)calloc(hashLength, 2);
  237|       |
  238|    460|	if (!buffer)
  ------------------
  |  Branch (238:6): [True: 0, False: 460]
  ------------------
  239|      0|		goto fail;
  240|       |
  241|    460|	if (!winpr_Digest(WINPR_MD_SHA1, pad1, 64, buffer, hashLength))
  ------------------
  |  Branch (241:6): [True: 0, False: 460]
  ------------------
  242|      0|		goto fail;
  243|       |
  244|    460|	if (!winpr_Digest(WINPR_MD_SHA1, pad2, 64, &buffer[hashLength], hashLength))
  ------------------
  |  Branch (244:6): [True: 0, False: 460]
  ------------------
  245|      0|		goto fail;
  246|       |
  247|    460|	CopyMemory(key, buffer, keyLength);
  ------------------
  |  |  123|    460|#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
  ------------------
  248|    460|	rc = TRUE;
  ------------------
  |  |  126|    460|#define TRUE true
  ------------------
  249|    460|fail:
  250|    460|	free(buffer);
  251|    460|	return rc;
  252|    460|}
assistance.c:update_connectionstring2_wchar:
  166|    269|{
  167|    269|	char* strc = nullptr;
  168|       |
  169|    269|	if (!str && (len != 0))
  ------------------
  |  Branch (169:6): [True: 0, False: 269]
  |  Branch (169:14): [True: 0, False: 0]
  ------------------
  170|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  171|       |
  172|    269|	if (str && (len > 0))
  ------------------
  |  Branch (172:6): [True: 269, False: 0]
  |  Branch (172:13): [True: 268, False: 1]
  ------------------
  173|    268|	{
  174|    268|		strc = ConvertWCharNToUtf8Alloc(str, len, nullptr);
  175|    268|		if (!strc)
  ------------------
  |  Branch (175:7): [True: 94, False: 174]
  ------------------
  176|     94|			return FALSE;
  ------------------
  |  |  122|     94|#define FALSE false
  ------------------
  177|    268|	}
  178|    175|	return update_connectionstring2_nocopy(file, strc);
  179|    269|}
assistance.c:freerdp_assistance_parse_connection_string1:
  326|    645|{
  327|    645|	char* tokens[8] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|    645|	{                      \
  |  |   85|    645|	} /** @since version 3.24.0 */
  ------------------
  328|    645|	BOOL rc = FALSE;
  ------------------
  |  |  122|    645|#define FALSE false
  ------------------
  329|       |
  330|    645|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    645|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    645|	do                                                                                             \
  |  |  |  |   61|    645|	{                                                                                              \
  |  |  |  |   62|    645|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    645|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    645|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    645|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    645|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    645|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    645|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    645|                                                                                                   \
  |  |  |  |   70|    645|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    645|	do                                                      \
  |  |  |  |  |  |   32|    645|	{                                                       \
  |  |  |  |  |  |   33|    645|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 645]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    645|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    645|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 645]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    645|                                                                                                   \
  |  |  |  |   72|    645|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    645|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    645|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    645|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 645]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  331|       |
  332|    645|	if (!file->RCTicket)
  ------------------
  |  Branch (332:6): [True: 37, False: 608]
  ------------------
  333|     37|		return FALSE;
  ------------------
  |  |  122|     37|#define FALSE false
  ------------------
  334|       |
  335|       |	/**
  336|       |	 * <ProtocolVersion>,<protocolType>,<machineAddressList>,<assistantAccountPwd>,
  337|       |	 * <RASessionID>,<RASessionName>,<RASessionPwd>,<protocolSpecificParms>
  338|       |	 */
  339|    608|	char* str = _strdup(file->RCTicket);
  340|       |
  341|    608|	if (!str)
  ------------------
  |  Branch (341:6): [True: 0, False: 608]
  ------------------
  342|      0|		goto error;
  343|       |
  344|    608|	{
  345|    608|		const size_t length = strlen(str);
  346|       |
  347|    608|		{
  348|    608|			int count = 1;
  349|  4.39M|			for (size_t i = 0; i < length; i++)
  ------------------
  |  Branch (349:23): [True: 4.38M, False: 608]
  ------------------
  350|  4.38M|			{
  351|  4.38M|				if (str[i] == ',')
  ------------------
  |  Branch (351:9): [True: 71.7k, False: 4.31M]
  ------------------
  352|  71.7k|					count++;
  353|  4.38M|			}
  354|       |
  355|    608|			if (count != 8)
  ------------------
  |  Branch (355:8): [True: 43, False: 565]
  ------------------
  356|     43|				goto error;
  357|    608|		}
  358|       |
  359|    565|		{
  360|    565|			size_t count = 0;
  361|    565|			tokens[count++] = str;
  362|       |
  363|  3.79M|			for (size_t i = 0; i < length; i++)
  ------------------
  |  Branch (363:23): [True: 3.79M, False: 565]
  ------------------
  364|  3.79M|			{
  365|  3.79M|				if (str[i] == ',')
  ------------------
  |  Branch (365:9): [True: 3.95k, False: 3.78M]
  ------------------
  366|  3.95k|				{
  367|  3.95k|					str[i] = '\0';
  368|  3.95k|					tokens[count++] = &str[i + 1];
  369|  3.95k|				}
  370|  3.79M|			}
  371|    565|		}
  372|    565|	}
  373|       |
  374|    565|	if (strcmp(tokens[0], "65538") != 0)
  ------------------
  |  Branch (374:6): [True: 55, False: 510]
  ------------------
  375|     55|		goto error;
  376|       |
  377|    510|	if (strcmp(tokens[1], "1") != 0)
  ------------------
  |  Branch (377:6): [True: 4, False: 506]
  ------------------
  378|      4|		goto error;
  379|       |
  380|    506|	if (strcmp(tokens[3], "*") != 0)
  ------------------
  |  Branch (380:6): [True: 3, False: 503]
  ------------------
  381|      3|		goto error;
  382|       |
  383|    503|	if (strcmp(tokens[5], "*") != 0)
  ------------------
  |  Branch (383:6): [True: 3, False: 500]
  ------------------
  384|      3|		goto error;
  385|       |
  386|    500|	if (strcmp(tokens[6], "*") != 0)
  ------------------
  |  Branch (386:6): [True: 2, False: 498]
  ------------------
  387|      2|		goto error;
  388|       |
  389|    498|	file->RASessionId = _strdup(tokens[4]);
  390|       |
  391|    498|	if (!file->RASessionId)
  ------------------
  |  Branch (391:6): [True: 0, False: 498]
  ------------------
  392|      0|		goto error;
  393|       |
  394|    498|	file->RASpecificParams = _strdup(tokens[7]);
  395|       |
  396|    498|	if (!file->RASpecificParams)
  ------------------
  |  Branch (396:6): [True: 0, False: 498]
  ------------------
  397|      0|		goto error;
  398|       |
  399|    498|	if (!freerdp_assistance_parse_address_list(file, tokens[2]))
  ------------------
  |  Branch (399:6): [True: 170, False: 328]
  ------------------
  400|    170|		goto error;
  401|       |
  402|    328|	rc = TRUE;
  ------------------
  |  |  126|    328|#define TRUE true
  ------------------
  403|    608|error:
  404|    608|	free(str);
  405|    608|	return rc;
  406|    328|}
assistance.c:freerdp_assistance_parse_address_list:
  289|    498|{
  290|    498|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    498|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    498|	do                                                                                             \
  |  |  |  |   61|    498|	{                                                                                              \
  |  |  |  |   62|    498|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    498|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    498|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    498|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    498|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    498|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    498|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    498|                                                                                                   \
  |  |  |  |   70|    498|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    498|	do                                                      \
  |  |  |  |  |  |   32|    498|	{                                                       \
  |  |  |  |  |  |   33|    498|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 498]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    498|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    498|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 498]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    498|                                                                                                   \
  |  |  |  |   72|    498|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    498|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    498|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    498|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 498]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|       |
  292|    498|	WLog_DBG(TAG, "freerdp_assistance_parse_address_list list=%s", list);
  ------------------
  |  |  342|    498|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  293|       |
  294|    498|	BOOL rc = FALSE;
  ------------------
  |  |  122|    498|#define FALSE false
  ------------------
  295|       |
  296|    498|	if (!list)
  ------------------
  |  Branch (296:6): [True: 0, False: 498]
  ------------------
  297|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  298|       |
  299|    498|	char* strp = list;
  300|    498|	char* s = ";";
  301|       |
  302|       |	// get the first token
  303|    498|	char* saveptr = nullptr;
  304|    498|	char* token = strtok_s(strp, s, &saveptr);
  305|       |
  306|       |	// walk through other tokens
  307|   535k|	while (token != nullptr)
  ------------------
  |  Branch (307:9): [True: 535k, False: 328]
  ------------------
  308|   535k|	{
  309|   535k|		char* port = strchr(token, ':');
  310|   535k|		if (!port)
  ------------------
  |  Branch (310:7): [True: 9, False: 535k]
  ------------------
  311|      9|			goto out;
  312|   535k|		*port = '\0';
  313|   535k|		port++;
  314|       |
  315|   535k|		if (!append_address(file, token, port))
  ------------------
  |  Branch (315:7): [True: 161, False: 535k]
  ------------------
  316|    161|			goto out;
  317|       |
  318|   535k|		token = strtok_s(nullptr, s, &saveptr);
  319|   535k|	}
  320|    328|	rc = TRUE;
  ------------------
  |  |  126|    328|#define TRUE true
  ------------------
  321|    498|out:
  322|    498|	return rc;
  323|    328|}
assistance.c:append_address:
  270|   535k|{
  271|   535k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|   535k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   535k|	do                                                                                             \
  |  |  |  |   61|   535k|	{                                                                                              \
  |  |  |  |   62|   535k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   535k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   535k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   535k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   535k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   535k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   535k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   535k|                                                                                                   \
  |  |  |  |   70|   535k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   535k|	do                                                      \
  |  |  |  |  |  |   32|   535k|	{                                                       \
  |  |  |  |  |  |   33|   535k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 535k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   535k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   535k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 535k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   535k|                                                                                                   \
  |  |  |  |   72|   535k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   535k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   535k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   535k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 535k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|       |
  273|   535k|	errno = 0;
  274|   535k|	unsigned long p = strtoul(port, nullptr, 0);
  275|       |
  276|   535k|	if ((errno != 0) || (p == 0) || (p > UINT16_MAX))
  ------------------
  |  Branch (276:6): [True: 1, False: 535k]
  |  Branch (276:22): [True: 3, False: 535k]
  |  Branch (276:34): [True: 129, False: 535k]
  ------------------
  277|    133|	{
  278|    133|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid port value %s",
  ------------------
  |  |  348|    133|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  279|    133|		         port);
  280|    133|		return FALSE;
  ------------------
  |  |  122|    133|#define FALSE false
  ------------------
  281|    133|	}
  282|       |
  283|   535k|	if (!append_address_to_list(file->MachineAddresses, host, host ? strlen(host) : 0))
  ------------------
  |  Branch (283:6): [True: 28, False: 535k]
  |  Branch (283:60): [True: 535k, False: 0]
  ------------------
  284|     28|		return FALSE;
  ------------------
  |  |  122|     28|#define FALSE false
  ------------------
  285|   535k|	return ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p);
  286|   535k|}
assistance.c:append_address_to_list:
  255|   537k|{
  256|   537k|	char* copy = nullptr;
  257|   537k|	if (len > 0)
  ------------------
  |  Branch (257:6): [True: 537k, False: 28]
  ------------------
  258|   537k|		copy = strndup(str, len);
  259|   537k|	if (!copy)
  ------------------
  |  Branch (259:6): [True: 28, False: 537k]
  ------------------
  260|     28|		return FALSE;
  ------------------
  |  |  122|     28|#define FALSE false
  ------------------
  261|       |
  262|   537k|	const BOOL rc = ArrayList_Append(MachineAddresses, copy);
  263|   537k|	if (!rc)
  ------------------
  |  Branch (263:6): [True: 0, False: 537k]
  ------------------
  264|      0|		free(copy);
  265|       |	// NOLINTNEXTLINE(clang-analyzer-unix.Malloc): ArrayList_Append takes ownership of copy
  266|   537k|	return rc;
  267|   537k|}
assistance.c:freerdp_assistance_contains_element:
  532|   212k|{
  533|   212k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|   212k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   212k|	do                                                                                             \
  |  |  |  |   61|   212k|	{                                                                                              \
  |  |  |  |   62|   212k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   212k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   212k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   212k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   212k|                                                                                                   \
  |  |  |  |   70|   212k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   212k|	do                                                      \
  |  |  |  |  |  |   32|   212k|	{                                                       \
  |  |  |  |  |  |   33|   212k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   212k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   212k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   212k|                                                                                                   \
  |  |  |  |   72|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   212k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   212k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   212k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  534|   212k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|   212k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   212k|	do                                                                                             \
  |  |  |  |   61|   212k|	{                                                                                              \
  |  |  |  |   62|   212k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   212k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   212k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   212k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   212k|                                                                                                   \
  |  |  |  |   70|   212k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   212k|	do                                                      \
  |  |  |  |  |  |   32|   212k|	{                                                       \
  |  |  |  |  |  |   33|   212k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   212k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   212k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   212k|                                                                                                   \
  |  |  |  |   72|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   212k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   212k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   212k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|   212k|	WINPR_ASSERT(plen);
  ------------------
  |  |   76|   212k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   212k|	do                                                                                             \
  |  |  |  |   61|   212k|	{                                                                                              \
  |  |  |  |   62|   212k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   212k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   212k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   212k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   212k|                                                                                                   \
  |  |  |  |   70|   212k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   212k|	do                                                      \
  |  |  |  |  |  |   32|   212k|	{                                                       \
  |  |  |  |  |  |   33|   212k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   212k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   212k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   212k|                                                                                                   \
  |  |  |  |   72|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   212k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   212k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   212k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|       |
  537|   212k|	char bkey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|   212k|	{                      \
  |  |   85|   212k|	} /** @since version 3.24.0 */
  ------------------
  538|   212k|	const int rc = _snprintf(bkey, sizeof(bkey), "<%s", key);
  ------------------
  |  |  251|   212k|#define _snprintf snprintf
  ------------------
  539|   212k|	WINPR_ASSERT(rc > 0);
  ------------------
  |  |   76|   212k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   212k|	do                                                                                             \
  |  |  |  |   61|   212k|	{                                                                                              \
  |  |  |  |   62|   212k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   212k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   212k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   212k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   212k|                                                                                                   \
  |  |  |  |   70|   212k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   212k|	do                                                      \
  |  |  |  |  |  |   32|   212k|	{                                                       \
  |  |  |  |  |  |   33|   212k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   212k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   212k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   212k|                                                                                                   \
  |  |  |  |   72|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   212k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   212k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   212k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|   212k|	WINPR_ASSERT((size_t)rc < sizeof(bkey));
  ------------------
  |  |   76|   212k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   212k|	do                                                                                             \
  |  |  |  |   61|   212k|	{                                                                                              \
  |  |  |  |   62|   212k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   212k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   212k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   212k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   212k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   212k|                                                                                                   \
  |  |  |  |   70|   212k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   212k|	do                                                      \
  |  |  |  |  |  |   32|   212k|	{                                                       \
  |  |  |  |  |  |   33|   212k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   212k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   212k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   212k|                                                                                                   \
  |  |  |  |   72|   212k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   212k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   212k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   212k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  541|   212k|	if ((rc < 0) || ((size_t)rc >= sizeof(bkey)))
  ------------------
  |  Branch (541:6): [True: 0, False: 212k]
  |  Branch (541:18): [True: 0, False: 212k]
  ------------------
  542|      0|		return nullptr;
  543|       |
  544|   212k|	char* tag = winpr_strnstr(input, bkey, ilen);
  545|   212k|	if (!tag)
  ------------------
  |  Branch (545:6): [True: 11.3k, False: 201k]
  ------------------
  546|  11.3k|		return nullptr;
  547|       |
  548|   201k|	const intptr_t tdiff = (tag - input);
  549|   201k|	WINPR_ASSERT(tdiff >= 0);
  ------------------
  |  |   76|   201k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   201k|	do                                                                                             \
  |  |  |  |   61|   201k|	{                                                                                              \
  |  |  |  |   62|   201k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   201k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   201k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   201k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   201k|                                                                                                   \
  |  |  |  |   70|   201k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   201k|	do                                                      \
  |  |  |  |  |  |   32|   201k|	{                                                       \
  |  |  |  |  |  |   33|   201k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   201k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   201k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   201k|                                                                                                   \
  |  |  |  |   72|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   201k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   201k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   201k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 201k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|   201k|	const size_t utdiff = WINPR_ASSERTING_INT_CAST(size_t, tdiff);
  ------------------
  |  |  112|   201k|	__extension__({                                                                             \
  |  |  113|   201k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   201k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   201k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   201k|	do                                                                                             \
  |  |  |  |  |  |   61|   201k|	{                                                                                              \
  |  |  |  |  |  |   62|   201k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   201k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   201k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   201k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   201k|                                                                                                   \
  |  |  |  |  |  |   70|   201k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   201k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   201k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   201k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 201k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   201k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   201k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 201k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   201k|                                                                                                   \
  |  |  |  |  |  |   72|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   201k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   201k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   201k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   201k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   201k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   201k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   201k|	do                                                                                             \
  |  |  |  |  |  |   61|   201k|	{                                                                                              \
  |  |  |  |  |  |   62|   201k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   201k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   201k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   201k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   201k|                                                                                                   \
  |  |  |  |  |  |   70|   201k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   201k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   201k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   800k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 102k, False: 98.8k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 102k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 98.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 98.8k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   201k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   201k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 201k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   201k|                                                                                                   \
  |  |  |  |  |  |   72|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   201k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   201k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   201k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   201k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   201k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   201k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   201k|	})
  ------------------
  551|   201k|	WINPR_ASSERT(utdiff <= ilen);
  ------------------
  |  |   76|   201k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   201k|	do                                                                                             \
  |  |  |  |   61|   201k|	{                                                                                              \
  |  |  |  |   62|   201k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   201k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   201k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   201k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   201k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   201k|                                                                                                   \
  |  |  |  |   70|   201k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   201k|	do                                                      \
  |  |  |  |  |  |   32|   201k|	{                                                       \
  |  |  |  |  |  |   33|   201k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   201k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   201k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   201k|                                                                                                   \
  |  |  |  |   72|   201k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   201k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   201k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   201k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 201k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|   201k|	const size_t tlen = ilen - utdiff;
  553|   201k|	const size_t texpect = strnlen(bkey, sizeof(bkey));
  554|   201k|	if (tlen <= texpect)
  ------------------
  |  Branch (554:6): [True: 1, False: 201k]
  ------------------
  555|      1|		return nullptr;
  556|       |
  557|   201k|	char* data = tag + texpect;
  558|       |
  559|       |	/* Ensure there is a valid delimiter following our token */
  560|   201k|	switch (data[0])
  561|   201k|	{
  562|  3.07k|		case '>':
  ------------------
  |  Branch (562:3): [True: 3.07k, False: 197k]
  ------------------
  563|  40.8k|		case '/':
  ------------------
  |  Branch (563:3): [True: 37.7k, False: 163k]
  ------------------
  564|   116k|		case ' ':
  ------------------
  |  Branch (564:3): [True: 75.2k, False: 125k]
  ------------------
  565|   117k|		case '\t':
  ------------------
  |  Branch (565:3): [True: 1.91k, False: 199k]
  ------------------
  566|   117k|			break;
  567|  83.0k|		default:
  ------------------
  |  Branch (567:3): [True: 83.0k, False: 117k]
  ------------------
  568|  83.0k|			WLog_ERR(TAG,
  ------------------
  |  |  348|  83.0k|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  569|  83.0k|			         "Failed to parse ASSISTANCE file: ConnectionString2 missing delimiter after "
  570|  83.0k|			         "field %s",
  571|  83.0k|			         bkey);
  572|  83.0k|			return nullptr;
  573|   201k|	}
  574|       |
  575|   117k|	const char* start = winpr_strnstr(tag, ">", tlen);
  576|       |
  577|   117k|	if (!start || (start > input + ilen))
  ------------------
  |  Branch (577:6): [True: 7.58k, False: 110k]
  |  Branch (577:16): [True: 0, False: 110k]
  ------------------
  578|  7.58k|	{
  579|  7.58k|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 missing field %s", bkey);
  ------------------
  |  |  348|  7.58k|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  580|  7.58k|		return nullptr;
  581|  7.58k|	}
  582|       |
  583|   110k|	const char* end = start;
  584|   110k|	const char* dend = start - 1;
  585|   110k|	if (*dend != '/')
  ------------------
  |  Branch (585:6): [True: 3.58k, False: 106k]
  ------------------
  586|  3.58k|	{
  587|  3.58k|		char ekey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  3.58k|	{                      \
  |  |   85|  3.58k|	} /** @since version 3.24.0 */
  ------------------
  588|  3.58k|		const int erc = _snprintf(ekey, sizeof(ekey), "</%s>", key);
  ------------------
  |  |  251|  3.58k|#define _snprintf snprintf
  ------------------
  589|  3.58k|		WINPR_ASSERT(erc > 0);
  ------------------
  |  |   76|  3.58k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  3.58k|	do                                                                                             \
  |  |  |  |   61|  3.58k|	{                                                                                              \
  |  |  |  |   62|  3.58k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  3.58k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  3.58k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  3.58k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  3.58k|                                                                                                   \
  |  |  |  |   70|  3.58k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  3.58k|	do                                                      \
  |  |  |  |  |  |   32|  3.58k|	{                                                       \
  |  |  |  |  |  |   33|  3.58k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.58k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  3.58k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.58k|                                                                                                   \
  |  |  |  |   72|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  3.58k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  3.58k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  3.58k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  590|  3.58k|		WINPR_ASSERT((size_t)erc < sizeof(ekey));
  ------------------
  |  |   76|  3.58k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  3.58k|	do                                                                                             \
  |  |  |  |   61|  3.58k|	{                                                                                              \
  |  |  |  |   62|  3.58k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  3.58k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  3.58k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  3.58k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  3.58k|                                                                                                   \
  |  |  |  |   70|  3.58k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  3.58k|	do                                                      \
  |  |  |  |  |  |   32|  3.58k|	{                                                       \
  |  |  |  |  |  |   33|  3.58k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.58k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  3.58k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.58k|                                                                                                   \
  |  |  |  |   72|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  3.58k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  3.58k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  3.58k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 3.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|  3.58k|		if ((erc <= 0) || ((size_t)erc >= sizeof(ekey)))
  ------------------
  |  Branch (591:7): [True: 0, False: 3.58k]
  |  Branch (591:21): [True: 0, False: 3.58k]
  ------------------
  592|      0|			return nullptr;
  593|  3.58k|		const size_t offset = WINPR_ASSERTING_INT_CAST(size_t, start - tag);
  ------------------
  |  |  112|  3.58k|	__extension__({                                                                             \
  |  |  113|  3.58k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  3.58k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  3.58k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.58k|	do                                                                                             \
  |  |  |  |  |  |   61|  3.58k|	{                                                                                              \
  |  |  |  |  |  |   62|  3.58k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  3.58k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  3.58k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  3.58k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  3.58k|                                                                                                   \
  |  |  |  |  |  |   70|  3.58k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  3.58k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  3.58k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  3.58k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  3.58k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  3.58k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.58k|                                                                                                   \
  |  |  |  |  |  |   72|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  3.58k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  3.58k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  3.58k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  3.58k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  3.58k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  3.58k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.58k|	do                                                                                             \
  |  |  |  |  |  |   61|  3.58k|	{                                                                                              \
  |  |  |  |  |  |   62|  3.58k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  3.58k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  3.58k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  3.58k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  3.58k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  3.58k|                                                                                                   \
  |  |  |  |  |  |   70|  3.58k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  3.58k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  3.58k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  10.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.58k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.58k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  3.58k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  3.58k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.58k|                                                                                                   \
  |  |  |  |  |  |   72|  3.58k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  3.58k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  3.58k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  3.58k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  3.58k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  3.58k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  3.58k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  3.58k|	})
  ------------------
  594|  3.58k|		dend = end = strrstr(start, ilen - offset, ekey);
  595|  3.58k|		if (end)
  ------------------
  |  Branch (595:7): [True: 3.40k, False: 176]
  ------------------
  596|  3.40k|			end += strnlen(ekey, sizeof(ekey));
  597|  3.58k|	}
  598|       |
  599|   110k|	if (!end)
  ------------------
  |  Branch (599:6): [True: 176, False: 110k]
  ------------------
  600|    176|	{
  601|    176|		WLog_ERR(TAG,
  ------------------
  |  |  348|    176|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  602|    176|		         "Failed to parse ASSISTANCE file: ConnectionString2 missing end tag for field %s",
  603|    176|		         key);
  604|    176|		return nullptr;
  605|    176|	}
  606|   110k|	if (plen)
  ------------------
  |  Branch (606:6): [True: 110k, False: 0]
  ------------------
  607|   110k|		*plen = WINPR_ASSERTING_INT_CAST(size_t, end - tag);
  ------------------
  |  |  112|   110k|	__extension__({                                                                             \
  |  |  113|   110k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   110k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   110k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   110k|	do                                                                                             \
  |  |  |  |  |  |   61|   110k|	{                                                                                              \
  |  |  |  |  |  |   62|   110k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   110k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   110k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   110k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   110k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   110k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   110k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   110k|                                                                                                   \
  |  |  |  |  |  |   70|   110k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   110k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   110k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   110k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 110k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   110k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   110k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 110k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   110k|                                                                                                   \
  |  |  |  |  |  |   72|   110k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   110k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   110k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   110k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 110k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   110k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   110k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   110k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   110k|	do                                                                                             \
  |  |  |  |  |  |   61|   110k|	{                                                                                              \
  |  |  |  |  |  |   62|   110k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   110k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   110k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   110k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   110k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   110k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   110k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   110k|                                                                                                   \
  |  |  |  |  |  |   70|   110k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   110k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   110k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   330k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 110k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 110k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   110k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   110k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 110k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   110k|                                                                                                   \
  |  |  |  |  |  |   72|   110k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   110k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   110k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   110k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 110k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   110k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   110k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   110k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   110k|	})
  ------------------
  608|       |
  609|   110k|	if (pdata)
  ------------------
  |  Branch (609:6): [True: 109k, False: 684]
  ------------------
  610|   109k|		*pdata = data;
  611|   110k|	if (pdlen)
  ------------------
  |  Branch (611:6): [True: 109k, False: 684]
  ------------------
  612|   109k|		*pdlen = WINPR_ASSERTING_INT_CAST(size_t, dend - data);
  ------------------
  |  |  112|   109k|	__extension__({                                                                             \
  |  |  113|   109k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   109k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   109k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   109k|	do                                                                                             \
  |  |  |  |  |  |   61|   109k|	{                                                                                              \
  |  |  |  |  |  |   62|   109k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   109k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   109k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   109k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   109k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   109k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   109k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   109k|                                                                                                   \
  |  |  |  |  |  |   70|   109k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   109k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   109k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   109k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 109k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   109k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   109k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 109k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   109k|                                                                                                   \
  |  |  |  |  |  |   72|   109k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   109k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   109k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   109k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 109k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   109k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   109k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   109k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   109k|	do                                                                                             \
  |  |  |  |  |  |   61|   109k|	{                                                                                              \
  |  |  |  |  |  |   62|   109k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   109k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   109k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   109k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   109k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   109k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   109k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   109k|                                                                                                   \
  |  |  |  |  |  |   70|   109k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   109k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   109k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   340k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 103k, False: 5.78k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 103k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.78k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.78k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   109k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   109k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 109k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   109k|                                                                                                   \
  |  |  |  |  |  |   72|   109k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   109k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   109k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   109k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 109k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   109k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   109k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   109k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   109k|	})
  ------------------
  613|   110k|	return tag;
  614|   110k|}
assistance.c:strrstr:
   79|  3.58k|{
   80|  3.58k|	if (*needle == '\0')
  ------------------
  |  Branch (80:6): [True: 0, False: 3.58k]
  ------------------
   81|      0|		return haystack;
   82|       |
   83|  3.58k|	const char* result = nullptr;
   84|  3.58k|	for (;;)
   85|  10.8k|	{
   86|  10.8k|		const char* p = strstr(haystack, needle);
   87|  10.8k|		if (p == nullptr)
  ------------------
  |  Branch (87:7): [True: 3.58k, False: 7.23k]
  ------------------
   88|  3.58k|			break;
   89|  7.23k|		if (p > haystack + len)
  ------------------
  |  Branch (89:7): [True: 0, False: 7.23k]
  ------------------
   90|      0|			return nullptr;
   91|       |
   92|  7.23k|		result = p;
   93|  7.23k|		haystack = p + 1;
   94|  7.23k|	}
   95|       |
   96|  3.58k|	return result;
   97|  3.58k|}
assistance.c:setup_string:
 1395|  4.26k|{
 1396|  4.26k|	WINPR_ASSERT(list);
  ------------------
  |  |   76|  4.26k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.26k|	do                                                                                             \
  |  |  |  |   61|  4.26k|	{                                                                                              \
  |  |  |  |   62|  4.26k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.26k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.26k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.26k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.26k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.26k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.26k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.26k|                                                                                                   \
  |  |  |  |   70|  4.26k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.26k|	do                                                      \
  |  |  |  |  |  |   32|  4.26k|	{                                                       \
  |  |  |  |  |  |   33|  4.26k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.26k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.26k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.26k|                                                                                                   \
  |  |  |  |   72|  4.26k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.26k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.26k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.26k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1397|       |
 1398|  4.26k|	wObject* obj = ArrayList_Object(list);
 1399|  4.26k|	if (!obj)
  ------------------
  |  Branch (1399:6): [True: 0, False: 4.26k]
  ------------------
 1400|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
 1401|  4.26k|	obj->fnObjectFree = free;
 1402|       |	// obj->fnObjectNew = wwinpr_ObjectStringClone;
 1403|  4.26k|	return TRUE;
  ------------------
  |  |  126|  4.26k|#define TRUE true
  ------------------
 1404|  4.26k|}
assistance.c:update_password:
  129|  4.26k|{
  130|  4.26k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  4.26k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.26k|	do                                                                                             \
  |  |  |  |   61|  4.26k|	{                                                                                              \
  |  |  |  |   62|  4.26k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.26k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.26k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.26k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.26k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.26k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.26k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.26k|                                                                                                   \
  |  |  |  |   70|  4.26k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.26k|	do                                                      \
  |  |  |  |  |  |   32|  4.26k|	{                                                       \
  |  |  |  |  |  |   33|  4.26k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.26k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.26k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.26k|                                                                                                   \
  |  |  |  |   72|  4.26k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.26k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.26k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.26k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  4.26k|	free(file->password);
  132|  4.26k|	file->password = nullptr;
  133|  4.26k|	if (!password)
  ------------------
  |  Branch (133:6): [True: 2.13k, False: 2.13k]
  ------------------
  134|  2.13k|		return TRUE;
  ------------------
  |  |  126|  2.13k|#define TRUE true
  ------------------
  135|  2.13k|	file->password = _strdup(password);
  136|  2.13k|	return file->password != nullptr;
  137|  4.26k|}
assistance.c:update_connectionstring2:
  151|  2.81k|{
  152|  2.81k|	char* strc = nullptr;
  153|  2.81k|	if (!str && (len != 0))
  ------------------
  |  Branch (153:6): [True: 2.13k, False: 684]
  |  Branch (153:14): [True: 0, False: 2.13k]
  ------------------
  154|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  155|       |
  156|  2.81k|	if (str && (len > 0))
  ------------------
  |  Branch (156:6): [True: 684, False: 2.13k]
  |  Branch (156:13): [True: 684, False: 0]
  ------------------
  157|    684|	{
  158|    684|		strc = strndup(str, len);
  159|    684|		if (!strc)
  ------------------
  |  Branch (159:7): [True: 0, False: 684]
  ------------------
  160|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  161|    684|	}
  162|  2.81k|	return update_connectionstring2_nocopy(file, strc);
  163|  2.81k|}
assistance.c:update_connectionstring2_nocopy:
  140|  2.99k|{
  141|  2.99k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.99k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.99k|	do                                                                                             \
  |  |  |  |   61|  2.99k|	{                                                                                              \
  |  |  |  |   62|  2.99k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.99k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.99k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.99k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.99k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.99k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.99k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.99k|                                                                                                   \
  |  |  |  |   70|  2.99k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.99k|	do                                                      \
  |  |  |  |  |  |   32|  2.99k|	{                                                       \
  |  |  |  |  |  |   33|  2.99k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.99k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.99k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.99k|                                                                                                   \
  |  |  |  |   72|  2.99k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.99k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.99k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.99k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|  2.99k|	free(file->ConnectionString2);
  143|  2.99k|	file->ConnectionString2 = nullptr;
  144|  2.99k|	if (!str)
  ------------------
  |  Branch (144:6): [True: 2.13k, False: 858]
  ------------------
  145|  2.13k|		return TRUE;
  ------------------
  |  |  126|  2.13k|#define TRUE true
  ------------------
  146|    858|	file->ConnectionString2 = str;
  147|    858|	return file->ConnectionString2 != nullptr;
  148|  2.99k|}
assistance.c:freerdp_assistance_parse_connection_string2:
  754|    859|{
  755|    859|	BOOL rc = FALSE;
  ------------------
  |  |  122|    859|#define FALSE false
  ------------------
  756|       |
  757|    859|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    859|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    859|	do                                                                                             \
  |  |  |  |   61|    859|	{                                                                                              \
  |  |  |  |   62|    859|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    859|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    859|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    859|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    859|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    859|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    859|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    859|                                                                                                   \
  |  |  |  |   70|    859|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    859|	do                                                      \
  |  |  |  |  |  |   32|    859|	{                                                       \
  |  |  |  |  |  |   33|    859|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 859]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    859|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    859|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 859]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    859|                                                                                                   \
  |  |  |  |   72|    859|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    859|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    859|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    859|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 859]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  758|       |
  759|    859|	if (!file->ConnectionString2)
  ------------------
  |  Branch (759:6): [True: 1, False: 858]
  ------------------
  760|      1|		return FALSE;
  ------------------
  |  |  122|      1|#define FALSE false
  ------------------
  761|       |
  762|    858|	char* str = _strdup(file->ConnectionString2);
  763|    858|	if (!str)
  ------------------
  |  Branch (763:6): [True: 0, False: 858]
  ------------------
  764|      0|		goto out_fail;
  765|    858|	const size_t slen = strlen(str);
  766|       |
  767|    858|	{
  768|    858|		char* e = nullptr;
  769|    858|		size_t elen = 0;
  770|    858|		if (!freerdp_assistance_consume_input_and_get_element(str, slen, "E", &e, &elen))
  ------------------
  |  Branch (770:7): [True: 181, False: 677]
  ------------------
  771|    181|			goto out_fail;
  772|       |
  773|    677|		if (!e || (elen == 0))
  ------------------
  |  Branch (773:7): [True: 0, False: 677]
  |  Branch (773:13): [True: 0, False: 677]
  ------------------
  774|      0|			goto out_fail;
  775|    677|		{
  776|    677|			char* a = nullptr;
  777|    677|			size_t alen = 0;
  778|    677|			if (!freerdp_assistance_get_element(e, elen, "A", &a, &alen))
  ------------------
  |  Branch (778:8): [True: 24, False: 653]
  ------------------
  779|     24|				goto out_fail;
  780|       |
  781|    653|			if (!a || (alen == 0))
  ------------------
  |  Branch (781:8): [True: 0, False: 653]
  |  Branch (781:14): [True: 0, False: 653]
  ------------------
  782|      0|				goto out_fail;
  783|       |
  784|    653|			if (!freerdp_assistance_parse_find_elements_of_c(file, e, elen))
  ------------------
  |  Branch (784:8): [True: 149, False: 504]
  ------------------
  785|    149|				goto out_fail;
  786|       |
  787|       |			/* '\0' terminate the detected XML elements so
  788|       |			 * the parser can continue with terminated strings
  789|       |			 */
  790|    504|			a[alen] = '\0';
  791|       |
  792|    504|			if (!freerdp_assistance_parse_attr_str(&file->RASpecificParams, "KH", a))
  ------------------
  |  Branch (792:8): [True: 32, False: 472]
  ------------------
  793|     32|				goto out_fail;
  794|       |
  795|    472|			if (!freerdp_assistance_parse_attr_str(&file->RASpecificParams2, "KH2", a))
  ------------------
  |  Branch (795:8): [True: 6, False: 466]
  ------------------
  796|      6|				goto out_fail;
  797|       |
  798|    466|			if (!freerdp_assistance_parse_attr_str(&file->RASessionId, "ID", a))
  ------------------
  |  Branch (798:8): [True: 5, False: 461]
  ------------------
  799|      5|				goto out_fail;
  800|    466|		}
  801|    466|	}
  802|    461|	rc = TRUE;
  ------------------
  |  |  126|    461|#define TRUE true
  ------------------
  803|    858|out_fail:
  804|    858|	free(str);
  805|    858|	return rc;
  806|    461|}
assistance.c:freerdp_assistance_get_element:
  647|   207k|{
  648|   207k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|   207k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   207k|	do                                                                                             \
  |  |  |  |   61|   207k|	{                                                                                              \
  |  |  |  |   62|   207k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   207k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   207k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   207k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   207k|                                                                                                   \
  |  |  |  |   70|   207k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   207k|	do                                                      \
  |  |  |  |  |  |   32|   207k|	{                                                       \
  |  |  |  |  |  |   33|   207k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   207k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   207k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   207k|                                                                                                   \
  |  |  |  |   72|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   207k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   207k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   207k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 207k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|   207k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|   207k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   207k|	do                                                                                             \
  |  |  |  |   61|   207k|	{                                                                                              \
  |  |  |  |   62|   207k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   207k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   207k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   207k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   207k|                                                                                                   \
  |  |  |  |   70|   207k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   207k|	do                                                      \
  |  |  |  |  |  |   32|   207k|	{                                                       \
  |  |  |  |  |  |   33|   207k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   207k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   207k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   207k|                                                                                                   \
  |  |  |  |   72|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   207k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   207k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   207k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 207k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  650|   207k|	WINPR_ASSERT(element);
  ------------------
  |  |   76|   207k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   207k|	do                                                                                             \
  |  |  |  |   61|   207k|	{                                                                                              \
  |  |  |  |   62|   207k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   207k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   207k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   207k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   207k|                                                                                                   \
  |  |  |  |   70|   207k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   207k|	do                                                      \
  |  |  |  |  |  |   32|   207k|	{                                                       \
  |  |  |  |  |  |   33|   207k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   207k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   207k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   207k|                                                                                                   \
  |  |  |  |   72|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   207k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   207k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   207k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 207k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|   207k|	WINPR_ASSERT(elen);
  ------------------
  |  |   76|   207k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   207k|	do                                                                                             \
  |  |  |  |   61|   207k|	{                                                                                              \
  |  |  |  |   62|   207k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   207k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   207k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   207k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   207k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   207k|                                                                                                   \
  |  |  |  |   70|   207k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   207k|	do                                                      \
  |  |  |  |  |  |   32|   207k|	{                                                       \
  |  |  |  |  |  |   33|   207k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   207k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   207k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   207k|                                                                                                   \
  |  |  |  |   72|   207k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   207k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   207k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   207k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 207k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  652|       |
  653|   207k|	size_t len = 0;
  654|   207k|	size_t dlen = 0;
  655|   207k|	char* data = nullptr;
  656|   207k|	char* tag = freerdp_assistance_contains_element(input, ilen, key, &len, &data, &dlen);
  657|   207k|	if (!tag)
  ------------------
  |  Branch (657:6): [True: 101k, False: 106k]
  ------------------
  658|   101k|		return FALSE;
  ------------------
  |  |  122|   101k|#define FALSE false
  ------------------
  659|       |
  660|   106k|	if (tag + len > input + ilen)
  ------------------
  |  Branch (660:6): [True: 0, False: 106k]
  ------------------
  661|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  662|       |
  663|   106k|	char* end = tag + len;
  664|   106k|	*element = data;
  665|   106k|	*elen = WINPR_ASSERTING_INT_CAST(size_t, end - data + 1);
  ------------------
  |  |  112|   106k|	__extension__({                                                                             \
  |  |  113|   106k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   106k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   106k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   106k|	do                                                                                             \
  |  |  |  |  |  |   61|   106k|	{                                                                                              \
  |  |  |  |  |  |   62|   106k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   106k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   106k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   106k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   106k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   106k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   106k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   106k|                                                                                                   \
  |  |  |  |  |  |   70|   106k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   106k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   106k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   106k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 106k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   106k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   106k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 106k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   106k|                                                                                                   \
  |  |  |  |  |  |   72|   106k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   106k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   106k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   106k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 106k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   106k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   106k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   106k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   106k|	do                                                                                             \
  |  |  |  |  |  |   61|   106k|	{                                                                                              \
  |  |  |  |  |  |   62|   106k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   106k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   106k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   106k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   106k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   106k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   106k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   106k|                                                                                                   \
  |  |  |  |  |  |   70|   106k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   106k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   106k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   319k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 106k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 106k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   106k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   106k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 106k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   106k|                                                                                                   \
  |  |  |  |  |  |   72|   106k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   106k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   106k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   106k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 106k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   106k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   106k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   106k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   106k|	})
  ------------------
  666|   106k|	return TRUE;
  ------------------
  |  |  126|   106k|#define TRUE true
  ------------------
  667|   106k|}
assistance.c:freerdp_assistance_parse_find_elements_of_c:
  748|    653|{
  749|    653|	return freerdp_assistance_parse_all_elements_of(file, data, len, "C",
  750|    653|	                                                freerdp_assistance_parse_all_elements_of_c);
  751|    653|}
assistance.c:freerdp_assistance_parse_all_elements_of:
  673|   101k|{
  674|   101k|	char* val = nullptr;
  675|   101k|	size_t vlen = 0;
  676|       |
  677|   206k|	while (freerdp_assistance_get_element(data, len, key, &val, &vlen))
  ------------------
  |  Branch (677:9): [True: 105k, False: 100k]
  ------------------
  678|   105k|	{
  679|   105k|		data = val + vlen;
  680|   105k|		len = strnlen(data, len);
  681|   105k|		if (vlen > 0)
  ------------------
  |  Branch (681:7): [True: 105k, False: 0]
  ------------------
  682|   105k|		{
  683|   105k|			val[vlen - 1] = '\0';
  684|       |
  685|   105k|			if (!fkt(file, val, vlen))
  ------------------
  |  Branch (685:8): [True: 333, False: 105k]
  ------------------
  686|    333|				return FALSE;
  ------------------
  |  |  122|    333|#define FALSE false
  ------------------
  687|   105k|		}
  688|   105k|	}
  689|       |
  690|   100k|	return TRUE;
  ------------------
  |  |  126|   100k|#define TRUE true
  ------------------
  691|   101k|}
assistance.c:freerdp_assistance_parse_all_elements_of_c:
  741|  98.0k|{
  742|  98.0k|	return freerdp_assistance_parse_all_elements_of(file, data, len, "T",
  743|  98.0k|	                                                freerdp_assistance_parse_all_elements_of_t);
  744|  98.0k|}
assistance.c:freerdp_assistance_parse_all_elements_of_t:
  727|  2.78k|{
  728|  2.78k|	UINT32 id = 0;
  729|  2.78k|	UINT32 sid = 0;
  730|  2.78k|	if (!freerdp_assistance_parse_attr_uint32(&id, "ID", data))
  ------------------
  |  Branch (730:6): [True: 105, False: 2.67k]
  ------------------
  731|    105|		return FALSE;
  ------------------
  |  |  122|    105|#define FALSE false
  ------------------
  732|  2.67k|	if (!freerdp_assistance_parse_attr_uint32(&sid, "SID", data))
  ------------------
  |  Branch (732:6): [True: 9, False: 2.66k]
  ------------------
  733|      9|		return FALSE;
  ------------------
  |  |  122|      9|#define FALSE false
  ------------------
  734|  2.66k|	WLog_DBG(TAG, "transport id=%" PRIu32 ", sid=%" PRIu32, id, sid);
  ------------------
  |  |  342|  2.66k|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  735|  2.66k|	return freerdp_assistance_parse_all_elements_of(file, data, len, "L",
  736|  2.66k|	                                                freerdp_assistance_parse_all_elements_of_l);
  737|  2.67k|}
assistance.c:freerdp_assistance_parse_all_elements_of_l:
  695|  5.02k|{
  696|  5.02k|	UINT32 p = 0;
  697|  5.02k|	const char* n = nullptr;
  698|  5.02k|	const char* u = nullptr;
  699|  5.02k|	size_t nlen = 0;
  700|  5.02k|	size_t ulen = 0;
  701|  5.02k|	if (!freerdp_assistance_parse_attr_uint32(&p, "P", data))
  ------------------
  |  Branch (701:6): [True: 18, False: 5.00k]
  ------------------
  702|     18|		return FALSE;
  ------------------
  |  |  122|     18|#define FALSE false
  ------------------
  703|  5.00k|	if (!freerdp_assistance_parse_attr(&n, &nlen, "N", data))
  ------------------
  |  Branch (703:6): [True: 7, False: 4.99k]
  ------------------
  704|      7|		return FALSE;
  ------------------
  |  |  122|      7|#define FALSE false
  ------------------
  705|  4.99k|	if (!freerdp_assistance_parse_attr(&u, &ulen, "U", data))
  ------------------
  |  Branch (705:6): [True: 10, False: 4.98k]
  ------------------
  706|     10|		return FALSE;
  ------------------
  |  |  122|     10|#define FALSE false
  ------------------
  707|       |
  708|  4.98k|	if (n && (nlen > 0))
  ------------------
  |  Branch (708:6): [True: 2.00k, False: 2.97k]
  |  Branch (708:11): [True: 564, False: 1.44k]
  ------------------
  709|    564|	{
  710|    564|		if (!append_address_to_list(file->MachineAddresses, n, nlen))
  ------------------
  |  Branch (710:7): [True: 0, False: 564]
  ------------------
  711|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  712|    564|		if (!ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p))
  ------------------
  |  Branch (712:7): [True: 0, False: 564]
  ------------------
  713|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  714|    564|	}
  715|  4.98k|	if (u && (ulen > 0))
  ------------------
  |  Branch (715:6): [True: 2.14k, False: 2.84k]
  |  Branch (715:11): [True: 1.35k, False: 785]
  ------------------
  716|  1.35k|	{
  717|  1.35k|		if (!append_address_to_list(file->MachineAddresses, u, ulen))
  ------------------
  |  Branch (717:7): [True: 0, False: 1.35k]
  ------------------
  718|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  719|  1.35k|		if (!ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p))
  ------------------
  |  Branch (719:7): [True: 0, False: 1.35k]
  ------------------
  720|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  721|  1.35k|	}
  722|  4.98k|	return TRUE;
  ------------------
  |  |  126|  4.98k|#define TRUE true
  ------------------
  723|  4.98k|}

LLVMFuzzerTestOneInput:
   28|  2.13k|{
   29|  2.13k|	parse_file_buffer(Data, Size);
   30|  2.13k|	return 0;
   31|  2.13k|}
TestFuzzCommonAssistanceParseFileBuffer.c:parse_file_buffer:
    4|  2.13k|{
    5|  2.13k|	static const char TEST_MSRC_INCIDENT_PASSWORD_TYPE2[] = "48BJQ853X3B4";
    6|  2.13k|	int status = -1;
    7|  2.13k|	rdpAssistanceFile* file = freerdp_assistance_file_new();
    8|  2.13k|	if (!file)
  ------------------
  |  Branch (8:6): [True: 0, False: 2.13k]
  ------------------
    9|      0|		return -1;
   10|       |
   11|  2.13k|	char* buf = calloc(Size + 1, sizeof(char));
   12|  2.13k|	if (buf == nullptr)
  ------------------
  |  Branch (12:6): [True: 0, False: 2.13k]
  ------------------
   13|      0|		goto err;
   14|  2.13k|	memcpy(buf, Data, Size);
   15|  2.13k|	buf[Size] = '\0';
   16|       |
   17|  2.13k|	status = freerdp_assistance_parse_file_buffer(file, buf, Size + 1,
   18|  2.13k|	                                              TEST_MSRC_INCIDENT_PASSWORD_TYPE2);
   19|       |
   20|  2.13k|err:
   21|  2.13k|	freerdp_assistance_file_free(file);
   22|  2.13k|	free(buf);
   23|       |
   24|  2.13k|	return status >= 0;
   25|  2.13k|}

assistance.c:winpr_Data_Write_UINT32:
  258|    248|	{
  259|    248|		WINPR_ASSERT(d);
  ------------------
  |  |   76|    248|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    248|	do                                                                                             \
  |  |  |  |   61|    248|	{                                                                                              \
  |  |  |  |   62|    248|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    248|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    248|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    248|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    248|                                                                                                   \
  |  |  |  |   70|    248|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    248|	do                                                      \
  |  |  |  |  |  |   32|    248|	{                                                       \
  |  |  |  |  |  |   33|    248|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    248|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    248|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    248|                                                                                                   \
  |  |  |  |   72|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    248|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    248|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    248|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|    248|		BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d);
  ------------------
  |  |   31|    248|#define WINPR_ENDIAN_CAST(t, val) WINPR_CXX_COMPAT_CAST(t, val)
  |  |  ------------------
  |  |  |  |   33|    248|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  ------------------
  261|    248|		winpr_Data_Write_UINT16(b, v & 0xFFFF);
  262|    248|		winpr_Data_Write_UINT16(b + 2, (v >> 16) & 0xFFFF);
  263|    248|	}
assistance.c:winpr_Data_Write_UINT16:
  235|    496|	{
  236|    496|		WINPR_ASSERT(d);
  ------------------
  |  |   76|    496|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    496|	do                                                                                             \
  |  |  |  |   61|    496|	{                                                                                              \
  |  |  |  |   62|    496|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    496|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    496|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    496|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    496|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    496|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    496|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    496|                                                                                                   \
  |  |  |  |   70|    496|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    496|	do                                                      \
  |  |  |  |  |  |   32|    496|	{                                                       \
  |  |  |  |  |  |   33|    496|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 496]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    496|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    496|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 496]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    496|                                                                                                   \
  |  |  |  |   72|    496|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    496|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    496|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    496|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 496]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|    496|		BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d);
  ------------------
  |  |   31|    496|#define WINPR_ENDIAN_CAST(t, val) WINPR_CXX_COMPAT_CAST(t, val)
  |  |  ------------------
  |  |  |  |   33|    496|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  ------------------
  238|    496|		b[0] = v & 0xFF;
  239|    496|		b[1] = (v >> 8) & 0xFF;
  240|    496|	}

assistance.c:WLog_Print_dbg_tag:
  323|  96.1k|	{
  324|  96.1k|		static wLog* log_cached_ptr = nullptr;
  325|  96.1k|		if (!log_cached_ptr)
  ------------------
  |  Branch (325:7): [True: 1, False: 96.1k]
  ------------------
  326|      1|			log_cached_ptr = WLog_Get(tag);
  327|       |
  328|  96.1k|		if (WLog_IsLevelActive(log_cached_ptr, log_level))
  ------------------
  |  Branch (328:7): [True: 92.5k, False: 3.62k]
  ------------------
  329|  92.5k|		{
  330|  92.5k|			va_list ap = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  331|  92.5k|			va_start(ap, fmt);
  332|  92.5k|			WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
  333|       |			va_end(ap);
  334|  92.5k|		}
  335|  96.1k|	}

_strdup:
  301|  4.59k|{
  302|  4.59k|	if (strSource == nullptr)
  ------------------
  |  Branch (302:6): [True: 0, False: 4.59k]
  ------------------
  303|      0|		return nullptr;
  304|       |
  305|  4.59k|	char* strDestination = strdup(strSource);
  306|       |
  307|  4.59k|	if (strDestination == nullptr)
  ------------------
  |  Branch (307:6): [True: 0, False: 4.59k]
  ------------------
  308|      0|		WLog_ERR(TAG, "strdup");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  309|       |
  310|  4.59k|	return strDestination;
  311|  4.59k|}
_wcsnlen:
  407|    442|{
  408|    442|	WINPR_ASSERT(str);
  ------------------
  |  |   76|    442|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    442|	do                                                                                             \
  |  |  |  |   61|    442|	{                                                                                              \
  |  |  |  |   62|    442|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    442|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    442|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    442|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    442|                                                                                                   \
  |  |  |  |   70|    442|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    442|	do                                                      \
  |  |  |  |  |  |   32|    442|	{                                                       \
  |  |  |  |  |  |   33|    442|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    442|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    442|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    442|                                                                                                   \
  |  |  |  |   72|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    442|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    442|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    442|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 442]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  409|       |
  410|    442|	size_t x = 0;
  411|  1.50M|	for (; x < max; x++)
  ------------------
  |  Branch (411:9): [True: 1.50M, False: 310]
  ------------------
  412|  1.50M|	{
  413|  1.50M|		if (str[x] == 0)
  ------------------
  |  Branch (413:7): [True: 132, False: 1.50M]
  ------------------
  414|    132|			return x;
  415|  1.50M|	}
  416|       |
  417|    310|	return x;
  418|    442|}
strtok_s:
  484|   535k|{
  485|   535k|	return strtok_r(strToken, strDelimit, context);
  486|   535k|}
winpr_strnstr:
  928|   330k|{
  929|   330k|	WINPR_ASSERT(haystack || (hlen == 0));
  ------------------
  |  |   76|   330k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   330k|	do                                                                                             \
  |  |  |  |   61|   330k|	{                                                                                              \
  |  |  |  |   62|   330k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   330k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   330k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   330k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   330k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   330k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   330k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   330k|                                                                                                   \
  |  |  |  |   70|   330k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   330k|	do                                                      \
  |  |  |  |  |  |   32|   330k|	{                                                       \
  |  |  |  |  |  |   33|   330k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:9): [True: 330k, False: 0]
  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   330k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   330k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 330k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   330k|                                                                                                   \
  |  |  |  |   72|   330k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   330k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   330k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   330k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 330k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|   330k|	WINPR_ASSERT(needle);
  ------------------
  |  |   76|   330k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   330k|	do                                                                                             \
  |  |  |  |   61|   330k|	{                                                                                              \
  |  |  |  |   62|   330k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   330k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   330k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   330k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   330k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   330k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   330k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   330k|                                                                                                   \
  |  |  |  |   70|   330k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   330k|	do                                                      \
  |  |  |  |  |  |   32|   330k|	{                                                       \
  |  |  |  |  |  |   33|   330k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 330k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   330k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   330k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 330k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   330k|                                                                                                   \
  |  |  |  |   72|   330k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   330k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   330k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   330k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 330k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|       |
  932|       |#if defined(WINPR_HAVE_STRNSTR)
  933|       |	return strnstr(haystack, needle, hlen);
  934|       |#else
  935|       |	/* Match native strnstr semantics: search at most hlen characters and stop at
  936|       |	 * the haystack NUL terminator, whichever comes first. */
  937|   330k|	const size_t needle_len = strlen(needle);
  938|       |
  939|   330k|	if (0 == needle_len)
  ------------------
  |  Branch (939:6): [True: 0, False: 330k]
  ------------------
  940|      0|		return haystack;
  941|       |
  942|  76.1M|	for (; (*haystack != '\0') && (hlen >= needle_len); haystack++, hlen--)
  ------------------
  |  Branch (942:9): [True: 76.1M, False: 17.3k]
  |  Branch (942:32): [True: 76.1M, False: 1.66k]
  ------------------
  943|  76.1M|	{
  944|  76.1M|		if ((haystack[0] == needle[0]) && (0 == strncmp(haystack, needle, needle_len)))
  ------------------
  |  Branch (944:7): [True: 2.66M, False: 73.4M]
  |  Branch (944:37): [True: 311k, False: 2.35M]
  ------------------
  945|   311k|			return haystack;
  946|  76.1M|	}
  947|  18.9k|	return nullptr;
  948|   330k|#endif
  949|   330k|}

ConvertWCharNToUtf8:
  384|    442|{
  385|    442|	BOOL isNullTerminated = FALSE;
  ------------------
  |  |  122|    442|#define FALSE false
  ------------------
  386|    442|	if (wlen == 0)
  ------------------
  |  Branch (386:6): [True: 0, False: 442]
  ------------------
  387|      0|		return 0;
  388|       |
  389|    442|	WINPR_ASSERT(wstr);
  ------------------
  |  |   76|    442|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    442|	do                                                                                             \
  |  |  |  |   61|    442|	{                                                                                              \
  |  |  |  |   62|    442|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    442|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    442|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    442|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    442|                                                                                                   \
  |  |  |  |   70|    442|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    442|	do                                                      \
  |  |  |  |  |  |   32|    442|	{                                                       \
  |  |  |  |  |  |   33|    442|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    442|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    442|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    442|                                                                                                   \
  |  |  |  |   72|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    442|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    442|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    442|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 442]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|    442|	size_t iwlen = _wcsnlen(wstr, wlen);
  391|       |
  392|    442|	if ((len > INT32_MAX) || (wlen > INT32_MAX))
  ------------------
  |  Branch (392:6): [True: 0, False: 442]
  |  Branch (392:27): [True: 0, False: 442]
  ------------------
  393|      0|	{
  394|      0|		SetLastError(ERROR_INVALID_PARAMETER);
  ------------------
  |  |  252|      0|#define ERROR_INVALID_PARAMETER 0x00000057
  ------------------
  395|      0|		return -1;
  396|      0|	}
  397|       |
  398|    442|	if (iwlen < wlen)
  ------------------
  |  Branch (398:6): [True: 132, False: 310]
  ------------------
  399|    132|	{
  400|    132|		isNullTerminated = TRUE;
  ------------------
  |  |  126|    132|#define TRUE true
  ------------------
  401|    132|		iwlen++;
  402|    132|	}
  403|    442|	WINPR_PRAGMA_DIAG_PUSH
  404|    442|	WINPR_PRAGMA_DIAG_IGNORED_DEPRECATED_DECL
  405|    442|	const int rc =
  406|    442|	    WideCharToMultiByte(CP_UTF8, 0, wstr, (int)iwlen, str, (int)len, nullptr, nullptr);
  ------------------
  |  |  103|    442|#define CP_UTF8 65001
  ------------------
  407|    442|	WINPR_PRAGMA_DIAG_POP
  408|    442|	if ((rc <= 0) || ((len > 0) && ((size_t)rc > len)))
  ------------------
  |  Branch (408:6): [True: 94, False: 348]
  |  Branch (408:20): [True: 174, False: 174]
  |  Branch (408:33): [True: 0, False: 174]
  ------------------
  409|     94|		return -1;
  410|    348|	else if (!isNullTerminated)
  ------------------
  |  Branch (410:11): [True: 250, False: 98]
  ------------------
  411|    250|	{
  412|    250|		if (str && ((size_t)rc < len))
  ------------------
  |  Branch (412:7): [True: 125, False: 125]
  |  Branch (412:14): [True: 125, False: 0]
  ------------------
  413|    125|			str[rc] = '\0';
  414|    250|		return rc;
  415|    250|	}
  416|     98|	else if ((size_t)rc == len)
  ------------------
  |  Branch (416:11): [True: 49, False: 49]
  ------------------
  417|     49|	{
  418|     49|		if (str && (str[rc - 1] != '\0'))
  ------------------
  |  Branch (418:7): [True: 49, False: 0]
  |  Branch (418:14): [True: 0, False: 49]
  ------------------
  419|      0|			return rc;
  420|     49|	}
  421|     98|	return rc - 1;
  422|    442|}
ConvertUtf8ToWChar:
  449|  2.15k|{
  450|  2.15k|	if (!str)
  ------------------
  |  Branch (450:6): [True: 114, False: 2.03k]
  ------------------
  451|    114|	{
  452|    114|		if (wstr && wlen)
  ------------------
  |  Branch (452:7): [True: 57, False: 57]
  |  Branch (452:15): [True: 57, False: 0]
  ------------------
  453|     57|			wstr[0] = 0;
  454|    114|		return 0;
  455|    114|	}
  456|       |
  457|  2.03k|	const size_t len = strlen(str);
  458|  2.03k|	return ConvertUtf8NToWChar(str, len + 1, wstr, wlen);
  459|  2.15k|}
ConvertUtf8NToWChar:
  462|  2.03k|{
  463|  2.03k|	size_t ilen = strnlen(str, len);
  464|  2.03k|	BOOL isNullTerminated = FALSE;
  ------------------
  |  |  122|  2.03k|#define FALSE false
  ------------------
  465|  2.03k|	if (len == 0)
  ------------------
  |  Branch (465:6): [True: 0, False: 2.03k]
  ------------------
  466|      0|		return 0;
  467|       |
  468|  2.03k|	WINPR_ASSERT(str);
  ------------------
  |  |   76|  2.03k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.03k|	do                                                                                             \
  |  |  |  |   61|  2.03k|	{                                                                                              \
  |  |  |  |   62|  2.03k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.03k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.03k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.03k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.03k|                                                                                                   \
  |  |  |  |   70|  2.03k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.03k|	do                                                      \
  |  |  |  |  |  |   32|  2.03k|	{                                                       \
  |  |  |  |  |  |   33|  2.03k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.03k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.03k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.03k|                                                                                                   \
  |  |  |  |   72|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.03k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.03k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.03k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|       |
  470|  2.03k|	if ((len > INT32_MAX) || (wlen > INT32_MAX))
  ------------------
  |  Branch (470:6): [True: 0, False: 2.03k]
  |  Branch (470:27): [True: 0, False: 2.03k]
  ------------------
  471|      0|	{
  472|      0|		SetLastError(ERROR_INVALID_PARAMETER);
  ------------------
  |  |  252|      0|#define ERROR_INVALID_PARAMETER 0x00000057
  ------------------
  473|      0|		return -1;
  474|      0|	}
  475|  2.03k|	if (ilen < len)
  ------------------
  |  Branch (475:6): [True: 2.03k, False: 0]
  ------------------
  476|  2.03k|	{
  477|  2.03k|		isNullTerminated = TRUE;
  ------------------
  |  |  126|  2.03k|#define TRUE true
  ------------------
  478|  2.03k|		ilen++;
  479|  2.03k|	}
  480|       |
  481|  2.03k|	const int iwlen = (int)wlen;
  482|  2.03k|	WINPR_PRAGMA_DIAG_PUSH
  483|  2.03k|	WINPR_PRAGMA_DIAG_IGNORED_DEPRECATED_DECL
  484|  2.03k|	const int rc = MultiByteToWideChar(CP_UTF8, 0, str, (int)ilen, wstr, iwlen);
  ------------------
  |  |  103|  2.03k|#define CP_UTF8 65001
  ------------------
  485|  2.03k|	WINPR_PRAGMA_DIAG_POP
  486|  2.03k|	if ((rc <= 0) || ((wlen > 0) && (rc > iwlen)))
  ------------------
  |  Branch (486:6): [True: 80, False: 1.95k]
  |  Branch (486:20): [True: 979, False: 979]
  |  Branch (486:34): [True: 0, False: 979]
  ------------------
  487|     80|		return -1;
  488|  1.95k|	if (!isNullTerminated)
  ------------------
  |  Branch (488:6): [True: 0, False: 1.95k]
  ------------------
  489|      0|	{
  490|      0|		if (wstr && (rc < iwlen))
  ------------------
  |  Branch (490:7): [True: 0, False: 0]
  |  Branch (490:15): [True: 0, False: 0]
  ------------------
  491|      0|			wstr[rc] = '\0';
  492|      0|		return rc;
  493|      0|	}
  494|  1.95k|	else if (rc == iwlen)
  ------------------
  |  Branch (494:11): [True: 979, False: 979]
  ------------------
  495|    979|	{
  496|    979|		if (wstr && (wstr[rc - 1] != '\0'))
  ------------------
  |  Branch (496:7): [True: 979, False: 0]
  |  Branch (496:15): [True: 0, False: 979]
  ------------------
  497|      0|			return rc;
  498|    979|	}
  499|  1.95k|	return rc - 1;
  500|  1.95k|}
ConvertWCharNToUtf8Alloc:
  550|    268|{
  551|    268|	char* tmp = nullptr;
  552|    268|	const SSIZE_T rc = ConvertWCharNToUtf8(wstr, wlen, nullptr, 0);
  553|       |
  554|    268|	if (pUtfCharLength)
  ------------------
  |  Branch (554:6): [True: 0, False: 268]
  ------------------
  555|      0|		*pUtfCharLength = 0;
  556|    268|	if (rc < 0)
  ------------------
  |  Branch (556:6): [True: 94, False: 174]
  ------------------
  557|     94|		return nullptr;
  558|    174|	tmp = calloc((size_t)rc + 1ull, sizeof(char));
  559|    174|	if (!tmp)
  ------------------
  |  Branch (559:6): [True: 0, False: 174]
  ------------------
  560|      0|		return nullptr;
  561|    174|	const SSIZE_T rc2 = ConvertWCharNToUtf8(wstr, wlen, tmp, (size_t)rc + 1ull);
  562|    174|	if (rc2 < 0)
  ------------------
  |  Branch (562:6): [True: 0, False: 174]
  ------------------
  563|      0|	{
  564|      0|		free(tmp);
  565|      0|		return nullptr;
  566|      0|	}
  567|    174|	WINPR_ASSERT(rc == rc2);
  ------------------
  |  |   76|    174|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    174|	do                                                                                             \
  |  |  |  |   61|    174|	{                                                                                              \
  |  |  |  |   62|    174|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    174|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    174|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    174|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    174|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    174|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    174|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    174|                                                                                                   \
  |  |  |  |   70|    174|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    174|	do                                                      \
  |  |  |  |  |  |   32|    174|	{                                                       \
  |  |  |  |  |  |   33|    174|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 174]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    174|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    174|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 174]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    174|                                                                                                   \
  |  |  |  |   72|    174|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    174|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    174|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    174|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 174]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|    174|	if (pUtfCharLength)
  ------------------
  |  Branch (568:6): [True: 0, False: 174]
  ------------------
  569|      0|		*pUtfCharLength = (size_t)rc2;
  570|    174|	return tmp;
  571|    174|}
ConvertUtf8ToWCharAlloc:
  598|  1.11k|{
  599|  1.11k|	WCHAR* tmp = nullptr;
  600|  1.11k|	const SSIZE_T rc = ConvertUtf8ToWChar(str, nullptr, 0);
  601|  1.11k|	if (pSize)
  ------------------
  |  Branch (601:6): [True: 1.11k, False: 0]
  ------------------
  602|  1.11k|		*pSize = 0;
  603|  1.11k|	if (rc < 0)
  ------------------
  |  Branch (603:6): [True: 80, False: 1.03k]
  ------------------
  604|     80|		return nullptr;
  605|  1.03k|	tmp = calloc((size_t)rc + 1ull, sizeof(WCHAR));
  606|  1.03k|	if (!tmp)
  ------------------
  |  Branch (606:6): [True: 0, False: 1.03k]
  ------------------
  607|      0|		return nullptr;
  608|  1.03k|	const SSIZE_T rc2 = ConvertUtf8ToWChar(str, tmp, (size_t)rc + 1ull);
  609|  1.03k|	if (rc2 < 0)
  ------------------
  |  Branch (609:6): [True: 0, False: 1.03k]
  ------------------
  610|      0|	{
  611|      0|		free(tmp);
  612|      0|		return nullptr;
  613|      0|	}
  614|  1.03k|	WINPR_ASSERT(rc == rc2);
  ------------------
  |  |   76|  1.03k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.03k|	do                                                                                             \
  |  |  |  |   61|  1.03k|	{                                                                                              \
  |  |  |  |   62|  1.03k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.03k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.03k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.03k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.03k|                                                                                                   \
  |  |  |  |   70|  1.03k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.03k|	do                                                      \
  |  |  |  |  |  |   32|  1.03k|	{                                                       \
  |  |  |  |  |  |   33|  1.03k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.03k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.03k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.03k|                                                                                                   \
  |  |  |  |   72|  1.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.03k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.03k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.03k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  615|  1.03k|	if (pSize)
  ------------------
  |  Branch (615:6): [True: 1.03k, False: 0]
  ------------------
  616|  1.03k|		*pSize = (size_t)rc2;
  617|  1.03k|	return tmp;
  618|  1.03k|}
unicode.c:WideCharToMultiByte:
  207|    442|{
  208|    442|	return int_WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr,
  209|    442|	                               cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
  210|    442|}
unicode.c:MultiByteToWideChar:
  155|  2.03k|{
  156|  2.03k|	return int_MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr,
  157|  2.03k|	                               cchWideChar);
  158|  2.03k|}

int_MultiByteToWideChar:
  656|  2.03k|{
  657|  2.03k|	size_t cbCharLen = (size_t)cbMultiByte;
  658|       |
  659|  2.03k|	WINPR_UNUSED(dwFlags);
  ------------------
  |  |  715|  2.03k|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  660|       |
  661|       |	/* If cbMultiByte is 0, the function fails */
  662|  2.03k|	if ((cbMultiByte == 0) || (cbMultiByte < -1))
  ------------------
  |  Branch (662:6): [True: 0, False: 2.03k]
  |  Branch (662:28): [True: 0, False: 2.03k]
  ------------------
  663|      0|		return 0;
  664|       |
  665|  2.03k|	if (cchWideChar < 0)
  ------------------
  |  Branch (665:6): [True: 0, False: 2.03k]
  ------------------
  666|      0|		return -1;
  667|       |
  668|  2.03k|	if (cbMultiByte < 0)
  ------------------
  |  Branch (668:6): [True: 0, False: 2.03k]
  ------------------
  669|      0|	{
  670|      0|		const size_t len = strlen(lpMultiByteStr);
  671|      0|		if (len >= INT32_MAX)
  ------------------
  |  Branch (671:7): [True: 0, False: 0]
  ------------------
  672|      0|			return 0;
  673|      0|		cbCharLen = (int)len + 1;
  674|      0|	}
  675|  2.03k|	else
  676|  2.03k|		cbCharLen = cbMultiByte;
  677|       |
  678|  2.03k|	WINPR_ASSERT(lpMultiByteStr);
  ------------------
  |  |   76|  2.03k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.03k|	do                                                                                             \
  |  |  |  |   61|  2.03k|	{                                                                                              \
  |  |  |  |   62|  2.03k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.03k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.03k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.03k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.03k|                                                                                                   \
  |  |  |  |   70|  2.03k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.03k|	do                                                      \
  |  |  |  |  |  |   32|  2.03k|	{                                                       \
  |  |  |  |  |  |   33|  2.03k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.03k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.03k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.03k|                                                                                                   \
  |  |  |  |   72|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.03k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.03k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.03k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  679|  2.03k|	switch (CodePage)
  680|  2.03k|	{
  681|      0|		case CP_ACP:
  ------------------
  |  |   97|      0|#define CP_ACP 0
  ------------------
  |  Branch (681:3): [True: 0, False: 2.03k]
  ------------------
  682|  2.03k|		case CP_UTF8:
  ------------------
  |  |  103|  2.03k|#define CP_UTF8 65001
  ------------------
  |  Branch (682:3): [True: 2.03k, False: 0]
  ------------------
  683|  2.03k|			break;
  684|       |
  685|      0|		default:
  ------------------
  |  Branch (685:3): [True: 0, False: 2.03k]
  ------------------
  686|      0|			WLog_ERR(TAG, "Unsupported encoding %u", CodePage);
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  687|      0|			return 0;
  688|  2.03k|	}
  689|       |
  690|  2.03k|	return winpr_ConvertUTF8toUTF16((const uint8_t*)lpMultiByteStr,
  691|  2.03k|	                                WINPR_ASSERTING_INT_CAST(int, cbCharLen),
  ------------------
  |  |  112|  2.03k|	__extension__({                                                                             \
  |  |  113|  2.03k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  2.03k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  2.03k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  2.03k|	do                                                                                             \
  |  |  |  |  |  |   61|  2.03k|	{                                                                                              \
  |  |  |  |  |  |   62|  2.03k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  2.03k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  2.03k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  2.03k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  2.03k|                                                                                                   \
  |  |  |  |  |  |   70|  2.03k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.03k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  2.03k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  2.03k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  2.03k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  2.03k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  2.03k|                                                                                                   \
  |  |  |  |  |  |   72|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  2.03k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  2.03k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  2.03k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  2.03k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  2.03k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  2.03k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  2.03k|	do                                                                                             \
  |  |  |  |  |  |   61|  2.03k|	{                                                                                              \
  |  |  |  |  |  |   62|  2.03k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  2.03k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  2.03k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  2.03k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  2.03k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  2.03k|                                                                                                   \
  |  |  |  |  |  |   70|  2.03k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.03k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  2.03k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  6.11k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 2.03k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 2.03k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  2.03k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  2.03k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  2.03k|                                                                                                   \
  |  |  |  |  |  |   72|  2.03k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  2.03k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  2.03k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  2.03k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  2.03k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  2.03k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  2.03k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  2.03k|	})
  ------------------
  692|  2.03k|	                                (uint16_t*)lpWideCharStr, cchWideChar);
  693|  2.03k|}
int_WideCharToMultiByte:
  698|    442|{
  699|    442|	size_t cbCharLen = (size_t)cchWideChar;
  700|       |
  701|    442|	WINPR_UNUSED(dwFlags);
  ------------------
  |  |  715|    442|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  702|       |	/* If cchWideChar is 0, the function fails */
  703|    442|	if ((cchWideChar == 0) || (cchWideChar < -1))
  ------------------
  |  Branch (703:6): [True: 0, False: 442]
  |  Branch (703:28): [True: 0, False: 442]
  ------------------
  704|      0|		return 0;
  705|       |
  706|    442|	if (cbMultiByte < 0)
  ------------------
  |  Branch (706:6): [True: 0, False: 442]
  ------------------
  707|      0|		return -1;
  708|       |
  709|    442|	WINPR_ASSERT(lpWideCharStr);
  ------------------
  |  |   76|    442|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    442|	do                                                                                             \
  |  |  |  |   61|    442|	{                                                                                              \
  |  |  |  |   62|    442|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    442|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    442|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    442|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    442|                                                                                                   \
  |  |  |  |   70|    442|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    442|	do                                                      \
  |  |  |  |  |  |   32|    442|	{                                                       \
  |  |  |  |  |  |   33|    442|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    442|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    442|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    442|                                                                                                   \
  |  |  |  |   72|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    442|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    442|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    442|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 442]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|       |	/* If cchWideChar is -1, the string is null-terminated */
  711|    442|	if (cchWideChar == -1)
  ------------------
  |  Branch (711:6): [True: 0, False: 442]
  ------------------
  712|      0|	{
  713|      0|		const size_t len = _wcslen(lpWideCharStr);
  714|      0|		if (len >= INT32_MAX)
  ------------------
  |  Branch (714:7): [True: 0, False: 0]
  ------------------
  715|      0|			return 0;
  716|      0|		cbCharLen = (int)len + 1;
  717|      0|	}
  718|    442|	else
  719|    442|		cbCharLen = cchWideChar;
  720|       |
  721|       |	/*
  722|       |	 * if cbMultiByte is 0, the function returns the required buffer size
  723|       |	 * in bytes for lpMultiByteStr and makes no use of the output parameter itself.
  724|       |	 */
  725|       |
  726|    442|	return winpr_ConvertUTF16toUTF8((const uint16_t*)lpWideCharStr,
  727|    442|	                                WINPR_ASSERTING_INT_CAST(int, cbCharLen),
  ------------------
  |  |  112|    442|	__extension__({                                                                             \
  |  |  113|    442|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|    442|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|    442|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    442|	do                                                                                             \
  |  |  |  |  |  |   61|    442|	{                                                                                              \
  |  |  |  |  |  |   62|    442|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    442|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    442|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    442|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    442|                                                                                                   \
  |  |  |  |  |  |   70|    442|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    442|	do                                                      \
  |  |  |  |  |  |  |  |   32|    442|	{                                                       \
  |  |  |  |  |  |  |  |   33|    442|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 442]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    442|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    442|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 442]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    442|                                                                                                   \
  |  |  |  |  |  |   72|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    442|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    442|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    442|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|    442|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|    442|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|    442|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    442|	do                                                                                             \
  |  |  |  |  |  |   61|    442|	{                                                                                              \
  |  |  |  |  |  |   62|    442|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    442|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    442|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    442|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    442|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    442|                                                                                                   \
  |  |  |  |  |  |   70|    442|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    442|	do                                                      \
  |  |  |  |  |  |  |  |   32|    442|	{                                                       \
  |  |  |  |  |  |  |  |   33|  1.32k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 442, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 442, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    442|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    442|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 442]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    442|                                                                                                   \
  |  |  |  |  |  |   72|    442|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    442|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    442|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    442|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 442]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    442|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|    442|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|    442|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|    442|	})
  ------------------
  728|    442|	                                (uint8_t*)lpMultiByteStr, cbMultiByte);
  729|    442|}
unicode_builtin.c:winpr_ConvertUTF8toUTF16:
  569|  2.03k|{
  570|  2.03k|	size_t length = 0;
  571|  2.03k|	uint16_t* dstBeg = nullptr;
  572|  2.03k|	uint16_t* dstEnd = nullptr;
  573|  2.03k|	const uint8_t* srcBeg = nullptr;
  574|  2.03k|	const uint8_t* srcEnd = nullptr;
  575|  2.03k|	ConversionResult result = sourceIllegal;
  576|       |
  577|  2.03k|	if (cchSrc == -1)
  ------------------
  |  Branch (577:6): [True: 0, False: 2.03k]
  ------------------
  578|      0|		cchSrc = (int)strnlen((const char*)src, INT32_MAX - 1) + 1;
  579|       |
  580|  2.03k|	srcBeg = src;
  581|  2.03k|	srcEnd = &src[cchSrc];
  582|       |
  583|  2.03k|	if (cchDst == 0)
  ------------------
  |  Branch (583:6): [True: 1.05k, False: 979]
  ------------------
  584|  1.05k|	{
  585|  1.05k|		result =
  586|  1.05k|		    winpr_ConvertUTF8toUTF16_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  587|       |
  588|  1.05k|		length = dstBeg - (uint16_t*)nullptr;
  589|  1.05k|	}
  590|    979|	else
  591|    979|	{
  592|    979|		dstBeg = dst;
  593|    979|		dstEnd = &dst[cchDst];
  594|       |
  595|    979|		result =
  596|    979|		    winpr_ConvertUTF8toUTF16_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  597|       |
  598|    979|		length = dstBeg - dst;
  599|    979|	}
  600|       |
  601|  2.03k|	if (result == targetExhausted)
  ------------------
  |  Branch (601:6): [True: 0, False: 2.03k]
  ------------------
  602|      0|	{
  603|      0|		SetLastError(ERROR_INSUFFICIENT_BUFFER);
  ------------------
  |  |  275|      0|#define ERROR_INSUFFICIENT_BUFFER 0x0000007A
  ------------------
  604|      0|		return 0;
  605|      0|	}
  606|       |
  607|  2.03k|	return (result == conversionOK) ? WINPR_ASSERTING_INT_CAST(int, length) : 0;
  ------------------
  |  |  112|  1.95k|	__extension__({                                                                             \
  |  |  113|  1.95k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  1.95k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  1.95k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.95k|	do                                                                                             \
  |  |  |  |  |  |   61|  1.95k|	{                                                                                              \
  |  |  |  |  |  |   62|  1.95k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  1.95k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  1.95k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  1.95k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  1.95k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  1.95k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  1.95k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  1.95k|                                                                                                   \
  |  |  |  |  |  |   70|  1.95k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.95k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  1.95k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  1.95k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.95k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  1.95k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  1.95k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.95k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.95k|                                                                                                   \
  |  |  |  |  |  |   72|  1.95k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  1.95k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  1.95k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  1.95k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 1.95k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  1.95k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  1.95k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  1.95k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.95k|	do                                                                                             \
  |  |  |  |  |  |   61|  1.95k|	{                                                                                              \
  |  |  |  |  |  |   62|  1.95k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  1.95k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  1.95k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  1.95k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  1.95k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  1.95k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  1.95k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  1.95k|                                                                                                   \
  |  |  |  |  |  |   70|  1.95k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.95k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  1.95k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  5.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  1.95k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  1.95k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.95k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.95k|                                                                                                   \
  |  |  |  |  |  |   72|  1.95k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  1.95k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  1.95k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  1.95k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 1.95k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  1.95k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  1.95k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  1.95k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  1.95k|	})
  ------------------
  |  Branch (607:9): [True: 1.95k, False: 80]
  ------------------
  608|  2.03k|}
unicode_builtin.c:winpr_ConvertUTF8toUTF16_Internal:
  414|  2.03k|{
  415|  2.03k|	bool computeLength = (!targetEnd) ? true : false;
  ------------------
  |  Branch (415:23): [True: 1.05k, False: 979]
  ------------------
  416|  2.03k|	ConversionResult result = conversionOK;
  417|  2.03k|	const uint8_t* source = *sourceStart;
  418|  2.03k|	uint16_t* target = *targetStart;
  419|       |
  420|  8.40M|	while (source < sourceEnd)
  ------------------
  |  Branch (420:9): [True: 8.39M, False: 1.95k]
  ------------------
  421|  8.39M|	{
  422|  8.39M|		uint32_t ch = 0;
  423|  8.39M|		unsigned short extraBytesToRead =
  424|  8.39M|		    WINPR_ASSERTING_INT_CAST(unsigned short, trailingBytesForUTF8[*source]);
  ------------------
  |  |  112|  8.39M|	__extension__({                                                                             \
  |  |  113|  8.39M|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  8.39M|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  8.39M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  8.39M|	do                                                                                             \
  |  |  |  |  |  |   61|  8.39M|	{                                                                                              \
  |  |  |  |  |  |   62|  8.39M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  8.39M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  8.39M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  8.39M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  8.39M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  8.39M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  8.39M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  8.39M|                                                                                                   \
  |  |  |  |  |  |   70|  8.39M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  8.39M|	do                                                      \
  |  |  |  |  |  |  |  |   32|  8.39M|	{                                                       \
  |  |  |  |  |  |  |  |   33|  8.39M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 8.39M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  8.39M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  8.39M|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 8.39M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  8.39M|                                                                                                   \
  |  |  |  |  |  |   72|  8.39M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  8.39M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  8.39M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  8.39M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 8.39M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  8.39M|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  8.39M|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  8.39M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  8.39M|	do                                                                                             \
  |  |  |  |  |  |   61|  8.39M|	{                                                                                              \
  |  |  |  |  |  |   62|  8.39M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  8.39M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  8.39M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  8.39M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  8.39M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  8.39M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  8.39M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  8.39M|                                                                                                   \
  |  |  |  |  |  |   70|  8.39M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  8.39M|	do                                                      \
  |  |  |  |  |  |  |  |   32|  8.39M|	{                                                       \
  |  |  |  |  |  |  |  |   33|  41.9M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.96k, False: 8.39M]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.96k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 8.39M, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 8.39M, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  8.39M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  8.39M|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 8.39M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  8.39M|                                                                                                   \
  |  |  |  |  |  |   72|  8.39M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  8.39M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  8.39M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  8.39M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 8.39M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  8.39M|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  8.39M|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  8.39M|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  8.39M|	})
  ------------------
  425|       |
  426|  8.39M|		if ((source + extraBytesToRead) >= sourceEnd)
  ------------------
  |  Branch (426:7): [True: 1, False: 8.39M]
  ------------------
  427|      1|		{
  428|      1|			result = sourceExhausted;
  429|      1|			break;
  430|      1|		}
  431|       |
  432|       |		/* Do this check whether lenient or strict */
  433|  8.39M|		if (!isLegalUTF8(source, extraBytesToRead + 1))
  ------------------
  |  Branch (433:7): [True: 79, False: 8.39M]
  ------------------
  434|     79|		{
  435|     79|			result = sourceIllegal;
  436|     79|			break;
  437|     79|		}
  438|       |
  439|       |		/*
  440|       |		 * The cases all fall through. See "Note A" below.
  441|       |		 */
  442|  8.39M|		switch (extraBytesToRead)
  443|  8.39M|		{
  444|      0|			case 5:
  ------------------
  |  Branch (444:4): [True: 0, False: 8.39M]
  ------------------
  445|      0|				ch += *source++;
  446|      0|				ch <<= 6; /* remember, illegal UTF-8 */
  447|       |				          /* fallthrough */
  448|      0|				WINPR_FALLTHROUGH
  ------------------
  |  |   68|      0|	(void)0;              \
  |  |   69|      0|	[[fallthrough]];
  ------------------
  449|       |
  450|      0|			case 4:
  ------------------
  |  Branch (450:4): [True: 0, False: 8.39M]
  ------------------
  451|      0|				ch += *source++;
  452|      0|				ch <<= 6; /* remember, illegal UTF-8 */
  453|       |				          /* fallthrough */
  454|      0|				WINPR_FALLTHROUGH
  ------------------
  |  |   68|      0|	(void)0;              \
  |  |   69|      0|	[[fallthrough]];
  ------------------
  455|       |
  456|    804|			case 3:
  ------------------
  |  Branch (456:4): [True: 804, False: 8.39M]
  ------------------
  457|    804|				ch += *source++;
  458|    804|				ch <<= 6;
  459|       |				/* fallthrough */
  460|    804|				WINPR_FALLTHROUGH
  ------------------
  |  |   68|    804|	(void)0;              \
  |  |   69|    804|	[[fallthrough]];
  ------------------
  461|       |
  462|  1.56k|			case 2:
  ------------------
  |  Branch (462:4): [True: 760, False: 8.39M]
  ------------------
  463|  1.56k|				ch += *source++;
  464|  1.56k|				ch <<= 6;
  465|       |				/* fallthrough */
  466|  1.56k|				WINPR_FALLTHROUGH
  ------------------
  |  |   68|  1.56k|	(void)0;              \
  |  |   69|  1.56k|	[[fallthrough]];
  ------------------
  467|       |
  468|  1.90k|			case 1:
  ------------------
  |  Branch (468:4): [True: 338, False: 8.39M]
  ------------------
  469|  1.90k|				ch += *source++;
  470|  1.90k|				ch <<= 6;
  471|       |				/* fallthrough */
  472|  1.90k|				WINPR_FALLTHROUGH
  ------------------
  |  |   68|  1.90k|	(void)0;              \
  |  |   69|  1.90k|	[[fallthrough]];
  ------------------
  473|       |
  474|  8.39M|			case 0:
  ------------------
  |  Branch (474:4): [True: 8.39M, False: 1.90k]
  ------------------
  475|  8.39M|				ch += *source++;
  476|  8.39M|				break;
  477|      0|			default:
  ------------------
  |  Branch (477:4): [True: 0, False: 8.39M]
  ------------------
  478|      0|				return sourceIllegal;
  479|  8.39M|		}
  480|       |
  481|  8.39M|		ch -= offsetsFromUTF8[extraBytesToRead];
  482|       |
  483|  8.39M|		if ((target >= targetEnd) && (!computeLength))
  ------------------
  |  Branch (483:7): [True: 4.24M, False: 4.15M]
  |  Branch (483:32): [True: 0, False: 4.24M]
  ------------------
  484|      0|		{
  485|      0|			source -= (extraBytesToRead + 1); /* Back up source pointer! */
  486|      0|			result = targetExhausted;
  487|      0|			break;
  488|      0|		}
  489|       |
  490|  8.39M|		if (ch <= UNI_MAX_BMP)
  ------------------
  |  |   61|  8.39M|#define UNI_MAX_BMP (uint32_t)0x0000FFFF
  ------------------
  |  Branch (490:7): [True: 8.39M, False: 804]
  ------------------
  491|  8.39M|		{
  492|       |			/* Target is a character <= 0xFFFF */
  493|       |			/* UTF-16 surrogate values are illegal in UTF-32 */
  494|  8.39M|			if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   85|  16.7M|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              			if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|    242|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (494:8): [True: 242, False: 8.39M]
  |  Branch (494:36): [True: 0, False: 242]
  ------------------
  495|      0|			{
  496|      0|				if (flags == strictConversion)
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|				{
  498|      0|					source -= (extraBytesToRead + 1); /* return to the illegal value itself */
  499|      0|					result = sourceIllegal;
  500|      0|					break;
  501|      0|				}
  502|      0|				else
  503|      0|				{
  504|      0|					if (!computeLength)
  ------------------
  |  Branch (504:10): [True: 0, False: 0]
  ------------------
  505|      0|						*target++ = setWcharFrom(UNI_REPLACEMENT_CHAR);
  ------------------
  |  |   60|      0|#define UNI_REPLACEMENT_CHAR (uint32_t)0x0000FFFD
  ------------------
  506|      0|					else
  507|      0|						target++;
  508|      0|				}
  509|      0|			}
  510|  8.39M|			else
  511|  8.39M|			{
  512|  8.39M|				if (!computeLength)
  ------------------
  |  Branch (512:9): [True: 4.15M, False: 4.24M]
  ------------------
  513|  4.15M|					*target++ = setWcharFrom((WCHAR)ch); /* normal case */
  514|  4.24M|				else
  515|  4.24M|					target++;
  516|  8.39M|			}
  517|  8.39M|		}
  518|    804|		else if (ch > UNI_MAX_UTF16)
  ------------------
  |  |   62|    804|#define UNI_MAX_UTF16 (uint32_t)0x0010FFFF
  ------------------
  |  Branch (518:12): [True: 0, False: 804]
  ------------------
  519|      0|		{
  520|      0|			if (flags == strictConversion)
  ------------------
  |  Branch (520:8): [True: 0, False: 0]
  ------------------
  521|      0|			{
  522|      0|				result = sourceIllegal;
  523|      0|				source -= (extraBytesToRead + 1); /* return to the start */
  524|      0|				break;                            /* Bail out; shouldn't continue */
  525|      0|			}
  526|      0|			else
  527|      0|			{
  528|      0|				if (!computeLength)
  ------------------
  |  Branch (528:9): [True: 0, False: 0]
  ------------------
  529|      0|					*target++ = setWcharFrom(UNI_REPLACEMENT_CHAR);
  ------------------
  |  |   60|      0|#define UNI_REPLACEMENT_CHAR (uint32_t)0x0000FFFD
  ------------------
  530|      0|				else
  531|      0|					target++;
  532|      0|			}
  533|      0|		}
  534|    804|		else
  535|    804|		{
  536|       |			/* target is a character in range 0xFFFF - 0x10FFFF. */
  537|    804|			if ((target + 1 >= targetEnd) && (!computeLength))
  ------------------
  |  Branch (537:8): [True: 410, False: 394]
  |  Branch (537:37): [True: 0, False: 410]
  ------------------
  538|      0|			{
  539|      0|				source -= (extraBytesToRead + 1); /* Back up source pointer! */
  540|      0|				result = targetExhausted;
  541|      0|				break;
  542|      0|			}
  543|       |
  544|    804|			ch -= halfBase;
  545|       |
  546|    804|			if (!computeLength)
  ------------------
  |  Branch (546:8): [True: 394, False: 410]
  ------------------
  547|    394|			{
  548|    394|				*target++ = setWcharFrom((WCHAR)((ch >> halfShift) + UNI_SUR_HIGH_START));
  ------------------
  |  |   85|    394|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
  549|    394|				*target++ = setWcharFrom((WCHAR)((ch & halfMask) + UNI_SUR_LOW_START));
  ------------------
  |  |   87|    394|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
  550|    394|			}
  551|    410|			else
  552|    410|			{
  553|    410|				target++;
  554|    410|				target++;
  555|    410|			}
  556|    804|		}
  557|  8.39M|	}
  558|       |
  559|  2.03k|	*sourceStart = source;
  560|  2.03k|	*targetStart = target;
  561|  2.03k|	return result;
  562|  2.03k|}
unicode_builtin.c:isLegalUTF8:
  335|  8.39M|{
  336|  8.39M|	uint8_t a = 0;
  337|  8.39M|	const uint8_t* srcptr = source + length;
  338|       |
  339|  8.39M|	switch (length)
  340|  8.39M|	{
  341|      3|		default:
  ------------------
  |  Branch (341:3): [True: 3, False: 8.39M]
  ------------------
  342|      3|			return false;
  343|       |
  344|       |			/* Everything else falls through when "true"... */
  345|    821|		case 4:
  ------------------
  |  Branch (345:3): [True: 821, False: 8.39M]
  ------------------
  346|    821|			if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
  ------------------
  |  Branch (346:8): [True: 4, False: 817]
  |  Branch (346:36): [True: 7, False: 810]
  ------------------
  347|     11|				return false;
  348|       |			/* fallthrough */
  349|    810|			WINPR_FALLTHROUGH
  ------------------
  |  |   68|    810|	(void)0;              \
  |  |   69|    810|	[[fallthrough]];
  ------------------
  350|       |
  351|  1.59k|		case 3:
  ------------------
  |  Branch (351:3): [True: 786, False: 8.39M]
  ------------------
  352|  1.59k|			if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
  ------------------
  |  Branch (352:8): [True: 6, False: 1.59k]
  |  Branch (352:36): [True: 6, False: 1.58k]
  ------------------
  353|     12|				return false;
  354|       |			/* fallthrough */
  355|  1.58k|			WINPR_FALLTHROUGH
  ------------------
  |  |   68|  1.58k|	(void)0;              \
  |  |   69|  1.58k|	[[fallthrough]];
  ------------------
  356|       |
  357|  1.93k|		case 2:
  ------------------
  |  Branch (357:3): [True: 352, False: 8.39M]
  ------------------
  358|  1.93k|			if ((a = (*--srcptr)) > 0xBF)
  ------------------
  |  Branch (358:8): [True: 4, False: 1.93k]
  ------------------
  359|      4|				return false;
  360|       |
  361|  1.93k|			switch (*source)
  362|  1.93k|			{
  363|       |					/* no fall-through in this inner switch */
  364|    261|				case 0xE0:
  ------------------
  |  Branch (364:5): [True: 261, False: 1.67k]
  ------------------
  365|    261|					if (a < 0xA0)
  ------------------
  |  Branch (365:10): [True: 9, False: 252]
  ------------------
  366|      9|						return false;
  367|       |
  368|    252|					break;
  369|       |
  370|    263|				case 0xED:
  ------------------
  |  Branch (370:5): [True: 263, False: 1.66k]
  ------------------
  371|    263|					if (a > 0x9F)
  ------------------
  |  Branch (371:10): [True: 5, False: 258]
  ------------------
  372|      5|						return false;
  373|       |
  374|    258|					break;
  375|       |
  376|    279|				case 0xF0:
  ------------------
  |  Branch (376:5): [True: 279, False: 1.65k]
  ------------------
  377|    279|					if (a < 0x90)
  ------------------
  |  Branch (377:10): [True: 3, False: 276]
  ------------------
  378|      3|						return false;
  379|       |
  380|    276|					break;
  381|       |
  382|    513|				case 0xF4:
  ------------------
  |  Branch (382:5): [True: 513, False: 1.41k]
  ------------------
  383|    513|					if (a > 0x8F)
  ------------------
  |  Branch (383:10): [True: 1, False: 512]
  ------------------
  384|      1|						return false;
  385|       |
  386|    512|					break;
  387|       |
  388|    616|				default:
  ------------------
  |  Branch (388:5): [True: 616, False: 1.31k]
  ------------------
  389|    616|					if (a < 0x80)
  ------------------
  |  Branch (389:10): [True: 7, False: 609]
  ------------------
  390|      7|						return false;
  391|    609|					break;
  392|  1.93k|			}
  393|       |			/* fallthrough */
  394|  1.90k|			WINPR_FALLTHROUGH
  ------------------
  |  |   68|  1.90k|	(void)0;              \
  |  |   69|  1.90k|	[[fallthrough]];
  ------------------
  395|       |
  396|  8.39M|		case 1:
  ------------------
  |  Branch (396:3): [True: 8.39M, False: 1.96k]
  ------------------
  397|  8.39M|			if (*source >= 0x80 && *source < 0xC2)
  ------------------
  |  Branch (397:8): [True: 1.92k, False: 8.39M]
  |  Branch (397:27): [True: 23, False: 1.90k]
  ------------------
  398|     23|				return false;
  399|  8.39M|	}
  400|       |
  401|  8.39M|	if (*source > 0xF4)
  ------------------
  |  Branch (401:6): [True: 1, False: 8.39M]
  ------------------
  402|      1|		return false;
  403|       |
  404|  8.39M|	return true;
  405|  8.39M|}
unicode_builtin.c:setWcharFrom:
  129|  4.75M|{
  130|       |#if defined(__BIG_ENDIAN__)
  131|       |	union
  132|       |	{
  133|       |		WCHAR w;
  134|       |		char c[2];
  135|       |	} cnv;
  136|       |
  137|       |	cnv.w = w;
  138|       |	const char c = cnv.c[0];
  139|       |	cnv.c[0] = cnv.c[1];
  140|       |	cnv.c[1] = c;
  141|       |	return cnv.w;
  142|       |#else
  143|  4.75M|	return w;
  144|  4.75M|#endif
  145|  4.75M|}
unicode_builtin.c:winpr_ConvertUTF16toUTF8:
  611|    442|{
  612|    442|	size_t length = 0;
  613|    442|	uint8_t* dstBeg = nullptr;
  614|    442|	uint8_t* dstEnd = nullptr;
  615|    442|	const uint16_t* srcBeg = nullptr;
  616|    442|	const uint16_t* srcEnd = nullptr;
  617|    442|	ConversionResult result = sourceIllegal;
  618|       |
  619|    442|	if (cchSrc == -1)
  ------------------
  |  Branch (619:6): [True: 0, False: 442]
  ------------------
  620|      0|		cchSrc = (int)_wcsnlen((const WCHAR*)src, INT32_MAX - 1) + 1;
  621|       |
  622|    442|	srcBeg = src;
  623|    442|	srcEnd = &src[cchSrc];
  624|       |
  625|    442|	if (cchDst == 0)
  ------------------
  |  Branch (625:6): [True: 268, False: 174]
  ------------------
  626|    268|	{
  627|    268|		result =
  628|    268|		    winpr_ConvertUTF16toUTF8_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  629|       |
  630|    268|		length = dstBeg - ((uint8_t*)nullptr);
  631|    268|	}
  632|    174|	else
  633|    174|	{
  634|    174|		dstBeg = dst;
  635|    174|		dstEnd = &dst[cchDst];
  636|       |
  637|    174|		result =
  638|    174|		    winpr_ConvertUTF16toUTF8_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  639|       |
  640|    174|		length = dstBeg - dst;
  641|    174|	}
  642|       |
  643|    442|	if (result == targetExhausted)
  ------------------
  |  Branch (643:6): [True: 0, False: 442]
  ------------------
  644|      0|	{
  645|      0|		SetLastError(ERROR_INSUFFICIENT_BUFFER);
  ------------------
  |  |  275|      0|#define ERROR_INSUFFICIENT_BUFFER 0x0000007A
  ------------------
  646|      0|		return 0;
  647|      0|	}
  648|       |
  649|    442|	return (result == conversionOK) ? WINPR_ASSERTING_INT_CAST(int, length) : 0;
  ------------------
  |  |  112|    348|	__extension__({                                                                             \
  |  |  113|    348|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|    348|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|    348|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    348|	do                                                                                             \
  |  |  |  |  |  |   61|    348|	{                                                                                              \
  |  |  |  |  |  |   62|    348|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    348|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    348|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    348|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    348|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    348|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    348|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    348|                                                                                                   \
  |  |  |  |  |  |   70|    348|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    348|	do                                                      \
  |  |  |  |  |  |  |  |   32|    348|	{                                                       \
  |  |  |  |  |  |  |  |   33|    348|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 348]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    348|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    348|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 348]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    348|                                                                                                   \
  |  |  |  |  |  |   72|    348|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    348|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    348|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    348|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 348]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|    348|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|    348|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|    348|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    348|	do                                                                                             \
  |  |  |  |  |  |   61|    348|	{                                                                                              \
  |  |  |  |  |  |   62|    348|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    348|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    348|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    348|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    348|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    348|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    348|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    348|                                                                                                   \
  |  |  |  |  |  |   70|    348|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    348|	do                                                      \
  |  |  |  |  |  |  |  |   32|    348|	{                                                       \
  |  |  |  |  |  |  |  |   33|  1.04k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 348, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 348, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    348|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    348|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 348]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    348|                                                                                                   \
  |  |  |  |  |  |   72|    348|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    348|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    348|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    348|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 348]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    348|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|    348|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|    348|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|    348|	})
  ------------------
  |  Branch (649:9): [True: 348, False: 94]
  ------------------
  650|    442|}
unicode_builtin.c:winpr_ConvertUTF16toUTF8_Internal:
  164|    442|{
  165|    442|	bool computeLength = (!targetEnd) ? true : false;
  ------------------
  |  Branch (165:23): [True: 268, False: 174]
  ------------------
  166|    442|	const uint16_t* source = *sourceStart;
  167|    442|	uint8_t* target = *targetStart;
  168|    442|	ConversionResult result = conversionOK;
  169|       |
  170|   602k|	while (source < sourceEnd)
  ------------------
  |  Branch (170:9): [True: 602k, False: 348]
  ------------------
  171|   602k|	{
  172|   602k|		uint32_t ch = 0;
  173|   602k|		unsigned short bytesToWrite = 0;
  174|   602k|		const uint32_t byteMask = 0xBF;
  175|   602k|		const uint32_t byteMark = 0x80;
  176|   602k|		const uint16_t* oldSource =
  177|   602k|		    source; /* In case we have to back up because of target overflow. */
  178|       |
  179|   602k|		ch = setWcharFrom(*source++);
  180|       |
  181|       |		/* If we have a surrogate pair, convert to UTF32 first. */
  182|   602k|		if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END)
  ------------------
  |  |   85|  1.20M|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              		if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END)
  ------------------
  |  |   86|  71.2k|#define UNI_SUR_HIGH_END (uint32_t)0xDBFF
  ------------------
  |  Branch (182:7): [True: 71.2k, False: 530k]
  |  Branch (182:35): [True: 1.02k, False: 70.2k]
  ------------------
  183|  1.02k|		{
  184|       |			/* If the 16 bits following the high surrogate are in the source buffer... */
  185|  1.02k|			if (source < sourceEnd)
  ------------------
  |  Branch (185:8): [True: 1.02k, False: 3]
  ------------------
  186|  1.02k|			{
  187|  1.02k|				uint32_t ch2 = setWcharFrom(*source);
  188|       |
  189|       |				/* If it's a low surrogate, convert to UTF32. */
  190|  1.02k|				if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END)
  ------------------
  |  |   87|  2.04k|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
              				if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|    971|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (190:9): [True: 971, False: 49]
  |  Branch (190:37): [True: 964, False: 7]
  ------------------
  191|    964|				{
  192|    964|					ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) +
  ------------------
  |  |   85|    964|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              					ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) +
  ------------------
  |  |   87|    964|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
  193|    964|					     halfBase;
  194|    964|					++source;
  195|    964|				}
  196|     56|				else if (flags == strictConversion)
  ------------------
  |  Branch (196:14): [True: 56, False: 0]
  ------------------
  197|     56|				{
  198|       |					/* it's an unpaired high surrogate */
  199|     56|					--source; /* return to the illegal value itself */
  200|     56|					result = sourceIllegal;
  201|     56|					break;
  202|     56|				}
  203|  1.02k|			}
  204|      3|			else
  205|      3|			{
  206|       |				/* We don't have the 16 bits following the high surrogate. */
  207|      3|				--source; /* return to the high surrogate */
  208|      3|				result = sourceExhausted;
  209|      3|				break;
  210|      3|			}
  211|  1.02k|		}
  212|   600k|		else if (flags == strictConversion)
  ------------------
  |  Branch (212:12): [True: 600k, False: 0]
  ------------------
  213|   600k|		{
  214|       |			/* UTF-16 surrogate values are illegal in UTF-32 */
  215|   600k|			if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   87|  1.20M|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
              			if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|  70.2k|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (215:8): [True: 70.2k, False: 530k]
  |  Branch (215:35): [True: 35, False: 70.1k]
  ------------------
  216|     35|			{
  217|     35|				--source; /* return to the illegal value itself */
  218|     35|				result = sourceIllegal;
  219|     35|				break;
  220|     35|			}
  221|   600k|		}
  222|       |
  223|       |		/* Figure out how many bytes the result will require */
  224|   601k|		if (ch < (uint32_t)0x80)
  ------------------
  |  Branch (224:7): [True: 864, False: 601k]
  ------------------
  225|    864|		{
  226|    864|			bytesToWrite = 1;
  227|    864|		}
  228|   601k|		else if (ch < (uint32_t)0x800)
  ------------------
  |  Branch (228:12): [True: 39.9k, False: 561k]
  ------------------
  229|  39.9k|		{
  230|  39.9k|			bytesToWrite = 2;
  231|  39.9k|		}
  232|   561k|		else if (ch < (uint32_t)0x10000)
  ------------------
  |  Branch (232:12): [True: 560k, False: 964]
  ------------------
  233|   560k|		{
  234|   560k|			bytesToWrite = 3;
  235|   560k|		}
  236|    964|		else if (ch < (uint32_t)0x110000)
  ------------------
  |  Branch (236:12): [True: 964, False: 0]
  ------------------
  237|    964|		{
  238|    964|			bytesToWrite = 4;
  239|    964|		}
  240|      0|		else
  241|      0|		{
  242|      0|			bytesToWrite = 3;
  243|      0|			ch = UNI_REPLACEMENT_CHAR;
  ------------------
  |  |   60|      0|#define UNI_REPLACEMENT_CHAR (uint32_t)0x0000FFFD
  ------------------
  244|      0|		}
  245|       |
  246|   601k|		target += bytesToWrite;
  247|       |
  248|   601k|		if ((target > targetEnd) && (!computeLength))
  ------------------
  |  Branch (248:7): [True: 301k, False: 299k]
  |  Branch (248:31): [True: 0, False: 301k]
  ------------------
  249|      0|		{
  250|      0|			source = oldSource; /* Back up source pointer! */
  251|      0|			target -= bytesToWrite;
  252|      0|			result = targetExhausted;
  253|      0|			break;
  254|      0|		}
  255|       |
  256|   601k|		if (!computeLength)
  ------------------
  |  Branch (256:7): [True: 299k, False: 301k]
  ------------------
  257|   299k|		{
  258|   299k|			switch (bytesToWrite)
  259|   299k|			{
  260|       |					/* note: everything falls through. */
  261|    470|				case 4:
  ------------------
  |  Branch (261:5): [True: 470, False: 299k]
  ------------------
  262|    470|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  263|    470|					ch >>= 6;
  264|       |					/* fallthrough */
  265|    470|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|    470|	(void)0;              \
  |  |   69|    470|	[[fallthrough]];
  ------------------
  266|   279k|				case 3:
  ------------------
  |  Branch (266:5): [True: 279k, False: 20.8k]
  ------------------
  267|   279k|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  268|   279k|					ch >>= 6;
  269|       |					/* fallthrough */
  270|   279k|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|   279k|	(void)0;              \
  |  |   69|   279k|	[[fallthrough]];
  ------------------
  271|       |
  272|   299k|				case 2:
  ------------------
  |  Branch (272:5): [True: 19.9k, False: 280k]
  ------------------
  273|   299k|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  274|   299k|					ch >>= 6;
  275|       |					/* fallthrough */
  276|   299k|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|   299k|	(void)0;              \
  |  |   69|   299k|	[[fallthrough]];
  ------------------
  277|       |
  278|   299k|				case 1:
  ------------------
  |  Branch (278:5): [True: 428, False: 299k]
  ------------------
  279|   299k|					*--target = (uint8_t)(ch | firstByteMark[bytesToWrite]);
  280|   299k|					break;
  281|      0|				default:
  ------------------
  |  Branch (281:5): [True: 0, False: 299k]
  ------------------
  282|      0|					return sourceIllegal;
  283|   299k|			}
  284|   299k|		}
  285|   301k|		else
  286|   301k|		{
  287|   301k|			switch (bytesToWrite)
  288|   301k|			{
  289|       |					/* note: everything falls through. */
  290|    494|				case 4:
  ------------------
  |  Branch (290:5): [True: 494, False: 301k]
  ------------------
  291|    494|					--target;
  292|       |					/* fallthrough */
  293|    494|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|    494|	(void)0;              \
  |  |   69|    494|	[[fallthrough]];
  ------------------
  294|       |
  295|   281k|				case 3:
  ------------------
  |  Branch (295:5): [True: 281k, False: 20.9k]
  ------------------
  296|   281k|					--target;
  297|       |					/* fallthrough */
  298|   281k|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|   281k|	(void)0;              \
  |  |   69|   281k|	[[fallthrough]];
  ------------------
  299|       |
  300|   301k|				case 2:
  ------------------
  |  Branch (300:5): [True: 20.0k, False: 281k]
  ------------------
  301|   301k|					--target;
  302|       |					/* fallthrough */
  303|   301k|					WINPR_FALLTHROUGH
  ------------------
  |  |   68|   301k|	(void)0;              \
  |  |   69|   301k|	[[fallthrough]];
  ------------------
  304|       |
  305|   301k|				case 1:
  ------------------
  |  Branch (305:5): [True: 436, False: 301k]
  ------------------
  306|   301k|					--target;
  307|   301k|					break;
  308|      0|				default:
  ------------------
  |  Branch (308:5): [True: 0, False: 301k]
  ------------------
  309|      0|					return sourceIllegal;
  310|   301k|			}
  311|   301k|		}
  312|       |
  313|   601k|		target += bytesToWrite;
  314|   601k|	}
  315|       |
  316|    442|	*sourceStart = source;
  317|    442|	*targetStart = target;
  318|    442|	return result;
  319|    442|}

winpr_RC4_New:
  146|    248|{
  147|    248|	return winpr_RC4_New_Internal(key, keylen, FALSE);
  ------------------
  |  |  122|    248|#define FALSE false
  ------------------
  148|    248|}
winpr_RC4_Update:
  151|    248|{
  152|    248|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    248|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    248|	do                                                                                             \
  |  |  |  |   61|    248|	{                                                                                              \
  |  |  |  |   62|    248|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    248|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    248|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    248|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    248|                                                                                                   \
  |  |  |  |   70|    248|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    248|	do                                                      \
  |  |  |  |  |  |   32|    248|	{                                                       \
  |  |  |  |  |  |   33|    248|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    248|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    248|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    248|                                                                                                   \
  |  |  |  |   72|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    248|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    248|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    248|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|       |
  154|       |#if defined(WITH_INTERNAL_RC4)
  155|       |	return winpr_int_rc4_update(ctx->ictx, length, input, output);
  156|       |#elif defined(WITH_OPENSSL)
  157|    248|	WINPR_ASSERT(ctx->ctx);
  ------------------
  |  |   76|    248|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    248|	do                                                                                             \
  |  |  |  |   61|    248|	{                                                                                              \
  |  |  |  |   62|    248|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    248|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    248|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    248|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    248|                                                                                                   \
  |  |  |  |   70|    248|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    248|	do                                                      \
  |  |  |  |  |  |   32|    248|	{                                                       \
  |  |  |  |  |  |   33|    248|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    248|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    248|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    248|                                                                                                   \
  |  |  |  |   72|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    248|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    248|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    248|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|    248|	int outputLength = 0;
  159|    248|	if (length > INT_MAX)
  ------------------
  |  Branch (159:6): [True: 0, False: 248]
  ------------------
  160|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  161|       |
  162|    248|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    248|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    248|	do                                                                                             \
  |  |  |  |   61|    248|	{                                                                                              \
  |  |  |  |   62|    248|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    248|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    248|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    248|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    248|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    248|                                                                                                   \
  |  |  |  |   70|    248|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    248|	do                                                      \
  |  |  |  |  |  |   32|    248|	{                                                       \
  |  |  |  |  |  |   33|    248|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    248|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    248|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    248|                                                                                                   \
  |  |  |  |   72|    248|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    248|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    248|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    248|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    248|	return EVP_CipherUpdate(ctx->ctx, output, &outputLength, input, (int)length) == 1;
  164|      0|#endif
  165|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  166|    248|}
winpr_RC4_Free:
  169|    328|{
  170|    328|	if (!ctx)
  ------------------
  |  Branch (170:6): [True: 80, False: 248]
  ------------------
  171|     80|		return;
  172|       |
  173|       |#if defined(WITH_INTERNAL_RC4)
  174|       |	winpr_int_rc4_free(ctx->ictx);
  175|       |#elif defined(WITH_OPENSSL)
  176|    248|	EVP_CIPHER_CTX_free(ctx->ctx);
  177|    248|#endif
  178|    248|	free(ctx);
  179|    248|}
winpr_Cipher_NewEx:
  593|    460|{
  594|    460|	if (cipher == WINPR_CIPHER_ARC4_128)
  ------------------
  |  Branch (594:6): [True: 0, False: 460]
  ------------------
  595|      0|	{
  596|      0|		WLog_ERR(TAG,
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  597|      0|		         "WINPR_CIPHER_ARC4_128 (RC4) cipher not supported, use winpr_RC4_new instead");
  598|      0|		return nullptr;
  599|      0|	}
  600|       |
  601|    460|	WINPR_CIPHER_CTX* ctx = calloc(1, sizeof(WINPR_CIPHER_CTX));
  602|    460|	if (!ctx)
  ------------------
  |  Branch (602:6): [True: 0, False: 460]
  ------------------
  603|      0|		return nullptr;
  604|       |
  605|    460|	ctx->cipher = cipher;
  606|    460|	ctx->op = op;
  607|       |
  608|    460|#if defined(WITH_OPENSSL)
  609|    460|	const EVP_CIPHER* evp = winpr_openssl_get_evp_cipher(cipher);
  610|    460|	if (!evp)
  ------------------
  |  Branch (610:6): [True: 0, False: 460]
  ------------------
  611|      0|		goto fail;
  612|       |
  613|    460|	ctx->ectx = EVP_CIPHER_CTX_new();
  614|    460|	if (!ctx->ectx)
  ------------------
  |  Branch (614:6): [True: 0, False: 460]
  ------------------
  615|      0|		goto fail;
  616|       |
  617|    460|	{
  618|    460|		const int operation = (op == WINPR_ENCRYPT) ? 1 : 0;
  ------------------
  |  Branch (618:25): [True: 0, False: 460]
  ------------------
  619|    460|		if (EVP_CipherInit_ex(ctx->ectx, evp, nullptr, key, iv, operation) != 1)
  ------------------
  |  Branch (619:7): [True: 0, False: 460]
  ------------------
  620|      0|			goto fail;
  621|    460|	}
  622|       |
  623|    460|	EVP_CIPHER_CTX_set_padding(ctx->ectx, 0);
  624|       |
  625|       |#elif defined(WITH_MBEDTLS)
  626|       |	mbedtls_cipher_type_t cipher_type = winpr_mbedtls_get_cipher_type(cipher);
  627|       |	const mbedtls_cipher_info_t* cipher_info = mbedtls_cipher_info_from_type(cipher_type);
  628|       |
  629|       |	if (!cipher_info)
  630|       |		goto fail;
  631|       |
  632|       |	ctx->mctx = calloc(1, sizeof(mbedtls_cipher_context_t));
  633|       |	if (!ctx->mctx)
  634|       |		goto fail;
  635|       |
  636|       |	const mbedtls_operation_t operation = (op == WINPR_ENCRYPT) ? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT;
  637|       |	mbedtls_cipher_init(ctx->mctx);
  638|       |
  639|       |	if (mbedtls_cipher_setup(ctx->mctx, cipher_info) != 0)
  640|       |		goto fail;
  641|       |
  642|       |	const int key_bitlen = mbedtls_cipher_get_key_bitlen(ctx->mctx);
  643|       |
  644|       |	if (mbedtls_cipher_setkey(ctx->mctx, key, key_bitlen, operation) != 0)
  645|       |		goto fail;
  646|       |
  647|       |	if (mbedtls_cipher_set_padding_mode(ctx->mctx, MBEDTLS_PADDING_NONE) != 0)
  648|       |		goto fail;
  649|       |
  650|       |#endif
  651|    460|	return ctx;
  652|       |
  653|      0|fail:
  654|      0|	winpr_Cipher_Free(ctx);
  655|      0|	return nullptr;
  656|    460|}
winpr_Cipher_Update:
  678|    460|{
  679|    460|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|    460|	WINPR_ASSERT(olen);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  681|       |
  682|    460|#if defined(WITH_OPENSSL)
  683|    460|	int outl = (int)*olen;
  684|       |
  685|    460|	if (ilen > INT_MAX)
  ------------------
  |  Branch (685:6): [True: 0, False: 460]
  ------------------
  686|      0|	{
  687|      0|		WLog_ERR(TAG, "input length %" PRIuz " > %d, abort", ilen, INT_MAX);
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  688|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  689|      0|	}
  690|       |
  691|    460|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|    460|	if (EVP_CipherUpdate(ctx->ectx, output, &outl, input, (int)ilen) == 1)
  ------------------
  |  Branch (692:6): [True: 460, False: 0]
  ------------------
  693|    460|	{
  694|    460|		*olen = (size_t)outl;
  695|    460|		return TRUE;
  ------------------
  |  |  126|    460|#define TRUE true
  ------------------
  696|    460|	}
  697|       |
  698|       |#elif defined(WITH_MBEDTLS)
  699|       |	WINPR_ASSERT(ctx->mctx);
  700|       |	if (mbedtls_cipher_update(ctx->mctx, input, ilen, output, olen) == 0)
  701|       |		return TRUE;
  702|       |
  703|       |#endif
  704|       |
  705|      0|	WLog_ERR(TAG, "Failed to update the data");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  706|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  707|    460|}
winpr_Cipher_Final:
  710|    460|{
  711|    460|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  712|       |
  713|    460|#if defined(WITH_OPENSSL)
  714|    460|	int outl = (int)*olen;
  715|       |
  716|    460|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    460|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    460|	do                                                                                             \
  |  |  |  |   61|    460|	{                                                                                              \
  |  |  |  |   62|    460|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    460|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    460|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    460|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    460|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    460|                                                                                                   \
  |  |  |  |   70|    460|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    460|	do                                                      \
  |  |  |  |  |  |   32|    460|	{                                                       \
  |  |  |  |  |  |   33|    460|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    460|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    460|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    460|                                                                                                   \
  |  |  |  |   72|    460|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    460|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    460|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    460|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 460]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|    460|	if (EVP_CipherFinal_ex(ctx->ectx, output, &outl) == 1)
  ------------------
  |  Branch (717:6): [True: 269, False: 191]
  ------------------
  718|    269|	{
  719|    269|		*olen = (size_t)outl;
  720|    269|		return TRUE;
  ------------------
  |  |  126|    269|#define TRUE true
  ------------------
  721|    269|	}
  722|       |
  723|       |#elif defined(WITH_MBEDTLS)
  724|       |
  725|       |	WINPR_ASSERT(ctx->mctx);
  726|       |	if (mbedtls_cipher_finish(ctx->mctx, output, olen) == 0)
  727|       |		return TRUE;
  728|       |
  729|       |#endif
  730|       |
  731|    191|	return FALSE;
  ------------------
  |  |  122|    191|#define FALSE false
  ------------------
  732|    460|}
winpr_Cipher_Free:
  735|    460|{
  736|    460|	if (!ctx)
  ------------------
  |  Branch (736:6): [True: 0, False: 460]
  ------------------
  737|      0|		return;
  738|       |
  739|    460|#if defined(WITH_OPENSSL)
  740|    460|	if (ctx->ectx)
  ------------------
  |  Branch (740:6): [True: 460, False: 0]
  ------------------
  741|    460|		EVP_CIPHER_CTX_free(ctx->ectx);
  742|       |#elif defined(WITH_MBEDTLS)
  743|       |	if (ctx->mctx)
  744|       |	{
  745|       |		mbedtls_cipher_free(ctx->mctx);
  746|       |		free(ctx->mctx);
  747|       |	}
  748|       |#endif
  749|       |
  750|    460|	free(ctx);
  751|    460|}
cipher.c:winpr_RC4_New_Internal:
   79|    248|{
   80|    248|	if (!key || (keylen == 0))
  ------------------
  |  Branch (80:6): [True: 0, False: 248]
  |  Branch (80:14): [True: 0, False: 248]
  ------------------
   81|      0|		return nullptr;
   82|       |
   83|    248|	WINPR_RC4_CTX* ctx = (WINPR_RC4_CTX*)calloc(1, sizeof(WINPR_RC4_CTX));
   84|    248|	if (!ctx)
  ------------------
  |  Branch (84:6): [True: 0, False: 248]
  ------------------
   85|      0|		return nullptr;
   86|       |
   87|       |#if defined(WITH_INTERNAL_RC4)
   88|       |	WINPR_UNUSED(override_fips);
   89|       |	ctx->ictx = winpr_int_rc4_new(key, keylen);
   90|       |	if (!ctx->ictx)
   91|       |		goto fail;
   92|       |#elif defined(WITH_OPENSSL)
   93|       |
   94|    248|	if (keylen > INT_MAX)
  ------------------
  |  Branch (94:6): [True: 0, False: 248]
  ------------------
   95|      0|		goto fail;
   96|       |
   97|    248|	ctx->ctx = EVP_CIPHER_CTX_new();
   98|    248|	if (!ctx->ctx)
  ------------------
  |  Branch (98:6): [True: 0, False: 248]
  ------------------
   99|      0|		goto fail;
  100|       |
  101|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  102|       |	EVP_CIPHER* evp = EVP_CIPHER_fetch(nullptr, "RC4", override_fips ? "fips=no" : nullptr);
  103|       |#else
  104|    248|	const EVP_CIPHER* evp = EVP_rc4();
  105|    248|#endif
  106|       |
  107|    248|	if (!evp)
  ------------------
  |  Branch (107:6): [True: 0, False: 248]
  ------------------
  108|      0|		goto fail;
  109|       |
  110|    248|	EVP_CIPHER_CTX_reset(ctx->ctx);
  111|    248|	if (EVP_EncryptInit_ex(ctx->ctx, evp, nullptr, nullptr, nullptr) != 1)
  ------------------
  |  Branch (111:6): [True: 0, False: 248]
  ------------------
  112|      0|		goto fail;
  113|       |
  114|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  115|       |	EVP_CIPHER_free(evp);
  116|       |
  117|       |	/* EVP_CIPH_FLAG_NON_FIPS_ALLOW does not exist before openssl 1.0.1 */
  118|       |#if !(OPENSSL_VERSION_NUMBER < 0x10001000L)
  119|       |
  120|       |	if (override_fips == TRUE)
  121|       |		EVP_CIPHER_CTX_set_flags(ctx->ctx, EVP_CIPH_FLAG_NON_FIPS_ALLOW);
  122|       |
  123|       |#endif
  124|       |#endif
  125|    248|	EVP_CIPHER_CTX_set_key_length(ctx->ctx, (int)keylen);
  126|    248|	if (EVP_EncryptInit_ex(ctx->ctx, nullptr, nullptr, key, nullptr) != 1)
  ------------------
  |  Branch (126:6): [True: 0, False: 248]
  ------------------
  127|      0|		goto fail;
  128|    248|#endif
  129|    248|	return ctx;
  130|       |
  131|      0|fail:
  132|      0|	WINPR_PRAGMA_DIAG_PUSH
  133|      0|	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
  134|       |
  135|      0|	winpr_RC4_Free(ctx);
  136|      0|	WINPR_PRAGMA_DIAG_POP
  137|      0|	return nullptr;
  138|    248|}
cipher.c:winpr_openssl_get_evp_cipher:
  287|    460|{
  288|    460|	const EVP_CIPHER* evp = nullptr;
  289|       |
  290|    460|	switch (cipher)
  291|    460|	{
  292|      0|		case WINPR_CIPHER_NULL:
  ------------------
  |  Branch (292:3): [True: 0, False: 460]
  ------------------
  293|      0|			evp = EVP_enc_null();
  294|      0|			break;
  295|       |
  296|      0|		case WINPR_CIPHER_AES_128_ECB:
  ------------------
  |  Branch (296:3): [True: 0, False: 460]
  ------------------
  297|      0|			evp = EVP_get_cipherbyname("aes-128-ecb");
  298|      0|			break;
  299|       |
  300|      0|		case WINPR_CIPHER_AES_192_ECB:
  ------------------
  |  Branch (300:3): [True: 0, False: 460]
  ------------------
  301|      0|			evp = EVP_get_cipherbyname("aes-192-ecb");
  302|      0|			break;
  303|       |
  304|      0|		case WINPR_CIPHER_AES_256_ECB:
  ------------------
  |  Branch (304:3): [True: 0, False: 460]
  ------------------
  305|      0|			evp = EVP_get_cipherbyname("aes-256-ecb");
  306|      0|			break;
  307|       |
  308|    460|		case WINPR_CIPHER_AES_128_CBC:
  ------------------
  |  Branch (308:3): [True: 460, False: 0]
  ------------------
  309|    460|			evp = EVP_get_cipherbyname("aes-128-cbc");
  310|    460|			break;
  311|       |
  312|      0|		case WINPR_CIPHER_AES_192_CBC:
  ------------------
  |  Branch (312:3): [True: 0, False: 460]
  ------------------
  313|      0|			evp = EVP_get_cipherbyname("aes-192-cbc");
  314|      0|			break;
  315|       |
  316|      0|		case WINPR_CIPHER_AES_256_CBC:
  ------------------
  |  Branch (316:3): [True: 0, False: 460]
  ------------------
  317|      0|			evp = EVP_get_cipherbyname("aes-256-cbc");
  318|      0|			break;
  319|       |
  320|      0|		case WINPR_CIPHER_AES_128_CFB128:
  ------------------
  |  Branch (320:3): [True: 0, False: 460]
  ------------------
  321|      0|			evp = EVP_get_cipherbyname("aes-128-cfb128");
  322|      0|			break;
  323|       |
  324|      0|		case WINPR_CIPHER_AES_192_CFB128:
  ------------------
  |  Branch (324:3): [True: 0, False: 460]
  ------------------
  325|      0|			evp = EVP_get_cipherbyname("aes-192-cfb128");
  326|      0|			break;
  327|       |
  328|      0|		case WINPR_CIPHER_AES_256_CFB128:
  ------------------
  |  Branch (328:3): [True: 0, False: 460]
  ------------------
  329|      0|			evp = EVP_get_cipherbyname("aes-256-cfb128");
  330|      0|			break;
  331|       |
  332|      0|		case WINPR_CIPHER_AES_128_CTR:
  ------------------
  |  Branch (332:3): [True: 0, False: 460]
  ------------------
  333|      0|			evp = EVP_get_cipherbyname("aes-128-ctr");
  334|      0|			break;
  335|       |
  336|      0|		case WINPR_CIPHER_AES_192_CTR:
  ------------------
  |  Branch (336:3): [True: 0, False: 460]
  ------------------
  337|      0|			evp = EVP_get_cipherbyname("aes-192-ctr");
  338|      0|			break;
  339|       |
  340|      0|		case WINPR_CIPHER_AES_256_CTR:
  ------------------
  |  Branch (340:3): [True: 0, False: 460]
  ------------------
  341|      0|			evp = EVP_get_cipherbyname("aes-256-ctr");
  342|      0|			break;
  343|       |
  344|      0|		case WINPR_CIPHER_AES_128_GCM:
  ------------------
  |  Branch (344:3): [True: 0, False: 460]
  ------------------
  345|      0|			evp = EVP_get_cipherbyname("aes-128-gcm");
  346|      0|			break;
  347|       |
  348|      0|		case WINPR_CIPHER_AES_192_GCM:
  ------------------
  |  Branch (348:3): [True: 0, False: 460]
  ------------------
  349|      0|			evp = EVP_get_cipherbyname("aes-192-gcm");
  350|      0|			break;
  351|       |
  352|      0|		case WINPR_CIPHER_AES_256_GCM:
  ------------------
  |  Branch (352:3): [True: 0, False: 460]
  ------------------
  353|      0|			evp = EVP_get_cipherbyname("aes-256-gcm");
  354|      0|			break;
  355|       |
  356|      0|		case WINPR_CIPHER_AES_128_CCM:
  ------------------
  |  Branch (356:3): [True: 0, False: 460]
  ------------------
  357|      0|			evp = EVP_get_cipherbyname("aes-128-ccm");
  358|      0|			break;
  359|       |
  360|      0|		case WINPR_CIPHER_AES_192_CCM:
  ------------------
  |  Branch (360:3): [True: 0, False: 460]
  ------------------
  361|      0|			evp = EVP_get_cipherbyname("aes-192-ccm");
  362|      0|			break;
  363|       |
  364|      0|		case WINPR_CIPHER_AES_256_CCM:
  ------------------
  |  Branch (364:3): [True: 0, False: 460]
  ------------------
  365|      0|			evp = EVP_get_cipherbyname("aes-256-ccm");
  366|      0|			break;
  367|       |
  368|      0|		case WINPR_CIPHER_CAMELLIA_128_ECB:
  ------------------
  |  Branch (368:3): [True: 0, False: 460]
  ------------------
  369|      0|			evp = EVP_get_cipherbyname("camellia-128-ecb");
  370|      0|			break;
  371|       |
  372|      0|		case WINPR_CIPHER_CAMELLIA_192_ECB:
  ------------------
  |  Branch (372:3): [True: 0, False: 460]
  ------------------
  373|      0|			evp = EVP_get_cipherbyname("camellia-192-ecb");
  374|      0|			break;
  375|       |
  376|      0|		case WINPR_CIPHER_CAMELLIA_256_ECB:
  ------------------
  |  Branch (376:3): [True: 0, False: 460]
  ------------------
  377|      0|			evp = EVP_get_cipherbyname("camellia-256-ecb");
  378|      0|			break;
  379|       |
  380|      0|		case WINPR_CIPHER_CAMELLIA_128_CBC:
  ------------------
  |  Branch (380:3): [True: 0, False: 460]
  ------------------
  381|      0|			evp = EVP_get_cipherbyname("camellia-128-cbc");
  382|      0|			break;
  383|       |
  384|      0|		case WINPR_CIPHER_CAMELLIA_192_CBC:
  ------------------
  |  Branch (384:3): [True: 0, False: 460]
  ------------------
  385|      0|			evp = EVP_get_cipherbyname("camellia-192-cbc");
  386|      0|			break;
  387|       |
  388|      0|		case WINPR_CIPHER_CAMELLIA_256_CBC:
  ------------------
  |  Branch (388:3): [True: 0, False: 460]
  ------------------
  389|      0|			evp = EVP_get_cipherbyname("camellia-256-cbc");
  390|      0|			break;
  391|       |
  392|      0|		case WINPR_CIPHER_CAMELLIA_128_CFB128:
  ------------------
  |  Branch (392:3): [True: 0, False: 460]
  ------------------
  393|      0|			evp = EVP_get_cipherbyname("camellia-128-cfb128");
  394|      0|			break;
  395|       |
  396|      0|		case WINPR_CIPHER_CAMELLIA_192_CFB128:
  ------------------
  |  Branch (396:3): [True: 0, False: 460]
  ------------------
  397|      0|			evp = EVP_get_cipherbyname("camellia-192-cfb128");
  398|      0|			break;
  399|       |
  400|      0|		case WINPR_CIPHER_CAMELLIA_256_CFB128:
  ------------------
  |  Branch (400:3): [True: 0, False: 460]
  ------------------
  401|      0|			evp = EVP_get_cipherbyname("camellia-256-cfb128");
  402|      0|			break;
  403|       |
  404|      0|		case WINPR_CIPHER_CAMELLIA_128_CTR:
  ------------------
  |  Branch (404:3): [True: 0, False: 460]
  ------------------
  405|      0|			evp = EVP_get_cipherbyname("camellia-128-ctr");
  406|      0|			break;
  407|       |
  408|      0|		case WINPR_CIPHER_CAMELLIA_192_CTR:
  ------------------
  |  Branch (408:3): [True: 0, False: 460]
  ------------------
  409|      0|			evp = EVP_get_cipherbyname("camellia-192-ctr");
  410|      0|			break;
  411|       |
  412|      0|		case WINPR_CIPHER_CAMELLIA_256_CTR:
  ------------------
  |  Branch (412:3): [True: 0, False: 460]
  ------------------
  413|      0|			evp = EVP_get_cipherbyname("camellia-256-ctr");
  414|      0|			break;
  415|       |
  416|      0|		case WINPR_CIPHER_CAMELLIA_128_GCM:
  ------------------
  |  Branch (416:3): [True: 0, False: 460]
  ------------------
  417|      0|			evp = EVP_get_cipherbyname("camellia-128-gcm");
  418|      0|			break;
  419|       |
  420|      0|		case WINPR_CIPHER_CAMELLIA_192_GCM:
  ------------------
  |  Branch (420:3): [True: 0, False: 460]
  ------------------
  421|      0|			evp = EVP_get_cipherbyname("camellia-192-gcm");
  422|      0|			break;
  423|       |
  424|      0|		case WINPR_CIPHER_CAMELLIA_256_GCM:
  ------------------
  |  Branch (424:3): [True: 0, False: 460]
  ------------------
  425|      0|			evp = EVP_get_cipherbyname("camellia-256-gcm");
  426|      0|			break;
  427|       |
  428|      0|		case WINPR_CIPHER_CAMELLIA_128_CCM:
  ------------------
  |  Branch (428:3): [True: 0, False: 460]
  ------------------
  429|      0|			evp = EVP_get_cipherbyname("camellia-128-ccm");
  430|      0|			break;
  431|       |
  432|      0|		case WINPR_CIPHER_CAMELLIA_192_CCM:
  ------------------
  |  Branch (432:3): [True: 0, False: 460]
  ------------------
  433|      0|			evp = EVP_get_cipherbyname("camellia-192-ccm");
  434|      0|			break;
  435|       |
  436|      0|		case WINPR_CIPHER_CAMELLIA_256_CCM:
  ------------------
  |  Branch (436:3): [True: 0, False: 460]
  ------------------
  437|      0|			evp = EVP_get_cipherbyname("camellia-256-ccm");
  438|      0|			break;
  439|       |
  440|      0|		case WINPR_CIPHER_DES_ECB:
  ------------------
  |  Branch (440:3): [True: 0, False: 460]
  ------------------
  441|      0|			evp = EVP_get_cipherbyname("des-ecb");
  442|      0|			break;
  443|       |
  444|      0|		case WINPR_CIPHER_DES_CBC:
  ------------------
  |  Branch (444:3): [True: 0, False: 460]
  ------------------
  445|      0|			evp = EVP_get_cipherbyname("des-cbc");
  446|      0|			break;
  447|       |
  448|      0|		case WINPR_CIPHER_DES_EDE_ECB:
  ------------------
  |  Branch (448:3): [True: 0, False: 460]
  ------------------
  449|      0|			evp = EVP_get_cipherbyname("des-ede-ecb");
  450|      0|			break;
  451|       |
  452|      0|		case WINPR_CIPHER_DES_EDE_CBC:
  ------------------
  |  Branch (452:3): [True: 0, False: 460]
  ------------------
  453|      0|			evp = EVP_get_cipherbyname("des-ede-cbc");
  454|      0|			break;
  455|       |
  456|      0|		case WINPR_CIPHER_DES_EDE3_ECB:
  ------------------
  |  Branch (456:3): [True: 0, False: 460]
  ------------------
  457|      0|			evp = EVP_get_cipherbyname("des-ede3-ecb");
  458|      0|			break;
  459|       |
  460|      0|		case WINPR_CIPHER_DES_EDE3_CBC:
  ------------------
  |  Branch (460:3): [True: 0, False: 460]
  ------------------
  461|      0|			evp = EVP_get_cipherbyname("des-ede3-cbc");
  462|      0|			break;
  463|       |
  464|      0|		case WINPR_CIPHER_ARC4_128:
  ------------------
  |  Branch (464:3): [True: 0, False: 460]
  ------------------
  465|      0|			evp = EVP_get_cipherbyname("rc4");
  466|      0|			break;
  467|       |
  468|      0|		case WINPR_CIPHER_BLOWFISH_ECB:
  ------------------
  |  Branch (468:3): [True: 0, False: 460]
  ------------------
  469|      0|			evp = EVP_get_cipherbyname("blowfish-ecb");
  470|      0|			break;
  471|       |
  472|      0|		case WINPR_CIPHER_BLOWFISH_CBC:
  ------------------
  |  Branch (472:3): [True: 0, False: 460]
  ------------------
  473|      0|			evp = EVP_get_cipherbyname("blowfish-cbc");
  474|      0|			break;
  475|       |
  476|      0|		case WINPR_CIPHER_BLOWFISH_CFB64:
  ------------------
  |  Branch (476:3): [True: 0, False: 460]
  ------------------
  477|      0|			evp = EVP_get_cipherbyname("blowfish-cfb64");
  478|      0|			break;
  479|       |
  480|      0|		case WINPR_CIPHER_BLOWFISH_CTR:
  ------------------
  |  Branch (480:3): [True: 0, False: 460]
  ------------------
  481|      0|			evp = EVP_get_cipherbyname("blowfish-ctr");
  482|      0|			break;
  483|      0|		default:
  ------------------
  |  Branch (483:3): [True: 0, False: 460]
  ------------------
  484|      0|			break;
  485|    460|	}
  486|       |
  487|    460|	return evp;
  488|    460|}

winpr_openssl_get_evp_md:
   69|  1.62k|{
   70|  1.62k|	const char* name = winpr_md_type_to_string(md);
   71|  1.62k|	if (!name)
  ------------------
  |  Branch (71:6): [True: 0, False: 1.62k]
  ------------------
   72|      0|		return nullptr;
   73|  1.62k|	return EVP_get_digestbyname(name);
   74|  1.62k|}
winpr_md_type_to_string:
  142|  1.62k|{
  143|  1.62k|	const struct hash_map* cur = hashes;
  144|  6.26k|	while (cur->name)
  ------------------
  |  Branch (144:9): [True: 6.26k, False: 0]
  ------------------
  145|  6.26k|	{
  146|  6.26k|		if (cur->md == md)
  ------------------
  |  Branch (146:7): [True: 1.62k, False: 4.63k]
  ------------------
  147|  1.62k|			return cur->name;
  148|  4.63k|		cur++;
  149|  4.63k|	}
  150|      0|	return nullptr;
  151|  1.62k|}
winpr_Digest_New:
  445|  1.62k|{
  446|  1.62k|	WINPR_DIGEST_CTX* ctx = calloc(1, sizeof(WINPR_DIGEST_CTX));
  447|  1.62k|	if (!ctx)
  ------------------
  |  Branch (447:6): [True: 0, False: 1.62k]
  ------------------
  448|      0|		return nullptr;
  449|       |
  450|  1.62k|#if defined(WITH_OPENSSL)
  451|       |#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
  452|       |    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
  453|       |	ctx->mdctx = EVP_MD_CTX_create();
  454|       |#else
  455|  1.62k|	ctx->mdctx = EVP_MD_CTX_new();
  456|  1.62k|#endif
  457|  1.62k|	if (!ctx->mdctx)
  ------------------
  |  Branch (457:6): [True: 0, False: 1.62k]
  ------------------
  458|      0|		goto fail;
  459|       |
  460|       |#elif defined(WITH_MBEDTLS)
  461|       |	ctx->mdctx = (mbedtls_md_context_t*)calloc(1, sizeof(mbedtls_md_context_t));
  462|       |
  463|       |	if (!ctx->mdctx)
  464|       |		goto fail;
  465|       |
  466|       |	mbedtls_md_init(ctx->mdctx);
  467|       |#endif
  468|  1.62k|	return ctx;
  469|       |
  470|      0|fail:
  471|      0|	WINPR_PRAGMA_DIAG_PUSH
  472|      0|	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
  473|      0|	winpr_Digest_Free(ctx);
  474|      0|	WINPR_PRAGMA_DIAG_POP
  475|      0|	return nullptr;
  476|  1.62k|}
winpr_Digest_Init:
  560|  1.62k|{
  561|  1.62k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.62k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.62k|	do                                                                                             \
  |  |  |  |   61|  1.62k|	{                                                                                              \
  |  |  |  |   62|  1.62k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.62k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.62k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.62k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.62k|                                                                                                   \
  |  |  |  |   70|  1.62k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.62k|	do                                                      \
  |  |  |  |  |  |   32|  1.62k|	{                                                       \
  |  |  |  |  |  |   33|  1.62k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.62k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.62k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.62k|                                                                                                   \
  |  |  |  |   72|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.62k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.62k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.62k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|       |
  563|  1.62k|	ctx->md = md;
  564|  1.62k|	switch (md)
  565|  1.62k|	{
  566|       |#if defined(WITH_INTERNAL_MD4)
  567|       |		case WINPR_MD_MD4:
  568|       |			winpr_MD4_Init(&ctx->md4);
  569|       |			return TRUE;
  570|       |#endif
  571|       |#if defined(WITH_INTERNAL_MD5)
  572|       |		case WINPR_MD_MD5:
  573|       |			winpr_MD5_Init(&ctx->md5);
  574|       |			return TRUE;
  575|       |#endif
  576|  1.62k|		default:
  ------------------
  |  Branch (576:3): [True: 1.62k, False: 0]
  ------------------
  577|  1.62k|			break;
  578|  1.62k|	}
  579|       |
  580|  1.62k|#if defined(WITH_OPENSSL)
  581|  1.62k|	const EVP_MD* evp = winpr_openssl_get_evp_md(md);
  582|  1.62k|	return winpr_Digest_Init_Internal(ctx, evp);
  583|       |#else
  584|       |	return winpr_Digest_Init_Internal(ctx, md);
  585|       |#endif
  586|  1.62k|}
winpr_Digest_Update:
  589|  1.62k|{
  590|  1.62k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.62k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.62k|	do                                                                                             \
  |  |  |  |   61|  1.62k|	{                                                                                              \
  |  |  |  |   62|  1.62k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.62k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.62k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.62k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.62k|                                                                                                   \
  |  |  |  |   70|  1.62k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.62k|	do                                                      \
  |  |  |  |  |  |   32|  1.62k|	{                                                       \
  |  |  |  |  |  |   33|  1.62k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.62k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.62k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.62k|                                                                                                   \
  |  |  |  |   72|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.62k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.62k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.62k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|       |
  592|  1.62k|	switch (ctx->md)
  593|  1.62k|	{
  594|       |#if defined(WITH_INTERNAL_MD4)
  595|       |		case WINPR_MD_MD4:
  596|       |			winpr_MD4_Update(&ctx->md4, input, ilen);
  597|       |			return TRUE;
  598|       |#endif
  599|       |#if defined(WITH_INTERNAL_MD5)
  600|       |		case WINPR_MD_MD5:
  601|       |			winpr_MD5_Update(&ctx->md5, input, ilen);
  602|       |			return TRUE;
  603|       |#endif
  604|  1.62k|		default:
  ------------------
  |  Branch (604:3): [True: 1.62k, False: 0]
  ------------------
  605|  1.62k|			break;
  606|  1.62k|	}
  607|       |
  608|  1.62k|#if defined(WITH_OPENSSL)
  609|  1.62k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  610|       |
  611|  1.62k|	return EVP_DigestUpdate(mdctx, input, ilen) == 1;
  612|       |
  613|       |#elif defined(WITH_MBEDTLS)
  614|       |	mbedtls_md_context_t* mdctx = ctx->mdctx;
  615|       |
  616|       |	if (mbedtls_md_update(mdctx, input, ilen) != 0)
  617|       |		return FALSE;
  618|       |
  619|       |#endif
  620|      0|	return TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
  621|  1.62k|}
winpr_Digest_Final:
  624|  1.62k|{
  625|  1.62k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.62k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.62k|	do                                                                                             \
  |  |  |  |   61|  1.62k|	{                                                                                              \
  |  |  |  |   62|  1.62k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.62k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.62k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.62k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.62k|                                                                                                   \
  |  |  |  |   70|  1.62k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.62k|	do                                                      \
  |  |  |  |  |  |   32|  1.62k|	{                                                       \
  |  |  |  |  |  |   33|  1.62k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.62k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.62k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.62k|                                                                                                   \
  |  |  |  |   72|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.62k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.62k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.62k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|       |
  627|  1.62k|	switch (ctx->md)
  628|  1.62k|	{
  629|       |#if defined(WITH_INTERNAL_MD4)
  630|       |		case WINPR_MD_MD4:
  631|       |			if (olen < WINPR_MD4_DIGEST_LENGTH)
  632|       |				return FALSE;
  633|       |			winpr_MD4_Final(output, &ctx->md4);
  634|       |			return TRUE;
  635|       |#endif
  636|       |#if defined(WITH_INTERNAL_MD5)
  637|       |		case WINPR_MD_MD5:
  638|       |			if (olen < WINPR_MD5_DIGEST_LENGTH)
  639|       |				return FALSE;
  640|       |			winpr_MD5_Final(output, &ctx->md5);
  641|       |			return TRUE;
  642|       |#endif
  643|       |
  644|  1.62k|		default:
  ------------------
  |  Branch (644:3): [True: 1.62k, False: 0]
  ------------------
  645|  1.62k|			break;
  646|  1.62k|	}
  647|       |
  648|  1.62k|#if defined(WITH_OPENSSL)
  649|  1.62k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  650|       |
  651|  1.62k|	return EVP_DigestFinal_ex(mdctx, output, nullptr) == 1;
  652|       |
  653|       |#elif defined(WITH_MBEDTLS)
  654|       |	mbedtls_md_context_t* mdctx = ctx->mdctx;
  655|       |
  656|       |	if (mbedtls_md_finish(mdctx, output) == 0)
  657|       |		return TRUE;
  658|       |
  659|       |#endif
  660|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  661|  1.62k|}
winpr_Digest_Free:
  706|  1.62k|{
  707|  1.62k|	if (!ctx)
  ------------------
  |  Branch (707:6): [True: 0, False: 1.62k]
  ------------------
  708|      0|		return;
  709|  1.62k|#if defined(WITH_OPENSSL)
  710|  1.62k|	if (ctx->mdctx)
  ------------------
  |  Branch (710:6): [True: 1.62k, False: 0]
  ------------------
  711|  1.62k|	{
  712|       |#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
  713|       |    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
  714|       |		EVP_MD_CTX_destroy(ctx->mdctx);
  715|       |#else
  716|  1.62k|		EVP_MD_CTX_free(ctx->mdctx);
  717|  1.62k|#endif
  718|  1.62k|	}
  719|       |
  720|       |#elif defined(WITH_MBEDTLS)
  721|       |	if (ctx->mdctx)
  722|       |	{
  723|       |		mbedtls_md_free(ctx->mdctx);
  724|       |		free(ctx->mdctx);
  725|       |	}
  726|       |
  727|       |#endif
  728|  1.62k|	free(ctx);
  729|  1.62k|}
winpr_Digest:
  756|  1.62k|{
  757|  1.62k|	BOOL result = FALSE;
  ------------------
  |  |  122|  1.62k|#define FALSE false
  ------------------
  758|  1.62k|	WINPR_DIGEST_CTX* ctx = winpr_Digest_New();
  759|       |
  760|  1.62k|	if (!ctx)
  ------------------
  |  Branch (760:6): [True: 0, False: 1.62k]
  ------------------
  761|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  762|       |
  763|  1.62k|	if (!winpr_Digest_Init(ctx, md))
  ------------------
  |  Branch (763:6): [True: 0, False: 1.62k]
  ------------------
  764|      0|		goto out;
  765|       |
  766|  1.62k|	if (!winpr_Digest_Update(ctx, input, ilen))
  ------------------
  |  Branch (766:6): [True: 0, False: 1.62k]
  ------------------
  767|      0|		goto out;
  768|       |
  769|  1.62k|	if (!winpr_Digest_Final(ctx, output, olen))
  ------------------
  |  Branch (769:6): [True: 0, False: 1.62k]
  ------------------
  770|      0|		goto out;
  771|       |
  772|  1.62k|	result = TRUE;
  ------------------
  |  |  126|  1.62k|#define TRUE true
  ------------------
  773|  1.62k|out:
  774|  1.62k|	winpr_Digest_Free(ctx);
  775|  1.62k|	return result;
  776|  1.62k|}
hash.c:winpr_Digest_Init_Internal:
  480|  1.62k|{
  481|  1.62k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.62k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.62k|	do                                                                                             \
  |  |  |  |   61|  1.62k|	{                                                                                              \
  |  |  |  |   62|  1.62k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.62k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.62k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.62k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.62k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.62k|                                                                                                   \
  |  |  |  |   70|  1.62k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.62k|	do                                                      \
  |  |  |  |  |  |   32|  1.62k|	{                                                       \
  |  |  |  |  |  |   33|  1.62k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.62k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.62k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.62k|                                                                                                   \
  |  |  |  |   72|  1.62k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.62k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.62k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.62k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  1.62k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  483|       |
  484|  1.62k|	if (!mdctx || !evp)
  ------------------
  |  Branch (484:6): [True: 0, False: 1.62k]
  |  Branch (484:16): [True: 0, False: 1.62k]
  ------------------
  485|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  486|       |
  487|  1.62k|	if (EVP_DigestInit_ex(mdctx, evp, nullptr) != 1)
  ------------------
  |  Branch (487:6): [True: 0, False: 1.62k]
  ------------------
  488|      0|	{
  489|      0|		WLog_ERR(TAG, "Failed to initialize digest %s", winpr_md_type_to_string(ctx->md));
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  490|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  491|      0|	}
  492|       |
  493|  1.62k|	return TRUE;
  ------------------
  |  |  126|  1.62k|#define TRUE true
  ------------------
  494|  1.62k|}

GetEnvironmentVariableA:
  168|      4|{
  169|      4|#if !defined(_UWP)
  170|      4|	size_t length = 0;
  171|       |
  172|       |	// NOLINTNEXTLINE(concurrency-mt-unsafe)
  173|      4|	char* env = getenv(lpName);
  174|       |
  175|      4|	if (!env)
  ------------------
  |  Branch (175:6): [True: 4, False: 0]
  ------------------
  176|      4|	{
  177|      4|		SetLastError(ERROR_ENVVAR_NOT_FOUND);
  ------------------
  |  |  342|      4|#define ERROR_ENVVAR_NOT_FOUND 0x000000CB
  ------------------
  178|      4|		return 0;
  179|      4|	}
  180|       |
  181|      0|	length = strlen(env);
  182|       |
  183|      0|	if ((length + 1 > nSize) || (!lpBuffer))
  ------------------
  |  Branch (183:6): [True: 0, False: 0]
  |  Branch (183:30): [True: 0, False: 0]
  ------------------
  184|      0|		return (DWORD)length + 1;
  185|       |
  186|      0|	CopyMemory(lpBuffer, env, length);
  ------------------
  |  |  123|      0|#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
  ------------------
  187|      0|	lpBuffer[length] = '\0';
  188|       |
  189|      0|	return (DWORD)length;
  190|       |#else
  191|       |	SetLastError(ERROR_ENVVAR_NOT_FOUND);
  192|       |	return 0;
  193|       |#endif
  194|      0|}

SetLastError:
   54|      4|{
   55|      4|	PTEB pt = NtCurrentTeb();
   56|      4|	if (pt)
  ------------------
  |  Branch (56:6): [True: 4, False: 0]
  ------------------
   57|      4|	{
   58|      4|		pt->LastErrorValue = dwErrCode;
   59|      4|	}
   60|      4|}

InterlockedIncrement:
  240|  92.5k|{
  241|  92.5k|	WINPR_ASSERT(Addend);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|       |
  243|  92.5k|#if defined(__GNUC__) || defined(__clang__)
  244|  92.5k|	WINPR_PRAGMA_DIAG_PUSH
  245|  92.5k|	WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
  246|  92.5k|	return __sync_add_and_fetch(Addend, 1);
  247|  92.5k|	WINPR_PRAGMA_DIAG_POP
  248|       |#else
  249|       |	return 0;
  250|       |#endif
  251|  92.5k|}
InterlockedDecrement:
  254|  92.5k|{
  255|  92.5k|	WINPR_ASSERT(Addend);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|       |
  257|  92.5k|#if defined(__GNUC__) || defined(__clang__)
  258|  92.5k|	WINPR_PRAGMA_DIAG_PUSH
  259|  92.5k|	WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
  260|  92.5k|	return __sync_sub_and_fetch(Addend, 1);
  261|  92.5k|	WINPR_PRAGMA_DIAG_POP
  262|       |#else
  263|       |	return 0;
  264|       |#endif
  265|  92.5k|}
InterlockedCompareExchangePointer:
  311|      2|{
  312|      2|	WINPR_ASSERT(Destination);
  ------------------
  |  |   76|      2|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|      2|	do                                                                                             \
  |  |  |  |   61|      2|	{                                                                                              \
  |  |  |  |   62|      2|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|      2|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|      2|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|      2|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|      2|                                                                                                   \
  |  |  |  |   70|      2|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|      2|	do                                                      \
  |  |  |  |  |  |   32|      2|	{                                                       \
  |  |  |  |  |  |   33|      2|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|      2|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|      2|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|      2|                                                                                                   \
  |  |  |  |   72|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|      2|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|      2|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|      2|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|       |
  314|      2|#if defined(__GNUC__) || defined(__clang__)
  315|      2|	WINPR_PRAGMA_DIAG_PUSH
  316|      2|	WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
  317|      2|	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
  318|      2|	WINPR_PRAGMA_DIAG_POP
  319|       |#else
  320|       |	return 0;
  321|       |#endif
  322|      2|}

NtCurrentTeb:
   50|      4|{
   51|      4|	PTEB teb = nullptr;
   52|       |
   53|      4|	if (pthread_once(&sTebOnceControl, sTebInitOnce) == 0)
  ------------------
  |  Branch (53:6): [True: 4, False: 0]
  ------------------
   54|      4|	{
   55|      4|		if ((teb = pthread_getspecific(sTebKey)) == nullptr)
  ------------------
  |  Branch (55:7): [True: 1, False: 3]
  ------------------
   56|      1|		{
   57|      1|			teb = calloc(1, sizeof(TEB));
   58|      1|			if (teb)
  ------------------
  |  Branch (58:8): [True: 1, False: 0]
  ------------------
   59|      1|				pthread_setspecific(sTebKey, teb);
   60|      1|		}
   61|      4|	}
   62|      4|	return teb;
   63|      4|}
nt.c:sTebInitOnce:
   45|      1|{
   46|      1|	pthread_key_create(&sTebKey, sTebDestruct);
   47|      1|}

InitializeCriticalSectionEx:
   55|  6.39k|{
   56|  6.39k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.39k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.39k|	do                                                                                             \
  |  |  |  |   61|  6.39k|	{                                                                                              \
  |  |  |  |   62|  6.39k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.39k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.39k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.39k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.39k|                                                                                                   \
  |  |  |  |   70|  6.39k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.39k|	do                                                      \
  |  |  |  |  |  |   32|  6.39k|	{                                                       \
  |  |  |  |  |  |   33|  6.39k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.39k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.39k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.39k|                                                                                                   \
  |  |  |  |   72|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.39k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.39k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.39k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|       |	/**
   58|       |	 * See http://msdn.microsoft.com/en-us/library/ff541979(v=vs.85).aspx
   59|       |	 * - The LockCount field indicates the number of times that any thread has
   60|       |	 *   called the EnterCriticalSection routine for this critical section,
   61|       |	 *   minus one. This field starts at -1 for an unlocked critical section.
   62|       |	 *   Each call of EnterCriticalSection increments this value; each call of
   63|       |	 *   LeaveCriticalSection decrements it.
   64|       |	 * - The RecursionCount field indicates the number of times that the owning
   65|       |	 *   thread has called EnterCriticalSection for this critical section.
   66|       |	 */
   67|  6.39k|	if (Flags != 0)
  ------------------
  |  Branch (67:6): [True: 0, False: 6.39k]
  ------------------
   68|      0|	{
   69|      0|		WLog_WARN(TAG, "Flags unimplemented");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
   70|      0|	}
   71|       |
   72|  6.39k|	lpCriticalSection->DebugInfo = nullptr;
   73|  6.39k|	lpCriticalSection->LockCount = -1;
   74|  6.39k|	lpCriticalSection->SpinCount = 0;
   75|  6.39k|	lpCriticalSection->RecursionCount = 0;
   76|  6.39k|	lpCriticalSection->OwningThread = nullptr;
   77|  6.39k|	lpCriticalSection->LockSemaphore = (winpr_sem_t*)malloc(sizeof(winpr_sem_t));
   78|       |
   79|  6.39k|	if (!lpCriticalSection->LockSemaphore)
  ------------------
  |  Branch (79:6): [True: 0, False: 6.39k]
  ------------------
   80|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   81|       |
   82|       |#if defined(__APPLE__)
   83|       |
   84|       |	if (semaphore_create(mach_task_self(), lpCriticalSection->LockSemaphore, SYNC_POLICY_FIFO, 0) !=
   85|       |	    KERN_SUCCESS)
   86|       |		goto out_fail;
   87|       |
   88|       |#else
   89|       |
   90|  6.39k|	if (sem_init(lpCriticalSection->LockSemaphore, 0, 0) != 0)
  ------------------
  |  Branch (90:6): [True: 0, False: 6.39k]
  ------------------
   91|      0|		goto out_fail;
   92|       |
   93|  6.39k|#endif
   94|  6.39k|	SetCriticalSectionSpinCount(lpCriticalSection, dwSpinCount);
   95|  6.39k|	return TRUE;
  ------------------
  |  |  126|  6.39k|#define TRUE true
  ------------------
   96|      0|out_fail:
   97|      0|	free(lpCriticalSection->LockSemaphore);
   98|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   99|  6.39k|}
InitializeCriticalSectionAndSpinCount:
  102|  6.39k|{
  103|  6.39k|	return InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, 0);
  104|  6.39k|}
SetCriticalSectionSpinCount:
  108|  6.39k|{
  109|  6.39k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.39k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.39k|	do                                                                                             \
  |  |  |  |   61|  6.39k|	{                                                                                              \
  |  |  |  |   62|  6.39k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.39k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.39k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.39k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.39k|                                                                                                   \
  |  |  |  |   70|  6.39k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.39k|	do                                                      \
  |  |  |  |  |  |   32|  6.39k|	{                                                       \
  |  |  |  |  |  |   33|  6.39k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.39k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.39k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.39k|                                                                                                   \
  |  |  |  |   72|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.39k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.39k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.39k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|       |#if !defined(WINPR_CRITICAL_SECTION_DISABLE_SPINCOUNT)
  111|       |	SYSTEM_INFO sysinfo;
  112|       |	DWORD dwPreviousSpinCount = lpCriticalSection->SpinCount;
  113|       |
  114|       |	if (dwSpinCount)
  115|       |	{
  116|       |		/* Don't spin on uniprocessor systems! */
  117|       |		GetNativeSystemInfo(&sysinfo);
  118|       |
  119|       |		if (sysinfo.dwNumberOfProcessors < 2)
  120|       |			dwSpinCount = 0;
  121|       |	}
  122|       |
  123|       |	lpCriticalSection->SpinCount = dwSpinCount;
  124|       |	return dwPreviousSpinCount;
  125|       |#else
  126|       |	// WLog_ERR("TODO", "TODO: implement");
  127|  6.39k|	return 0;
  128|  6.39k|#endif
  129|  6.39k|}
EnterCriticalSection:
  155|  92.5k|{
  156|  92.5k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|       |#if !defined(WINPR_CRITICAL_SECTION_DISABLE_SPINCOUNT)
  158|       |	ULONG SpinCount = lpCriticalSection->SpinCount;
  159|       |
  160|       |	/* If we're lucky or if the current thread is already owner we can return early */
  161|       |	if (SpinCount && TryEnterCriticalSection(lpCriticalSection))
  162|       |		return;
  163|       |
  164|       |	/* Spin requested times but don't compete with another waiting thread */
  165|       |	while (SpinCount-- && lpCriticalSection->LockCount < 1)
  166|       |	{
  167|       |		/* Atomically try to acquire and check the if the section is free. */
  168|       |		if (InterlockedCompareExchange(&lpCriticalSection->LockCount, 0, -1) == -1)
  169|       |		{
  170|       |			lpCriticalSection->RecursionCount = 1;
  171|       |			lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId();
  172|       |			return;
  173|       |		}
  174|       |
  175|       |		/* Failed to get the lock. Let the scheduler know that we're spinning. */
  176|       |		if (sched_yield() != 0)
  177|       |		{
  178|       |			/**
  179|       |			 * On some operating systems sched_yield is a stub.
  180|       |			 * usleep should at least trigger a context switch if any thread is waiting.
  181|       |			 * A ThreadYield() would be nice in winpr ...
  182|       |			 */
  183|       |			usleep(1);
  184|       |		}
  185|       |	}
  186|       |
  187|       |#endif
  188|       |
  189|       |	/* First try the fastest possible path to get the lock. */
  190|  92.5k|	if (InterlockedIncrement(&lpCriticalSection->LockCount))
  ------------------
  |  Branch (190:6): [True: 0, False: 92.5k]
  ------------------
  191|      0|	{
  192|       |		/* Section is already locked. Check if it is owned by the current thread. */
  193|      0|		if (lpCriticalSection->OwningThread == (HANDLE)(ULONG_PTR)GetCurrentThreadId())
  ------------------
  |  Branch (193:7): [True: 0, False: 0]
  ------------------
  194|      0|		{
  195|       |			/* Recursion. No need to wait. */
  196|      0|			lpCriticalSection->RecursionCount++;
  197|      0|			return;
  198|      0|		}
  199|       |
  200|       |		/* Section is locked by another thread. We have to wait. */
  201|      0|		WaitForCriticalSection(lpCriticalSection);
  202|      0|	}
  203|       |
  204|       |	/* We got the lock. Own it ... */
  205|  92.5k|	lpCriticalSection->RecursionCount = 1;
  206|  92.5k|	lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId();
  207|  92.5k|}
LeaveCriticalSection:
  236|  92.5k|{
  237|  92.5k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|       |
  239|       |	/* Decrement RecursionCount and check if this is the last LeaveCriticalSection call ...*/
  240|  92.5k|	if (--lpCriticalSection->RecursionCount < 1)
  ------------------
  |  Branch (240:6): [True: 92.5k, False: 0]
  ------------------
  241|  92.5k|	{
  242|       |		/* Last recursion, clear owner, unlock and if there are other waiting threads ... */
  243|  92.5k|		lpCriticalSection->OwningThread = nullptr;
  244|       |
  245|  92.5k|		if (InterlockedDecrement(&lpCriticalSection->LockCount) >= 0)
  ------------------
  |  Branch (245:7): [True: 0, False: 92.5k]
  ------------------
  246|      0|		{
  247|       |			/* ...signal the semaphore to unblock the next waiting thread */
  248|      0|			UnWaitCriticalSection(lpCriticalSection);
  249|      0|		}
  250|  92.5k|	}
  251|      0|	else
  252|      0|	{
  253|      0|		(void)InterlockedDecrement(&lpCriticalSection->LockCount);
  254|      0|	}
  255|  92.5k|}
DeleteCriticalSection:
  258|  6.39k|{
  259|  6.39k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.39k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.39k|	do                                                                                             \
  |  |  |  |   61|  6.39k|	{                                                                                              \
  |  |  |  |   62|  6.39k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.39k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.39k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.39k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.39k|                                                                                                   \
  |  |  |  |   70|  6.39k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.39k|	do                                                      \
  |  |  |  |  |  |   32|  6.39k|	{                                                       \
  |  |  |  |  |  |   33|  6.39k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.39k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.39k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.39k|                                                                                                   \
  |  |  |  |   72|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.39k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.39k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.39k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|       |
  261|  6.39k|	lpCriticalSection->LockCount = -1;
  262|  6.39k|	lpCriticalSection->SpinCount = 0;
  263|  6.39k|	lpCriticalSection->RecursionCount = 0;
  264|  6.39k|	lpCriticalSection->OwningThread = nullptr;
  265|       |
  266|  6.39k|	if (lpCriticalSection->LockSemaphore != nullptr)
  ------------------
  |  Branch (266:6): [True: 6.39k, False: 0]
  ------------------
  267|  6.39k|	{
  268|       |#if defined __APPLE__
  269|       |		semaphore_destroy(mach_task_self(), *((winpr_sem_t*)lpCriticalSection->LockSemaphore));
  270|       |#else
  271|  6.39k|		sem_destroy((winpr_sem_t*)lpCriticalSection->LockSemaphore);
  272|  6.39k|#endif
  273|  6.39k|		free(lpCriticalSection->LockSemaphore);
  274|  6.39k|		lpCriticalSection->LockSemaphore = nullptr;
  275|  6.39k|	}
  276|  6.39k|}

winpr_InitOnceExecuteOnce:
   55|  2.13k|{
   56|  2.13k|	for (;;)
   57|  2.13k|	{
   58|  2.13k|		switch ((ULONG_PTR)InitOnce->Ptr & 3)
   59|  2.13k|		{
   60|  2.13k|			case 2:
  ------------------
  |  Branch (60:4): [True: 2.13k, False: 2]
  ------------------
   61|       |				/* already completed successfully */
   62|  2.13k|				return TRUE;
  ------------------
  |  |  126|  2.13k|#define TRUE true
  ------------------
   63|       |
   64|      2|			case 0:
  ------------------
  |  Branch (64:4): [True: 2, False: 2.13k]
  ------------------
   65|       |
   66|       |				/* first time */
   67|      2|				if (InterlockedCompareExchangePointer(&InitOnce->Ptr, (PVOID)1, (PVOID)0) !=
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      2|				    (PVOID)0)
   69|      0|				{
   70|       |					/* some other thread was faster */
   71|      0|					break;
   72|      0|				}
   73|       |
   74|       |				/* it's our job to call the init function */
   75|      2|				if (InitFn(InitOnce, Parameter, Context))
  ------------------
  |  Branch (75:9): [True: 2, False: 0]
  ------------------
   76|      2|				{
   77|       |					/* success */
   78|      2|					InitOnce->Ptr = (PVOID)2;
   79|      2|					return TRUE;
  ------------------
  |  |  126|      2|#define TRUE true
  ------------------
   80|      2|				}
   81|       |
   82|       |				/* the init function returned an error,  reset the status */
   83|      0|				InitOnce->Ptr = (PVOID)0;
   84|      0|				return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   85|       |
   86|      0|			case 1:
  ------------------
  |  Branch (86:4): [True: 0, False: 2.13k]
  ------------------
   87|       |				/* in progress */
   88|      0|				break;
   89|       |
   90|      0|			default:
  ------------------
  |  Branch (90:4): [True: 0, False: 2.13k]
  ------------------
   91|      0|				WLog_ERR(TAG, "internal error");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
   92|      0|				return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   93|  2.13k|		}
   94|       |
   95|      0|		Sleep(5);
   96|      0|	}
   97|  2.13k|}

GetLocalTime:
  278|  92.5k|{
  279|  92.5k|	time_t ct = 0;
  280|  92.5k|	struct tm tres;
  281|  92.5k|	struct tm* ltm = nullptr;
  282|  92.5k|	WORD wMilliseconds = 0;
  283|  92.5k|	UINT64 now = winpr_GetUnixTimeNS();
  284|  92.5k|	ct = WINPR_TIME_NS_TO_S(now);
  ------------------
  |  |  357|  92.5k|#define WINPR_TIME_NS_TO_S(ns) ((ns) / 1000000000ull) /** @since version 3.4.0 */
  ------------------
  285|  92.5k|	wMilliseconds = (WORD)(WINPR_TIME_NS_REM_MS(now));
  ------------------
  |  |  363|  92.5k|#define WINPR_TIME_NS_REM_MS(ns) (WINPR_TIME_NS_REM_US(ns) / 1000ull) /** @since version 3.4.0 */
  |  |  ------------------
  |  |  |  |  362|  92.5k|#define WINPR_TIME_NS_REM_US(ns) (WINPR_TIME_NS_REM_NS(ns) / 1000ull) /** @since version 3.4.0 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  361|  92.5k|#define WINPR_TIME_NS_REM_NS(ns) ((ns) % 1000000000ull)               /** @since version 3.4.0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|  92.5k|	ltm = localtime_r(&ct, &tres);
  287|  92.5k|	ZeroMemory(lpSystemTime, sizeof(SYSTEMTIME));
  ------------------
  |  |  126|  92.5k|#define ZeroMemory(Destination, Length) memset((Destination), 0, (Length))
  ------------------
  288|       |
  289|  92.5k|	if (ltm)
  ------------------
  |  Branch (289:6): [True: 92.5k, False: 0]
  ------------------
  290|  92.5k|	{
  291|  92.5k|		lpSystemTime->wYear = (WORD)(ltm->tm_year + 1900);
  292|  92.5k|		lpSystemTime->wMonth = (WORD)(ltm->tm_mon + 1);
  293|  92.5k|		lpSystemTime->wDayOfWeek = (WORD)ltm->tm_wday;
  294|  92.5k|		lpSystemTime->wDay = (WORD)ltm->tm_mday;
  295|  92.5k|		lpSystemTime->wHour = (WORD)ltm->tm_hour;
  296|  92.5k|		lpSystemTime->wMinute = (WORD)ltm->tm_min;
  297|  92.5k|		lpSystemTime->wSecond = (WORD)ltm->tm_sec;
  298|  92.5k|		lpSystemTime->wMilliseconds = wMilliseconds;
  299|  92.5k|	}
  300|  92.5k|}
winpr_GetUnixTimeNS:
  630|  92.5k|{
  631|       |#if defined(_WIN32)
  632|       |
  633|       |	union
  634|       |	{
  635|       |		UINT64 u64;
  636|       |		FILETIME ft;
  637|       |	} t = WINPR_C_ARRAY_INIT;
  638|       |	GetSystemTimeAsFileTime(&t.ft);
  639|       |	return (t.u64 - FILETIME_TO_UNIX_OFFSET_S * 10000000ull) * 100ull;
  640|       |#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L)
  641|  92.5k|	struct timespec ts = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  642|  92.5k|	if (clock_gettime(CLOCK_REALTIME, &ts) != 0)
  ------------------
  |  Branch (642:6): [True: 0, False: 92.5k]
  ------------------
  643|      0|		return 0;
  644|  92.5k|	return WINPR_ASSERTING_INT_CAST(uint64_t, ts.tv_sec) * 1000000000ull +
  ------------------
  |  |  112|  92.5k|	__extension__({                                                                             \
  |  |  113|  92.5k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  92.5k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  92.5k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  92.5k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   277k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  92.5k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  92.5k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  92.5k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  92.5k|	})
  ------------------
  645|  92.5k|	       WINPR_ASSERTING_INT_CAST(uint64_t, ts.tv_nsec);
  ------------------
  |  |  112|  92.5k|	__extension__({                                                                             \
  |  |  113|  92.5k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  92.5k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  92.5k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  92.5k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   277k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  92.5k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  92.5k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  92.5k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  92.5k|	})
  ------------------
  646|       |#else
  647|       |	struct timeval tv = WINPR_C_ARRAY_INIT;
  648|       |	if (gettimeofday(&tv, nullptr) != 0)
  649|       |		return 0;
  650|       |	return tv.tv_sec * 1000000000ULL + tv.tv_usec * 1000ull;
  651|       |#endif
  652|  92.5k|}

GetCurrentProcessId:
  583|  92.5k|{
  584|  92.5k|	return ((DWORD)getpid());
  585|  92.5k|}

GetCurrentThreadId:
  907|  92.5k|{
  908|       |#if defined(__FreeBSD__)
  909|       |	return WINPR_CXX_COMPAT_CAST(DWORD, pthread_getthreadid_np());
  910|       |#elif defined(__linux__)
  911|  92.5k|	return WINPR_CXX_COMPAT_CAST(DWORD, syscall(SYS_gettid));
  ------------------
  |  |   33|  92.5k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  ------------------
  912|       |#else
  913|       |	pthread_t tid = pthread_self();
  914|       |	/* Since pthread_t can be 64-bits on some systems, take just the    */
  915|       |	/* lower 32-bits of it for the thread ID returned by this function. */
  916|       |	uintptr_t ptid = WINPR_REINTERPRET_CAST(tid, pthread_t, uintptr_t);
  917|       |	return (ptid & UINT32_MAX) ^ (ptid >> 32);
  918|       |#endif
  919|  92.5k|}

winpr_atexit:
   33|      2|{
   34|      2|	atexit_count++;
   35|      2|	const int rc = atexit(fkt);
   36|      2|	if (rc != 0)
  ------------------
  |  Branch (36:6): [True: 0, False: 2]
  ------------------
   37|      0|	{
   38|      0|		char buffer[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|      0|	{                      \
  |  |   85|      0|	} /** @since version 3.24.0 */
  ------------------
   39|      0|		WLog_ERR(TAG, "atexit[%" PRIuz "] failed: %s [%d]", atexit_count,
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
   40|      0|		         winpr_strerror(errno, buffer, sizeof(buffer)), errno);
   41|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   42|      0|	}
   43|      2|	return TRUE;
  ------------------
  |  |  126|      2|#define TRUE true
  ------------------
   44|      2|}

ArrayList_SetItem:
  171|  1.07M|{
  172|  1.07M|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  1.07M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.07M|	do                                                                                             \
  |  |  |  |   61|  1.07M|	{                                                                                              \
  |  |  |  |   62|  1.07M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.07M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.07M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.07M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.07M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.07M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.07M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.07M|                                                                                                   \
  |  |  |  |   70|  1.07M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.07M|	do                                                      \
  |  |  |  |  |  |   32|  1.07M|	{                                                       \
  |  |  |  |  |  |   33|  1.07M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.07M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.07M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.07M|                                                                                                   \
  |  |  |  |   72|  1.07M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.07M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.07M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.07M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  1.07M|	if (index >= arrayList->size)
  ------------------
  |  Branch (173:6): [True: 0, False: 1.07M]
  ------------------
  174|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  175|       |
  176|  1.07M|	if (arrayList->object.fnObjectNew)
  ------------------
  |  Branch (176:6): [True: 0, False: 1.07M]
  ------------------
  177|      0|	{
  178|      0|		arrayList->array[index] = arrayList->object.fnObjectNew(obj);
  179|      0|		if (obj && !arrayList->array[index])
  ------------------
  |  Branch (179:7): [True: 0, False: 0]
  |  Branch (179:14): [True: 0, False: 0]
  ------------------
  180|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  181|      0|	}
  182|  1.07M|	else
  183|  1.07M|	{
  184|  1.07M|		union
  185|  1.07M|		{
  186|  1.07M|			const void* cpv;
  187|  1.07M|			void* pv;
  188|  1.07M|		} cnv;
  189|  1.07M|		cnv.cpv = obj;
  190|  1.07M|		arrayList->array[index] = cnv.pv;
  191|  1.07M|	}
  192|  1.07M|	return TRUE;
  ------------------
  |  |  126|  1.07M|#define TRUE true
  ------------------
  193|  1.07M|}
ArrayList_Clear:
  259|  6.39k|{
  260|  6.39k|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  6.39k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.39k|	do                                                                                             \
  |  |  |  |   61|  6.39k|	{                                                                                              \
  |  |  |  |   62|  6.39k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.39k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.39k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.39k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.39k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.39k|                                                                                                   \
  |  |  |  |   70|  6.39k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.39k|	do                                                      \
  |  |  |  |  |  |   32|  6.39k|	{                                                       \
  |  |  |  |  |  |   33|  6.39k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.39k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.39k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.39k|                                                                                                   \
  |  |  |  |   72|  6.39k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.39k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.39k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.39k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|  6.39k|	ArrayList_Lock_Conditional(arrayList);
  262|       |
  263|  1.08M|	for (size_t index = 0; index < arrayList->size; index++)
  ------------------
  |  Branch (263:25): [True: 1.07M, False: 6.39k]
  ------------------
  264|  1.07M|	{
  265|  1.07M|		if (arrayList->object.fnObjectFree)
  ------------------
  |  Branch (265:7): [True: 537k, False: 537k]
  ------------------
  266|   537k|			arrayList->object.fnObjectFree(arrayList->array[index]);
  267|       |
  268|  1.07M|		arrayList->array[index] = nullptr;
  269|  1.07M|	}
  270|       |
  271|  6.39k|	arrayList->size = 0;
  272|       |
  273|  6.39k|	ArrayList_Unlock_Conditional(arrayList);
  274|  6.39k|}
ArrayList_Append:
  315|  1.07M|{
  316|  1.07M|	size_t index = 0;
  317|  1.07M|	BOOL rc = FALSE;
  ------------------
  |  |  122|  1.07M|#define FALSE false
  ------------------
  318|       |
  319|  1.07M|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  1.07M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.07M|	do                                                                                             \
  |  |  |  |   61|  1.07M|	{                                                                                              \
  |  |  |  |   62|  1.07M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.07M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.07M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.07M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.07M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.07M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.07M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.07M|                                                                                                   \
  |  |  |  |   70|  1.07M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.07M|	do                                                      \
  |  |  |  |  |  |   32|  1.07M|	{                                                       \
  |  |  |  |  |  |   33|  1.07M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.07M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.07M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.07M|                                                                                                   \
  |  |  |  |   72|  1.07M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.07M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.07M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.07M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.07M|	ArrayList_Lock_Conditional(arrayList);
  321|       |
  322|  1.07M|	if (!ArrayList_EnsureCapacity(arrayList, 1))
  ------------------
  |  Branch (322:6): [True: 0, False: 1.07M]
  ------------------
  323|      0|		goto out;
  324|       |
  325|  1.07M|	index = arrayList->size++;
  326|  1.07M|	rc = ArrayList_SetItem(arrayList, index, obj);
  327|  1.07M|out:
  328|       |
  329|  1.07M|	ArrayList_Unlock_Conditional(arrayList);
  330|       |
  331|  1.07M|	return rc;
  332|  1.07M|}
ArrayList_Object:
  530|  10.6k|{
  531|  10.6k|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  10.6k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  10.6k|	do                                                                                             \
  |  |  |  |   61|  10.6k|	{                                                                                              \
  |  |  |  |   62|  10.6k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  10.6k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  10.6k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  10.6k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  10.6k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  10.6k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  10.6k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  10.6k|                                                                                                   \
  |  |  |  |   70|  10.6k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  10.6k|	do                                                      \
  |  |  |  |  |  |   32|  10.6k|	{                                                       \
  |  |  |  |  |  |   33|  10.6k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 10.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  10.6k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  10.6k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 10.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  10.6k|                                                                                                   \
  |  |  |  |   72|  10.6k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  10.6k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  10.6k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  10.6k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|  10.6k|	return &arrayList->object;
  533|  10.6k|}
ArrayList_New:
  577|  6.39k|{
  578|  6.39k|	wObject* obj = nullptr;
  579|  6.39k|	wArrayList* arrayList = nullptr;
  580|  6.39k|	arrayList = (wArrayList*)calloc(1, sizeof(wArrayList));
  581|       |
  582|  6.39k|	if (!arrayList)
  ------------------
  |  Branch (582:6): [True: 0, False: 6.39k]
  ------------------
  583|      0|		return nullptr;
  584|       |
  585|  6.39k|	arrayList->synchronized = synchronized;
  586|  6.39k|	arrayList->growthFactor = 2;
  587|  6.39k|	obj = ArrayList_Object(arrayList);
  588|  6.39k|	if (!obj)
  ------------------
  |  Branch (588:6): [True: 0, False: 6.39k]
  ------------------
  589|      0|		goto fail;
  590|  6.39k|	obj->fnObjectEquals = ArrayList_DefaultCompare;
  591|  6.39k|	if (!ArrayList_EnsureCapacity(arrayList, 32))
  ------------------
  |  Branch (591:6): [True: 0, False: 6.39k]
  ------------------
  592|      0|		goto fail;
  593|       |
  594|  6.39k|	if (!InitializeCriticalSectionAndSpinCount(&arrayList->lock, 4000))
  ------------------
  |  Branch (594:6): [True: 0, False: 6.39k]
  ------------------
  595|      0|		goto fail;
  596|  6.39k|	return arrayList;
  597|      0|fail:
  598|      0|	WINPR_PRAGMA_DIAG_PUSH
  599|      0|	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
  600|      0|	ArrayList_Free(arrayList);
  601|      0|	WINPR_PRAGMA_DIAG_POP
  602|      0|	return nullptr;
  603|  6.39k|}
ArrayList_Free:
  606|  6.39k|{
  607|  6.39k|	if (!arrayList)
  ------------------
  |  Branch (607:6): [True: 0, False: 6.39k]
  ------------------
  608|      0|		return;
  609|       |
  610|  6.39k|	ArrayList_Clear(arrayList);
  611|  6.39k|	DeleteCriticalSection(&arrayList->lock);
  612|  6.39k|	free((void*)arrayList->array);
  613|  6.39k|	free(arrayList);
  614|  6.39k|}
ArrayList.c:ArrayList_Lock_Conditional:
  120|  1.08M|{
  121|  1.08M|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  1.08M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.08M|	do                                                                                             \
  |  |  |  |   61|  1.08M|	{                                                                                              \
  |  |  |  |   62|  1.08M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.08M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.08M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.08M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.08M|                                                                                                   \
  |  |  |  |   70|  1.08M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.08M|	do                                                      \
  |  |  |  |  |  |   32|  1.08M|	{                                                       \
  |  |  |  |  |  |   33|  1.08M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.08M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.08M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.08M|                                                                                                   \
  |  |  |  |   72|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.08M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.08M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.08M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  1.08M|	if (arrayList->synchronized)
  ------------------
  |  Branch (122:6): [True: 0, False: 1.08M]
  ------------------
  123|      0|		EnterCriticalSection(&arrayList->lock);
  124|  1.08M|}
ArrayList.c:ArrayList_Unlock_Conditional:
  137|  1.08M|{
  138|  1.08M|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  1.08M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.08M|	do                                                                                             \
  |  |  |  |   61|  1.08M|	{                                                                                              \
  |  |  |  |   62|  1.08M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.08M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.08M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.08M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.08M|                                                                                                   \
  |  |  |  |   70|  1.08M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.08M|	do                                                      \
  |  |  |  |  |  |   32|  1.08M|	{                                                       \
  |  |  |  |  |  |   33|  1.08M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.08M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.08M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.08M|                                                                                                   \
  |  |  |  |   72|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.08M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.08M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.08M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  1.08M|	if (arrayList->synchronized)
  ------------------
  |  Branch (139:6): [True: 0, False: 1.08M]
  ------------------
  140|      0|		LeaveCriticalSection(&arrayList->lock);
  141|  1.08M|}
ArrayList.c:ArrayList_EnsureCapacity:
  199|  1.08M|{
  200|  1.08M|	WINPR_ASSERT(arrayList);
  ------------------
  |  |   76|  1.08M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.08M|	do                                                                                             \
  |  |  |  |   61|  1.08M|	{                                                                                              \
  |  |  |  |   62|  1.08M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.08M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.08M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.08M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.08M|                                                                                                   \
  |  |  |  |   70|  1.08M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.08M|	do                                                      \
  |  |  |  |  |  |   32|  1.08M|	{                                                       \
  |  |  |  |  |  |   33|  1.08M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.08M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.08M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.08M|                                                                                                   \
  |  |  |  |   72|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.08M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.08M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.08M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  1.08M|	WINPR_ASSERT(count > 0);
  ------------------
  |  |   76|  1.08M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.08M|	do                                                                                             \
  |  |  |  |   61|  1.08M|	{                                                                                              \
  |  |  |  |   62|  1.08M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.08M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.08M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.08M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.08M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.08M|                                                                                                   \
  |  |  |  |   70|  1.08M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.08M|	do                                                      \
  |  |  |  |  |  |   32|  1.08M|	{                                                       \
  |  |  |  |  |  |   33|  1.08M|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.08M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.08M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.08M|                                                                                                   \
  |  |  |  |   72|  1.08M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.08M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.08M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.08M|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|       |
  203|  1.08M|	if (arrayList->size + count > arrayList->capacity)
  ------------------
  |  Branch (203:6): [True: 6.82k, False: 1.07M]
  ------------------
  204|  6.82k|	{
  205|  6.82k|		void** newArray = nullptr;
  206|  6.82k|		size_t newCapacity = arrayList->capacity * arrayList->growthFactor;
  207|  6.82k|		if (newCapacity < arrayList->size + count)
  ------------------
  |  Branch (207:7): [True: 6.39k, False: 436]
  ------------------
  208|  6.39k|			newCapacity = arrayList->size + count;
  209|       |
  210|  6.82k|		newArray = (void**)realloc((void*)arrayList->array, sizeof(void*) * newCapacity);
  211|       |
  212|  6.82k|		if (!newArray)
  ------------------
  |  Branch (212:7): [True: 0, False: 6.82k]
  ------------------
  213|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  214|       |
  215|  6.82k|		arrayList->array = newArray;
  216|  6.82k|		arrayList->capacity = newCapacity;
  217|  6.82k|	}
  218|       |
  219|  1.08M|	return TRUE;
  ------------------
  |  |  126|  1.08M|#define TRUE true
  ------------------
  220|  1.08M|}

winpr_HexStringToBinBuffer:
  188|    460|{
  189|    460|	size_t y = 0;
  190|    460|	size_t maxStrLen = 0;
  191|    460|	if (!str || !data || (strLength == 0) || (dataLength == 0))
  ------------------
  |  Branch (191:6): [True: 0, False: 460]
  |  Branch (191:14): [True: 0, False: 460]
  |  Branch (191:23): [True: 1, False: 459]
  |  Branch (191:43): [True: 0, False: 459]
  ------------------
  192|      1|		return 0;
  193|       |
  194|    459|	maxStrLen = strnlen(str, strLength);
  195|  6.38M|	for (size_t x = 0; x < maxStrLen;)
  ------------------
  |  Branch (195:21): [True: 6.38M, False: 457]
  ------------------
  196|  6.38M|	{
  197|  6.38M|		BYTE val = value(str[x++]);
  198|  6.38M|		if (x < maxStrLen)
  ------------------
  |  Branch (198:7): [True: 6.38M, False: 342]
  ------------------
  199|  6.38M|			val = (BYTE)(val << 4) | (value(str[x++]));
  200|  6.38M|		if (x < maxStrLen)
  ------------------
  |  Branch (200:7): [True: 6.38M, False: 459]
  ------------------
  201|  6.38M|		{
  202|  6.38M|			if (str[x] == ' ')
  ------------------
  |  Branch (202:8): [True: 7.08k, False: 6.37M]
  ------------------
  203|  7.08k|				x++;
  204|  6.38M|		}
  205|  6.38M|		data[y++] = val;
  206|  6.38M|		if (y >= dataLength)
  ------------------
  |  Branch (206:7): [True: 2, False: 6.38M]
  ------------------
  207|      2|			return y;
  208|  6.38M|	}
  209|    457|	return y;
  210|    459|}
print.c:value:
  177|  12.7M|{
  178|  12.7M|	if ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (178:6): [True: 11.3M, False: 1.39M]
  |  Branch (178:20): [True: 4.08M, False: 7.28M]
  ------------------
  179|  4.08M|		return (c - '0') & 0xFF;
  180|  8.68M|	if ((c >= 'A') && (c <= 'F'))
  ------------------
  |  Branch (180:6): [True: 657k, False: 8.02M]
  |  Branch (180:20): [True: 126k, False: 530k]
  ------------------
  181|   126k|		return (10 + c - 'A') & 0xFF;
  182|  8.55M|	if ((c >= 'a') && (c <= 'f'))
  ------------------
  |  Branch (182:6): [True: 276k, False: 8.28M]
  |  Branch (182:20): [True: 212k, False: 64.3k]
  ------------------
  183|   212k|		return (10 + c - 'a') & 0xFF;
  184|  8.34M|	return 0;
  185|  8.55M|}

winpr_InitializeSSL:
  350|  2.13k|{
  351|  2.13k|	static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
  ------------------
  |  |  402|  2.13k|#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
  |  |  ------------------
  |  |  |  |  377|  2.13k|	{                     \
  |  |  |  |  378|  2.13k|		0                 \
  |  |  |  |  379|  2.13k|	}
  |  |  ------------------
  ------------------
  352|       |
  353|  2.13k|	if (!InitOnceExecuteOnce(&once, winpr_openssl_initialize, &flags, nullptr))
  ------------------
  |  |  424|  2.13k|#define InitOnceExecuteOnce winpr_InitOnceExecuteOnce
  ------------------
  |  Branch (353:6): [True: 0, False: 2.13k]
  ------------------
  354|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  355|       |
  356|  2.13k|	return winpr_enable_fips(flags);
  357|  2.13k|}
winpr_CleanupSSL:
  378|      1|{
  379|      1|	if (flags & WINPR_SSL_CLEANUP_GLOBAL)
  ------------------
  |  |   32|      1|#define WINPR_SSL_CLEANUP_GLOBAL 0x01
  ------------------
  |  Branch (379:6): [True: 0, False: 1]
  ------------------
  380|      0|	{
  381|      0|		if (!g_winpr_openssl_initialized_by_winpr)
  ------------------
  |  Branch (381:7): [True: 0, False: 0]
  ------------------
  382|      0|		{
  383|      0|			WLog_WARN(TAG, "ssl was not initialized by winpr");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  384|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  385|      0|		}
  386|       |
  387|      0|		g_winpr_openssl_initialized_by_winpr = FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  388|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  389|       |		_winpr_openssl_cleanup_locking();
  390|       |#endif
  391|       |#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
  392|       |		CRYPTO_cleanup_all_ex_data();
  393|       |		ERR_free_strings();
  394|       |		EVP_cleanup();
  395|       |#endif
  396|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  397|       |		flags |= WINPR_SSL_CLEANUP_THREAD;
  398|       |#endif
  399|      0|	}
  400|       |
  401|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  402|       |
  403|       |	if (flags & WINPR_SSL_CLEANUP_THREAD)
  404|       |	{
  405|       |#if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER)
  406|       |		ERR_remove_state(0);
  407|       |#else
  408|       |		ERR_remove_thread_state(nullptr);
  409|       |#endif
  410|       |	}
  411|       |
  412|       |#endif
  413|       |#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  414|       |	OSSL_LIB_CTX* ctx = OSSL_LIB_CTX_get0_global_default();
  415|       |	if (ctx)
  416|       |		OSSL_PROVIDER_do_all(ctx, unload, nullptr);
  417|       |#endif
  418|       |
  419|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  420|      1|}
ssl.c:winpr_openssl_initialize:
  292|      1|{
  293|      1|	DWORD flags = param ? *(PDWORD)param : WINPR_SSL_INIT_DEFAULT;
  ------------------
  |  |   27|      0|#define WINPR_SSL_INIT_DEFAULT 0x00
  ------------------
  |  Branch (293:16): [True: 1, False: 0]
  ------------------
  294|       |
  295|      1|	if (flags & WINPR_SSL_INIT_ALREADY_INITIALIZED)
  ------------------
  |  |   28|      1|#define WINPR_SSL_INIT_ALREADY_INITIALIZED 0x01
  ------------------
  |  Branch (295:6): [True: 0, False: 1]
  ------------------
  296|      0|	{
  297|      0|		return TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
  298|      0|	}
  299|       |
  300|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  301|       |
  302|       |	if (flags & WINPR_SSL_INIT_ENABLE_LOCKING)
  303|       |	{
  304|       |		if (!_winpr_openssl_initialize_locking())
  305|       |		{
  306|       |			return FALSE;
  307|       |		}
  308|       |	}
  309|       |
  310|       |#endif
  311|       |	/* SSL_load_error_strings() is void */
  312|       |#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
  313|       |	SSL_load_error_strings();
  314|       |	/* SSL_library_init() always returns "1" */
  315|       |	SSL_library_init();
  316|       |	OpenSSL_add_all_digests();
  317|       |	OpenSSL_add_all_ciphers();
  318|       |#else
  319|       |
  320|      1|	if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS |
  ------------------
  |  Branch (320:6): [True: 0, False: 1]
  ------------------
  321|      1|	                         OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS |
  322|      1|	                         OPENSSL_INIT_ENGINE_ALL_BUILTIN,
  323|      1|	                     nullptr) != 1)
  324|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  325|       |
  326|      1|#endif
  327|       |
  328|       |#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  329|       |	/* The legacy provider is needed for MD4. */
  330|       |	s_winpr_openssl_provider_legacy = OSSL_PROVIDER_load(nullptr, "legacy");
  331|       |	if (s_winpr_openssl_provider_legacy == nullptr)
  332|       |	{
  333|       |		WLog_WARN(TAG, "OpenSSL LEGACY provider failed to load, no md4 support available!");
  334|       |	}
  335|       |	s_winpr_openssl_provider_default = OSSL_PROVIDER_load(nullptr, "default");
  336|       |	if (s_winpr_openssl_provider_default == nullptr)
  337|       |	{
  338|       |		WLog_WARN(TAG, "OpenSSL DEFAULT provider failed to load");
  339|       |	}
  340|       |#endif
  341|       |
  342|      1|	(void)winpr_atexit(winpr_openssl_cleanup);
  343|      1|	g_winpr_openssl_initialized_by_winpr = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  344|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  345|      1|}
ssl.c:winpr_openssl_cleanup:
  286|      1|{
  287|      1|	winpr_CleanupSSL(WINPR_SSL_INIT_DEFAULT);
  ------------------
  |  |   27|      1|#define WINPR_SSL_INIT_DEFAULT 0x00
  ------------------
  288|      1|}
ssl.c:winpr_enable_fips:
  246|  2.13k|{
  247|  2.13k|	if (flags & WINPR_SSL_INIT_ENABLE_FIPS)
  ------------------
  |  |   30|  2.13k|#define WINPR_SSL_INIT_ENABLE_FIPS 0x4
  ------------------
  |  Branch (247:6): [True: 0, False: 2.13k]
  ------------------
  248|      0|	{
  249|       |#if (OPENSSL_VERSION_NUMBER < 0x10001000L) || defined(LIBRESSL_VERSION_NUMBER)
  250|       |		WLog_ERR(TAG, "Openssl fips mode not available on openssl versions less than 1.0.1!");
  251|       |		return FALSE;
  252|       |#else
  253|      0|		WLog_DBG(TAG, "Ensuring openssl fips mode is enabled");
  ------------------
  |  |  342|      0|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  254|       |
  255|       |#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  256|       |		s_winpr_openssl_provider_fips = OSSL_PROVIDER_load(nullptr, "fips");
  257|       |		if (s_winpr_openssl_provider_fips == nullptr)
  258|       |		{
  259|       |			WLog_WARN(TAG, "OpenSSL FIPS provider failed to load");
  260|       |		}
  261|       |		if (!EVP_default_properties_is_fips_enabled(nullptr))
  262|       |#else
  263|      0|		if (FIPS_mode() != 1)
  ------------------
  |  Branch (263:7): [True: 0, False: 0]
  ------------------
  264|      0|#endif
  265|      0|		{
  266|       |#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  267|       |			if (EVP_set_default_properties(nullptr, "fips=yes"))
  268|       |#else
  269|      0|			if (FIPS_mode_set(1))
  ------------------
  |  Branch (269:8): [True: 0, False: 0]
  ------------------
  270|      0|#endif
  271|      0|				WLog_INFO(TAG, "Openssl fips mode enabled!");
  ------------------
  |  |  344|      0|	WLog_Print_dbg_tag(tag, WLOG_INFO, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  272|      0|			else
  273|      0|			{
  274|      0|				WLog_ERR(TAG, "Openssl fips mode enable failed!");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  275|      0|				return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  276|      0|			}
  277|      0|		}
  278|       |
  279|      0|#endif
  280|      0|	}
  281|       |
  282|  2.13k|	return TRUE;
  ------------------
  |  |  126|  2.13k|#define TRUE true
  ------------------
  283|  2.13k|}

WLog_Appender_Free:
   25|      1|{
   26|      1|	if (!appender)
  ------------------
  |  Branch (26:6): [True: 0, False: 1]
  ------------------
   27|      0|		return;
   28|       |
   29|      1|	if (appender->Layout)
  ------------------
  |  Branch (29:6): [True: 1, False: 0]
  ------------------
   30|      1|	{
   31|      1|		WLog_Layout_Free(log, appender->Layout);
   32|      1|		appender->Layout = nullptr;
   33|      1|	}
   34|       |
   35|      1|	DeleteCriticalSection(&appender->lock);
   36|      1|	appender->Free(appender);
   37|      1|}
WLog_GetLogAppender:
   40|   185k|{
   41|   185k|	if (!log)
  ------------------
  |  Branch (41:6): [True: 0, False: 185k]
  ------------------
   42|      0|		return nullptr;
   43|       |
   44|   185k|	if (!log->Appender)
  ------------------
  |  Branch (44:6): [True: 92.5k, False: 92.5k]
  ------------------
   45|  92.5k|		return WLog_GetLogAppender(log->Parent);
   46|       |
   47|  92.5k|	return log->Appender;
   48|   185k|}
WLog_OpenAppender:
   51|      1|{
   52|      1|	int status = 0;
   53|      1|	wLogAppender* appender = nullptr;
   54|       |
   55|      1|	appender = WLog_GetLogAppender(log);
   56|       |
   57|      1|	if (!appender)
  ------------------
  |  Branch (57:6): [True: 0, False: 1]
  ------------------
   58|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   59|       |
   60|      1|	if (!appender->Open)
  ------------------
  |  Branch (60:6): [True: 0, False: 1]
  ------------------
   61|      0|		return TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
   62|       |
   63|      1|	if (!appender->active)
  ------------------
  |  Branch (63:6): [True: 1, False: 0]
  ------------------
   64|      1|	{
   65|      1|		status = appender->Open(log, appender);
   66|      1|		appender->active = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
   67|      1|	}
   68|       |
   69|      1|	return status;
   70|      1|}
WLog_SetLogAppenderType:
  157|      1|{
  158|      1|	if (!log)
  ------------------
  |  Branch (158:6): [True: 0, False: 1]
  ------------------
  159|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  160|       |
  161|      1|	if (log->Appender)
  ------------------
  |  Branch (161:6): [True: 0, False: 1]
  ------------------
  162|      0|	{
  163|      0|		WLog_Appender_Free(log, log->Appender);
  164|      0|		log->Appender = nullptr;
  165|      0|	}
  166|       |
  167|      1|	log->Appender = WLog_Appender_New(log, logAppenderType);
  168|      1|	return log->Appender != nullptr;
  169|      1|}
Appender.c:WLog_Appender_New:
   95|      1|{
   96|      1|	wLogAppender* appender = nullptr;
   97|       |
   98|      1|	if (!log)
  ------------------
  |  Branch (98:6): [True: 0, False: 1]
  ------------------
   99|      0|		return nullptr;
  100|       |
  101|      1|	switch (logAppenderType)
  102|      1|	{
  103|      1|		case WLOG_APPENDER_CONSOLE:
  ------------------
  |  Branch (103:3): [True: 1, False: 0]
  ------------------
  104|      1|			appender = WLog_ConsoleAppender_New(log);
  105|      1|			break;
  106|      0|		case WLOG_APPENDER_FILE:
  ------------------
  |  Branch (106:3): [True: 0, False: 1]
  ------------------
  107|      0|			appender = WLog_FileAppender_New(log);
  108|      0|			break;
  109|      0|		case WLOG_APPENDER_BINARY:
  ------------------
  |  Branch (109:3): [True: 0, False: 1]
  ------------------
  110|      0|			appender = WLog_BinaryAppender_New(log);
  111|      0|			break;
  112|      0|		case WLOG_APPENDER_CALLBACK:
  ------------------
  |  Branch (112:3): [True: 0, False: 1]
  ------------------
  113|      0|			appender = WLog_CallbackAppender_New(log);
  114|      0|			break;
  115|      0|#ifdef WINPR_HAVE_SYSLOG_H
  116|      0|		case WLOG_APPENDER_SYSLOG:
  ------------------
  |  Branch (116:3): [True: 0, False: 1]
  ------------------
  117|      0|			appender = WLog_SyslogAppender_New(log);
  118|      0|			break;
  119|      0|#endif
  120|       |#ifdef WINPR_HAVE_JOURNALD_H
  121|       |		case WLOG_APPENDER_JOURNALD:
  122|       |			appender = WLog_JournaldAppender_New(log);
  123|       |			break;
  124|       |#endif
  125|      0|		case WLOG_APPENDER_UDP:
  ------------------
  |  Branch (125:3): [True: 0, False: 1]
  ------------------
  126|      0|			appender = WLog_UdpAppender_New(log);
  127|      0|			break;
  128|      0|		default:
  ------------------
  |  Branch (128:3): [True: 0, False: 1]
  ------------------
  129|      0|			(void)fprintf(stderr, "%s: unknown handler type %" PRIu32 "\n", __func__,
  130|      0|			              logAppenderType);
  131|      0|			appender = nullptr;
  132|      0|			break;
  133|      1|	}
  134|       |
  135|      1|	if (!appender)
  ------------------
  |  Branch (135:6): [True: 0, False: 1]
  ------------------
  136|      0|		appender = WLog_ConsoleAppender_New(log);
  137|       |
  138|      1|	if (!appender)
  ------------------
  |  Branch (138:6): [True: 0, False: 1]
  ------------------
  139|      0|		return nullptr;
  140|       |
  141|      1|	if (!(appender->Layout = WLog_Layout_New(log)))
  ------------------
  |  Branch (141:6): [True: 0, False: 1]
  ------------------
  142|      0|	{
  143|      0|		WLog_Appender_Free(log, appender);
  144|      0|		return nullptr;
  145|      0|	}
  146|       |
  147|      1|	if (!InitializeCriticalSectionAndSpinCount(&appender->lock, 4000))
  ------------------
  |  Branch (147:6): [True: 0, False: 1]
  ------------------
  148|      0|	{
  149|      0|		WLog_Appender_Free(log, appender);
  150|      0|		return nullptr;
  151|      0|	}
  152|       |
  153|      1|	return appender;
  154|      1|}

WLog_ConsoleAppender_New:
  251|      1|{
  252|      1|	wLogConsoleAppender* ConsoleAppender =
  253|      1|	    (wLogConsoleAppender*)calloc(1, sizeof(wLogConsoleAppender));
  254|       |
  255|      1|	if (!ConsoleAppender)
  ------------------
  |  Branch (255:6): [True: 0, False: 1]
  ------------------
  256|      0|		return nullptr;
  257|       |
  258|      1|	ConsoleAppender->common.Type = WLOG_APPENDER_CONSOLE;
  259|      1|	ConsoleAppender->common.Open = WLog_ConsoleAppender_Open;
  260|      1|	ConsoleAppender->common.Close = WLog_ConsoleAppender_Close;
  261|      1|	ConsoleAppender->common.WriteMessage = WLog_ConsoleAppender_WriteMessage;
  262|      1|	ConsoleAppender->common.WriteDataMessage = WLog_ConsoleAppender_WriteDataMessage;
  263|      1|	ConsoleAppender->common.WriteImageMessage = WLog_ConsoleAppender_WriteImageMessage;
  264|      1|	ConsoleAppender->common.WritePacketMessage = WLog_ConsoleAppender_WritePacketMessage;
  265|      1|	ConsoleAppender->common.Set = WLog_ConsoleAppender_Set;
  266|      1|	ConsoleAppender->common.Free = WLog_ConsoleAppender_Free;
  267|       |
  268|      1|	ConsoleAppender->outputStream = WLOG_CONSOLE_DEFAULT;
  ------------------
  |  |   29|      1|#define WLOG_CONSOLE_DEFAULT 0
  ------------------
  269|       |
  270|       |#ifdef _WIN32
  271|       |	if (IsDebuggerPresent())
  272|       |		ConsoleAppender->outputStream = WLOG_CONSOLE_DEBUG;
  273|       |#endif
  274|       |
  275|      1|	return &ConsoleAppender->common;
  276|      1|}
ConsoleAppender.c:WLog_ConsoleAppender_Open:
   43|      1|{
   44|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
   45|      1|}
ConsoleAppender.c:WLog_ConsoleAppender_WriteMessage:
   55|  92.5k|{
   56|  92.5k|	if (!appender)
  ------------------
  |  Branch (56:6): [True: 0, False: 92.5k]
  ------------------
   57|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   58|       |
   59|  92.5k|	wLogConsoleAppender* consoleAppender = (wLogConsoleAppender*)appender;
   60|       |
   61|  92.5k|	char prefix[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
   62|  92.5k|	WLog_Layout_GetMessagePrefix(log, appender->Layout, cmessage, prefix, sizeof(prefix));
   63|       |
   64|       |#ifdef _WIN32
   65|       |	if (consoleAppender->outputStream == WLOG_CONSOLE_DEBUG)
   66|       |	{
   67|       |		OutputDebugStringA(prefix);
   68|       |		OutputDebugStringA(cmessage->TextString);
   69|       |		OutputDebugStringA("\n");
   70|       |
   71|       |		return TRUE;
   72|       |	}
   73|       |#endif
   74|       |#ifdef ANDROID
   75|       |	android_LogPriority level;
   76|       |	switch (cmessage->Level)
   77|       |	{
   78|       |		case WLOG_TRACE:
   79|       |			level = ANDROID_LOG_VERBOSE;
   80|       |			break;
   81|       |		case WLOG_DEBUG:
   82|       |			level = ANDROID_LOG_DEBUG;
   83|       |			break;
   84|       |		case WLOG_INFO:
   85|       |			level = ANDROID_LOG_INFO;
   86|       |			break;
   87|       |		case WLOG_WARN:
   88|       |			level = ANDROID_LOG_WARN;
   89|       |			break;
   90|       |		case WLOG_ERROR:
   91|       |			level = ANDROID_LOG_ERROR;
   92|       |			break;
   93|       |		case WLOG_FATAL:
   94|       |			level = ANDROID_LOG_FATAL;
   95|       |			break;
   96|       |		case WLOG_OFF:
   97|       |			level = ANDROID_LOG_SILENT;
   98|       |			break;
   99|       |		default:
  100|       |			level = ANDROID_LOG_FATAL;
  101|       |			break;
  102|       |	}
  103|       |
  104|       |	if (level != ANDROID_LOG_SILENT)
  105|       |		__android_log_print(level, log->Name, "%s%s", prefix, cmessage->TextString);
  106|       |
  107|       |#else
  108|  92.5k|	FILE* fp = nullptr;
  109|  92.5k|	switch (consoleAppender->outputStream)
  110|  92.5k|	{
  111|      0|		case WLOG_CONSOLE_STDOUT:
  ------------------
  |  |   30|      0|#define WLOG_CONSOLE_STDOUT 1
  ------------------
  |  Branch (111:3): [True: 0, False: 92.5k]
  ------------------
  112|      0|			fp = stdout;
  113|      0|			break;
  114|      0|		case WLOG_CONSOLE_STDERR:
  ------------------
  |  |   31|      0|#define WLOG_CONSOLE_STDERR 2
  ------------------
  |  Branch (114:3): [True: 0, False: 92.5k]
  ------------------
  115|      0|			fp = stderr;
  116|      0|			break;
  117|  92.5k|		default:
  ------------------
  |  Branch (117:3): [True: 92.5k, False: 0]
  ------------------
  118|  92.5k|			switch (cmessage->Level)
  119|  92.5k|			{
  120|      0|				case WLOG_TRACE:
  ------------------
  |  Branch (120:5): [True: 0, False: 92.5k]
  ------------------
  121|      0|				case WLOG_DEBUG:
  ------------------
  |  Branch (121:5): [True: 0, False: 92.5k]
  ------------------
  122|      0|				case WLOG_INFO:
  ------------------
  |  Branch (122:5): [True: 0, False: 92.5k]
  ------------------
  123|      0|					fp = stdout;
  124|      0|					break;
  125|  92.5k|				default:
  ------------------
  |  Branch (125:5): [True: 92.5k, False: 0]
  ------------------
  126|  92.5k|					fp = stderr;
  127|  92.5k|					break;
  128|  92.5k|			}
  129|  92.5k|			break;
  130|  92.5k|	}
  131|       |
  132|  92.5k|	if (cmessage->Level != WLOG_OFF)
  ------------------
  |  Branch (132:6): [True: 92.5k, False: 0]
  ------------------
  133|  92.5k|		(void)fprintf(fp, "%s%s\n", prefix, cmessage->TextString);
  134|  92.5k|#endif
  135|  92.5k|	return TRUE;
  ------------------
  |  |  126|  92.5k|#define TRUE true
  ------------------
  136|  92.5k|}
ConsoleAppender.c:WLog_ConsoleAppender_Free:
  238|      1|{
  239|      1|	if (appender)
  ------------------
  |  Branch (239:6): [True: 1, False: 0]
  ------------------
  240|      1|	{
  241|      1|		if (appender->PacketMessageContext)
  ------------------
  |  Branch (241:7): [True: 0, False: 1]
  ------------------
  242|      0|		{
  243|      0|			Pcap_Close((wPcap*)appender->PacketMessageContext);
  244|      0|		}
  245|       |
  246|      1|		free(appender);
  247|      1|	}
  248|      1|}

WLog_Layout_GetMessagePrefix:
  246|  92.5k|{
  247|  92.5k|	char format[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  248|       |
  249|  92.5k|	WINPR_ASSERT(layout);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|  92.5k|	WINPR_ASSERT(message);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  92.5k|	WINPR_ASSERT(prefix);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|       |
  253|  92.5k|	struct format_tid_arg targ = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  254|       |
  255|  92.5k|	SYSTEMTIME localTime = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  256|  92.5k|	GetLocalTime(&localTime);
  257|       |
  258|  92.5k|	struct format_option_recurse recurse = {
  259|  92.5k|		.options = nullptr, .nroptions = 0, .log = log, .layout = layout, .message = message
  260|  92.5k|	};
  261|       |
  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  263|  92.5k|	struct format_option options[] = {
  264|  92.5k|		{ ENTRY("%ctx"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  265|  92.5k|		  ENTRY("%s"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  266|  92.5k|		  log->custom,
  267|  92.5k|		  { .pv = log->context },
  268|  92.5k|		  nullptr,
  269|  92.5k|		  &recurse }, /* log context */
  270|  92.5k|		{ ENTRY("%dw"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  271|  92.5k|		  ENTRY("%u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  272|  92.5k|		  nullptr,
  273|  92.5k|		  { .s = localTime.wDayOfWeek },
  274|  92.5k|		  nullptr,
  275|  92.5k|		  &recurse }, /* day of week */
  276|  92.5k|		{ ENTRY("%dy"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  277|  92.5k|		  ENTRY("%u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  278|  92.5k|		  nullptr,
  279|  92.5k|		  { .s = localTime.wDay },
  280|  92.5k|		  nullptr,
  281|  92.5k|		  &recurse }, /* day of year
  282|       |		               */
  283|  92.5k|		{ ENTRY("%fl"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  284|  92.5k|		  ENTRY("%s"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  285|  92.5k|		  nullptr,
  286|  92.5k|		  { .cpv = message->FileName },
  287|  92.5k|		  nullptr,
  288|  92.5k|		  &recurse }, /* file
  289|       |		               */
  290|  92.5k|		{ ENTRY("%fn"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  291|  92.5k|		  ENTRY("%s"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  292|  92.5k|		  nullptr,
  293|  92.5k|		  { .cpv = message->FunctionName },
  294|  92.5k|		  nullptr,
  295|  92.5k|		  &recurse }, /* function
  296|       |		               */
  297|  92.5k|		{ ENTRY("%hr"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  298|  92.5k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  299|  92.5k|		  nullptr,
  300|  92.5k|		  { .s = localTime.wHour },
  301|  92.5k|		  nullptr,
  302|  92.5k|		  &recurse }, /* hours
  303|       |		               */
  304|  92.5k|		{ ENTRY("%ln"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  305|  92.5k|		  ENTRY("%" PRIuz),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  306|  92.5k|		  nullptr,
  307|  92.5k|		  { .s = message->LineNumber },
  308|  92.5k|		  nullptr,
  309|  92.5k|		  &recurse }, /* line number */
  310|  92.5k|		{ ENTRY("%lv"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  311|  92.5k|		  ENTRY("%s"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  312|  92.5k|		  nullptr,
  313|  92.5k|		  { .cpv = WLOG_LEVELS[message->Level] },
  314|  92.5k|		  nullptr,
  315|  92.5k|		  &recurse }, /* log level */
  316|  92.5k|		{ ENTRY("%mi"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  317|  92.5k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  318|  92.5k|		  nullptr,
  319|  92.5k|		  { .s = localTime.wMinute },
  320|  92.5k|		  nullptr,
  321|  92.5k|		  &recurse }, /* minutes
  322|       |		               */
  323|  92.5k|		{ ENTRY("%ml"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  324|  92.5k|		  ENTRY("%03u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  325|  92.5k|		  nullptr,
  326|  92.5k|		  { .s = localTime.wMilliseconds },
  327|  92.5k|		  nullptr,
  328|  92.5k|		  &recurse }, /* milliseconds */
  329|  92.5k|		{ ENTRY("%mn"), ENTRY("%s"), nullptr, { .cpv = log->Name }, nullptr, &recurse }, /* module
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%mn"), ENTRY("%s"), nullptr, { .cpv = log->Name }, nullptr, &recurse }, /* module
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  330|       |		                                                                                    name */
  331|  92.5k|		{ ENTRY("%mo"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  332|  92.5k|		  ENTRY("%u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  333|  92.5k|		  nullptr,
  334|  92.5k|		  { .s = localTime.wMonth },
  335|  92.5k|		  nullptr,
  336|  92.5k|		  &recurse }, /* month
  337|       |		               */
  338|  92.5k|		{ ENTRY("%pid"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  339|  92.5k|		  ENTRY("%u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  340|  92.5k|		  nullptr,
  341|  92.5k|		  { .s = GetCurrentProcessId() },
  342|  92.5k|		  nullptr,
  343|  92.5k|		  &recurse }, /* process id */
  344|  92.5k|		{ ENTRY("%se"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  345|  92.5k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  346|  92.5k|		  nullptr,
  347|  92.5k|		  { .s = localTime.wSecond },
  348|  92.5k|		  nullptr,
  349|  92.5k|		  &recurse },                                                                /* seconds
  350|       |		                                                                              */
  351|  92.5k|		{ ENTRY("%tid"), ENTRY("%s"), get_tid, { .pv = &targ }, nullptr, &recurse }, /* thread id */
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%tid"), ENTRY("%s"), get_tid, { .pv = &targ }, nullptr, &recurse }, /* thread id */
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  352|  92.5k|		{ ENTRY("%yr"), ENTRY("%u"), nullptr, { .s = localTime.wYear }, nullptr, &recurse }, /* year
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%yr"), ENTRY("%u"), nullptr, { .s = localTime.wYear }, nullptr, &recurse }, /* year
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  353|       |		                                                                                      */
  354|  92.5k|		{ ENTRY("%{"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  355|  92.5k|		  ENTRY("%}"),
  ------------------
  |  |  262|  92.5k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  356|  92.5k|		  nullptr,
  357|  92.5k|		  { .pv = log->context },
  358|  92.5k|		  skip_if_null,
  359|  92.5k|		  &recurse }, /* skip if no context */
  360|  92.5k|	};
  361|       |
  362|  92.5k|	recurse.options = options;
  363|  92.5k|	recurse.nroptions = ARRAYSIZE(options);
  ------------------
  |  |  966|  92.5k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  962|  92.5k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  961|  92.5k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|       |
  365|  92.5k|	if (!replace_format_string(layout->FormatString, &recurse, format, ARRAYSIZE(format)))
  ------------------
  |  |  966|  92.5k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  962|  92.5k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  961|  92.5k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (365:6): [True: 0, False: 92.5k]
  ------------------
  366|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  367|       |
  368|  92.5k|	WINPR_PRAGMA_DIAG_PUSH
  369|  92.5k|	WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY
  370|       |
  371|  92.5k|	WLog_PrintMessagePrefix(prefix, prefixlen, format);
  372|       |
  373|  92.5k|	WINPR_PRAGMA_DIAG_POP
  374|       |
  375|  92.5k|	return TRUE;
  ------------------
  |  |  126|  92.5k|#define TRUE true
  ------------------
  376|  92.5k|}
WLog_Layout_New:
  403|      1|{
  404|      1|	LPCSTR prefix = "WLOG_PREFIX";
  405|      1|	DWORD nSize = 0;
  406|      1|	char* env = nullptr;
  407|      1|	wLogLayout* layout = nullptr;
  408|      1|	layout = (wLogLayout*)calloc(1, sizeof(wLogLayout));
  409|       |
  410|      1|	if (!layout)
  ------------------
  |  Branch (410:6): [True: 0, False: 1]
  ------------------
  411|      0|		return nullptr;
  412|       |
  413|      1|	nSize = GetEnvironmentVariableA(prefix, nullptr, 0);
  414|       |
  415|      1|	if (nSize)
  ------------------
  |  Branch (415:6): [True: 0, False: 1]
  ------------------
  416|      0|	{
  417|      0|		env = (LPSTR)malloc(nSize);
  418|       |
  419|      0|		if (!env)
  ------------------
  |  Branch (419:7): [True: 0, False: 0]
  ------------------
  420|      0|		{
  421|      0|			free(layout);
  422|      0|			return nullptr;
  423|      0|		}
  424|       |
  425|      0|		if (GetEnvironmentVariableA(prefix, env, nSize) != nSize - 1)
  ------------------
  |  Branch (425:7): [True: 0, False: 0]
  ------------------
  426|      0|		{
  427|      0|			free(env);
  428|      0|			free(layout);
  429|      0|			return nullptr;
  430|      0|		}
  431|      0|	}
  432|       |
  433|      1|	if (env)
  ------------------
  |  Branch (433:6): [True: 0, False: 1]
  ------------------
  434|      0|		layout->FormatString = env;
  435|      1|	else
  436|      1|	{
  437|       |#ifdef ANDROID
  438|       |		layout->FormatString = _strdup("[pid=%pid:tid=%tid] - [%fn]%{[%ctx]%}: ");
  439|       |#else
  440|      1|		layout->FormatString =
  441|      1|		    _strdup("[%hr:%mi:%se:%ml] [%pid:%tid] [%lv][%mn] - [%fn]%{[%ctx]%}: ");
  442|      1|#endif
  443|       |
  444|      1|		if (!layout->FormatString)
  ------------------
  |  Branch (444:7): [True: 0, False: 1]
  ------------------
  445|      0|		{
  446|      0|			free(layout);
  447|      0|			return nullptr;
  448|      0|		}
  449|      1|	}
  450|       |
  451|      1|	return layout;
  452|      1|}
WLog_Layout_Free:
  455|      1|{
  456|      1|	if (layout)
  ------------------
  |  Branch (456:6): [True: 1, False: 0]
  ------------------
  457|      1|	{
  458|      1|		if (layout->FormatString)
  ------------------
  |  Branch (458:7): [True: 1, False: 0]
  ------------------
  459|      1|		{
  460|      1|			free(layout->FormatString);
  461|      1|			layout->FormatString = nullptr;
  462|      1|		}
  463|       |
  464|      1|		free(layout);
  465|      1|	}
  466|      1|}
Layout.c:get_tid:
  101|  92.5k|{
  102|  92.5k|	struct format_tid_arg* targ = arg;
  103|  92.5k|	WINPR_ASSERT(targ);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|       |
  105|  92.5k|	size_t tid = 0;
  106|  92.5k|#if defined __linux__ && !defined ANDROID
  107|       |	/* On Linux we prefer to see the LWP id */
  108|  92.5k|	tid = (size_t)syscall(SYS_gettid);
  109|       |#else
  110|       |	tid = (size_t)GetCurrentThreadId();
  111|       |#endif
  112|  92.5k|	(void)_snprintf(targ->tid, sizeof(targ->tid), "%08" PRIxz, tid);
  ------------------
  |  |  251|  92.5k|#define _snprintf snprintf
  ------------------
              	(void)_snprintf(targ->tid, sizeof(targ->tid), "%08" PRIxz, tid);
  ------------------
  |  |  487|  92.5k|#define PRIxz "zx"
  ------------------
  113|  92.5k|	return targ->tid;
  114|  92.5k|}
Layout.c:skip_if_null:
  150|  92.5k|{
  151|  92.5k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  92.5k|	WINPR_ASSERT(fmt);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  92.5k|	WINPR_ASSERT(preplacelen);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|  92.5k|	WINPR_ASSERT(pskiplen);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|       |
  156|  92.5k|	*preplacelen = 0;
  157|  92.5k|	*pskiplen = 0;
  158|       |
  159|  92.5k|	const char* str = &fmt[opt->fmtlen]; /* Skip first %{ from string */
  160|  92.5k|	const char* end = strstr(str, opt->replace);
  161|  92.5k|	if (!end)
  ------------------
  |  Branch (161:6): [True: 0, False: 92.5k]
  ------------------
  162|      0|		return nullptr;
  163|  92.5k|	*pskiplen = WINPR_ASSERTING_INT_CAST(size_t, end - fmt) + opt->replacelen;
  ------------------
  |  |  112|  92.5k|	__extension__({                                                                             \
  |  |  113|  92.5k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|  92.5k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  92.5k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|  92.5k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   277k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  92.5k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|  92.5k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|  92.5k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|  92.5k|	})
  ------------------
  164|       |
  165|  92.5k|	if (!opt->arg.cpv)
  ------------------
  |  Branch (165:6): [True: 92.5k, False: 0]
  ------------------
  166|  92.5k|		return nullptr;
  167|       |
  168|      0|	const size_t replacelen = WINPR_ASSERTING_INT_CAST(size_t, end - str);
  ------------------
  |  |  112|      0|	__extension__({                                                                             \
  |  |  113|      0|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|      0|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|      0|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|	do                                                                                             \
  |  |  |  |  |  |   61|      0|	{                                                                                              \
  |  |  |  |  |  |   62|      0|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|      0|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|      0|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|      0|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|      0|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|      0|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|      0|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|      0|                                                                                                   \
  |  |  |  |  |  |   70|      0|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|      0|	do                                                      \
  |  |  |  |  |  |  |  |   32|      0|	{                                                       \
  |  |  |  |  |  |  |  |   33|      0|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|      0|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|      0|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|                                                                                                   \
  |  |  |  |  |  |   72|      0|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|      0|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|      0|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|      0|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|      0|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|      0|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|      0|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|	do                                                                                             \
  |  |  |  |  |  |   61|      0|	{                                                                                              \
  |  |  |  |  |  |   62|      0|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|      0|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|      0|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|      0|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|      0|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|      0|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|      0|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|      0|                                                                                                   \
  |  |  |  |  |  |   70|      0|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|      0|	do                                                      \
  |  |  |  |  |  |  |  |   32|      0|	{                                                       \
  |  |  |  |  |  |  |  |   33|      0|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|      0|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|      0|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|                                                                                                   \
  |  |  |  |  |  |   72|      0|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|      0|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|      0|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|      0|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|      0|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|      0|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|      0|	})
  ------------------
  169|       |
  170|      0|	char buffer[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|      0|	{                      \
  |  |   85|      0|	} /** @since version 3.24.0 */
  ------------------
  171|      0|	memcpy(buffer, str, MIN(replacelen, ARRAYSIZE(buffer) - 1));
  ------------------
  |  |   42|      0|#define MIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (42:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  172|       |
  173|      0|	if (!replace_format_string(buffer, opt->recurse, opt->recurse->buffer,
  ------------------
  |  Branch (173:6): [True: 0, False: 0]
  ------------------
  174|      0|	                           ARRAYSIZE(opt->recurse->buffer)))
  ------------------
  |  |  966|      0|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  962|      0|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  961|      0|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|      0|		return nullptr;
  176|       |
  177|      0|	*preplacelen = strnlen(opt->recurse->buffer, ARRAYSIZE(opt->recurse->buffer));
  ------------------
  |  |  966|      0|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  962|      0|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  961|      0|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|      0|	return opt->recurse->buffer;
  179|      0|}
Layout.c:replace_format_string:
  183|  92.5k|{
  184|  92.5k|	WINPR_ASSERT(FormatString);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  92.5k|	WINPR_ASSERT(recurse);
  ------------------
  |  |   76|  92.5k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  92.5k|	do                                                                                             \
  |  |  |  |   61|  92.5k|	{                                                                                              \
  |  |  |  |   62|  92.5k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  92.5k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  92.5k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  92.5k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  92.5k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  92.5k|                                                                                                   \
  |  |  |  |   70|  92.5k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  92.5k|	do                                                      \
  |  |  |  |  |  |   32|  92.5k|	{                                                       \
  |  |  |  |  |  |   33|  92.5k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  92.5k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  92.5k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  92.5k|                                                                                                   \
  |  |  |  |   72|  92.5k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  92.5k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  92.5k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  92.5k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 92.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  186|       |
  187|  92.5k|	size_t index = 0;
  188|  92.5k|	const char* prefix = WLog_GetGlobalPrefix();
  189|  92.5k|	if (prefix)
  ------------------
  |  Branch (189:6): [True: 0, False: 92.5k]
  ------------------
  190|      0|	{
  191|      0|		const int res = _snprintf(format, formatlen, "{%s}", prefix);
  ------------------
  |  |  251|      0|#define _snprintf snprintf
  ------------------
  192|      0|		if (res < 0)
  ------------------
  |  Branch (192:7): [True: 0, False: 0]
  ------------------
  193|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  194|      0|		index = (size_t)res;
  195|      0|	}
  196|       |
  197|  2.96M|	while (*FormatString)
  ------------------
  |  Branch (197:9): [True: 2.86M, False: 92.5k]
  ------------------
  198|  2.86M|	{
  199|  2.86M|		const struct format_option* opt =
  200|  2.86M|		    bsearch(FormatString, recurse->options, recurse->nroptions,
  201|  2.86M|		            sizeof(struct format_option), opt_compare_fn);
  202|  2.86M|		if (opt)
  ------------------
  |  Branch (202:7): [True: 925k, False: 1.94M]
  ------------------
  203|   925k|		{
  204|   925k|			size_t replacelen = opt->replacelen;
  205|   925k|			size_t fmtlen = opt->fmtlen;
  206|   925k|			const char* replace = opt->replace;
  207|   925k|			const void* arg = opt->arg.cpv;
  208|       |
  209|   925k|			if (opt->ext)
  ------------------
  |  Branch (209:8): [True: 92.5k, False: 833k]
  ------------------
  210|  92.5k|				replace = opt->ext(opt, FormatString, &replacelen, &fmtlen);
  211|   925k|			if (opt->fkt)
  ------------------
  |  Branch (211:8): [True: 92.5k, False: 833k]
  ------------------
  212|  92.5k|				arg = opt->fkt(opt->arg.pv);
  213|       |
  214|   925k|			if (replace && (replacelen > 0))
  ------------------
  |  Branch (214:8): [True: 833k, False: 92.5k]
  |  Branch (214:19): [True: 833k, False: 0]
  ------------------
  215|   833k|			{
  216|   833k|				WINPR_PRAGMA_DIAG_PUSH
  217|   833k|				WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL
  218|   833k|				const int rc = _snprintf(&format[index], formatlen - index, replace, arg);
  ------------------
  |  |  251|   833k|#define _snprintf snprintf
  ------------------
  219|   833k|				WINPR_PRAGMA_DIAG_POP
  220|   833k|				if (rc < 0)
  ------------------
  |  Branch (220:9): [True: 0, False: 833k]
  ------------------
  221|      0|					return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  222|   833k|				if (!check_and_log_format_size(format, formatlen, index,
  ------------------
  |  Branch (222:9): [True: 0, False: 833k]
  ------------------
  223|   833k|				                               WINPR_ASSERTING_INT_CAST(size_t, rc)))
  ------------------
  |  |  112|   833k|	__extension__({                                                                             \
  |  |  113|   833k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   833k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   833k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   833k|	do                                                                                             \
  |  |  |  |  |  |   61|   833k|	{                                                                                              \
  |  |  |  |  |  |   62|   833k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   833k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   833k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   833k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   833k|                                                                                                   \
  |  |  |  |  |  |   70|   833k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   833k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   833k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   833k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   833k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   833k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   833k|                                                                                                   \
  |  |  |  |  |  |   72|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   833k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   833k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   833k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 833k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   833k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   833k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   833k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   833k|	do                                                                                             \
  |  |  |  |  |  |   61|   833k|	{                                                                                              \
  |  |  |  |  |  |   62|   833k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   833k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   833k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   833k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   833k|                                                                                                   \
  |  |  |  |  |  |   70|   833k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   833k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   833k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  2.49M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 833k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 833k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   833k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   833k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   833k|                                                                                                   \
  |  |  |  |  |  |   72|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   833k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   833k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   833k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 833k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   833k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   833k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   833k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   833k|	})
  ------------------
  224|      0|					return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  225|   833k|				index += WINPR_ASSERTING_INT_CAST(size_t, rc);
  ------------------
  |  |  112|   833k|	__extension__({                                                                             \
  |  |  113|   833k|		__typeof(ivar) var = ivar;                                                              \
  |  |  114|   833k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   833k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   833k|	do                                                                                             \
  |  |  |  |  |  |   61|   833k|	{                                                                                              \
  |  |  |  |  |  |   62|   833k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   833k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   833k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   833k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   833k|                                                                                                   \
  |  |  |  |  |  |   70|   833k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   833k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   833k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   833k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   833k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   833k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   833k|                                                                                                   \
  |  |  |  |  |  |   72|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   833k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   833k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   833k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 833k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|   833k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  116|   833k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   833k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   833k|	do                                                                                             \
  |  |  |  |  |  |   61|   833k|	{                                                                                              \
  |  |  |  |  |  |   62|   833k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   833k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   833k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   833k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   833k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   833k|                                                                                                   \
  |  |  |  |  |  |   70|   833k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   833k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   833k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  2.49M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 833k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 833k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   833k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   833k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 833k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   833k|                                                                                                   \
  |  |  |  |  |  |   72|   833k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   833k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   833k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   833k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 833k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|   833k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  118|   833k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   33|   833k|#define WINPR_CXX_COMPAT_CAST(t, val) (t)(val)
  |  |  ------------------
  |  |  119|   833k|	})
  ------------------
  226|   833k|			}
  227|   925k|			FormatString += fmtlen;
  228|   925k|		}
  229|  1.94M|		else
  230|  1.94M|		{
  231|       |			/* Unknown format string */
  232|  1.94M|			if (*FormatString == '%')
  ------------------
  |  Branch (232:8): [True: 0, False: 1.94M]
  ------------------
  233|      0|				return log_invalid_fmt(FormatString);
  234|       |
  235|  1.94M|			if (!check_and_log_format_size(format, formatlen, index, 1))
  ------------------
  |  Branch (235:8): [True: 0, False: 1.94M]
  ------------------
  236|      0|				return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  237|  1.94M|			format[index++] = *FormatString++;
  238|  1.94M|		}
  239|  2.86M|	}
  240|       |
  241|  92.5k|	return check_and_log_format_size(format, formatlen, index, 0);
  242|  92.5k|}
Layout.c:opt_compare_fn:
  137|  11.3M|{
  138|  11.3M|	const char* what = a;
  139|  11.3M|	const struct format_option* opt = b;
  140|  11.3M|	if (!opt)
  ------------------
  |  Branch (140:6): [True: 0, False: 11.3M]
  ------------------
  141|      0|		return -1;
  142|  11.3M|	return strncmp(what, opt->fmt, opt->fmtlen);
  143|  11.3M|}
Layout.c:check_and_log_format_size:
  123|  2.86M|{
  124|       |	/* format string must be '\0' terminated, so abort at size - 1 */
  125|  2.86M|	if (index + add + 1 >= size)
  ------------------
  |  Branch (125:6): [True: 0, False: 2.86M]
  ------------------
  126|      0|	{
  127|      0|		(void)fprintf(stderr,
  128|      0|		              "Format string too long ['%s', max %" PRIuz ", used %" PRIuz
  129|      0|		              ", adding %" PRIuz "]\n",
  130|      0|		              format, size, index, add);
  131|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  132|      0|	}
  133|  2.86M|	return TRUE;
  ------------------
  |  |  126|  2.86M|#define TRUE true
  ------------------
  134|  2.86M|}
Layout.c:WLog_PrintMessagePrefix:
   93|  92.5k|{
   94|  92.5k|	va_list args = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
   95|  92.5k|	va_start(args, format);
   96|  92.5k|	WLog_PrintMessagePrefixVA(prefix, prefixlen, format, args);
   97|       |	va_end(args);
   98|  92.5k|}
Layout.c:WLog_PrintMessagePrefixVA:
   86|  92.5k|{
   87|  92.5k|	(void)vsnprintf(prefix, prefixlen, format, args);
   88|  92.5k|}

WLog_PrintTextMessageVA:
  420|  92.5k|{
  421|  92.5k|	wLogMessage message = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  422|  92.5k|	message.Type = WLOG_MESSAGE_TEXT;
  423|  92.5k|	message.Level = level;
  424|  92.5k|	message.LineNumber = line;
  425|  92.5k|	message.FileName = file;
  426|  92.5k|	message.FunctionName = function;
  427|       |
  428|  92.5k|	message.FormatString = fmt;
  429|       |
  430|  92.5k|	return WLog_PrintTextMessageInternal(log, &message, args);
  431|  92.5k|}
WLog_GetLogLevel:
  456|  96.1k|{
  457|  96.1k|	if (!log)
  ------------------
  |  Branch (457:6): [True: 0, False: 96.1k]
  ------------------
  458|      0|		return WLOG_OFF;
  459|       |
  460|  96.1k|	if (log->FilterLevel <= WLOG_FILTER_NOT_INITIALIZED)
  ------------------
  |  |   53|  96.1k|#define WLOG_FILTER_NOT_INITIALIZED (-2)
  ------------------
  |  Branch (460:6): [True: 0, False: 96.1k]
  ------------------
  461|      0|		log->FilterLevel = WLog_GetFilterLogLevel(log);
  462|       |
  463|  96.1k|	if (log->FilterLevel > WLOG_FILTER_NOT_FILTERED)
  ------------------
  |  |   52|  96.1k|#define WLOG_FILTER_NOT_FILTERED (-1)
  ------------------
  |  Branch (463:6): [True: 0, False: 96.1k]
  ------------------
  464|      0|		return (DWORD)log->FilterLevel;
  465|  96.1k|	else if (log->Level == WLOG_LEVEL_INHERIT)
  ------------------
  |  Branch (465:11): [True: 1, False: 96.1k]
  ------------------
  466|      1|		log->Level = WLog_GetLogLevel(log->Parent);
  467|       |
  468|  96.1k|	return log->Level;
  469|  96.1k|}
WLog_IsLevelActive:
  472|  96.1k|{
  473|  96.1k|	DWORD level = 0;
  474|       |
  475|  96.1k|	if (!_log)
  ------------------
  |  Branch (475:6): [True: 0, False: 96.1k]
  ------------------
  476|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  477|       |
  478|  96.1k|	level = WLog_GetLogLevel(_log);
  479|       |
  480|  96.1k|	if (level == WLOG_OFF)
  ------------------
  |  Branch (480:6): [True: 0, False: 96.1k]
  ------------------
  481|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  482|       |
  483|  96.1k|	return _log_level >= level;
  484|  96.1k|}
WLog_GetRoot:
  954|      1|{
  955|      1|	if (!InitOnceExecuteOnce(&g_WLogInitialized, WLog_InitializeRoot, nullptr, nullptr))
  ------------------
  |  |  424|      1|#define InitOnceExecuteOnce winpr_InitOnceExecuteOnce
  ------------------
  |  Branch (955:6): [True: 0, False: 1]
  ------------------
  956|      0|		return nullptr;
  957|       |
  958|      1|	return g_RootLog;
  959|      1|}
WLog_Get:
 1053|      1|{
 1054|      1|	wLog* root = WLog_GetRoot();
 1055|      1|	return WLog_Get_int(root, name);
 1056|      1|}
WLog_GetGlobalPrefix:
 1111|  92.5k|{
 1112|  92.5k|	return g_GlobalPrefix;
 1113|  92.5k|}
wlog.c:WLog_PrintTextMessageInternal:
  354|  92.5k|{
  355|  92.5k|	assert(cmessage);
  ------------------
  |  Branch (355:2): [True: 0, False: 92.5k]
  |  Branch (355:2): [True: 92.5k, False: 0]
  ------------------
  356|       |
  357|  92.5k|	char formattedLogMessage[WLOG_MAX_STRING_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   84|  92.5k|	{                      \
  |  |   85|  92.5k|	} /** @since version 3.24.0 */
  ------------------
  358|  92.5k|	wLogMessage message = *cmessage;
  359|  92.5k|	message.TextString = formattedLogMessage;
  360|       |
  361|  92.5k|	WINPR_PRAGMA_DIAG_PUSH
  362|  92.5k|	WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL
  363|  92.5k|	if (vsnprintf(formattedLogMessage, ARRAYSIZE(formattedLogMessage) - 1, cmessage->FormatString,
  ------------------
  |  |  966|  92.5k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  962|  92.5k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  961|  92.5k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (363:6): [True: 0, False: 92.5k]
  ------------------
  364|  92.5k|	              args) < 0)
  365|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  366|  92.5k|	WINPR_PRAGMA_DIAG_POP
  367|       |
  368|  92.5k|	return WLog_Write(log, &message);
  369|  92.5k|}
wlog.c:WLog_Write:
  232|  92.5k|{
  233|  92.5k|	BOOL status = FALSE;
  ------------------
  |  |  122|  92.5k|#define FALSE false
  ------------------
  234|  92.5k|	wLogAppender* appender = WLog_GetLogAppender(log);
  235|       |
  236|  92.5k|	if (!appender)
  ------------------
  |  Branch (236:6): [True: 0, False: 92.5k]
  ------------------
  237|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  238|       |
  239|  92.5k|	if (!appender->active)
  ------------------
  |  Branch (239:6): [True: 1, False: 92.5k]
  ------------------
  240|      1|		if (!WLog_OpenAppender(log))
  ------------------
  |  Branch (240:7): [True: 0, False: 1]
  ------------------
  241|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  242|       |
  243|  92.5k|	EnterCriticalSection(&appender->lock);
  244|       |
  245|  92.5k|	if (appender->WriteMessage)
  ------------------
  |  Branch (245:6): [True: 92.5k, False: 0]
  ------------------
  246|  92.5k|	{
  247|  92.5k|		if (appender->recursive)
  ------------------
  |  Branch (247:7): [True: 0, False: 92.5k]
  ------------------
  248|      0|			status = log_recursion(message->FileName, message->FunctionName, message->LineNumber);
  249|  92.5k|		else
  250|  92.5k|		{
  251|  92.5k|			appender->recursive = TRUE;
  ------------------
  |  |  126|  92.5k|#define TRUE true
  ------------------
  252|  92.5k|			status = appender->WriteMessage(log, appender, message);
  253|  92.5k|			appender->recursive = FALSE;
  ------------------
  |  |  122|  92.5k|#define FALSE false
  ------------------
  254|  92.5k|		}
  255|  92.5k|	}
  256|       |
  257|  92.5k|	LeaveCriticalSection(&appender->lock);
  258|  92.5k|	return status;
  259|  92.5k|}
wlog.c:WLog_GetFilterLogLevel:
  767|      2|{
  768|      2|	BOOL match = FALSE;
  ------------------
  |  |  122|      2|#define FALSE false
  ------------------
  769|       |
  770|      2|	if (log->FilterLevel >= 0)
  ------------------
  |  Branch (770:6): [True: 0, False: 2]
  ------------------
  771|      0|		return log->FilterLevel;
  772|       |
  773|      2|	log->FilterLevel = WLOG_FILTER_NOT_FILTERED;
  ------------------
  |  |   52|      2|#define WLOG_FILTER_NOT_FILTERED (-1)
  ------------------
  774|      2|	for (DWORD i = 0; i < g_FilterCount; i++)
  ------------------
  |  Branch (774:20): [True: 0, False: 2]
  ------------------
  775|      0|	{
  776|      0|		const wLogFilter* filter = &g_Filters[i];
  777|      0|		for (DWORD j = 0; j < filter->NameCount; j++)
  ------------------
  |  Branch (777:21): [True: 0, False: 0]
  ------------------
  778|      0|		{
  779|      0|			if (j >= log->NameCount)
  ------------------
  |  Branch (779:8): [True: 0, False: 0]
  ------------------
  780|      0|				break;
  781|       |
  782|      0|			if (_stricmp(filter->Names[j], "*") == 0)
  ------------------
  |  Branch (782:8): [True: 0, False: 0]
  ------------------
  783|      0|			{
  784|      0|				match = TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
  785|      0|				assert(filter->Level <= INT32_MAX);
  ------------------
  |  Branch (785:5): [True: 0, False: 0]
  |  Branch (785:5): [True: 0, False: 0]
  ------------------
  786|      0|				log->FilterLevel = (LONG)filter->Level;
  787|      0|				break;
  788|      0|			}
  789|       |
  790|      0|			if (_stricmp(filter->Names[j], log->Names[j]) != 0)
  ------------------
  |  Branch (790:8): [True: 0, False: 0]
  ------------------
  791|      0|				break;
  792|       |
  793|      0|			if (j == (log->NameCount - 1))
  ------------------
  |  Branch (793:8): [True: 0, False: 0]
  ------------------
  794|      0|			{
  795|      0|				match = log->NameCount == filter->NameCount;
  796|      0|				if (match)
  ------------------
  |  Branch (796:9): [True: 0, False: 0]
  ------------------
  797|      0|				{
  798|      0|					assert(filter->Level <= INT32_MAX);
  ------------------
  |  Branch (798:6): [True: 0, False: 0]
  |  Branch (798:6): [True: 0, False: 0]
  ------------------
  799|      0|					log->FilterLevel = (LONG)filter->Level;
  800|      0|				}
  801|      0|				break;
  802|      0|			}
  803|      0|		}
  804|       |
  805|      0|		if (match)
  ------------------
  |  Branch (805:7): [True: 0, False: 0]
  ------------------
  806|      0|			break;
  807|      0|	}
  808|       |
  809|      2|	return log->FilterLevel;
  810|      2|}
wlog.c:WLog_InitializeRoot:
  113|      1|{
  114|      1|	char* env = nullptr;
  115|      1|	DWORD nSize = 0;
  116|      1|	DWORD logAppenderType = 0;
  117|      1|	LPCSTR appender = "WLOG_APPENDER";
  118|       |
  119|      1|	WINPR_UNUSED(InitOnce);
  ------------------
  |  |  715|      1|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  120|      1|	WINPR_UNUSED(Parameter);
  ------------------
  |  |  715|      1|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  121|      1|	WINPR_UNUSED(Context);
  ------------------
  |  |  715|      1|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  122|       |
  123|      1|	if (!(g_RootLog = WLog_New("", nullptr)))
  ------------------
  |  Branch (123:6): [True: 0, False: 1]
  ------------------
  124|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  125|       |
  126|      1|	g_RootLog->IsRoot = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  127|      1|	logAppenderType = WLOG_APPENDER_CONSOLE;
  128|      1|	nSize = GetEnvironmentVariableA(appender, nullptr, 0);
  129|       |
  130|      1|	if (nSize)
  ------------------
  |  Branch (130:6): [True: 0, False: 1]
  ------------------
  131|      0|	{
  132|      0|		env = (LPSTR)malloc(nSize);
  133|       |
  134|      0|		if (!env)
  ------------------
  |  Branch (134:7): [True: 0, False: 0]
  ------------------
  135|      0|			goto fail;
  136|       |
  137|      0|		if (GetEnvironmentVariableA(appender, env, nSize) != nSize - 1)
  ------------------
  |  Branch (137:7): [True: 0, False: 0]
  ------------------
  138|      0|		{
  139|      0|			(void)fprintf(stderr, "%s environment variable modified in my back", appender);
  140|      0|			free(env);
  141|      0|			goto fail;
  142|      0|		}
  143|       |
  144|      0|		if (_stricmp(env, "CONSOLE") == 0)
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|			logAppenderType = WLOG_APPENDER_CONSOLE;
  146|      0|		else if (_stricmp(env, "FILE") == 0)
  ------------------
  |  Branch (146:12): [True: 0, False: 0]
  ------------------
  147|      0|			logAppenderType = WLOG_APPENDER_FILE;
  148|      0|		else if (_stricmp(env, "BINARY") == 0)
  ------------------
  |  Branch (148:12): [True: 0, False: 0]
  ------------------
  149|      0|			logAppenderType = WLOG_APPENDER_BINARY;
  150|       |
  151|      0|#ifdef WINPR_HAVE_SYSLOG_H
  152|      0|		else if (_stricmp(env, "SYSLOG") == 0)
  ------------------
  |  Branch (152:12): [True: 0, False: 0]
  ------------------
  153|      0|			logAppenderType = WLOG_APPENDER_SYSLOG;
  154|       |
  155|      0|#endif /* WINPR_HAVE_SYSLOG_H */
  156|       |#ifdef WINPR_HAVE_JOURNALD_H
  157|       |		else if (_stricmp(env, "JOURNALD") == 0)
  158|       |			logAppenderType = WLOG_APPENDER_JOURNALD;
  159|       |
  160|       |#endif
  161|      0|		else if (_stricmp(env, "UDP") == 0)
  ------------------
  |  Branch (161:12): [True: 0, False: 0]
  ------------------
  162|      0|			logAppenderType = WLOG_APPENDER_UDP;
  163|       |
  164|      0|		free(env);
  165|      0|	}
  166|       |
  167|      1|	if (!WLog_SetLogAppenderType(g_RootLog, logAppenderType))
  ------------------
  |  Branch (167:6): [True: 0, False: 1]
  ------------------
  168|      0|		goto fail;
  169|       |
  170|      1|	if (!WLog_ParseFilters(g_RootLog))
  ------------------
  |  Branch (170:6): [True: 0, False: 1]
  ------------------
  171|      0|		goto fail;
  172|       |
  173|      1|	(void)winpr_atexit(WLog_Uninit_);
  174|       |
  175|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  176|      0|fail:
  177|      0|	WLog_Uninit_();
  178|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  179|      1|}
wlog.c:WLog_ParseFilters:
  741|      1|{
  742|      1|	LPCSTR filter = "WLOG_FILTER";
  743|      1|	BOOL res = FALSE;
  ------------------
  |  |  122|      1|#define FALSE false
  ------------------
  744|      1|	char* env = nullptr;
  745|      1|	DWORD nSize = 0;
  746|      1|	free(g_Filters);
  747|      1|	g_Filters = nullptr;
  748|      1|	g_FilterCount = 0;
  749|      1|	nSize = GetEnvironmentVariableA(filter, nullptr, 0);
  750|       |
  751|      1|	if (nSize < 1)
  ------------------
  |  Branch (751:6): [True: 1, False: 0]
  ------------------
  752|      1|		return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  753|       |
  754|      0|	env = (LPSTR)malloc(nSize);
  755|       |
  756|      0|	if (!env)
  ------------------
  |  Branch (756:6): [True: 0, False: 0]
  ------------------
  757|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  758|       |
  759|      0|	if (GetEnvironmentVariableA(filter, env, nSize) == nSize - 1)
  ------------------
  |  Branch (759:6): [True: 0, False: 0]
  ------------------
  760|      0|		res = WLog_AddStringLogFilters_int(root, env);
  761|       |
  762|      0|	free(env);
  763|      0|	return res;
  764|      0|}
wlog.c:WLog_Uninit_:
   81|      1|{
   82|      1|	wLog* child = nullptr;
   83|      1|	wLog* root = g_RootLog;
   84|       |
   85|      1|	if (!root)
  ------------------
  |  Branch (85:6): [True: 0, False: 1]
  ------------------
   86|      0|		return;
   87|       |
   88|      2|	for (DWORD index = 0; index < root->ChildrenCount; index++)
  ------------------
  |  Branch (88:24): [True: 1, False: 1]
  ------------------
   89|      1|	{
   90|      1|		child = root->Children[index];
   91|      1|		WLog_Free(child);
   92|      1|	}
   93|       |
   94|      1|	WLog_Free(root);
   95|      1|	g_RootLog = nullptr;
   96|      1|	free(g_GlobalPrefix);
   97|      1|	g_GlobalPrefix = nullptr;
   98|      1|}
wlog.c:WLog_Get_int:
 1031|      1|{
 1032|      1|	wLog* log = nullptr;
 1033|       |
 1034|      1|	if (!(log = WLog_FindChild(root, name)))
  ------------------
  |  Branch (1034:6): [True: 1, False: 0]
  ------------------
 1035|      1|	{
 1036|      1|		if (!root)
  ------------------
  |  Branch (1036:7): [True: 0, False: 1]
  ------------------
 1037|      0|			return nullptr;
 1038|       |
 1039|      1|		if (!(log = WLog_New(name, root)))
  ------------------
  |  Branch (1039:7): [True: 0, False: 1]
  ------------------
 1040|      0|			return nullptr;
 1041|       |
 1042|      1|		if (!WLog_AddChild(root, log))
  ------------------
  |  Branch (1042:7): [True: 0, False: 1]
  ------------------
 1043|      0|		{
 1044|      0|			WLog_Free(log);
 1045|      0|			return nullptr;
 1046|      0|		}
 1047|      1|	}
 1048|       |
 1049|      1|	return log;
 1050|      1|}
wlog.c:WLog_FindChild:
 1006|      1|{
 1007|      1|	wLog* child = nullptr;
 1008|       |
 1009|      1|	if (!root)
  ------------------
  |  Branch (1009:6): [True: 0, False: 1]
  ------------------
 1010|      0|		return nullptr;
 1011|       |
 1012|      1|	WLog_Lock(root);
 1013|       |
 1014|      1|	for (DWORD index = 0; index < root->ChildrenCount; index++)
  ------------------
  |  Branch (1014:24): [True: 0, False: 1]
  ------------------
 1015|      0|	{
 1016|      0|		wLog* cchild = root->Children[index];
 1017|       |
 1018|      0|		if (strcmp(cchild->Name, name) == 0)
  ------------------
  |  Branch (1018:7): [True: 0, False: 0]
  ------------------
 1019|      0|		{
 1020|      0|			child = cchild;
 1021|      0|			break;
 1022|      0|		}
 1023|      0|	}
 1024|       |
 1025|      1|	WLog_Unlock(root);
 1026|       |
 1027|      1|	return child;
 1028|      1|}
wlog.c:WLog_Lock:
  101|      2|{
  102|      2|	WINPR_ASSERT(log);
  ------------------
  |  |   76|      2|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|      2|	do                                                                                             \
  |  |  |  |   61|      2|	{                                                                                              \
  |  |  |  |   62|      2|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|      2|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|      2|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|      2|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|      2|                                                                                                   \
  |  |  |  |   70|      2|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|      2|	do                                                      \
  |  |  |  |  |  |   32|      2|	{                                                       \
  |  |  |  |  |  |   33|      2|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|      2|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|      2|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|      2|                                                                                                   \
  |  |  |  |   72|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|      2|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|      2|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|      2|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|      2|	EnterCriticalSection(&log->lock);
  104|      2|}
wlog.c:WLog_Unlock:
  107|      2|{
  108|      2|	WINPR_ASSERT(log);
  ------------------
  |  |   76|      2|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|      2|	do                                                                                             \
  |  |  |  |   61|      2|	{                                                                                              \
  |  |  |  |   62|      2|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|      2|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|      2|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|      2|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|      2|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|      2|                                                                                                   \
  |  |  |  |   70|      2|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|      2|	do                                                      \
  |  |  |  |  |  |   32|      2|	{                                                       \
  |  |  |  |  |  |   33|      2|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|      2|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|      2|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|      2|                                                                                                   \
  |  |  |  |   72|      2|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|      2|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|      2|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|      2|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|      2|	LeaveCriticalSection(&log->lock);
  110|      2|}
wlog.c:WLog_AddChild:
  962|      1|{
  963|      1|	BOOL status = FALSE;
  ------------------
  |  |  122|      1|#define FALSE false
  ------------------
  964|       |
  965|      1|	WLog_Lock(parent);
  966|       |
  967|      1|	if (parent->ChildrenCount >= parent->ChildrenSize)
  ------------------
  |  Branch (967:6): [True: 1, False: 0]
  ------------------
  968|      1|	{
  969|      1|		parent->ChildrenSize = parent->ChildrenCount + 4;
  970|       |
  971|      1|		if (parent->ChildrenSize == 0)
  ------------------
  |  Branch (971:7): [True: 0, False: 1]
  ------------------
  972|      0|		{
  973|      0|			free((void*)parent->Children);
  974|      0|			parent->Children = nullptr;
  975|      0|		}
  976|      1|		else
  977|      1|		{
  978|      1|			wLog** tmp =
  979|      1|			    (wLog**)realloc((void*)parent->Children, sizeof(wLog*) * parent->ChildrenSize);
  980|       |
  981|      1|			if (!tmp)
  ------------------
  |  Branch (981:8): [True: 0, False: 1]
  ------------------
  982|      0|			{
  983|      0|				free((void*)parent->Children);
  984|      0|				parent->Children = nullptr;
  985|      0|				goto exit;
  986|      0|			}
  987|       |
  988|      1|			parent->Children = tmp;
  989|      1|		}
  990|      1|	}
  991|       |
  992|      1|	if (!parent->Children)
  ------------------
  |  Branch (992:6): [True: 0, False: 1]
  ------------------
  993|      0|		goto exit;
  994|       |
  995|      1|	parent->Children[parent->ChildrenCount++] = child;
  996|      1|	child->Parent = parent;
  997|       |
  998|      1|	WLog_Unlock(parent);
  999|       |
 1000|      1|	status = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
 1001|      1|exit:
 1002|      1|	return status;
 1003|      1|}
wlog.c:WLog_New:
  857|      2|{
  858|      2|	wLog* log = nullptr;
  859|      2|	char* env = nullptr;
  860|      2|	DWORD nSize = 0;
  861|      2|	int iLevel = 0;
  862|      2|	log = (wLog*)calloc(1, sizeof(wLog));
  863|       |
  864|      2|	if (!log)
  ------------------
  |  Branch (864:6): [True: 0, False: 2]
  ------------------
  865|      0|		return nullptr;
  866|       |
  867|      2|	log->Name = _strdup(name);
  868|       |
  869|      2|	if (!log->Name)
  ------------------
  |  Branch (869:6): [True: 0, False: 2]
  ------------------
  870|      0|		goto out_fail;
  871|       |
  872|      2|	if (!WLog_ParseName(log, name))
  ------------------
  |  Branch (872:6): [True: 0, False: 2]
  ------------------
  873|      0|		goto out_fail;
  874|       |
  875|      2|	log->Parent = rootLogger;
  876|      2|	log->FilterLevel = WLOG_FILTER_NOT_INITIALIZED;
  ------------------
  |  |   53|      2|#define WLOG_FILTER_NOT_INITIALIZED (-2)
  ------------------
  877|       |
  878|      2|	if (rootLogger)
  ------------------
  |  Branch (878:6): [True: 1, False: 1]
  ------------------
  879|      1|	{
  880|      1|		log->Level = WLOG_LEVEL_INHERIT;
  881|      1|		log->inherit = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  882|      1|	}
  883|      1|	else
  884|      1|	{
  885|      1|		LPCSTR level = "WLOG_LEVEL";
  886|      1|		log->Level = WLOG_INFO;
  887|      1|		nSize = GetEnvironmentVariableA(level, nullptr, 0);
  888|       |
  889|      1|		if (nSize)
  ------------------
  |  Branch (889:7): [True: 0, False: 1]
  ------------------
  890|      0|		{
  891|      0|			env = (LPSTR)malloc(nSize);
  892|       |
  893|      0|			if (!env)
  ------------------
  |  Branch (893:8): [True: 0, False: 0]
  ------------------
  894|      0|				goto out_fail;
  895|       |
  896|      0|			if (GetEnvironmentVariableA(level, env, nSize) != nSize - 1)
  ------------------
  |  Branch (896:8): [True: 0, False: 0]
  ------------------
  897|      0|			{
  898|      0|				(void)fprintf(stderr, "%s environment variable changed in my back !\n", level);
  899|      0|				free(env);
  900|      0|				goto out_fail;
  901|      0|			}
  902|       |
  903|      0|			iLevel = WLog_ParseLogLevel(env);
  904|      0|			free(env);
  905|       |
  906|      0|			if (iLevel >= 0)
  ------------------
  |  Branch (906:8): [True: 0, False: 0]
  ------------------
  907|      0|			{
  908|      0|				if (!WLog_SetLogLevel(log, (DWORD)iLevel))
  ------------------
  |  Branch (908:9): [True: 0, False: 0]
  ------------------
  909|      0|					goto out_fail;
  910|      0|			}
  911|      0|		}
  912|      1|	}
  913|       |
  914|      2|	iLevel = WLog_GetFilterLogLevel(log);
  915|       |
  916|      2|	if (iLevel >= 0)
  ------------------
  |  Branch (916:6): [True: 0, False: 2]
  ------------------
  917|      0|	{
  918|      0|		if (!WLog_SetLogLevel(log, (DWORD)iLevel))
  ------------------
  |  Branch (918:7): [True: 0, False: 0]
  ------------------
  919|      0|			goto out_fail;
  920|      0|	}
  921|       |
  922|      2|	if (!InitializeCriticalSectionAndSpinCount(&log->lock, 4000))
  ------------------
  |  Branch (922:6): [True: 0, False: 2]
  ------------------
  923|      0|		goto out_fail;
  924|       |
  925|      2|	return log;
  926|      0|out_fail:
  927|      0|	WLog_Free(log);
  928|      0|	return nullptr;
  929|      2|}
wlog.c:WLog_ParseName:
  813|      2|{
  814|      2|	const char* cp = name;
  815|      2|	char* p = nullptr;
  816|      2|	size_t count = 1;
  817|      2|	LPSTR names = nullptr;
  818|       |
  819|      4|	while ((cp = strchr(cp, '.')) != nullptr)
  ------------------
  |  Branch (819:9): [True: 2, False: 2]
  ------------------
  820|      2|	{
  821|      2|		count++;
  822|      2|		cp++;
  823|      2|	}
  824|       |
  825|      2|	names = _strdup(name);
  826|       |
  827|      2|	if (!names)
  ------------------
  |  Branch (827:6): [True: 0, False: 2]
  ------------------
  828|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  829|       |
  830|      2|	log->NameCount = count;
  831|      2|	log->Names = (LPSTR*)calloc((count + 1UL), sizeof(LPSTR));
  832|       |
  833|      2|	if (!log->Names)
  ------------------
  |  Branch (833:6): [True: 0, False: 2]
  ------------------
  834|      0|	{
  835|      0|		free(names);
  836|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  837|      0|	}
  838|       |
  839|      2|	log->Names[count] = nullptr;
  840|      2|	count = 0;
  841|      2|	p = (char*)names;
  842|      2|	log->Names[count++] = p;
  843|       |
  844|      4|	while ((p = strchr(p, '.')) != nullptr)
  ------------------
  |  Branch (844:9): [True: 2, False: 2]
  ------------------
  845|      2|	{
  846|      2|		if (count < log->NameCount)
  ------------------
  |  Branch (846:7): [True: 2, False: 0]
  ------------------
  847|      2|			log->Names[count++] = p + 1;
  848|       |
  849|      2|		*p = '\0';
  850|      2|		p++;
  851|      2|	}
  852|       |
  853|      2|	return TRUE;
  ------------------
  |  |  126|      2|#define TRUE true
  ------------------
  854|      2|}
wlog.c:WLog_Free:
  932|      2|{
  933|      2|	if (log)
  ------------------
  |  Branch (933:6): [True: 2, False: 0]
  ------------------
  934|      2|	{
  935|      2|		if (log->Appender)
  ------------------
  |  Branch (935:7): [True: 1, False: 1]
  ------------------
  936|      1|		{
  937|      1|			WLog_Appender_Free(log, log->Appender);
  938|      1|			log->Appender = nullptr;
  939|      1|		}
  940|       |
  941|      2|		free(log->Name);
  942|       |
  943|       |		/* The first element in this array is allocated, the rest are indices into this variable */
  944|      2|		if (log->Names)
  ------------------
  |  Branch (944:7): [True: 2, False: 0]
  ------------------
  945|      2|			free(log->Names[0]);
  946|      2|		free((void*)log->Names);
  947|      2|		free((void*)log->Children);
  948|      2|		DeleteCriticalSection(&log->lock);
  949|      2|		free(log);
  950|      2|	}
  951|      2|}

