Moore's Mind

Sunday, January 01, 2006

Bug in PEER_RECORD.pszAttributes

I've been implementing a class to simplify setting and managing the XML attributes associated with a PEER_RECORD. I figured a useful approach to associating attributes is to implement a method that allows you to simply provide an instance of a run-time object, and use reflection to get a list of properties and their current values.

So everything was working great, until I decided to try extracting the attributes of the current PEER_RECORD properties. Whenever I did this and called PeerGraphAddRecord, the error PEER_E_INVALID_ATTRIBUTES. Here is the pszAttribute XML fragement:

<attribute name="Type"
<attribute name="ID"
<attribute name="Version" type="int">0</attribute>
<attribute name="CreationTime"
<attribute name="ExpirationTime"
<attribute name="LastModifiedTime"
<attribute name="DataAsStream" type="string">System.IO.MemoryStream</attribute>
<attribute name="DataAsString" type="string">a</attribute>

Turns out, that when I remove the two dates with year 1600, the error no longer occurs.

I've confirmed these are valid XML dates by loading them into a Dataset with a column type of DateTime. They are interpreted and converted correctly.

I'm using Windows XP SP2. Guess I'll report the bug to Microsoft.