Andrey,
Thanks for your comments. I've updated and re-sent the patch, please let me know if you see any problems with it.
I knocked up a quick test and you are correct, native ws2_32 does not allow a 0 handle in WSIoctl. I'll send a patch for that once this set is commited.
Cheers Jon