diff options
| author | Rob Mensching <rob@firegiant.com> | 2025-11-01 20:24:25 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-11-03 14:49:39 -0800 |
| commit | 4d626c294c4783d454e27ea4e5614037dac8576e (patch) | |
| tree | 51d822f48716e4c5ef2a51ca28925896f221b521 /src/burn/engine/cache.cpp | |
| parent | 33c12fa386aa7ace7a6bd06a45bc3ecf17e9c8f5 (diff) | |
| download | wix-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/burn/engine/cache.cpp')
| -rw-r--r-- | src/burn/engine/cache.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index e432df69..f5df6500 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp | |||
| @@ -619,8 +619,8 @@ extern "C" HRESULT CacheGetLocalSourcePaths( | |||
| 619 | 619 | ||
| 620 | hr = GetLastUsedSourceFolder(pVariables, &sczLastSourceFolder); | 620 | hr = GetLastUsedSourceFolder(pVariables, &sczLastSourceFolder); |
| 621 | fPreferSourcePathLocation = !pCache->fRunningFromCache || FAILED(hr); | 621 | fPreferSourcePathLocation = !pCache->fRunningFromCache || FAILED(hr); |
| 622 | fTryLastFolder = SUCCEEDED(hr) && sczLastSourceFolder && *sczLastSourceFolder && CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pCache->sczSourceProcessFolder, -1, sczLastSourceFolder, -1); | 622 | fTryLastFolder = SUCCEEDED(hr) && sczLastSourceFolder && *sczLastSourceFolder && CSTR_EQUAL != ::CompareStringOrdinal(pCache->sczSourceProcessFolder, -1, sczLastSourceFolder, -1, TRUE); |
| 623 | fTryRelativePath = CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, wzSourcePath, -1, wzRelativePath, -1); | 623 | fTryRelativePath = CSTR_EQUAL != ::CompareStringOrdinal(wzSourcePath, -1, wzRelativePath, -1, TRUE); |
| 624 | fSourceIsAbsolute = PathIsRooted(wzSourcePath); | 624 | fSourceIsAbsolute = PathIsRooted(wzSourcePath); |
| 625 | 625 | ||
| 626 | // If the source path provided is a full path, try that first. | 626 | // If the source path provided is a full path, try that first. |
| @@ -797,7 +797,7 @@ extern "C" HRESULT CacheSetLastUsedSource( | |||
| 797 | 797 | ||
| 798 | // If the source path ends with the relative path then this source could be a new path. | 798 | // If the source path ends with the relative path then this source could be a new path. |
| 799 | iSourceRelativePath = cchSourcePath - cchRelativePath; | 799 | iSourceRelativePath = cchSourcePath - cchRelativePath; |
| 800 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, wzSourcePath + iSourceRelativePath, -1, wzRelativePath, -1)) | 800 | if (CSTR_EQUAL == ::CompareStringOrdinal(wzSourcePath + iSourceRelativePath, -1, wzRelativePath, -1, TRUE)) |
| 801 | { | 801 | { |
| 802 | hr = StrAllocString(&sczSourceFolder, wzSourcePath, iSourceRelativePath); | 802 | hr = StrAllocString(&sczSourceFolder, wzSourcePath, iSourceRelativePath); |
| 803 | ExitOnFailure(hr, "Failed to trim source folder."); | 803 | ExitOnFailure(hr, "Failed to trim source folder."); |
| @@ -805,7 +805,7 @@ extern "C" HRESULT CacheSetLastUsedSource( | |||
| 805 | hr = VariableGetString(pVariables, BURN_BUNDLE_LAST_USED_SOURCE, &sczLastSourceFolder); | 805 | hr = VariableGetString(pVariables, BURN_BUNDLE_LAST_USED_SOURCE, &sczLastSourceFolder); |
| 806 | if (SUCCEEDED(hr)) | 806 | if (SUCCEEDED(hr)) |
| 807 | { | 807 | { |
| 808 | nCompare = ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, sczSourceFolder, -1, sczLastSourceFolder, -1); | 808 | nCompare = ::CompareStringOrdinal(sczSourceFolder, -1, sczLastSourceFolder, -1, TRUE); |
| 809 | } | 809 | } |
| 810 | else if (E_NOTFOUND == hr) | 810 | else if (E_NOTFOUND == hr) |
| 811 | { | 811 | { |
| @@ -1031,7 +1031,7 @@ extern "C" HRESULT CacheCompleteBundle( | |||
| 1031 | ExitOnFailure(hr, "Failed to combine completed path with engine file name."); | 1031 | ExitOnFailure(hr, "Failed to combine completed path with engine file name."); |
| 1032 | 1032 | ||
| 1033 | // We can't just use wzExecutablePath because we needed to call CreateCompletedPath to ensure that the destination was secured. | 1033 | // We can't just use wzExecutablePath because we needed to call CreateCompletedPath to ensure that the destination was secured. |
| 1034 | Assert(CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, wzExecutablePath, -1, sczTargetPath, -1)); | 1034 | Assert(CSTR_EQUAL == ::CompareStringOrdinal(wzExecutablePath, -1, sczTargetPath, -1, TRUE)); |
| 1035 | 1035 | ||
| 1036 | // If the bundle is running out of the package cache then we don't need to copy it there | 1036 | // If the bundle is running out of the package cache then we don't need to copy it there |
| 1037 | // (and don't want to since it'll be in use) so bail. | 1037 | // (and don't want to since it'll be in use) so bail. |
