Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

4.1.10.5.17 SortResponseLinks

Note: Some of the information in this section is subject to change because it applies to an unreleased, preliminary version of the Windows Server operating system, and thus may differ from the final version of the server software when released. All behavior notes that pertain to the unreleased, preliminary version of the Windows Server operating system contain specific references to Windows Server 2016 Technical Preview in the Product Behavior appendix.

 procedure SortResponseLinks(var msgOut: DRS_MSG_GETCHGREPLY_NATIVE)

The SortResponseLinks procedure sorts the contents of msgOut.rgValues in ascending order according to the comparison method CompareLinks():

 procedure CompareLinks(REPLVALINF_NATIVE val1, REPLVALINF_NATIVE val2): integer
 begin
   c: integer
   dsname1: DSName
   dsname2: DSName
  
  
   /* Returns 1
      if val1 > val2, 0 if val1 = val2, or -1 if val1 < val2. */
  
  
   /* Compare by ascending host object objectGUID. */
   c := result of ANSI C function memcmp() 
       applied to val1.pObject^.Guid and val2.pObject^.Guid, 
       in little-endian byte order
  
  
   /* Then by ascending attribute ID. */
   if c = 0 then
     if val1.attrTyp < val2.attrTyp then
       c := -1
     else if val1.attrTyp > val2.attrType then
       c := 1
     endif
   endif
  
  
   /* Then by ascending "is present". */
   if c = 0 then
     if not val1.fIsPresent and val2.fIsPresent then
       c := -1
     else if val1.fIsPresent and not val2.fIsPresent then
       c := 1
     endif
   endif
  
  
   /* Then by ascending referenced object objectGUID. */
   if c = 0 then
     dsname1 := Value of val1.AVal.pVal^
     dsname2 := Value of val2.AVal.pVal^
  
  
     c := result of ANSI C function memcmp() applied to dsname1.Guid
         and dsname2.Guid, in little-endian byte order
   endif
  
  
   return c
 end
Show:
© 2015 Microsoft