From d2ba0da55725f2908b67e1470afc7cfd71cb3d1f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 1 Nov 2025 21:52:31 -0700 Subject: 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 --- src/tools/thmviewer/thmviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/thmviewer/thmviewer.cpp b/src/tools/thmviewer/thmviewer.cpp index 69a9920b..12d311af 100644 --- a/src/tools/thmviewer/thmviewer.cpp +++ b/src/tools/thmviewer/thmviewer.cpp @@ -495,14 +495,14 @@ static void OnNewTheme( tvi.item.lParam = i + 1; //prgdwPageIds[i]; - TODO: do the right thing here by calling ThemeGetPageIds(), should not assume we know how the page ids will be calculated. HTREEITEM hti = reinterpret_cast(::SendMessage(pTreeControl->hWnd, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); - if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pPage->sczName, -1, wzSelectedPage, -1)) + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringOrdinal(pPage->sczName, -1, wzSelectedPage, -1, FALSE)) { htiSelected = hti; } } } - if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Application", -1, wzSelectedPage, -1)) + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringOrdinal(L"Application", -1, wzSelectedPage, -1, FALSE)) { htiSelected = tvi.hParent; } @@ -519,7 +519,7 @@ static BOOL OnThemeLoadingControl( __in THEME_LOADINGCONTROL_RESULTS* pResults ) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, L"Tree", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pArgs->pThemeControl->sczName, -1, L"Tree", -1, FALSE)) { pResults->wId = THMVWR_CONTROL_TREE; } -- cgit v1.2.3-55-g6feb