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

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

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

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

_strdup:
  303|  4.73k|{
  304|  4.73k|	if (strSource == nullptr)
  ------------------
  |  Branch (304:6): [True: 0, False: 4.73k]
  ------------------
  305|      0|		return nullptr;
  306|       |
  307|  4.73k|	char* strDestination = strdup(strSource);
  308|       |
  309|  4.73k|	if (strDestination == nullptr)
  ------------------
  |  Branch (309:6): [True: 0, False: 4.73k]
  ------------------
  310|      0|		WLog_ERR(TAG, "strdup");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  311|       |
  312|  4.73k|	return strDestination;
  313|  4.73k|}
_wcsnlen:
  409|    419|{
  410|    419|	WINPR_ASSERT(str);
  ------------------
  |  |   76|    419|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    419|	do                                                                                             \
  |  |  |  |   61|    419|	{                                                                                              \
  |  |  |  |   62|    419|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    419|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    419|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    419|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    419|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    419|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    419|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    419|                                                                                                   \
  |  |  |  |   70|    419|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    419|	do                                                      \
  |  |  |  |  |  |   32|    419|	{                                                       \
  |  |  |  |  |  |   33|    419|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 419]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    419|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    419|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 419]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    419|                                                                                                   \
  |  |  |  |   72|    419|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    419|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    419|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    419|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  411|       |
  412|    419|	size_t x = 0;
  413|  1.55M|	for (; x < max; x++)
  ------------------
  |  Branch (413:9): [True: 1.55M, False: 308]
  ------------------
  414|  1.55M|	{
  415|  1.55M|		if (str[x] == 0)
  ------------------
  |  Branch (415:7): [True: 111, False: 1.55M]
  ------------------
  416|    111|			return x;
  417|  1.55M|	}
  418|       |
  419|    308|	return x;
  420|    419|}
strtok_s:
  489|   593k|{
  490|   593k|	return strtok_r(strToken, strDelimit, context);
  491|   593k|}
winpr_strnstr:
  935|   349k|{
  936|   349k|	WINPR_ASSERT(haystack || (hlen == 0));
  ------------------
  |  |   76|   349k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   349k|	do                                                                                             \
  |  |  |  |   61|   349k|	{                                                                                              \
  |  |  |  |   62|   349k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   349k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   349k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   349k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   349k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   349k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   349k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   349k|                                                                                                   \
  |  |  |  |   70|   349k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   349k|	do                                                      \
  |  |  |  |  |  |   32|   349k|	{                                                       \
  |  |  |  |  |  |   33|   349k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:9): [True: 349k, False: 0]
  |  |  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   349k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   349k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 349k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   349k|                                                                                                   \
  |  |  |  |   72|   349k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   349k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   349k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   349k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 349k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|   349k|	WINPR_ASSERT(needle);
  ------------------
  |  |   76|   349k|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|   349k|	do                                                                                             \
  |  |  |  |   61|   349k|	{                                                                                              \
  |  |  |  |   62|   349k|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|   349k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|   349k|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|   349k|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|   349k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|   349k|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|   349k|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|   349k|                                                                                                   \
  |  |  |  |   70|   349k|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   349k|	do                                                      \
  |  |  |  |  |  |   32|   349k|	{                                                       \
  |  |  |  |  |  |   33|   349k|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 349k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   349k|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|   349k|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 349k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   349k|                                                                                                   \
  |  |  |  |   72|   349k|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|   349k|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|   349k|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|   349k|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 349k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|   349k|	const size_t needle_len = strlen(needle);
  945|       |
  946|   349k|	if (0 == needle_len)
  ------------------
  |  Branch (946:6): [True: 0, False: 349k]
  ------------------
  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|  84.5M|	for (; (*haystack != '\0') && (hlen >= needle_len); haystack++, hlen--)
  ------------------
  |  Branch (949:9): [True: 84.4M, False: 17.6k]
  |  Branch (949:32): [True: 84.4M, False: 1.86k]
  ------------------
  950|  84.4M|	{
  951|  84.4M|		if ((haystack[0] == needle[0]) && (0 == strncmp(haystack, needle, needle_len)))
  ------------------
  |  Branch (951:7): [True: 2.61M, False: 81.8M]
  |  Branch (951:37): [True: 329k, False: 2.28M]
  ------------------
  952|   329k|			return WINPR_CAST_CONST_PTR_AWAY(haystack, char*);
  ------------------
  |  |  132|   329k|	__extension__({                             \
  |  |  133|   329k|		union                                   \
  |  |  134|   329k|		{                                       \
  |  |  135|   329k|			__typeof(ptr) src;                  \
  |  |  136|   329k|			dstType dst;                        \
  |  |  137|   329k|		} cnv;                                  \
  |  |  138|   329k|		cnv.src = ptr;                          \
  |  |  139|   329k|		cnv.dst;                                \
  |  |  140|   329k|	})
  ------------------
  953|  84.4M|	}
  954|  19.5k|	return nullptr;
  955|   349k|#endif
  956|   349k|}

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

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

winpr_RC4_New:
  146|    244|{
  147|    244|	return winpr_RC4_New_Internal(key, keylen, FALSE);
  ------------------
  |  |  122|    244|#define FALSE false
  ------------------
  148|    244|}
winpr_RC4_Update:
  151|    244|{
  152|    244|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    244|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    244|	do                                                                                             \
  |  |  |  |   61|    244|	{                                                                                              \
  |  |  |  |   62|    244|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    244|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    244|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    244|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    244|                                                                                                   \
  |  |  |  |   70|    244|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    244|	do                                                      \
  |  |  |  |  |  |   32|    244|	{                                                       \
  |  |  |  |  |  |   33|    244|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    244|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    244|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    244|                                                                                                   \
  |  |  |  |   72|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    244|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    244|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    244|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|       |
  154|       |#if defined(WITH_INTERNAL_RC4)
  155|       |	return winpr_int_rc4_update(ctx->ictx, length, input, output);
  156|       |#elif defined(WITH_OPENSSL)
  157|    244|	WINPR_ASSERT(ctx->ctx);
  ------------------
  |  |   76|    244|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    244|	do                                                                                             \
  |  |  |  |   61|    244|	{                                                                                              \
  |  |  |  |   62|    244|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    244|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    244|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    244|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    244|                                                                                                   \
  |  |  |  |   70|    244|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    244|	do                                                      \
  |  |  |  |  |  |   32|    244|	{                                                       \
  |  |  |  |  |  |   33|    244|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    244|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    244|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    244|                                                                                                   \
  |  |  |  |   72|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    244|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    244|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    244|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|    244|	int outputLength = 0;
  159|    244|	if (length > INT_MAX)
  ------------------
  |  Branch (159:6): [True: 0, False: 244]
  ------------------
  160|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  161|       |
  162|    244|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    244|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    244|	do                                                                                             \
  |  |  |  |   61|    244|	{                                                                                              \
  |  |  |  |   62|    244|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    244|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    244|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    244|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    244|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    244|                                                                                                   \
  |  |  |  |   70|    244|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    244|	do                                                      \
  |  |  |  |  |  |   32|    244|	{                                                       \
  |  |  |  |  |  |   33|    244|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    244|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    244|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    244|                                                                                                   \
  |  |  |  |   72|    244|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    244|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    244|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    244|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    244|	return EVP_CipherUpdate(ctx->ctx, output, &outputLength, input, (int)length) == 1;
  164|      0|#endif
  165|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  166|    244|}
winpr_RC4_Free:
  169|    322|{
  170|    322|	if (!ctx)
  ------------------
  |  Branch (170:6): [True: 78, False: 244]
  ------------------
  171|     78|		return;
  172|       |
  173|       |#if defined(WITH_INTERNAL_RC4)
  174|       |	winpr_int_rc4_free(ctx->ictx);
  175|       |#elif defined(WITH_OPENSSL)
  176|    244|	EVP_CIPHER_CTX_free(ctx->ctx);
  177|    244|#endif
  178|    244|	free(ctx);
  179|    244|}
winpr_Cipher_NewEx:
  593|    453|{
  594|    453|	if (cipher == WINPR_CIPHER_ARC4_128)
  ------------------
  |  Branch (594:6): [True: 0, False: 453]
  ------------------
  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|    453|	WINPR_CIPHER_CTX* ctx = calloc(1, sizeof(WINPR_CIPHER_CTX));
  602|    453|	if (!ctx)
  ------------------
  |  Branch (602:6): [True: 0, False: 453]
  ------------------
  603|      0|		return nullptr;
  604|       |
  605|    453|	ctx->cipher = cipher;
  606|    453|	ctx->op = op;
  607|       |
  608|    453|#if defined(WITH_OPENSSL)
  609|    453|	const EVP_CIPHER* evp = winpr_openssl_get_evp_cipher(cipher);
  610|    453|	if (!evp)
  ------------------
  |  Branch (610:6): [True: 0, False: 453]
  ------------------
  611|      0|		goto fail;
  612|       |
  613|    453|	ctx->ectx = EVP_CIPHER_CTX_new();
  614|    453|	if (!ctx->ectx)
  ------------------
  |  Branch (614:6): [True: 0, False: 453]
  ------------------
  615|      0|		goto fail;
  616|       |
  617|    453|	{
  618|    453|		const int operation = (op == WINPR_ENCRYPT) ? 1 : 0;
  ------------------
  |  Branch (618:25): [True: 0, False: 453]
  ------------------
  619|    453|		if (EVP_CipherInit_ex(ctx->ectx, evp, nullptr, key, iv, operation) != 1)
  ------------------
  |  Branch (619:7): [True: 0, False: 453]
  ------------------
  620|      0|			goto fail;
  621|    453|	}
  622|       |
  623|    453|	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 (iv != nullptr)
  648|       |	{
  649|       |		const size_t ivsize = mbedtls_cipher_get_iv_size(ctx->mctx);
  650|       |
  651|       |		if (ivsize > 0)
  652|       |		{
  653|       |			if (ivlen == 0) /* winpr_Cipher_New() passes ivlen = 0 */
  654|       |				ivlen = ivsize;
  655|       |
  656|       |			if (mbedtls_cipher_set_iv(ctx->mctx, iv, ivlen) != 0)
  657|       |				goto fail;
  658|       |		}
  659|       |	}
  660|       |
  661|       |	if (mbedtls_cipher_set_padding_mode(ctx->mctx, MBEDTLS_PADDING_NONE) != 0)
  662|       |		goto fail;
  663|       |
  664|       |#endif
  665|    453|	return ctx;
  666|       |
  667|      0|fail:
  668|      0|	winpr_Cipher_Free(ctx);
  669|      0|	return nullptr;
  670|    453|}
winpr_Cipher_Update:
  692|    453|{
  693|    453|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    453|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    453|	do                                                                                             \
  |  |  |  |   61|    453|	{                                                                                              \
  |  |  |  |   62|    453|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    453|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    453|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    453|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    453|                                                                                                   \
  |  |  |  |   70|    453|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    453|	do                                                      \
  |  |  |  |  |  |   32|    453|	{                                                       \
  |  |  |  |  |  |   33|    453|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    453|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    453|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    453|                                                                                                   \
  |  |  |  |   72|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    453|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    453|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    453|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 453]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  694|    453|	WINPR_ASSERT(olen);
  ------------------
  |  |   76|    453|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    453|	do                                                                                             \
  |  |  |  |   61|    453|	{                                                                                              \
  |  |  |  |   62|    453|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    453|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    453|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    453|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    453|                                                                                                   \
  |  |  |  |   70|    453|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    453|	do                                                      \
  |  |  |  |  |  |   32|    453|	{                                                       \
  |  |  |  |  |  |   33|    453|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    453|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    453|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    453|                                                                                                   \
  |  |  |  |   72|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    453|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    453|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    453|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 453]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|       |
  696|    453|#if defined(WITH_OPENSSL)
  697|    453|	int outl = (int)*olen;
  698|       |
  699|    453|	if (ilen > INT_MAX)
  ------------------
  |  Branch (699:6): [True: 0, False: 453]
  ------------------
  700|      0|	{
  701|      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__)
  ------------------
  702|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  703|      0|	}
  704|       |
  705|    453|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    453|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    453|	do                                                                                             \
  |  |  |  |   61|    453|	{                                                                                              \
  |  |  |  |   62|    453|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    453|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    453|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    453|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    453|                                                                                                   \
  |  |  |  |   70|    453|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    453|	do                                                      \
  |  |  |  |  |  |   32|    453|	{                                                       \
  |  |  |  |  |  |   33|    453|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    453|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    453|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    453|                                                                                                   \
  |  |  |  |   72|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    453|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    453|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    453|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 453]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  706|    453|	if (EVP_CipherUpdate(ctx->ectx, output, &outl, input, (int)ilen) == 1)
  ------------------
  |  Branch (706:6): [True: 453, False: 0]
  ------------------
  707|    453|	{
  708|    453|		*olen = (size_t)outl;
  709|    453|		return TRUE;
  ------------------
  |  |  126|    453|#define TRUE true
  ------------------
  710|    453|	}
  711|       |
  712|       |#elif defined(WITH_MBEDTLS)
  713|       |	WINPR_ASSERT(ctx->mctx);
  714|       |	if (mbedtls_cipher_update(ctx->mctx, input, ilen, output, olen) == 0)
  715|       |		return TRUE;
  716|       |
  717|       |#endif
  718|       |
  719|      0|	WLog_ERR(TAG, "Failed to update the data");
  ------------------
  |  |  348|      0|	WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  720|      0|	return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  721|    453|}
winpr_Cipher_Final:
  724|    453|{
  725|    453|	WINPR_ASSERT(ctx);
  ------------------
  |  |   76|    453|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    453|	do                                                                                             \
  |  |  |  |   61|    453|	{                                                                                              \
  |  |  |  |   62|    453|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    453|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    453|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    453|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    453|                                                                                                   \
  |  |  |  |   70|    453|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    453|	do                                                      \
  |  |  |  |  |  |   32|    453|	{                                                       \
  |  |  |  |  |  |   33|    453|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    453|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    453|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    453|                                                                                                   \
  |  |  |  |   72|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    453|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    453|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    453|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 453]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|       |
  727|    453|#if defined(WITH_OPENSSL)
  728|    453|	int outl = (int)*olen;
  729|       |
  730|    453|	WINPR_ASSERT(ctx->ectx);
  ------------------
  |  |   76|    453|#define WINPR_ASSERT(cond) WINPR_ASSERT_AT((cond), __FILE__, __func__, __LINE__)
  |  |  ------------------
  |  |  |  |   60|    453|	do                                                                                             \
  |  |  |  |   61|    453|	{                                                                                              \
  |  |  |  |   62|    453|		WINPR_PRAGMA_DIAG_PUSH                                                                     \
  |  |  |  |   63|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE                               \
  |  |  |  |   64|    453|		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE                                         \
  |  |  |  |   65|    453|		WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS                                                  \
  |  |  |  |   66|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   67|    453|		    coverity compliance block deviate 'CONSTANT_EXPRESSION_RESULT' 'WINPR_ASSERT')         \
  |  |  |  |   68|    453|		WINPR_DO_COVERITY_PRAGMA(coverity compliance block deviate : 2 'NO_EFFECT' 'WINPR_ASSERT') \
  |  |  |  |   69|    453|                                                                                                   \
  |  |  |  |   70|    453|		winpr_internal_assert((cond), (file), (fkt), (line));                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|    453|	do                                                      \
  |  |  |  |  |  |   32|    453|	{                                                       \
  |  |  |  |  |  |   33|    453|		if (!(cond))                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:7): [True: 0, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    453|			winpr_int_assert(#cond, (file), (fkt), (line)); \
  |  |  |  |  |  |   35|    453|	} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:11): [Folded, False: 453]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|    453|                                                                                                   \
  |  |  |  |   72|    453|		WINPR_DO_COVERITY_PRAGMA(                                                                  \
  |  |  |  |   73|    453|		    coverity compliance end_block 'CONSTANT_EXPRESSION_RESULT' 'NO_EFFECT')                \
  |  |  |  |   74|    453|		WINPR_PRAGMA_DIAG_POP                                                                      \
  |  |  |  |   75|    453|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:11): [Folded, False: 453]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|    453|	if (EVP_CipherFinal_ex(ctx->ectx, output, &outl) == 1)
  ------------------
  |  Branch (731:6): [True: 252, False: 201]
  ------------------
  732|    252|	{
  733|    252|		*olen = (size_t)outl;
  734|    252|		return TRUE;
  ------------------
  |  |  126|    252|#define TRUE true
  ------------------
  735|    252|	}
  736|       |
  737|       |#elif defined(WITH_MBEDTLS)
  738|       |
  739|       |	WINPR_ASSERT(ctx->mctx);
  740|       |	if (mbedtls_cipher_finish(ctx->mctx, output, olen) == 0)
  741|       |		return TRUE;
  742|       |
  743|       |#endif
  744|       |
  745|    201|	return FALSE;
  ------------------
  |  |  122|    201|#define FALSE false
  ------------------
  746|    453|}
winpr_Cipher_Free:
  749|    453|{
  750|    453|	if (!ctx)
  ------------------
  |  Branch (750:6): [True: 0, False: 453]
  ------------------
  751|      0|		return;
  752|       |
  753|    453|#if defined(WITH_OPENSSL)
  754|    453|	if (ctx->ectx)
  ------------------
  |  Branch (754:6): [True: 453, False: 0]
  ------------------
  755|    453|		EVP_CIPHER_CTX_free(ctx->ectx);
  756|       |#elif defined(WITH_MBEDTLS)
  757|       |	if (ctx->mctx)
  758|       |	{
  759|       |		mbedtls_cipher_free(ctx->mctx);
  760|       |		free(ctx->mctx);
  761|       |	}
  762|       |#endif
  763|       |
  764|    453|	free(ctx);
  765|    453|}
cipher.c:winpr_RC4_New_Internal:
   79|    244|{
   80|    244|	if (!key || (keylen == 0))
  ------------------
  |  Branch (80:6): [True: 0, False: 244]
  |  Branch (80:14): [True: 0, False: 244]
  ------------------
   81|      0|		return nullptr;
   82|       |
   83|    244|	WINPR_RC4_CTX* ctx = (WINPR_RC4_CTX*)calloc(1, sizeof(WINPR_RC4_CTX));
   84|    244|	if (!ctx)
  ------------------
  |  Branch (84:6): [True: 0, False: 244]
  ------------------
   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|    244|	if (keylen > INT_MAX)
  ------------------
  |  Branch (94:6): [True: 0, False: 244]
  ------------------
   95|      0|		goto fail;
   96|       |
   97|    244|	ctx->ctx = EVP_CIPHER_CTX_new();
   98|    244|	if (!ctx->ctx)
  ------------------
  |  Branch (98:6): [True: 0, False: 244]
  ------------------
   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|    244|	const EVP_CIPHER* evp = EVP_rc4();
  105|    244|#endif
  106|       |
  107|    244|	if (!evp)
  ------------------
  |  Branch (107:6): [True: 0, False: 244]
  ------------------
  108|      0|		goto fail;
  109|       |
  110|    244|	EVP_CIPHER_CTX_reset(ctx->ctx);
  111|    244|	if (EVP_EncryptInit_ex(ctx->ctx, evp, nullptr, nullptr, nullptr) != 1)
  ------------------
  |  Branch (111:6): [True: 0, False: 244]
  ------------------
  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|    244|	EVP_CIPHER_CTX_set_key_length(ctx->ctx, (int)keylen);
  126|    244|	if (EVP_EncryptInit_ex(ctx->ctx, nullptr, nullptr, key, nullptr) != 1)
  ------------------
  |  Branch (126:6): [True: 0, False: 244]
  ------------------
  127|      0|		goto fail;
  128|    244|#endif
  129|    244|	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|    244|}
cipher.c:winpr_openssl_get_evp_cipher:
  287|    453|{
  288|    453|	const EVP_CIPHER* evp = nullptr;
  289|       |
  290|    453|	switch (cipher)
  291|    453|	{
  292|      0|		case WINPR_CIPHER_NULL:
  ------------------
  |  Branch (292:3): [True: 0, False: 453]
  ------------------
  293|      0|			evp = EVP_enc_null();
  294|      0|			break;
  295|       |
  296|      0|		case WINPR_CIPHER_AES_128_ECB:
  ------------------
  |  Branch (296:3): [True: 0, False: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  305|      0|			evp = EVP_get_cipherbyname("aes-256-ecb");
  306|      0|			break;
  307|       |
  308|    453|		case WINPR_CIPHER_AES_128_CBC:
  ------------------
  |  Branch (308:3): [True: 453, False: 0]
  ------------------
  309|    453|			evp = EVP_get_cipherbyname("aes-128-cbc");
  310|    453|			break;
  311|       |
  312|      0|		case WINPR_CIPHER_AES_192_CBC:
  ------------------
  |  Branch (312:3): [True: 0, False: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  465|      0|			evp = EVP_get_cipherbyname("rc4");
  466|      0|			break;
  467|       |
  468|      0|		case WINPR_CIPHER_BLOWFISH_ECB:
  ------------------
  |  Branch (468:3): [True: 0, False: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  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: 453]
  ------------------
  481|      0|			evp = EVP_get_cipherbyname("blowfish-ctr");
  482|      0|			break;
  483|      0|		default:
  ------------------
  |  Branch (483:3): [True: 0, False: 453]
  ------------------
  484|      0|			break;
  485|    453|	}
  486|       |
  487|    453|	return evp;
  488|    453|}

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

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

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

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

GetCurrentProcessId:
  686|  97.8k|{
  687|  97.8k|	return ((DWORD)getpid());
  688|  97.8k|}

GetCurrentThreadId:
  910|  97.8k|{
  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|  97.8k|	return WINPR_CXX_COMPAT_CAST(DWORD, syscall(SYS_gettid));
  ------------------
  |  |   34|  97.8k|#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|       |#if UINTPTR_MAX > UINT32_MAX
  923|       |	return (ptid & UINT32_MAX) ^ (ptid >> 32);
  924|       |#else
  925|       |	/* A 32-bit pthread_t already fits. Shifting it by 32 is undefined behaviour and
  926|       |	 * WebAssembly masks the shift count to 0, so the expression above returned
  927|       |	 * ptid ^ ptid == 0 for every thread, and critical sections took any thread for
  928|       |	 * the owner. */
  929|       |	return WINPR_CXX_COMPAT_CAST(DWORD, ptid);
  930|       |#endif
  931|       |#endif
  932|  97.8k|}

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

winpr_HexStringToBinBuffer:
  188|    453|{
  189|    453|	size_t y = 0;
  190|    453|	size_t maxStrLen = 0;
  191|    453|	if (!str || !data || (strLength == 0) || (dataLength == 0))
  ------------------
  |  Branch (191:6): [True: 0, False: 453]
  |  Branch (191:14): [True: 0, False: 453]
  |  Branch (191:23): [True: 1, False: 452]
  |  Branch (191:43): [True: 0, False: 452]
  ------------------
  192|      1|		return 0;
  193|       |
  194|    452|	maxStrLen = strnlen(str, strLength);
  195|  5.87M|	for (size_t x = 0; x < maxStrLen;)
  ------------------
  |  Branch (195:21): [True: 5.86M, False: 451]
  ------------------
  196|  5.86M|	{
  197|  5.86M|		BYTE val = value(str[x++]);
  198|  5.86M|		if (x < maxStrLen)
  ------------------
  |  Branch (198:7): [True: 5.86M, False: 332]
  ------------------
  199|  5.86M|			val = (BYTE)(val << 4) | (value(str[x++]));
  200|  5.86M|		if (x < maxStrLen)
  ------------------
  |  Branch (200:7): [True: 5.86M, False: 452]
  ------------------
  201|  5.86M|		{
  202|  5.86M|			if (str[x] == ' ')
  ------------------
  |  Branch (202:8): [True: 7.44k, False: 5.86M]
  ------------------
  203|  7.44k|				x++;
  204|  5.86M|		}
  205|  5.86M|		data[y++] = val;
  206|  5.86M|		if (y >= dataLength)
  ------------------
  |  Branch (206:7): [True: 1, False: 5.86M]
  ------------------
  207|      1|			return y;
  208|  5.86M|	}
  209|    451|	return y;
  210|    452|}
print.c:value:
  177|  11.7M|{
  178|  11.7M|	if ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (178:6): [True: 10.4M, False: 1.29M]
  |  Branch (178:20): [True: 4.06M, False: 6.37M]
  ------------------
  179|  4.06M|		return (c - '0') & 0xFF;
  180|  7.67M|	if ((c >= 'A') && (c <= 'F'))
  ------------------
  |  Branch (180:6): [True: 844k, False: 6.82M]
  |  Branch (180:20): [True: 113k, False: 730k]
  ------------------
  181|   113k|		return (10 + c - 'A') & 0xFF;
  182|  7.55M|	if ((c >= 'a') && (c <= 'f'))
  ------------------
  |  Branch (182:6): [True: 337k, False: 7.22M]
  |  Branch (182:20): [True: 270k, False: 66.2k]
  ------------------
  183|   270k|		return (10 + c - 'a') & 0xFF;
  184|  7.28M|	return 0;
  185|  7.55M|}

winpr_InitializeSSL:
  353|  2.20k|{
  354|  2.20k|	static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
  ------------------
  |  |  402|  2.20k|#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
  |  |  ------------------
  |  |  |  |  377|  2.20k|	{                     \
  |  |  |  |  378|  2.20k|		0                 \
  |  |  |  |  379|  2.20k|	}
  |  |  ------------------
  ------------------
  355|       |
  356|  2.20k|	if (!InitOnceExecuteOnce(&once, winpr_openssl_initialize, &flags, nullptr))
  ------------------
  |  |  424|  2.20k|#define InitOnceExecuteOnce winpr_InitOnceExecuteOnce
  ------------------
  |  Branch (356:6): [True: 0, False: 2.20k]
  ------------------
  357|      0|		return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  358|       |
  359|  2.20k|	return winpr_enable_fips(flags);
  360|  2.20k|}
winpr_CleanupSSL:
  381|      1|{
  382|      1|	if (flags & WINPR_SSL_CLEANUP_GLOBAL)
  ------------------
  |  |   32|      1|#define WINPR_SSL_CLEANUP_GLOBAL 0x01
  ------------------
  |  Branch (382:6): [True: 0, False: 1]
  ------------------
  383|      0|	{
  384|      0|		if (!g_winpr_openssl_initialized_by_winpr)
  ------------------
  |  Branch (384:7): [True: 0, False: 0]
  ------------------
  385|      0|		{
  386|      0|			WLog_WARN(TAG, "ssl was not initialized by winpr");
  ------------------
  |  |  346|      0|	WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
  ------------------
  387|      0|			return FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  388|      0|		}
  389|       |
  390|      0|		g_winpr_openssl_initialized_by_winpr = FALSE;
  ------------------
  |  |  122|      0|#define FALSE false
  ------------------
  391|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  392|       |		_winpr_openssl_cleanup_locking();
  393|       |#endif
  394|       |#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
  395|       |		CRYPTO_cleanup_all_ex_data();
  396|       |		ERR_free_strings();
  397|       |		EVP_cleanup();
  398|       |#endif
  399|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  400|       |		flags |= WINPR_SSL_CLEANUP_THREAD;
  401|       |#endif
  402|      0|	}
  403|       |
  404|       |#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
  405|       |
  406|       |	if (flags & WINPR_SSL_CLEANUP_THREAD)
  407|       |	{
  408|       |#if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER)
  409|       |		ERR_remove_state(0);
  410|       |#else
  411|       |		ERR_remove_thread_state(nullptr);
  412|       |#endif
  413|       |	}
  414|       |
  415|       |#endif
  416|       |#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  417|       |	OSSL_LIB_CTX* ctx = OSSL_LIB_CTX_get0_global_default();
  418|       |	if (ctx)
  419|       |		OSSL_PROVIDER_do_all(ctx, unload, nullptr);
  420|       |#endif
  421|       |
  422|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  423|      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 has MD4 and RC4, which are needed unless WinPR uses
  330|       |	 * its own implementations of both (WITH_INTERNAL_MD4, WITH_INTERNAL_RC4). */
  331|       |	s_winpr_openssl_provider_legacy = OSSL_PROVIDER_load(nullptr, "legacy");
  332|       |#if !defined(WITH_INTERNAL_MD4) || !defined(WITH_INTERNAL_RC4)
  333|       |	if (s_winpr_openssl_provider_legacy == nullptr)
  334|       |	{
  335|       |		WLog_WARN(TAG, "OpenSSL LEGACY provider failed to load, no md4/rc4 support available!");
  336|       |	}
  337|       |#endif
  338|       |	s_winpr_openssl_provider_default = OSSL_PROVIDER_load(nullptr, "default");
  339|       |	if (s_winpr_openssl_provider_default == nullptr)
  340|       |	{
  341|       |		WLog_WARN(TAG, "OpenSSL DEFAULT provider failed to load");
  342|       |	}
  343|       |#endif
  344|       |
  345|      1|	(void)winpr_atexit(winpr_openssl_cleanup);
  346|      1|	g_winpr_openssl_initialized_by_winpr = TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  347|      1|	return TRUE;
  ------------------
  |  |  126|      1|#define TRUE true
  ------------------
  348|      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.20k|{
  247|  2.20k|	if (flags & WINPR_SSL_INIT_ENABLE_FIPS)
  ------------------
  |  |   30|  2.20k|#define WINPR_SSL_INIT_ENABLE_FIPS 0x4
  ------------------
  |  Branch (247:6): [True: 0, False: 2.20k]
  ------------------
  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.20k|	return TRUE;
  ------------------
  |  |  126|  2.20k|#define TRUE true
  ------------------
  283|  2.20k|}

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

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

