March 11, 2026
12:04 p.m.
Hans Leidekker (@hans) commented about dlls/wbemprox/tests/query.c:
SysFreeString( wql ); }
+const WCHAR* get_ip_type(const WCHAR* ip) { + struct sockaddr_in sa; + struct sockaddr_in6 sa6; + + if (InetPtonW(AF_INET, ip, &(sa.sin_addr)) == 1) return L"IPv4"; + else if (InetPtonW(AF_INET6, ip, &(sa6.sin6_addr)) == 1) return L"IPv6"; + + return L"Unknow"; +}
There's no need to use winsock functions, you can just check for '.' or ':' in the address. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10272#note_131822