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:

<attributes>
<attribute name="Type"
type="string">4d5b2f11-6522-433b-84ef-a298e60757b0</attribute>
<attribute name="ID"
type="string">00000000-0000-0000-0000-000000000000</attribute>
<attribute name="Version" type="int">0</attribute>
<attribute name="CreationTime"
type="date">1600-12-31T17:00:00.0000000-07:00</attribute>
<attribute name="ExpirationTime"
type="date">2006-01-01T07:18:31.0507500-07:00</attribute>
<attribute name="LastModifiedTime"
type="date">1600-12-31T17:00:00.0000000-07:00</attribute>
<attribute name="DataAsStream" type="string">System.IO.MemoryStream</attribute>
<attribute name="DataAsString" type="string">a</attribute>
</attributes>

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.