Replace
Code Snippet
struct in6_addr sin6;inet_pton(AF_INET6, addr, &sin6);
with something like
Code Snippet
struct in6_addr sin6;
struct sockaddr_storage ss;
int sslen = sizeof(ss);
WSAStringToAddressA(addr, AF_INET6, NULL, (struct sockaddr*)&ss, &sslen);
sin6 = ((struct sockaddr_in6 *)&ss)->sin6_addr;