0

I'm parsing the recurrence blob of recurring calendar appointments in order to determine deleted occurrences, following this answer. The MS documentation has some examples, but these do not document every detail:

The blobs start with this data:

Field Type
ReaderVersion WORD
WriterVersion WORD
RecurFrequency WORD
PatternType WORD
CalendarType WORD
FirstDateTime ULONG
Period ULONG
SlidingFlag ULONG
PatternTypeSpecific BYTE array
EndType ULONG
OccurrenceCount ULONG
FirstDOW ULONG
DeletedInstanceCount ULONG
DeletedInstanceDate ULONG
...

I need to retrieve the (one or more) DeletedInstanceDate(s). Complications are:

  • From the daily example, PatternTypeSpecific seems to be omitted for daily recurrences. Is this assumption correct? The bytes that I see when parsing seem to indicate 'yes'.
  • PatternTypeSpecific is documented as a BYTE array of varying length. I need to know the length, but can't find it.

Is PatternTypeSpecific an AppointmentRecurrencePattern structure as documented here, or is it something else? How can I know its size?

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144

1 Answers1

0

You need to check the pattern type first https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxocal/cf7153b4-f8b5-4cb6-bf14-e78d21f94814 this will determine the length of the field based on the pattern type definition.

PatternTypeSpecific (variable): A structure that specifies the details of the recurrence pattern. The structure varies according to the value of the PatternType field, as specified in sections 2.2.1.44.1.3, 2.2.1.44.1.4, 2.2.1.44.1.5, and 2.2.1.44.1.6.

then depending on the Pattern Type this will affect the PatternTypeSpecific eg for PatternTypeSpecific Day https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxocal/be0c5760-8757-4d6d-a721-eb1547cf7836

For a daily recurrence pattern (value of the PatternType field is 0x0000), the PatternTypeSpecific field has no value and is zero bytes. In other words, the value of the PatternTypeSpecific field is not included in the BLOB when the value of the PatternType field is 0x0000.

PatternTypeSpecific is always 4 bytes for the week, month, year patterns, but the interpretation varies.

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
Glen Scales
  • 20,495
  • 1
  • 20
  • 23