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.
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.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|