Skip to content

Commit

Permalink
U/sgriffin/nodes (#74)
Browse files Browse the repository at this point in the history
* Rebuild MAPIString on AnnotatedData and strip special handling from AddNodesForTree

Add nodeName to AddNodesForTree to ease debugging

* Rebuild MAPIString on AnnotatedData and strip special handling from AddNodesForTree

Add nodeName to AddNodesForTree to ease debugging

* Remove special casing for AnnotatedBytes, which is now subclassed from AnnotatedData

* Rebuild AnnotatedData to support multiple parsings

* hide obj types from output

* remove trailing \0 from tree copy

* Add meta tags to tag parsing

* parse named props in fx transfer data

* Parse times in fx buffers

* better time handling

* Hide types for SyntacticalBase

* add property tag information to recipient sync
  • Loading branch information
stephenegriffin committed Sep 5, 2023
1 parent 87696cb commit 76a67b3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
42 changes: 40 additions & 2 deletions MAPIInspector/Source/Parsers/MSOXCDATA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3892,6 +3892,20 @@ public string this[string key]
}
}

/// <summary>
/// The AnnotatedComment class is a comment node that takes up no space in the stream. It is used to annotate other nodes with comments.
/// </summary>
public class AnnotatedComment : AnnotatedData
{
/// <summary>
/// Initializes a new instance of the Information class with parameters.
/// </summary>
/// <param name="comment">The comment</param>
public AnnotatedComment(string comment) => this.ParsedValue = comment;
public static implicit operator AnnotatedComment(string comment) => new AnnotatedComment(comment);
public override int Size { get { return 0; } }
}

/// <summary>
/// The AnnotatedBytes class to a byte stream with an alternate version of it (typically ConvertByteArrayToString)
/// </summary>
Expand All @@ -3904,7 +3918,7 @@ public class AnnotatedBytes : AnnotatedData
private int size;

/// <summary>
/// Initializes a new instance of the Information class with parameters.
/// Initializes a new instance of the AnnotatedBytes class with parameters.
/// </summary>
/// <param name="size">Size of the byte array</param>
public AnnotatedBytes(int size)
Expand Down Expand Up @@ -4808,12 +4822,14 @@ public override void Parse(Stream s)
{
PropertyValue propValue = new PropertyValue(tempPropTag.PropertyType);
propValue.Parse(s);
propValue.PropertyTag = $"{tempPropTag.PropertyType}:{tempPropTag.PropertyId}";
rowPropValue = propValue;
}
else
{
TypedPropertyValue typePropValue = new TypedPropertyValue();
typePropValue.Parse(s);
typePropValue.PropertyTag = $"{tempPropTag.PropertyType}:{tempPropTag.PropertyId}";
rowPropValue = typePropValue;
}
}
Expand All @@ -4823,12 +4839,14 @@ public override void Parse(Stream s)
{
FlaggedPropertyValue flagPropValue = new FlaggedPropertyValue(tempPropTag.PropertyType);
flagPropValue.Parse(s);
flagPropValue.PropertyTag = $"{tempPropTag.PropertyType}:{tempPropTag.PropertyId}";
rowPropValue = flagPropValue;
}
else
{
FlaggedPropertyValueWithType flagPropValue = new FlaggedPropertyValueWithType();
flagPropValue.Parse(s);
flagPropValue.PropertyTag = $"{tempPropTag.PropertyType}:{tempPropTag.PropertyId}";
rowPropValue = flagPropValue;
}
}
Expand Down Expand Up @@ -6444,10 +6462,15 @@ public class PropertyValue : BaseStructure
private PropertyDataType propertyType;

/// <summary>
/// Boole value indicates if this property value is for address book.
/// Bool value indicates if this property value is for address book.
/// </summary>
private bool isAddressBook;

/// <summary>
/// Source property tag information
/// </summary>
public AnnotatedComment PropertyTag;

/// <summary>
/// Initializes a new instance of the PropertyValue class
/// </summary>
Expand Down Expand Up @@ -6786,6 +6809,11 @@ public class TypedPropertyValue : BaseStructure
/// </summary>
public object PropertyValue;

/// <summary>
/// Source property tag information
/// </summary>
public AnnotatedComment PropertyTag;

/// <summary>
/// The Count wide size of ptypMutiple type.
/// </summary>
Expand Down Expand Up @@ -6904,6 +6932,11 @@ public class FlaggedPropertyValue : BaseStructure
/// </summary>
private CountWideEnum countWide;

/// <summary>
/// Source property tag information
/// </summary>
public AnnotatedComment PropertyTag;

/// <summary>
/// Initializes a new instance of the FlaggedPropertyValue class
/// </summary>
Expand Down Expand Up @@ -6962,6 +6995,11 @@ public class FlaggedPropertyValueWithType : BaseStructure
/// </summary>
public object PropertyValue;

/// <summary>
/// Source property tag information
/// </summary>
public AnnotatedComment PropertyTag;

/// <summary>
/// The Count wide size.
/// </summary>
Expand Down
14 changes: 8 additions & 6 deletions MAPIInspector/Source/Parsers/MSOXCFXICS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7159,6 +7159,8 @@ protected SyntacticalBase(FastTransferStream stream)
/// </summary>
/// <param name="stream">Stream contains the serialized object</param>
public abstract void Parse(FastTransferStream stream);

public override string ToString() => string.Empty;
}

/// <summary>
Expand Down Expand Up @@ -7215,12 +7217,12 @@ public class MetaPropValue : SyntacticalBase
/// <summary>
/// The property type.
/// </summary>
public ushort PropType;
public PropertyDataType PropType;

/// <summary>
/// The property id.
/// </summary>
public ushort PropID;
public PidTagPropertyEnum PropID;

/// <summary>
/// The property value.
Expand Down Expand Up @@ -7254,16 +7256,16 @@ public static bool Verify(FastTransferStream stream)
/// <param name="stream">A FastTransferStream.</param>
public override void Parse(FastTransferStream stream)
{
this.PropType = stream.ReadUInt16();
this.PropID = stream.ReadUInt16();
this.PropType = (PropertyDataType)stream.ReadUInt16();
this.PropID = (PidTagPropertyEnum)stream.ReadUInt16();

if (this.PropID != 0x4011 && this.PropID != 0x4008)
if (this.PropID != PidTagPropertyEnum.MetaTagNewFXFolder && this.PropID != PidTagPropertyEnum.MetaTagDnPrefix)
{
this.PropValue = stream.ReadUInt32();
}
else
{
if (this.PropID != 0x4011)
if (this.PropID != PidTagPropertyEnum.MetaTagNewFXFolder)
{
FolderReplicaInfo folderReplicaInfo = new FolderReplicaInfo();
folderReplicaInfo.Parse(stream);
Expand Down

0 comments on commit 76a67b3

Please sign in to comment.