http://bugs.winehq.org/show_bug.cgi?id=11965
Summary: WSAStartup() is not required to do networking Product: Wine Version: 0.9.49. Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P1 Component: winsock AssignedTo: wine-bugs@winehq.org ReportedBy: mark@ookoo.org
On Windows (tested at least on Xp, and this is also according to MSDN doc), when calling any network function, you absolutely have to call WSAStartup() before.
If you didn't call WSAStartup(), any ws2_32 function will fail, with error WSANOTINITIALISED (10093).
I'm writing cross-compilable programs on linux that should also run on Win32, and I do all my tests on wine. It took me a while to find out why people trying to use this program on real windows boxes had troubles accessing network.
The expected behaviour for Winsock2 functions is to fail, unless WSAStartup() was called. For each time you call WSAStartup(), you have to call WSACleanup() once.