How do I get a printable IPv6 address (as obtained from getaddrinfo)
without having a IPv6 stack installed? I tried
...
struct addrinfo *ai;
char buf[50] = "??";
DWORD buf_len = sizeof(buf);

if (getaddrinfo("www.kame.net", "80", hints, &ai) == 0) {
if (WSAAddressToString (ai->ai_addr, ai->ai_addrlen,NULL,buf,&buf_len))
puts ("failed");
}
....

I only get WSAEINVAL from WSAAddressToString(), but fail to see that I've
used it wrong. It works fine with an AF_INET address of course.

I can see in tcpdump that an AAAA record is sent and a reply
is received and thus getaddrinfo() succeedes. But how to print it?
Do I have to use getnameinfo() with flags = NI_NUMERICHOST?

--gv