Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DsAddressToSiteNamesEx function

The DsAddressToSiteNamesEx function obtains the site and subnet names corresponding to the addresses specified.

Syntax


DWORD DsAddressToSiteNamesEx(
  _In_opt_  LPCTSTR ComputerName,
  _In_      DWORD EntryCount,
  _In_      PSOCKET_ADDRESS SocketAddresses,
  _Out_     LPTSTR **SiteNames,
  _Out_     LPTSTR **SubnetNames
);

Parameters

ComputerName [in, optional]

Pointer to a null-terminated string that specifies the name of the remote server to process this function. This parameter must be the name of a domain controller. A non-domain controller can call this function by calling DsGetDcName to find the domain controller.

EntryCount [in]

Contains the number of elements in the SocketAddresses array.

SocketAddresses [in]

Contains an array of SOCKET_ADDRESS structures that contain the addresses to convert. Each address in this array must be of the type AF_INET. EntryCount contains the number of elements in this array.

SiteNames [out]

Receives an array of null-terminated string pointers that contain the site names for the addresses. Each element in this array corresponds to the same element in the SocketAddresses array. An element is NULL if the corresponding address does not map to any known site or if the address entry is not of the proper form. The caller must free this array when it is no longer required by calling NetApiBufferFree.

SubnetNames [out]

Receives an array of null-terminated string pointers that contain the subnet names used to perform the address to site name mappings. Each element in this array corresponds to the same element in the SocketAddresses array. An element is NULL if the corresponding address to site name mapping was not determined or if no subnet was used to perform the corresponding address to site mapping. The latter will be the case when there is exactly one site in the enterprise with no subnet objects mapped to it. The caller must free this array when it is no longer required by calling NetApiBufferFree.

Return value

Returns NO_ERROR if successful or a Win32 or RPC error otherwise. The following are possible error codes.

Return codeDescription
ERROR_INVALID_PARAMETER

One or more parameters are invalid.

ERROR_NOT_ENOUGH_MEMORY

A memory allocation failure occurred.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Dsgetdc.h

Library

Netapi32.lib

DLL

Netapi32.dll

Unicode and ANSI names

DsAddressToSiteNamesExW (Unicode) and DsAddressToSiteNamesExA (ANSI)

See also

DsGetDcName
NetApiBufferFree
DsAddressToSiteNames
Directory Service Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.