BTW, if anyone is looking, you can code programmatically control the IPv4 firewall via the ICS/ICF API. And the docs for the IPv6 firewall SDK are online.
Links relevant to P2P
My contact on the P2P team just gave me two more important links for the construction of IPv6 based P2P apps. The first is IP Helper, a library included with XP that “enables the retrieval and modification of network configuration settings for the local computer”. I had never seen that library before, but it’s full of useful methods like GetAdaptersInfo and GetAdaptersAddresses. I want to be able to retrieve the IPv6 address of my NICs directly, so this is the library I need. Anyone out there wrapped it in managed code yet? I was hoping to do this part with WMI, but the IPv6 info doesn’t seem to be exposed via WMI.
The other relevant link is the IPv6 Internet Connection Firewall SDK, which “contains all the software required to configure the IPv6 Internet Connection Firewall”. I assume that means that I can open relevant ports to enable P2P communication. As I wrote yesterday, the issue I’m having with GraphChat is likely related to the IPv6 Firewall configuration. I’d like to include in my P2P managed library the ability to manage the IPv6 Firewall.
P2P Problems Solved
Someone from the P2P team internally saw my blog and set me a list of commands to execute and send back to him to help troubleshoot my problem. One of those commands was “net start pnrpsvc”. Aha! I hadn’t realized that the WinXP Adv. Networking Pack installed any services. Turns out it installs four, including the “Peer Name Resolution Protocol” service (i.e. pnrpsvc). What’s odd is that now that I’ve started it manually once, it seems to autostart on demand now. I can resolve addresses, as well as ping the seed server. GraphChat doesn’t work yet, but I think that’s because the IPv6 firewall only has two ports open by default – PNRP (UDP 3540) and Grouping (TCP 3587). The GraphChat sample uses a dynamically chosen port, which would be blocked.
So now that I’m back on track, I’ve got the PNRP namespace provider API wrapped in Managed C++. I can register, unregister, resolve and enumerate PNRP clouds from managed code. I’ve also got a first pass of the Identity Manager API and a skeleton of the Graphing API done. I’ll post code when I have a managed GraphChat sample working.
More on Function Interception
I got an email from Steve Maine who used JavaScript’s support for function pointers to extend the Page_ClientValidate function. Steve’s version calls the built-in version, but then sets the cursor focus to the first invalid control (assuming there are any). Pretty cool.
However, Steve goes on to talk about how quickly function interception can become unmaintainable. Dealing with the ability to override expected functionality is hard enough in object oriented languages. They call it the “fragile base class problem” for a reason. In JavaScript, you have the potential for the “fragile intercepted method problem”. Granted, my solution is also “intercepting” a method, albeit in a lo-tech, code injection, search-and-replace kind of way. But maintainability needs to be of paramount importance in system design. I don’t want to have to go mucking about in the plumbing primarily because plumbing skills are at a premium (I hear Don is trying to hire them all for his team).
More on Hacking __doPostBack
I got an email from Phil Weber who had an interesting solution to the __doPostBack problem. He used JavaScript’s function pointer support to redirect __doPostBack to a function of his own creation. In this function, he can add whatever functionality he wants, including a call to the original __doPostBack method. And what’s funny, like me he was having an issue with a rich text editor. What is it about rich text editors? (They’re non standard, that’s probably what it is).
This is a pretty elegant solution. Especially since his solution can be enabled on a single page as needed. My solution processes every page output from the site. The primary benefit of my solution is that it can add the additional code directly into the __doPostBack function, which means I don’t have to replicate the code to get the “theform” instance. Also, since it automatically fixes up every page in the web app, I don’t have to remember to turn it on in every page.
If you ask Phil nicely, he might send you his code. If we all ask him nicely, maybe he’ll post it.