aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/ca/scanet.h
blob: efe6a408e7316ff74d33fd31fbb70a5c298e9e4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once
// 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.


/**
 * Locates a domain controller (server name) for a given input domain.
 * Flags can be provided where required (as per those for DsGetDcName) for a specific server to be returned.
 * NOTE: Where the domain provided is identical to the local machine, this function will return NULL, such that the
 * result can be provided directly to NetUserAdd or similar functions.
 *
 * @param pwzDomain Pointer to the domain name to be queried
 * @param ppwzServerName Pointer to the server name to be returned
 * @param flags Flags to be used in the DsGetDcName call(s)
 * @return HRESULT to indicate if an error was encountered
 */
HRESULT GetDomainServerName(LPCWSTR pwzDomain, LPWSTR* ppwzServerName, ULONG flags);