diff options
| author | Bevan Weiss <bevan.weiss@gmail.com> | 2025-01-03 15:06:15 +1100 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-02-11 23:14:49 -0800 |
| commit | 8f5130afdc60f4957086e41d62cfe9f8d70d5321 (patch) | |
| tree | da9f8a9d217eff1484bf78003d52624d1f91433b /src/ext/Util/ca/scanet.cpp | |
| parent | fcae786168ee7c148ac932d725357f9714ad6631 (diff) | |
| download | wix-8f5130afdc60f4957086e41d62cfe9f8d70d5321.tar.gz wix-8f5130afdc60f4957086e41d62cfe9f8d70d5321.tar.bz2 wix-8f5130afdc60f4957086e41d62cfe9f8d70d5321.zip | |
Fix ups for Domain Group creation / removal.
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/ext/Util/ca/scanet.cpp')
| -rw-r--r-- | src/ext/Util/ca/scanet.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ext/Util/ca/scanet.cpp b/src/ext/Util/ca/scanet.cpp index a8ad0316..ad6c8b01 100644 --- a/src/ext/Util/ca/scanet.cpp +++ b/src/ext/Util/ca/scanet.cpp | |||
| @@ -8,8 +8,13 @@ HRESULT GetDomainServerName(LPCWSTR pwzDomain, LPWSTR* ppwzServerName, ULONG fla | |||
| 8 | DWORD er = ERROR_SUCCESS; | 8 | DWORD er = ERROR_SUCCESS; |
| 9 | PDOMAIN_CONTROLLER_INFOW pDomainControllerInfo = NULL; | 9 | PDOMAIN_CONTROLLER_INFOW pDomainControllerInfo = NULL; |
| 10 | HRESULT hr = S_OK; | 10 | HRESULT hr = S_OK; |
| 11 | WCHAR pwzComputerName[MAX_COMPUTERNAME_LENGTH + 1]; | ||
| 12 | DWORD cchComputerName = countof(pwzComputerName); | ||
| 11 | 13 | ||
| 12 | if (pwzDomain && *pwzDomain) | 14 | hr = ::GetComputerNameW(pwzComputerName, &cchComputerName); |
| 15 | ExitOnFailure(hr, "failed to obtain computer name"); | ||
| 16 | |||
| 17 | if (pwzDomain && *pwzDomain && 0!=lstrcmpiW(pwzComputerName, pwzDomain) && 0!=lstrcmpiW(L".", pwzDomain)) | ||
| 13 | { | 18 | { |
| 14 | er = ::DsGetDcNameW(NULL, pwzDomain, NULL, NULL, flags, &pDomainControllerInfo); | 19 | er = ::DsGetDcNameW(NULL, pwzDomain, NULL, NULL, flags, &pDomainControllerInfo); |
| 15 | if (RPC_S_SERVER_UNAVAILABLE == er) | 20 | if (RPC_S_SERVER_UNAVAILABLE == er) |
| @@ -21,7 +26,7 @@ HRESULT GetDomainServerName(LPCWSTR pwzDomain, LPWSTR* ppwzServerName, ULONG fla | |||
| 21 | if (ERROR_SUCCESS == er && pDomainControllerInfo->DomainControllerName) | 26 | if (ERROR_SUCCESS == er && pDomainControllerInfo->DomainControllerName) |
| 22 | { | 27 | { |
| 23 | // Skip the \\ prefix if present. | 28 | // Skip the \\ prefix if present. |
| 24 | if ('\\' == *pDomainControllerInfo->DomainControllerName && '\\' == *pDomainControllerInfo->DomainControllerName + 1) | 29 | if ('\\' == *pDomainControllerInfo->DomainControllerName && '\\' == *(pDomainControllerInfo->DomainControllerName + 1) ) |
| 25 | { | 30 | { |
| 26 | hr = StrAllocString(ppwzServerName, pDomainControllerInfo->DomainControllerName + 2, 0); | 31 | hr = StrAllocString(ppwzServerName, pDomainControllerInfo->DomainControllerName + 2, 0); |
| 27 | } | 32 | } |
