Turns out InetPton expects a UTF-16 string by default, so I just called InetPtonA, which expects a "normal" ASCII char*, so instead of calling
int result = InetPton(AF_INET, serverAddress, &serverAddr.sin_addr.S_un.S_addr);
which redirects to InetPtonW()
,
I used
int result = InetPtonA(AF_INET, serverAddress, &serverAddr.sin_addr.S_un.S_addr);
.