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/ext/Iis/ca/scaexecIIS7.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ext/Iis/ca/scaexecIIS7.cpp') 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( // //Do not append trailing '/' for default vDir // - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzPathName, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzPathName, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzLocationPath, L"/", 0); ExitOnFailure(hr, "failed to copy location WebDir '/'"); @@ -742,7 +742,7 @@ HRESULT IIS7WebDir( // //Do not append trailing '/' for default vDir // - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzPathName, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzPathName, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzLocationPath, L"/", 0); ExitOnFailure(hr, "failed to copy location WebDir '/'"); @@ -998,7 +998,7 @@ HRESULT IIS7WebError( hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName); ExitOnFailure(hr, "failed to format web error config path"); - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzAppName, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzAppName, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzConfigPath, L"/", 0); ExitOnFailure(hr, "failed to copy web error config path delim"); @@ -1325,7 +1325,7 @@ HRESULT IIS7HttpHeader( hr = StrAllocFormatted(&pwzConfigPath, L"%s/%s", IIS_CONFIG_APPHOST_ROOT, pwzSiteName); ExitOnFailure(hr, "failed to format web error config path"); - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzAppName, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzAppName, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzConfigPath, L"/", 0); ExitOnFailure(hr, "failed to copy web error config path delim"); @@ -2340,7 +2340,7 @@ HRESULT IIS7AppExtension( // //Do not append trailing '/' for default vDir // - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzConfigPath, L"/", 0); ExitOnFailure(hr, "failed to copy appext config path delim"); @@ -2495,7 +2495,7 @@ LExit: // //Do not append trailing '/' for default vDir // - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzConfigPath, L"/", 0); ExitOnFailure(hr, "failed to copy appext config path delim"); @@ -2627,7 +2627,7 @@ HRESULT IIS7DirProperties( // //Do not append trailing '/' for default vDir // - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzWebRoot, -1, L"/", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzWebRoot, -1, L"/", -1, TRUE)) { hr = StrAllocConcat(&pwzConfigPath, L"/", 0); ExitOnFailure(hr, "failed to copy appext config path delim"); @@ -3337,7 +3337,7 @@ static HRESULT CreateWebLog( ExitOnFailure(hr, "Failed get logfile element"); ReleaseVariant(vtProp); - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pwzFormat, -1, L"none", -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pwzFormat, -1, L"none", -1, TRUE)) { hr = Iis7PutPropertyString(pLogFile, IIS_CONFIG_LOGFORMAT, pwzFormat); ExitOnFailure(hr, "Failed set logfile format property"); @@ -4118,7 +4118,7 @@ static HRESULT ClearLocationTag( ExitOnFailure(hr, "Failed to get IIS location collection count"); hr = pLocation->get_Path(&bstrLocationPath); - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, swLocationPath, -1, bstrLocationPath, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(swLocationPath, -1, bstrLocationPath, -1, TRUE)) { hr = pLocationCollection->DeleteLocation(vtIndex); ExitOnFailure(hr, "Failed to delete IIS location tag %ls",swLocationPath); -- cgit v1.2.3-55-g6feb