Commit c77defed authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wintrust: Use the ARRAY_SIZE() macro.

parent 6c6af641
...@@ -673,8 +673,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAlgorithmIdWithNullParams( ...@@ -673,8 +673,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAlgorithmIdWithNullParams(
items[1].pvStructInfo = &algo->Parameters; items[1].pvStructInfo = &algo->Parameters;
else else
items[1].pvStructInfo = &nullBlob; items[1].pvStructInfo = &nullBlob;
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
return ret; return ret;
} }
...@@ -688,8 +688,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAttributeTypeValue(DWORD dwCertEncodingType, ...@@ -688,8 +688,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAttributeTypeValue(DWORD dwCertEncodingType,
{ &typeValue->Value, CRYPT_CopyEncodedBlob, 0 }, { &typeValue->Value, CRYPT_CopyEncodedBlob, 0 },
}; };
return CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, return CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
struct SPCDigest struct SPCDigest
...@@ -708,8 +708,8 @@ static BOOL WINAPI CRYPT_AsnEncodeSPCDigest(DWORD dwCertEncodingType, ...@@ -708,8 +708,8 @@ static BOOL WINAPI CRYPT_AsnEncodeSPCDigest(DWORD dwCertEncodingType,
{ &digest->Digest, CRYPT_CopyEncodedBlob, 0 }, { &digest->Digest, CRYPT_CopyEncodedBlob, 0 },
}; };
return CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, return CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType, BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType,
...@@ -729,8 +729,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType, ...@@ -729,8 +729,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType,
{ &data->DigestAlgorithm, CRYPT_AsnEncodeSPCDigest, 0 }, { &data->DigestAlgorithm, CRYPT_AsnEncodeSPCDigest, 0 },
}; };
ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -996,8 +996,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoEncode(DWORD dwCertEncodingType, ...@@ -996,8 +996,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoEncode(DWORD dwCertEncodingType,
{ &info->dwCertVersion, CRYPT_AsnEncodeInt, 0 }, { &info->dwCertVersion, CRYPT_AsnEncodeInt, 0 },
}; };
ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -1025,8 +1025,8 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType, ...@@ -1025,8 +1025,8 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
{ &value->Value, CRYPT_AsnEncodeOctets, 0 }, { &value->Value, CRYPT_AsnEncodeOctets, 0 },
}; };
ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -1084,8 +1084,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoEncode(DWORD dwCertEncodingType, ...@@ -1084,8 +1084,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoEncode(DWORD dwCertEncodingType,
{ &criteria->fMeetsCriteria, CRYPT_AsnEncodeBool, 0 }, { &criteria->fMeetsCriteria, CRYPT_AsnEncodeBool, 0 },
}; };
ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, ARRAY_SIZE(items),
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); pbEncoded, pcbEncoded);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -1808,9 +1808,8 @@ BOOL WINAPI WVTAsn1SpcPeImageDataDecode(DWORD dwCertEncodingType, ...@@ -1808,9 +1808,8 @@ BOOL WINAPI WVTAsn1SpcPeImageDataDecode(DWORD dwCertEncodingType,
offsetof(SPC_PE_IMAGE_DATA, pFile), 0 }, offsetof(SPC_PE_IMAGE_DATA, pFile), 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -1995,9 +1994,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAttributeTypeValue(DWORD dwCertEncodingType, ...@@ -1995,9 +1994,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAttributeTypeValue(DWORD dwCertEncodingType,
TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags,
pvStructInfo, *pcbStructInfo); pvStructInfo, *pcbStructInfo);
return CRYPT_AsnDecodeSequence(dwCertEncodingType, items, return CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo,
pvStructInfo, pcbStructInfo,
typeValue ? typeValue->pszObjId : NULL); typeValue ? typeValue->pszObjId : NULL);
} }
...@@ -2019,9 +2017,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType, ...@@ -2019,9 +2017,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType,
TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags,
pvStructInfo, *pcbStructInfo); pvStructInfo, *pcbStructInfo);
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, algo ? algo->pszObjId : NULL);
pvStructInfo, pcbStructInfo, algo ? algo->pszObjId : NULL);
if (ret && pvStructInfo) if (ret && pvStructInfo)
{ {
TRACE("pszObjId is %p (%s)\n", algo->pszObjId, TRACE("pszObjId is %p (%s)\n", algo->pszObjId,
...@@ -2048,9 +2045,8 @@ static BOOL WINAPI CRYPT_AsnDecodeSPCDigest(DWORD dwCertEncodingType, ...@@ -2048,9 +2045,8 @@ static BOOL WINAPI CRYPT_AsnDecodeSPCDigest(DWORD dwCertEncodingType,
TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags,
pvStructInfo, *pcbStructInfo); pvStructInfo, *pcbStructInfo);
return CRYPT_AsnDecodeSequence(dwCertEncodingType, items, return CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo,
pvStructInfo, pcbStructInfo,
digest ? digest->DigestAlgorithm.pszObjId : NULL); digest ? digest->DigestAlgorithm.pszObjId : NULL);
} }
...@@ -2076,9 +2072,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentDecode(DWORD dwCertEncodingType, ...@@ -2076,9 +2072,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentDecode(DWORD dwCertEncodingType,
offsetof(SPC_INDIRECT_DATA_CONTENT, DigestAlgorithm.pszObjId), 0 }, offsetof(SPC_INDIRECT_DATA_CONTENT, DigestAlgorithm.pszObjId), 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -2174,9 +2169,8 @@ BOOL WINAPI WVTAsn1SpcSpOpusInfoDecode(DWORD dwCertEncodingType, ...@@ -2174,9 +2169,8 @@ BOOL WINAPI WVTAsn1SpcSpOpusInfoDecode(DWORD dwCertEncodingType,
offsetof(SPC_SP_OPUS_INFO, pPublisherInfo), 0 }, offsetof(SPC_SP_OPUS_INFO, pPublisherInfo), 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -2256,9 +2250,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoDecode(DWORD dwCertEncodingType, ...@@ -2256,9 +2250,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoDecode(DWORD dwCertEncodingType,
FALSE, FALSE, 0, 0 }, FALSE, FALSE, 0, 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -2292,9 +2285,8 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType, ...@@ -2292,9 +2285,8 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType,
offsetof(CAT_NAMEVALUE, Value.pbData), 0 }, offsetof(CAT_NAMEVALUE, Value.pbData), 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -2367,9 +2359,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoDecode(DWORD dwCertEncodingType, ...@@ -2367,9 +2359,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoDecode(DWORD dwCertEncodingType,
fMeetsCriteria), FALSE, FALSE, 0, 0 }, fMeetsCriteria), FALSE, FALSE, 0, 0 },
}; };
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, ARRAY_SIZE(items),
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, NULL);
pvStructInfo, pcbStructInfo, NULL);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
......
...@@ -522,11 +522,9 @@ static LPCSTR filetime_to_str(const FILETIME *time) ...@@ -522,11 +522,9 @@ static LPCSTR filetime_to_str(const FILETIME *time)
if (!time) return NULL; if (!time) return NULL;
GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, dateFmt, GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, dateFmt, ARRAY_SIZE(dateFmt));
sizeof(dateFmt) / sizeof(dateFmt[0]));
FileTimeToSystemTime(time, &sysTime); FileTimeToSystemTime(time, &sysTime);
GetDateFormatA(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, GetDateFormatA(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, ARRAY_SIZE(date));
sizeof(date) / sizeof(date[0]));
return date; return date;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment