Paolo Bonzini wrote:
> I'm wondering if some programs out there used WSAStartup autonomously 
> without going through the sockets module...

That would not hurt. WSAStartup succeeds when called repeatedly, even
when called with different version numbers:

$ cat foo.c
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
int main()
{
  WSADATA data;
  int err;

  err = WSAStartup (0x101, &data);
  printf ("%d\n", err);
  err = WSAStartup (0x101, &data);
  printf ("%d\n", err);
  err = WSAStartup (0x201, &data);
  printf ("%d\n", err);
  err = WSAStartup (0x101, &data);
  printf ("%d\n", err);
  return 0;
}

$ gcc -mno-cygwin foo.c -lws2_32

$ ./a.exe 
0
0
0
0


Bruno


Reply via email to