4.1.1.2.6 GetDomainNameFromEntinf

 procedure GetDomainNameFromEntinf(e: ENTINF): DSName

Informative summary of behavior: This procedure examines the values for the hasMasterNCs attribute found in e and returns the domain NC. The hasMasterNCs attribute always contains the dsnames of the schema NC, the config NC, and the default domain NC of the DC represented by e. The domain NC is identified by a process of elimination.

 prefixTable: PrefixTable
 attr:ATTR
 j:DWORD
  
 prefixTable := NewPrefixTable()
  
 /* Scan the ENTINF e to get the attribute for which ATTRTYP is
  * hasMasterNCs.*/
 attr := ENTINF_GetAttribute(e, hasMasterNCs, prefixTable)
 for j=0 to (attr.AttrVal.valCount-1)
   if (attr.AttrVal.pAVal[j].pVal ≠ SchemaNC()) and
      (attr.AttrVal.pAVal[j].pVal ≠ ConfigNC()) and
              (attr.AttrVal.pAVal[j].valLen > 0) then
         return attr.AttrVal.pAVal[j].pVal^
   end if
 endfor
  
 return null
Show: