Export (0) Print
Expand All

4.1.10.6.3 PrepareCrossNCMove

procedure PrepareCrossNCMove(
  replEntinfList: REPLENTINFLIST,
  sourcePrefixTable: PrefixTable): boolean

Informative summary of behavior: The PrepareCrossNCMove procedure determines whether the object specified by the replEntinfList argument is being moved from one NC to another and, if so, performs preparatory work and/or terminates further processing of replEntinfList. The procedure returns true if further processing of replicated update in replEntinfList must be performed. Otherwise, it returns false.

proxiedNameAttrVal: ATTRVAL
proxiedNameValue: DNBinary 
localProxiedNameValue: DNBinary
proxyEpoch: DWORD
localProxyEpoch: DWORD
proxyObject: DSName
proxyObjectNameValue: DNBinary
isProxy: boolean
objClassVal: ATTRVAL

proxiedNameAttrVal := ENTINF_GetValue(
                        replEntinfList.Entinf, 
                        proxiedObjectName,
                        sourcePrefixTable)
if (proxiedNameAttrVal = null) then
  /* Update is not related to cross NC move. Therefore, continue  
     processing the replicated update. */
  return true 
endif

/* replEntinfList corresponds to an object that has moved across an
 * NC /
proxiedNameValue := ValueFromATTRVAL(
    proxiedNameAttrVal, Syntax(proxiedObjectName), sourcePrefixTable)
proxyEpoch := GetProxyEpoch(proxiedNameValue)

/* Check whether the objectClass is infrastructureUpdate. */
objClassVal := ENTINF_GetValue(replEntinfList.Entinf, objectClass,
    sourcePrefixTable)
if LocalAttidFromRemoteAttid(
    sourcePrefixTable, objClassVal.pAVal^.pVal^)
    = infrastructureUpdate then
  isProxy := true
else
  isProxy := false
endif

if not isProxy then 
  /* Replicated update is not for an infrastructureUpdate object. */
  proxyObject := replEntinfList.Entinf.pName^
  if (ObjExists(proxyObject)) and 
     (not proxyObject!proxiedObjectName = null) then
    localProxyEpoch := GetProxyEpoch(proxyObject!proxiedObjectName)
  else
    localProxyEpoch := 0
  endif
  if (localProxyEpoch > proxyEpoch) then
    /* Local EPOCH value is higher. Don't continue processing the
     * replicated update. */
    return false
  else if (localProxyEpoch < proxyEpoch) and
          (ObjExists(proxyObject)) then
    Expunge(proxyObject)
  endif
else
  proxyObjectNameValue :=
      ValueFromATTRVAL(proxiedNameAttrVal.pVal,
                       Syntax(proxiedObjectName),
                       sourcePrefixTable)
  proxyObject := proxyObjectNameValue.dn
  if (ObjExists(proxyObject)) then 
    localProxiedNameValue = proxyObject!proxiedObjectName
    if (localProxiedNameValue = null) then
      localProxyEpoch := 0
    else
      localProxyEpoch := GetProxyEpoch(localProxiedNameValue)
    endif
    if (localProxyEpoch < proxyEpoch) then
      Expunge(proxyObject)
    endif
  endif
endif  
return true /* Continue processing the replicated update. */
 
Show:
© 2015 Microsoft