Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

4.1.10.6.1 ProcessGetNCChangesReply

procedure ProcessGetNCChangesReply(
  hDrs: DRS_HANDLE,
  rf: RepsFrom,
  msgIn: DRS_MSG_GETCHGREQ_V10,
  dwOutVersion: ULONG,
  msgOut: DRS_MSG_GETCHGREPLY) : ULONG

Informative summary of behavior: The ProcessGetNCChangesReply procedure is invoked when an IDL_DRSGetNCChanges response is received over RPC or SMTP, as specified in [MS-SRPL]. Processing of a given response can be separated into five distinct phases: decompression, attribute value decryption, processing objectupdates, processing link value updates, and updating the "watermark" information.

The arguments to this procedure are as follows:

  • hDrs: The DRS_HANDLE derived by sending IDL_DRSBind to the server.

  • rf: RepsFrom for the server.

  • msgIn: IDL_DRSGetNCChanges request message sent to the server.

  • dwOutVersion: Version of response message received from the server.

  • msgOut: Response message received from the server.

msgReplyV6: DRS_MSG_GETCHGREPLY_V6
replEntinfList: REPLENTINFLIST
continueProcessing: boolean
writableReplica: boolean
sourcePrefixTable: PrefixTable
attributesAndStamps: set of AttributeAndStamp
linkValueCount: DWORD
clientSchemaSignature: sequence of BYTE
serverSchemaSignature: sequence of BYTE
fServerSchemaMoreRecent: boolean
lastElement: DWORD

ulResult := msgReplyV6.dwDRSError

if (ulResult = 0) then
  /* Decompress and/or translate the response to a V6 response,
   * as necessary. */
  if (dwOutVersion = 0x2) or (dwOutVersion = 0x7) then
    msgReplyV6 := DecompressReplyMessage(msgOut, dwOutVersion)
  else
    msgReplyV6 := GetNCChangesV6Reply(msgOut, dwOutVersion)
  endif

  sourcePrefixTable :=   
      AbstractPTFromConcretePT(msgReplyV6.PrefixTableSrc)

  /* Check whether the schema on client and server match. */ 
  lastElement := sourcePrefixTable.length - 1
  serverSchemaSignature :=
     copy sourcePrefixTable[lastElement].prefix.length bytes of data 
     from sourcePrefixTable[lastElement].prefix.elements
  clientSchemaSignature := SchemaNC()!schemaInfo
  if clientSchemaSignature ≠ serverSchemaSignature and 
     msgReplyV6.pNC^ ≠ SchemaNC())
  then
    return ERROR_DS_DRA_SCHEMA_MISMATCH
  endif
  Remove sourcePrefixTable[lastElement] from sourcePrefixTable

else
  return ulResult
endif

/* If the source has the Recycle Bin optional feature enabled, then it must
 * be enabled locally, unless the Schema partition is being updating.
 */
if  msgReplyV6.pNC^ ≠ SchemaNC() and
   ServerExtensions(hDrs).RB and not IsRecycleBinEnabled()
then
   EnableRecycleBin()
   return ERROR_DS_DRS_EXTENSIONS_CHANGED
endif

/* Process object updates. */
replEntinfList := msgReplyV6.pObjects^
while (ulResult = 0) and (not replEntinfList = null)
  /* Decrypt any encrypted attribute values. */
  ulResult := DecryptValuesIfNecessary (
                hDrs,
                sourcePrefixTable,
                replEntinfList.Entinf.AttrBlock)

  if (ulResult = 0) then
    attributesAndStamps := GetStampsForUpdate(
                         replEntinfList,
                         sourcePrefixTable)
    /* Process objects that are moved across an NC. */
    continueProcessing := PrepareCrossNCMove(
                            replEntinfList, 
                            sourcePrefixTable)
  endif
  if continueProcessing and (ulResult = 0) then
    if (DRS_WRIT_REP in msgIn.ulFlags) then
      writableReplica  := true
    else
      writableReplica  := false
    endif
    continueProcessing := AdjustInstanceTypeAttrVal(
                            msgReplyV6.pNC^,
                            writableReplica , 
                            replEntinfList, 
                            prefixTable)
  endif
  if continueProcessing and (ulResult = 0) then
    if (not ObjExists(replEntinfList.Entinf.pName^)) then
      ulResult := AddObject(
                    replEntinfList, 
                    sourcePrefixTable,
                    attributesAndStamps)
    else
      ulResult := UpdateObject(
                    replEntinfList, 
                    sourcePrefixTable,
                    attributesAndStamps)
    endif
  endif
  replEntinfList := replEntinfList.pNextEntInf^
endwhile

/* Enable link value updates for outbound replication
 * if inbound link value updates are detected from source. */
if (msgReplyV6.cNumValues > 0) then
  dc.fLinkValueStampEnabled = true
endif

/* Process link value updates. */
linkValueCount := 0
while (ulResult = 0) and (linkValueCount < msgReplyV6.cNumValues)
  ulResult := ProcessLinkValue(
                msgReplyV6.rgValues[linkValueCount],
                msgReplyV6.pNC^,
                prefixTable,
                msgIn.ulFlags,
                msgIn.ulMoreFlags)
  linkValueCount := linkValueCount + 1
endwhile

if (ulResult = ERROR_DS_DRA_MISSING_PARENT) then
  Send IDL_DRSGetNCChanges message again with the same input 
  parameters specified in msgIn but this time with msgIn.ulFlags 
  containing DRS_GET_ANC field set. It is an error for this 
  condition to occur if (DRS_GET_ANC in msgIn.ulFlags) is true
else if (ulResult = ERROR_DS_DRA_RECYCLED_TARGET) then
  Send IDL_DRSGetNCChanges message again with the same input 
  parameters specified in the msgIn but this time with msgIn.ulMoreFlags 
  containing DRS_GET_TGT field set. 
else if (msgIn.ulExtendedOp = 0) then
  /* Not an extended operation. Update "watermark" information. */
  UpdateRepsFrom(
    rf,
    msgReplyV6, 
    dsaServer,
    ulResult)
  
  if (ulResult = 0) and (msgReplyV6.fMoreData = false) then
    UpdateUTDandPAS(
      msgReplyV6,
      msgIn.partialAttrSetEx^)
  endif
endif

return ulResult
 
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.