From 4d626c294c4783d454e27ea4e5614037dac8576e Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 1 Nov 2025 20:24:25 -0700 Subject: Use CompareStringOrdinal() instead of CompareString() case-insensitive This commit moves to the modern CompareStringOrdinal() for all case-insensitve uses of CompareString() with the invariant locale. Partially resolves 6947 --- src/libs/dutil/WixToolset.DUtil/apuputil.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libs/dutil/WixToolset.DUtil/apuputil.cpp') diff --git a/src/libs/dutil/WixToolset.DUtil/apuputil.cpp b/src/libs/dutil/WixToolset.DUtil/apuputil.cpp index eb96d515..62cf4d06 100644 --- a/src/libs/dutil/WixToolset.DUtil/apuputil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/apuputil.cpp @@ -112,7 +112,7 @@ extern "C" HRESULT DAPI ApupAllocChainFromAtom( } // Trim the unused entries from the end, if any of the entries failed to parse or validate - if (pChain->cEntries != pFeed->cEntries) + if (pChain->cEntries != pFeed->cEntries) { if (pChain->cEntries > 0) { @@ -354,22 +354,22 @@ static HRESULT ParseEnclosure( dwDigestLength = 0; if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, L"algorithm", -1, pAttribute->wzAttribute, -1)) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, L"md5", -1, pAttribute->wzValue, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(L"md5", -1, pAttribute->wzValue, -1, TRUE)) { pEnclosure->digestAlgorithm = APUP_HASH_ALGORITHM_MD5; dwDigestLength = MD5_HASH_LEN; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, L"sha1", -1, pAttribute->wzValue, -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(L"sha1", -1, pAttribute->wzValue, -1, TRUE)) { pEnclosure->digestAlgorithm = APUP_HASH_ALGORITHM_SHA1; dwDigestLength = SHA1_HASH_LEN; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, L"sha256", -1, pAttribute->wzValue, -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(L"sha256", -1, pAttribute->wzValue, -1, TRUE)) { pEnclosure->digestAlgorithm = APUP_HASH_ALGORITHM_SHA256; dwDigestLength = SHA256_HASH_LEN; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, L"sha512", -1, pAttribute->wzValue, -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(L"sha512", -1, pAttribute->wzValue, -1, TRUE)) { pEnclosure->digestAlgorithm = APUP_HASH_ALGORITHM_SHA512; dwDigestLength = SHA512_HASH_LEN; -- cgit v1.2.3-55-g6feb