|
1 | 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
2 | 2 |
|
3 | 3 | #include "precomp.h" |
4 | | -#include "scanet.h" |
5 | 4 |
|
6 | 5 | LPCWSTR vcsGroupQuery = L"SELECT `Group`, `Component_`, `Name`, `Domain` FROM `Wix4Group` WHERE `Group`=?"; |
7 | 6 | enum eGroupQuery { vgqGroup = 1, vgqComponent, vgqName, vgqDomain }; |
@@ -458,7 +457,20 @@ HRESULT ScaGroupExecute( |
458 | 457 | // and removing groups. Note: MSDN says that it is safe to call these APIs from any |
459 | 458 | // user, so we should be safe calling it during immediate mode. |
460 | 459 |
|
461 | | - hr = GetDomainServerName(psg->wzDomain, &pwzServerName); |
| 460 | + hr = GetDomainServerName(psg->wzDomain, &pwzServerName, 0); |
| 461 | + if (HRESULT_FROM_WIN32(ERROR_NO_SUCH_DOMAIN) == hr) |
| 462 | + { |
| 463 | + if (SCAG_NON_VITAL & psg->iAttributes) |
| 464 | + { |
| 465 | + WcaLog(LOGMSG_VERBOSE, "Domain does not exist for non-vital group: %ls\\%ls - continuing", psg->wzDomain, psg->wzName); |
| 466 | + hr = S_OK; |
| 467 | + goto ExitCurrentGroup; |
| 468 | + } |
| 469 | + else |
| 470 | + { |
| 471 | + ExitOnFailure(hr, "Domain does not exist for vital group: %ls\\%ls - aborting", psg->wzDomain, psg->wzName); |
| 472 | + } |
| 473 | + } |
462 | 474 |
|
463 | 475 | er = ::NetLocalGroupGetInfo(pwzServerName, psg->wzName, 0, reinterpret_cast<LPBYTE*>(&pGroupInfo)); |
464 | 476 | if (NERR_Success == er) |
@@ -597,6 +609,7 @@ HRESULT ScaGroupExecute( |
597 | 609 | ExitOnFailure(hr, "failed to schedule RemoveGroup"); |
598 | 610 | } |
599 | 611 |
|
| 612 | + ExitCurrentGroup: |
600 | 613 | ReleaseNullStr(pwzScriptKey); |
601 | 614 | ReleaseNullStr(pwzActionData); |
602 | 615 | ReleaseNullStr(pwzRollbackData); |
|
0 commit comments