Export (0) Print
Expand All

5.114.10 GetResponseDirSyncControlValue

procedure GetResponseDirSyncControlValue (
    [in] chgReply: DRS_MSG_GETCHGREPLY_V6
    ) : DirSyncControlValue

Informative summary of behavior: The GetResponseDirSyncControlValue procedure creates an LDAP_SERVER_DIRSYNC_OID control value, to be returned in the response LDAP_SERVER_DIRSYNC_OID control, from a DRS_MSG_GETCHGREPLY_V6 structure (chgReply).

The arguments to this procedure are as follows:

  • chgReply: A DRS_MSG_GETCHGREPLY_V6 message generated by the GetReplChanges function.

replControlValue: DirSyncControlValue
minCookieLength: ULONG
utdVectorSize: ULONG
pUpToDateVecSrcV1: UPTODATE_VECTOR_V1_EXT

/* Construct LDAP_SERVER_DIRSYNC_OID response control value */

replControlValue.flag := chgReply.fMoreData
replControlValue.size := 0 /* must be ignored by the client */

/* minimum possible cookie size in bytes; that is, the size of a cookie
when a UTD vector is not present in the cookie. */

minCookieLength := 17*4

pUpToDateVecSrcV1 := If necessary, convert chgReply.pUpToDateVecSrc (of
      type UPTODATE_VECTOR_V2_EXT) to UPTODATE_VECTOR_V1_EXT by
      creating a new UPTODATE_VECTOR_V1_EXT with a UPTODATE_CURSOR_V1
      cursor for each UPTODATE_CURSOR_V2 cursor, ignoring the
      timeLastSyncSuccess field in UPTODATE_CURSOR_V2.

utdVectorSize := 16 /* offsetof(UPTODATE_VECTOR,V1.rgCursors[0]) */
              + (pUpToDateVecSrcV1.V1.cNumCursors *
                 sizeof(UPTODATE_CURSOR_V1))

replControlValue.cookie.length := minCookieLength + utdVectorSize replControlValue.cookie.value.signature := "SDSM"
replControlValue.cookie.value.version := 3
replControlValue.cookie.value.creationTime := current system time
replControlValue.cookie.value.utdVectorSize := utdVectorSize
replControlValue.cookie.value.usnVector := chgReply.usnvecTo
replControlValue.cookie.value.uuidSourceDsaInvocationID :=
                              chgReply.uuidInvocIdSrc
copy utdVectorSize bytes from pUpToDateVecSrcV1 to
     replControlValue.cookie.value.utdVector

return replControlValue
 
Show:
© 2015 Microsoft