freerdp_assistance_encrypt_pass_stub:
  900|    317|{
  901|    317|	BOOL rc = 0;
  902|    317|	size_t cbPasswordW = 0;
  903|    317|	size_t cbPassStubW = 0;
  904|    317|	BYTE PasswordHash[WINPR_MD5_DIGEST_LENGTH] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    317|	{                      \
  |  |   86|    317|	} /** @since version 3.24.0 */
  ------------------
  905|    317|	WINPR_RC4_CTX* rc4Ctx = nullptr;
  906|    317|	BYTE* pbIn = nullptr;
  907|    317|	BYTE* pbOut = nullptr;
  908|    317|	BYTE* res = nullptr;
  909|    317|	WCHAR* PasswordW = ConvertUtf8ToWCharAlloc(password, &cbPasswordW);
  910|    317|	WCHAR* PassStubW = ConvertUtf8ToWCharAlloc(passStub, &cbPassStubW);
  911|       |
  912|    317|	cbPasswordW = cbPasswordW * sizeof(WCHAR);
  913|    317|	cbPassStubW = cbPassStubW * sizeof(WCHAR);
  914|    317|	const size_t EncryptedSize = cbPassStubW + 4;
  915|       |
  916|    317|	if (!PasswordW || !PassStubW)
  ------------------
  |  Branch (916:6): [True: 0, False: 317]
  |  Branch (916:20): [True: 81, False: 236]
  ------------------
  917|     81|		goto fail;
  918|       |
  919|    236|	if (!winpr_Digest(WINPR_MD_MD5, (BYTE*)PasswordW, cbPasswordW, (BYTE*)PasswordHash,
  ------------------
  |  Branch (919:6): [True: 0, False: 236]
  ------------------
  920|    236|	                  sizeof(PasswordHash)))
  921|      0|		goto fail;
  922|       |
  923|    236|	pbIn = (BYTE*)calloc(1, EncryptedSize);
  924|    236|	pbOut = (BYTE*)calloc(1, EncryptedSize);
  925|       |
  926|    236|	if (!pbIn || !pbOut)
  ------------------
  |  Branch (926:6): [True: 0, False: 236]
  |  Branch (926:15): [True: 0, False: 236]
  ------------------
  927|      0|		goto fail;
  928|       |
  929|    236|	WINPR_ASSERT(cbPasswordW <= UINT32_MAX);
  ------------------
  |  |   76|    236|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    236|	do                                                                                             \
  |  |  |  |   61|    236|	{                                                                                              \
  |  |  |  |   62|    236|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    236|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    236|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    236|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    236|                                                                                                   \
  |  |  |  |   70|    236|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    236|	do                                                      \
  |  |  |  |  |  |   32|    236|	{                                                       \
  |  |  |  |  |  |   33|    236|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    236|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    236|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    236|                                                                                                   \
  |  |  |  |   72|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    236|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    236|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    236|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|    236|	winpr_Data_Write_UINT32(pbIn, (UINT32)cbPassStubW);
  931|    236|	CopyMemory(&pbIn[4], PassStubW, cbPassStubW);
  ------------------
  |  |  123|    236|#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
  ------------------
  932|    236|	rc4Ctx = winpr_RC4_New(PasswordHash, sizeof(PasswordHash));
  933|       |
  934|    236|	if (!rc4Ctx)
  ------------------
  |  Branch (934:6): [True: 0, False: 236]
  ------------------
  935|      0|	{
  936|      0|		WLog_ERR(TAG, "winpr_Cipher_New failure");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  937|      0|		goto fail;
  938|      0|	}
  939|       |
  940|    236|	rc = winpr_RC4_Update(rc4Ctx, EncryptedSize, pbIn, pbOut);
  941|       |
  942|    236|	if (!rc)
  ------------------
  |  Branch (942:6): [True: 0, False: 236]
  ------------------
  943|      0|	{
  944|      0|		WLog_ERR(TAG, "winpr_Cipher_Update failure");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  945|      0|		goto fail;
  946|      0|	}
  947|    236|	res = pbOut;
  948|    317|fail:
  949|    317|	winpr_RC4_Free(rc4Ctx);
  950|    317|	free(PasswordW);
  951|    317|	free(PassStubW);
  952|    317|	free(pbIn);
  953|    317|	if (!res)
  ------------------
  |  Branch (953:6): [True: 81, False: 236]
  ------------------
  954|     81|		free(pbOut);
  955|    236|	else
  956|    236|		*pEncryptedSize = EncryptedSize;
  957|    317|	return res;
  958|    236|}
freerdp_assistance_hex_string_to_bin:
 1055|    438|{
 1056|    438|	BYTE* buffer = nullptr;
 1057|    438|	if (!str || !size)
  ------------------
  |  Branch (1057:6): [True: 0, False: 438]
  |  Branch (1057:14): [True: 0, False: 438]
  ------------------
 1058|      0|		return nullptr;
 1059|    438|	*size = 0;
 1060|    438|	const size_t length = strlen(str);
 1061|    438|	buffer = calloc(length, sizeof(BYTE));
 1062|    438|	if (!buffer)
  ------------------
  |  Branch (1062:6): [True: 0, False: 438]
  ------------------
 1063|      0|		return nullptr;
 1064|    438|	const size_t rc = winpr_HexStringToBinBuffer(str, length, buffer, length);
 1065|    438|	if (rc == 0)
  ------------------
  |  Branch (1065:6): [True: 1, False: 437]
  ------------------
 1066|      1|	{
 1067|      1|		free(buffer);
 1068|      1|		return nullptr;
 1069|      1|	}
 1070|    437|	*size = rc;
 1071|    437|	return buffer;
 1072|    438|}
freerdp_assistance_parse_file_buffer:
 1239|  2.15k|{
 1240|  2.15k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.15k|	do                                                                                             \
  |  |  |  |   61|  2.15k|	{                                                                                              \
  |  |  |  |   62|  2.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.15k|                                                                                                   \
  |  |  |  |   70|  2.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.15k|	do                                                      \
  |  |  |  |  |  |   32|  2.15k|	{                                                       \
  |  |  |  |  |  |   33|  2.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.15k|                                                                                                   \
  |  |  |  |   72|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1241|  2.15k|	if (!password)
  ------------------
  |  Branch (1241:6): [True: 0, False: 2.15k]
  ------------------
 1242|      0|	{
 1243|      0|		WLog_WARN(TAG, "empty password supplied");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1244|      0|	}
 1245|       |
 1246|  2.15k|	if (!cbuffer || (size == 0))
  ------------------
  |  Branch (1246:6): [True: 0, False: 2.15k]
  |  Branch (1246:18): [True: 0, False: 2.15k]
  ------------------
 1247|      0|	{
 1248|      0|		WLog_WARN(TAG, "no data supplied [%p, %" PRIuz "]",
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1249|      0|		          WINPR_CXX_COMPAT_CAST(const void*, cbuffer), size);
 1250|      0|		return -1;
 1251|      0|	}
 1252|       |
 1253|  2.15k|	char* abuffer = strndup(cbuffer, size);
 1254|  2.15k|	const size_t len = strnlen(cbuffer, size);
 1255|  2.15k|	if (len == size)
  ------------------
  |  Branch (1255:6): [True: 0, False: 2.15k]
  ------------------
 1256|      0|		WLog_WARN(TAG, "Input data not '\\0' terminated");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1257|       |
 1258|  2.15k|	if (!abuffer)
  ------------------
  |  Branch (1258:6): [True: 0, False: 2.15k]
  ------------------
 1259|      0|		return -1;
 1260|       |
 1261|  2.15k|	const int rc = freerdp_assistance_parse_file_buffer_int(file, abuffer, len + 1, password);
 1262|  2.15k|	free(abuffer);
 1263|  2.15k|	return rc;
 1264|  2.15k|}
freerdp_assistance_file_new:
 1436|  2.15k|{
 1437|  2.15k|	if (!winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT))
  ------------------
  |  |   27|  2.15k|#define WINPR_SSL_INIT_DEFAULT 0x00
  ------------------
  |  Branch (1437:6): [True: 0, False: 2.15k]
  ------------------
 1438|      0|		return nullptr;
 1439|       |
 1440|  2.15k|	rdpAssistanceFile* file = calloc(1, sizeof(rdpAssistanceFile));
 1441|  2.15k|	if (!file)
  ------------------
  |  Branch (1441:6): [True: 0, False: 2.15k]
  ------------------
 1442|      0|		return nullptr;
 1443|       |
 1444|  2.15k|	file->MachineAddresses = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.15k|#define FALSE false
  ------------------
 1445|  2.15k|	file->MachinePorts = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.15k|#define FALSE false
  ------------------
 1446|  2.15k|	file->MachineUris = ArrayList_New(FALSE);
  ------------------
  |  |  122|  2.15k|#define FALSE false
  ------------------
 1447|       |
 1448|  2.15k|	if (!file->MachineAddresses || !file->MachinePorts || !file->MachineUris)
  ------------------
  |  Branch (1448:6): [True: 0, False: 2.15k]
  |  Branch (1448:33): [True: 0, False: 2.15k]
  |  Branch (1448:56): [True: 0, False: 2.15k]
  ------------------
 1449|      0|		goto fail;
 1450|       |
 1451|  2.15k|	if (!setup_string(file->MachineAddresses) || !setup_string(file->MachineUris))
  ------------------
  |  Branch (1451:6): [True: 0, False: 2.15k]
  |  Branch (1451:47): [True: 0, False: 2.15k]
  ------------------
 1452|      0|		goto fail;
 1453|       |
 1454|  2.15k|	return file;
 1455|       |
 1456|      0|fail:
 1457|      0|	WINPR_PRAGMA_DIAG_PUSH
 1458|      0|	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
 1459|      0|	freerdp_assistance_file_free(file);
 1460|      0|	WINPR_PRAGMA_DIAG_POP
 1461|      0|	return nullptr;
 1462|  2.15k|}
freerdp_assistance_file_free:
 1465|  2.15k|{
 1466|  2.15k|	if (!file)
  ------------------
  |  Branch (1466:6): [True: 0, False: 2.15k]
  ------------------
 1467|      0|		return;
 1468|       |
 1469|  2.15k|	free(file->password);
 1470|  2.15k|	free(file->ConnectionString2);
 1471|  2.15k|	free(file->filename);
 1472|  2.15k|	free(file->Username);
 1473|  2.15k|	free(file->LHTicket);
 1474|  2.15k|	free(file->RCTicket);
 1475|  2.15k|	free(file->PassStub);
 1476|  2.15k|	free(file->ConnectionString1);
 1477|  2.15k|	free(file->EncryptedLHTicket);
 1478|  2.15k|	free(file->RASessionId);
 1479|  2.15k|	free(file->RASpecificParams);
 1480|  2.15k|	free(file->RASpecificParams2);
 1481|  2.15k|	free(file->EncryptedPassStub);
 1482|       |
 1483|  2.15k|	ArrayList_Free(file->MachineAddresses);
 1484|  2.15k|	ArrayList_Free(file->MachinePorts);
 1485|  2.15k|	ArrayList_Free(file->MachineUris);
 1486|  2.15k|	free(file);
 1487|  2.15k|}
assistance.c:freerdp_assistance_parse_file_buffer_int:
 1206|  2.15k|{
 1207|  2.15k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.15k|	do                                                                                             \
  |  |  |  |   61|  2.15k|	{                                                                                              \
  |  |  |  |   62|  2.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.15k|                                                                                                   \
  |  |  |  |   70|  2.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.15k|	do                                                      \
  |  |  |  |  |  |   32|  2.15k|	{                                                       \
  |  |  |  |  |  |   33|  2.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.15k|                                                                                                   \
  |  |  |  |   72|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1208|  2.15k|	WINPR_ASSERT(buffer);
  ------------------
  |  |   76|  2.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.15k|	do                                                                                             \
  |  |  |  |   61|  2.15k|	{                                                                                              \
  |  |  |  |   62|  2.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.15k|                                                                                                   \
  |  |  |  |   70|  2.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.15k|	do                                                      \
  |  |  |  |  |  |   32|  2.15k|	{                                                       \
  |  |  |  |  |  |   33|  2.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.15k|                                                                                                   \
  |  |  |  |   72|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1209|  2.15k|	WINPR_ASSERT(size > 0);
  ------------------
  |  |   76|  2.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.15k|	do                                                                                             \
  |  |  |  |   61|  2.15k|	{                                                                                              \
  |  |  |  |   62|  2.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.15k|                                                                                                   \
  |  |  |  |   70|  2.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.15k|	do                                                      \
  |  |  |  |  |  |   32|  2.15k|	{                                                       \
  |  |  |  |  |  |   33|  2.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.15k|                                                                                                   \
  |  |  |  |   72|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1210|       |
 1211|  2.15k|	if (!update_password(file, password))
  ------------------
  |  Branch (1211:6): [True: 0, False: 2.15k]
  ------------------
 1212|      0|		return -1;
 1213|       |
 1214|  2.15k|	char* uploadinfo = nullptr;
 1215|  2.15k|	size_t uploadinfosize = 0;
 1216|  2.15k|	if (freerdp_assistance_consume_input_and_get_element(buffer, size, "UPLOADINFO", &uploadinfo,
  ------------------
  |  Branch (1216:6): [True: 1.21k, False: 941]
  ------------------
 1217|  2.15k|	                                                     &uploadinfosize))
 1218|  1.21k|		return freerdp_assistance_parse_uploadinfo(file, uploadinfo, uploadinfosize);
 1219|       |
 1220|    941|	size_t elen = 0;
 1221|    941|	const char* estr =
 1222|    941|	    freerdp_assistance_contains_element(buffer, size, "E", &elen, nullptr, nullptr);
 1223|    941|	if (!estr || (elen == 0))
  ------------------
  |  Branch (1223:6): [True: 181, False: 760]
  |  Branch (1223:15): [True: 0, False: 760]
  ------------------
 1224|    181|	{
 1225|    181|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Neither UPLOADINFO nor <E> found");
  ------------------
  |  |  348|    181|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1226|    181|		return -1;
 1227|    181|	}
 1228|    760|	if (!update_connectionstring2(file, estr, elen))
  ------------------
  |  Branch (1228:6): [True: 0, False: 760]
  ------------------
 1229|      0|		return -1;
 1230|       |
 1231|    760|	if (!freerdp_assistance_parse_connection_string2(file))
  ------------------
  |  Branch (1231:6): [True: 229, False: 531]
  ------------------
 1232|    229|		return -1;
 1233|       |
 1234|    531|	return 1;
 1235|    760|}
assistance.c:freerdp_assistance_consume_input_and_get_element:
  640|  4.15k|{
  641|  4.15k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|  4.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.15k|	do                                                                                             \
  |  |  |  |   61|  4.15k|	{                                                                                              \
  |  |  |  |   62|  4.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.15k|                                                                                                   \
  |  |  |  |   70|  4.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.15k|	do                                                      \
  |  |  |  |  |  |   32|  4.15k|	{                                                       \
  |  |  |  |  |  |   33|  4.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.15k|                                                                                                   \
  |  |  |  |   72|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|  4.15k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|  4.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.15k|	do                                                                                             \
  |  |  |  |   61|  4.15k|	{                                                                                              \
  |  |  |  |   62|  4.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.15k|                                                                                                   \
  |  |  |  |   70|  4.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.15k|	do                                                      \
  |  |  |  |  |  |   32|  4.15k|	{                                                       \
  |  |  |  |  |  |   33|  4.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.15k|                                                                                                   \
  |  |  |  |   72|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  643|  4.15k|	WINPR_ASSERT(element);
  ------------------
  |  |   76|  4.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.15k|	do                                                                                             \
  |  |  |  |   61|  4.15k|	{                                                                                              \
  |  |  |  |   62|  4.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.15k|                                                                                                   \
  |  |  |  |   70|  4.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.15k|	do                                                      \
  |  |  |  |  |  |   32|  4.15k|	{                                                       \
  |  |  |  |  |  |   33|  4.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.15k|                                                                                                   \
  |  |  |  |   72|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|  4.15k|	WINPR_ASSERT(elen);
  ------------------
  |  |   76|  4.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.15k|	do                                                                                             \
  |  |  |  |   61|  4.15k|	{                                                                                              \
  |  |  |  |   62|  4.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.15k|                                                                                                   \
  |  |  |  |   70|  4.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.15k|	do                                                      \
  |  |  |  |  |  |   32|  4.15k|	{                                                       \
  |  |  |  |  |  |   33|  4.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.15k|                                                                                                   \
  |  |  |  |   72|  4.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  645|       |
  646|  4.15k|	size_t len = 0;
  647|  4.15k|	size_t dlen = 0;
  648|  4.15k|	char* data = nullptr;
  649|  4.15k|	char* tag = freerdp_assistance_contains_element(input, ilen, key, &len, &data, &dlen);
  650|  4.15k|	if (!tag)
  ------------------
  |  Branch (650:6): [True: 1.11k, False: 3.04k]
  ------------------
  651|  1.11k|		return FALSE;
  ------------------
  |  |  122|  1.11k|#define FALSE false
  ------------------
  652|       |
  653|  3.04k|	char* end = data + dlen;
  654|  3.04k|	*tag = '\0';
  655|  3.04k|	*end = '\0';
  656|  3.04k|	*element = data;
  657|  3.04k|	*elen = dlen + 1;
  658|  3.04k|	return TRUE;
  ------------------
  |  |  126|  3.04k|#define TRUE true
  ------------------
  659|  4.15k|}
assistance.c:freerdp_assistance_parse_uploadinfo:
 1082|  1.21k|{
 1083|  1.21k|	const char escalated[9] = { 'E', 's', 'c', 'a', 'l', 'a', 't', 'e', 'd' };
 1084|  1.21k|	const size_t esclen = sizeof(escalated);
 1085|  1.21k|	const char* typestr = nullptr;
 1086|  1.21k|	size_t typelen = 0;
 1087|       |
 1088|  1.21k|	if (!uploadinfo || (uploadinfosize == 0))
  ------------------
  |  Branch (1088:6): [True: 0, False: 1.21k]
  |  Branch (1088:21): [True: 0, False: 1.21k]
  ------------------
 1089|      0|		return -1;
 1090|       |
 1091|  1.21k|	const size_t ulen = strnlen(uploadinfo, uploadinfosize);
 1092|  1.21k|	if (ulen == uploadinfosize)
  ------------------
  |  Branch (1092:6): [True: 0, False: 1.21k]
  ------------------
 1093|      0|	{
 1094|      0|		WLog_WARN(TAG, "UPLOADINFOR string is not '\\0' terminated");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1095|      0|		return -1;
 1096|      0|	}
 1097|       |
 1098|  1.21k|	if (!freerdp_assistance_parse_attr(&typestr, &typelen, "TYPE", uploadinfo))
  ------------------
  |  Branch (1098:6): [True: 1, False: 1.21k]
  ------------------
 1099|      1|		return -1;
 1100|       |
 1101|  1.21k|	if ((typelen != esclen) || (strncmp(typestr, escalated, esclen) != 0))
  ------------------
  |  Branch (1101:6): [True: 58, False: 1.15k]
  |  Branch (1101:29): [True: 72, False: 1.08k]
  ------------------
 1102|    130|	{
 1103|    130|		WLog_ERR(TAG,
  ------------------
  |  |  348|    130|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1104|    130|		         "Failed to parse ASSISTANCE file: Missing or invalid UPLOADINFO TYPE '%s' [%" PRIuz
 1105|    130|		         "]",
 1106|    130|		         typestr, typelen);
 1107|    130|		return -1;
 1108|    130|	}
 1109|       |
 1110|  1.08k|	char* uploaddata = nullptr;
 1111|  1.08k|	size_t uploaddatasize = 0;
 1112|  1.08k|	if (!freerdp_assistance_consume_input_and_get_element(uploadinfo, ulen, "UPLOADDATA",
  ------------------
  |  Branch (1112:6): [True: 10, False: 1.07k]
  ------------------
 1113|  1.08k|	                                                      &uploaddata, &uploaddatasize))
 1114|     10|		return -1;
 1115|       |
 1116|       |	/* Parse USERNAME */
 1117|  1.07k|	if (!freerdp_assistance_parse_attr_str(&file->Username, "USERNAME", uploaddata))
  ------------------
  |  Branch (1117:6): [True: 1, False: 1.07k]
  ------------------
 1118|      1|		return -1;
 1119|       |
 1120|       |	/* Parse LHTICKET */
 1121|  1.07k|	if (!freerdp_assistance_parse_attr_str(&file->LHTicket, "LHTICKET", uploaddata))
  ------------------
  |  Branch (1121:6): [True: 3, False: 1.07k]
  ------------------
 1122|      3|		return -1;
 1123|       |
 1124|       |	/* Parse RCTICKET */
 1125|  1.07k|	if (!freerdp_assistance_parse_attr_str(&file->RCTicket, "RCTICKET", uploaddata))
  ------------------
  |  Branch (1125:6): [True: 1, False: 1.07k]
  ------------------
 1126|      1|		return -1;
 1127|       |
 1128|       |	/* Parse RCTICKETENCRYPTED */
 1129|  1.07k|	if (!freerdp_assistance_parse_attr_bool(&file->RCTicketEncrypted, "RCTICKETENCRYPTED",
  ------------------
  |  Branch (1129:6): [True: 1, False: 1.06k]
  ------------------
 1130|  1.07k|	                                        uploaddata))
 1131|      1|		return -1;
 1132|       |
 1133|       |	/* Parse PassStub */
 1134|  1.06k|	if (!freerdp_assistance_parse_attr_str(&file->PassStub, "PassStub", uploaddata))
  ------------------
  |  Branch (1134:6): [True: 1, False: 1.06k]
  ------------------
 1135|      1|		return -1;
 1136|       |
 1137|  1.06k|	if (file->PassStub)
  ------------------
  |  Branch (1137:6): [True: 279, False: 789]
  ------------------
 1138|    279|	{
 1139|    279|		const char* amp = "&amp;";
 1140|    279|		char* passtub = strstr(file->PassStub, amp);
 1141|    607|		while (passtub)
  ------------------
  |  Branch (1141:10): [True: 328, False: 279]
  ------------------
 1142|    328|		{
 1143|    328|			const char* end = passtub + 5;
 1144|    328|			const size_t len = strlen(end);
 1145|    328|			memmove(&passtub[1], end, len + 1);
 1146|    328|			passtub = strstr(passtub, amp);
 1147|    328|		}
 1148|    279|	}
 1149|       |
 1150|       |	/* Parse DtStart */
 1151|  1.06k|	if (!freerdp_assistance_parse_attr_uint32(&file->DtStart, "DtStart", uploaddata))
  ------------------
  |  Branch (1151:6): [True: 4, False: 1.06k]
  ------------------
 1152|      4|		return -1;
 1153|       |
 1154|       |	/* Parse DtLength */
 1155|  1.06k|	if (!freerdp_assistance_parse_attr_uint32(&file->DtLength, "DtLength", uploaddata))
  ------------------
  |  Branch (1155:6): [True: 4, False: 1.06k]
  ------------------
 1156|      4|		return -1;
 1157|       |
 1158|       |	/* Parse L (LowSpeed) */
 1159|  1.06k|	if (!freerdp_assistance_parse_attr_bool(&file->LowSpeed, "L", uploaddata))
  ------------------
  |  Branch (1159:6): [True: 1, False: 1.05k]
  ------------------
 1160|      1|		return -1;
 1161|       |
 1162|  1.05k|	file->Type = (file->LHTicket) ? 2 : 1;
  ------------------
  |  Branch (1162:15): [True: 438, False: 621]
  ------------------
 1163|  1.05k|	int status = 0;
 1164|       |
 1165|  1.05k|	switch (file->Type)
 1166|  1.05k|	{
 1167|    438|		case 2:
  ------------------
  |  Branch (1167:3): [True: 438, False: 621]
  ------------------
 1168|    438|		{
 1169|    438|			file->EncryptedLHTicket = freerdp_assistance_hex_string_to_bin(
 1170|    438|			    file->LHTicket, &file->EncryptedLHTicketLength);
 1171|       |
 1172|    438|			if (!freerdp_assistance_decrypt2(file))
  ------------------
  |  Branch (1172:8): [True: 438, False: 0]
  ------------------
 1173|    438|				status = -1;
 1174|    438|		}
 1175|    438|		break;
 1176|       |
 1177|    621|		case 1:
  ------------------
  |  Branch (1177:3): [True: 621, False: 438]
  ------------------
 1178|    621|		{
 1179|    621|			if (!freerdp_assistance_parse_connection_string1(file))
  ------------------
  |  Branch (1179:8): [True: 304, False: 317]
  ------------------
 1180|    304|				status = -1;
 1181|    621|		}
 1182|    621|		break;
 1183|       |
 1184|      0|		default:
  ------------------
  |  Branch (1184:3): [True: 0, False: 1.05k]
  ------------------
 1185|      0|			return -1;
 1186|  1.05k|	}
 1187|       |
 1188|  1.05k|	if (status < 0)
  ------------------
  |  Branch (1188:6): [True: 742, False: 317]
  ------------------
 1189|    742|	{
 1190|    742|		WLog_ERR(TAG, "freerdp_assistance_parse_connection_string1 failure: %d", status);
  ------------------
  |  |  348|    742|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1191|    742|		return -1;
 1192|    742|	}
 1193|       |
 1194|    317|	file->EncryptedPassStub = freerdp_assistance_encrypt_pass_stub(file->password, file->PassStub,
 1195|    317|	                                                               &file->EncryptedPassStubLength);
 1196|       |
 1197|    317|	if (!file->EncryptedPassStub)
  ------------------
  |  Branch (1197:6): [True: 81, False: 236]
  ------------------
 1198|     81|		return -1;
 1199|       |
 1200|    236|	return 1;
 1201|    317|}
assistance.c:freerdp_assistance_parse_attr:
  434|  34.9k|{
  435|  34.9k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  34.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  34.9k|	do                                                                                             \
  |  |  |  |   61|  34.9k|	{                                                                                              \
  |  |  |  |   62|  34.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  34.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  34.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  34.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  34.9k|                                                                                                   \
  |  |  |  |   70|  34.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  34.9k|	do                                                      \
  |  |  |  |  |  |   32|  34.9k|	{                                                       \
  |  |  |  |  |  |   33|  34.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  34.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  34.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  34.9k|                                                                                                   \
  |  |  |  |   72|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  34.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  34.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  34.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 34.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|  34.9k|	WINPR_ASSERT(plength);
  ------------------
  |  |   76|  34.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  34.9k|	do                                                                                             \
  |  |  |  |   61|  34.9k|	{                                                                                              \
  |  |  |  |   62|  34.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  34.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  34.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  34.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  34.9k|                                                                                                   \
  |  |  |  |   70|  34.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  34.9k|	do                                                      \
  |  |  |  |  |  |   32|  34.9k|	{                                                       \
  |  |  |  |  |  |   33|  34.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  34.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  34.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  34.9k|                                                                                                   \
  |  |  |  |   72|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  34.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  34.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  34.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 34.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|  34.9k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|  34.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  34.9k|	do                                                                                             \
  |  |  |  |   61|  34.9k|	{                                                                                              \
  |  |  |  |   62|  34.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  34.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  34.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  34.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  34.9k|                                                                                                   \
  |  |  |  |   70|  34.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  34.9k|	do                                                      \
  |  |  |  |  |  |   32|  34.9k|	{                                                       \
  |  |  |  |  |  |   33|  34.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  34.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  34.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  34.9k|                                                                                                   \
  |  |  |  |   72|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  34.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  34.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  34.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 34.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|       |
  439|  34.9k|	*opt = nullptr;
  440|  34.9k|	*plength = 0;
  441|  34.9k|	if (!tag)
  ------------------
  |  Branch (441:6): [True: 0, False: 34.9k]
  ------------------
  442|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  443|       |
  444|  34.9k|	char bkey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  34.9k|	{                      \
  |  |   86|  34.9k|	} /** @since version 3.24.0 */
  ------------------
  445|  34.9k|	const int rc = _snprintf(bkey, sizeof(bkey), "%s=\"", key);
  ------------------
  |  |  295|  34.9k|#define _snprintf snprintf
  ------------------
  446|  34.9k|	WINPR_ASSERT(rc > 0);
  ------------------
  |  |   76|  34.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  34.9k|	do                                                                                             \
  |  |  |  |   61|  34.9k|	{                                                                                              \
  |  |  |  |   62|  34.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  34.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  34.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  34.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  34.9k|                                                                                                   \
  |  |  |  |   70|  34.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  34.9k|	do                                                      \
  |  |  |  |  |  |   32|  34.9k|	{                                                       \
  |  |  |  |  |  |   33|  34.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  34.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  34.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  34.9k|                                                                                                   \
  |  |  |  |   72|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  34.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  34.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  34.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 34.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|  34.9k|	WINPR_ASSERT((size_t)rc < sizeof(bkey));
  ------------------
  |  |   76|  34.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  34.9k|	do                                                                                             \
  |  |  |  |   61|  34.9k|	{                                                                                              \
  |  |  |  |   62|  34.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  34.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  34.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  34.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  34.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  34.9k|                                                                                                   \
  |  |  |  |   70|  34.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  34.9k|	do                                                      \
  |  |  |  |  |  |   32|  34.9k|	{                                                       \
  |  |  |  |  |  |   33|  34.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  34.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  34.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 34.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  34.9k|                                                                                                   \
  |  |  |  |   72|  34.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  34.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  34.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  34.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 34.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  448|  34.9k|	if ((rc <= 0) || ((size_t)rc >= sizeof(bkey)))
  ------------------
  |  Branch (448:6): [True: 0, False: 34.9k]
  |  Branch (448:19): [True: 0, False: 34.9k]
  ------------------
  449|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  450|       |
  451|  34.9k|	const char* p = strstr(tag, bkey);
  452|  34.9k|	if (!p)
  ------------------
  |  Branch (452:6): [True: 24.7k, False: 10.2k]
  ------------------
  453|  24.7k|		return TRUE;
  ------------------
  |  |  126|  24.7k|#define TRUE true
  ------------------
  454|       |
  455|  10.2k|	p += strlen(bkey);
  456|  10.2k|	const char* q = strchr(p, '"');
  457|       |
  458|  10.2k|	if (!q)
  ------------------
  |  Branch (458:6): [True: 100, False: 10.1k]
  ------------------
  459|    100|	{
  460|    100|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid field '%s=%s'",
  ------------------
  |  |  348|    100|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  461|    100|		         key, p);
  462|    100|		return FALSE;
  ------------------
  |  |  122|    100|#define FALSE false
  ------------------
  463|    100|	}
  464|       |
  465|  10.1k|	if (p > q)
  ------------------
  |  Branch (465:6): [True: 0, False: 10.1k]
  ------------------
  466|      0|	{
  467|      0|		WLog_ERR(TAG,
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  468|      0|		         "Failed to parse ASSISTANCE file: ConnectionString2 invalid field "
  469|      0|		         "order for '%s'",
  470|      0|		         key);
  471|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  472|      0|	}
  473|  10.1k|	const size_t length = WINPR_ASSERTING_INT_CAST(size_t, q - p);
  ------------------
  |  |  180|  10.1k|	__extension__({                                                                             \
  |  |  181|  10.1k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  10.1k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  10.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  10.1k|	do                                                                                             \
  |  |  |  |  |  |   61|  10.1k|	{                                                                                              \
  |  |  |  |  |  |   62|  10.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  10.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  10.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  10.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  10.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  10.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  10.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  10.1k|                                                                                                   \
  |  |  |  |  |  |   70|  10.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  10.1k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  10.1k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  10.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 10.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  10.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  10.1k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 10.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  10.1k|                                                                                                   \
  |  |  |  |  |  |   72|  10.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  10.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  10.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  10.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 10.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  10.1k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  10.1k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  10.1k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  10.1k|	do                                                                                             \
  |  |  |  |  |  |   61|  10.1k|	{                                                                                              \
  |  |  |  |  |  |   62|  10.1k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  10.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  10.1k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  10.1k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  10.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  10.1k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  10.1k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  10.1k|                                                                                                   \
  |  |  |  |  |  |   70|  10.1k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  10.1k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  10.1k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  37.1k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 6.72k, False: 3.39k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 6.72k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.39k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.39k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  10.1k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  10.1k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 10.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  10.1k|                                                                                                   \
  |  |  |  |  |  |   72|  10.1k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  10.1k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  10.1k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  10.1k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 10.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  10.1k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  10.1k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  10.1k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  10.1k|	})
  ------------------
  474|  10.1k|	*opt = p;
  475|  10.1k|	*plength = length;
  476|       |
  477|  10.1k|	return TRUE;
  ------------------
  |  |  126|  10.1k|#define TRUE true
  ------------------
  478|  10.1k|}
assistance.c:freerdp_assistance_parse_attr_str:
  482|  5.95k|{
  483|  5.95k|	const char* copt = nullptr;
  484|  5.95k|	size_t size = 0;
  485|  5.95k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (485:6): [True: 58, False: 5.89k]
  ------------------
  486|     58|		return FALSE;
  ------------------
  |  |  122|     58|#define FALSE false
  ------------------
  487|  5.89k|	return update_option(opt, copt, size);
  488|  5.95k|}
assistance.c:update_option:
  102|  5.89k|{
  103|  5.89k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  5.89k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  5.89k|	do                                                                                             \
  |  |  |  |   61|  5.89k|	{                                                                                              \
  |  |  |  |   62|  5.89k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  5.89k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  5.89k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  5.89k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  5.89k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  5.89k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  5.89k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  5.89k|                                                                                                   \
  |  |  |  |   70|  5.89k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  5.89k|	do                                                      \
  |  |  |  |  |  |   32|  5.89k|	{                                                       \
  |  |  |  |  |  |   33|  5.89k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 5.89k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  5.89k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  5.89k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 5.89k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  5.89k|                                                                                                   \
  |  |  |  |   72|  5.89k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  5.89k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  5.89k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  5.89k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 5.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  5.89k|	free(*opt);
  105|  5.89k|	*opt = nullptr;
  106|       |
  107|  5.89k|	if (!val && (len != 0))
  ------------------
  |  Branch (107:6): [True: 4.52k, False: 1.37k]
  |  Branch (107:14): [True: 0, False: 4.52k]
  ------------------
  108|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  109|  5.89k|	else if (!val && (len == 0))
  ------------------
  |  Branch (109:11): [True: 4.52k, False: 1.37k]
  |  Branch (109:19): [True: 4.52k, False: 0]
  ------------------
  110|  4.52k|		return TRUE;
  ------------------
  |  |  126|  4.52k|#define TRUE true
  ------------------
  111|  1.37k|	*opt = strndup(val, len);
  112|  1.37k|	return *opt != nullptr;
  113|  5.89k|}
assistance.c:freerdp_assistance_parse_attr_bool:
  492|  2.13k|{
  493|  2.13k|	const char* copt = nullptr;
  494|  2.13k|	size_t size = 0;
  495|       |
  496|  2.13k|	WINPR_ASSERT(opt);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  497|  2.13k|	*opt = FALSE;
  ------------------
  |  |  122|  2.13k|#define FALSE false
  ------------------
  498|       |
  499|  2.13k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (499:6): [True: 2, False: 2.12k]
  ------------------
  500|      2|		return FALSE;
  ------------------
  |  |  122|      2|#define FALSE false
  ------------------
  501|  2.12k|	if (size != 1)
  ------------------
  |  Branch (501:6): [True: 2.11k, False: 12]
  ------------------
  502|  2.11k|		return TRUE;
  ------------------
  |  |  126|  2.11k|#define TRUE true
  ------------------
  503|       |
  504|     12|	*opt = (copt[0] == '1');
  505|     12|	return TRUE;
  ------------------
  |  |  126|     12|#define TRUE true
  ------------------
  506|  2.12k|}
assistance.c:freerdp_assistance_parse_attr_uint32:
  510|  13.9k|{
  511|  13.9k|	const char* copt = nullptr;
  512|  13.9k|	size_t size = 0;
  513|       |
  514|  13.9k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  13.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  13.9k|	do                                                                                             \
  |  |  |  |   61|  13.9k|	{                                                                                              \
  |  |  |  |   62|  13.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  13.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  13.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  13.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  13.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  13.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  13.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  13.9k|                                                                                                   \
  |  |  |  |   70|  13.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  13.9k|	do                                                      \
  |  |  |  |  |  |   32|  13.9k|	{                                                       \
  |  |  |  |  |  |   33|  13.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 13.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  13.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  13.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 13.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  13.9k|                                                                                                   \
  |  |  |  |   72|  13.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  13.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  13.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  13.9k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 13.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  515|  13.9k|	*opt = 0;
  516|       |
  517|  13.9k|	if (!freerdp_assistance_parse_attr(&copt, &size, key, tag))
  ------------------
  |  Branch (517:6): [True: 18, False: 13.9k]
  ------------------
  518|     18|		return FALSE;
  ------------------
  |  |  122|     18|#define FALSE false
  ------------------
  519|       |
  520|  13.9k|	char buffer[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  13.9k|	{                      \
  |  |   86|  13.9k|	} /** @since version 3.24.0 */
  ------------------
  521|  13.9k|	if ((!copt && (size > 0)) || (size >= sizeof(buffer)))
  ------------------
  |  Branch (521:7): [True: 11.6k, False: 2.22k]
  |  Branch (521:16): [True: 0, False: 11.6k]
  |  Branch (521:31): [True: 35, False: 13.8k]
  ------------------
  522|     35|	{
  523|     35|		WLog_WARN(TAG, "Invalid UINT32 string '%s' [%" PRIuz "]", copt, size);
  ------------------
  |  |  346|     35|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  524|     35|		return FALSE;
  ------------------
  |  |  122|     35|#define FALSE false
  ------------------
  525|     35|	}
  526|       |
  527|  13.8k|	if (size > 0)
  ------------------
  |  Branch (527:6): [True: 1.16k, False: 12.7k]
  ------------------
  528|  1.16k|		strncpy(buffer, copt, size);
  529|       |
  530|  13.8k|	errno = 0;
  531|  13.8k|	unsigned long val = strtoul(buffer, nullptr, 0);
  532|       |
  533|  13.8k|	if ((errno != 0) || (val > UINT32_MAX))
  ------------------
  |  Branch (533:6): [True: 3, False: 13.8k]
  |  Branch (533:22): [True: 75, False: 13.8k]
  ------------------
  534|     78|	{
  535|     78|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Invalid value %s", buffer);
  ------------------
  |  |  348|     78|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  536|     78|		return FALSE;
  ------------------
  |  |  122|     78|#define FALSE false
  ------------------
  537|     78|	}
  538|       |
  539|  13.8k|	*opt = (UINT32)val;
  540|       |
  541|  13.8k|	return TRUE;
  ------------------
  |  |  126|  13.8k|#define TRUE true
  ------------------
  542|  13.8k|}
assistance.c:freerdp_assistance_decrypt2:
  962|    438|{
  963|    438|	BOOL rc = FALSE;
  ------------------
  |  |  122|    438|#define FALSE false
  ------------------
  964|    438|	int status = 0;
  965|    438|	size_t cbPasswordW = 0;
  966|    438|	size_t cchOutW = 0;
  967|    438|	WINPR_CIPHER_CTX* aesDec = nullptr;
  968|    438|	WCHAR* PasswordW = nullptr;
  969|    438|	BYTE* pbIn = nullptr;
  970|    438|	BYTE* pbOut = nullptr;
  971|    438|	size_t cbOut = 0;
  972|    438|	size_t cbIn = 0;
  973|    438|	size_t cbFinal = 0;
  974|    438|	BYTE DerivedKey[WINPR_AES_BLOCK_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    438|	{                      \
  |  |   86|    438|	} /** @since version 3.24.0 */
  ------------------
  975|    438|	BYTE InitializationVector[WINPR_AES_BLOCK_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    438|	{                      \
  |  |   86|    438|	} /** @since version 3.24.0 */
  ------------------
  976|    438|	BYTE PasswordHash[WINPR_SHA1_DIGEST_LENGTH] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    438|	{                      \
  |  |   86|    438|	} /** @since version 3.24.0 */
  ------------------
  977|       |
  978|    438|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  979|       |
  980|    438|	if (!file->password)
  ------------------
  |  Branch (980:6): [True: 0, False: 438]
  ------------------
  981|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  982|       |
  983|    438|	PasswordW = ConvertUtf8ToWCharAlloc(file->password, &cbPasswordW);
  984|    438|	if (!PasswordW)
  ------------------
  |  Branch (984:6): [True: 0, False: 438]
  ------------------
  985|      0|	{
  986|      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__)
  ------------------
  987|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  988|      0|	}
  989|       |
  990|    438|	cbPasswordW = cbPasswordW * sizeof(WCHAR);
  991|       |
  992|    438|	if (!winpr_Digest(WINPR_MD_SHA1, (BYTE*)PasswordW, cbPasswordW, PasswordHash,
  ------------------
  |  Branch (992:6): [True: 0, False: 438]
  ------------------
  993|    438|	                  sizeof(PasswordHash)))
  994|      0|		goto fail;
  995|       |
  996|    438|	if (!freerdp_assistance_crypt_derive_key_sha1(PasswordHash, sizeof(PasswordHash), DerivedKey,
  ------------------
  |  Branch (996:6): [True: 0, False: 438]
  ------------------
  997|    438|	                                              sizeof(DerivedKey)))
  998|      0|		goto fail;
  999|       |
 1000|    438|	aesDec =
 1001|    438|	    winpr_Cipher_NewEx(WINPR_CIPHER_AES_128_CBC, WINPR_DECRYPT, DerivedKey, sizeof(DerivedKey),
 1002|    438|	                       InitializationVector, sizeof(InitializationVector));
 1003|       |
 1004|    438|	if (!aesDec)
  ------------------
  |  Branch (1004:6): [True: 0, False: 438]
  ------------------
 1005|      0|		goto fail;
 1006|       |
 1007|    438|	cbOut = cbFinal = 0;
 1008|    438|	cbIn = file->EncryptedLHTicketLength;
 1009|    438|	pbIn = file->EncryptedLHTicket;
 1010|    438|	pbOut = (BYTE*)calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2);
  ------------------
  |  |  205|    438|#define WINPR_AES_BLOCK_SIZE 16
  ------------------
 1011|       |
 1012|    438|	if (!pbOut)
  ------------------
  |  Branch (1012:6): [True: 0, False: 438]
  ------------------
 1013|      0|		goto fail;
 1014|       |
 1015|    438|	if (!winpr_Cipher_Update(aesDec, pbIn, cbIn, pbOut, &cbOut))
  ------------------
  |  Branch (1015:6): [True: 0, False: 438]
  ------------------
 1016|      0|		goto fail;
 1017|       |
 1018|    438|	if (!winpr_Cipher_Final(aesDec, pbOut + cbOut, &cbFinal))
  ------------------
  |  Branch (1018:6): [True: 196, False: 242]
  ------------------
 1019|    196|	{
 1020|    196|		WLog_ERR(TAG, "winpr_Cipher_Final failure");
  ------------------
  |  |  348|    196|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1021|    196|		goto fail;
 1022|    196|	}
 1023|       |
 1024|    242|	cbOut += cbFinal;
 1025|    242|	cbFinal = 0;
 1026|       |
 1027|    242|	union
 1028|    242|	{
 1029|    242|		const WCHAR* wc;
 1030|    242|		const BYTE* b;
 1031|    242|	} cnv;
 1032|       |
 1033|    242|	cnv.b = pbOut;
 1034|    242|	cchOutW = cbOut / sizeof(WCHAR);
 1035|       |
 1036|    242|	if (!update_connectionstring2_wchar(file, cnv.wc, cchOutW))
  ------------------
  |  Branch (1036:6): [True: 85, False: 157]
  ------------------
 1037|     85|	{
 1038|     85|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: Conversion from UCS2 to UTF8 failed");
  ------------------
  |  |  348|     85|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1039|     85|		goto fail;
 1040|     85|	}
 1041|       |
 1042|    157|	if (!freerdp_assistance_parse_connection_string2(file))
  ------------------
  |  Branch (1042:6): [True: 157, False: 0]
  ------------------
 1043|    157|		goto fail;
 1044|       |
 1045|      0|	rc = TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
 1046|    438|fail:
 1047|    438|	winpr_Cipher_Free(aesDec);
 1048|    438|	free(PasswordW);
 1049|    438|	free(pbOut);
 1050|    438|	WLog_DBG(TAG, "freerdp_assistance_parse_connection_string2: %d", status);
  ------------------
  |  |  342|    438|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
 1051|    438|	return rc;
 1052|      0|}
assistance.c:freerdp_assistance_crypt_derive_key_sha1:
  226|    438|{
  227|    438|	BOOL rc = FALSE;
  ------------------
  |  |  122|    438|#define FALSE false
  ------------------
  228|    438|	BYTE pad1[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    438|	{                      \
  |  |   86|    438|	} /** @since version 3.24.0 */
  ------------------
  229|    438|	BYTE pad2[64] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    438|	{                      \
  |  |   86|    438|	} /** @since version 3.24.0 */
  ------------------
  230|       |
  231|    438|	if (hashLength == 0)
  ------------------
  |  Branch (231:6): [True: 0, False: 438]
  ------------------
  232|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  233|       |
  234|    438|	memset(pad1, 0x36, sizeof(pad1));
  235|    438|	memset(pad2, 0x5C, sizeof(pad2));
  236|       |
  237|  9.19k|	for (size_t i = 0; i < hashLength; i++)
  ------------------
  |  Branch (237:21): [True: 8.76k, False: 438]
  ------------------
  238|  8.76k|	{
  239|  8.76k|		pad1[i] ^= hash[i];
  240|  8.76k|		pad2[i] ^= hash[i];
  241|  8.76k|	}
  242|       |
  243|    438|	BYTE* buffer = (BYTE*)calloc(hashLength, 2);
  244|       |
  245|    438|	if (!buffer)
  ------------------
  |  Branch (245:6): [True: 0, False: 438]
  ------------------
  246|      0|		goto fail;
  247|       |
  248|    438|	if (!winpr_Digest(WINPR_MD_SHA1, pad1, 64, buffer, hashLength))
  ------------------
  |  Branch (248:6): [True: 0, False: 438]
  ------------------
  249|      0|		goto fail;
  250|       |
  251|    438|	if (!winpr_Digest(WINPR_MD_SHA1, pad2, 64, &buffer[hashLength], hashLength))
  ------------------
  |  Branch (251:6): [True: 0, False: 438]
  ------------------
  252|      0|		goto fail;
  253|       |
  254|    438|	CopyMemory(key, buffer, keyLength);
  ------------------
  |  |  123|    438|#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
  ------------------
  255|    438|	rc = TRUE;
  ------------------
  |  |  126|    438|#define TRUE true
  ------------------
  256|    438|fail:
  257|    438|	free(buffer);
  258|    438|	return rc;
  259|    438|}
assistance.c:update_connectionstring2_wchar:
  173|    242|{
  174|    242|	char* strc = nullptr;
  175|       |
  176|    242|	if (!str && (len != 0))
  ------------------
  |  Branch (176:6): [True: 0, False: 242]
  |  Branch (176:14): [True: 0, False: 0]
  ------------------
  177|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  178|       |
  179|    242|	if (str && (len > 0))
  ------------------
  |  Branch (179:6): [True: 242, False: 0]
  |  Branch (179:13): [True: 241, False: 1]
  ------------------
  180|    241|	{
  181|    241|		strc = ConvertWCharNToUtf8Alloc(str, len, nullptr);
  182|    241|		if (!strc)
  ------------------
  |  Branch (182:7): [True: 85, False: 156]
  ------------------
  183|     85|			return FALSE;
  ------------------
  |  |  122|     85|#define FALSE false
  ------------------
  184|    241|	}
  185|    157|	return update_connectionstring2_nocopy(file, strc);
  186|    242|}
assistance.c:freerdp_assistance_parse_connection_string1:
  337|    621|{
  338|    621|	char* tokens[8] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|    621|	{                      \
  |  |   86|    621|	} /** @since version 3.24.0 */
  ------------------
  339|    621|	BOOL rc = FALSE;
  ------------------
  |  |  122|    621|#define FALSE false
  ------------------
  340|       |
  341|    621|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    621|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    621|	do                                                                                             \
  |  |  |  |   61|    621|	{                                                                                              \
  |  |  |  |   62|    621|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    621|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    621|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    621|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    621|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    621|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    621|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    621|                                                                                                   \
  |  |  |  |   70|    621|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    621|	do                                                      \
  |  |  |  |  |  |   32|    621|	{                                                       \
  |  |  |  |  |  |   33|    621|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 621]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    621|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    621|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 621]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    621|                                                                                                   \
  |  |  |  |   72|    621|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    621|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    621|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    621|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 621]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  342|       |
  343|    621|	if (!file->RCTicket)
  ------------------
  |  Branch (343:6): [True: 31, False: 590]
  ------------------
  344|     31|		return FALSE;
  ------------------
  |  |  122|     31|#define FALSE false
  ------------------
  345|       |
  346|       |	/**
  347|       |	 * <ProtocolVersion>,<protocolType>,<machineAddressList>,<assistantAccountPwd>,
  348|       |	 * <RASessionID>,<RASessionName>,<RASessionPwd>,<protocolSpecificParms>
  349|       |	 */
  350|    590|	char* str = _strdup(file->RCTicket);
  351|       |
  352|    590|	if (!str)
  ------------------
  |  Branch (352:6): [True: 0, False: 590]
  ------------------
  353|      0|		goto error;
  354|       |
  355|    590|	{
  356|    590|		const size_t length = strlen(str);
  357|       |
  358|    590|		{
  359|    590|			int count = 1;
  360|  5.59M|			for (size_t i = 0; i < length; i++)
  ------------------
  |  Branch (360:23): [True: 5.59M, False: 590]
  ------------------
  361|  5.59M|			{
  362|  5.59M|				if (str[i] == ',')
  ------------------
  |  Branch (362:9): [True: 998k, False: 4.59M]
  ------------------
  363|   998k|					count++;
  364|  5.59M|			}
  365|       |
  366|    590|			if (count != 8)
  ------------------
  |  Branch (366:8): [True: 33, False: 557]
  ------------------
  367|     33|				goto error;
  368|    590|		}
  369|       |
  370|    557|		{
  371|    557|			size_t count = 0;
  372|    557|			tokens[count++] = str;
  373|       |
  374|  4.59M|			for (size_t i = 0; i < length; i++)
  ------------------
  |  Branch (374:23): [True: 4.59M, False: 557]
  ------------------
  375|  4.59M|			{
  376|  4.59M|				if (str[i] == ',')
  ------------------
  |  Branch (376:9): [True: 3.89k, False: 4.59M]
  ------------------
  377|  3.89k|				{
  378|  3.89k|					str[i] = '\0';
  379|  3.89k|					tokens[count++] = &str[i + 1];
  380|  3.89k|				}
  381|  4.59M|			}
  382|    557|		}
  383|    557|	}
  384|       |
  385|    557|	if (strcmp(tokens[0], "65538") != 0)
  ------------------
  |  Branch (385:6): [True: 56, False: 501]
  ------------------
  386|     56|		goto error;
  387|       |
  388|    501|	if (strcmp(tokens[1], "1") != 0)
  ------------------
  |  Branch (388:6): [True: 2, False: 499]
  ------------------
  389|      2|		goto error;
  390|       |
  391|    499|	if (strcmp(tokens[3], "*") != 0)
  ------------------
  |  Branch (391:6): [True: 3, False: 496]
  ------------------
  392|      3|		goto error;
  393|       |
  394|    496|	if (strcmp(tokens[5], "*") != 0)
  ------------------
  |  Branch (394:6): [True: 2, False: 494]
  ------------------
  395|      2|		goto error;
  396|       |
  397|    494|	if (strcmp(tokens[6], "*") != 0)
  ------------------
  |  Branch (397:6): [True: 3, False: 491]
  ------------------
  398|      3|		goto error;
  399|       |
  400|    491|	file->RASessionId = _strdup(tokens[4]);
  401|       |
  402|    491|	if (!file->RASessionId)
  ------------------
  |  Branch (402:6): [True: 0, False: 491]
  ------------------
  403|      0|		goto error;
  404|       |
  405|    491|	file->RASpecificParams = _strdup(tokens[7]);
  406|       |
  407|    491|	if (!file->RASpecificParams)
  ------------------
  |  Branch (407:6): [True: 0, False: 491]
  ------------------
  408|      0|		goto error;
  409|       |
  410|    491|	if (!freerdp_assistance_parse_address_list(file, tokens[2]))
  ------------------
  |  Branch (410:6): [True: 174, False: 317]
  ------------------
  411|    174|		goto error;
  412|       |
  413|    317|	rc = TRUE;
  ------------------
  |  |  126|    317|#define TRUE true
  ------------------
  414|    590|error:
  415|    590|	free(str);
  416|    590|	return rc;
  417|    317|}
assistance.c:freerdp_assistance_parse_address_list:
  299|    491|{
  300|    491|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    491|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    491|	do                                                                                             \
  |  |  |  |   61|    491|	{                                                                                              \
  |  |  |  |   62|    491|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    491|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    491|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    491|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    491|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    491|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    491|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    491|                                                                                                   \
  |  |  |  |   70|    491|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    491|	do                                                      \
  |  |  |  |  |  |   32|    491|	{                                                       \
  |  |  |  |  |  |   33|    491|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 491]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    491|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    491|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 491]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    491|                                                                                                   \
  |  |  |  |   72|    491|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    491|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    491|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    491|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 491]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|       |
  302|    491|	WLog_DBG(TAG, "freerdp_assistance_parse_address_list list=%s", list);
  ------------------
  |  |  342|    491|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  303|       |
  304|    491|	BOOL rc = FALSE;
  ------------------
  |  |  122|    491|#define FALSE false
  ------------------
  305|       |
  306|    491|	if (!list)
  ------------------
  |  Branch (306:6): [True: 0, False: 491]
  ------------------
  307|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  308|       |
  309|    491|	char* strp = list;
  310|    491|	char* s = ";";
  311|       |
  312|       |	// get the first token
  313|    491|	char* saveptr = nullptr;
  314|    491|	char* token = strtok_s(strp, s, &saveptr);
  315|       |
  316|       |	// walk through other tokens
  317|   585k|	while (token != nullptr)
  ------------------
  |  Branch (317:9): [True: 584k, False: 317]
  ------------------
  318|   584k|	{
  319|   584k|		char* port = strchr(token, ':');
  320|   584k|		if (!port)
  ------------------
  |  Branch (320:7): [True: 16, False: 584k]
  ------------------
  321|     16|			goto out;
  322|   584k|		*port = '\0';
  323|   584k|		port++;
  324|       |
  325|   584k|		if (!append_address(file, token, port))
  ------------------
  |  Branch (325:7): [True: 158, False: 584k]
  ------------------
  326|    158|			goto out;
  327|       |
  328|   584k|		token = strtok_s(nullptr, s, &saveptr);
  329|   584k|	}
  330|    317|	rc = TRUE;
  ------------------
  |  |  126|    317|#define TRUE true
  ------------------
  331|    491|out:
  332|    491|	return rc;
  333|    317|}
assistance.c:append_address:
  279|   584k|{
  280|   584k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|   584k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   584k|	do                                                                                             \
  |  |  |  |   61|   584k|	{                                                                                              \
  |  |  |  |   62|   584k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   584k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   584k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   584k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   584k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   584k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   584k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   584k|                                                                                                   \
  |  |  |  |   70|   584k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   584k|	do                                                      \
  |  |  |  |  |  |   32|   584k|	{                                                       \
  |  |  |  |  |  |   33|   584k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 584k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   584k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   584k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 584k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   584k|                                                                                                   \
  |  |  |  |   72|   584k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   584k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   584k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   584k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 584k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|       |
  282|   584k|	errno = 0;
  283|   584k|	unsigned long p = strtoul(port, nullptr, 0);
  284|       |
  285|   584k|	if ((errno != 0) || (p == 0) || (p > UINT16_MAX))
  ------------------
  |  Branch (285:6): [True: 2, False: 584k]
  |  Branch (285:22): [True: 3, False: 584k]
  |  Branch (285:34): [True: 124, False: 584k]
  ------------------
  286|    129|	{
  287|    129|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 invalid port value %s",
  ------------------
  |  |  348|    129|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  288|    129|		         port);
  289|    129|		return FALSE;
  ------------------
  |  |  122|    129|#define FALSE false
  ------------------
  290|    129|	}
  291|       |
  292|   584k|	if (!append_address_to_list(file->MachineAddresses, host, host ? strlen(host) : 0))
  ------------------
  |  Branch (292:6): [True: 29, False: 584k]
  |  Branch (292:60): [True: 584k, False: 0]
  ------------------
  293|     29|		return FALSE;
  ------------------
  |  |  122|     29|#define FALSE false
  ------------------
  294|   584k|	return ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p);
  295|   584k|}
assistance.c:append_address_to_list:
  263|   587k|{
  264|   587k|	char* copy = nullptr;
  265|   587k|	if (len > 0)
  ------------------
  |  Branch (265:6): [True: 587k, False: 29]
  ------------------
  266|   587k|		copy = strndup(str, len);
  267|   587k|	if (!copy)
  ------------------
  |  Branch (267:6): [True: 29, False: 587k]
  ------------------
  268|     29|		return FALSE;
  ------------------
  |  |  122|     29|#define FALSE false
  ------------------
  269|       |
  270|   587k|	const BOOL rc = ArrayList_Append(MachineAddresses, copy);
  271|   587k|	if (!rc)
  ------------------
  |  Branch (271:6): [True: 0, False: 587k]
  ------------------
  272|      0|		free(copy);
  273|       |	// NOLINTNEXTLINE(clang-analyzer-unix.Malloc): ArrayList_Append takes ownership of copy
  274|   587k|	return rc;
  275|   587k|}
assistance.c:freerdp_assistance_contains_element:
  547|   184k|{
  548|   184k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|   184k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   184k|	do                                                                                             \
  |  |  |  |   61|   184k|	{                                                                                              \
  |  |  |  |   62|   184k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   184k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   184k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   184k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   184k|                                                                                                   \
  |  |  |  |   70|   184k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   184k|	do                                                      \
  |  |  |  |  |  |   32|   184k|	{                                                       \
  |  |  |  |  |  |   33|   184k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   184k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   184k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   184k|                                                                                                   \
  |  |  |  |   72|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   184k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   184k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   184k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  549|   184k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|   184k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   184k|	do                                                                                             \
  |  |  |  |   61|   184k|	{                                                                                              \
  |  |  |  |   62|   184k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   184k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   184k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   184k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   184k|                                                                                                   \
  |  |  |  |   70|   184k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   184k|	do                                                      \
  |  |  |  |  |  |   32|   184k|	{                                                       \
  |  |  |  |  |  |   33|   184k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   184k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   184k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   184k|                                                                                                   \
  |  |  |  |   72|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   184k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   184k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   184k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|   184k|	WINPR_ASSERT(plen);
  ------------------
  |  |   76|   184k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   184k|	do                                                                                             \
  |  |  |  |   61|   184k|	{                                                                                              \
  |  |  |  |   62|   184k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   184k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   184k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   184k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   184k|                                                                                                   \
  |  |  |  |   70|   184k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   184k|	do                                                      \
  |  |  |  |  |  |   32|   184k|	{                                                       \
  |  |  |  |  |  |   33|   184k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   184k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   184k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   184k|                                                                                                   \
  |  |  |  |   72|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   184k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   184k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   184k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|       |
  552|   184k|	char bkey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|   184k|	{                      \
  |  |   86|   184k|	} /** @since version 3.24.0 */
  ------------------
  553|   184k|	const int rc = _snprintf(bkey, sizeof(bkey), "<%s", key);
  ------------------
  |  |  295|   184k|#define _snprintf snprintf
  ------------------
  554|   184k|	WINPR_ASSERT(rc > 0);
  ------------------
  |  |   76|   184k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   184k|	do                                                                                             \
  |  |  |  |   61|   184k|	{                                                                                              \
  |  |  |  |   62|   184k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   184k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   184k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   184k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   184k|                                                                                                   \
  |  |  |  |   70|   184k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   184k|	do                                                      \
  |  |  |  |  |  |   32|   184k|	{                                                       \
  |  |  |  |  |  |   33|   184k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   184k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   184k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   184k|                                                                                                   \
  |  |  |  |   72|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   184k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   184k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   184k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|   184k|	WINPR_ASSERT((size_t)rc < sizeof(bkey));
  ------------------
  |  |   76|   184k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   184k|	do                                                                                             \
  |  |  |  |   61|   184k|	{                                                                                              \
  |  |  |  |   62|   184k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   184k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   184k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   184k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   184k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   184k|                                                                                                   \
  |  |  |  |   70|   184k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   184k|	do                                                      \
  |  |  |  |  |  |   32|   184k|	{                                                       \
  |  |  |  |  |  |   33|   184k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   184k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   184k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   184k|                                                                                                   \
  |  |  |  |   72|   184k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   184k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   184k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   184k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|   184k|	if ((rc < 0) || ((size_t)rc >= sizeof(bkey)))
  ------------------
  |  Branch (556:6): [True: 0, False: 184k]
  |  Branch (556:18): [True: 0, False: 184k]
  ------------------
  557|      0|		return nullptr;
  558|       |
  559|   184k|	char* tag = winpr_strnstr(input, bkey, ilen);
  560|   184k|	if (!tag)
  ------------------
  |  Branch (560:6): [True: 10.9k, False: 173k]
  ------------------
  561|  10.9k|		return nullptr;
  562|       |
  563|   173k|	const intptr_t tdiff = (tag - input);
  564|   173k|	WINPR_ASSERT(tdiff >= 0);
  ------------------
  |  |   76|   173k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   173k|	do                                                                                             \
  |  |  |  |   61|   173k|	{                                                                                              \
  |  |  |  |   62|   173k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   173k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   173k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   173k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   173k|                                                                                                   \
  |  |  |  |   70|   173k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   173k|	do                                                      \
  |  |  |  |  |  |   32|   173k|	{                                                       \
  |  |  |  |  |  |   33|   173k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   173k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   173k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   173k|                                                                                                   \
  |  |  |  |   72|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   173k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   173k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   173k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 173k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  565|   173k|	const size_t utdiff = WINPR_ASSERTING_INT_CAST(size_t, tdiff);
  ------------------
  |  |  180|   173k|	__extension__({                                                                             \
  |  |  181|   173k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|   173k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   173k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   173k|	do                                                                                             \
  |  |  |  |  |  |   61|   173k|	{                                                                                              \
  |  |  |  |  |  |   62|   173k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   173k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   173k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   173k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   173k|                                                                                                   \
  |  |  |  |  |  |   70|   173k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   173k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   173k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   173k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 173k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   173k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   173k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 173k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   173k|                                                                                                   \
  |  |  |  |  |  |   72|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   173k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   173k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   173k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|   173k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|   173k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   173k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   173k|	do                                                                                             \
  |  |  |  |  |  |   61|   173k|	{                                                                                              \
  |  |  |  |  |  |   62|   173k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   173k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   173k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   173k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   173k|                                                                                                   \
  |  |  |  |  |  |   70|   173k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   173k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   173k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   694k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 87.4k, False: 86.3k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 87.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 86.3k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 86.3k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   173k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   173k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 173k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   173k|                                                                                                   \
  |  |  |  |  |  |   72|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   173k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   173k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   173k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|   173k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|   173k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|   173k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|   173k|	})
  ------------------
  566|   173k|	WINPR_ASSERT(utdiff <= ilen);
  ------------------
  |  |   76|   173k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   173k|	do                                                                                             \
  |  |  |  |   61|   173k|	{                                                                                              \
  |  |  |  |   62|   173k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   173k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   173k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   173k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   173k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   173k|                                                                                                   \
  |  |  |  |   70|   173k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   173k|	do                                                      \
  |  |  |  |  |  |   32|   173k|	{                                                       \
  |  |  |  |  |  |   33|   173k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   173k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   173k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   173k|                                                                                                   \
  |  |  |  |   72|   173k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   173k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   173k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   173k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 173k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  567|   173k|	const size_t tlen = ilen - utdiff;
  568|   173k|	const size_t texpect = strnlen(bkey, sizeof(bkey));
  569|   173k|	if (tlen <= texpect)
  ------------------
  |  Branch (569:6): [True: 2, False: 173k]
  ------------------
  570|      2|		return nullptr;
  571|       |
  572|   173k|	char* data = tag + texpect;
  573|       |
  574|       |	/* Ensure there is a valid delimiter following our token */
  575|   173k|	switch (data[0])
  576|   173k|	{
  577|  3.25k|		case '>':
  ------------------
  |  Branch (577:3): [True: 3.25k, False: 170k]
  ------------------
  578|  38.6k|		case '/':
  ------------------
  |  Branch (578:3): [True: 35.3k, False: 138k]
  ------------------
  579|   102k|		case ' ':
  ------------------
  |  Branch (579:3): [True: 63.4k, False: 110k]
  ------------------
  580|   104k|		case '\t':
  ------------------
  |  Branch (580:3): [True: 1.95k, False: 171k]
  ------------------
  581|   104k|			break;
  582|  69.7k|		default:
  ------------------
  |  Branch (582:3): [True: 69.7k, False: 104k]
  ------------------
  583|  69.7k|			WLog_ERR(TAG,
  ------------------
  |  |  348|  69.7k|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  584|  69.7k|			         "Failed to parse ASSISTANCE file: ConnectionString2 missing delimiter after "
  585|  69.7k|			         "field %s",
  586|  69.7k|			         bkey);
  587|  69.7k|			return nullptr;
  588|   173k|	}
  589|       |
  590|   104k|	const char* start = winpr_strnstr(tag, ">", tlen);
  591|       |
  592|   104k|	if (!start || (start > input + ilen))
  ------------------
  |  Branch (592:6): [True: 7.06k, False: 96.9k]
  |  Branch (592:16): [True: 0, False: 96.9k]
  ------------------
  593|  7.06k|	{
  594|  7.06k|		WLog_ERR(TAG, "Failed to parse ASSISTANCE file: ConnectionString2 missing field %s", bkey);
  ------------------
  |  |  348|  7.06k|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  595|  7.06k|		return nullptr;
  596|  7.06k|	}
  597|       |
  598|  96.9k|	const char* end = start;
  599|  96.9k|	const char* dend = start - 1;
  600|  96.9k|	if (*dend != '/')
  ------------------
  |  Branch (600:6): [True: 3.87k, False: 93.1k]
  ------------------
  601|  3.87k|	{
  602|  3.87k|		char ekey[128] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  3.87k|	{                      \
  |  |   86|  3.87k|	} /** @since version 3.24.0 */
  ------------------
  603|  3.87k|		const int erc = _snprintf(ekey, sizeof(ekey), "</%s>", key);
  ------------------
  |  |  295|  3.87k|#define _snprintf snprintf
  ------------------
  604|  3.87k|		WINPR_ASSERT(erc > 0);
  ------------------
  |  |   76|  3.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  3.87k|	do                                                                                             \
  |  |  |  |   61|  3.87k|	{                                                                                              \
  |  |  |  |   62|  3.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  3.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  3.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  3.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  3.87k|                                                                                                   \
  |  |  |  |   70|  3.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  3.87k|	do                                                      \
  |  |  |  |  |  |   32|  3.87k|	{                                                       \
  |  |  |  |  |  |   33|  3.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  3.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.87k|                                                                                                   \
  |  |  |  |   72|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  3.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  3.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  3.87k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 3.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  3.87k|		WINPR_ASSERT((size_t)erc < sizeof(ekey));
  ------------------
  |  |   76|  3.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  3.87k|	do                                                                                             \
  |  |  |  |   61|  3.87k|	{                                                                                              \
  |  |  |  |   62|  3.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  3.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  3.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  3.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  3.87k|                                                                                                   \
  |  |  |  |   70|  3.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  3.87k|	do                                                      \
  |  |  |  |  |  |   32|  3.87k|	{                                                       \
  |  |  |  |  |  |   33|  3.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  3.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.87k|                                                                                                   \
  |  |  |  |   72|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  3.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  3.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  3.87k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 3.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  606|  3.87k|		if ((erc <= 0) || ((size_t)erc >= sizeof(ekey)))
  ------------------
  |  Branch (606:7): [True: 0, False: 3.87k]
  |  Branch (606:21): [True: 0, False: 3.87k]
  ------------------
  607|      0|			return nullptr;
  608|  3.87k|		const size_t offset = WINPR_ASSERTING_INT_CAST(size_t, start - tag);
  ------------------
  |  |  180|  3.87k|	__extension__({                                                                             \
  |  |  181|  3.87k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  3.87k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  3.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.87k|	do                                                                                             \
  |  |  |  |  |  |   61|  3.87k|	{                                                                                              \
  |  |  |  |  |  |   62|  3.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  3.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  3.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  3.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  3.87k|                                                                                                   \
  |  |  |  |  |  |   70|  3.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  3.87k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  3.87k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  3.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 3.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  3.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  3.87k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.87k|                                                                                                   \
  |  |  |  |  |  |   72|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  3.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  3.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  3.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  3.87k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  3.87k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  3.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.87k|	do                                                                                             \
  |  |  |  |  |  |   61|  3.87k|	{                                                                                              \
  |  |  |  |  |  |   62|  3.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  3.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  3.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  3.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  3.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  3.87k|                                                                                                   \
  |  |  |  |  |  |   70|  3.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  3.87k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  3.87k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  11.6k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.87k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 3.87k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  3.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  3.87k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.87k|                                                                                                   \
  |  |  |  |  |  |   72|  3.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  3.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  3.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  3.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  3.87k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  3.87k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  3.87k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  3.87k|	})
  ------------------
  609|  3.87k|		dend = end = strrstr(start, ilen - offset, ekey);
  610|  3.87k|		if (end)
  ------------------
  |  Branch (610:7): [True: 3.64k, False: 230]
  ------------------
  611|  3.64k|			end += strnlen(ekey, sizeof(ekey));
  612|  3.87k|	}
  613|       |
  614|  96.9k|	if (!end)
  ------------------
  |  Branch (614:6): [True: 230, False: 96.7k]
  ------------------
  615|    230|	{
  616|    230|		WLog_ERR(TAG,
  ------------------
  |  |  348|    230|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  617|    230|		         "Failed to parse ASSISTANCE file: ConnectionString2 missing end tag for field %s",
  618|    230|		         key);
  619|    230|		return nullptr;
  620|    230|	}
  621|  96.7k|	if (plen)
  ------------------
  |  Branch (621:6): [True: 96.7k, False: 0]
  ------------------
  622|  96.7k|		*plen = WINPR_ASSERTING_INT_CAST(size_t, end - tag);
  ------------------
  |  |  180|  96.7k|	__extension__({                                                                             \
  |  |  181|  96.7k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  96.7k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  96.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  96.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  96.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  96.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  96.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  96.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  96.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  96.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  96.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  96.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  96.7k|                                                                                                   \
  |  |  |  |  |  |   70|  96.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  96.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  96.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  96.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 96.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  96.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  96.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 96.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  96.7k|                                                                                                   \
  |  |  |  |  |  |   72|  96.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  96.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  96.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  96.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 96.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  96.7k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  96.7k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  96.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  96.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  96.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  96.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  96.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  96.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  96.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  96.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  96.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  96.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  96.7k|                                                                                                   \
  |  |  |  |  |  |   70|  96.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  96.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  96.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   290k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 96.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 96.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  96.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  96.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 96.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  96.7k|                                                                                                   \
  |  |  |  |  |  |   72|  96.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  96.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  96.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  96.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 96.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  96.7k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  96.7k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  96.7k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  96.7k|	})
  ------------------
  623|       |
  624|  96.7k|	if (pdata)
  ------------------
  |  Branch (624:6): [True: 95.9k, False: 760]
  ------------------
  625|  95.9k|		*pdata = data;
  626|  96.7k|	if (pdlen)
  ------------------
  |  Branch (626:6): [True: 95.9k, False: 760]
  ------------------
  627|  95.9k|		*pdlen = WINPR_ASSERTING_INT_CAST(size_t, dend - data);
  ------------------
  |  |  180|  95.9k|	__extension__({                                                                             \
  |  |  181|  95.9k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  95.9k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  95.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  95.9k|	do                                                                                             \
  |  |  |  |  |  |   61|  95.9k|	{                                                                                              \
  |  |  |  |  |  |   62|  95.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  95.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  95.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  95.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  95.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  95.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  95.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  95.9k|                                                                                                   \
  |  |  |  |  |  |   70|  95.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  95.9k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  95.9k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  95.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 95.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  95.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  95.9k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 95.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  95.9k|                                                                                                   \
  |  |  |  |  |  |   72|  95.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  95.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  95.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  95.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 95.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  95.9k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  95.9k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  95.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  95.9k|	do                                                                                             \
  |  |  |  |  |  |   61|  95.9k|	{                                                                                              \
  |  |  |  |  |  |   62|  95.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  95.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  95.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  95.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  95.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  95.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  95.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  95.9k|                                                                                                   \
  |  |  |  |  |  |   70|  95.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  95.9k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  95.9k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   298k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 90.7k, False: 5.29k]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 90.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.29k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 5.29k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  95.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  95.9k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 95.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  95.9k|                                                                                                   \
  |  |  |  |  |  |   72|  95.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  95.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  95.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  95.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 95.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  95.9k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  95.9k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  95.9k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  95.9k|	})
  ------------------
  628|  96.7k|	return tag;
  629|  96.9k|}
assistance.c:strrstr:
   80|  3.87k|{
   81|  3.87k|	if (*needle == '\0')
  ------------------
  |  Branch (81:6): [True: 0, False: 3.87k]
  ------------------
   82|      0|		return haystack;
   83|       |
   84|  3.87k|	const char* result = nullptr;
   85|  3.87k|	for (;;)
   86|  10.9k|	{
   87|  10.9k|		const char* p = strstr(haystack, needle);
   88|  10.9k|		if (p == nullptr)
  ------------------
  |  Branch (88:7): [True: 3.87k, False: 7.11k]
  ------------------
   89|  3.87k|			break;
   90|  7.11k|		if (p > haystack + len)
  ------------------
  |  Branch (90:7): [True: 0, False: 7.11k]
  ------------------
   91|      0|			return nullptr;
   92|       |
   93|  7.11k|		result = p;
   94|  7.11k|		haystack = p + 1;
   95|  7.11k|	}
   96|       |
   97|  3.87k|	return result;
   98|  3.87k|}
assistance.c:update_connectionstring2:
  157|    760|{
  158|    760|	char* strc = nullptr;
  159|    760|	if (!str && (len != 0))
  ------------------
  |  Branch (159:6): [True: 0, False: 760]
  |  Branch (159:14): [True: 0, False: 0]
  ------------------
  160|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  161|       |
  162|    760|	if (str && (len > 0))
  ------------------
  |  Branch (162:6): [True: 760, False: 0]
  |  Branch (162:13): [True: 760, False: 0]
  ------------------
  163|    760|	{
  164|    760|		strc = strndup(str, len);
  165|    760|		if (!strc)
  ------------------
  |  Branch (165:7): [True: 0, False: 760]
  ------------------
  166|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  167|    760|	}
  168|    760|	return update_connectionstring2_nocopy(file, strc);
  169|    760|}
assistance.c:setup_string:
 1424|  4.31k|{
 1425|  4.31k|	WINPR_ASSERT(list);
  ------------------
  |  |   76|  4.31k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  4.31k|	do                                                                                             \
  |  |  |  |   61|  4.31k|	{                                                                                              \
  |  |  |  |   62|  4.31k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  4.31k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  4.31k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  4.31k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  4.31k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  4.31k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  4.31k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  4.31k|                                                                                                   \
  |  |  |  |   70|  4.31k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  4.31k|	do                                                      \
  |  |  |  |  |  |   32|  4.31k|	{                                                       \
  |  |  |  |  |  |   33|  4.31k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 4.31k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.31k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  4.31k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 4.31k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.31k|                                                                                                   \
  |  |  |  |   72|  4.31k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  4.31k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  4.31k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  4.31k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 4.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1426|       |
 1427|  4.31k|	wObject* obj = ArrayList_Object(list);
 1428|  4.31k|	if (!obj)
  ------------------
  |  Branch (1428:6): [True: 0, False: 4.31k]
  ------------------
 1429|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
 1430|  4.31k|	obj->fnObjectFree = free;
 1431|       |	// obj->fnObjectNew = wwinpr_ObjectStringClone;
 1432|  4.31k|	return TRUE;
  ------------------
  |  |  126|  4.31k|#define TRUE true
  ------------------
 1433|  4.31k|}
assistance.c:update_connectionstring2_nocopy:
  145|    917|{
  146|    917|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    917|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    917|	do                                                                                             \
  |  |  |  |   61|    917|	{                                                                                              \
  |  |  |  |   62|    917|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    917|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    917|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    917|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    917|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    917|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    917|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    917|                                                                                                   \
  |  |  |  |   70|    917|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    917|	do                                                      \
  |  |  |  |  |  |   32|    917|	{                                                       \
  |  |  |  |  |  |   33|    917|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 917]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    917|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    917|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 917]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    917|                                                                                                   \
  |  |  |  |   72|    917|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    917|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    917|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    917|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 917]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|    917|	free(file->ConnectionString2);
  148|    917|	file->ConnectionString2 = nullptr;
  149|    917|	if (!str)
  ------------------
  |  Branch (149:6): [True: 1, False: 916]
  ------------------
  150|      1|		return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  151|    916|	file->ConnectionString2 = str;
  152|    916|	return file->ConnectionString2 != nullptr;
  153|    917|}
assistance.c:update_password:
  133|  2.15k|{
  134|  2.15k|	WINPR_ASSERT(file);
  ------------------
  |  |   76|  2.15k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  2.15k|	do                                                                                             \
  |  |  |  |   61|  2.15k|	{                                                                                              \
  |  |  |  |   62|  2.15k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  2.15k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  2.15k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  2.15k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  2.15k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  2.15k|                                                                                                   \
  |  |  |  |   70|  2.15k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  2.15k|	do                                                      \
  |  |  |  |  |  |   32|  2.15k|	{                                                       \
  |  |  |  |  |  |   33|  2.15k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.15k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  2.15k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  2.15k|                                                                                                   \
  |  |  |  |   72|  2.15k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  2.15k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  2.15k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  2.15k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 2.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|  2.15k|	free(file->password);
  136|  2.15k|	file->password = nullptr;
  137|  2.15k|	if (!password)
  ------------------
  |  Branch (137:6): [True: 0, False: 2.15k]
  ------------------
  138|      0|		return TRUE;
  ------------------
  |  |  126|      0|#define TRUE true
  ------------------
  139|  2.15k|	file->password = _strdup(password);
  140|  2.15k|	return file->password != nullptr;
  141|  2.15k|}
assistance.c:freerdp_assistance_parse_connection_string2:
  779|    917|{
  780|    917|	BOOL rc = FALSE;
  ------------------
  |  |  122|    917|#define FALSE false
  ------------------
  781|       |
  782|    917|	WINPR_ASSERT(file);
  ------------------
  |  |   76|    917|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    917|	do                                                                                             \
  |  |  |  |   61|    917|	{                                                                                              \
  |  |  |  |   62|    917|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    917|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    917|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    917|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    917|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    917|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    917|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    917|                                                                                                   \
  |  |  |  |   70|    917|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    917|	do                                                      \
  |  |  |  |  |  |   32|    917|	{                                                       \
  |  |  |  |  |  |   33|    917|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 917]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    917|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    917|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 917]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    917|                                                                                                   \
  |  |  |  |   72|    917|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    917|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    917|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    917|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 917]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  783|       |
  784|    917|	if (!file->ConnectionString2)
  ------------------
  |  Branch (784:6): [True: 1, False: 916]
  ------------------
  785|      1|		return FALSE;
  ------------------
  |  |  122|      1|#define FALSE false
  ------------------
  786|       |
  787|    916|	char* str = _strdup(file->ConnectionString2);
  788|    916|	if (!str)
  ------------------
  |  Branch (788:6): [True: 0, False: 916]
  ------------------
  789|      0|		goto out_fail;
  790|    916|	const size_t slen = strlen(str);
  791|       |
  792|    916|	{
  793|    916|		char* e = nullptr;
  794|    916|		size_t elen = 0;
  795|    916|		if (!freerdp_assistance_consume_input_and_get_element(str, slen, "E", &e, &elen))
  ------------------
  |  Branch (795:7): [True: 162, False: 754]
  ------------------
  796|    162|			goto out_fail;
  797|       |
  798|    754|		if (!e || (elen == 0))
  ------------------
  |  Branch (798:7): [True: 0, False: 754]
  |  Branch (798:13): [True: 0, False: 754]
  ------------------
  799|      0|			goto out_fail;
  800|    754|		{
  801|    754|			char* a = nullptr;
  802|    754|			size_t alen = 0;
  803|    754|			if (!freerdp_assistance_get_element(e, elen, "A", &a, &alen))
  ------------------
  |  Branch (803:8): [True: 27, False: 727]
  ------------------
  804|     27|				goto out_fail;
  805|       |
  806|    727|			if (!a || (alen == 0))
  ------------------
  |  Branch (806:8): [True: 0, False: 727]
  |  Branch (806:14): [True: 0, False: 727]
  ------------------
  807|      0|				goto out_fail;
  808|       |
  809|    727|			if (!freerdp_assistance_parse_find_elements_of_c(file, e, elen))
  ------------------
  |  Branch (809:8): [True: 144, False: 583]
  ------------------
  810|    144|				goto out_fail;
  811|       |
  812|       |			/* '\0' terminate the detected XML elements so
  813|       |			 * the parser can continue with terminated strings
  814|       |			 */
  815|    583|			a[alen] = '\0';
  816|       |
  817|    583|			if (!freerdp_assistance_parse_attr_str(&file->RASpecificParams, "KH", a))
  ------------------
  |  Branch (817:8): [True: 41, False: 542]
  ------------------
  818|     41|				goto out_fail;
  819|       |
  820|    542|			if (!freerdp_assistance_parse_attr_str(&file->RASpecificParams2, "KH2", a))
  ------------------
  |  Branch (820:8): [True: 4, False: 538]
  ------------------
  821|      4|				goto out_fail;
  822|       |
  823|    538|			if (!freerdp_assistance_parse_attr_str(&file->RASessionId, "ID", a))
  ------------------
  |  Branch (823:8): [True: 7, False: 531]
  ------------------
  824|      7|				goto out_fail;
  825|    538|		}
  826|    538|	}
  827|    531|	rc = TRUE;
  ------------------
  |  |  126|    531|#define TRUE true
  ------------------
  828|    916|out_fail:
  829|    916|	free(str);
  830|    916|	return rc;
  831|    531|}
assistance.c:freerdp_assistance_get_element:
  664|   179k|{
  665|   179k|	WINPR_ASSERT(input);
  ------------------
  |  |   76|   179k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   179k|	do                                                                                             \
  |  |  |  |   61|   179k|	{                                                                                              \
  |  |  |  |   62|   179k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   179k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   179k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   179k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   179k|                                                                                                   \
  |  |  |  |   70|   179k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   179k|	do                                                      \
  |  |  |  |  |  |   32|   179k|	{                                                       \
  |  |  |  |  |  |   33|   179k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   179k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   179k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   179k|                                                                                                   \
  |  |  |  |   72|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   179k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   179k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   179k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  666|   179k|	WINPR_ASSERT(key);
  ------------------
  |  |   76|   179k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   179k|	do                                                                                             \
  |  |  |  |   61|   179k|	{                                                                                              \
  |  |  |  |   62|   179k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   179k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   179k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   179k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   179k|                                                                                                   \
  |  |  |  |   70|   179k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   179k|	do                                                      \
  |  |  |  |  |  |   32|   179k|	{                                                       \
  |  |  |  |  |  |   33|   179k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   179k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   179k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   179k|                                                                                                   \
  |  |  |  |   72|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   179k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   179k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   179k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|   179k|	WINPR_ASSERT(element);
  ------------------
  |  |   76|   179k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   179k|	do                                                                                             \
  |  |  |  |   61|   179k|	{                                                                                              \
  |  |  |  |   62|   179k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   179k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   179k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   179k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   179k|                                                                                                   \
  |  |  |  |   70|   179k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   179k|	do                                                      \
  |  |  |  |  |  |   32|   179k|	{                                                       \
  |  |  |  |  |  |   33|   179k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   179k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   179k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   179k|                                                                                                   \
  |  |  |  |   72|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   179k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   179k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   179k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  668|   179k|	WINPR_ASSERT(elen);
  ------------------
  |  |   76|   179k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   179k|	do                                                                                             \
  |  |  |  |   61|   179k|	{                                                                                              \
  |  |  |  |   62|   179k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   179k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   179k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   179k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   179k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   179k|                                                                                                   \
  |  |  |  |   70|   179k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   179k|	do                                                      \
  |  |  |  |  |  |   32|   179k|	{                                                       \
  |  |  |  |  |  |   33|   179k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   179k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   179k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   179k|                                                                                                   \
  |  |  |  |   72|   179k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   179k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   179k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   179k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  669|       |
  670|   179k|	size_t len = 0;
  671|   179k|	size_t dlen = 0;
  672|   179k|	char* data = nullptr;
  673|   179k|	char* tag = freerdp_assistance_contains_element(input, ilen, key, &len, &data, &dlen);
  674|   179k|	if (!tag)
  ------------------
  |  Branch (674:6): [True: 86.6k, False: 92.9k]
  ------------------
  675|  86.6k|		return FALSE;
  ------------------
  |  |  122|  86.6k|#define FALSE false
  ------------------
  676|       |
  677|  92.9k|	if (tag + len > input + ilen)
  ------------------
  |  Branch (677:6): [True: 0, False: 92.9k]
  ------------------
  678|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  679|       |
  680|  92.9k|	char* end = tag + len;
  681|  92.9k|	*element = data;
  682|  92.9k|	*elen = WINPR_ASSERTING_INT_CAST(size_t, end - data + 1);
  ------------------
  |  |  180|  92.9k|	__extension__({                                                                             \
  |  |  181|  92.9k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  92.9k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  92.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.9k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.9k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.9k|                                                                                                   \
  |  |  |  |  |  |   70|  92.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.9k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.9k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  92.9k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 92.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.9k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.9k|                                                                                                   \
  |  |  |  |  |  |   72|  92.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  92.9k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  92.9k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  92.9k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  92.9k|	do                                                                                             \
  |  |  |  |  |  |   61|  92.9k|	{                                                                                              \
  |  |  |  |  |  |   62|  92.9k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  92.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  92.9k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  92.9k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  92.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  92.9k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  92.9k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  92.9k|                                                                                                   \
  |  |  |  |  |  |   70|  92.9k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  92.9k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  92.9k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   278k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.9k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 92.9k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  92.9k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  92.9k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 92.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  92.9k|                                                                                                   \
  |  |  |  |  |  |   72|  92.9k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  92.9k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  92.9k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  92.9k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 92.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  92.9k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  92.9k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  92.9k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  92.9k|	})
  ------------------
  683|  92.9k|	return TRUE;
  ------------------
  |  |  126|  92.9k|#define TRUE true
  ------------------
  684|  92.9k|}
assistance.c:freerdp_assistance_parse_find_elements_of_c:
  772|    727|{
  773|    727|	return freerdp_assistance_parse_all_elements_of(file, data, len, "C",
  774|    727|	                                                freerdp_assistance_parse_all_elements_of_c);
  775|    727|}
assistance.c:freerdp_assistance_parse_all_elements_of:
  691|  86.9k|{
  692|  86.9k|	char* val = nullptr;
  693|  86.9k|	size_t vlen = 0;
  694|       |
  695|   178k|	while (freerdp_assistance_get_element(data, len, key, &val, &vlen))
  ------------------
  |  Branch (695:9): [True: 92.2k, False: 86.6k]
  ------------------
  696|  92.2k|	{
  697|  92.2k|		if (vlen > len)
  ------------------
  |  Branch (697:7): [True: 0, False: 92.2k]
  ------------------
  698|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  699|  92.2k|		data = val + vlen;
  700|  92.2k|		len = strnlen(data, len - vlen);
  701|  92.2k|		if (vlen > 0)
  ------------------
  |  Branch (701:7): [True: 92.2k, False: 0]
  ------------------
  702|  92.2k|		{
  703|  92.2k|			val[vlen - 1] = '\0';
  704|       |
  705|  92.2k|			if (!fkt(file, val, vlen))
  ------------------
  |  Branch (705:8): [True: 323, False: 91.9k]
  ------------------
  706|    323|				return FALSE;
  ------------------
  |  |  122|    323|#define FALSE false
  ------------------
  707|  92.2k|		}
  708|  92.2k|	}
  709|       |
  710|  86.6k|	return TRUE;
  ------------------
  |  |  126|  86.6k|#define TRUE true
  ------------------
  711|  86.9k|}
assistance.c:freerdp_assistance_parse_all_elements_of_c:
  764|  83.3k|{
  765|  83.3k|	return freerdp_assistance_parse_all_elements_of(file, data, len, "T",
  766|  83.3k|	                                                freerdp_assistance_parse_all_elements_of_t);
  767|  83.3k|}
assistance.c:freerdp_assistance_parse_all_elements_of_t:
  749|  3.01k|{
  750|  3.01k|	UINT32 id = 0;
  751|  3.01k|	UINT32 sid = 0;
  752|  3.01k|	if (!freerdp_assistance_parse_attr_uint32(&id, "ID", data))
  ------------------
  |  Branch (752:6): [True: 102, False: 2.91k]
  ------------------
  753|    102|		return FALSE;
  ------------------
  |  |  122|    102|#define FALSE false
  ------------------
  754|  2.91k|	if (!freerdp_assistance_parse_attr_uint32(&sid, "SID", data))
  ------------------
  |  Branch (754:6): [True: 7, False: 2.90k]
  ------------------
  755|      7|		return FALSE;
  ------------------
  |  |  122|      7|#define FALSE false
  ------------------
  756|  2.90k|	WLog_DBG(TAG, "transport id=%" PRIu32 ", sid=%" PRIu32, id, sid);
  ------------------
  |  |  342|  2.90k|	WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  757|  2.90k|	return freerdp_assistance_parse_all_elements_of(file, data, len, "L",
  758|  2.90k|	                                                freerdp_assistance_parse_all_elements_of_l);
  759|  2.91k|}
assistance.c:freerdp_assistance_parse_all_elements_of_l:
  716|  5.87k|{
  717|  5.87k|	UINT32 p = 0;
  718|  5.87k|	const char* n = nullptr;
  719|  5.87k|	const char* u = nullptr;
  720|  5.87k|	size_t nlen = 0;
  721|  5.87k|	size_t ulen = 0;
  722|  5.87k|	if (!freerdp_assistance_parse_attr_uint32(&p, "P", data))
  ------------------
  |  Branch (722:6): [True: 14, False: 5.86k]
  ------------------
  723|     14|		return FALSE;
  ------------------
  |  |  122|     14|#define FALSE false
  ------------------
  724|  5.86k|	if (!freerdp_assistance_parse_attr(&n, &nlen, "N", data))
  ------------------
  |  Branch (724:6): [True: 10, False: 5.85k]
  ------------------
  725|     10|		return FALSE;
  ------------------
  |  |  122|     10|#define FALSE false
  ------------------
  726|  5.85k|	if (!freerdp_assistance_parse_attr(&u, &ulen, "U", data))
  ------------------
  |  Branch (726:6): [True: 11, False: 5.84k]
  ------------------
  727|     11|		return FALSE;
  ------------------
  |  |  122|     11|#define FALSE false
  ------------------
  728|       |
  729|  5.84k|	if (n && (nlen > 0))
  ------------------
  |  Branch (729:6): [True: 2.45k, False: 3.39k]
  |  Branch (729:11): [True: 912, False: 1.53k]
  ------------------
  730|    912|	{
  731|    912|		if (!append_address_to_list(file->MachineAddresses, n, nlen))
  ------------------
  |  Branch (731:7): [True: 0, False: 912]
  ------------------
  732|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  733|    912|		if (!ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p))
  ------------------
  |  Branch (733:7): [True: 0, False: 912]
  ------------------
  734|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  735|    912|	}
  736|  5.84k|	if (u && (ulen > 0))
  ------------------
  |  Branch (736:6): [True: 2.83k, False: 3.01k]
  |  Branch (736:11): [True: 2.03k, False: 800]
  ------------------
  737|  2.03k|	{
  738|  2.03k|		if (!append_address_to_list(file->MachineAddresses, u, ulen))
  ------------------
  |  Branch (738:7): [True: 0, False: 2.03k]
  ------------------
  739|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  740|  2.03k|		if (!ArrayList_Append(file->MachinePorts, (void*)(uintptr_t)p))
  ------------------
  |  Branch (740:7): [True: 0, False: 2.03k]
  ------------------
  741|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  742|  2.03k|	}
  743|  5.84k|	return TRUE;
  ------------------
  |  |  126|  5.84k|#define TRUE true
  ------------------
  744|  5.84k|}

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

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

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

_strdup:
  303|  4.65k|{
  304|  4.65k|	if (strSource == nullptr)
  ------------------
  |  Branch (304:6): [True: 0, False: 4.65k]
  ------------------
  305|      0|		return nullptr;
  306|       |
  307|  4.65k|	char* strDestination = strdup(strSource);
  308|       |
  309|  4.65k|	if (strDestination == nullptr)
  ------------------
  |  Branch (309:6): [True: 0, False: 4.65k]
  ------------------
  310|      0|		WLog_ERR(TAG, "strdup");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  311|       |
  312|  4.65k|	return strDestination;
  313|  4.65k|}
_wcsnlen:
  409|    397|{
  410|    397|	WINPR_ASSERT(str);
  ------------------
  |  |   76|    397|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    397|	do                                                                                             \
  |  |  |  |   61|    397|	{                                                                                              \
  |  |  |  |   62|    397|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    397|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    397|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    397|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    397|                                                                                                   \
  |  |  |  |   70|    397|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    397|	do                                                      \
  |  |  |  |  |  |   32|    397|	{                                                       \
  |  |  |  |  |  |   33|    397|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    397|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    397|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    397|                                                                                                   \
  |  |  |  |   72|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    397|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    397|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    397|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 397]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  411|       |
  412|    397|	size_t x = 0;
  413|  1.61M|	for (; x < max; x++)
  ------------------
  |  Branch (413:9): [True: 1.61M, False: 298]
  ------------------
  414|  1.61M|	{
  415|  1.61M|		if (str[x] == 0)
  ------------------
  |  Branch (415:7): [True: 99, False: 1.61M]
  ------------------
  416|     99|			return x;
  417|  1.61M|	}
  418|       |
  419|    298|	return x;
  420|    397|}
strtok_s:
  489|   585k|{
  490|   585k|	return strtok_r(strToken, strDelimit, context);
  491|   585k|}
winpr_strnstr:
  935|   288k|{
  936|   288k|	WINPR_ASSERT(haystack || (hlen == 0));
  ------------------
  |  |   76|   288k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   288k|	do                                                                                             \
  |  |  |  |   61|   288k|	{                                                                                              \
  |  |  |  |   62|   288k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   288k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   288k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   288k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   288k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   288k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   288k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   288k|                                                                                                   \
  |  |  |  |   70|   288k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   288k|	do                                                      \
  |  |  |  |  |  |   32|   288k|	{                                                       \
  |  |  |  |  |  |   33|   288k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:9): [True: 288k, False: 0]
  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   288k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   288k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 288k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   288k|                                                                                                   \
  |  |  |  |   72|   288k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   288k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   288k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   288k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 288k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|   288k|	WINPR_ASSERT(needle);
  ------------------
  |  |   76|   288k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   288k|	do                                                                                             \
  |  |  |  |   61|   288k|	{                                                                                              \
  |  |  |  |   62|   288k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   288k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   288k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   288k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   288k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   288k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   288k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   288k|                                                                                                   \
  |  |  |  |   70|   288k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   288k|	do                                                      \
  |  |  |  |  |  |   32|   288k|	{                                                       \
  |  |  |  |  |  |   33|   288k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 288k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   288k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   288k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 288k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   288k|                                                                                                   \
  |  |  |  |   72|   288k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   288k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   288k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   288k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 288k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  938|       |
  939|       |#if defined(WINPR_HAVE_STRNSTR)
  940|       |	return strnstr(haystack, needle, hlen);
  941|       |#else
  942|       |	/* Match native strnstr semantics: search at most hlen characters and stop at
  943|       |	 * the haystack NUL terminator, whichever comes first. */
  944|   288k|	const size_t needle_len = strlen(needle);
  945|       |
  946|   288k|	if (0 == needle_len)
  ------------------
  |  Branch (946:6): [True: 0, False: 288k]
  ------------------
  947|      0|		return WINPR_CAST_CONST_PTR_AWAY(haystack, char*);
  ------------------
  |  |  132|      0|	__extension__({                             \
  |  |  133|      0|		union                                   \
  |  |  134|      0|		{                                       \
  |  |  135|      0|			__typeof(ptr) src;                  \
  |  |  136|      0|			dstType dst;                        \
  |  |  137|      0|		} cnv;                                  \
  |  |  138|      0|		cnv.src = ptr;                          \
  |  |  139|      0|		cnv.dst;                                \
  |  |  140|      0|	})
  ------------------
  948|       |
  949|  83.3M|	for (; (*haystack != '\0') && (hlen >= needle_len); haystack++, hlen--)
  ------------------
  |  Branch (949:9): [True: 83.3M, False: 16.1k]
  |  Branch (949:32): [True: 83.2M, False: 1.86k]
  ------------------
  950|  83.2M|	{
  951|  83.2M|		if ((haystack[0] == needle[0]) && (0 == strncmp(haystack, needle, needle_len)))
  ------------------
  |  Branch (951:7): [True: 2.02M, False: 81.2M]
  |  Branch (951:37): [True: 270k, False: 1.75M]
  ------------------
  952|   270k|			return WINPR_CAST_CONST_PTR_AWAY(haystack, char*);
  ------------------
  |  |  132|   270k|	__extension__({                             \
  |  |  133|   270k|		union                                   \
  |  |  134|   270k|		{                                       \
  |  |  135|   270k|			__typeof(ptr) src;                  \
  |  |  136|   270k|			dstType dst;                        \
  |  |  137|   270k|		} cnv;                                  \
  |  |  138|   270k|		cnv.src = ptr;                          \
  |  |  139|   270k|		cnv.dst;                                \
  |  |  140|   270k|	})
  ------------------
  953|  83.2M|	}
  954|  17.9k|	return nullptr;
  955|   288k|#endif
  956|   288k|}

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

int_MultiByteToWideChar:
  656|  1.95k|{
  657|  1.95k|	size_t cbCharLen = (size_t)cbMultiByte;
  658|       |
  659|  1.95k|	WINPR_UNUSED(dwFlags);
  ------------------
  |  |  758|  1.95k|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  660|       |
  661|       |	/* If cbMultiByte is 0, the function fails */
  662|  1.95k|	if ((cbMultiByte == 0) || (cbMultiByte < -1))
  ------------------
  |  Branch (662:6): [True: 0, False: 1.95k]
  |  Branch (662:28): [True: 0, False: 1.95k]
  ------------------
  663|      0|		return 0;
  664|       |
  665|  1.95k|	if (cchWideChar < 0)
  ------------------
  |  Branch (665:6): [True: 0, False: 1.95k]
  ------------------
  666|      0|		return -1;
  667|       |
  668|  1.95k|	if (cbMultiByte < 0)
  ------------------
  |  Branch (668:6): [True: 0, False: 1.95k]
  ------------------
  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|  1.95k|	else
  676|  1.95k|		cbCharLen = cbMultiByte;
  677|       |
  678|  1.95k|	WINPR_ASSERT(lpMultiByteStr);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  679|  1.95k|	switch (CodePage)
  680|  1.95k|	{
  681|      0|		case CP_ACP:
  ------------------
  |  |  117|      0|#define CP_ACP 0
  ------------------
  |  Branch (681:3): [True: 0, False: 1.95k]
  ------------------
  682|  1.95k|		case CP_UTF8:
  ------------------
  |  |  123|  1.95k|#define CP_UTF8 65001
  ------------------
  |  Branch (682:3): [True: 1.95k, False: 0]
  ------------------
  683|  1.95k|			break;
  684|       |
  685|      0|		default:
  ------------------
  |  Branch (685:3): [True: 0, False: 1.95k]
  ------------------
  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|  1.95k|	}
  689|       |
  690|  1.95k|	return winpr_ConvertUTF8toUTF16((const uint8_t*)lpMultiByteStr,
  691|  1.95k|	                                WINPR_ASSERTING_INT_CAST(int, cbCharLen),
  ------------------
  |  |  180|  1.95k|	__extension__({                                                                             \
  |  |  181|  1.95k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  1.95k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  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.86k|		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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  1.95k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  1.95k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  1.95k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  1.95k|	})
  ------------------
  692|  1.95k|	                                (uint16_t*)lpWideCharStr, cchWideChar);
  693|  1.95k|}
int_WideCharToMultiByte:
  698|    397|{
  699|    397|	size_t cbCharLen = (size_t)cchWideChar;
  700|       |
  701|    397|	WINPR_UNUSED(dwFlags);
  ------------------
  |  |  758|    397|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  702|       |	/* If cchWideChar is 0, the function fails */
  703|    397|	if ((cchWideChar == 0) || (cchWideChar < -1))
  ------------------
  |  Branch (703:6): [True: 0, False: 397]
  |  Branch (703:28): [True: 0, False: 397]
  ------------------
  704|      0|		return 0;
  705|       |
  706|    397|	if (cbMultiByte < 0)
  ------------------
  |  Branch (706:6): [True: 0, False: 397]
  ------------------
  707|      0|		return -1;
  708|       |
  709|    397|	WINPR_ASSERT(lpWideCharStr);
  ------------------
  |  |   76|    397|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    397|	do                                                                                             \
  |  |  |  |   61|    397|	{                                                                                              \
  |  |  |  |   62|    397|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    397|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    397|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    397|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    397|                                                                                                   \
  |  |  |  |   70|    397|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    397|	do                                                      \
  |  |  |  |  |  |   32|    397|	{                                                       \
  |  |  |  |  |  |   33|    397|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    397|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    397|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    397|                                                                                                   \
  |  |  |  |   72|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    397|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    397|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    397|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 397]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|       |	/* If cchWideChar is -1, the string is null-terminated */
  711|    397|	if (cchWideChar == -1)
  ------------------
  |  Branch (711:6): [True: 0, False: 397]
  ------------------
  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|    397|	else
  719|    397|		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|    397|	return winpr_ConvertUTF16toUTF8((const uint16_t*)lpWideCharStr,
  727|    397|	                                WINPR_ASSERTING_INT_CAST(int, cbCharLen),
  ------------------
  |  |  180|    397|	__extension__({                                                                             \
  |  |  181|    397|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|    397|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|    397|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    397|	do                                                                                             \
  |  |  |  |  |  |   61|    397|	{                                                                                              \
  |  |  |  |  |  |   62|    397|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    397|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    397|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    397|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    397|                                                                                                   \
  |  |  |  |  |  |   70|    397|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    397|	do                                                      \
  |  |  |  |  |  |  |  |   32|    397|	{                                                       \
  |  |  |  |  |  |  |  |   33|    397|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 397]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    397|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    397|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 397]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    397|                                                                                                   \
  |  |  |  |  |  |   72|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    397|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    397|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    397|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|    397|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|    397|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|    397|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    397|	do                                                                                             \
  |  |  |  |  |  |   61|    397|	{                                                                                              \
  |  |  |  |  |  |   62|    397|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    397|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    397|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    397|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    397|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    397|                                                                                                   \
  |  |  |  |  |  |   70|    397|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    397|	do                                                      \
  |  |  |  |  |  |  |  |   32|    397|	{                                                       \
  |  |  |  |  |  |  |  |   33|  1.19k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 397, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 397, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    397|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    397|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 397]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    397|                                                                                                   \
  |  |  |  |  |  |   72|    397|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    397|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    397|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    397|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 397]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|    397|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|    397|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|    397|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|    397|	})
  ------------------
  728|    397|	                                (uint8_t*)lpMultiByteStr, cbMultiByte);
  729|    397|}
unicode_builtin.c:winpr_ConvertUTF8toUTF16:
  569|  1.95k|{
  570|  1.95k|	size_t length = 0;
  571|  1.95k|	uint16_t* dstBeg = nullptr;
  572|  1.95k|	uint16_t* dstEnd = nullptr;
  573|  1.95k|	const uint8_t* srcBeg = nullptr;
  574|  1.95k|	const uint8_t* srcEnd = nullptr;
  575|  1.95k|	ConversionResult result = sourceIllegal;
  576|       |
  577|  1.95k|	if (cchSrc == -1)
  ------------------
  |  Branch (577:6): [True: 0, False: 1.95k]
  ------------------
  578|      0|		cchSrc = (int)strnlen((const char*)src, INT32_MAX - 1) + 1;
  579|       |
  580|  1.95k|	srcBeg = src;
  581|  1.95k|	srcEnd = &src[cchSrc];
  582|       |
  583|  1.95k|	if (cchDst == 0)
  ------------------
  |  Branch (583:6): [True: 1.01k, False: 937]
  ------------------
  584|  1.01k|	{
  585|  1.01k|		result =
  586|  1.01k|		    winpr_ConvertUTF8toUTF16_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  587|       |
  588|  1.01k|		length = dstBeg - (uint16_t*)nullptr;
  589|  1.01k|	}
  590|    937|	else
  591|    937|	{
  592|    937|		dstBeg = dst;
  593|    937|		dstEnd = &dst[cchDst];
  594|       |
  595|    937|		result =
  596|    937|		    winpr_ConvertUTF8toUTF16_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  597|       |
  598|    937|		length = dstBeg - dst;
  599|    937|	}
  600|       |
  601|  1.95k|	if (result == targetExhausted)
  ------------------
  |  Branch (601:6): [True: 0, False: 1.95k]
  ------------------
  602|      0|	{
  603|      0|		SetLastError(ERROR_INSUFFICIENT_BUFFER);
  ------------------
  |  |  275|      0|#define ERROR_INSUFFICIENT_BUFFER 0x0000007A
  ------------------
  604|      0|		return 0;
  605|      0|	}
  606|       |
  607|  1.95k|	return (result == conversionOK) ? WINPR_ASSERTING_INT_CAST(int, length) : 0;
  ------------------
  |  |  180|  1.87k|	__extension__({                                                                             \
  |  |  181|  1.87k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  1.87k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  1.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.87k|	do                                                                                             \
  |  |  |  |  |  |   61|  1.87k|	{                                                                                              \
  |  |  |  |  |  |   62|  1.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  1.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  1.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  1.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  1.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  1.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  1.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  1.87k|                                                                                                   \
  |  |  |  |  |  |   70|  1.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.87k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  1.87k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  1.87k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  1.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  1.87k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.87k|                                                                                                   \
  |  |  |  |  |  |   72|  1.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  1.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  1.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  1.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 1.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  1.87k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  1.87k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  1.87k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.87k|	do                                                                                             \
  |  |  |  |  |  |   61|  1.87k|	{                                                                                              \
  |  |  |  |  |  |   62|  1.87k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  1.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  1.87k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  1.87k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  1.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  1.87k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  1.87k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  1.87k|                                                                                                   \
  |  |  |  |  |  |   70|  1.87k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.87k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  1.87k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  5.62k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.87k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.87k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  1.87k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  1.87k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.87k|                                                                                                   \
  |  |  |  |  |  |   72|  1.87k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  1.87k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  1.87k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  1.87k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 1.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  1.87k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  1.87k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  1.87k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  1.87k|	})
  ------------------
  |  Branch (607:9): [True: 1.87k, False: 81]
  ------------------
  608|  1.95k|}
unicode_builtin.c:winpr_ConvertUTF8toUTF16_Internal:
  414|  1.95k|{
  415|  1.95k|	bool computeLength = (!targetEnd) ? true : false;
  ------------------
  |  Branch (415:23): [True: 1.01k, False: 937]
  ------------------
  416|  1.95k|	ConversionResult result = conversionOK;
  417|  1.95k|	const uint8_t* source = *sourceStart;
  418|  1.95k|	uint16_t* target = *targetStart;
  419|       |
  420|  6.88M|	while (source < sourceEnd)
  ------------------
  |  Branch (420:9): [True: 6.87M, False: 1.87k]
  ------------------
  421|  6.87M|	{
  422|  6.87M|		uint32_t ch = 0;
  423|  6.87M|		unsigned short extraBytesToRead =
  424|  6.87M|		    WINPR_ASSERTING_INT_CAST(unsigned short, trailingBytesForUTF8[*source]);
  ------------------
  |  |  180|  6.87M|	__extension__({                                                                             \
  |  |  181|  6.87M|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  6.87M|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  6.87M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.87M|	do                                                                                             \
  |  |  |  |  |  |   61|  6.87M|	{                                                                                              \
  |  |  |  |  |  |   62|  6.87M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  6.87M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  6.87M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  6.87M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  6.87M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  6.87M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  6.87M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  6.87M|                                                                                                   \
  |  |  |  |  |  |   70|  6.87M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  6.87M|	do                                                      \
  |  |  |  |  |  |  |  |   32|  6.87M|	{                                                       \
  |  |  |  |  |  |  |  |   33|  6.87M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.87M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  6.87M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  6.87M|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.87M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  6.87M|                                                                                                   \
  |  |  |  |  |  |   72|  6.87M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  6.87M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  6.87M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  6.87M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 6.87M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  6.87M|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  6.87M|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  6.87M|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.87M|	do                                                                                             \
  |  |  |  |  |  |   61|  6.87M|	{                                                                                              \
  |  |  |  |  |  |   62|  6.87M|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  6.87M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  6.87M|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  6.87M|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  6.87M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  6.87M|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  6.87M|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  6.87M|                                                                                                   \
  |  |  |  |  |  |   70|  6.87M|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  6.87M|	do                                                      \
  |  |  |  |  |  |  |  |   32|  6.87M|	{                                                       \
  |  |  |  |  |  |  |  |   33|  34.3M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.87k, False: 6.87M]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 1.87k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 6.87M, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 6.87M, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  6.87M|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  6.87M|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.87M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  6.87M|                                                                                                   \
  |  |  |  |  |  |   72|  6.87M|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  6.87M|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  6.87M|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  6.87M|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 6.87M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  6.87M|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  6.87M|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  6.87M|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  6.87M|	})
  ------------------
  425|       |
  426|  6.87M|		if ((source + extraBytesToRead) >= sourceEnd)
  ------------------
  |  Branch (426:7): [True: 1, False: 6.87M]
  ------------------
  427|      1|		{
  428|      1|			result = sourceExhausted;
  429|      1|			break;
  430|      1|		}
  431|       |
  432|       |		/* Do this check whether lenient or strict */
  433|  6.87M|		if (!isLegalUTF8(source, extraBytesToRead + 1))
  ------------------
  |  Branch (433:7): [True: 80, False: 6.87M]
  ------------------
  434|     80|		{
  435|     80|			result = sourceIllegal;
  436|     80|			break;
  437|     80|		}
  438|       |
  439|       |		/*
  440|       |		 * The cases all fall through. See "Note A" below.
  441|       |		 */
  442|  6.87M|		switch (extraBytesToRead)
  443|  6.87M|		{
  444|      0|			case 5:
  ------------------
  |  Branch (444:4): [True: 0, False: 6.87M]
  ------------------
  445|      0|				ch += *source++;
  446|      0|				ch <<= 6; /* remember, illegal UTF-8 */
  447|       |				          /* fallthrough */
  448|      0|				WINPR_FALLTHROUGH
  ------------------
  |  |   69|      0|	(void)0;              \
  |  |   70|      0|	[[fallthrough]];
  ------------------
  449|       |
  450|      0|			case 4:
  ------------------
  |  Branch (450:4): [True: 0, False: 6.87M]
  ------------------
  451|      0|				ch += *source++;
  452|      0|				ch <<= 6; /* remember, illegal UTF-8 */
  453|       |				          /* fallthrough */
  454|      0|				WINPR_FALLTHROUGH
  ------------------
  |  |   69|      0|	(void)0;              \
  |  |   70|      0|	[[fallthrough]];
  ------------------
  455|       |
  456|    787|			case 3:
  ------------------
  |  Branch (456:4): [True: 787, False: 6.87M]
  ------------------
  457|    787|				ch += *source++;
  458|    787|				ch <<= 6;
  459|       |				/* fallthrough */
  460|    787|				WINPR_FALLTHROUGH
  ------------------
  |  |   69|    787|	(void)0;              \
  |  |   70|    787|	[[fallthrough]];
  ------------------
  461|       |
  462|  1.51k|			case 2:
  ------------------
  |  Branch (462:4): [True: 725, False: 6.87M]
  ------------------
  463|  1.51k|				ch += *source++;
  464|  1.51k|				ch <<= 6;
  465|       |				/* fallthrough */
  466|  1.51k|				WINPR_FALLTHROUGH
  ------------------
  |  |   69|  1.51k|	(void)0;              \
  |  |   70|  1.51k|	[[fallthrough]];
  ------------------
  467|       |
  468|  1.81k|			case 1:
  ------------------
  |  Branch (468:4): [True: 300, False: 6.87M]
  ------------------
  469|  1.81k|				ch += *source++;
  470|  1.81k|				ch <<= 6;
  471|       |				/* fallthrough */
  472|  1.81k|				WINPR_FALLTHROUGH
  ------------------
  |  |   69|  1.81k|	(void)0;              \
  |  |   70|  1.81k|	[[fallthrough]];
  ------------------
  473|       |
  474|  6.87M|			case 0:
  ------------------
  |  Branch (474:4): [True: 6.87M, False: 1.81k]
  ------------------
  475|  6.87M|				ch += *source++;
  476|  6.87M|				break;
  477|      0|			default:
  ------------------
  |  Branch (477:4): [True: 0, False: 6.87M]
  ------------------
  478|      0|				return sourceIllegal;
  479|  6.87M|		}
  480|       |
  481|  6.87M|		ch -= offsetsFromUTF8[extraBytesToRead];
  482|       |
  483|  6.87M|		if ((target >= targetEnd) && (!computeLength))
  ------------------
  |  Branch (483:7): [True: 3.48M, False: 3.39M]
  |  Branch (483:32): [True: 0, False: 3.48M]
  ------------------
  484|      0|		{
  485|      0|			source -= (extraBytesToRead + 1); /* Back up source pointer! */
  486|      0|			result = targetExhausted;
  487|      0|			break;
  488|      0|		}
  489|       |
  490|  6.87M|		if (ch <= UNI_MAX_BMP)
  ------------------
  |  |   61|  6.87M|#define UNI_MAX_BMP (uint32_t)0x0000FFFF
  ------------------
  |  Branch (490:7): [True: 6.87M, False: 787]
  ------------------
  491|  6.87M|		{
  492|       |			/* Target is a character <= 0xFFFF */
  493|       |			/* UTF-16 surrogate values are illegal in UTF-32 */
  494|  6.87M|			if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   85|  13.7M|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              			if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|    229|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (494:8): [True: 229, False: 6.87M]
  |  Branch (494:36): [True: 0, False: 229]
  ------------------
  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|  6.87M|			else
  511|  6.87M|			{
  512|  6.87M|				if (!computeLength)
  ------------------
  |  Branch (512:9): [True: 3.39M, False: 3.48M]
  ------------------
  513|  3.39M|					*target++ = setWcharFrom((WCHAR)ch); /* normal case */
  514|  3.48M|				else
  515|  3.48M|					target++;
  516|  6.87M|			}
  517|  6.87M|		}
  518|    787|		else if (ch > UNI_MAX_UTF16)
  ------------------
  |  |   62|    787|#define UNI_MAX_UTF16 (uint32_t)0x0010FFFF
  ------------------
  |  Branch (518:12): [True: 0, False: 787]
  ------------------
  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|    787|		else
  535|    787|		{
  536|       |			/* target is a character in range 0xFFFF - 0x10FFFF. */
  537|    787|			if ((target + 1 >= targetEnd) && (!computeLength))
  ------------------
  |  Branch (537:8): [True: 399, False: 388]
  |  Branch (537:37): [True: 0, False: 399]
  ------------------
  538|      0|			{
  539|      0|				source -= (extraBytesToRead + 1); /* Back up source pointer! */
  540|      0|				result = targetExhausted;
  541|      0|				break;
  542|      0|			}
  543|       |
  544|    787|			ch -= halfBase;
  545|       |
  546|    787|			if (!computeLength)
  ------------------
  |  Branch (546:8): [True: 388, False: 399]
  ------------------
  547|    388|			{
  548|    388|				*target++ = setWcharFrom((WCHAR)((ch >> halfShift) + UNI_SUR_HIGH_START));
  ------------------
  |  |   85|    388|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
  549|    388|				*target++ = setWcharFrom((WCHAR)((ch & halfMask) + UNI_SUR_LOW_START));
  ------------------
  |  |   87|    388|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
  550|    388|			}
  551|    399|			else
  552|    399|			{
  553|    399|				target++;
  554|    399|				target++;
  555|    399|			}
  556|    787|		}
  557|  6.87M|	}
  558|       |
  559|  1.95k|	*sourceStart = source;
  560|  1.95k|	*targetStart = target;
  561|  1.95k|	return result;
  562|  1.95k|}
unicode_builtin.c:isLegalUTF8:
  335|  6.87M|{
  336|  6.87M|	uint8_t a = 0;
  337|  6.87M|	const uint8_t* srcptr = source + length;
  338|       |
  339|  6.87M|	switch (length)
  340|  6.87M|	{
  341|      5|		default:
  ------------------
  |  Branch (341:3): [True: 5, False: 6.87M]
  ------------------
  342|      5|			return false;
  343|       |
  344|       |			/* Everything else falls through when "true"... */
  345|    804|		case 4:
  ------------------
  |  Branch (345:3): [True: 804, False: 6.87M]
  ------------------
  346|    804|			if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
  ------------------
  |  Branch (346:8): [True: 3, False: 801]
  |  Branch (346:36): [True: 7, False: 794]
  ------------------
  347|     10|				return false;
  348|       |			/* fallthrough */
  349|    794|			WINPR_FALLTHROUGH
  ------------------
  |  |   69|    794|	(void)0;              \
  |  |   70|    794|	[[fallthrough]];
  ------------------
  350|       |
  351|  1.54k|		case 3:
  ------------------
  |  Branch (351:3): [True: 749, False: 6.87M]
  ------------------
  352|  1.54k|			if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
  ------------------
  |  Branch (352:8): [True: 6, False: 1.53k]
  |  Branch (352:36): [True: 6, False: 1.53k]
  ------------------
  353|     12|				return false;
  354|       |			/* fallthrough */
  355|  1.53k|			WINPR_FALLTHROUGH
  ------------------
  |  |   69|  1.53k|	(void)0;              \
  |  |   70|  1.53k|	[[fallthrough]];
  ------------------
  356|       |
  357|  1.84k|		case 2:
  ------------------
  |  Branch (357:3): [True: 313, False: 6.87M]
  ------------------
  358|  1.84k|			if ((a = (*--srcptr)) > 0xBF)
  ------------------
  |  Branch (358:8): [True: 3, False: 1.84k]
  ------------------
  359|      3|				return false;
  360|       |
  361|  1.84k|			switch (*source)
  362|  1.84k|			{
  363|       |					/* no fall-through in this inner switch */
  364|    242|				case 0xE0:
  ------------------
  |  Branch (364:5): [True: 242, False: 1.59k]
  ------------------
  365|    242|					if (a < 0xA0)
  ------------------
  |  Branch (365:10): [True: 8, False: 234]
  ------------------
  366|      8|						return false;
  367|       |
  368|    234|					break;
  369|       |
  370|    260|				case 0xED:
  ------------------
  |  Branch (370:5): [True: 260, False: 1.58k]
  ------------------
  371|    260|					if (a > 0x9F)
  ------------------
  |  Branch (371:10): [True: 3, False: 257]
  ------------------
  372|      3|						return false;
  373|       |
  374|    257|					break;
  375|       |
  376|    257|				case 0xF0:
  ------------------
  |  Branch (376:5): [True: 211, False: 1.63k]
  ------------------
  377|    211|					if (a < 0x90)
  ------------------
  |  Branch (377:10): [True: 4, False: 207]
  ------------------
  378|      4|						return false;
  379|       |
  380|    207|					break;
  381|       |
  382|    567|				case 0xF4:
  ------------------
  |  Branch (382:5): [True: 567, False: 1.27k]
  ------------------
  383|    567|					if (a > 0x8F)
  ------------------
  |  Branch (383:10): [True: 1, False: 566]
  ------------------
  384|      1|						return false;
  385|       |
  386|    566|					break;
  387|       |
  388|    566|				default:
  ------------------
  |  Branch (388:5): [True: 561, False: 1.28k]
  ------------------
  389|    561|					if (a < 0x80)
  ------------------
  |  Branch (389:10): [True: 6, False: 555]
  ------------------
  390|      6|						return false;
  391|    555|					break;
  392|  1.84k|			}
  393|       |			/* fallthrough */
  394|  1.81k|			WINPR_FALLTHROUGH
  ------------------
  |  |   69|  1.81k|	(void)0;              \
  |  |   70|  1.81k|	[[fallthrough]];
  ------------------
  395|       |
  396|  6.87M|		case 1:
  ------------------
  |  Branch (396:3): [True: 6.87M, False: 1.87k]
  ------------------
  397|  6.87M|			if (*source >= 0x80 && *source < 0xC2)
  ------------------
  |  Branch (397:8): [True: 1.84k, False: 6.87M]
  |  Branch (397:27): [True: 26, False: 1.81k]
  ------------------
  398|     26|				return false;
  399|  6.87M|	}
  400|       |
  401|  6.87M|	if (*source > 0xF4)
  ------------------
  |  Branch (401:6): [True: 2, False: 6.87M]
  ------------------
  402|      2|		return false;
  403|       |
  404|  6.87M|	return true;
  405|  6.87M|}
unicode_builtin.c:setWcharFrom:
  129|  3.97M|{
  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|  3.97M|	return w;
  144|  3.97M|#endif
  145|  3.97M|}
unicode_builtin.c:winpr_ConvertUTF16toUTF8:
  611|    397|{
  612|    397|	size_t length = 0;
  613|    397|	uint8_t* dstBeg = nullptr;
  614|    397|	uint8_t* dstEnd = nullptr;
  615|    397|	const uint16_t* srcBeg = nullptr;
  616|    397|	const uint16_t* srcEnd = nullptr;
  617|    397|	ConversionResult result = sourceIllegal;
  618|       |
  619|    397|	if (cchSrc == -1)
  ------------------
  |  Branch (619:6): [True: 0, False: 397]
  ------------------
  620|      0|		cchSrc = (int)_wcsnlen((const WCHAR*)src, INT32_MAX - 1) + 1;
  621|       |
  622|    397|	srcBeg = src;
  623|    397|	srcEnd = &src[cchSrc];
  624|       |
  625|    397|	if (cchDst == 0)
  ------------------
  |  Branch (625:6): [True: 241, False: 156]
  ------------------
  626|    241|	{
  627|    241|		result =
  628|    241|		    winpr_ConvertUTF16toUTF8_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  629|       |
  630|    241|		length = dstBeg - ((uint8_t*)nullptr);
  631|    241|	}
  632|    156|	else
  633|    156|	{
  634|    156|		dstBeg = dst;
  635|    156|		dstEnd = &dst[cchDst];
  636|       |
  637|    156|		result =
  638|    156|		    winpr_ConvertUTF16toUTF8_Internal(&srcBeg, srcEnd, &dstBeg, dstEnd, strictConversion);
  639|       |
  640|    156|		length = dstBeg - dst;
  641|    156|	}
  642|       |
  643|    397|	if (result == targetExhausted)
  ------------------
  |  Branch (643:6): [True: 0, False: 397]
  ------------------
  644|      0|	{
  645|      0|		SetLastError(ERROR_INSUFFICIENT_BUFFER);
  ------------------
  |  |  275|      0|#define ERROR_INSUFFICIENT_BUFFER 0x0000007A
  ------------------
  646|      0|		return 0;
  647|      0|	}
  648|       |
  649|    397|	return (result == conversionOK) ? WINPR_ASSERTING_INT_CAST(int, length) : 0;
  ------------------
  |  |  180|    312|	__extension__({                                                                             \
  |  |  181|    312|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|    312|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|    312|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    312|	do                                                                                             \
  |  |  |  |  |  |   61|    312|	{                                                                                              \
  |  |  |  |  |  |   62|    312|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    312|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    312|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    312|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    312|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    312|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    312|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    312|                                                                                                   \
  |  |  |  |  |  |   70|    312|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    312|	do                                                      \
  |  |  |  |  |  |  |  |   32|    312|	{                                                       \
  |  |  |  |  |  |  |  |   33|    312|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 312]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    312|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    312|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 312]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    312|                                                                                                   \
  |  |  |  |  |  |   72|    312|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    312|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    312|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    312|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 312]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|    312|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|    312|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|    312|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    312|	do                                                                                             \
  |  |  |  |  |  |   61|    312|	{                                                                                              \
  |  |  |  |  |  |   62|    312|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|    312|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|    312|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|    312|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|    312|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|    312|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|    312|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|    312|                                                                                                   \
  |  |  |  |  |  |   70|    312|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|    312|	do                                                      \
  |  |  |  |  |  |  |  |   32|    312|	{                                                       \
  |  |  |  |  |  |  |  |   33|    936|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 312, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 312, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|    312|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|    312|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 312]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    312|                                                                                                   \
  |  |  |  |  |  |   72|    312|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|    312|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|    312|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|    312|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 312]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|    312|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|    312|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|    312|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|    312|	})
  ------------------
  |  Branch (649:9): [True: 312, False: 85]
  ------------------
  650|    397|}
unicode_builtin.c:winpr_ConvertUTF16toUTF8_Internal:
  164|    397|{
  165|    397|	bool computeLength = (!targetEnd) ? true : false;
  ------------------
  |  Branch (165:23): [True: 241, False: 156]
  ------------------
  166|    397|	const uint16_t* source = *sourceStart;
  167|    397|	uint8_t* target = *targetStart;
  168|    397|	ConversionResult result = conversionOK;
  169|       |
  170|   585k|	while (source < sourceEnd)
  ------------------
  |  Branch (170:9): [True: 585k, False: 312]
  ------------------
  171|   585k|	{
  172|   585k|		uint32_t ch = 0;
  173|   585k|		unsigned short bytesToWrite = 0;
  174|   585k|		const uint32_t byteMask = 0xBF;
  175|   585k|		const uint32_t byteMark = 0x80;
  176|   585k|		const uint16_t* oldSource =
  177|   585k|		    source; /* In case we have to back up because of target overflow. */
  178|       |
  179|   585k|		ch = setWcharFrom(*source++);
  180|       |
  181|       |		/* If we have a surrogate pair, convert to UTF32 first. */
  182|   585k|		if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END)
  ------------------
  |  |   85|  1.17M|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              		if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END)
  ------------------
  |  |   86|  69.1k|#define UNI_SUR_HIGH_END (uint32_t)0xDBFF
  ------------------
  |  Branch (182:7): [True: 69.1k, False: 516k]
  |  Branch (182:35): [True: 1.07k, False: 68.0k]
  ------------------
  183|  1.07k|		{
  184|       |			/* If the 16 bits following the high surrogate are in the source buffer... */
  185|  1.07k|			if (source < sourceEnd)
  ------------------
  |  Branch (185:8): [True: 1.07k, False: 3]
  ------------------
  186|  1.07k|			{
  187|  1.07k|				uint32_t ch2 = setWcharFrom(*source);
  188|       |
  189|       |				/* If it's a low surrogate, convert to UTF32. */
  190|  1.07k|				if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END)
  ------------------
  |  |   87|  2.15k|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
              				if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|  1.02k|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (190:9): [True: 1.02k, False: 46]
  |  Branch (190:37): [True: 1.02k, False: 7]
  ------------------
  191|  1.02k|				{
  192|  1.02k|					ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) +
  ------------------
  |  |   85|  1.02k|#define UNI_SUR_HIGH_START (uint32_t)0xD800
  ------------------
              					ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) +
  ------------------
  |  |   87|  1.02k|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
  193|  1.02k|					     halfBase;
  194|  1.02k|					++source;
  195|  1.02k|				}
  196|     53|				else if (flags == strictConversion)
  ------------------
  |  Branch (196:14): [True: 53, False: 0]
  ------------------
  197|     53|				{
  198|       |					/* it's an unpaired high surrogate */
  199|     53|					--source; /* return to the illegal value itself */
  200|     53|					result = sourceIllegal;
  201|     53|					break;
  202|     53|				}
  203|  1.07k|			}
  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.07k|		}
  212|   584k|		else if (flags == strictConversion)
  ------------------
  |  Branch (212:12): [True: 584k, False: 0]
  ------------------
  213|   584k|		{
  214|       |			/* UTF-16 surrogate values are illegal in UTF-32 */
  215|   584k|			if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   87|  1.16M|#define UNI_SUR_LOW_START (uint32_t)0xDC00
  ------------------
              			if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)
  ------------------
  |  |   88|  68.0k|#define UNI_SUR_LOW_END (uint32_t)0xDFFF
  ------------------
  |  Branch (215:8): [True: 68.0k, False: 516k]
  |  Branch (215:35): [True: 29, False: 68.0k]
  ------------------
  216|     29|			{
  217|     29|				--source; /* return to the illegal value itself */
  218|     29|				result = sourceIllegal;
  219|     29|				break;
  220|     29|			}
  221|   584k|		}
  222|       |
  223|       |		/* Figure out how many bytes the result will require */
  224|   585k|		if (ch < (uint32_t)0x80)
  ------------------
  |  Branch (224:7): [True: 781, False: 584k]
  ------------------
  225|    781|		{
  226|    781|			bytesToWrite = 1;
  227|    781|		}
  228|   584k|		else if (ch < (uint32_t)0x800)
  ------------------
  |  Branch (228:12): [True: 39.2k, False: 545k]
  ------------------
  229|  39.2k|		{
  230|  39.2k|			bytesToWrite = 2;
  231|  39.2k|		}
  232|   545k|		else if (ch < (uint32_t)0x10000)
  ------------------
  |  Branch (232:12): [True: 544k, False: 1.02k]
  ------------------
  233|   544k|		{
  234|   544k|			bytesToWrite = 3;
  235|   544k|		}
  236|  1.02k|		else if (ch < (uint32_t)0x110000)
  ------------------
  |  Branch (236:12): [True: 1.02k, False: 0]
  ------------------
  237|  1.02k|		{
  238|  1.02k|			bytesToWrite = 4;
  239|  1.02k|		}
  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|   585k|		target += bytesToWrite;
  247|       |
  248|   585k|		if ((target > targetEnd) && (!computeLength))
  ------------------
  |  Branch (248:7): [True: 293k, False: 291k]
  |  Branch (248:31): [True: 0, False: 293k]
  ------------------
  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|   585k|		if (!computeLength)
  ------------------
  |  Branch (256:7): [True: 291k, False: 293k]
  ------------------
  257|   291k|		{
  258|   291k|			switch (bytesToWrite)
  259|   291k|			{
  260|       |					/* note: everything falls through. */
  261|    505|				case 4:
  ------------------
  |  Branch (261:5): [True: 505, False: 290k]
  ------------------
  262|    505|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  263|    505|					ch >>= 6;
  264|       |					/* fallthrough */
  265|    505|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|    505|	(void)0;              \
  |  |   70|    505|	[[fallthrough]];
  ------------------
  266|   271k|				case 3:
  ------------------
  |  Branch (266:5): [True: 270k, False: 20.4k]
  ------------------
  267|   271k|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  268|   271k|					ch >>= 6;
  269|       |					/* fallthrough */
  270|   271k|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|   271k|	(void)0;              \
  |  |   70|   271k|	[[fallthrough]];
  ------------------
  271|       |
  272|   290k|				case 2:
  ------------------
  |  Branch (272:5): [True: 19.5k, False: 271k]
  ------------------
  273|   290k|					*--target = (uint8_t)((ch | byteMark) & byteMask);
  274|   290k|					ch >>= 6;
  275|       |					/* fallthrough */
  276|   290k|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|   290k|	(void)0;              \
  |  |   70|   290k|	[[fallthrough]];
  ------------------
  277|       |
  278|   291k|				case 1:
  ------------------
  |  Branch (278:5): [True: 388, False: 290k]
  ------------------
  279|   291k|					*--target = (uint8_t)(ch | firstByteMark[bytesToWrite]);
  280|   291k|					break;
  281|      0|				default:
  ------------------
  |  Branch (281:5): [True: 0, False: 291k]
  ------------------
  282|      0|					return sourceIllegal;
  283|   291k|			}
  284|   291k|		}
  285|   293k|		else
  286|   293k|		{
  287|   293k|			switch (bytesToWrite)
  288|   293k|			{
  289|       |					/* note: everything falls through. */
  290|    517|				case 4:
  ------------------
  |  Branch (290:5): [True: 517, False: 293k]
  ------------------
  291|    517|					--target;
  292|       |					/* fallthrough */
  293|    517|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|    517|	(void)0;              \
  |  |   70|    517|	[[fallthrough]];
  ------------------
  294|       |
  295|   273k|				case 3:
  ------------------
  |  Branch (295:5): [True: 273k, False: 20.5k]
  ------------------
  296|   273k|					--target;
  297|       |					/* fallthrough */
  298|   273k|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|   273k|	(void)0;              \
  |  |   70|   273k|	[[fallthrough]];
  ------------------
  299|       |
  300|   293k|				case 2:
  ------------------
  |  Branch (300:5): [True: 19.6k, False: 274k]
  ------------------
  301|   293k|					--target;
  302|       |					/* fallthrough */
  303|   293k|					WINPR_FALLTHROUGH
  ------------------
  |  |   69|   293k|	(void)0;              \
  |  |   70|   293k|	[[fallthrough]];
  ------------------
  304|       |
  305|   293k|				case 1:
  ------------------
  |  Branch (305:5): [True: 393, False: 293k]
  ------------------
  306|   293k|					--target;
  307|   293k|					break;
  308|      0|				default:
  ------------------
  |  Branch (308:5): [True: 0, False: 293k]
  ------------------
  309|      0|					return sourceIllegal;
  310|   293k|			}
  311|   293k|		}
  312|       |
  313|   585k|		target += bytesToWrite;
  314|   585k|	}
  315|       |
  316|    397|	*sourceStart = source;
  317|    397|	*targetStart = target;
  318|    397|	return result;
  319|    397|}

winpr_RC4_New:
  146|    236|{
  147|    236|	return winpr_RC4_New_Internal(key, keylen, FALSE);
  ------------------
  |  |  122|    236|#define FALSE false
  ------------------
  148|    236|}
winpr_RC4_Update:
  151|    236|{
  152|    236|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    236|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    236|	do                                                                                             \
  |  |  |  |   61|    236|	{                                                                                              \
  |  |  |  |   62|    236|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    236|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    236|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    236|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    236|                                                                                                   \
  |  |  |  |   70|    236|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    236|	do                                                      \
  |  |  |  |  |  |   32|    236|	{                                                       \
  |  |  |  |  |  |   33|    236|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    236|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    236|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    236|                                                                                                   \
  |  |  |  |   72|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    236|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    236|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    236|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|       |
  154|       |#if defined(WITH_INTERNAL_RC4)
  155|       |	return winpr_int_rc4_update(ctx->ictx, length, input, output);
  156|       |#elif defined(WITH_OPENSSL)
  157|    236|	WINPR_ASSERT(ctx->ctx);
  ------------------
  |  |   76|    236|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    236|	do                                                                                             \
  |  |  |  |   61|    236|	{                                                                                              \
  |  |  |  |   62|    236|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    236|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    236|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    236|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    236|                                                                                                   \
  |  |  |  |   70|    236|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    236|	do                                                      \
  |  |  |  |  |  |   32|    236|	{                                                       \
  |  |  |  |  |  |   33|    236|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    236|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    236|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    236|                                                                                                   \
  |  |  |  |   72|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    236|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    236|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    236|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|    236|	int outputLength = 0;
  159|    236|	if (length > INT_MAX)
  ------------------
  |  Branch (159:6): [True: 0, False: 236]
  ------------------
  160|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  161|       |
  162|    236|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    236|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    236|	do                                                                                             \
  |  |  |  |   61|    236|	{                                                                                              \
  |  |  |  |   62|    236|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    236|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    236|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    236|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    236|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    236|                                                                                                   \
  |  |  |  |   70|    236|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    236|	do                                                      \
  |  |  |  |  |  |   32|    236|	{                                                       \
  |  |  |  |  |  |   33|    236|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    236|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    236|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    236|                                                                                                   \
  |  |  |  |   72|    236|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    236|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    236|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    236|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    236|	return EVP_CipherUpdate(ctx->ctx, output, &outputLength, input, (int)length) == 1;
  164|      0|#endif
  165|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  166|    236|}
winpr_RC4_Free:
  169|    317|{
  170|    317|	if (!ctx)
  ------------------
  |  Branch (170:6): [True: 81, False: 236]
  ------------------
  171|     81|		return;
  172|       |
  173|       |#if defined(WITH_INTERNAL_RC4)
  174|       |	winpr_int_rc4_free(ctx->ictx);
  175|       |#elif defined(WITH_OPENSSL)
  176|    236|	EVP_CIPHER_CTX_free(ctx->ctx);
  177|    236|#endif
  178|    236|	free(ctx);
  179|    236|}
winpr_Cipher_NewEx:
  593|    438|{
  594|    438|	if (cipher == WINPR_CIPHER_ARC4_128)
  ------------------
  |  Branch (594:6): [True: 0, False: 438]
  ------------------
  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|    438|	WINPR_CIPHER_CTX* ctx = calloc(1, sizeof(WINPR_CIPHER_CTX));
  602|    438|	if (!ctx)
  ------------------
  |  Branch (602:6): [True: 0, False: 438]
  ------------------
  603|      0|		return nullptr;
  604|       |
  605|    438|	ctx->cipher = cipher;
  606|    438|	ctx->op = op;
  607|       |
  608|    438|#if defined(WITH_OPENSSL)
  609|    438|	const EVP_CIPHER* evp = winpr_openssl_get_evp_cipher(cipher);
  610|    438|	if (!evp)
  ------------------
  |  Branch (610:6): [True: 0, False: 438]
  ------------------
  611|      0|		goto fail;
  612|       |
  613|    438|	ctx->ectx = EVP_CIPHER_CTX_new();
  614|    438|	if (!ctx->ectx)
  ------------------
  |  Branch (614:6): [True: 0, False: 438]
  ------------------
  615|      0|		goto fail;
  616|       |
  617|    438|	{
  618|    438|		const int operation = (op == WINPR_ENCRYPT) ? 1 : 0;
  ------------------
  |  Branch (618:25): [True: 0, False: 438]
  ------------------
  619|    438|		if (EVP_CipherInit_ex(ctx->ectx, evp, nullptr, key, iv, operation) != 1)
  ------------------
  |  Branch (619:7): [True: 0, False: 438]
  ------------------
  620|      0|			goto fail;
  621|    438|	}
  622|       |
  623|    438|	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|    438|	return ctx;
  652|       |
  653|      0|fail:
  654|      0|	winpr_Cipher_Free(ctx);
  655|      0|	return nullptr;
  656|    438|}
winpr_Cipher_Update:
  678|    438|{
  679|    438|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|    438|	WINPR_ASSERT(olen);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  681|       |
  682|    438|#if defined(WITH_OPENSSL)
  683|    438|	int outl = (int)*olen;
  684|       |
  685|    438|	if (ilen > INT_MAX)
  ------------------
  |  Branch (685:6): [True: 0, False: 438]
  ------------------
  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|    438|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|    438|	if (EVP_CipherUpdate(ctx->ectx, output, &outl, input, (int)ilen) == 1)
  ------------------
  |  Branch (692:6): [True: 438, False: 0]
  ------------------
  693|    438|	{
  694|    438|		*olen = (size_t)outl;
  695|    438|		return TRUE;
  ------------------
  |  |  126|    438|#define TRUE true
  ------------------
  696|    438|	}
  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|    438|}
winpr_Cipher_Final:
  710|    438|{
  711|    438|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  712|       |
  713|    438|#if defined(WITH_OPENSSL)
  714|    438|	int outl = (int)*olen;
  715|       |
  716|    438|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    438|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    438|	do                                                                                             \
  |  |  |  |   61|    438|	{                                                                                              \
  |  |  |  |   62|    438|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    438|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    438|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    438|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    438|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    438|                                                                                                   \
  |  |  |  |   70|    438|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    438|	do                                                      \
  |  |  |  |  |  |   32|    438|	{                                                       \
  |  |  |  |  |  |   33|    438|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    438|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    438|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 438]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    438|                                                                                                   \
  |  |  |  |   72|    438|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    438|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    438|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    438|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 438]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|    438|	if (EVP_CipherFinal_ex(ctx->ectx, output, &outl) == 1)
  ------------------
  |  Branch (717:6): [True: 242, False: 196]
  ------------------
  718|    242|	{
  719|    242|		*olen = (size_t)outl;
  720|    242|		return TRUE;
  ------------------
  |  |  126|    242|#define TRUE true
  ------------------
  721|    242|	}
  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|    196|	return FALSE;
  ------------------
  |  |  122|    196|#define FALSE false
  ------------------
  732|    438|}
winpr_Cipher_Free:
  735|    438|{
  736|    438|	if (!ctx)
  ------------------
  |  Branch (736:6): [True: 0, False: 438]
  ------------------
  737|      0|		return;
  738|       |
  739|    438|#if defined(WITH_OPENSSL)
  740|    438|	if (ctx->ectx)
  ------------------
  |  Branch (740:6): [True: 438, False: 0]
  ------------------
  741|    438|		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|    438|	free(ctx);
  751|    438|}
cipher.c:winpr_RC4_New_Internal:
   79|    236|{
   80|    236|	if (!key || (keylen == 0))
  ------------------
  |  Branch (80:6): [True: 0, False: 236]
  |  Branch (80:14): [True: 0, False: 236]
  ------------------
   81|      0|		return nullptr;
   82|       |
   83|    236|	WINPR_RC4_CTX* ctx = (WINPR_RC4_CTX*)calloc(1, sizeof(WINPR_RC4_CTX));
   84|    236|	if (!ctx)
  ------------------
  |  Branch (84:6): [True: 0, False: 236]
  ------------------
   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|    236|	if (keylen > INT_MAX)
  ------------------
  |  Branch (94:6): [True: 0, False: 236]
  ------------------
   95|      0|		goto fail;
   96|       |
   97|    236|	ctx->ctx = EVP_CIPHER_CTX_new();
   98|    236|	if (!ctx->ctx)
  ------------------
  |  Branch (98:6): [True: 0, False: 236]
  ------------------
   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|    236|	const EVP_CIPHER* evp = EVP_rc4();
  105|    236|#endif
  106|       |
  107|    236|	if (!evp)
  ------------------
  |  Branch (107:6): [True: 0, False: 236]
  ------------------
  108|      0|		goto fail;
  109|       |
  110|    236|	EVP_CIPHER_CTX_reset(ctx->ctx);
  111|    236|	if (EVP_EncryptInit_ex(ctx->ctx, evp, nullptr, nullptr, nullptr) != 1)
  ------------------
  |  Branch (111:6): [True: 0, False: 236]
  ------------------
  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|    236|	EVP_CIPHER_CTX_set_key_length(ctx->ctx, (int)keylen);
  126|    236|	if (EVP_EncryptInit_ex(ctx->ctx, nullptr, nullptr, key, nullptr) != 1)
  ------------------
  |  Branch (126:6): [True: 0, False: 236]
  ------------------
  127|      0|		goto fail;
  128|    236|#endif
  129|    236|	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|    236|}
cipher.c:winpr_openssl_get_evp_cipher:
  287|    438|{
  288|    438|	const EVP_CIPHER* evp = nullptr;
  289|       |
  290|    438|	switch (cipher)
  291|    438|	{
  292|      0|		case WINPR_CIPHER_NULL:
  ------------------
  |  Branch (292:3): [True: 0, False: 438]
  ------------------
  293|      0|			evp = EVP_enc_null();
  294|      0|			break;
  295|       |
  296|      0|		case WINPR_CIPHER_AES_128_ECB:
  ------------------
  |  Branch (296:3): [True: 0, False: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  305|      0|			evp = EVP_get_cipherbyname("aes-256-ecb");
  306|      0|			break;
  307|       |
  308|    438|		case WINPR_CIPHER_AES_128_CBC:
  ------------------
  |  Branch (308:3): [True: 438, False: 0]
  ------------------
  309|    438|			evp = EVP_get_cipherbyname("aes-128-cbc");
  310|    438|			break;
  311|       |
  312|      0|		case WINPR_CIPHER_AES_192_CBC:
  ------------------
  |  Branch (312:3): [True: 0, False: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  465|      0|			evp = EVP_get_cipherbyname("rc4");
  466|      0|			break;
  467|       |
  468|      0|		case WINPR_CIPHER_BLOWFISH_ECB:
  ------------------
  |  Branch (468:3): [True: 0, False: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  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: 438]
  ------------------
  481|      0|			evp = EVP_get_cipherbyname("blowfish-ctr");
  482|      0|			break;
  483|      0|		default:
  ------------------
  |  Branch (483:3): [True: 0, False: 438]
  ------------------
  484|      0|			break;
  485|    438|	}
  486|       |
  487|    438|	return evp;
  488|    438|}

winpr_openssl_get_evp_md:
   69|  1.55k|{
   70|  1.55k|	const char* name = winpr_md_type_to_string(md);
   71|  1.55k|	if (!name)
  ------------------
  |  Branch (71:6): [True: 0, False: 1.55k]
  ------------------
   72|      0|		return nullptr;
   73|  1.55k|	return EVP_get_digestbyname(name);
   74|  1.55k|}
winpr_md_type_to_string:
  142|  1.55k|{
  143|  1.55k|	const struct hash_map* cur = hashes;
  144|  5.96k|	while (cur->name)
  ------------------
  |  Branch (144:9): [True: 5.96k, False: 0]
  ------------------
  145|  5.96k|	{
  146|  5.96k|		if (cur->md == md)
  ------------------
  |  Branch (146:7): [True: 1.55k, False: 4.41k]
  ------------------
  147|  1.55k|			return cur->name;
  148|  4.41k|		cur++;
  149|  4.41k|	}
  150|      0|	return nullptr;
  151|  1.55k|}
winpr_Digest_New:
  445|  1.55k|{
  446|  1.55k|	WINPR_DIGEST_CTX* ctx = calloc(1, sizeof(WINPR_DIGEST_CTX));
  447|  1.55k|	if (!ctx)
  ------------------
  |  Branch (447:6): [True: 0, False: 1.55k]
  ------------------
  448|      0|		return nullptr;
  449|       |
  450|  1.55k|#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.55k|	ctx->mdctx = EVP_MD_CTX_new();
  456|  1.55k|#endif
  457|  1.55k|	if (!ctx->mdctx)
  ------------------
  |  Branch (457:6): [True: 0, False: 1.55k]
  ------------------
  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.55k|	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.55k|}
winpr_Digest_Init:
  560|  1.55k|{
  561|  1.55k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.55k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.55k|	do                                                                                             \
  |  |  |  |   61|  1.55k|	{                                                                                              \
  |  |  |  |   62|  1.55k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.55k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.55k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.55k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.55k|                                                                                                   \
  |  |  |  |   70|  1.55k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.55k|	do                                                      \
  |  |  |  |  |  |   32|  1.55k|	{                                                       \
  |  |  |  |  |  |   33|  1.55k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.55k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.55k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.55k|                                                                                                   \
  |  |  |  |   72|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.55k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.55k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.55k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|       |
  563|  1.55k|	ctx->md = md;
  564|  1.55k|	switch (md)
  565|  1.55k|	{
  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.55k|		default:
  ------------------
  |  Branch (576:3): [True: 1.55k, False: 0]
  ------------------
  577|  1.55k|			break;
  578|  1.55k|	}
  579|       |
  580|  1.55k|#if defined(WITH_OPENSSL)
  581|  1.55k|	const EVP_MD* evp = winpr_openssl_get_evp_md(md);
  582|  1.55k|	return winpr_Digest_Init_Internal(ctx, evp);
  583|       |#else
  584|       |	return winpr_Digest_Init_Internal(ctx, md);
  585|       |#endif
  586|  1.55k|}
winpr_Digest_Update:
  589|  1.55k|{
  590|  1.55k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.55k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.55k|	do                                                                                             \
  |  |  |  |   61|  1.55k|	{                                                                                              \
  |  |  |  |   62|  1.55k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.55k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.55k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.55k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.55k|                                                                                                   \
  |  |  |  |   70|  1.55k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.55k|	do                                                      \
  |  |  |  |  |  |   32|  1.55k|	{                                                       \
  |  |  |  |  |  |   33|  1.55k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.55k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.55k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.55k|                                                                                                   \
  |  |  |  |   72|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.55k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.55k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.55k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|       |
  592|  1.55k|	switch (ctx->md)
  593|  1.55k|	{
  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.55k|		default:
  ------------------
  |  Branch (604:3): [True: 1.55k, False: 0]
  ------------------
  605|  1.55k|			break;
  606|  1.55k|	}
  607|       |
  608|  1.55k|#if defined(WITH_OPENSSL)
  609|  1.55k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  610|       |
  611|  1.55k|	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.55k|}
winpr_Digest_Final:
  624|  1.55k|{
  625|  1.55k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.55k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.55k|	do                                                                                             \
  |  |  |  |   61|  1.55k|	{                                                                                              \
  |  |  |  |   62|  1.55k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.55k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.55k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.55k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.55k|                                                                                                   \
  |  |  |  |   70|  1.55k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.55k|	do                                                      \
  |  |  |  |  |  |   32|  1.55k|	{                                                       \
  |  |  |  |  |  |   33|  1.55k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.55k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.55k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.55k|                                                                                                   \
  |  |  |  |   72|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.55k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.55k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.55k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|       |
  627|  1.55k|	switch (ctx->md)
  628|  1.55k|	{
  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.55k|		default:
  ------------------
  |  Branch (644:3): [True: 1.55k, False: 0]
  ------------------
  645|  1.55k|			break;
  646|  1.55k|	}
  647|       |
  648|  1.55k|#if defined(WITH_OPENSSL)
  649|  1.55k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  650|       |
  651|  1.55k|	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.55k|}
winpr_Digest_Free:
  706|  1.55k|{
  707|  1.55k|	if (!ctx)
  ------------------
  |  Branch (707:6): [True: 0, False: 1.55k]
  ------------------
  708|      0|		return;
  709|  1.55k|#if defined(WITH_OPENSSL)
  710|  1.55k|	if (ctx->mdctx)
  ------------------
  |  Branch (710:6): [True: 1.55k, False: 0]
  ------------------
  711|  1.55k|	{
  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.55k|		EVP_MD_CTX_free(ctx->mdctx);
  717|  1.55k|#endif
  718|  1.55k|	}
  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.55k|	free(ctx);
  729|  1.55k|}
winpr_Digest:
  756|  1.55k|{
  757|  1.55k|	BOOL result = FALSE;
  ------------------
  |  |  122|  1.55k|#define FALSE false
  ------------------
  758|  1.55k|	WINPR_DIGEST_CTX* ctx = winpr_Digest_New();
  759|       |
  760|  1.55k|	if (!ctx)
  ------------------
  |  Branch (760:6): [True: 0, False: 1.55k]
  ------------------
  761|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  762|       |
  763|  1.55k|	if (!winpr_Digest_Init(ctx, md))
  ------------------
  |  Branch (763:6): [True: 0, False: 1.55k]
  ------------------
  764|      0|		goto out;
  765|       |
  766|  1.55k|	if (!winpr_Digest_Update(ctx, input, ilen))
  ------------------
  |  Branch (766:6): [True: 0, False: 1.55k]
  ------------------
  767|      0|		goto out;
  768|       |
  769|  1.55k|	if (!winpr_Digest_Final(ctx, output, olen))
  ------------------
  |  Branch (769:6): [True: 0, False: 1.55k]
  ------------------
  770|      0|		goto out;
  771|       |
  772|  1.55k|	result = TRUE;
  ------------------
  |  |  126|  1.55k|#define TRUE true
  ------------------
  773|  1.55k|out:
  774|  1.55k|	winpr_Digest_Free(ctx);
  775|  1.55k|	return result;
  776|  1.55k|}
hash.c:winpr_Digest_Init_Internal:
  480|  1.55k|{
  481|  1.55k|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|  1.55k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  1.55k|	do                                                                                             \
  |  |  |  |   61|  1.55k|	{                                                                                              \
  |  |  |  |   62|  1.55k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  1.55k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  1.55k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  1.55k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  1.55k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  1.55k|                                                                                                   \
  |  |  |  |   70|  1.55k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.55k|	do                                                      \
  |  |  |  |  |  |   32|  1.55k|	{                                                       \
  |  |  |  |  |  |   33|  1.55k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.55k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  1.55k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.55k|                                                                                                   \
  |  |  |  |   72|  1.55k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  1.55k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  1.55k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  1.55k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  1.55k|	EVP_MD_CTX* mdctx = ctx->mdctx;
  483|       |
  484|  1.55k|	if (!mdctx || !evp)
  ------------------
  |  Branch (484:6): [True: 0, False: 1.55k]
  |  Branch (484:16): [True: 0, False: 1.55k]
  ------------------
  485|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  486|       |
  487|  1.55k|	if (EVP_DigestInit_ex(mdctx, evp, nullptr) != 1)
  ------------------
  |  Branch (487:6): [True: 0, False: 1.55k]
  ------------------
  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.55k|	return TRUE;
  ------------------
  |  |  126|  1.55k|#define TRUE true
  ------------------
  494|  1.55k|}

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|  78.7k|{
  241|  78.7k|	WINPR_ASSERT(Addend);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|       |
  243|  78.7k|#if defined(__GNUC__) || defined(__clang__)
  244|  78.7k|	WINPR_PRAGMA_DIAG_PUSH
  245|  78.7k|	WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
  246|  78.7k|	return __sync_add_and_fetch(Addend, 1);
  247|  78.7k|	WINPR_PRAGMA_DIAG_POP
  248|       |#else
  249|       |	return 0;
  250|       |#endif
  251|  78.7k|}
InterlockedDecrement:
  254|  78.7k|{
  255|  78.7k|	WINPR_ASSERT(Addend);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|       |
  257|  78.7k|#if defined(__GNUC__) || defined(__clang__)
  258|  78.7k|	WINPR_PRAGMA_DIAG_PUSH
  259|  78.7k|	WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
  260|  78.7k|	return __sync_sub_and_fetch(Addend, 1);
  261|  78.7k|	WINPR_PRAGMA_DIAG_POP
  262|       |#else
  263|       |	return 0;
  264|       |#endif
  265|  78.7k|}
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.47k|{
   56|  6.47k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.47k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.47k|	do                                                                                             \
  |  |  |  |   61|  6.47k|	{                                                                                              \
  |  |  |  |   62|  6.47k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.47k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.47k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.47k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.47k|                                                                                                   \
  |  |  |  |   70|  6.47k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.47k|	do                                                      \
  |  |  |  |  |  |   32|  6.47k|	{                                                       \
  |  |  |  |  |  |   33|  6.47k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.47k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.47k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.47k|                                                                                                   \
  |  |  |  |   72|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.47k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.47k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.47k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   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.47k|	if (Flags != 0)
  ------------------
  |  Branch (67:6): [True: 0, False: 6.47k]
  ------------------
   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.47k|	lpCriticalSection->DebugInfo = nullptr;
   73|  6.47k|	lpCriticalSection->LockCount = -1;
   74|  6.47k|	lpCriticalSection->SpinCount = 0;
   75|  6.47k|	lpCriticalSection->RecursionCount = 0;
   76|  6.47k|	lpCriticalSection->OwningThread = nullptr;
   77|  6.47k|	lpCriticalSection->LockSemaphore = (winpr_sem_t*)malloc(sizeof(winpr_sem_t));
   78|       |
   79|  6.47k|	if (!lpCriticalSection->LockSemaphore)
  ------------------
  |  Branch (79:6): [True: 0, False: 6.47k]
  ------------------
   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.47k|	if (sem_init(lpCriticalSection->LockSemaphore, 0, 0) != 0)
  ------------------
  |  Branch (90:6): [True: 0, False: 6.47k]
  ------------------
   91|      0|		goto out_fail;
   92|       |
   93|  6.47k|#endif
   94|  6.47k|	SetCriticalSectionSpinCount(lpCriticalSection, dwSpinCount);
   95|  6.47k|	return TRUE;
  ------------------
  |  |  126|  6.47k|#define TRUE true
  ------------------
   96|      0|out_fail:
   97|      0|	free(lpCriticalSection->LockSemaphore);
   98|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   99|  6.47k|}
InitializeCriticalSectionAndSpinCount:
  102|  6.47k|{
  103|  6.47k|	return InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, 0);
  104|  6.47k|}
SetCriticalSectionSpinCount:
  108|  6.47k|{
  109|  6.47k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.47k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.47k|	do                                                                                             \
  |  |  |  |   61|  6.47k|	{                                                                                              \
  |  |  |  |   62|  6.47k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.47k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.47k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.47k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.47k|                                                                                                   \
  |  |  |  |   70|  6.47k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.47k|	do                                                      \
  |  |  |  |  |  |   32|  6.47k|	{                                                       \
  |  |  |  |  |  |   33|  6.47k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.47k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.47k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.47k|                                                                                                   \
  |  |  |  |   72|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.47k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.47k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.47k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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.47k|	return 0;
  128|  6.47k|#endif
  129|  6.47k|}
EnterCriticalSection:
  155|  78.7k|{
  156|  78.7k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  78.7k|	if (InterlockedIncrement(&lpCriticalSection->LockCount))
  ------------------
  |  Branch (190:6): [True: 0, False: 78.7k]
  ------------------
  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|  78.7k|	lpCriticalSection->RecursionCount = 1;
  206|  78.7k|	lpCriticalSection->OwningThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId();
  207|  78.7k|}
LeaveCriticalSection:
  236|  78.7k|{
  237|  78.7k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|       |
  239|       |	/* Decrement RecursionCount and check if this is the last LeaveCriticalSection call ...*/
  240|  78.7k|	if (--lpCriticalSection->RecursionCount < 1)
  ------------------
  |  Branch (240:6): [True: 78.7k, False: 0]
  ------------------
  241|  78.7k|	{
  242|       |		/* Last recursion, clear owner, unlock and if there are other waiting threads ... */
  243|  78.7k|		lpCriticalSection->OwningThread = nullptr;
  244|       |
  245|  78.7k|		if (InterlockedDecrement(&lpCriticalSection->LockCount) >= 0)
  ------------------
  |  Branch (245:7): [True: 0, False: 78.7k]
  ------------------
  246|      0|		{
  247|       |			/* ...signal the semaphore to unblock the next waiting thread */
  248|      0|			UnWaitCriticalSection(lpCriticalSection);
  249|      0|		}
  250|  78.7k|	}
  251|      0|	else
  252|      0|	{
  253|      0|		(void)InterlockedDecrement(&lpCriticalSection->LockCount);
  254|      0|	}
  255|  78.7k|}
DeleteCriticalSection:
  258|  6.47k|{
  259|  6.47k|	WINPR_ASSERT(lpCriticalSection);
  ------------------
  |  |   76|  6.47k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  6.47k|	do                                                                                             \
  |  |  |  |   61|  6.47k|	{                                                                                              \
  |  |  |  |   62|  6.47k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  6.47k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  6.47k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  6.47k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  6.47k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  6.47k|                                                                                                   \
  |  |  |  |   70|  6.47k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.47k|	do                                                      \
  |  |  |  |  |  |   32|  6.47k|	{                                                       \
  |  |  |  |  |  |   33|  6.47k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  6.47k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  6.47k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  6.47k|                                                                                                   \
  |  |  |  |   72|  6.47k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  6.47k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  6.47k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  6.47k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 6.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|       |
  261|  6.47k|	lpCriticalSection->LockCount = -1;
  262|  6.47k|	lpCriticalSection->SpinCount = 0;
  263|  6.47k|	lpCriticalSection->RecursionCount = 0;
  264|  6.47k|	lpCriticalSection->OwningThread = nullptr;
  265|       |
  266|  6.47k|	if (lpCriticalSection->LockSemaphore != nullptr)
  ------------------
  |  Branch (266:6): [True: 6.47k, False: 0]
  ------------------
  267|  6.47k|	{
  268|       |#if defined __APPLE__
  269|       |		semaphore_destroy(mach_task_self(), *((winpr_sem_t*)lpCriticalSection->LockSemaphore));
  270|       |#else
  271|  6.47k|		sem_destroy((winpr_sem_t*)lpCriticalSection->LockSemaphore);
  272|  6.47k|#endif
  273|  6.47k|		free(lpCriticalSection->LockSemaphore);
  274|  6.47k|		lpCriticalSection->LockSemaphore = nullptr;
  275|  6.47k|	}
  276|  6.47k|}

winpr_InitOnceExecuteOnce:
   55|  2.15k|{
   56|  2.15k|	for (;;)
   57|  2.15k|	{
   58|  2.15k|		switch ((ULONG_PTR)InitOnce->Ptr & 3)
   59|  2.15k|		{
   60|  2.15k|			case 2:
  ------------------
  |  Branch (60:4): [True: 2.15k, False: 2]
  ------------------
   61|       |				/* already completed successfully */
   62|  2.15k|				return TRUE;
  ------------------
  |  |  126|  2.15k|#define TRUE true
  ------------------
   63|       |
   64|      2|			case 0:
  ------------------
  |  Branch (64:4): [True: 2, False: 2.15k]
  ------------------
   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.15k]
  ------------------
   87|       |				/* in progress */
   88|      0|				break;
   89|       |
   90|      0|			default:
  ------------------
  |  Branch (90:4): [True: 0, False: 2.15k]
  ------------------
   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.15k|		}
   94|       |
   95|      0|		Sleep(5);
   96|      0|	}
   97|  2.15k|}

GetLocalTime:
  308|  78.7k|{
  309|  78.7k|	time_t ct = 0;
  310|  78.7k|	struct tm tres;
  311|  78.7k|	struct tm* ltm = nullptr;
  312|  78.7k|	WORD wMilliseconds = 0;
  313|  78.7k|	UINT64 now = winpr_GetUnixTimeNS();
  314|  78.7k|	ct = WINPR_TIME_NS_TO_S(now);
  ------------------
  |  |  400|  78.7k|#define WINPR_TIME_NS_TO_S(ns) ((ns) / 1000000000ull) /** @since version 3.4.0 */
  ------------------
  315|  78.7k|	wMilliseconds = (WORD)(WINPR_TIME_NS_REM_MS(now));
  ------------------
  |  |  406|  78.7k|#define WINPR_TIME_NS_REM_MS(ns) (WINPR_TIME_NS_REM_US(ns) / 1000ull) /** @since version 3.4.0 */
  |  |  ------------------
  |  |  |  |  405|  78.7k|#define WINPR_TIME_NS_REM_US(ns) (WINPR_TIME_NS_REM_NS(ns) / 1000ull) /** @since version 3.4.0 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  404|  78.7k|#define WINPR_TIME_NS_REM_NS(ns) ((ns) % 1000000000ull)               /** @since version 3.4.0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  78.7k|	ltm = localtime_r(&ct, &tres);
  317|  78.7k|	ZeroMemory(lpSystemTime, sizeof(SYSTEMTIME));
  ------------------
  |  |  126|  78.7k|#define ZeroMemory(Destination, Length) memset((Destination), 0, (Length))
  ------------------
  318|       |
  319|  78.7k|	if (ltm)
  ------------------
  |  Branch (319:6): [True: 78.7k, False: 0]
  ------------------
  320|  78.7k|	{
  321|  78.7k|		lpSystemTime->wYear = (WORD)(ltm->tm_year + 1900);
  322|  78.7k|		lpSystemTime->wMonth = (WORD)(ltm->tm_mon + 1);
  323|  78.7k|		lpSystemTime->wDayOfWeek = (WORD)ltm->tm_wday;
  324|  78.7k|		lpSystemTime->wDay = (WORD)ltm->tm_mday;
  325|  78.7k|		lpSystemTime->wHour = (WORD)ltm->tm_hour;
  326|  78.7k|		lpSystemTime->wMinute = (WORD)ltm->tm_min;
  327|  78.7k|		lpSystemTime->wSecond = (WORD)ltm->tm_sec;
  328|  78.7k|		lpSystemTime->wMilliseconds = wMilliseconds;
  329|  78.7k|	}
  330|  78.7k|}
winpr_GetUnixTimeNS:
 1042|  78.7k|{
 1043|       |#if defined(_WIN32)
 1044|       |
 1045|       |	union
 1046|       |	{
 1047|       |		UINT64 u64;
 1048|       |		FILETIME ft;
 1049|       |	} t = WINPR_C_ARRAY_INIT;
 1050|       |	GetSystemTimeAsFileTime(&t.ft);
 1051|       |	return (t.u64 - FILETIME_TO_UNIX_OFFSET_S * 10000000ull) * 100ull;
 1052|       |#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L)
 1053|  78.7k|	struct timespec ts = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
 1054|  78.7k|	if (clock_gettime(CLOCK_REALTIME, &ts) != 0)
  ------------------
  |  Branch (1054:6): [True: 0, False: 78.7k]
  ------------------
 1055|      0|		return 0;
 1056|  78.7k|	return WINPR_ASSERTING_INT_CAST(uint64_t, ts.tv_sec) * 1000000000ull +
  ------------------
  |  |  180|  78.7k|	__extension__({                                                                             \
  |  |  181|  78.7k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  78.7k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  78.7k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  78.7k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   236k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  78.7k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  78.7k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  78.7k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  78.7k|	})
  ------------------
 1057|  78.7k|	       WINPR_ASSERTING_INT_CAST(uint64_t, ts.tv_nsec);
  ------------------
  |  |  180|  78.7k|	__extension__({                                                                             \
  |  |  181|  78.7k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  78.7k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  78.7k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  78.7k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   236k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  78.7k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  78.7k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  78.7k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  78.7k|	})
  ------------------
 1058|       |#else
 1059|       |	struct timeval tv = WINPR_C_ARRAY_INIT;
 1060|       |	if (gettimeofday(&tv, nullptr) != 0)
 1061|       |		return 0;
 1062|       |	return tv.tv_sec * 1000000000ULL + tv.tv_usec * 1000ull;
 1063|       |#endif
 1064|  78.7k|}

GetCurrentProcessId:
  684|  78.7k|{
  685|  78.7k|	return ((DWORD)getpid());
  686|  78.7k|}

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

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

winpr_HexStringToBinBuffer:
  188|    438|{
  189|    438|	size_t y = 0;
  190|    438|	size_t maxStrLen = 0;
  191|    438|	if (!str || !data || (strLength == 0) || (dataLength == 0))
  ------------------
  |  Branch (191:6): [True: 0, False: 438]
  |  Branch (191:14): [True: 0, False: 438]
  |  Branch (191:23): [True: 1, False: 437]
  |  Branch (191:43): [True: 0, False: 437]
  ------------------
  192|      1|		return 0;
  193|       |
  194|    437|	maxStrLen = strnlen(str, strLength);
  195|  5.61M|	for (size_t x = 0; x < maxStrLen;)
  ------------------
  |  Branch (195:21): [True: 5.61M, False: 435]
  ------------------
  196|  5.61M|	{
  197|  5.61M|		BYTE val = value(str[x++]);
  198|  5.61M|		if (x < maxStrLen)
  ------------------
  |  Branch (198:7): [True: 5.61M, False: 327]
  ------------------
  199|  5.61M|			val = (BYTE)(val << 4) | (value(str[x++]));
  200|  5.61M|		if (x < maxStrLen)
  ------------------
  |  Branch (200:7): [True: 5.61M, False: 437]
  ------------------
  201|  5.61M|		{
  202|  5.61M|			if (str[x] == ' ')
  ------------------
  |  Branch (202:8): [True: 7.41k, False: 5.61M]
  ------------------
  203|  7.41k|				x++;
  204|  5.61M|		}
  205|  5.61M|		data[y++] = val;
  206|  5.61M|		if (y >= dataLength)
  ------------------
  |  Branch (206:7): [True: 2, False: 5.61M]
  ------------------
  207|      2|			return y;
  208|  5.61M|	}
  209|    435|	return y;
  210|    437|}
print.c:value:
  177|  11.2M|{
  178|  11.2M|	if ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (178:6): [True: 9.93M, False: 1.30M]
  |  Branch (178:20): [True: 3.86M, False: 6.06M]
  ------------------
  179|  3.86M|		return (c - '0') & 0xFF;
  180|  7.37M|	if ((c >= 'A') && (c <= 'F'))
  ------------------
  |  Branch (180:6): [True: 829k, False: 6.54M]
  |  Branch (180:20): [True: 119k, False: 709k]
  ------------------
  181|   119k|		return (10 + c - 'A') & 0xFF;
  182|  7.25M|	if ((c >= 'a') && (c <= 'f'))
  ------------------
  |  Branch (182:6): [True: 328k, False: 6.92M]
  |  Branch (182:20): [True: 264k, False: 64.3k]
  ------------------
  183|   264k|		return (10 + c - 'a') & 0xFF;
  184|  6.98M|	return 0;
  185|  7.25M|}

winpr_InitializeSSL:
  350|  2.15k|{
  351|  2.15k|	static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
  ------------------
  |  |  402|  2.15k|#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
  |  |  ------------------
  |  |  |  |  377|  2.15k|	{                     \
  |  |  |  |  378|  2.15k|		0                 \
  |  |  |  |  379|  2.15k|	}
  |  |  ------------------
  ------------------
  352|       |
  353|  2.15k|	if (!InitOnceExecuteOnce(&once, winpr_openssl_initialize, &flags, nullptr))
  ------------------
  |  |  424|  2.15k|#define InitOnceExecuteOnce winpr_InitOnceExecuteOnce
  ------------------
  |  Branch (353:6): [True: 0, False: 2.15k]
  ------------------
  354|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  355|       |
  356|  2.15k|	return winpr_enable_fips(flags);
  357|  2.15k|}
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.15k|{
  247|  2.15k|	if (flags & WINPR_SSL_INIT_ENABLE_FIPS)
  ------------------
  |  |   30|  2.15k|#define WINPR_SSL_INIT_ENABLE_FIPS 0x4
  ------------------
  |  Branch (247:6): [True: 0, False: 2.15k]
  ------------------
  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.15k|	return TRUE;
  ------------------
  |  |  126|  2.15k|#define TRUE true
  ------------------
  283|  2.15k|}

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|   157k|{
   41|   157k|	if (!log)
  ------------------
  |  Branch (41:6): [True: 0, False: 157k]
  ------------------
   42|      0|		return nullptr;
   43|       |
   44|   157k|	if (!log->Appender)
  ------------------
  |  Branch (44:6): [True: 78.7k, False: 78.7k]
  ------------------
   45|  78.7k|		return WLog_GetLogAppender(log->Parent);
   46|       |
   47|  78.7k|	return log->Appender;
   48|   157k|}
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:
  243|      1|{
  244|      1|	wLogConsoleAppender* ConsoleAppender =
  245|      1|	    (wLogConsoleAppender*)calloc(1, sizeof(wLogConsoleAppender));
  246|       |
  247|      1|	if (!ConsoleAppender)
  ------------------
  |  Branch (247:6): [True: 0, False: 1]
  ------------------
  248|      0|		return nullptr;
  249|       |
  250|      1|	ConsoleAppender->common.Type = WLOG_APPENDER_CONSOLE;
  251|      1|	ConsoleAppender->common.Open = WLog_ConsoleAppender_Open;
  252|      1|	ConsoleAppender->common.Close = WLog_ConsoleAppender_Close;
  253|      1|	ConsoleAppender->common.WriteMessage = WLog_ConsoleAppender_WriteMessage;
  254|      1|	ConsoleAppender->common.WriteDataMessage = WLog_ConsoleAppender_WriteDataMessage;
  255|      1|	ConsoleAppender->common.WriteImageMessage = WLog_ConsoleAppender_WriteImageMessage;
  256|      1|	ConsoleAppender->common.WritePacketMessage = WLog_ConsoleAppender_WritePacketMessage;
  257|      1|	ConsoleAppender->common.Set = WLog_ConsoleAppender_Set;
  258|      1|	ConsoleAppender->common.Free = WLog_ConsoleAppender_Free;
  259|       |
  260|      1|	ConsoleAppender->outputStream = WLOG_CONSOLE_DEFAULT;
  ------------------
  |  |   29|      1|#define WLOG_CONSOLE_DEFAULT 0
  ------------------
  261|       |
  262|       |#ifdef _WIN32
  263|       |	if (IsDebuggerPresent())
  264|       |		ConsoleAppender->outputStream = WLOG_CONSOLE_DEBUG;
  265|       |#endif
  266|       |
  267|      1|	return &ConsoleAppender->common;
  268|      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|  78.7k|{
   56|  78.7k|	if (!appender)
  ------------------
  |  Branch (56:6): [True: 0, False: 78.7k]
  ------------------
   57|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
   58|       |
   59|  78.7k|	wLogConsoleAppender* consoleAppender = (wLogConsoleAppender*)appender;
   60|       |
   61|  78.7k|	char prefix[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
   62|  78.7k|	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|  78.7k|	FILE* fp = nullptr;
  109|  78.7k|	switch (consoleAppender->outputStream)
  110|  78.7k|	{
  111|      0|		case WLOG_CONSOLE_STDOUT:
  ------------------
  |  |   30|      0|#define WLOG_CONSOLE_STDOUT 1
  ------------------
  |  Branch (111:3): [True: 0, False: 78.7k]
  ------------------
  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: 78.7k]
  ------------------
  115|      0|			fp = stderr;
  116|      0|			break;
  117|  78.7k|		default:
  ------------------
  |  Branch (117:3): [True: 78.7k, False: 0]
  ------------------
  118|  78.7k|			switch (cmessage->Level)
  119|  78.7k|			{
  120|      0|				case WLOG_TRACE:
  ------------------
  |  Branch (120:5): [True: 0, False: 78.7k]
  ------------------
  121|      0|				case WLOG_DEBUG:
  ------------------
  |  Branch (121:5): [True: 0, False: 78.7k]
  ------------------
  122|      0|				case WLOG_INFO:
  ------------------
  |  Branch (122:5): [True: 0, False: 78.7k]
  ------------------
  123|      0|					fp = stdout;
  124|      0|					break;
  125|  78.7k|				default:
  ------------------
  |  Branch (125:5): [True: 78.7k, False: 0]
  ------------------
  126|  78.7k|					fp = stderr;
  127|  78.7k|					break;
  128|  78.7k|			}
  129|  78.7k|			break;
  130|  78.7k|	}
  131|       |
  132|  78.7k|	if (cmessage->Level != WLOG_OFF)
  ------------------
  |  Branch (132:6): [True: 78.7k, False: 0]
  ------------------
  133|  78.7k|		(void)fprintf(fp, "%s%s\n", prefix, cmessage->TextString);
  134|  78.7k|#endif
  135|  78.7k|	return TRUE;
  ------------------
  |  |  126|  78.7k|#define TRUE true
  ------------------
  136|  78.7k|}
ConsoleAppender.c:WLog_ConsoleAppender_Free:
  230|      1|{
  231|      1|	if (appender)
  ------------------
  |  Branch (231:6): [True: 1, False: 0]
  ------------------
  232|      1|	{
  233|      1|		if (appender->PacketMessageContext)
  ------------------
  |  Branch (233:7): [True: 0, False: 1]
  ------------------
  234|      0|		{
  235|      0|			Pcap_Close((wPcap*)appender->PacketMessageContext);
  236|      0|		}
  237|       |
  238|      1|		free(appender);
  239|      1|	}
  240|      1|}

WLog_Layout_GetMessagePrefix:
  246|  78.7k|{
  247|  78.7k|	char format[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
  248|       |
  249|  78.7k|	WINPR_ASSERT(layout);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|  78.7k|	WINPR_ASSERT(message);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  78.7k|	WINPR_ASSERT(prefix);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|       |
  253|  78.7k|	struct format_tid_arg targ = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
  254|       |
  255|  78.7k|	SYSTEMTIME localTime = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
  256|  78.7k|	GetLocalTime(&localTime);
  257|       |
  258|  78.7k|	struct format_option_recurse recurse = {
  259|  78.7k|		.options = nullptr, .nroptions = 0, .log = log, .layout = layout, .message = message
  260|  78.7k|	};
  261|       |
  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  263|  78.7k|	struct format_option options[] = {
  264|  78.7k|		{ ENTRY("%ctx"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  265|  78.7k|		  ENTRY("%s"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  266|  78.7k|		  log->custom,
  267|  78.7k|		  { .pv = log->context },
  268|  78.7k|		  nullptr,
  269|  78.7k|		  &recurse }, /* log context */
  270|  78.7k|		{ ENTRY("%dw"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  271|  78.7k|		  ENTRY("%u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  272|  78.7k|		  nullptr,
  273|  78.7k|		  { .s = localTime.wDayOfWeek },
  274|  78.7k|		  nullptr,
  275|  78.7k|		  &recurse }, /* day of week */
  276|  78.7k|		{ ENTRY("%dy"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  277|  78.7k|		  ENTRY("%u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  278|  78.7k|		  nullptr,
  279|  78.7k|		  { .s = localTime.wDay },
  280|  78.7k|		  nullptr,
  281|  78.7k|		  &recurse }, /* day of year
  282|       |		               */
  283|  78.7k|		{ ENTRY("%fl"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  284|  78.7k|		  ENTRY("%s"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  285|  78.7k|		  nullptr,
  286|  78.7k|		  { .cpv = message->FileName },
  287|  78.7k|		  nullptr,
  288|  78.7k|		  &recurse }, /* file
  289|       |		               */
  290|  78.7k|		{ ENTRY("%fn"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  291|  78.7k|		  ENTRY("%s"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  292|  78.7k|		  nullptr,
  293|  78.7k|		  { .cpv = message->FunctionName },
  294|  78.7k|		  nullptr,
  295|  78.7k|		  &recurse }, /* function
  296|       |		               */
  297|  78.7k|		{ ENTRY("%hr"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  298|  78.7k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  299|  78.7k|		  nullptr,
  300|  78.7k|		  { .s = localTime.wHour },
  301|  78.7k|		  nullptr,
  302|  78.7k|		  &recurse }, /* hours
  303|       |		               */
  304|  78.7k|		{ ENTRY("%ln"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  305|  78.7k|		  ENTRY("%" PRIuz),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  306|  78.7k|		  nullptr,
  307|  78.7k|		  { .s = message->LineNumber },
  308|  78.7k|		  nullptr,
  309|  78.7k|		  &recurse }, /* line number */
  310|  78.7k|		{ ENTRY("%lv"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  311|  78.7k|		  ENTRY("%s"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  312|  78.7k|		  nullptr,
  313|  78.7k|		  { .cpv = WLOG_LEVELS[message->Level] },
  314|  78.7k|		  nullptr,
  315|  78.7k|		  &recurse }, /* log level */
  316|  78.7k|		{ ENTRY("%mi"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  317|  78.7k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  318|  78.7k|		  nullptr,
  319|  78.7k|		  { .s = localTime.wMinute },
  320|  78.7k|		  nullptr,
  321|  78.7k|		  &recurse }, /* minutes
  322|       |		               */
  323|  78.7k|		{ ENTRY("%ml"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  324|  78.7k|		  ENTRY("%03u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  325|  78.7k|		  nullptr,
  326|  78.7k|		  { .s = localTime.wMilliseconds },
  327|  78.7k|		  nullptr,
  328|  78.7k|		  &recurse }, /* milliseconds */
  329|  78.7k|		{ ENTRY("%mn"), ENTRY("%s"), nullptr, { .cpv = log->Name }, nullptr, &recurse }, /* module
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%mn"), ENTRY("%s"), nullptr, { .cpv = log->Name }, nullptr, &recurse }, /* module
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  330|       |		                                                                                    name */
  331|  78.7k|		{ ENTRY("%mo"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  332|  78.7k|		  ENTRY("%u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  333|  78.7k|		  nullptr,
  334|  78.7k|		  { .s = localTime.wMonth },
  335|  78.7k|		  nullptr,
  336|  78.7k|		  &recurse }, /* month
  337|       |		               */
  338|  78.7k|		{ ENTRY("%pid"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  339|  78.7k|		  ENTRY("%u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  340|  78.7k|		  nullptr,
  341|  78.7k|		  { .s = GetCurrentProcessId() },
  342|  78.7k|		  nullptr,
  343|  78.7k|		  &recurse }, /* process id */
  344|  78.7k|		{ ENTRY("%se"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  345|  78.7k|		  ENTRY("%02u"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  346|  78.7k|		  nullptr,
  347|  78.7k|		  { .s = localTime.wSecond },
  348|  78.7k|		  nullptr,
  349|  78.7k|		  &recurse },                                                                /* seconds
  350|       |		                                                                              */
  351|  78.7k|		{ ENTRY("%tid"), ENTRY("%s"), get_tid, { .pv = &targ }, nullptr, &recurse }, /* thread id */
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%tid"), ENTRY("%s"), get_tid, { .pv = &targ }, nullptr, &recurse }, /* thread id */
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  352|  78.7k|		{ ENTRY("%yr"), ENTRY("%u"), nullptr, { .s = localTime.wYear }, nullptr, &recurse }, /* year
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
              		{ ENTRY("%yr"), ENTRY("%u"), nullptr, { .s = localTime.wYear }, nullptr, &recurse }, /* year
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  353|       |		                                                                                      */
  354|  78.7k|		{ ENTRY("%{"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  355|  78.7k|		  ENTRY("%}"),
  ------------------
  |  |  262|  78.7k|#define ENTRY(x) x, sizeof(x) - 1
  ------------------
  356|  78.7k|		  nullptr,
  357|  78.7k|		  { .pv = log->context },
  358|  78.7k|		  skip_if_null,
  359|  78.7k|		  &recurse }, /* skip if no context */
  360|  78.7k|	};
  361|       |
  362|  78.7k|	recurse.options = options;
  363|  78.7k|	recurse.nroptions = ARRAYSIZE(options);
  ------------------
  |  |  962|  78.7k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  958|  78.7k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  957|  78.7k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|       |
  365|  78.7k|	if (!replace_format_string(layout->FormatString, &recurse, format, ARRAYSIZE(format)))
  ------------------
  |  |  962|  78.7k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  958|  78.7k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  957|  78.7k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (365:6): [True: 0, False: 78.7k]
  ------------------
  366|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  367|       |
  368|  78.7k|	WINPR_PRAGMA_DIAG_PUSH
  369|  78.7k|	WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY
  370|       |
  371|  78.7k|	WLog_PrintMessagePrefix(prefix, prefixlen, format);
  372|       |
  373|  78.7k|	WINPR_PRAGMA_DIAG_POP
  374|       |
  375|  78.7k|	return TRUE;
  ------------------
  |  |  126|  78.7k|#define TRUE true
  ------------------
  376|  78.7k|}
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|  78.7k|{
  102|  78.7k|	struct format_tid_arg* targ = arg;
  103|  78.7k|	WINPR_ASSERT(targ);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|       |
  105|  78.7k|	size_t tid = 0;
  106|  78.7k|#if defined __linux__ && !defined ANDROID
  107|       |	/* On Linux we prefer to see the LWP id */
  108|  78.7k|	tid = (size_t)syscall(SYS_gettid);
  109|       |#else
  110|       |	tid = (size_t)GetCurrentThreadId();
  111|       |#endif
  112|  78.7k|	(void)_snprintf(targ->tid, sizeof(targ->tid), "%08" PRIxz, tid);
  ------------------
  |  |  295|  78.7k|#define _snprintf snprintf
  ------------------
              	(void)_snprintf(targ->tid, sizeof(targ->tid), "%08" PRIxz, tid);
  ------------------
  |  |  487|  78.7k|#define PRIxz "zx"
  ------------------
  113|  78.7k|	return targ->tid;
  114|  78.7k|}
Layout.c:skip_if_null:
  150|  78.7k|{
  151|  78.7k|	WINPR_ASSERT(opt);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  78.7k|	WINPR_ASSERT(fmt);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  78.7k|	WINPR_ASSERT(preplacelen);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|  78.7k|	WINPR_ASSERT(pskiplen);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|       |
  156|  78.7k|	*preplacelen = 0;
  157|  78.7k|	*pskiplen = 0;
  158|       |
  159|  78.7k|	const char* str = &fmt[opt->fmtlen]; /* Skip first %{ from string */
  160|  78.7k|	const char* end = strstr(str, opt->replace);
  161|  78.7k|	if (!end)
  ------------------
  |  Branch (161:6): [True: 0, False: 78.7k]
  ------------------
  162|      0|		return nullptr;
  163|  78.7k|	*pskiplen = WINPR_ASSERTING_INT_CAST(size_t, end - fmt) + opt->replacelen;
  ------------------
  |  |  180|  78.7k|	__extension__({                                                                             \
  |  |  181|  78.7k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|  78.7k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|  78.7k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|  78.7k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   236k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 78.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|  78.7k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|  78.7k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|  78.7k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|  78.7k|	})
  ------------------
  164|       |
  165|  78.7k|	if (!opt->arg.cpv)
  ------------------
  |  Branch (165:6): [True: 78.7k, False: 0]
  ------------------
  166|  78.7k|		return nullptr;
  167|       |
  168|      0|	const size_t replacelen = WINPR_ASSERTING_INT_CAST(size_t, end - str);
  ------------------
  |  |  180|      0|	__extension__({                                                                             \
  |  |  181|      0|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|      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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|      0|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|      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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|      0|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|      0|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|      0|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|      0|	})
  ------------------
  169|       |
  170|      0|	char buffer[WLOG_MAX_PREFIX_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|      0|	{                      \
  |  |   86|      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)))
  ------------------
  |  |  962|      0|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  958|      0|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  957|      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));
  ------------------
  |  |  962|      0|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  958|      0|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  957|      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|  78.7k|{
  184|  78.7k|	WINPR_ASSERT(FormatString);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  78.7k|	WINPR_ASSERT(recurse);
  ------------------
  |  |   76|  78.7k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|  78.7k|	do                                                                                             \
  |  |  |  |   61|  78.7k|	{                                                                                              \
  |  |  |  |   62|  78.7k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|  78.7k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|  78.7k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|  78.7k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|  78.7k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|  78.7k|                                                                                                   \
  |  |  |  |   70|  78.7k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  78.7k|	do                                                      \
  |  |  |  |  |  |   32|  78.7k|	{                                                       \
  |  |  |  |  |  |   33|  78.7k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  78.7k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|  78.7k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 78.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  78.7k|                                                                                                   \
  |  |  |  |   72|  78.7k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|  78.7k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|  78.7k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|  78.7k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 78.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  186|       |
  187|  78.7k|	size_t index = 0;
  188|  78.7k|	const char* prefix = WLog_GetGlobalPrefix();
  189|  78.7k|	if (prefix)
  ------------------
  |  Branch (189:6): [True: 0, False: 78.7k]
  ------------------
  190|      0|	{
  191|      0|		const int res = _snprintf(format, formatlen, "{%s}", prefix);
  ------------------
  |  |  295|      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.51M|	while (*FormatString)
  ------------------
  |  Branch (197:9): [True: 2.44M, False: 78.7k]
  ------------------
  198|  2.44M|	{
  199|  2.44M|		const struct format_option* opt =
  200|  2.44M|		    bsearch(FormatString, recurse->options, recurse->nroptions,
  201|  2.44M|		            sizeof(struct format_option), opt_compare_fn);
  202|  2.44M|		if (opt)
  ------------------
  |  Branch (202:7): [True: 787k, False: 1.65M]
  ------------------
  203|   787k|		{
  204|   787k|			size_t replacelen = opt->replacelen;
  205|   787k|			size_t fmtlen = opt->fmtlen;
  206|   787k|			const char* replace = opt->replace;
  207|   787k|			const void* arg = opt->arg.cpv;
  208|       |
  209|   787k|			if (opt->ext)
  ------------------
  |  Branch (209:8): [True: 78.7k, False: 708k]
  ------------------
  210|  78.7k|				replace = opt->ext(opt, FormatString, &replacelen, &fmtlen);
  211|   787k|			if (opt->fkt)
  ------------------
  |  Branch (211:8): [True: 78.7k, False: 708k]
  ------------------
  212|  78.7k|				arg = opt->fkt(opt->arg.pv);
  213|       |
  214|   787k|			if (replace && (replacelen > 0))
  ------------------
  |  Branch (214:8): [True: 708k, False: 78.7k]
  |  Branch (214:19): [True: 708k, False: 0]
  ------------------
  215|   708k|			{
  216|   708k|				WINPR_PRAGMA_DIAG_PUSH
  217|   708k|				WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL
  218|   708k|				const int rc = _snprintf(&format[index], formatlen - index, replace, arg);
  ------------------
  |  |  295|   708k|#define _snprintf snprintf
  ------------------
  219|   708k|				WINPR_PRAGMA_DIAG_POP
  220|   708k|				if (rc < 0)
  ------------------
  |  Branch (220:9): [True: 0, False: 708k]
  ------------------
  221|      0|					return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  222|   708k|				if (!check_and_log_format_size(format, formatlen, index,
  ------------------
  |  Branch (222:9): [True: 0, False: 708k]
  ------------------
  223|   708k|				                               WINPR_ASSERTING_INT_CAST(size_t, rc)))
  ------------------
  |  |  180|   708k|	__extension__({                                                                             \
  |  |  181|   708k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|   708k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   708k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   708k|	do                                                                                             \
  |  |  |  |  |  |   61|   708k|	{                                                                                              \
  |  |  |  |  |  |   62|   708k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   708k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   708k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   708k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   708k|                                                                                                   \
  |  |  |  |  |  |   70|   708k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   708k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   708k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   708k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   708k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   708k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   708k|                                                                                                   \
  |  |  |  |  |  |   72|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   708k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   708k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   708k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 708k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|   708k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|   708k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   708k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   708k|	do                                                                                             \
  |  |  |  |  |  |   61|   708k|	{                                                                                              \
  |  |  |  |  |  |   62|   708k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   708k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   708k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   708k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   708k|                                                                                                   \
  |  |  |  |  |  |   70|   708k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   708k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   708k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  2.12M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 708k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 708k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   708k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   708k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   708k|                                                                                                   \
  |  |  |  |  |  |   72|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   708k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   708k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   708k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 708k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|   708k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|   708k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|   708k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|   708k|	})
  ------------------
  224|      0|					return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  225|   708k|				index += WINPR_ASSERTING_INT_CAST(size_t, rc);
  ------------------
  |  |  180|   708k|	__extension__({                                                                             \
  |  |  181|   708k|		__typeof(ivar) var = ivar;                                                              \
  |  |  182|   708k|		WINPR_ASSERT((var) ==                                                                   \
  |  |  ------------------
  |  |  |  |   76|   708k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   708k|	do                                                                                             \
  |  |  |  |  |  |   61|   708k|	{                                                                                              \
  |  |  |  |  |  |   62|   708k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   708k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   708k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   708k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   708k|                                                                                                   \
  |  |  |  |  |  |   70|   708k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   708k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   708k|	{                                                       \
  |  |  |  |  |  |  |  |   33|   708k|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   708k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   708k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   708k|                                                                                                   \
  |  |  |  |  |  |   72|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   708k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   708k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   708k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 708k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|   708k|		             WINPR_CXX_COMPAT_CAST(__typeof(var), WINPR_CXX_COMPAT_CAST(type, (var)))); \
  |  |  184|   708k|		WINPR_ASSERT((((var) > 0) && (WINPR_CXX_COMPAT_CAST(type, (var)) > 0)) ||               \
  |  |  ------------------
  |  |  |  |   76|   708k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   708k|	do                                                                                             \
  |  |  |  |  |  |   61|   708k|	{                                                                                              \
  |  |  |  |  |  |   62|   708k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |  |  |   63|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |  |  |   64|   708k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |  |  |   65|   708k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |  |  |   66|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   67|   708k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |  |  |   68|   708k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |  |  |   69|   708k|                                                                                                   \
  |  |  |  |  |  |   70|   708k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   708k|	do                                                      \
  |  |  |  |  |  |  |  |   32|   708k|	{                                                       \
  |  |  |  |  |  |  |  |   33|  2.12M|		if (!(cond))                                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 708k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 708k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|   708k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |  |  |   35|   708k|	} while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 708k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   708k|                                                                                                   \
  |  |  |  |  |  |   72|   708k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |  |  |   73|   708k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |  |  |   74|   708k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |  |  |   75|   708k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:11): [Folded, False: 708k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  185|   708k|		             (((var) <= 0) && WINPR_CXX_COMPAT_CAST(type, (var)) <= 0));                \
  |  |  186|   708k|		WINPR_CXX_COMPAT_CAST(type, (var));                                                     \
  |  |  ------------------
  |  |  |  |   34|   708k|#define WINPR_CXX_COMPAT_CAST(t, val) ((t)(val))
  |  |  ------------------
  |  |  187|   708k|	})
  ------------------
  226|   708k|			}
  227|   787k|			FormatString += fmtlen;
  228|   787k|		}
  229|  1.65M|		else
  230|  1.65M|		{
  231|       |			/* Unknown format string */
  232|  1.65M|			if (*FormatString == '%')
  ------------------
  |  Branch (232:8): [True: 0, False: 1.65M]
  ------------------
  233|      0|				return log_invalid_fmt(FormatString);
  234|       |
  235|  1.65M|			if (!check_and_log_format_size(format, formatlen, index, 1))
  ------------------
  |  Branch (235:8): [True: 0, False: 1.65M]
  ------------------
  236|      0|				return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  237|  1.65M|			format[index++] = *FormatString++;
  238|  1.65M|		}
  239|  2.44M|	}
  240|       |
  241|  78.7k|	return check_and_log_format_size(format, formatlen, index, 0);
  242|  78.7k|}
Layout.c:opt_compare_fn:
  137|  9.68M|{
  138|  9.68M|	const char* what = a;
  139|  9.68M|	const struct format_option* opt = b;
  140|  9.68M|	if (!opt)
  ------------------
  |  Branch (140:6): [True: 0, False: 9.68M]
  ------------------
  141|      0|		return -1;
  142|  9.68M|	return strncmp(what, opt->fmt, opt->fmtlen);
  143|  9.68M|}
Layout.c:check_and_log_format_size:
  123|  2.44M|{
  124|       |	/* format string must be '\0' terminated, so abort at size - 1 */
  125|  2.44M|	if (index + add + 1 >= size)
  ------------------
  |  Branch (125:6): [True: 0, False: 2.44M]
  ------------------
  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.44M|	return TRUE;
  ------------------
  |  |  126|  2.44M|#define TRUE true
  ------------------
  134|  2.44M|}
Layout.c:WLog_PrintMessagePrefix:
   93|  78.7k|{
   94|  78.7k|	va_list args = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
   95|  78.7k|	va_start(args, format);
   96|  78.7k|	WLog_PrintMessagePrefixVA(prefix, prefixlen, format, args);
   97|       |	va_end(args);
   98|  78.7k|}
Layout.c:WLog_PrintMessagePrefixVA:
   86|  78.7k|{
   87|  78.7k|	(void)vsnprintf(prefix, prefixlen, format, args);
   88|  78.7k|}

WLog_PrintTextMessageVA:
  420|  78.7k|{
  421|  78.7k|	wLogMessage message = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
  422|  78.7k|	message.Type = WLOG_MESSAGE_TEXT;
  423|  78.7k|	message.Level = level;
  424|  78.7k|	message.LineNumber = line;
  425|  78.7k|	message.FileName = file;
  426|  78.7k|	message.FunctionName = function;
  427|       |
  428|  78.7k|	message.FormatString = fmt;
  429|       |
  430|  78.7k|	return WLog_PrintTextMessageInternal(log, &message, args);
  431|  78.7k|}
WLog_GetLogLevel:
  456|  82.5k|{
  457|  82.5k|	if (!log)
  ------------------
  |  Branch (457:6): [True: 0, False: 82.5k]
  ------------------
  458|      0|		return WLOG_OFF;
  459|       |
  460|  82.5k|	if (log->FilterLevel <= WLOG_FILTER_NOT_INITIALIZED)
  ------------------
  |  |   53|  82.5k|#define WLOG_FILTER_NOT_INITIALIZED (-2)
  ------------------
  |  Branch (460:6): [True: 0, False: 82.5k]
  ------------------
  461|      0|		log->FilterLevel = WLog_GetFilterLogLevel(log);
  462|       |
  463|  82.5k|	if (log->FilterLevel > WLOG_FILTER_NOT_FILTERED)
  ------------------
  |  |   52|  82.5k|#define WLOG_FILTER_NOT_FILTERED (-1)
  ------------------
  |  Branch (463:6): [True: 0, False: 82.5k]
  ------------------
  464|      0|		return (DWORD)log->FilterLevel;
  465|  82.5k|	else if (log->Level == WLOG_LEVEL_INHERIT)
  ------------------
  |  Branch (465:11): [True: 1, False: 82.5k]
  ------------------
  466|      1|		log->Level = WLog_GetLogLevel(log->Parent);
  467|       |
  468|  82.5k|	return log->Level;
  469|  82.5k|}
WLog_IsLevelActive:
  472|  82.5k|{
  473|  82.5k|	DWORD level = 0;
  474|       |
  475|  82.5k|	if (!_log)
  ------------------
  |  Branch (475:6): [True: 0, False: 82.5k]
  ------------------
  476|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  477|       |
  478|  82.5k|	level = WLog_GetLogLevel(_log);
  479|       |
  480|  82.5k|	if (level == WLOG_OFF)
  ------------------
  |  Branch (480:6): [True: 0, False: 82.5k]
  ------------------
  481|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  482|       |
  483|  82.5k|	return _log_level >= level;
  484|  82.5k|}
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|  78.7k|{
 1112|  78.7k|	return g_GlobalPrefix;
 1113|  78.7k|}
wlog.c:WLog_PrintTextMessageInternal:
  354|  78.7k|{
  355|  78.7k|	assert(cmessage);
  ------------------
  |  Branch (355:2): [True: 0, False: 78.7k]
  |  Branch (355:2): [True: 78.7k, False: 0]
  ------------------
  356|       |
  357|  78.7k|	char formattedLogMessage[WLOG_MAX_STRING_SIZE] = WINPR_C_ARRAY_INIT;
  ------------------
  |  |   85|  78.7k|	{                      \
  |  |   86|  78.7k|	} /** @since version 3.24.0 */
  ------------------
  358|  78.7k|	wLogMessage message = *cmessage;
  359|  78.7k|	message.TextString = formattedLogMessage;
  360|       |
  361|  78.7k|	WINPR_PRAGMA_DIAG_PUSH
  362|  78.7k|	WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL
  363|  78.7k|	if (vsnprintf(formattedLogMessage, ARRAYSIZE(formattedLogMessage) - 1, cmessage->FormatString,
  ------------------
  |  |  962|  78.7k|#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
  |  |  ------------------
  |  |  |  |  958|  78.7k|#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
  |  |  |  |  ------------------
  |  |  |  |  |  |  957|  78.7k|#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (363:6): [True: 0, False: 78.7k]
  ------------------
  364|  78.7k|	              args) < 0)
  365|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  366|  78.7k|	WINPR_PRAGMA_DIAG_POP
  367|       |
  368|  78.7k|	return WLog_Write(log, &message);
  369|  78.7k|}
wlog.c:WLog_Write:
  232|  78.7k|{
  233|  78.7k|	BOOL status = FALSE;
  ------------------
  |  |  122|  78.7k|#define FALSE false
  ------------------
  234|  78.7k|	wLogAppender* appender = WLog_GetLogAppender(log);
  235|       |
  236|  78.7k|	if (!appender)
  ------------------
  |  Branch (236:6): [True: 0, False: 78.7k]
  ------------------
  237|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  238|       |
  239|  78.7k|	if (!appender->active)
  ------------------
  |  Branch (239:6): [True: 1, False: 78.7k]
  ------------------
  240|      1|		if (!WLog_OpenAppender(log))
  ------------------
  |  Branch (240:7): [True: 0, False: 1]
  ------------------
  241|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  242|       |
  243|  78.7k|	EnterCriticalSection(&appender->lock);
  244|       |
  245|  78.7k|	if (appender->WriteMessage)
  ------------------
  |  Branch (245:6): [True: 78.7k, False: 0]
  ------------------
  246|  78.7k|	{
  247|  78.7k|		if (appender->recursive)
  ------------------
  |  Branch (247:7): [True: 0, False: 78.7k]
  ------------------
  248|      0|			status = log_recursion(message->FileName, message->FunctionName, message->LineNumber);
  249|  78.7k|		else
  250|  78.7k|		{
  251|  78.7k|			appender->recursive = TRUE;
  ------------------
  |  |  126|  78.7k|#define TRUE true
  ------------------
  252|  78.7k|			status = appender->WriteMessage(log, appender, message);
  253|  78.7k|			appender->recursive = FALSE;
  ------------------
  |  |  122|  78.7k|#define FALSE false
  ------------------
  254|  78.7k|		}
  255|  78.7k|	}
  256|       |
  257|  78.7k|	LeaveCriticalSection(&appender->lock);
  258|  78.7k|	return status;
  259|  78.7k|}
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);
  ------------------
  |  |  758|      1|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  120|      1|	WINPR_UNUSED(Parameter);
  ------------------
  |  |  758|      1|#define WINPR_UNUSED(x) (void)(x)
  ------------------
  121|      1|	WINPR_UNUSED(Context);
  ------------------
  |  |  758|      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|}

