22.214.171.124.2 Calling NetrDatabaseSync2
The client calling this method MUST be a BDC. The client SHOULD<141> call this method in a loop (referred to in this section as the synchronization loop) until all database records are received as indicated by the return code STATUS_SUCCESS.
The client MUST do the following:
Pass a valid PDC name as the PrimaryName parameter.
Pass the client BDC name as the ComputerName parameter.
Pass a valid client Netlogon authenticator as the Authenticator parameter.
Pass a valid database identifier as the DatabaseID parameter as follows:
Set RestartState to NormalState unless this call is a restart of a synchronization loop, in which case set RestartState as follows:
GroupState if the last delta type of the previous synchronization loop was AddOrChangeGroup.
UserState if the last delta type of the previous synchronization loop was AddOrChangeUser.
GroupMemberState if the last delta type of the previous synchronization loop was ChangeGroupMembership.
AliasState if the last delta type of the previous synchronization loop was AddOrChangeAlias.
AliasMemberState if the last delta type of the previous synchronization loop was ChangeAliasMembership.
If this is a first call in a synchronization loop, pass SyncContext as 0x00000000. Otherwise, pass SyncContext as the SyncContext value returned by the previous call in a synchronization loop, either continued as normal or terminated.
Pass the preferred maximum length of data to be referenced in the DeltaArray parameter as the PreferredMaximumLength parameter.
On receiving the STATUS_MORE_ENTRIES status code, the client SHOULD<142> continue calling this routine in a loop until all missing database entries are received. On receiving the STATUS_SUCCESS status code, the client MUST terminate the loop. The client MAY terminate the loop early on without receiving all entries. For example, the client MAY choose to do so on a system shutdown notification. In that case, if the client intends to restart the synchronization loop at a later point, the client MUST maintain the state for setting the RestartState parameter to restart the loop as previously described.