diff options
Diffstat (limited to 'src/ext/Util/ca')
-rw-r--r-- | src/ext/Util/ca/scagroup.cpp | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/src/ext/Util/ca/scagroup.cpp b/src/ext/Util/ca/scagroup.cpp index 3d2c3beb..699d9db7 100644 --- a/src/ext/Util/ca/scagroup.cpp +++ b/src/ext/Util/ca/scagroup.cpp | |||
@@ -553,7 +553,14 @@ HRESULT ScaGroupExecute( | |||
553 | // | 553 | // |
554 | // Schedule the creation now. | 554 | // Schedule the creation now. |
555 | // | 555 | // |
556 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateGroup"), pwzActionData, COST_GROUP_ADD); | 556 | if (psg->wzDomain && *psg->wzDomain) |
557 | { | ||
558 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateDomainGroup"), pwzActionData, COST_GROUP_ADD); | ||
559 | } | ||
560 | else | ||
561 | { | ||
562 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateGroup"), pwzActionData, COST_GROUP_ADD); | ||
563 | } | ||
557 | ExitOnFailure(hr, "failed to schedule CreateGroup"); | 564 | ExitOnFailure(hr, "failed to schedule CreateGroup"); |
558 | } | 565 | } |
559 | else if (((GROUP_EXISTS_YES == geGroupExists) | 566 | else if (((GROUP_EXISTS_YES == geGroupExists) |
@@ -569,7 +576,14 @@ HRESULT ScaGroupExecute( | |||
569 | // | 576 | // |
570 | // Note: We can't rollback the removal of a group which is why RemoveGroup is a commit | 577 | // Note: We can't rollback the removal of a group which is why RemoveGroup is a commit |
571 | // CustomAction. | 578 | // CustomAction. |
572 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroup"), pwzActionData, COST_GROUP_DELETE); | 579 | if (psg->wzDomain && *psg->wzDomain) |
580 | { | ||
581 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroup"), pwzActionData, COST_GROUP_DELETE); | ||
582 | } | ||
583 | else | ||
584 | { | ||
585 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroup"), pwzActionData, COST_GROUP_DELETE); | ||
586 | } | ||
573 | ExitOnFailure(hr, "failed to schedule RemoveGroup"); | 587 | ExitOnFailure(hr, "failed to schedule RemoveGroup"); |
574 | } | 588 | } |
575 | 589 | ||
@@ -641,7 +655,15 @@ HRESULT ScaGroupMembershipRemoveParentsExecute( | |||
641 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); | 655 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); |
642 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); | 656 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); |
643 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); | 657 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); |
644 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | 658 | |
659 | if (psgp->wzDomain && *psgp->wzDomain) | ||
660 | { | ||
661 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | ||
662 | } | ||
663 | else | ||
664 | { | ||
665 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | ||
666 | } | ||
645 | 667 | ||
646 | LExit: | 668 | LExit: |
647 | ReleaseNullStr(pwzActionData); | 669 | ReleaseNullStr(pwzActionData); |
@@ -680,7 +702,14 @@ HRESULT ScaGroupMembershipRemoveChildrenExecute( | |||
680 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psgc->wzDomain); | 702 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psgc->wzDomain); |
681 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); | 703 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); |
682 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); | 704 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); |
683 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | 705 | if (psg->wzDomain && *psg->wzDomain) |
706 | { | ||
707 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | ||
708 | } | ||
709 | else | ||
710 | { | ||
711 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); | ||
712 | } | ||
684 | 713 | ||
685 | LExit: | 714 | LExit: |
686 | ReleaseNullStr(pwzActionData); | 715 | ReleaseNullStr(pwzActionData); |
@@ -748,7 +777,14 @@ HRESULT ScaGroupMembershipAddParentsExecute( | |||
748 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); | 777 | ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); |
749 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); | 778 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); |
750 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); | 779 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); |
751 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | 780 | if (psgp->wzDomain&&* psgp->wzDomain) |
781 | { | ||
782 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | ||
783 | } | ||
784 | else | ||
785 | { | ||
786 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | ||
787 | } | ||
752 | 788 | ||
753 | LExit: | 789 | LExit: |
754 | ReleaseNullStr(pwzActionData); | 790 | ReleaseNullStr(pwzActionData); |
@@ -790,7 +826,14 @@ HRESULT ScaGroupMembershipAddChildrenExecute( | |||
790 | ExitOnFailure(hr, "Failed to add parent group domain to custom action data: %ls", psgc->wzDomain); | 826 | ExitOnFailure(hr, "Failed to add parent group domain to custom action data: %ls", psgc->wzDomain); |
791 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); | 827 | hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); |
792 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); | 828 | ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); |
793 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | 829 | if (psg->wzDomain && *psg->wzDomain) |
830 | { | ||
831 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | ||
832 | } | ||
833 | else | ||
834 | { | ||
835 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); | ||
836 | } | ||
794 | 837 | ||
795 | LExit: | 838 | LExit: |
796 | ReleaseNullStr(pwzActionData); | 839 | ReleaseNullStr(pwzActionData); |