Directory Services |
The DsReplicaGetInfo2 function retrieves replication state data from the directory service. This function allows paging of results in cases where there are more than 1000 entries to retrieve.
DWORD DsReplicaGetInfo2( HANDLE hDS, DS_REPL_INFO_TYPE InfoType, LPCWSTR pszObject, UUID* puuidForSourceDsaObjGuid, LPCWSTR pszAttributeName, LPCWSTR pszValue, DWORD dwFlags, DWORD dwEnumerationContext, VOID** ppInfo );
Value | Meaning |
---|---|
DS_REPL_INFO_NEIGHBORS | pszObject identifies the naming context for which replication neighbors are requested. |
DS_REPL_INFO_CURSORS_FOR_NC | pszObject identifies the naming context for which replication cursors are requested. |
DS_REPL_INFO_METADATA_FOR_OBJ | pszObject identifies the object for which replication metadata is requested. |
DS_REPL_INFO_KCC_DSA_CONNECT_FAILURES | pszObject must be NULL. |
DS_REPL_INFO_KCC_DSA_LINK_FAILURES | pszObject must be NULL. |
DS_REPL_INFO_PENDING_OPS | pszObject must be NULL. |
DS_REPL_INFO_METADATA_FOR_ATTR_VALUE | pszObject identifies the object for which attribute replication metadata is requested. |
DS_REPL_INFO_CURSORS_2_FOR_NC | |
DS_REPL_INFO_CURSORS_3_FOR_NC | |
DS_REPL_INFO_METADATA_2_FOR_OBJ | pszObject identifies the object for which replication metadata is requested. |
DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE | pszObject identifies the object for which attribute replication metadata is requested. |
This parameter is only used if the InfoType parameter contains one of the following values.
DS_REPL_INFO_METADATA_FOR_ATTR_VALUE
DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE
Value | Meaning |
---|---|
DS_REPL_INFO_FLAG_IMPROVE_LINKED_ATTRS | Causes the attribute metadata to be improved to account for metadata on the attribute's linked values. The resulting vector represents changes for all attributes. This modified vector is useful for clients that expect all attributes and metadata to be included in the attribute metadata vector. |
This parameter is only used if the InfoType parameter contains one of the following values.
DS_REPL_INFO_CURSORS_2_FOR_NC
DS_REPL_INFO_CURSORS_3_FOR_NC
DS_REPL_INFO_METADATA_FOR_ATTR_VALUE
DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE
This function will retrieve a maximum of 1000 entries on each call. If after calling this function, more entries are available, the dwEnumerationContext member of the retrieved structure will contain the index of the next entry to retrieve. The dwEnumerationContext member of the retrieved structure is then used as the dwEnumerationContext parameter in the next call to this function. When all of the entries have been retrieved, the dwEnumerationContext member of the retrieved structure will contain -1. If -1 is passed for this parameter, this function will return ERROR_NO_MORE_ITEMS.
The caller must free this memory when it is no longer required by calling DsReplicaFreeInfo.
Return Code | Description |
---|---|
ERROR_INVALID_PARAMETER | One or more parameters are invalid. |
ERROR_NOT_SUPPORTED | The requested version of the directory service server extensions is not supported. |
ERROR_DS_DRA_ACCESS_DENIED | The user associated with the credentials tied to hDS does not have sufficient privileges to read the requested replication state data. The user must have the Manage Replication Topology control access right on the root of the naming context containing pszObject, or the root of the local domain if pszObject is NULL. |
ERROR_DS_DRA_BAD_DN | pszObject is not an appropriate distinguished name. |
ERROR_NO_MORE_ITEMS | There are no more entries to retrieve. |
The following code example demonstrates how to use this function to obtain more than 1000 entries.
do { DS_REPL_ATTR_VALUE_META_DATA_2 *pDSAttrMetaData; DWORD dwEnumContext = 0; DWORD dwRet; dwRet = DsReplicaGetInfo2( ..., DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE, ..., ..., ..., ..., ..., dwEnumContext, (LPVOID*)&pDSAttrMetaData); if(ERROR_SUCCESS == dwRet) { dwEnumContext = pDSAttrMetaData->dwEnumerationContext; // Get the entries from pDSAttrMetaData. DsReplicaFreeInfo(DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE, (LPVOID)pDSAttrMetaData); } }while(ERROR_SUCCESS == dwRet);
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 only as Unicode.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.
DsBind, DsReplicaFreeInfo, Domain Controller and Replication Management Functions