5.11 AttributeStamp

AttributeStamp is an abstract type that contains information about the last originating update to an attribute. It is a tuple of the following:

  • dwVersion: A 32-bit integer. Set to 1 when a value for the attribute is set for the first time. On each subsequent originating update, if the current value of dwVersion is less than 0xFFFFFFFF, then increment it by 1; otherwise set it to 0.

  • timeChanged: The date and time at which the last originating update was made.

  • uuidOriginating: The invocation ID of the DC that performed the last originating update.

  • usnOriginating: The USN assigned to the last originating update by the DC that performed it.

Comparisons

Version Comparison: The following procedure is used for comparing the dwVersion fields of two AttributeStamps:

 procedure CompareVersions(x: DWORD, y: DWORD): int

Informative summary of behavior: This procedure compares two dwVersions and returns an integer that is used in AttributeStamp following comparisons.

   if x = y then
      return 0
   elseif x > 0x7FFFFFFF then
      if y = (x – 0x80000000) then
         return 1
      elseif (y < (x – 0x7FFFFFFF)) or (x < y) then
         return -1
      else
         return 1
      endif
   elseif x < 0x7FFFFFFF then
      if y = (x + 0x80000000) then
         return -1
      elseif (x < y) and (y < (x – 0x7FFFFFFF)) then
         return -1
      else
         return 1
      endif
   else
      if y = 0xFFFFFFFF then
         return -1
      elseif x < y then
         return -1
      else
         return 1
      endif
   endif
  

AttributeStamp Comparison: Given two AttributeStamps x and y, let d be the result of the procedure CompareVersions(x.dwVersion, y.dwVersion).

x is said to be equal to y if any of the following is true:

  • x is null and y is null

  • d = 0 and x.timeChanged = y.timeChanged and x.uuidOriginating = y.uuidOriginating

x is said to be greater than y if any of the following is true:

  • x is not null and y is null

  • d > 0

  • d = 0 and x.timeChanged > y.timeChanged

  • d = 0 and x.timeChanged = y.timeChanged and x.uuidOriginating > y.uuidOriginating

x is said to be less than y if any of the following is true:

  • x is null and y is not null

  • d < 0

  • d = 0 and x.timeChanged < y.timeChanged

  • d = 0 and x.timeChanged = y.timeChanged and x.uuidOriginating < y.uuidOriginating

Conversions

A value x of type AttributeStamp can be converted to and from its wire format y of type PROPERTY_META_DATA_EXT by associating the values of fields in x with the values of the like-named fields in y.