aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/be/utilsearch.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-10-06 16:37:14 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-10-10 11:40:02 -0500
commit21a0685ef69e9d634600622b19ea970c6f58ef03 (patch)
tree5d37e316803f06d97d4aefd3df8ab45f3f7e7257 /src/ext/Util/be/utilsearch.cpp
parent3c11c1389f67824fb1f368cedacbaf566645e56f (diff)
downloadwix-21a0685ef69e9d634600622b19ea970c6f58ef03.tar.gz
wix-21a0685ef69e9d634600622b19ea970c6f58ef03.tar.bz2
wix-21a0685ef69e9d634600622b19ea970c6f58ef03.zip
Add Netfx bundle extension and netfx:DotNetCoreSearch.
Remove built-in .NET Core packages since they update too quickly. Fixes 6257
Diffstat (limited to 'src/ext/Util/be/utilsearch.cpp')
-rw-r--r--src/ext/Util/be/utilsearch.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ext/Util/be/utilsearch.cpp b/src/ext/Util/be/utilsearch.cpp
index 7cd2ea09..20a514d8 100644
--- a/src/ext/Util/be/utilsearch.cpp
+++ b/src/ext/Util/be/utilsearch.cpp
@@ -17,11 +17,11 @@ STDMETHODIMP UtilSearchParseFromXml(
17 17
18 // Select Util search nodes. 18 // Select Util search nodes.
19 hr = XmlSelectNodes(pixnBundleExtension, L"WixWindowsFeatureSearch", &pixnNodes); 19 hr = XmlSelectNodes(pixnBundleExtension, L"WixWindowsFeatureSearch", &pixnNodes);
20 ExitOnFailure(hr, "Failed to select Util search nodes."); 20 BextExitOnFailure(hr, "Failed to select Util search nodes.");
21 21
22 // Get Util search node count. 22 // Get Util search node count.
23 hr = pixnNodes->get_length((long*)&cNodes); 23 hr = pixnNodes->get_length((long*)&cNodes);
24 ExitOnFailure(hr, "Failed to get Util search node count."); 24 BextExitOnFailure(hr, "Failed to get Util search node count.");
25 25
26 if (!cNodes) 26 if (!cNodes)
27 { 27 {
@@ -30,7 +30,7 @@ STDMETHODIMP UtilSearchParseFromXml(
30 30
31 // Allocate memory for searches. 31 // Allocate memory for searches.
32 pSearches->rgSearches = (UTIL_SEARCH*)MemAlloc(sizeof(UTIL_SEARCH) * cNodes, TRUE); 32 pSearches->rgSearches = (UTIL_SEARCH*)MemAlloc(sizeof(UTIL_SEARCH) * cNodes, TRUE);
33 ExitOnNull(pSearches->rgSearches, hr, E_OUTOFMEMORY, "Failed to allocate memory for search structs."); 33 BextExitOnNull(pSearches->rgSearches, hr, E_OUTOFMEMORY, "Failed to allocate memory for search structs.");
34 34
35 pSearches->cSearches = cNodes; 35 pSearches->cSearches = cNodes;
36 36
@@ -40,11 +40,11 @@ STDMETHODIMP UtilSearchParseFromXml(
40 UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; 40 UTIL_SEARCH* pSearch = &pSearches->rgSearches[i];
41 41
42 hr = XmlNextElement(pixnNodes, &pixnNode, &bstrNodeName); 42 hr = XmlNextElement(pixnNodes, &pixnNode, &bstrNodeName);
43 ExitOnFailure(hr, "Failed to get next node."); 43 BextExitOnFailure(hr, "Failed to get next node.");
44 44
45 // @Id 45 // @Id
46 hr = XmlGetAttributeEx(pixnNode, L"Id", &pSearch->sczId); 46 hr = XmlGetAttributeEx(pixnNode, L"Id", &pSearch->sczId);
47 ExitOnFailure(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 == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"WixWindowsFeatureSearch", -1))
@@ -53,7 +53,7 @@ STDMETHODIMP UtilSearchParseFromXml(
53 53
54 // @Type 54 // @Type
55 hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); 55 hr = XmlGetAttributeEx(pixnNode, L"Type", &scz);
56 ExitOnFailure(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 == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"sha2CodeSigning", -1))
59 { 59 {
@@ -61,14 +61,12 @@ STDMETHODIMP UtilSearchParseFromXml(
61 } 61 }
62 else 62 else
63 { 63 {
64 hr = E_INVALIDARG; 64 BextExitWithRootFailure(hr, E_INVALIDARG, "Invalid value for @Type: %ls", scz);
65 ExitOnFailure(hr, "Invalid value for @Type: %ls", scz);
66 } 65 }
67 } 66 }
68 else 67 else
69 { 68 {
70 hr = E_UNEXPECTED; 69 BextExitWithRootFailure(hr, E_UNEXPECTED, "Unexpected element name: %ls", bstrNodeName);
71 ExitOnFailure(hr, "Unexpected element name: %ls", bstrNodeName);
72 } 70 }
73 71
74 // prepare next iteration 72 // prepare next iteration
@@ -112,7 +110,7 @@ STDMETHODIMP UtilSearchExecute(
112 UTIL_SEARCH* pSearch = NULL; 110 UTIL_SEARCH* pSearch = NULL;
113 111
114 hr = UtilSearchFindById(pSearches, wzSearchId, &pSearch); 112 hr = UtilSearchFindById(pSearches, wzSearchId, &pSearch);
115 ExitOnFailure(hr, "Search id '%ls' is unknown to the util extension."); 113 BextExitOnFailure(hr, "Search id '%ls' is unknown to the util extension.", wzSearchId);
116 114
117 switch (pSearch->Type) 115 switch (pSearch->Type)
118 { 116 {