Export (0) Print
Expand All

5.114.4 DirSyncReqToGetChgReq

procedure DirSyncReqToGetChgReq(
  [in] searchArg:  DirSyncSearchArg,
  [in] dirSyncControlValue: DirSyncControlValue,
  [out] nativeRequest: DRS_MSG_GETCHGREQ_V10
  ): ULONG

Informative summary of behavior: The DirSyncReqToGetChgReq procedure transforms the received LDAP search request with an LDAP_SERVER_DIRSYNC_OID control message into a DRS_MSG_GETCHGREQ_V10 request.

baseObjectDsName: DSNAME
replFlags: ULONG
ulSizeLimit: ULONG
ulMaxBytes: ULONG
errCode: ULONG

/* Validate input */
/* If the base of the search is not the root of an NC, 
   return unwillingToPerform */

baseObjectDsName := GetDSNameFromDN (searchArg.pObject)
if baseObjectDsName ≠ GetObjectNC(baseObjectDsName) then
   return unwillingToPerform
endif

nativeRequest.pNC := baseObjectDsName
nativeRequest.ulFlags := 0

nativeRequest.ulMoreFlags := 0

replFlags := dirSyncControlValue.flags
if (LDAP_DIRSYNC_ANCESTORS_FIRST_ORDER in replFlags) then
   nativeRequest.ulFlags := nativeRequest.ulFlags + {DRS_GET_ANC}
endif

ulSizeLimit := 1000
if (searchArg.sizeLimit) then
   ulSizeLimit := min(searchArg.sizeLimit, ulSizeLimit)
endif

nativeRequest.cMaxObjects = max (ulSizeLimit, 100)

ulMaxBytes := dirSyncControlValue.size
if (ulMaxBytes = 0) then
   ulMaxBytes := 1024*1024
endif
nativeRequest.cMaxBytes := ulMaxBytes

cookie := dirSyncControlValue.cookie
errCode := GetUsnUtdVectorFromCookie (cookie, nativeRequest) 
if (errCode ≠ 0) then
   return errCode
endif

/* Handle attribute selection */
copy the list of required attributes, if present, from searchArg.pSelection 
    to nativeRequest.pPartialAttrSet

return 0 /* success */
 
Show:
© 2014 Microsoft