1#include <winapifamily.h>
23#pragma region Desktop Family
24#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
35#pragma warning(disable:4820)
41typedef unsigned char u_char;
42typedef unsigned short u_short;
43typedef unsigned int u_int;
44typedef unsigned long u_long;
51typedef UINT_PTR SOCKET;
65typedef struct fd_set {
67 SOCKET fd_array[FD_SETSIZE];
74extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
81#define FD_CLR(fd, set) do { \
83 for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
84 if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
85 while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
86 ((fd_set FAR *)(set))->fd_array[__i] = \
87 ((fd_set FAR *)(set))->fd_array[__i+1]; \
90 ((fd_set FAR *)(set))->fd_count--; \
96#define FD_SET(fd, set) do { \
97 if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \
98 ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=(fd);\
101#define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0)
103#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set))
118#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
119#define timercmp(tvp, uvp, cmp) \
120 ((tvp)->tv_sec cmp (uvp)->tv_sec || \
121 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
122#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
134#define IOCPARM_MASK 0x7f
135#define IOC_VOID 0x20000000
136#define IOC_OUT 0x40000000
137#define IOC_IN 0x80000000
138#define IOC_INOUT (IOC_IN|IOC_OUT)
141#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
143#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
145#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
147#define FIONREAD _IOR('f', 127, u_long)
148#define FIONBIO _IOW('f', 126, u_long)
149#define FIOASYNC _IOW('f', 125, u_long)
152#define SIOCSHIWAT _IOW('s', 0, u_long)
153#define SIOCGHIWAT _IOR('s', 1, u_long)
154#define SIOCSLOWAT _IOW('s', 2, u_long)
155#define SIOCGLOWAT _IOR('s', 3, u_long)
156#define SIOCATMARK _IOR('s', 7, u_long)
166 char FAR * FAR * h_aliases;
169 char FAR * FAR * h_addr_list;
170#define h_addr h_addr_list[0]
179 char FAR * FAR * n_aliases;
186 char FAR * FAR * s_aliases;
198 char FAR * FAR * p_aliases;
211#define IPPROTO_ICMP 1
212#define IPPROTO_IGMP 2
215#define IPPROTO_PUP 12
216#define IPPROTO_UDP 17
217#define IPPROTO_IDP 22
220#define IPPROTO_RAW 255
221#define IPPROTO_MAX 256
227#define IPPORT_DISCARD 9
228#define IPPORT_SYSTAT 11
229#define IPPORT_DAYTIME 13
230#define IPPORT_NETSTAT 15
232#define IPPORT_TELNET 23
233#define IPPORT_SMTP 25
234#define IPPORT_TIMESERVER 37
235#define IPPORT_NAMESERVER 42
236#define IPPORT_WHOIS 43
242#define IPPORT_TFTP 69
244#define IPPORT_FINGER 79
245#define IPPORT_TTYLINK 87
246#define IPPORT_SUPDUP 95
251#define IPPORT_EXECSERVER 512
252#define IPPORT_LOGINSERVER 513
253#define IPPORT_CMDSERVER 514
254#define IPPORT_EFSSERVER 520
259#define IPPORT_BIFFUDP 512
260#define IPPORT_WHOSERVER 513
261#define IPPORT_ROUTESERVER 520
268#define IPPORT_RESERVED 1024
273#define IMPLINK_IP 155
274#define IMPLINK_LOWEXPER 156
275#define IMPLINK_HIGHEXPER 158
284#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
285#define IN_CLASSA_NET 0xff000000
286#define IN_CLASSA_NSHIFT 24
287#define IN_CLASSA_HOST 0x00ffffff
288#define IN_CLASSA_MAX 128
290#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
291#define IN_CLASSB_NET 0xffff0000
292#define IN_CLASSB_NSHIFT 16
293#define IN_CLASSB_HOST 0x0000ffff
294#define IN_CLASSB_MAX 65536
296#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
297#define IN_CLASSC_NET 0xffffff00
298#define IN_CLASSC_NSHIFT 8
299#define IN_CLASSC_HOST 0x000000ff
301#define INADDR_ANY (u_long)0x00000000
302#define INADDR_LOOPBACK 0x7f000001
303#define INADDR_BROADCAST (u_long)0xffffffff
304#define INADDR_NONE 0xffffffff
312 struct in_addr sin_addr;
316#define WSADESCRIPTION_LEN 256
317#define WSASYS_STATUS_LEN 128
319typedef struct WSAData {
323 unsigned short iMaxSockets;
324 unsigned short iMaxUdpDg;
325 char FAR * lpVendorInfo;
326 char szDescription[WSADESCRIPTION_LEN+1];
327 char szSystemStatus[WSASYS_STATUS_LEN+1];
329 char szDescription[WSADESCRIPTION_LEN+1];
330 char szSystemStatus[WSASYS_STATUS_LEN+1];
331 unsigned short iMaxSockets;
332 unsigned short iMaxUdpDg;
333 char FAR * lpVendorInfo;
337typedef WSADATA FAR *LPWSADATA;
343#define IP_MULTICAST_IF 2
344#define IP_MULTICAST_TTL 3
345#define IP_MULTICAST_LOOP 4
346#define IP_ADD_MEMBERSHIP 5
347#define IP_DROP_MEMBERSHIP 6
350#define IP_DONTFRAGMENT 9
353#define IP_DEFAULT_MULTICAST_TTL 1
354#define IP_DEFAULT_MULTICAST_LOOP 1
355#define IP_MAX_MEMBERSHIPS 20
361 struct in_addr imr_multiaddr;
362 struct in_addr imr_interface;
374#define INVALID_SOCKET (SOCKET)(~0)
375#define SOCKET_ERROR (-1)
384#define SOCK_SEQPACKET 5
389#define SO_DEBUG 0x0001
390#define SO_ACCEPTCONN 0x0002
391#define SO_REUSEADDR 0x0004
392#define SO_KEEPALIVE 0x0008
393#define SO_DONTROUTE 0x0010
394#define SO_BROADCAST 0x0020
395#define SO_USELOOPBACK 0x0040
396#define SO_LINGER 0x0080
397#define SO_OOBINLINE 0x0100
399#define SO_DONTLINGER (u_int)(~SO_LINGER)
404#define SO_SNDBUF 0x1001
405#define SO_RCVBUF 0x1002
406#define SO_SNDLOWAT 0x1003
407#define SO_RCVLOWAT 0x1004
408#define SO_SNDTIMEO 0x1005
409#define SO_RCVTIMEO 0x1006
410#define SO_ERROR 0x1007
411#define SO_TYPE 0x1008
417#define SO_CONNDATA 0x7000
418#define SO_CONNOPT 0x7001
419#define SO_DISCDATA 0x7002
420#define SO_DISCOPT 0x7003
421#define SO_CONNDATALEN 0x7004
422#define SO_CONNOPTLEN 0x7005
423#define SO_DISCDATALEN 0x7006
424#define SO_DISCOPTLEN 0x7007
429#define SO_OPENTYPE 0x7008
431#define SO_SYNCHRONOUS_ALERT 0x10
432#define SO_SYNCHRONOUS_NONALERT 0x20
437#define SO_MAXDG 0x7009
438#define SO_MAXPATHDG 0x700A
439#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
440#define SO_CONNECT_TIME 0x700C
445#define TCP_NODELAY 0x0001
446#define TCP_BSDURGENT 0x7000
469#define AF_APPLETALK 16
471#define AF_VOICEVIEW 18
473#define AF_UNKNOWN1 20
499#define PF_UNSPEC AF_UNSPEC
500#define PF_UNIX AF_UNIX
501#define PF_INET AF_INET
502#define PF_IMPLINK AF_IMPLINK
504#define PF_CHAOS AF_CHAOS
509#define PF_ECMA AF_ECMA
510#define PF_DATAKIT AF_DATAKIT
511#define PF_CCITT AF_CCITT
513#define PF_DECnet AF_DECnet
516#define PF_HYLINK AF_HYLINK
517#define PF_APPLETALK AF_APPLETALK
518#define PF_VOICEVIEW AF_VOICEVIEW
519#define PF_FIREFOX AF_FIREFOX
520#define PF_UNKNOWN1 AF_UNKNOWN1
536#define SOL_SOCKET 0xffff
545#define MSG_DONTROUTE 0x4
547#define MSG_MAXIOVLEN 16
549#define MSG_PARTIAL 0x8000
554#define MAXGETHOSTSTRUCT 1024
562#define FD_ACCEPT 0x08
563#define FD_CONNECT 0x10
576#define WSABASEERR 10000
580#define WSAEINTR (WSABASEERR+4)
581#define WSAEBADF (WSABASEERR+9)
582#define WSAEACCES (WSABASEERR+13)
583#define WSAEFAULT (WSABASEERR+14)
584#define WSAEINVAL (WSABASEERR+22)
585#define WSAEMFILE (WSABASEERR+24)
590#define WSAEWOULDBLOCK (WSABASEERR+35)
591#define WSAEINPROGRESS (WSABASEERR+36)
592#define WSAEALREADY (WSABASEERR+37)
593#define WSAENOTSOCK (WSABASEERR+38)
594#define WSAEDESTADDRREQ (WSABASEERR+39)
595#define WSAEMSGSIZE (WSABASEERR+40)
596#define WSAEPROTOTYPE (WSABASEERR+41)
597#define WSAENOPROTOOPT (WSABASEERR+42)
598#define WSAEPROTONOSUPPORT (WSABASEERR+43)
599#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
600#define WSAEOPNOTSUPP (WSABASEERR+45)
601#define WSAEPFNOSUPPORT (WSABASEERR+46)
602#define WSAEAFNOSUPPORT (WSABASEERR+47)
603#define WSAEADDRINUSE (WSABASEERR+48)
604#define WSAEADDRNOTAVAIL (WSABASEERR+49)
605#define WSAENETDOWN (WSABASEERR+50)
606#define WSAENETUNREACH (WSABASEERR+51)
607#define WSAENETRESET (WSABASEERR+52)
608#define WSAECONNABORTED (WSABASEERR+53)
609#define WSAECONNRESET (WSABASEERR+54)
610#define WSAENOBUFS (WSABASEERR+55)
611#define WSAEISCONN (WSABASEERR+56)
612#define WSAENOTCONN (WSABASEERR+57)
613#define WSAESHUTDOWN (WSABASEERR+58)
614#define WSAETOOMANYREFS (WSABASEERR+59)
615#define WSAETIMEDOUT (WSABASEERR+60)
616#define WSAECONNREFUSED (WSABASEERR+61)
617#define WSAELOOP (WSABASEERR+62)
618#define WSAENAMETOOLONG (WSABASEERR+63)
619#define WSAEHOSTDOWN (WSABASEERR+64)
620#define WSAEHOSTUNREACH (WSABASEERR+65)
621#define WSAENOTEMPTY (WSABASEERR+66)
622#define WSAEPROCLIM (WSABASEERR+67)
623#define WSAEUSERS (WSABASEERR+68)
624#define WSAEDQUOT (WSABASEERR+69)
625#define WSAESTALE (WSABASEERR+70)
626#define WSAEREMOTE (WSABASEERR+71)
628#define WSAEDISCON (WSABASEERR+101)
633#define WSASYSNOTREADY (WSABASEERR+91)
634#define WSAVERNOTSUPPORTED (WSABASEERR+92)
635#define WSANOTINITIALISED (WSABASEERR+93)
650#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
653#define WSATRY_AGAIN (WSABASEERR+1002)
656#define WSANO_RECOVERY (WSABASEERR+1003)
659#define WSANO_DATA (WSABASEERR+1004)
662#define WSA_SECURE_HOST_NOT_FOUND (WSABASEERR+1032)
666#define WSA_IPSEC_NAME_POLICY_ERROR (WSABASEERR+1033)
679#define h_errno WSAGetLastError()
680#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
681#define TRY_AGAIN WSATRY_AGAIN
682#define NO_RECOVERY WSANO_RECOVERY
683#define NO_DATA WSANO_DATA
685#define WSANO_ADDRESS WSANO_DATA
686#define NO_ADDRESS WSANO_ADDRESS
694#define EWOULDBLOCK WSAEWOULDBLOCK
695#define EINPROGRESS WSAEINPROGRESS
696#define EALREADY WSAEALREADY
697#define ENOTSOCK WSAENOTSOCK
698#define EDESTADDRREQ WSAEDESTADDRREQ
699#define EMSGSIZE WSAEMSGSIZE
700#define EPROTOTYPE WSAEPROTOTYPE
701#define ENOPROTOOPT WSAENOPROTOOPT
702#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
703#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
704#define EOPNOTSUPP WSAEOPNOTSUPP
705#define EPFNOSUPPORT WSAEPFNOSUPPORT
706#define EAFNOSUPPORT WSAEAFNOSUPPORT
707#define EADDRINUSE WSAEADDRINUSE
708#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
709#define ENETDOWN WSAENETDOWN
710#define ENETUNREACH WSAENETUNREACH
711#define ENETRESET WSAENETRESET
712#define ECONNABORTED WSAECONNABORTED
713#define ECONNRESET WSAECONNRESET
714#define ENOBUFS WSAENOBUFS
715#define EISCONN WSAEISCONN
716#define ENOTCONN WSAENOTCONN
717#define ESHUTDOWN WSAESHUTDOWN
718#define ETOOMANYREFS WSAETOOMANYREFS
719#define ETIMEDOUT WSAETIMEDOUT
720#define ECONNREFUSED WSAECONNREFUSED
721#define ELOOP WSAELOOP
722#define ENAMETOOLONG WSAENAMETOOLONG
723#define EHOSTDOWN WSAEHOSTDOWN
724#define EHOSTUNREACH WSAEHOSTUNREACH
725#define ENOTEMPTY WSAENOTEMPTY
726#define EPROCLIM WSAEPROCLIM
727#define EUSERS WSAEUSERS
728#define EDQUOT WSAEDQUOT
729#define ESTALE WSAESTALE
730#define EREMOTE WSAEREMOTE
739SOCKET PASCAL FAR accept (
741 _Out_writes_bytes_opt_(*addrlen)
struct sockaddr FAR *addr,
742 _Inout_opt_
int FAR *addrlen);
746 _In_reads_bytes_(namelen)
const struct sockaddr FAR *addr,
749int PASCAL FAR closesocket ( IN SOCKET s);
751int PASCAL FAR connect (
753 _In_reads_bytes_(namelen)
const struct sockaddr FAR *name,
756int PASCAL FAR ioctlsocket (
759 _Inout_ u_long FAR *argp);
761int PASCAL FAR getpeername (
763 _Out_writes_bytes_to_(*namelen, *namelen)
struct sockaddr FAR *name,
764 _Inout_
int FAR * namelen);
766int PASCAL FAR getsockname (
768 _Out_writes_bytes_to_(*namelen, *namelen)
struct sockaddr FAR *name,
769 _Inout_
int FAR * namelen);
771int PASCAL FAR getsockopt (
775 _Out_writes_bytes_(*optlen)
char FAR * optval,
776 _Inout_
int FAR *optlen);
778u_long PASCAL FAR htonl ( _In_ u_long hostlong);
780u_short PASCAL FAR htons (_In_ u_short hostshort);
782unsigned long PASCAL FAR inet_addr (_In_z_
const char FAR * cp);
784char FAR * PASCAL FAR inet_ntoa (_In_
struct in_addr in);
786int PASCAL FAR listen (
790u_long PASCAL FAR ntohl (_In_ u_long netlong);
792u_short PASCAL FAR ntohs (_In_ u_short netshort);
796 _Out_writes_bytes_to_(len,
return) __out_data_source(NETWORK)
char FAR * buf,
800int PASCAL FAR recvfrom (
802 _Out_writes_bytes_to_(len,
return) __out_data_source(NETWORK)
char FAR * buf,
805 _Out_writes_bytes_to_opt_(*fromlen, *fromlen)
struct sockaddr FAR * from,
806 _Inout_opt_
int FAR * fromlen);
808int PASCAL FAR select (
810 _Inout_opt_ fd_set FAR *readfds,
811 _Inout_opt_ fd_set FAR *writefds,
812 _Inout_opt_ fd_set FAR *exceptfds,
813 _In_opt_
const struct timeval FAR *timeout);
817 _In_reads_bytes_(len)
const char FAR * buf,
821int PASCAL FAR sendto (
823 _In_reads_bytes_(len)
const char FAR * buf,
826 _In_reads_bytes_opt_(tolen)
const struct sockaddr FAR *to,
829int PASCAL FAR setsockopt (
833 _In_reads_bytes_opt_(optlen)
const char FAR * optval,
836int PASCAL FAR shutdown (
840SOCKET PASCAL FAR socket (
847struct hostent FAR * PASCAL FAR gethostbyaddr(
848 _In_reads_bytes_(len)
const char FAR * addr,
852struct hostent FAR * PASCAL FAR gethostbyname(_In_z_
const char FAR * name);
854int PASCAL FAR gethostname (
855 _Out_writes_bytes_to_(namelen,
return)
char FAR * name,
858struct servent FAR * PASCAL FAR getservbyport(
860 _In_z_
const char FAR * proto);
862struct servent FAR * PASCAL FAR getservbyname(
863 _In_z_
const char FAR * name,
864 _In_z_
const char FAR * proto);
866struct protoent FAR * PASCAL FAR getprotobynumber(_In_
int proto);
868struct protoent FAR * PASCAL FAR getprotobyname(_In_z_
const char FAR * name);
872int PASCAL FAR WSAStartup(
873 _In_ WORD wVersionRequired,
874 _Out_ LPWSADATA lpWSAData);
876int PASCAL FAR WSACleanup(
void);
878void PASCAL FAR WSASetLastError(_In_
int iError);
880int PASCAL FAR WSAGetLastError(
void);
882BOOL PASCAL FAR WSAIsBlocking(
void);
884int PASCAL FAR WSAUnhookBlockingHook(
void);
886FARPROC PASCAL FAR WSASetBlockingHook(_In_ FARPROC lpBlockFunc);
888int PASCAL FAR WSACancelBlockingCall(
void);
890HANDLE PASCAL FAR WSAAsyncGetServByName(
893 _In_z_
const char FAR * name,
894 _In_z_
const char FAR * proto,
895 _Out_writes_bytes_(buflen)
char FAR * buf,
898HANDLE PASCAL FAR WSAAsyncGetServByPort(
902 _In_
const char FAR * proto,
903 _Out_writes_bytes_(buflen)
char FAR * buf,
906HANDLE PASCAL FAR WSAAsyncGetProtoByName(
909 _In_z_
const char FAR * name,
910 _Out_writes_bytes_(buflen)
char FAR * buf,
913HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(
917 _Out_writes_bytes_(buflen)
char FAR * buf,
920HANDLE PASCAL FAR WSAAsyncGetHostByName(
923 _In_z_
const char FAR * name,
924 _Out_writes_bytes_(buflen)
char FAR * buf,
927HANDLE PASCAL FAR WSAAsyncGetHostByAddr(
930 _In_
const char FAR * addr,
933 _Out_writes_bytes_(buflen)
char FAR * buf,
936int PASCAL FAR WSACancelAsyncRequest(_In_ HANDLE hAsyncTaskHandle);
938int PASCAL FAR WSAAsyncSelect(
944int PASCAL FAR WSARecvEx (
946 _Out_writes_bytes_to_(len,
return) __out_data_source(NETWORK)
char FAR * buf,
948 _Inout_
int FAR *flags);
950typedef struct _TRANSMIT_FILE_BUFFERS {
955} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
957#define TF_DISCONNECT 0x01
958#define TF_REUSE_SOCKET 0x02
959#define TF_WRITE_BEHIND 0x04
966 _In_ DWORD nNumberOfBytesToWrite,
967 _In_ DWORD nNumberOfBytesPerSend,
968 _Inout_opt_ LPOVERLAPPED lpOverlapped,
969 _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
970 _In_ DWORD dwReserved
976 _In_ SOCKET sListenSocket,
977 _In_ SOCKET sAcceptSocket,
978 _Out_writes_bytes_to_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength,
979 *lpdwBytesReceived) PVOID lpOutputBuffer,
980 _In_ DWORD dwReceiveDataLength,
981 _In_ DWORD dwLocalAddressLength,
982 _In_ DWORD dwRemoteAddressLength,
983 _Out_ LPDWORD lpdwBytesReceived,
984 _Inout_ LPOVERLAPPED lpOverlapped
989GetAcceptExSockaddrs (
990 _In_reads_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer,
991 _In_ DWORD dwReceiveDataLength,
992 _In_ DWORD dwLocalAddressLength,
993 _In_ DWORD dwRemoteAddressLength,
994 _Outptr_result_bytebuffer_(*LocalSockaddrLength)
struct sockaddr **LocalSockaddr,
995 _Out_ LPINT LocalSockaddrLength,
996 _Outptr_result_bytebuffer_(*RemoteSockaddrLength)
struct sockaddr **RemoteSockaddr,
997 _Out_ LPINT RemoteSockaddrLength
1005typedef struct sockaddr SOCKADDR;
1006typedef struct sockaddr *PSOCKADDR;
1007typedef struct sockaddr FAR *LPSOCKADDR;
1009typedef struct sockaddr_in SOCKADDR_IN;
1010typedef struct sockaddr_in *PSOCKADDR_IN;
1011typedef struct sockaddr_in FAR *LPSOCKADDR_IN;
1013typedef struct linger LINGER;
1014typedef struct linger *PLINGER;
1015typedef struct linger FAR *LPLINGER;
1017typedef struct fd_set FD_SET;
1018typedef struct fd_set *PFD_SET;
1019typedef struct fd_set FAR *LPFD_SET;
1021typedef struct hostent HOSTENT;
1022typedef struct hostent *PHOSTENT;
1023typedef struct hostent FAR *LPHOSTENT;
1025typedef struct servent SERVENT;
1026typedef struct servent *PSERVENT;
1027typedef struct servent FAR *LPSERVENT;
1029typedef struct protoent PROTOENT;
1030typedef struct protoent *PPROTOENT;
1031typedef struct protoent FAR *LPPROTOENT;
1033typedef struct timeval TIMEVAL;
1034typedef struct timeval *PTIMEVAL;
1035typedef struct timeval FAR *LPTIMEVAL;
1044#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
1049#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
1055#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
1061#define WSAGETASYNCERROR(lParam) HIWORD(lParam)
1067#define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
1073#define WSAGETSELECTERROR(lParam) HIWORD(lParam)
1075#if(_WIN32_WINNT >= 0x0501)
1077#error WINSOCK2 required.