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/libs/dutil/WixToolset.DUtil/apuputil.cpp | 32 ++++++------- src/libs/dutil/WixToolset.DUtil/atomutil.cpp | 66 +++++++++++++------------- src/libs/dutil/WixToolset.DUtil/dictutil.cpp | 11 ++--- src/libs/dutil/WixToolset.DUtil/iniutil.cpp | 10 ++-- src/libs/dutil/WixToolset.DUtil/locutil.cpp | 6 +-- src/libs/dutil/WixToolset.DUtil/monutil.cpp | 4 +- src/libs/dutil/WixToolset.DUtil/sceutil.cpp | 16 +++---- src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 70 ++++++++++++++-------------- src/libs/dutil/WixToolset.DUtil/xmlutil.cpp | 4 +- 9 files changed, 107 insertions(+), 112 deletions(-) (limited to 'src/libs') diff --git a/src/libs/dutil/WixToolset.DUtil/apuputil.cpp b/src/libs/dutil/WixToolset.DUtil/apuputil.cpp index 62cf4d06..848aac15 100644 --- a/src/libs/dutil/WixToolset.DUtil/apuputil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/apuputil.cpp @@ -70,16 +70,16 @@ extern "C" HRESULT DAPI ApupAllocChainFromAtom( // First search the ATOM feed's custom elements to try and find the default application identity. for (ATOM_UNKNOWN_ELEMENT* pElement = pFeed->pUnknownElements; pElement; pElement = pElement->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1, FALSE)) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzElement, -1, L"application", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzElement, -1, L"application", -1, FALSE)) { hr = StrAllocString(&pChain->wzDefaultApplicationId, pElement->wzValue, 0); ApupExitOnFailure(hr, "Failed to allocate default application id."); for (ATOM_UNKNOWN_ATTRIBUTE* pAttribute = pElement->pAttributes; pAttribute; pAttribute = pAttribute->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pAttribute->wzAttribute, -1, L"type", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pAttribute->wzAttribute, -1, L"type", -1, FALSE)) { hr = StrAllocString(&pChain->wzDefaultApplicationType, pAttribute->wzValue, 0); ApupExitOnFailure(hr, "Failed to allocate default application type."); @@ -213,44 +213,44 @@ static HRESULT ProcessEntry( // First search the ATOM entry's custom elements to try and find the application update information. for (ATOM_UNKNOWN_ELEMENT* pElement = pAtomEntry->pUnknownElements; pElement; pElement = pElement->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1, FALSE)) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzElement, -1, L"application", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzElement, -1, L"application", -1, FALSE)) { hr = StrAllocString(&pApupEntry->wzApplicationId, pElement->wzValue, 0); ApupExitOnFailure(hr, "Failed to allocate application identity."); for (ATOM_UNKNOWN_ATTRIBUTE* pAttribute = pElement->pAttributes; pAttribute; pAttribute = pAttribute->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pAttribute->wzAttribute, -1, L"type", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pAttribute->wzAttribute, -1, L"type", -1, FALSE)) { hr = StrAllocString(&pApupEntry->wzApplicationType, pAttribute->wzValue, 0); ApupExitOnFailure(hr, "Failed to allocate application type."); } } } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzElement, -1, L"upgrade", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzElement, -1, L"upgrade", -1, FALSE)) { hr = StrAllocString(&pApupEntry->wzUpgradeId, pElement->wzValue, 0); ApupExitOnFailure(hr, "Failed to allocate upgrade id."); for (ATOM_UNKNOWN_ATTRIBUTE* pAttribute = pElement->pAttributes; pAttribute; pAttribute = pAttribute->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pAttribute->wzAttribute, -1, L"version", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pAttribute->wzAttribute, -1, L"version", -1, FALSE)) { hr = VerParseVersion(pAttribute->wzValue, 0, FALSE, &pApupEntry->pUpgradeVersion); ApupExitOnFailure(hr, "Failed to parse upgrade version string '%ls' from ATOM entry.", pAttribute->wzValue); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pAttribute->wzAttribute, -1, L"exclusive", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(pAttribute->wzAttribute, -1, L"exclusive", -1, FALSE)) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pAttribute->wzValue, -1, L"true", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pAttribute->wzValue, -1, L"true", -1, FALSE)) { pApupEntry->fUpgradeExclusive = TRUE; } } } } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzElement, -1, L"version", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzElement, -1, L"version", -1, FALSE)) { hr = VerParseVersion(pElement->wzValue, 0, FALSE, &pApupEntry->pVersion); ApupExitOnFailure(hr, "Failed to parse version string '%ls' from ATOM entry.", pElement->wzValue); @@ -309,7 +309,7 @@ static HRESULT ProcessEntry( for (DWORD i = 0; i < pAtomEntry->cLinks; ++i) { ATOM_LINK* pLink = pAtomEntry->rgLinks + i; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pLink->wzRel, -1, L"enclosure", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pLink->wzRel, -1, L"enclosure", -1, FALSE)) { hr = ParseEnclosure(pLink, pApupEntry->rgEnclosures + pApupEntry->cEnclosures); ApupExitOnFailure(hr, "Failed to parse enclosure."); @@ -344,15 +344,15 @@ static HRESULT ParseEnclosure( // First search the ATOM link's custom elements to try and find the application update enclosure information. for (ATOM_UNKNOWN_ELEMENT* pElement = pLink->pUnknownElements; pElement; pElement = pElement->pNext) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pElement->wzNamespace, -1, APPLICATION_SYNDICATION_NAMESPACE, -1, FALSE)) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, L"digest", -1, pElement->wzElement, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(L"digest", -1, pElement->wzElement, -1, FALSE)) { // Find the digest[@algorithm] which is required. Everything else is ignored. for (ATOM_UNKNOWN_ATTRIBUTE* pAttribute = pElement->pAttributes; pAttribute; pAttribute = pAttribute->pNext) { dwDigestLength = 0; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, L"algorithm", -1, pAttribute->wzAttribute, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(L"algorithm", -1, pAttribute->wzAttribute, -1, FALSE)) { if (CSTR_EQUAL == ::CompareStringOrdinal(L"md5", -1, pAttribute->wzValue, -1, TRUE)) { @@ -406,7 +406,7 @@ static HRESULT ParseEnclosure( break; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, L"name", -1, pElement->wzElement, -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(L"name", -1, pElement->wzElement, -1, FALSE)) { hr = StrAllocString(&pEnclosure->wzLocalName, pElement->wzValue, 0); ApupExitOnFailure(hr, "Failed to copy local name."); diff --git a/src/libs/dutil/WixToolset.DUtil/atomutil.cpp b/src/libs/dutil/WixToolset.DUtil/atomutil.cpp index d6fd3890..df5bb424 100644 --- a/src/libs/dutil/WixToolset.DUtil/atomutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/atomutil.cpp @@ -341,63 +341,63 @@ static HRESULT ParseAtomFeed( while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"generator", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"generator", -1, FALSE)) { hr = AssignString(&pNewFeed->wzGenerator, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed generator."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"icon", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"icon", -1, FALSE)) { hr = AssignString(&pNewFeed->wzIcon, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed icon."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"id", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"id", -1, FALSE)) { hr = AssignString(&pNewFeed->wzId, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed id."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"logo", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"logo", -1, FALSE)) { hr = AssignString(&pNewFeed->wzLogo, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed logo."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"subtitle", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"subtitle", -1, FALSE)) { hr = AssignString(&pNewFeed->wzSubtitle, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed subtitle."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"title", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"title", -1, FALSE)) { hr = AssignString(&pNewFeed->wzTitle, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed title."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"updated", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"updated", -1, FALSE)) { hr = AssignDateTime(&pNewFeed->ftUpdated, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM feed updated."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"author", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"author", -1, FALSE)) { hr = ParseAtomAuthor(pNode, &pNewFeed->rgAuthors[cAuthors]); AtomExitOnFailure(hr, "Failed to parse ATOM author."); ++cAuthors; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"category", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"category", -1, FALSE)) { hr = ParseAtomCategory(pNode, &pNewFeed->rgCategories[cCategories]); AtomExitOnFailure(hr, "Failed to parse ATOM category."); ++cCategories; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"entry", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"entry", -1, FALSE)) { hr = ParseAtomEntry(pNode, &pNewFeed->rgEntries[cEntries]); AtomExitOnFailure(hr, "Failed to parse ATOM entry."); ++cEntries; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"link", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"link", -1, FALSE)) { hr = ParseAtomLink(pNode, &pNewFeed->rgLinks[cLinks]); AtomExitOnFailure(hr, "Failed to parse ATOM link."); @@ -516,17 +516,17 @@ static HRESULT ParseAtomAuthor( while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"name", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"name", -1, FALSE)) { hr = AssignString(&pAuthor->wzName, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM author name."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"email", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"email", -1, FALSE)) { hr = AssignString(&pAuthor->wzEmail, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM author email."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"uri", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"uri", -1, FALSE)) { hr = AssignString(&pAuthor->wzUrl, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM author uri."); @@ -570,17 +570,17 @@ static HRESULT ParseAtomCategory( while (S_OK == (hr = XmlNextAttribute(pixnnmAttributes, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"label", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"label", -1, FALSE)) { hr = AssignString(&pCategory->wzLabel, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM category label."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"scheme", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"scheme", -1, FALSE)) { hr = AssignString(&pCategory->wzScheme, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM category scheme."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"term", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"term", -1, FALSE)) { hr = AssignString(&pCategory->wzTerm, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM category term."); @@ -639,12 +639,12 @@ static HRESULT ParseAtomContent( while (S_OK == (hr = XmlNextAttribute(pixnnmAttributes, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"type", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"type", -1, FALSE)) { hr = AssignString(&pContent->wzType, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM content type."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"url", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"url", -1, FALSE)) { hr = AssignString(&pContent->wzUrl, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM content scheme."); @@ -721,46 +721,46 @@ static HRESULT ParseAtomEntry( while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"id", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"id", -1, FALSE)) { hr = AssignString(&pEntry->wzId, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM entry id."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"summary", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"summary", -1, FALSE)) { hr = AssignString(&pEntry->wzSummary, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM entry summary."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"title", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"title", -1, FALSE)) { hr = AssignString(&pEntry->wzTitle, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM entry title."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"published", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"published", -1, FALSE)) { hr = AssignDateTime(&pEntry->ftPublished, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM entry published."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"updated", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"updated", -1, FALSE)) { hr = AssignDateTime(&pEntry->ftUpdated, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM entry updated."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"author", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"author", -1, FALSE)) { hr = ParseAtomAuthor(pNode, &pEntry->rgAuthors[cAuthors]); AtomExitOnFailure(hr, "Failed to parse ATOM entry author."); ++cAuthors; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"category", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"category", -1, FALSE)) { hr = ParseAtomCategory(pNode, &pEntry->rgCategories[cCategories]); AtomExitOnFailure(hr, "Failed to parse ATOM entry category."); ++cCategories; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"content", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"content", -1, FALSE)) { if (NULL != pEntry->pContent) { @@ -774,7 +774,7 @@ static HRESULT ParseAtomEntry( hr = ParseAtomContent(pNode, pEntry->pContent); AtomExitOnFailure(hr, "Failed to parse ATOM entry content."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"link", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"link", -1, FALSE)) { hr = ParseAtomLink(pNode, &pEntry->rgLinks[cLinks]); AtomExitOnFailure(hr, "Failed to parse ATOM entry link."); @@ -842,17 +842,17 @@ static HRESULT ParseAtomLink( while (S_OK == (hr = XmlNextAttribute(pixnnmAttributes, &pNode, &bstrNodeName))) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"rel", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"rel", -1, FALSE)) { hr = AssignString(&pLink->wzRel, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM link rel."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"href", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"href", -1, FALSE)) { hr = AssignString(&pLink->wzUrl, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM link href."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"length", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"length", -1, FALSE)) { hr = XmlGetAttributeUInt64(pixnLink, bstrNodeName, &pLink->dw64Length); if (E_INVALIDARG == hr) @@ -861,12 +861,12 @@ static HRESULT ParseAtomLink( } AtomExitOnFailure(hr, "Failed to parse ATOM link length."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"title", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"title", -1, FALSE)) { hr = AssignString(&pLink->wzTitle, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM link title."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"type", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"type", -1, FALSE)) { hr = AssignString(&pLink->wzType, pNode); AtomExitOnFailure(hr, "Failed to allocate ATOM link type."); diff --git a/src/libs/dutil/WixToolset.DUtil/dictutil.cpp b/src/libs/dutil/WixToolset.DUtil/dictutil.cpp index 09b150df..247b7b43 100644 --- a/src/libs/dutil/WixToolset.DUtil/dictutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/dictutil.cpp @@ -499,14 +499,9 @@ static BOOL IsMatchExact( ) { LPCWSTR wzMatchString = GetKey(psd, TranslateOffsetToValue(psd, psd->ppvBuckets[dwMatchIndex])); - DWORD dwFlags = 0; + BOOL fIgnoreCase = (DICT_FLAG_CASEINSENSITIVE & psd->dfFlags) ? TRUE : FALSE; - if (DICT_FLAG_CASEINSENSITIVE & psd->dfFlags) - { - dwFlags |= NORM_IGNORECASE; - } - - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, dwFlags, wzOriginalString, -1, wzMatchString, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(wzOriginalString, -1, wzMatchString, -1, fIgnoreCase)) { return TRUE; } @@ -605,7 +600,7 @@ static HRESULT GetInsertIndex( // If we wrapped all the way back around to our original index, the dict is full - throw an error if (dwIndexCandidate == dwOriginalIndexCandidate) { - // The dict table is full - this error seems to be a reasonably close match + // The dict table is full - this error seems to be a reasonably close match hr = HRESULT_FROM_WIN32(ERROR_DATABASE_FULL); DictExitOnRootFailure(hr, "Failed to add item '%ls' to dict table because dict table is full of items", pszString); } diff --git a/src/libs/dutil/WixToolset.DUtil/iniutil.cpp b/src/libs/dutil/WixToolset.DUtil/iniutil.cpp index 46f6e380..12af6fb2 100644 --- a/src/libs/dutil/WixToolset.DUtil/iniutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/iniutil.cpp @@ -441,7 +441,7 @@ extern "C" HRESULT DAPI IniGetValue( for (DWORD i = 0; i < pi->cValues; ++i) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pi->rgivValues[i].wzName, -1, wzValueName, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pi->rgivValues[i].wzName, -1, wzValueName, -1, FALSE)) { pValue = pi->rgivValues + i; break; @@ -483,7 +483,7 @@ extern "C" HRESULT DAPI IniSetValue( for (DWORD i = 0; i < pi->cValues; ++i) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pi->rgivValues[i].wzName, -1, wzValueName, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pi->rgivValues[i].wzName, -1, wzValueName, -1, FALSE)) { pValue = pi->rgivValues + i; break; @@ -507,7 +507,7 @@ extern "C" HRESULT DAPI IniSetValue( { if (pValue) { - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, pValue->wzValue, -1, wzValue, -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(pValue->wzValue, -1, wzValue, -1, FALSE)) { pi->fModified = TRUE; hr = StrAllocString(const_cast(&pValue->wzValue), wzValue, 0); @@ -660,7 +660,7 @@ extern "C" HRESULT DAPI IniWriteFile( IniExitOnFailure(hr, "Failed to get section prefix from name: %ls", pi->rgivValues[i].wzName); // If the new section prefix is different, write a section out for it - if (fSections && sczNewSectionPrefix && (NULL == sczCurrentSectionPrefix || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, sczNewSectionPrefix, -1, sczCurrentSectionPrefix, -1))) + if (fSections && sczNewSectionPrefix && (NULL == sczCurrentSectionPrefix || CSTR_EQUAL != ::CompareStringOrdinal(sczNewSectionPrefix, -1, sczCurrentSectionPrefix, -1, FALSE))) { hr = StrAllocConcat(&sczContents, pi->sczOpenTagPrefix, 0); IniExitOnFailure(hr, "Failed to concat open tag prefix to string"); @@ -674,7 +674,7 @@ extern "C" HRESULT DAPI IniWriteFile( hr = StrAllocConcat(&sczContents, L"\r\n", 2); IniExitOnFailure(hr, "Failed to add endline to ini output buffer in-memory"); - + ReleaseNullStr(sczCurrentSectionPrefix); sczCurrentSectionPrefix = sczNewSectionPrefix; sczNewSectionPrefix = NULL; diff --git a/src/libs/dutil/WixToolset.DUtil/locutil.cpp b/src/libs/dutil/WixToolset.DUtil/locutil.cpp index 008d0367..0e897186 100644 --- a/src/libs/dutil/WixToolset.DUtil/locutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/locutil.cpp @@ -315,7 +315,7 @@ extern "C" HRESULT DAPI LocGetControl( { pLocControl = &pWixLoc->rgLocControls[i]; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pLocControl->wzControl, -1, wzId, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pLocControl->wzControl, -1, wzId, -1, FALSE)) { *ppLocControl = pLocControl; ExitFunction1(hr = S_OK); @@ -341,7 +341,7 @@ extern "C" HRESULT DAPI LocGetString( { pLocString = pWixLoc->rgLocStrings + i; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pLocString->wzId, -1, wzId, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pLocString->wzId, -1, wzId, -1, FALSE)) { *ppLocString = pLocString; hr = S_OK; @@ -555,7 +555,7 @@ static HRESULT ParseWxlString( if (S_OK == hr) { - pLocString->bOverridable = CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrText, -1, L"yes", -1); + pLocString->bOverridable = CSTR_EQUAL == ::CompareStringOrdinal(bstrText, -1, L"yes", -1, FALSE); } ReleaseNullBSTR(bstrText); diff --git a/src/libs/dutil/WixToolset.DUtil/monutil.cpp b/src/libs/dutil/WixToolset.DUtil/monutil.cpp index b42332ef..d6437b39 100644 --- a/src/libs/dutil/WixToolset.DUtil/monutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/monutil.cpp @@ -1598,14 +1598,14 @@ static HRESULT FindRequestIndex( switch (pWaiterContext->rgRequests[i].type) { case MON_DIRECTORY: - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pWaiterContext->rgRequests[i].rgsczPathHierarchy[pWaiterContext->rgRequests[i].cPathHierarchy - 1], -1, pMessage->directory.sczDirectory, -1) && pWaiterContext->rgRequests[i].fRecursive == pMessage->fRecursive) + if (CSTR_EQUAL == ::CompareStringOrdinal(pWaiterContext->rgRequests[i].rgsczPathHierarchy[pWaiterContext->rgRequests[i].cPathHierarchy - 1], -1, pMessage->directory.sczDirectory, -1, FALSE) && pWaiterContext->rgRequests[i].fRecursive == pMessage->fRecursive) { *pdwIndex = i; ExitFunction1(hr = S_OK); } break; case MON_REGKEY: - if (reinterpret_cast(pMessage->regkey.hkRoot) == reinterpret_cast(pWaiterContext->rgRequests[i].regkey.hkRoot) && CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pWaiterContext->rgRequests[i].rgsczPathHierarchy[pWaiterContext->rgRequests[i].cPathHierarchy - 1], -1, pMessage->regkey.sczSubKey, -1) && pWaiterContext->rgRequests[i].fRecursive == pMessage->fRecursive && pWaiterContext->rgRequests[i].regkey.kbKeyBitness == pMessage->regkey.kbKeyBitness) + if (reinterpret_cast(pMessage->regkey.hkRoot) == reinterpret_cast(pWaiterContext->rgRequests[i].regkey.hkRoot) && CSTR_EQUAL == ::CompareStringOrdinal(pWaiterContext->rgRequests[i].rgsczPathHierarchy[pWaiterContext->rgRequests[i].cPathHierarchy - 1], -1, pMessage->regkey.sczSubKey, -1, FALSE) && pWaiterContext->rgRequests[i].fRecursive == pMessage->fRecursive && pWaiterContext->rgRequests[i].regkey.kbKeyBitness == pMessage->regkey.kbKeyBitness) { *pdwIndex = i; ExitFunction1(hr = S_OK); diff --git a/src/libs/dutil/WixToolset.DUtil/sceutil.cpp b/src/libs/dutil/WixToolset.DUtil/sceutil.cpp index 590c937a..98b5e2d8 100644 --- a/src/libs/dutil/WixToolset.DUtil/sceutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/sceutil.cpp @@ -224,7 +224,7 @@ extern "C" HRESULT DAPI SceCreateDatabase( LPWSTR sczDirectory = NULL; SCE_DATABASE *pNewSceDatabase = NULL; SCE_DATABASE_INTERNAL *pNewSceDatabaseInternal = NULL; - IDBDataSourceAdmin *pIDBDataSourceAdmin = NULL; + IDBDataSourceAdmin *pIDBDataSourceAdmin = NULL; DBPROPSET rgdbpDataSourcePropSet[2] = { }; DBPROP rgdbpDataSourceProp[2] = { }; DBPROP rgdbpDataSourceSsceProp[1] = { }; @@ -239,7 +239,7 @@ extern "C" HRESULT DAPI SceCreateDatabase( hr = CreateSqlCe(wzSqlCeDllPath, &pNewSceDatabaseInternal->pIDBInitialize, &pNewSceDatabaseInternal->hSqlCeDll); ExitOnFailure(hr, "Failed to get IDBInitialize interface"); - + hr = pNewSceDatabaseInternal->pIDBInitialize->QueryInterface(IID_IDBDataSourceAdmin, reinterpret_cast(&pIDBDataSourceAdmin)); ExitOnFailure(hr, "Failed to get IDBDataSourceAdmin interface"); @@ -259,7 +259,7 @@ extern "C" HRESULT DAPI SceCreateDatabase( rgdbpDataSourceProp[1].vValue.vt = VT_I4; rgdbpDataSourceProp[1].vValue.lVal = DB_MODE_SHARE_DENY_NONE; - // SQL CE doesn't seem to allow us to specify DBPROP_INIT_PROMPT if we include any properties from DBPROPSET_SSCE_DBINIT + // SQL CE doesn't seem to allow us to specify DBPROP_INIT_PROMPT if we include any properties from DBPROPSET_SSCE_DBINIT rgdbpDataSourcePropSet[0].guidPropertySet = DBPROPSET_DBINIT; rgdbpDataSourcePropSet[0].rgProperties = rgdbpDataSourceProp; rgdbpDataSourcePropSet[0].cProperties = _countof(rgdbpDataSourceProp); @@ -336,7 +336,7 @@ extern "C" HRESULT DAPI SceOpenDatabase( hr = CreateSqlCe(wzSqlCeDllPath, &pNewSceDatabaseInternal->pIDBInitialize, &pNewSceDatabaseInternal->hSqlCeDll); ExitOnFailure(hr, "Failed to get IDBInitialize interface"); - + hr = pNewSceDatabaseInternal->pIDBInitialize->QueryInterface(IID_IDBProperties, reinterpret_cast(&pNewSceDatabaseInternal->pIDBProperties)); ExitOnFailure(hr, "Failed to get IDBProperties interface"); @@ -369,7 +369,7 @@ extern "C" HRESULT DAPI SceOpenDatabase( rgdbpDataSourceProp[1].vValue.vt = VT_I4; rgdbpDataSourceProp[1].vValue.lVal = DB_MODE_SHARE_DENY_NONE; - // SQL CE doesn't seem to allow us to specify DBPROP_INIT_PROMPT if we include any properties from DBPROPSET_SSCE_DBINIT + // SQL CE doesn't seem to allow us to specify DBPROP_INIT_PROMPT if we include any properties from DBPROPSET_SSCE_DBINIT rgdbpDataSourcePropSet[0].guidPropertySet = DBPROPSET_DBINIT; rgdbpDataSourcePropSet[0].rgProperties = rgdbpDataSourceProp; rgdbpDataSourcePropSet[0].cProperties = _countof(rgdbpDataSourceProp); @@ -407,7 +407,7 @@ extern "C" HRESULT DAPI SceOpenDatabase( hr = GetDatabaseSchemaInfo(pNewSceDatabase, &sczSchemaType, &dwVersionFound); ExitOnFailure(hr, "Failed to find schema version of database"); - if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, sczSchemaType, -1, wzExpectedSchemaType, -1)) + if (CSTR_EQUAL != ::CompareStringOrdinal(sczSchemaType, -1, wzExpectedSchemaType, -1, FALSE)) { hr = HRESULT_FROM_WIN32(ERROR_BAD_FILE_TYPE); ExitOnRootFailure(hr, "Tried to open wrong database type - expected type %ls, found type %ls", wzExpectedSchemaType, sczSchemaType); @@ -2306,8 +2306,8 @@ static HRESULT SetSessionProperties( rgdbpDataSourceProp[0].dwPropertyID = DBPROP_SSCE_TRANSACTION_COMMIT_MODE; rgdbpDataSourceProp[0].dwOptions = DBPROPOPTIONS_REQUIRED; rgdbpDataSourceProp[0].vValue.vt = VT_I4; - rgdbpDataSourceProp[0].vValue.lVal = DBPROPVAL_SSCE_TCM_FLUSH; - + rgdbpDataSourceProp[0].vValue.lVal = DBPROPVAL_SSCE_TCM_FLUSH; + rgdbpDataSourcePropSet[0].guidPropertySet = DBPROPSET_SSCE_SESSION; rgdbpDataSourcePropSet[0].rgProperties = rgdbpDataSourceProp; rgdbpDataSourcePropSet[0].cProperties = 1; diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index 36b187a7..a7a7e45b 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp @@ -1145,7 +1145,7 @@ DAPI_(void) ThemeGetPageIds( for (DWORD j = 0; j < pTheme->cPages; ++j) { LPCWSTR wzPageName = pTheme->rgPages[j].sczName; - if (wzPageName && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPageName, -1, wzFindName, -1)) + if (wzPageName && CSTR_EQUAL == ::CompareStringOrdinal(wzPageName, -1, wzFindName, -1, FALSE)) { rgdwPageIds[i] = j + 1; // add one to make the page ids 1-based (so zero is invalid). break; @@ -2082,7 +2082,7 @@ static HRESULT ParseButtonImages( ThmExitOnFailure(hr, "Null element encountered!"); } - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ButtonFocusImage", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ButtonFocusImage", -1, FALSE)) { if (pFocusImageRef) { @@ -2091,7 +2091,7 @@ static HRESULT ParseButtonImages( pImageRef = pFocusImageRef = pControl->Button.rgImageRef + 3; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ButtonHoverImage", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ButtonHoverImage", -1, FALSE)) { if (pHoverImageRef) { @@ -2100,7 +2100,7 @@ static HRESULT ParseButtonImages( pImageRef = pHoverImageRef = pControl->Button.rgImageRef + 1; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ButtonSelectedImage", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ButtonSelectedImage", -1, FALSE)) { if (pSelectedImageRef) { @@ -2776,35 +2776,35 @@ static HRESULT GetFontColor( if (pdwSystemColor) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"btnface", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"btnface", -1, FALSE)) { *pdwSystemColor = COLOR_BTNFACE; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"btntext", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"btntext", -1, FALSE)) { *pdwSystemColor = COLOR_BTNTEXT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"graytext", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"graytext", -1, FALSE)) { *pdwSystemColor = COLOR_GRAYTEXT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"highlight", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"highlight", -1, FALSE)) { *pdwSystemColor = COLOR_HIGHLIGHT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"highlighttext", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"highlighttext", -1, FALSE)) { *pdwSystemColor = COLOR_HIGHLIGHTTEXT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"hotlight", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"hotlight", -1, FALSE)) { *pdwSystemColor = COLOR_HOTLIGHT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"window", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"window", -1, FALSE)) { *pdwSystemColor = COLOR_WINDOW; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstr, -1, L"windowtext", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstr, -1, L"windowtext", -1, FALSE)) { *pdwSystemColor = COLOR_WINDOWTEXT; } @@ -3229,71 +3229,71 @@ static HRESULT ParseControls( ThmExitOnFailure(hr, "Null element encountered!"); } - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Billboard", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Billboard", -1, FALSE)) { type = THEME_CONTROL_TYPE_BILLBOARD; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Button", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Button", -1, FALSE)) { type = THEME_CONTROL_TYPE_BUTTON; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Checkbox", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Checkbox", -1, FALSE)) { type = THEME_CONTROL_TYPE_CHECKBOX; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Combobox", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Combobox", -1, FALSE)) { type = THEME_CONTROL_TYPE_COMBOBOX; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"CommandLink", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"CommandLink", -1, FALSE)) { type = THEME_CONTROL_TYPE_COMMANDLINK; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Editbox", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Editbox", -1, FALSE)) { type = THEME_CONTROL_TYPE_EDITBOX; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Hyperlink", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Hyperlink", -1, FALSE)) { type = THEME_CONTROL_TYPE_HYPERLINK; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Hypertext", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Hypertext", -1, FALSE)) { type = THEME_CONTROL_TYPE_HYPERTEXT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ImageControl", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ImageControl", -1, FALSE)) { type = THEME_CONTROL_TYPE_IMAGE; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Label", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Label", -1, FALSE)) { type = THEME_CONTROL_TYPE_LABEL; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ListView", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ListView", -1, FALSE)) { type = THEME_CONTROL_TYPE_LISTVIEW; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Panel", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Panel", -1, FALSE)) { type = THEME_CONTROL_TYPE_PANEL; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Progressbar", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Progressbar", -1, FALSE)) { type = THEME_CONTROL_TYPE_PROGRESSBAR; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Richedit", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Richedit", -1, FALSE)) { type = THEME_CONTROL_TYPE_RICHEDIT; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Static", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Static", -1, FALSE)) { type = THEME_CONTROL_TYPE_STATIC; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"Tabs", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"Tabs", -1, FALSE)) { type = THEME_CONTROL_TYPE_TAB; } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"TreeView", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"TreeView", -1, FALSE)) { type = THEME_CONTROL_TYPE_TREEVIEW; } @@ -3705,14 +3705,14 @@ static HRESULT ParseActions( THEME_ACTION* pAction = pControl->rgActions + i; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"BrowseDirectoryAction", -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"BrowseDirectoryAction", -1, FALSE)) { pAction->type = THEME_ACTION_TYPE_BROWSE_DIRECTORY; hr = XmlGetAttributeEx(pixnChild, L"VariableName", &pAction->BrowseDirectory.sczVariableName); ThmExitOnFailure(hr, "Failed when querying BrowseDirectoryAction/@VariableName attribute."); } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"ChangePageAction", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"ChangePageAction", -1, FALSE)) { pAction->type = THEME_ACTION_TYPE_CHANGE_PAGE; @@ -3725,7 +3725,7 @@ static HRESULT ParseActions( ThmExitOnFailure(hr, "Failed when querying ChangePageAction/@Cancel attribute."); } } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrType, -1, L"CloseWindowAction", -1)) + else if (CSTR_EQUAL == ::CompareStringOrdinal(bstrType, -1, L"CloseWindowAction", -1, FALSE)) { pAction->type = THEME_ACTION_TYPE_CLOSE_WINDOW; } @@ -4367,7 +4367,7 @@ static HRESULT FindImageList( for (DWORD i = 0; i < pTheme->cImageLists; ++i) { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pTheme->rgImageLists[i].sczName, -1, wzImageListName, -1)) + if (CSTR_EQUAL == ::CompareStringOrdinal(pTheme->rgImageLists[i].sczName, -1, wzImageListName, -1, FALSE)) { *phImageList = pTheme->rgImageLists[i].hImageList; ExitFunction1(hr = S_OK); @@ -5027,7 +5027,7 @@ static void OnBrowseDirectory( THEME_CONTROL* pControl = pTheme->rgControls + i; if ((!pControl->wPageId || pControl->wPageId == pTheme->dwCurrentPageId) && - CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pControl->sczName, -1, pAction->BrowseDirectory.sczVariableName, -1)) + CSTR_EQUAL == ::CompareStringOrdinal(pControl->sczName, -1, pAction->BrowseDirectory.sczVariableName, -1, FALSE)) { pTargetControl = pControl; break; @@ -5790,7 +5790,7 @@ static HRESULT ShowControl( hr = S_OK; - Button_SetCheck(hWnd, (!sczText && !pControl->sczValue) || (sczText && CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczText, -1, pControl->sczValue, -1))); + Button_SetCheck(hWnd, (!sczText && !pControl->sczValue) || (sczText && CSTR_EQUAL == ::CompareStringOrdinal(sczText, -1, pControl->sczValue, -1, FALSE))); } } diff --git a/src/libs/dutil/WixToolset.DUtil/xmlutil.cpp b/src/libs/dutil/WixToolset.DUtil/xmlutil.cpp index 2e1a2200..c4273c2e 100644 --- a/src/libs/dutil/WixToolset.DUtil/xmlutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/xmlutil.cpp @@ -98,7 +98,7 @@ extern "C" void DAPI XmlUninitialize( { ::CoUninitialize(); } - } + } } extern "C" HRESULT DAPI XmlCreateElement( @@ -738,7 +738,7 @@ HRESULT DAPI XmlGetYesNoAttribute( { XmlExitOnFailure(hr, "Failed to get attribute."); - *pfYes = CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczValue, -1, L"yes", -1); + *pfYes = CSTR_EQUAL == ::CompareStringOrdinal(sczValue, -1, L"yes", -1, FALSE); } LExit: -- cgit v1.2.3-55-g6feb