Directory Services

DsBindToISTG

The DsBindToISTG function binds to the computer that holds the Inter-Site Topology Generator (ISTG) role in the domain of the local computer. This function is used to obtain the bind handle for use with the DsQuerySitesByCost function.

DWORD WINAPI DsBindToISTG(
  LPCTSTR SiteName,
  HANDLE* phDS
);

Parameters

SiteName
[in, optional] Pointer to a null-terminated string that contains the site name used when binding. If this parameter is NULL, the site of the nearest domain controller is used.
phDS
[out] Address of a HANDLE value that receives the bind handle. To close this handle, call DsUnBind.

Return Values

Returns ERROR_SUCCESS if successful or a Win32 or RPC error code otherwise. The following are possible error codes.
Return Code Description
ERROR_INVALID_PARAMETER The phDS parameter is invalid.
ERROR_NOT_ENOUGH_MEMORY A memory allocation failure occurred.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.

See Also

DsQuerySitesByCost, DsUnBind, Domain Controller and Replication Management Functions