diff options
| author | Rob Mensching <rob@firegiant.com> | 2025-11-01 21:52:31 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-11-03 14:49:39 -0800 |
| commit | d2ba0da55725f2908b67e1470afc7cfd71cb3d1f (patch) | |
| tree | c2a1db61c5fac031c698976106bba2c453d85ded /src/ext | |
| parent | 4d626c294c4783d454e27ea4e5614037dac8576e (diff) | |
| download | wix-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/ext')
| -rw-r--r-- | src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | 4 | ||||
| -rw-r--r-- | src/ext/Iis/ca/scafilter.cpp | 4 | ||||
| -rw-r--r-- | src/ext/NetFx/be/netfxsearch.cpp | 8 | ||||
| -rw-r--r-- | src/ext/Util/be/utilsearch.cpp | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp index 9ddab7c0..6cfe0b4c 100644 --- a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | |||
| @@ -614,7 +614,7 @@ public: // IBootstrapperApplication | |||
| 614 | { | 614 | { |
| 615 | // After restart we need to finish the dependency registration for our package so allow the package | 615 | // After restart we need to finish the dependency registration for our package so allow the package |
| 616 | // to go present. | 616 | // to go present. |
| 617 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPackageId, -1, m_sczAfterForcedRestartPackage, -1)) | 617 | if (CSTR_EQUAL == ::CompareStringOrdinal(wzPackageId, -1, m_sczAfterForcedRestartPackage, -1, FALSE)) |
| 618 | { | 618 | { |
| 619 | // Do not allow a repair because that could put us in a perpetual restart loop. | 619 | // Do not allow a repair because that could put us in a perpetual restart loop. |
| 620 | if (BOOTSTRAPPER_REQUEST_STATE_REPAIR == *pRequestState) | 620 | if (BOOTSTRAPPER_REQUEST_STATE_REPAIR == *pRequestState) |
| @@ -3570,7 +3570,7 @@ private: | |||
| 3570 | for (DWORD iAssignControl = 0; iAssignControl < countof(m_rgInitControls); ++iAssignControl) | 3570 | for (DWORD iAssignControl = 0; iAssignControl < countof(m_rgInitControls); ++iAssignControl) |
| 3571 | { | 3571 | { |
| 3572 | THEME_ASSIGN_CONTROL_ID* pAssignControl = m_rgInitControls + iAssignControl; | 3572 | THEME_ASSIGN_CONTROL_ID* pAssignControl = m_rgInitControls + iAssignControl; |
| 3573 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, pAssignControl->wzName, -1)) | 3573 | if (CSTR_EQUAL == ::CompareStringOrdinal(pArgs->pThemeControl->sczName, -1, pAssignControl->wzName, -1, FALSE)) |
| 3574 | { | 3574 | { |
| 3575 | if (!pAssignControl->ppControl) | 3575 | if (!pAssignControl->ppControl) |
| 3576 | { | 3576 | { |
diff --git a/src/ext/Iis/ca/scafilter.cpp b/src/ext/Iis/ca/scafilter.cpp index 9d9014fd..294e002e 100644 --- a/src/ext/Iis/ca/scafilter.cpp +++ b/src/ext/Iis/ca/scafilter.cpp | |||
| @@ -158,7 +158,7 @@ HRESULT ScaFiltersInstall( | |||
| 158 | { | 158 | { |
| 159 | if (WcaIsInstalling(psf->isInstalled, psf->isAction)) | 159 | if (WcaIsInstalling(psf->isInstalled, psf->isAction)) |
| 160 | { | 160 | { |
| 161 | if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1)) | 161 | if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringOrdinal(wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1, FALSE)) |
| 162 | { | 162 | { |
| 163 | if (pwzLoadOrder) | 163 | if (pwzLoadOrder) |
| 164 | { | 164 | { |
| @@ -234,7 +234,7 @@ HRESULT ScaFiltersUninstall( | |||
| 234 | { | 234 | { |
| 235 | if (WcaIsUninstalling(psf->isInstalled, psf->isAction)) | 235 | if (WcaIsUninstalling(psf->isInstalled, psf->isAction)) |
| 236 | { | 236 | { |
| 237 | if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1)) | 237 | if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringOrdinal(wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1, FALSE)) |
| 238 | { | 238 | { |
| 239 | if (pwzLoadOrder) | 239 | if (pwzLoadOrder) |
| 240 | { | 240 | { |
diff --git a/src/ext/NetFx/be/netfxsearch.cpp b/src/ext/NetFx/be/netfxsearch.cpp index 38c34e3c..6f3373d9 100644 --- a/src/ext/NetFx/be/netfxsearch.cpp +++ b/src/ext/NetFx/be/netfxsearch.cpp | |||
| @@ -46,7 +46,7 @@ STDMETHODIMP NetfxSearchParseFromXml( | |||
| 46 | BextExitOnFailure(hr, "Failed to get @Id."); | 46 | BextExitOnFailure(hr, "Failed to get @Id."); |
| 47 | 47 | ||
| 48 | // Read type specific attributes. | 48 | // Read type specific attributes. |
| 49 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"NetFxNetCoreSearch", -1)) | 49 | if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"NetFxNetCoreSearch", -1, FALSE)) |
| 50 | { | 50 | { |
| 51 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SEARCH; | 51 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SEARCH; |
| 52 | 52 | ||
| @@ -63,7 +63,7 @@ STDMETHODIMP NetfxSearchParseFromXml( | |||
| 63 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSearch.sczMajorVersion); | 63 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSearch.sczMajorVersion); |
| 64 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); | 64 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); |
| 65 | } | 65 | } |
| 66 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"NetFxNetCoreSdkSearch", -1)) | 66 | else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"NetFxNetCoreSdkSearch", -1, FALSE)) |
| 67 | { | 67 | { |
| 68 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH; | 68 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH; |
| 69 | 69 | ||
| @@ -76,7 +76,7 @@ STDMETHODIMP NetfxSearchParseFromXml( | |||
| 76 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSdkSearch.sczMajorVersion); | 76 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSdkSearch.sczMajorVersion); |
| 77 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); | 77 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); |
| 78 | } | 78 | } |
| 79 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"NetFxNetCoreSdkFeatureBandSearch", -1)) | 79 | else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"NetFxNetCoreSdkFeatureBandSearch", -1, FALSE)) |
| 80 | { | 80 | { |
| 81 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_FEATURE_BAND_SEARCH; | 81 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_FEATURE_BAND_SEARCH; |
| 82 | 82 | ||
| @@ -176,7 +176,7 @@ STDMETHODIMP NetfxSearchFindById( | |||
| 176 | { | 176 | { |
| 177 | NETFX_SEARCH* pSearch = &pSearches->rgSearches[i]; | 177 | NETFX_SEARCH* pSearch = &pSearches->rgSearches[i]; |
| 178 | 178 | ||
| 179 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pSearch->sczId, -1, wzId, -1)) | 179 | if (CSTR_EQUAL == ::CompareStringOrdinal(pSearch->sczId, -1, wzId, -1, FALSE)) |
| 180 | { | 180 | { |
| 181 | *ppSearch = pSearch; | 181 | *ppSearch = pSearch; |
| 182 | ExitFunction1(hr = S_OK); | 182 | ExitFunction1(hr = S_OK); |
diff --git a/src/ext/Util/be/utilsearch.cpp b/src/ext/Util/be/utilsearch.cpp index 59c497e3..a0818963 100644 --- a/src/ext/Util/be/utilsearch.cpp +++ b/src/ext/Util/be/utilsearch.cpp | |||
| @@ -47,7 +47,7 @@ STDMETHODIMP UtilSearchParseFromXml( | |||
| 47 | BextExitOnFailure(hr, "Failed to get @Id."); | 47 | BextExitOnFailure(hr, "Failed to get @Id."); |
| 48 | 48 | ||
| 49 | // Read type specific attributes. | 49 | // Read type specific attributes. |
| 50 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"WixWindowsFeatureSearch", -1)) | 50 | if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"WixWindowsFeatureSearch", -1, FALSE)) |
| 51 | { | 51 | { |
| 52 | pSearch->Type = UTIL_SEARCH_TYPE_WINDOWS_FEATURE_SEARCH; | 52 | pSearch->Type = UTIL_SEARCH_TYPE_WINDOWS_FEATURE_SEARCH; |
| 53 | 53 | ||
| @@ -55,7 +55,7 @@ STDMETHODIMP UtilSearchParseFromXml( | |||
| 55 | hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); | 55 | hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); |
| 56 | BextExitOnFailure(hr, "Failed to get @Type."); | 56 | BextExitOnFailure(hr, "Failed to get @Type."); |
| 57 | 57 | ||
| 58 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"sha2CodeSigning", -1)) | 58 | if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"sha2CodeSigning", -1, FALSE)) |
| 59 | { | 59 | { |
| 60 | pSearch->WindowsFeatureSearch.type = UTIL_WINDOWS_FEATURE_SEARCH_TYPE_SHA2_CODE_SIGNING; | 60 | pSearch->WindowsFeatureSearch.type = UTIL_WINDOWS_FEATURE_SEARCH_TYPE_SHA2_CODE_SIGNING; |
| 61 | } | 61 | } |
| @@ -144,7 +144,7 @@ STDMETHODIMP UtilSearchFindById( | |||
| 144 | { | 144 | { |
| 145 | UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; | 145 | UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; |
| 146 | 146 | ||
| 147 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pSearch->sczId, -1, wzId, -1)) | 147 | if (CSTR_EQUAL == ::CompareStringOrdinal(pSearch->sczId, -1, wzId, -1, FALSE)) |
| 148 | { | 148 | { |
| 149 | *ppSearch = pSearch; | 149 | *ppSearch = pSearch; |
| 150 | ExitFunction1(hr = S_OK); | 150 | ExitFunction1(hr = S_OK); |
