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.

8 Comments:

  • At 7:59 AM, Blogger Ad. said…

    On the December CTP of Vista, its even worse. Any attempt to use a date results in the following error:

    The data area passed to a system call is too small

    Here is the XML fragment I was passing:

    <attributes><attribute name="ExpirationTime" type="date">2006-01-01T08:35:06.8903782-07:00</attribute></attributes>

     
  • At 8:25 AM, Blogger Ad. said…

    I've posted a comment to the Windows Vista Networking Forum on Microsoft's web-site.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=186082&SiteID=1

     
  • At 11:09 PM, Blogger darrelhill3016 said…

    I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

     
  • At 11:25 PM, Blogger Admin said…

    Hi Ad.,
    I was looking for information about file sharing when I came across your blog. Bug in PEER_RECORD.pszAttributes doesn't really cover what I was after but it sure looks like it'll be useful. I'm off to find more resources on file sharing. Good luck and keep it up.

     
  • At 10:22 AM, Blogger dwainsmith0749 said…

    I read over your blog, and i found it inquisitive, you may find My Blog interesting. So please Click Here To Read My Blog

    http://pennystockinvestment.blogspot.com

     
  • At 11:04 AM, Blogger Tripp Parks said…

    Thanks, I have opened a bug internally, we do not handle fractional seconds correctly, but full seconds will work.

     
  • At 8:54 PM, Blogger MSU CSE 498 Team 6 said…

    Hey Adrian, my name is Dan Lash and I'm on a team at Michigan State that is working with the Peer to Peer library for our senior capstone course. Ravi directed us to you today and we're all excited about the work you've already done. We'd like to ask you some questions if you don't mind. Pleas email me at lash@msu.edu

     
  • At 10:20 AM, Blogger Ad. said…

    Dan, I've e-mailed you a couple of times. Am I being blocked as spam?

    Ad.

     

Post a Comment

<< Home