The DsQuerySitesByCost function gets the communication cost between one site and one or more other sites.
NTDSAPI_POSTXP DWORD DsQuerySitesByCostA( HANDLE hDS, LPSTR pszFromSite, LPSTR *rgszToSites, DWORD cToSites, DWORD dwFlags, PDS_SITE_COST_INFO *prgSiteInfo );
A directory service handle.
Pointer to a null-terminated string that contains the relative distinguished name of the site the costs are measured from.
Contains an array of null-terminated string pointers that contain the relative distinguished names of the sites the costs are measured to.
Contains the number of elements in the rgwszToSites array.
Pointer to an array of DS_SITE_COST_INFO structures that receives the cost data. Each element in this array contains the cost data between the site identified by the pwszFromSite parameter and the site identified by the corresponding rgwszToSites element.
The caller must free this memory when it is no longer required by calling DsQuerySitesFree.
Returns ERROR_SUCCESS if successful or a Win32 or RPC error code otherwise. Possible error codes include values listed in the following list.
The cost values obtained by this function are only used to compare and have no meaning by themselves. For example, the cost for site 1 can be compared to the cost for site 2, but the cost for site 1 cannot be compared to a fixed value.
|Windows version||Windows Vista Windows Server 2008|