aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Iis
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2025-11-01 20:24:25 -0700
committerRob Mensching <rob@firegiant.com>2025-11-03 14:49:39 -0800
commit4d626c294c4783d454e27ea4e5614037dac8576e (patch)
tree51d822f48716e4c5ef2a51ca28925896f221b521 /src/ext/Iis
parent33c12fa386aa7ace7a6bd06a45bc3ecf17e9c8f5 (diff)
downloadwix-4d626c294c4783d454e27ea4e5614037dac8576e.tar.gz
wix-4d626c294c4783d454e27ea4e5614037dac8576e.tar.bz2
wix-4d626c294c4783d454e27ea4e5614037dac8576e.zip
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
Diffstat (limited to 'src/ext/Iis')
-rw-r--r--src/ext/Iis/ca/scaapppool.cpp18
-rw-r--r--src/ext/Iis/ca/scaexecIIS7.cpp18
-rw-r--r--src/ext/Iis/ca/scawebappext.cpp2
3 files changed, 19 insertions, 19 deletions
diff --git a/src/ext/Iis/ca/scaapppool.cpp b/src/ext/Iis/ca/scaapppool.cpp
index 781c55ca..951f2d4b 100644
--- a/src/ext/Iis/ca/scaapppool.cpp
+++ b/src/ext/Iis/ca/scaapppool.cpp
@@ -80,7 +80,7 @@ HRESULT ScaAppPoolRead(
80 WcaLog(LOGMSG_VERBOSE, "Skipping ScaAppPoolRead() - required table not present"); 80 WcaLog(LOGMSG_VERBOSE, "Skipping ScaAppPoolRead() - required table not present");
81 ExitFunction1(hr = S_FALSE); 81 ExitFunction1(hr = S_FALSE);
82 } 82 }
83 83
84 hr = WcaBeginUnwrapQuery(&hComponentQuery, ppwzCustomActionData); 84 hr = WcaBeginUnwrapQuery(&hComponentQuery, ppwzCustomActionData);
85 ExitOnFailure(hr, "Failed to unwrap query for ScaAppPoolRead"); 85 ExitOnFailure(hr, "Failed to unwrap query for ScaAppPoolRead");
86 86
@@ -478,17 +478,17 @@ HRESULT ScaWriteAppPool(
478 } 478 }
479 else if (psap->iAttributes & APATTR_OTHERUSER) 479 else if (psap->iAttributes & APATTR_OTHERUSER)
480 { 480 {
481 if (!*psap->suUser.wzDomain || CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzDomain, -1, L".", -1)) 481 if (!*psap->suUser.wzDomain || CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzDomain, -1, L".", -1, TRUE))
482 { 482 {
483 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"NetworkService", -1)) 483 if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"NetworkService", -1, TRUE))
484 { 484 {
485 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE; 485 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE;
486 } 486 }
487 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"LocalService", -1)) 487 else if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"LocalService", -1, TRUE))
488 { 488 {
489 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE; 489 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE;
490 } 490 }
491 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"LocalSystem", -1)) 491 else if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"LocalSystem", -1, TRUE))
492 { 492 {
493 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM; 493 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM;
494 } 494 }
@@ -497,17 +497,17 @@ HRESULT ScaWriteAppPool(
497 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER; 497 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER;
498 } 498 }
499 } 499 }
500 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzDomain, -1, L"NT AUTHORITY", -1)) 500 else if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzDomain, -1, L"NT AUTHORITY", -1, TRUE))
501 { 501 {
502 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"NETWORK SERVICE", -1)) 502 if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"NETWORK SERVICE", -1, TRUE))
503 { 503 {
504 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE; 504 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_NETWORKSERVICE;
505 } 505 }
506 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"SERVICE", -1)) 506 else if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"SERVICE", -1, TRUE))
507 { 507 {
508 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE; 508 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSERVICE;
509 } 509 }
510 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, psap->suUser.wzName, -1, L"SYSTEM", -1)) 510 else if (CSTR_EQUAL == ::CompareStringOrdinal(psap->suUser.wzName, -1, L"SYSTEM", -1, TRUE))
511 { 511 {
512 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM; 512 dwIdentity = MD_APPPOOL_IDENTITY_TYPE_LOCALSYSTEM;
513 } 513 }
diff --git a/src/ext/Iis/ca/scaexecIIS7.cpp b/src/ext/Iis/ca/scaexecIIS7.cpp
index 108007a1..52378d34 100644
--- a/src/ext/Iis/ca/scaexecIIS7.cpp
+++ b/src/ext/Iis/ca/scaexecIIS7.cpp
@@ -566,7 +566,7 @@ HRESULT IIS7AspProperty(
566 // 566 //
567 //Do not append trailing '/' for default vDir 567 //Do not append trailing '/' for default vDir
568 // 568 //
569 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzPathName, -1, L"/", -1)) 569 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzPathName, -1, L"/", -1, TRUE))
570 { 570 {
571 hr = StrAllocConcat(&pwzLocationPath, L"/", 0); 571 hr = StrAllocConcat(&pwzLocationPath, L"/", 0);
572 ExitOnFailure(hr, "failed to copy location WebDir '/'"); 572 ExitOnFailure(hr, "failed to copy location WebDir '/'");
@@ -742,7 +742,7 @@ HRESULT IIS7WebDir(
742 // 742 //
743 //Do not append trailing '/' for default vDir 743 //Do not append trailing '/' for default vDir
744 // 744 //
745 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzPathName, -1, L"/", -1)) 745 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzPathName, -1, L"/", -1, TRUE))
746 { 746 {
747 hr = StrAllocConcat(&pwzLocationPath, L"/", 0); 747 hr = StrAllocConcat(&pwzLocationPath, L"/", 0);
748 ExitOnFailure(hr, "failed to copy location WebDir '/'"); 748 ExitOnFailure(hr, "failed to copy location WebDir '/'");
@@ -998,7 +998,7 @@ HRESULT IIS7WebError(
998 hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName); 998 hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName);
999 ExitOnFailure(hr, "failed to format web error config path"); 999 ExitOnFailure(hr, "failed to format web error config path");
1000 1000
1001 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzAppName, -1, L"/", -1)) 1001 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzAppName, -1, L"/", -1, TRUE))
1002 { 1002 {
1003 hr = StrAllocConcat(&pwzConfigPath, L"/", 0); 1003 hr = StrAllocConcat(&pwzConfigPath, L"/", 0);
1004 ExitOnFailure(hr, "failed to copy web error config path delim"); 1004 ExitOnFailure(hr, "failed to copy web error config path delim");
@@ -1325,7 +1325,7 @@ HRESULT IIS7HttpHeader(
1325 hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName); 1325 hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName);
1326 ExitOnFailure(hr, "failed to format web error config path"); 1326 ExitOnFailure(hr, "failed to format web error config path");
1327 1327
1328 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzAppName, -1, L"/", -1)) 1328 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzAppName, -1, L"/", -1, TRUE))
1329 { 1329 {
1330 hr = StrAllocConcat(&pwzConfigPath, L"/", 0); 1330 hr = StrAllocConcat(&pwzConfigPath, L"/", 0);
1331 ExitOnFailure(hr, "failed to copy web error config path delim"); 1331 ExitOnFailure(hr, "failed to copy web error config path delim");
@@ -2340,7 +2340,7 @@ HRESULT IIS7AppExtension(
2340 // 2340 //
2341 //Do not append trailing '/' for default vDir 2341 //Do not append trailing '/' for default vDir
2342 // 2342 //
2343 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) 2343 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE))
2344 { 2344 {
2345 hr = StrAllocConcat(&pwzConfigPath, L"/", 0); 2345 hr = StrAllocConcat(&pwzConfigPath, L"/", 0);
2346 ExitOnFailure(hr, "failed to copy appext config path delim"); 2346 ExitOnFailure(hr, "failed to copy appext config path delim");
@@ -2495,7 +2495,7 @@ LExit:
2495 // 2495 //
2496 //Do not append trailing '/' for default vDir 2496 //Do not append trailing '/' for default vDir
2497 // 2497 //
2498 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) 2498 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE))
2499 { 2499 {
2500 hr = StrAllocConcat(&pwzConfigPath, L"/", 0); 2500 hr = StrAllocConcat(&pwzConfigPath, L"/", 0);
2501 ExitOnFailure(hr, "failed to copy appext config path delim"); 2501 ExitOnFailure(hr, "failed to copy appext config path delim");
@@ -2627,7 +2627,7 @@ HRESULT IIS7DirProperties(
2627 // 2627 //
2628 //Do not append trailing '/' for default vDir 2628 //Do not append trailing '/' for default vDir
2629 // 2629 //
2630 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) 2630 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE))
2631 { 2631 {
2632 hr = StrAllocConcat(&pwzConfigPath, L"/", 0); 2632 hr = StrAllocConcat(&pwzConfigPath, L"/", 0);
2633 ExitOnFailure(hr, "failed to copy appext config path delim"); 2633 ExitOnFailure(hr, "failed to copy appext config path delim");
@@ -3337,7 +3337,7 @@ static HRESULT CreateWebLog(
3337 ExitOnFailure(hr, "Failed get logfile element"); 3337 ExitOnFailure(hr, "Failed get logfile element");
3338 ReleaseVariant(vtProp); 3338 ReleaseVariant(vtProp);
3339 3339
3340 if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzFormat, -1, L"none", -1)) 3340 if (CSTR_EQUAL != ::CompareStringOrdinal(pwzFormat, -1, L"none", -1, TRUE))
3341 { 3341 {
3342 hr = Iis7PutPropertyString(pLogFile, IIS_CONFIG_LOGFORMAT, pwzFormat); 3342 hr = Iis7PutPropertyString(pLogFile, IIS_CONFIG_LOGFORMAT, pwzFormat);
3343 ExitOnFailure(hr, "Failed set logfile format property"); 3343 ExitOnFailure(hr, "Failed set logfile format property");
@@ -4118,7 +4118,7 @@ static HRESULT ClearLocationTag(
4118 ExitOnFailure(hr, "Failed to get IIS location collection count"); 4118 ExitOnFailure(hr, "Failed to get IIS location collection count");
4119 4119
4120 hr = pLocation->get_Path(&bstrLocationPath); 4120 hr = pLocation->get_Path(&bstrLocationPath);
4121 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, swLocationPath, -1, bstrLocationPath, -1)) 4121 if (CSTR_EQUAL == ::CompareStringOrdinal(swLocationPath, -1, bstrLocationPath, -1, TRUE))
4122 { 4122 {
4123 hr = pLocationCollection->DeleteLocation(vtIndex); 4123 hr = pLocationCollection->DeleteLocation(vtIndex);
4124 ExitOnFailure(hr, "Failed to delete IIS location tag %ls",swLocationPath); 4124 ExitOnFailure(hr, "Failed to delete IIS location tag %ls",swLocationPath);
diff --git a/src/ext/Iis/ca/scawebappext.cpp b/src/ext/Iis/ca/scawebappext.cpp
index cf3b9dd3..2f74871c 100644
--- a/src/ext/Iis/ca/scawebappext.cpp
+++ b/src/ext/Iis/ca/scawebappext.cpp
@@ -124,7 +124,7 @@ HRESULT ScaWebAppExtensionsWrite(
124 } 124 }
125 125
126 // if verbs were specified and not the keyword "all" 126 // if verbs were specified and not the keyword "all"
127 if (pswappext->wzVerbs[0] && CSTR_EQUAL != CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pswappext->wzVerbs, -1, L"all", -1)) 127 if (pswappext->wzVerbs[0] && CSTR_EQUAL != CompareStringOrdinal(pswappext->wzVerbs, -1, L"all", -1, TRUE))
128 { 128 {
129 hr = ::StringCchCatW(wzAppExtension, countof(wzAppExtension), L","); 129 hr = ::StringCchCatW(wzAppExtension, countof(wzAppExtension), L",");
130 ExitOnFailure(hr, "Failed to concatenate comma to app extension string"); 130 ExitOnFailure(hr, "Failed to concatenate comma to app extension string");