aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/dictutil.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2025-11-01 21:52:31 -0700
committerRob Mensching <rob@firegiant.com>2025-11-03 14:49:39 -0800
commitd2ba0da55725f2908b67e1470afc7cfd71cb3d1f (patch)
treec2a1db61c5fac031c698976106bba2c453d85ded /src/libs/dutil/WixToolset.DUtil/dictutil.cpp
parent4d626c294c4783d454e27ea4e5614037dac8576e (diff)
downloadwix-d2ba0da55725f2908b67e1470afc7cfd71cb3d1f.tar.gz
wix-d2ba0da55725f2908b67e1470afc7cfd71cb3d1f.tar.bz2
wix-d2ba0da55725f2908b67e1470afc7cfd71cb3d1f.zip
Use CompareStringOrdinal() instead of CompareString() case-sensitive
This commit moves to the modern CompareStringOrdinal() for all case-sensitve uses of CompareString() with the invariant locale. Resolves 6947
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/dictutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/dictutil.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/dictutil.cpp b/src/libs/dutil/WixToolset.DUtil/dictutil.cpp
index 09b150df..247b7b43 100644
--- a/src/libs/dutil/WixToolset.DUtil/dictutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/dictutil.cpp
@@ -499,14 +499,9 @@ static BOOL IsMatchExact(
499 ) 499 )
500{ 500{
501 LPCWSTR wzMatchString = GetKey(psd, TranslateOffsetToValue(psd, psd->ppvBuckets[dwMatchIndex])); 501 LPCWSTR wzMatchString = GetKey(psd, TranslateOffsetToValue(psd, psd->ppvBuckets[dwMatchIndex]));
502 DWORD dwFlags = 0; 502 BOOL fIgnoreCase = (DICT_FLAG_CASEINSENSITIVE & psd->dfFlags) ? TRUE : FALSE;
503 503
504 if (DICT_FLAG_CASEINSENSITIVE & psd->dfFlags) 504 if (CSTR_EQUAL == ::CompareStringOrdinal(wzOriginalString, -1, wzMatchString, -1, fIgnoreCase))
505 {
506 dwFlags |= NORM_IGNORECASE;
507 }
508
509 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, dwFlags, wzOriginalString, -1, wzMatchString, -1))
510 { 505 {
511 return TRUE; 506 return TRUE;
512 } 507 }
@@ -605,7 +600,7 @@ static HRESULT GetInsertIndex(
605 // If we wrapped all the way back around to our original index, the dict is full - throw an error 600 // If we wrapped all the way back around to our original index, the dict is full - throw an error
606 if (dwIndexCandidate == dwOriginalIndexCandidate) 601 if (dwIndexCandidate == dwOriginalIndexCandidate)
607 { 602 {
608 // The dict table is full - this error seems to be a reasonably close match 603 // The dict table is full - this error seems to be a reasonably close match
609 hr = HRESULT_FROM_WIN32(ERROR_DATABASE_FULL); 604 hr = HRESULT_FROM_WIN32(ERROR_DATABASE_FULL);
610 DictExitOnRootFailure(hr, "Failed to add item '%ls' to dict table because dict table is full of items", pszString); 605 DictExitOnRootFailure(hr, "Failed to add item '%ls' to dict table because dict table is full of items", pszString);
611 } 606 }