4.1.10.4.2 ReplSingleObjRequestMsg

 procedure ReplSingleObjRequestMsg(
   hDrs: DRS_HANDLE,
   version: DWORD,
   nc: DSName,
   object: DSName,
   rf: RepsFrom,
   ulFlags: ULONG,
   ulMoreFlags: ULONG,
   cMaxObjects: ULONG,
   cMaxBytes: ULONG,
   fWithSecrets: boolean,
   var msgRequest: DRS_MSG_GETCHGREQ): DWORD

Informative summary of behavior: The client can send an IDL_DRSGetNCChanges request to the server to replicate changes from a single object. The ReplSingleObjRequestMsg procedure specifies how the request message is constructed for this operation. The arguments for this method are the same as those for the procedure ReplicateNCRequestMsg, with the following exceptions:

  • object: The DSName of the object that should be replicated.

  • fWithSecrets: The object's secret attributes should be replicated. Only RODCs need to make, and can make, this request.

The procedure returns a Windows error code if it cannot construct msgRequest.

 msgRequest: DRS_MSG_GETCHGREQ 
 msgIn: DRS_MSG_GETCHGREQ_V10
 ncType: ULONG
  
 /* An NC replica with root of DSName nc must already exist on the 
    client */
 if (not PartialGCReplicaExists(nc) and
     not FullReplicaExists(nc)) then
   return ERROR_DS_DRA_BAD_NC
 endif
  
 /* Only RODCs are allowed to request secrets explicitly */
 if fWithSecrets and not AmIRODC() then
   return ERROR_INVALID_PARAMETER
 endif
  
 if fWithSecrets then
   msgIn.ulExtendedOp := EXOP_REPL_SECRETS
 else
   msgIn.ulExtendedOp := EXOP_REPL_OBJ
 endif
  
 if AmIRODC()then
   if DRS_WRIT_REP in ulFlags then
     return ERROR_INVALID_PARAMETER
   endif
   ext := ServerExtensions(hDrs)
   if not DRS_EXT_LH_BETA2 in ext.dwFlags and
      msgIn.pNC^ = SchemaNC() then
     ulFlags := ulFlags + {DRS_WRIT_REP}
   endif
 endif
  
 ncType = GetNCType(nc)
 if not NCT_GC_PARTIAL in ncType then
   ulFlags := ulFlags + {DRS_GET_ALL_GROUP_MEMBERSHIP}
 endif
  
 msgIn.ulFlags := ulFlags
 msgIn.ulMoreFlags := ulMoreFlags
 msgIn.cMaxObjects := cMaxObjects
 msgIn.cMaxBytes := cMaxBytes
 msgIn.uuidDsaObjDest := dc.serverGuid
 msgIn.pNC := ADR(object) 
 msgIn.liFsmoInfo := 0
 msgIn.pUpToDateVecDest :=   
     ConcreteUTDFromAbstractUTD(nc!replUpToDateVector)
 msgIn.pPartialAttrSetEx := null
  
 /* set msgIn.pPartialAttrSet field */
 if ObjExists(nc) and nc!partialAttributeSet ≠ null then
   msgIn.pPartialAttrSet := ConcretePASFromAbstractPAS(
                                nc!partialAttributeSet)
 else
   if (NCT_GC_PARTIAL in ncType  and 
       NCT_FILTERED_ATTRIBUTE_SET in ncType)} then
     msgIn.pPartialAttrSet := FilteredGCPAS()
   else if NCT_FILTERED_ATTRIBUTE_SET in ncType then
     msgIn.pPartialAttrSet := FilteredPAS()
   else if NCT_GC_PARTIAL in ncType then
     msgIn.pPartialAttrSet := GCPAS()
   else
     msgIn.pPartialAttrSet := null
   endif
 endif
  
 msgIn.PrefixTableDest = ConcretePTFromAbstractPT(dc.prefixTable)
  
 /* Fill usnvecFrom and uuidInvocIdSrc fields. 
  * usnvecFrom: This field contains the value of the usnVec field in 
  * RepsFrom tuple corresponding to the IDL_DRSGetNCChanges server
  * DC, or zeros if no such repsFrom is present. 
  * uuidInvocIdSrc: If the usnvecFrom field is not zeros, this field
  * MUST contain the uuidInvocId from the same tuple from which the 
  * usnVec fieldwas retrieved. Otherwise, this field contains
  * zeros.*/
  
 if (rf = null) then 
   msgIn.usnvecFrom := 0
   msgIn.uuidInvocIdSrc := 0
 else
   msgIn.usnvecFrom := rf.usnVec
   msgIn.uuidInvocIdSrc := rf.uuidInvocId
 endif
  
 if version = 5 then
   msgRequest.V5 := msgIn
   msgRequest.V5.pUpToDateVecDestV1 := msgIn.pUpToDateVecDest
 else if version = 8 then
   msgRequest.V8 := msgIn
 else 
   msgRequest.V10 := msgIn
 endif
  
 return 0
Show: