DsReplicaUpdateRefsA function (ntdsapi.h)

The DsReplicaUpdateRefs function adds or removes a replication reference for a destination from a source naming context.

Syntax

NTDSAPI DWORD DsReplicaUpdateRefsA(
  [in] HANDLE     hDS,
  [in] LPCSTR     NameContext,
  [in] LPCSTR     DsaDest,
  [in] const UUID *pUuidDsaDest,
  [in] ULONG      Options
);

Parameters

[in] hDS

Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.

[in] NameContext

Pointer to a constant null-terminated string that specifies the distinguished name of the source naming context.

[in] DsaDest

Pointer to a constant null-terminated string that specifies the transport-specific address of the destination directory system agent.

[in] pUuidDsaDest

Pointer to a UUID value that contains the destination directory system agent.

[in] Options

Contains a set of flags that provide additional data used to process the request. This can be zero or a combination of one or more of the following values.

DS_REPUPD_ADD_REFERENCE

A reference to the destination is added to the source server.

DS_REPUPD_ASYNCHRONOUS_OPERATION

The operation is performed asynchronously.

DS_REPUPD_DELETE_REFERENCE

A reference to the destination is removed from the source server.

DS_REPUPD_WRITEABLE

The reference to the replica added or removed is writable. Otherwise, it is read-only.

Return value

If the function succeeds, ERROR_SUCCESS is returned.

If the function fails, the return value can be one of the following.

Remarks

If both DS_REPUPD_ADD_REFERENCE and DS_REPUPD_DELETE_REFERENCE are set in the Options parameter, a reference to the destination is added if one does not already exist on the server. If a reference to the destination already exists, the reference is updated.

Note

The ntdsapi.h header defines DsReplicaUpdateRefs as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header ntdsapi.h
Library Ntdsapi.lib
DLL Ntdsapi.dll

See also

Domain Controller and Replication Management Functions

DsReplicaAdd

DsReplicaDel

DsReplicaModify

DsReplicaSync