Moore's Mind

Monday, February 27, 2006

Just installed the February CTP of Vista, when I call PeerCollabSignin to sign-in, a PEER_E_PRIVACY_DECLINED error is returned. There is no documentation on this error code.

I'm guessing, its because I haven't visited Control Panel, People Near Me and agreed to the privacy statement.

When I run the Windows Collaboration application, it appears to launch a COM surrogate process that pops up the "Set up People Near Me" window and gets me to set my display name and agree to the privacy statement.

In my opinion, this same behavior should be built-in to the PeerCollabSignin method when the sign-in flags are either NEARME or ALL.

Comments are welcome.

Saturday, February 25, 2006

Bug in PeerGroupIssueCredentials

After trying to figure out how this function works for nearly a week now, I've come to the conclusion, its not working as advertised. Part of the problem, is that none of Microsoft's example code uses this function.

There are three ways to use PeerGroupIssueCredentials:

1) PeerGroupIssueCredentials(hGroup, pwzSubjectIdentity, NULL, 0, ppwzInvitation)

In this form, NULL credentials are passed. The information (member data and credentials) stored in the peer database is used. This is a useful way to re-issue a lost invitation.

2) PeerGroupIssueCredentials(hGroup, pwzSubjectIdentity, pCredentialInfo, 0, ppwzInvitation)

In this form, new credentials can be passed in order to generate a new invitation. Typically, this would extend the expiry date of the member or change their role or friendly name. I get a valid invitation. However, when I use this invitation to re-join the group, the updated credentials are not taken.

3) PeerGroupIssueCredentials(hGroup, pwzSubjectIdentity, pCredentialInfo, 1, ppwzInvitation)

Same as 2) except the newly created GMC (invitation) is published to the group and automatically picked up by the member. When the member connects or is connected, I see the PEER_GROUP_EVENT_MEMBER_CHANGED event with changeType=PEER_MEMBER_JOINED. However, again, the updated credentials are not taken.

If anyone has a working example, showing the expiry date of a member being updated correctly using PeerGroupIssueCredentials, I would really appreciate some help.

The other interesting limitation that I came across is that there doesn't appear to be a way to send a change to PEER_MEMBER.pwzAttributes back to the group.