aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/iniutil.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/iniutil.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/iniutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/iniutil.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/iniutil.cpp b/src/libs/dutil/WixToolset.DUtil/iniutil.cpp
index 46f6e380..12af6fb2 100644
--- a/src/libs/dutil/WixToolset.DUtil/iniutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/iniutil.cpp
@@ -441,7 +441,7 @@ extern "C" HRESULT DAPI IniGetValue(
441 441
442 for (DWORD i = 0; i < pi->cValues; ++i) 442 for (DWORD i = 0; i < pi->cValues; ++i)
443 { 443 {
444 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pi->rgivValues[i].wzName, -1, wzValueName, -1)) 444 if (CSTR_EQUAL == ::CompareStringOrdinal(pi->rgivValues[i].wzName, -1, wzValueName, -1, FALSE))
445 { 445 {
446 pValue = pi->rgivValues + i; 446 pValue = pi->rgivValues + i;
447 break; 447 break;
@@ -483,7 +483,7 @@ extern "C" HRESULT DAPI IniSetValue(
483 483
484 for (DWORD i = 0; i < pi->cValues; ++i) 484 for (DWORD i = 0; i < pi->cValues; ++i)
485 { 485 {
486 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pi->rgivValues[i].wzName, -1, wzValueName, -1)) 486 if (CSTR_EQUAL == ::CompareStringOrdinal(pi->rgivValues[i].wzName, -1, wzValueName, -1, FALSE))
487 { 487 {
488 pValue = pi->rgivValues + i; 488 pValue = pi->rgivValues + i;
489 break; 489 break;
@@ -507,7 +507,7 @@ extern "C" HRESULT DAPI IniSetValue(
507 { 507 {
508 if (pValue) 508 if (pValue)
509 { 509 {
510 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, pValue->wzValue, -1, wzValue, -1)) 510 if (CSTR_EQUAL != ::CompareStringOrdinal(pValue->wzValue, -1, wzValue, -1, FALSE))
511 { 511 {
512 pi->fModified = TRUE; 512 pi->fModified = TRUE;
513 hr = StrAllocString(const_cast<LPWSTR *>(&pValue->wzValue), wzValue, 0); 513 hr = StrAllocString(const_cast<LPWSTR *>(&pValue->wzValue), wzValue, 0);
@@ -660,7 +660,7 @@ extern "C" HRESULT DAPI IniWriteFile(
660 IniExitOnFailure(hr, "Failed to get section prefix from name: %ls", pi->rgivValues[i].wzName); 660 IniExitOnFailure(hr, "Failed to get section prefix from name: %ls", pi->rgivValues[i].wzName);
661 661
662 // If the new section prefix is different, write a section out for it 662 // If the new section prefix is different, write a section out for it
663 if (fSections && sczNewSectionPrefix && (NULL == sczCurrentSectionPrefix || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, sczNewSectionPrefix, -1, sczCurrentSectionPrefix, -1))) 663 if (fSections && sczNewSectionPrefix && (NULL == sczCurrentSectionPrefix || CSTR_EQUAL != ::CompareStringOrdinal(sczNewSectionPrefix, -1, sczCurrentSectionPrefix, -1, FALSE)))
664 { 664 {
665 hr = StrAllocConcat(&sczContents, pi->sczOpenTagPrefix, 0); 665 hr = StrAllocConcat(&sczContents, pi->sczOpenTagPrefix, 0);
666 IniExitOnFailure(hr, "Failed to concat open tag prefix to string"); 666 IniExitOnFailure(hr, "Failed to concat open tag prefix to string");
@@ -674,7 +674,7 @@ extern "C" HRESULT DAPI IniWriteFile(
674 674
675 hr = StrAllocConcat(&sczContents, L"\r\n", 2); 675 hr = StrAllocConcat(&sczContents, L"\r\n", 2);
676 IniExitOnFailure(hr, "Failed to add endline to ini output buffer in-memory"); 676 IniExitOnFailure(hr, "Failed to add endline to ini output buffer in-memory");
677 677
678 ReleaseNullStr(sczCurrentSectionPrefix); 678 ReleaseNullStr(sczCurrentSectionPrefix);
679 sczCurrentSectionPrefix = sczNewSectionPrefix; 679 sczCurrentSectionPrefix = sczNewSectionPrefix;
680 sczNewSectionPrefix = NULL; 680 sczNewSectionPrefix = NULL;