aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-05-13 13:49:57 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-05-14 11:12:31 -0500
commit7d56566b7c51c49ded526466dfae6af9e1709040 (patch)
treebda62f4cdd8c7318542d8f0ed20901cb41e1a271 /src/api
parent031991f32f059b64374e6d257cbe573304dd577f (diff)
downloadwix-7d56566b7c51c49ded526466dfae6af9e1709040.tar.gz
wix-7d56566b7c51c49ded526466dfae6af9e1709040.tar.bz2
wix-7d56566b7c51c49ded526466dfae6af9e1709040.zip
Update balutil and Bal.wixext to use more concise Exit* macros.
Diffstat (limited to 'src/api')
-rw-r--r--src/api/burn/balutil/balcondition.cpp4
-rw-r--r--src/api/burn/balutil/balinfo.cpp105
-rw-r--r--src/api/burn/balutil/inc/balutil.h4
-rw-r--r--src/api/burn/bextutil/bextutil.cpp2
-rw-r--r--src/api/burn/bextutil/inc/bextutil.h4
5 files changed, 41 insertions, 78 deletions
diff --git a/src/api/burn/balutil/balcondition.cpp b/src/api/burn/balutil/balcondition.cpp
index 8b05508f..00a46e05 100644
--- a/src/api/burn/balutil/balcondition.cpp
+++ b/src/api/burn/balutil/balcondition.cpp
@@ -35,10 +35,10 @@ DAPI_(HRESULT) BalConditionsParseFromXml(
35 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL))) 35 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
36 { 36 {
37 hr = XmlGetAttributeEx(pNode, L"Condition", &prgConditions[iCondition].sczCondition); 37 hr = XmlGetAttributeEx(pNode, L"Condition", &prgConditions[iCondition].sczCondition);
38 ExitOnFailure(hr, "Failed to get condition for condition."); 38 ExitOnRequiredXmlQueryFailure(hr, "Failed to get condition for condition.");
39 39
40 hr = XmlGetAttributeEx(pNode, L"Message", &prgConditions[iCondition].sczMessage); 40 hr = XmlGetAttributeEx(pNode, L"Message", &prgConditions[iCondition].sczMessage);
41 ExitOnFailure(hr, "Failed to get message for condition."); 41 ExitOnRequiredXmlQueryFailure(hr, "Failed to get message for condition.");
42 42
43 if (pWixLoc && prgConditions[iCondition].sczMessage && *prgConditions[iCondition].sczMessage) 43 if (pWixLoc && prgConditions[iCondition].sczMessage && *prgConditions[iCondition].sczMessage)
44 { 44 {
diff --git a/src/api/burn/balutil/balinfo.cpp b/src/api/burn/balutil/balinfo.cpp
index 29e453f6..5832281f 100644
--- a/src/api/burn/balutil/balinfo.cpp
+++ b/src/api/burn/balutil/balinfo.cpp
@@ -123,29 +123,21 @@ DAPI_(HRESULT) BalInfoParseFromXml(
123{ 123{
124 HRESULT hr = S_OK; 124 HRESULT hr = S_OK;
125 IXMLDOMNode* pNode = NULL; 125 IXMLDOMNode* pNode = NULL;
126 BOOL fXmlFound = FALSE;
126 127
127 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBundleProperties", &pNode); 128 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBundleProperties", &pNode);
128 ExitOnFailure(hr, "Failed to select bundle information."); 129 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to select bundle information.");
129 130
130 if (S_OK == hr) 131 if (fXmlFound)
131 { 132 {
132 hr = XmlGetYesNoAttribute(pNode, L"PerMachine", &pBundle->fPerMachine); 133 hr = XmlGetYesNoAttribute(pNode, L"PerMachine", &pBundle->fPerMachine);
133 if (E_NOTFOUND != hr) 134 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information per-machine.");
134 {
135 ExitOnFailure(hr, "Failed to read bundle information per-machine.");
136 }
137 135
138 hr = XmlGetAttributeEx(pNode, L"DisplayName", &pBundle->sczName); 136 hr = XmlGetAttributeEx(pNode, L"DisplayName", &pBundle->sczName);
139 if (E_NOTFOUND != hr) 137 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information display name.");
140 {
141 ExitOnFailure(hr, "Failed to read bundle information display name.");
142 }
143 138
144 hr = XmlGetAttributeEx(pNode, L"LogPathVariable", &pBundle->sczLogVariable); 139 hr = XmlGetAttributeEx(pNode, L"LogPathVariable", &pBundle->sczLogVariable);
145 if (E_NOTFOUND != hr) 140 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information log path variable.");
146 {
147 ExitOnFailure(hr, "Failed to read bundle information log path variable.");
148 }
149 } 141 }
150 142
151 hr = ParseOverridableVariablesFromXml(&pBundle->overridableVariables, pixdManifest); 143 hr = ParseOverridableVariablesFromXml(&pBundle->overridableVariables, pixdManifest);
@@ -192,7 +184,7 @@ DAPI_(HRESULT) BalInfoAddRelatedBundleAsPackage(
192 break; 184 break;
193 185
194 default: 186 default:
195 ExitOnFailure(hr = E_INVALIDARG, "Unknown related bundle type: %u", relationType); 187 ExitWithRootFailure(hr, E_INVALIDARG, "Unknown related bundle type: %u", relationType);
196 } 188 }
197 189
198 // Check to see if the bundle is already in the list of packages. 190 // Check to see if the bundle is already in the list of packages.
@@ -403,6 +395,7 @@ static HRESULT ParsePackagesFromXml(
403 BAL_INFO_PACKAGE* prgPackages = NULL; 395 BAL_INFO_PACKAGE* prgPackages = NULL;
404 DWORD cPackages = 0; 396 DWORD cPackages = 0;
405 LPWSTR scz = NULL; 397 LPWSTR scz = NULL;
398 BOOL fXmlFound = FALSE;
406 399
407 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixPackageProperties", &pNodeList); 400 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixPackageProperties", &pNodeList);
408 ExitOnFailure(hr, "Failed to select all packages."); 401 ExitOnFailure(hr, "Failed to select all packages.");
@@ -417,22 +410,16 @@ static HRESULT ParsePackagesFromXml(
417 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL))) 410 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
418 { 411 {
419 hr = XmlGetAttributeEx(pNode, L"Package", &prgPackages[iPackage].sczId); 412 hr = XmlGetAttributeEx(pNode, L"Package", &prgPackages[iPackage].sczId);
420 ExitOnFailure(hr, "Failed to get package identifier for package."); 413 ExitOnRequiredXmlQueryFailure(hr, "Failed to get package identifier for package.");
421 414
422 hr = XmlGetAttributeEx(pNode, L"DisplayName", &prgPackages[iPackage].sczDisplayName); 415 hr = XmlGetAttributeEx(pNode, L"DisplayName", &prgPackages[iPackage].sczDisplayName);
423 if (E_NOTFOUND != hr) 416 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get display name for package.");
424 {
425 ExitOnFailure(hr, "Failed to get display name for package.");
426 }
427 417
428 hr = XmlGetAttributeEx(pNode, L"Description", &prgPackages[iPackage].sczDescription); 418 hr = XmlGetAttributeEx(pNode, L"Description", &prgPackages[iPackage].sczDescription);
429 if (E_NOTFOUND != hr) 419 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get description for package.");
430 {
431 ExitOnFailure(hr, "Failed to get description for package.");
432 }
433 420
434 hr = XmlGetAttributeEx(pNode, L"PackageType", &scz); 421 hr = XmlGetAttributeEx(pNode, L"PackageType", &scz);
435 ExitOnFailure(hr, "Failed to get package type for package."); 422 ExitOnRequiredXmlQueryFailure(hr, "Failed to get package type for package.");
436 423
437 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Bundle", -1, scz, -1)) 424 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Bundle", -1, scz, -1))
438 { 425 {
@@ -456,43 +443,28 @@ static HRESULT ParsePackagesFromXml(
456 } 443 }
457 444
458 hr = XmlGetYesNoAttribute(pNode, L"Permanent", &prgPackages[iPackage].fPermanent); 445 hr = XmlGetYesNoAttribute(pNode, L"Permanent", &prgPackages[iPackage].fPermanent);
459 ExitOnFailure(hr, "Failed to get permanent setting for package."); 446 ExitOnRequiredXmlQueryFailure(hr, "Failed to get permanent setting for package.");
460 447
461 hr = XmlGetYesNoAttribute(pNode, L"Vital", &prgPackages[iPackage].fVital); 448 hr = XmlGetYesNoAttribute(pNode, L"Vital", &prgPackages[iPackage].fVital);
462 ExitOnFailure(hr, "Failed to get vital setting for package."); 449 ExitOnRequiredXmlQueryFailure(hr, "Failed to get vital setting for package.");
463 450
464 hr = XmlGetAttributeEx(pNode, L"ProductCode", &prgPackages[iPackage].sczProductCode); 451 hr = XmlGetAttributeEx(pNode, L"ProductCode", &prgPackages[iPackage].sczProductCode);
465 if (E_NOTFOUND != hr) 452 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get product code for package.");
466 {
467 ExitOnFailure(hr, "Failed to get product code for package.");
468 }
469 453
470 hr = XmlGetAttributeEx(pNode, L"UpgradeCode", &prgPackages[iPackage].sczUpgradeCode); 454 hr = XmlGetAttributeEx(pNode, L"UpgradeCode", &prgPackages[iPackage].sczUpgradeCode);
471 if (E_NOTFOUND != hr) 455 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get upgrade code for package.");
472 {
473 ExitOnFailure(hr, "Failed to get upgrade code for package.");
474 }
475 456
476 hr = XmlGetAttributeEx(pNode, L"Version", &prgPackages[iPackage].sczVersion); 457 hr = XmlGetAttributeEx(pNode, L"Version", &prgPackages[iPackage].sczVersion);
477 if (E_NOTFOUND != hr) 458 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get version for package.");
478 {
479 ExitOnFailure(hr, "Failed to get version for package.");
480 }
481 459
482 hr = XmlGetAttributeEx(pNode, L"InstallCondition", &prgPackages[iPackage].sczInstallCondition); 460 hr = XmlGetAttributeEx(pNode, L"InstallCondition", &prgPackages[iPackage].sczInstallCondition);
483 if (E_NOTFOUND != hr) 461 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get install condition for package.");
484 {
485 ExitOnFailure(hr, "Failed to get install condition for package.");
486 }
487 462
488 hr = XmlGetAttributeEx(pNode, L"RepairCondition", &prgPackages[iPackage].sczRepairCondition); 463 hr = XmlGetAttributeEx(pNode, L"RepairCondition", &prgPackages[iPackage].sczRepairCondition);
489 if (E_NOTFOUND != hr) 464 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get repair condition for package.");
490 {
491 ExitOnFailure(hr, "Failed to get repair condition for package.");
492 }
493 465
494 hr = XmlGetAttributeEx(pNode, L"Cache", &scz); 466 hr = XmlGetAttributeEx(pNode, L"Cache", &scz);
495 ExitOnFailure(hr, "Failed to get cache type for package."); 467 ExitOnRequiredXmlQueryFailure(hr, "Failed to get cache type for package.");
496 468
497 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, scz, -1, L"remove", -1)) 469 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, scz, -1, L"remove", -1))
498 { 470 {
@@ -541,6 +513,7 @@ static HRESULT ParseBalPackageInfoFromXml(
541 IXMLDOMNode* pNode = NULL; 513 IXMLDOMNode* pNode = NULL;
542 LPWSTR scz = NULL; 514 LPWSTR scz = NULL;
543 BAL_INFO_PACKAGE* pPackage = NULL; 515 BAL_INFO_PACKAGE* pPackage = NULL;
516 BOOL fXmlFound = FALSE;
544 517
545 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixBalPackageInfo", &pNodeList); 518 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixBalPackageInfo", &pNodeList);
546 ExitOnFailure(hr, "Failed to select all packages."); 519 ExitOnFailure(hr, "Failed to select all packages.");
@@ -548,16 +521,13 @@ static HRESULT ParseBalPackageInfoFromXml(
548 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL))) 521 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
549 { 522 {
550 hr = XmlGetAttributeEx(pNode, L"PackageId", &scz); 523 hr = XmlGetAttributeEx(pNode, L"PackageId", &scz);
551 ExitOnFailure(hr, "Failed to get package identifier for WixBalPackageInfo."); 524 ExitOnRequiredXmlQueryFailure(hr, "Failed to get package identifier for WixBalPackageInfo.");
552 525
553 hr = BalInfoFindPackageById(pPackages, scz, &pPackage); 526 hr = BalInfoFindPackageById(pPackages, scz, &pPackage);
554 ExitOnFailure(hr, "Failed to find package specified in WixBalPackageInfo: %ls", scz); 527 ExitOnFailure(hr, "Failed to find package specified in WixBalPackageInfo: %ls", scz);
555 528
556 hr = XmlGetAttributeEx(pNode, L"DisplayInternalUICondition", &pPackage->sczDisplayInternalUICondition); 529 hr = XmlGetAttributeEx(pNode, L"DisplayInternalUICondition", &pPackage->sczDisplayInternalUICondition);
557 if (E_NOTFOUND != hr) 530 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get DisplayInternalUICondition setting for package.");
558 {
559 ExitOnFailure(hr, "Failed to get DisplayInternalUICondition setting for package.");
560 }
561 531
562 ReleaseNullObject(pNode); 532 ReleaseNullObject(pNode);
563 } 533 }
@@ -569,7 +539,7 @@ static HRESULT ParseBalPackageInfoFromXml(
569 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL))) 539 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
570 { 540 {
571 hr = XmlGetAttributeEx(pNode, L"PackageId", &scz); 541 hr = XmlGetAttributeEx(pNode, L"PackageId", &scz);
572 ExitOnFailure(hr, "Failed to get package identifier for WixMbaPrereqInformation."); 542 ExitOnRequiredXmlQueryFailure(hr, "Failed to get package identifier for WixMbaPrereqInformation.");
573 543
574 hr = BalInfoFindPackageById(pPackages, scz, &pPackage); 544 hr = BalInfoFindPackageById(pPackages, scz, &pPackage);
575 ExitOnFailure(hr, "Failed to find package specified in WixMbaPrereqInformation: %ls", scz); 545 ExitOnFailure(hr, "Failed to find package specified in WixMbaPrereqInformation: %ls", scz);
@@ -577,16 +547,10 @@ static HRESULT ParseBalPackageInfoFromXml(
577 pPackage->fPrereqPackage = TRUE; 547 pPackage->fPrereqPackage = TRUE;
578 548
579 hr = XmlGetAttributeEx(pNode, L"LicenseFile", &pPackage->sczPrereqLicenseFile); 549 hr = XmlGetAttributeEx(pNode, L"LicenseFile", &pPackage->sczPrereqLicenseFile);
580 if (E_NOTFOUND != hr) 550 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get LicenseFile setting for prereq package.");
581 {
582 ExitOnFailure(hr, "Failed to get LicenseFile setting for prereq package.");
583 }
584 551
585 hr = XmlGetAttributeEx(pNode, L"LicenseUrl", &pPackage->sczPrereqLicenseUrl); 552 hr = XmlGetAttributeEx(pNode, L"LicenseUrl", &pPackage->sczPrereqLicenseUrl);
586 if (E_NOTFOUND != hr) 553 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get LicenseUrl setting for prereq package.");
587 {
588 ExitOnFailure(hr, "Failed to get LicenseUrl setting for prereq package.");
589 }
590 554
591 ReleaseNullObject(pNode); 555 ReleaseNullObject(pNode);
592 } 556 }
@@ -619,15 +583,11 @@ static HRESULT ParseOverridableVariablesFromXml(
619 BAL_INFO_OVERRIDABLE_VARIABLE* pOverridableVariable = NULL; 583 BAL_INFO_OVERRIDABLE_VARIABLE* pOverridableVariable = NULL;
620 584
621 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/CommandLine", &pCommandLineNode); 585 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/CommandLine", &pCommandLineNode);
622 if (S_FALSE == hr) 586 ExitOnRequiredXmlQueryFailure(hr, "Failed to select command line information.");
623 {
624 hr = E_NOTFOUND;
625 }
626 ExitOnFailure(hr, "Failed to select command line information.");
627 587
628 // @Variables 588 // @Variables
629 hr = XmlGetAttributeEx(pCommandLineNode, L"Variables", &scz); 589 hr = XmlGetAttributeEx(pCommandLineNode, L"Variables", &scz);
630 ExitOnFailure(hr, "Failed to get command line variable type."); 590 ExitOnRequiredXmlQueryFailure(hr, "Failed to get command line variable type.");
631 591
632 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"upperCase", -1)) 592 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"upperCase", -1))
633 { 593 {
@@ -639,16 +599,11 @@ static HRESULT ParseOverridableVariablesFromXml(
639 } 599 }
640 else 600 else
641 { 601 {
642 hr = E_INVALIDARG; 602 ExitWithRootFailure(hr, E_INVALIDARG, "Invalid value for CommandLine/@Variables: %ls", scz);
643 ExitOnFailure(hr, "Invalid value for CommandLine/@Variables: %ls", scz);
644 } 603 }
645 604
646 // Get the list of variables users can override on the command line. 605 // Get the list of variables users can override on the command line.
647 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOverridableVariable", &pNodes); 606 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOverridableVariable", &pNodes);
648 if (S_FALSE == hr)
649 {
650 ExitFunction1(hr = S_OK);
651 }
652 ExitOnFailure(hr, "Failed to select overridable variable nodes."); 607 ExitOnFailure(hr, "Failed to select overridable variable nodes.");
653 608
654 hr = pNodes->get_length(reinterpret_cast<long*>(&pOverridableVariables->cVariables)); 609 hr = pNodes->get_length(reinterpret_cast<long*>(&pOverridableVariables->cVariables));
@@ -671,7 +626,7 @@ static HRESULT ParseOverridableVariablesFromXml(
671 626
672 // @Name 627 // @Name
673 hr = XmlGetAttributeEx(pNode, L"Name", &pOverridableVariable->sczName); 628 hr = XmlGetAttributeEx(pNode, L"Name", &pOverridableVariable->sczName);
674 ExitOnFailure(hr, "Failed to get name for overridable variable."); 629 ExitOnRequiredXmlQueryFailure(hr, "Failed to get name for overridable variable.");
675 630
676 hr = DictAddValue(pOverridableVariables->sdVariables, pOverridableVariable); 631 hr = DictAddValue(pOverridableVariables->sdVariables, pOverridableVariable);
677 ExitOnFailure(hr, "Failed to add \"%ls\" to the string dictionary.", pOverridableVariable->sczName); 632 ExitOnFailure(hr, "Failed to add \"%ls\" to the string dictionary.", pOverridableVariable->sczName);
diff --git a/src/api/burn/balutil/inc/balutil.h b/src/api/burn/balutil/inc/balutil.h
index 0c47301a..2e370db7 100644
--- a/src/api/burn/balutil/inc/balutil.h
+++ b/src/api/burn/balutil/inc/balutil.h
@@ -16,6 +16,8 @@ extern "C" {
16#define BalExitOnNullSource(d, p, x, e, f, ...) if (NULL == p) { x = e; BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 16#define BalExitOnNullSource(d, p, x, e, f, ...) if (NULL == p) { x = e; BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
17#define BalExitOnNullWithLastErrorSource(d, p, x, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 17#define BalExitOnNullWithLastErrorSource(d, p, x, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
18#define BalExitWithLastErrorSource(d, x, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 18#define BalExitWithLastErrorSource(d, x, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
19#define BalExitOnOptionalXmlQueryFailureSource(d, x, b, f, ...) { { if (S_FALSE == x || E_NOTFOUND == x) { b = FALSE; x = S_OK; } else { b = SUCCEEDED(x); } }; BalExitOnRootFailureSource(d, x, f, __VA_ARGS__); }
20#define BalExitOnRequiredXmlQueryFailureSource(d, x, f, ...) { if (S_FALSE == x) { x = E_NOTFOUND; } BalExitOnRootFailureSource(d, x, f, __VA_ARGS__); }
19 21
20#define BalExitOnFailure(x, f, ...) BalExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 22#define BalExitOnFailure(x, f, ...) BalExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
21#define BalExitOnRootFailure(x, f, ...) BalExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 23#define BalExitOnRootFailure(x, f, ...) BalExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
@@ -24,6 +26,8 @@ extern "C" {
24#define BalExitOnNull(p, x, e, f, ...) BalExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, f, __VA_ARGS__) 26#define BalExitOnNull(p, x, e, f, ...) BalExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, f, __VA_ARGS__)
25#define BalExitOnNullWithLastError(p, x, f, ...) BalExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, f, __VA_ARGS__) 27#define BalExitOnNullWithLastError(p, x, f, ...) BalExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, f, __VA_ARGS__)
26#define BalExitWithLastError(x, f, ...) BalExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 28#define BalExitWithLastError(x, f, ...) BalExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
29#define BalExitOnOptionalXmlQueryFailure(x, b, f, ...) BalExitOnOptionalXmlQueryFailureSource(DUTIL_SOURCE_DEFAULT, x, b, f, __VA_ARGS__)
30#define BalExitOnRequiredXmlQueryFailure(x, f, ...) BalExitOnRequiredXmlQueryFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
27 31
28#ifndef FACILITY_WIX 32#ifndef FACILITY_WIX
29#define FACILITY_WIX 500 33#define FACILITY_WIX 500
diff --git a/src/api/burn/bextutil/bextutil.cpp b/src/api/burn/bextutil/bextutil.cpp
index 4b22d502..b2e689c3 100644
--- a/src/api/burn/bextutil/bextutil.cpp
+++ b/src/api/burn/bextutil/bextutil.cpp
@@ -85,7 +85,7 @@ DAPI_(HRESULT) BextGetBundleExtensionDataNode(
85 85
86 // @Id 86 // @Id
87 hr = XmlGetAttributeEx(pixnNode, L"Id", &sczId); 87 hr = XmlGetAttributeEx(pixnNode, L"Id", &sczId);
88 ExitOnFailure(hr, "Failed to get @Id."); 88 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Id.");
89 89
90 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczId, -1, wzExtensionId, -1)) 90 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczId, -1, wzExtensionId, -1))
91 { 91 {
diff --git a/src/api/burn/bextutil/inc/bextutil.h b/src/api/burn/bextutil/inc/bextutil.h
index facaf2e8..e3edff01 100644
--- a/src/api/burn/bextutil/inc/bextutil.h
+++ b/src/api/burn/bextutil/inc/bextutil.h
@@ -16,6 +16,8 @@ extern "C" {
16#define BextExitOnNullSource(d, p, x, e, f, ...) if (NULL == p) { x = e; BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 16#define BextExitOnNullSource(d, p, x, e, f, ...) if (NULL == p) { x = e; BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
17#define BextExitOnNullWithLastErrorSource(d, p, x, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 17#define BextExitOnNullWithLastErrorSource(d, p, x, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
18#define BextExitWithLastErrorSource(d, x, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } 18#define BextExitWithLastErrorSource(d, x, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
19#define BextExitOnOptionalXmlQueryFailureSource(d, x, b, f, ...) { { if (S_FALSE == x || E_NOTFOUND == x) { b = FALSE; x = S_OK; } else { b = SUCCEEDED(x); } }; BextExitOnRootFailureSource(d, x, f, __VA_ARGS__); }
20#define BextExitOnRequiredXmlQueryFailureSource(d, x, f, ...) { if (S_FALSE == x) { x = E_NOTFOUND; } BextExitOnRootFailureSource(d, x, f, __VA_ARGS__); }
19 21
20#define BextExitOnFailure(x, f, ...) BextExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 22#define BextExitOnFailure(x, f, ...) BextExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
21#define BextExitOnRootFailure(x, f, ...) BextExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 23#define BextExitOnRootFailure(x, f, ...) BextExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
@@ -24,6 +26,8 @@ extern "C" {
24#define BextExitOnNull(p, x, e, f, ...) BextExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, f, __VA_ARGS__) 26#define BextExitOnNull(p, x, e, f, ...) BextExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, f, __VA_ARGS__)
25#define BextExitOnNullWithLastError(p, x, f, ...) BextExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, f, __VA_ARGS__) 27#define BextExitOnNullWithLastError(p, x, f, ...) BextExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, f, __VA_ARGS__)
26#define BextExitWithLastError(x, f, ...) BextExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__) 28#define BextExitWithLastError(x, f, ...) BextExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
29#define BextExitOnOptionalXmlQueryFailure(x, b, f, ...) BextExitOnOptionalXmlQueryFailureSource(DUTIL_SOURCE_DEFAULT, x, b, f, __VA_ARGS__)
30#define BextExitOnRequiredXmlQueryFailure(x, f, ...) BextExitOnRequiredXmlQueryFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
27 31
28const LPCWSTR BUNDLE_EXTENSION_MANIFEST_FILENAME = L"BundleExtensionData.xml"; 32const LPCWSTR BUNDLE_EXTENSION_MANIFEST_FILENAME = L"BundleExtensionData.xml";
29 33