#include <winapifamily.h>
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#if _MSC_VER > 1000
#pragma once
#endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifndef _INC_WINDOWS
#include <windows.h>
#endif /* _INC_WINDOWS */
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
typedef
unsigned
char
;
typedef
unsigned
short
;
typedef
unsigned
int
;
typedef
unsigned
long
;
typedef
;
#ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif /* FD_SETSIZE */
typedef
struct
{
;
SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */
}
;
#ifdef __cplusplus
extern
"C"
{
#endif
extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
extern
int
__stdcall
(
,
*);
#ifdef __cplusplus
}
#endif
#define FD_CLR(fd, set) do { \
u_int __i; \
for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
((fd_set FAR *)(set))->fd_array[__i] = \
((fd_set FAR *)(set))->fd_array[__i+1]; \
__i++; \
} \
((fd_set FAR *)(set))->fd_count--; \
break; \
} \
} \
} while(0)
#define FD_SET(fd, set) do { \
if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \
((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=(fd);\
} while(0)
#define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0)
#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set))
struct
{
long
;
long
;
};
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp, uvp, cmp) \
((tvp)->tv_sec cmp (uvp)->tv_sec || \
(tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
#define IOC_VOID 0x20000000 /* no parameters */
#define IOC_OUT 0x40000000 /* copy out parameters */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_INOUT (IOC_IN|IOC_OUT)
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
#define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */
#define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */
#define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */
#define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */
#define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */
#define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */
#define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */
#define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */
struct
{
char FAR * h_name; /* official name of host */
char FAR * FAR * h_aliases; /* alias list */
short
;
short
;
char FAR * FAR * h_addr_list; /* list of addresses */
#define h_addr h_addr_list[0] /* address, for backward compat */
};
struct
{
char FAR * n_name; /* official name of net */
char FAR * FAR * n_aliases; /* alias list */
short
;
;
};
struct
{
char FAR * s_name; /* official service name */
char FAR * FAR * s_aliases; /* alias list */
#ifdef _WIN64
char FAR * s_proto; /* protocol to use */
short s_port; /* port # */
#else
short
;
char FAR * s_proto; /* protocol to use */
#endif
};
struct
{
char FAR * p_name; /* official protocol name */
char FAR * FAR * p_aliases; /* alias list */
short
;
};
#define IPPROTO_IP 0 /* dummy for IP */
#define IPPROTO_ICMP 1 /* control message protocol */
#define IPPROTO_IGMP 2 /* group management protocol */
#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
#define IPPROTO_TCP 6 /* tcp */
#define IPPROTO_PUP 12 /* pup */
#define IPPROTO_UDP 17 /* user datagram protocol */
#define IPPROTO_IDP 22 /* xns idp */
#define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */
#define IPPROTO_RAW 255 /* raw IP packet */
#define IPPROTO_MAX 256
#define IPPORT_ECHO 7
#define IPPORT_DISCARD 9
#define IPPORT_SYSTAT 11
#define IPPORT_DAYTIME 13
#define IPPORT_NETSTAT 15
#define IPPORT_FTP 21
#define IPPORT_TELNET 23
#define IPPORT_SMTP 25
#define IPPORT_TIMESERVER 37
#define IPPORT_NAMESERVER 42
#define IPPORT_WHOIS 43
#define IPPORT_MTP 57
#define IPPORT_TFTP 69
#define IPPORT_RJE 77
#define IPPORT_FINGER 79
#define IPPORT_TTYLINK 87
#define IPPORT_SUPDUP 95
#define IPPORT_EXECSERVER 512
#define IPPORT_LOGINSERVER 513
#define IPPORT_CMDSERVER 514
#define IPPORT_EFSSERVER 520
#define IPPORT_BIFFUDP 512
#define IPPORT_WHOSERVER 513
#define IPPORT_ROUTESERVER 520
#define IPPORT_RESERVED 1024
#define IMPLINK_IP 155
#define IMPLINK_LOWEXPER 156
#define IMPLINK_HIGHEXPER 158
#include <inaddr.h>
#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST 0x00ffffff
#define IN_CLASSA_MAX 128
#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST 0x0000ffff
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST 0x000000ff
#define INADDR_ANY (u_long)0x00000000
#define INADDR_LOOPBACK 0x7f000001
#define INADDR_BROADCAST (u_long)0xffffffff
#define INADDR_NONE 0xffffffff
struct
{
short
;
;
struct
;
char
[
8
];
};
#define WSADESCRIPTION_LEN 256
#define WSASYS_STATUS_LEN 128
typedef
struct
{
;
;
#ifdef _WIN64
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
char FAR * lpVendorInfo;
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
#else
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
unsigned
short
;
unsigned
short
;
char FAR * lpVendorInfo;
#endif
}
;
typedef WSADATA FAR *LPWSADATA;
#define IP_OPTIONS 1 /* set/get IP per-packet options */
#define IP_MULTICAST_IF 2 /* set/get IP multicast interface */
#define IP_MULTICAST_TTL 3 /* set/get IP multicast timetolive */
#define IP_MULTICAST_LOOP 4 /* set/get IP multicast loopback */
#define IP_ADD_MEMBERSHIP 5 /* add an IP group membership */
#define IP_DROP_MEMBERSHIP 6 /* drop an IP group membership */
#define IP_TTL 7 /* set/get IP Time To Live */
#define IP_TOS 8 /* set/get IP Type Of Service */
#define IP_DONTFRAGMENT 9 /* set/get IP Don't Fragment flag */
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
struct
{
struct
;
struct
;
};
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#define SOCK_STREAM 1 /* stream socket */
#define SOCK_DGRAM 2 /* datagram socket */
#define SOCK_RAW 3 /* raw-protocol interface */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequenced packet stream */
#define SO_DEBUG 0x0001 /* turn on debugging info recording */
#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
#define SO_REUSEADDR 0x0004 /* allow local address reuse */
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
#define SO_DONTROUTE 0x0010 /* just use interface addresses */
#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
#define SO_LINGER 0x0080 /* linger on close if data present */
#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
#define SO_DONTLINGER (u_int)(~SO_LINGER)
#define SO_SNDBUF 0x1001 /* send buffer size */
#define SO_RCVBUF 0x1002 /* receive buffer size */
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
#define SO_SNDTIMEO 0x1005 /* send timeout */
#define SO_RCVTIMEO 0x1006 /* receive timeout */
#define SO_ERROR 0x1007 /* get error status and clear */
#define SO_TYPE 0x1008 /* get socket type */
#define SO_CONNDATA 0x7000
#define SO_CONNOPT 0x7001
#define SO_DISCDATA 0x7002
#define SO_DISCOPT 0x7003
#define SO_CONNDATALEN 0x7004
#define SO_CONNOPTLEN 0x7005
#define SO_DISCDATALEN 0x7006
#define SO_DISCOPTLEN 0x7007
#define SO_OPENTYPE 0x7008
#define SO_SYNCHRONOUS_ALERT 0x10
#define SO_SYNCHRONOUS_NONALERT 0x20
#define SO_MAXDG 0x7009
#define SO_MAXPATHDG 0x700A
#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
#define SO_CONNECT_TIME 0x700C
#define TCP_NODELAY 0x0001
#define TCP_BSDURGENT 0x7000
#define AF_UNSPEC 0 /* unspecified */
#define AF_UNIX 1 /* local to host (pipes, portals) */
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
#define AF_IMPLINK 3 /* arpanet imp addresses */
#define AF_PUP 4 /* pup protocols: e.g. BSP */
#define AF_CHAOS 5 /* mit CHAOS protocols */
#define AF_IPX 6 /* IPX and SPX */
#define AF_NS 6 /* XEROX NS protocols */
#define AF_ISO 7 /* ISO protocols */
#define AF_OSI AF_ISO /* OSI is ISO */
#define AF_ECMA 8 /* european computer manufacturers */
#define AF_DATAKIT 9 /* datakit protocols */
#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
#define AF_SNA 11 /* IBM SNA */
#define AF_DECnet 12 /* DECnet */
#define AF_DLI 13 /* Direct data link interface */
#define AF_LAT 14 /* LAT */
#define AF_HYLINK 15 /* NSC Hyperchannel */
#define AF_APPLETALK 16 /* AppleTalk */
#define AF_NETBIOS 17 /* NetBios-style addresses */
#define AF_VOICEVIEW 18 /* VoiceView */
#define AF_FIREFOX 19 /* FireFox */
#define AF_UNKNOWN1 20 /* Somebody is using this! */
#define AF_BAN 21 /* Banyan */
#define AF_MAX 22
struct
{
;
char
[
14
];
};
struct
{
;
;
};
#define PF_UNSPEC AF_UNSPEC
#define PF_UNIX AF_UNIX
#define PF_INET AF_INET
#define PF_IMPLINK AF_IMPLINK
#define PF_PUP AF_PUP
#define PF_CHAOS AF_CHAOS
#define PF_NS AF_NS
#define PF_IPX AF_IPX
#define PF_ISO AF_ISO
#define PF_OSI AF_OSI
#define PF_ECMA AF_ECMA
#define PF_DATAKIT AF_DATAKIT
#define PF_CCITT AF_CCITT
#define PF_SNA AF_SNA
#define PF_DECnet AF_DECnet
#define PF_DLI AF_DLI
#define PF_LAT AF_LAT
#define PF_HYLINK AF_HYLINK
#define PF_APPLETALK AF_APPLETALK
#define PF_VOICEVIEW AF_VOICEVIEW
#define PF_FIREFOX AF_FIREFOX
#define PF_UNKNOWN1 AF_UNKNOWN1
#define PF_BAN AF_BAN
#define PF_MAX AF_MAX
struct
{
;
;
};
#define SOL_SOCKET 0xffff /* options for socket level */
#define SOMAXCONN 5
#define MSG_OOB 0x1 /* process out-of-band data */
#define MSG_PEEK 0x2 /* peek at incoming message */
#define MSG_DONTROUTE 0x4 /* send without using routing tables */
#define MSG_MAXIOVLEN 16
#define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */
#define MAXGETHOSTSTRUCT 1024
#define FD_READ 0x01
#define FD_WRITE 0x02
#define FD_OOB 0x04
#define FD_ACCEPT 0x08
#define FD_CONNECT 0x10
#define FD_CLOSE 0x20
#ifndef WSABASEERR
/*
* All Windows Sockets error constants are biased by WSABASEERR from
* the "normal"
*/
#define WSABASEERR 10000
/*
* Windows Sockets definitions of regular Microsoft C error constants
*/
#define WSAEINTR (WSABASEERR+4)
#define WSAEBADF (WSABASEERR+9)
#define WSAEACCES (WSABASEERR+13)
#define WSAEFAULT (WSABASEERR+14)
#define WSAEINVAL (WSABASEERR+22)
#define WSAEMFILE (WSABASEERR+24)
/*
* Windows Sockets definitions of regular Berkeley error constants
*/
#define WSAEWOULDBLOCK (WSABASEERR+35)
#define WSAEINPROGRESS (WSABASEERR+36)
#define WSAEALREADY (WSABASEERR+37)
#define WSAENOTSOCK (WSABASEERR+38)
#define WSAEDESTADDRREQ (WSABASEERR+39)
#define WSAEMSGSIZE (WSABASEERR+40)
#define WSAEPROTOTYPE (WSABASEERR+41)
#define WSAENOPROTOOPT (WSABASEERR+42)
#define WSAEPROTONOSUPPORT (WSABASEERR+43)
#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
#define WSAEOPNOTSUPP (WSABASEERR+45)
#define WSAEPFNOSUPPORT (WSABASEERR+46)
#define WSAEAFNOSUPPORT (WSABASEERR+47)
#define WSAEADDRINUSE (WSABASEERR+48)
#define WSAEADDRNOTAVAIL (WSABASEERR+49)
#define WSAENETDOWN (WSABASEERR+50)
#define WSAENETUNREACH (WSABASEERR+51)
#define WSAENETRESET (WSABASEERR+52)
#define WSAECONNABORTED (WSABASEERR+53)
#define WSAECONNRESET (WSABASEERR+54)
#define WSAENOBUFS (WSABASEERR+55)
#define WSAEISCONN (WSABASEERR+56)
#define WSAENOTCONN (WSABASEERR+57)
#define WSAESHUTDOWN (WSABASEERR+58)
#define WSAETOOMANYREFS (WSABASEERR+59)
#define WSAETIMEDOUT (WSABASEERR+60)
#define WSAECONNREFUSED (WSABASEERR+61)
#define WSAELOOP (WSABASEERR+62)
#define WSAENAMETOOLONG (WSABASEERR+63)
#define WSAEHOSTDOWN (WSABASEERR+64)
#define WSAEHOSTUNREACH (WSABASEERR+65)
#define WSAENOTEMPTY (WSABASEERR+66)
#define WSAEPROCLIM (WSABASEERR+67)
#define WSAEUSERS (WSABASEERR+68)
#define WSAEDQUOT (WSABASEERR+69)
#define WSAESTALE (WSABASEERR+70)
#define WSAEREMOTE (WSABASEERR+71)
#define WSAEDISCON (WSABASEERR+101)
/*
* Extended Windows Sockets error constant definitions
*/
#define WSASYSNOTREADY (WSABASEERR+91)
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
#define WSANOTINITIALISED (WSABASEERR+93)
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* (when using the resolver). Note that these errors are
* retrieved via WSAGetLastError() and must therefore follow
* the rules for avoiding clashes with error numbers from
* specific implementations or language run-time systems.
* For this reason the codes are based at WSABASEERR+1001.
* Note also that [WSA]NO_ADDRESS is defined only for
* compatibility purposes.
*/
/* Authoritative Answer: Host not found */
#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
/* Non-Authoritative: Host not found, or SERVERFAIL */
#define WSATRY_AGAIN (WSABASEERR+1002)
/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
#define WSANO_RECOVERY (WSABASEERR+1003)
/* Valid name, no data record of requested type */
#define WSANO_DATA (WSABASEERR+1004)
/* Authoritative Answer: Host not found Securely */
#define WSA_SECURE_HOST_NOT_FOUND (WSABASEERR+1032)
/* Name based IPSEC policy could not be added*/
#define WSA_IPSEC_NAME_POLICY_ERROR (WSABASEERR+1033)
/*
* WinSock error codes are also defined in winerror.h
* Hence the IFDEF.
*/
#endif /* ifdef WSABASEERR */
#define h_errno WSAGetLastError()
#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
#define TRY_AGAIN WSATRY_AGAIN
#define NO_RECOVERY WSANO_RECOVERY
#define NO_DATA WSANO_DATA
#define WSANO_ADDRESS WSANO_DATA
#define NO_ADDRESS WSANO_ADDRESS
#if 0
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY
#define ENOTSOCK WSAENOTSOCK
#define EDESTADDRREQ WSAEDESTADDRREQ
#define EMSGSIZE WSAEMSGSIZE
#define EPROTOTYPE WSAEPROTOTYPE
#define ENOPROTOOPT WSAENOPROTOOPT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#define EOPNOTSUPP WSAEOPNOTSUPP
#define EPFNOSUPPORT WSAEPFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EADDRINUSE WSAEADDRINUSE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define ENETDOWN WSAENETDOWN
#define ENETUNREACH WSAENETUNREACH
#define ENETRESET WSAENETRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNRESET WSAECONNRESET
#define ENOBUFS WSAENOBUFS
#define EISCONN WSAEISCONN
#define ENOTCONN WSAENOTCONN
#define ESHUTDOWN WSAESHUTDOWN
#define ETOOMANYREFS WSAETOOMANYREFS
#define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED
#define ELOOP WSAELOOP
#define ENAMETOOLONG WSAENAMETOOLONG
#define EHOSTDOWN WSAEHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH
#define ENOTEMPTY WSAENOTEMPTY
#define EPROCLIM WSAEPROCLIM
#define EUSERS WSAEUSERS
#define EDQUOT WSAEDQUOT
#define ESTALE WSAESTALE
#define EREMOTE WSAEREMOTE
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
SOCKET PASCAL FAR accept (
_Out_writes_bytes_opt_(*addrlen) struct sockaddr FAR *addr,
_Inout_opt_ int FAR *addrlen);
_In_reads_bytes_(namelen) const struct sockaddr FAR *addr,
int PASCAL FAR closesocket ( IN SOCKET s);
_In_reads_bytes_(namelen) const struct sockaddr FAR *name,
int PASCAL FAR ioctlsocket (
_Inout_ u_long FAR *argp);
int PASCAL FAR getpeername (
_Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name,
_Inout_ int FAR * namelen);
int PASCAL FAR getsockname (
_Out_writes_bytes_to_(*namelen, *namelen) struct sockaddr FAR *name,
_Inout_ int FAR * namelen);
int PASCAL FAR getsockopt (
_Out_writes_bytes_(*optlen) char FAR * optval,
_Inout_ int FAR *optlen);
u_long PASCAL FAR htonl ( _In_ u_long hostlong);
u_short PASCAL FAR htons (_In_ u_short hostshort);
unsigned long PASCAL FAR inet_addr (_In_z_ const char FAR * cp);
unsigned
long
__stdcall
(
const
char
*
);
char FAR * PASCAL FAR inet_ntoa (_In_ struct in_addr in);
char
*
__stdcall
(
struct
);
u_long PASCAL FAR ntohl (_In_ u_long netlong);
u_short PASCAL FAR ntohs (_In_ u_short netshort);
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR * buf,
int PASCAL FAR recvfrom (
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR * buf,
_Out_writes_bytes_to_opt_(*fromlen, *fromlen) struct sockaddr FAR * from,
_Inout_opt_ int FAR * fromlen);
_Inout_opt_ fd_set FAR *readfds,
_Inout_opt_ fd_set FAR *writefds,
_Inout_opt_ fd_set FAR *exceptfds,
_In_opt_ const struct timeval FAR *timeout);
_In_reads_bytes_(len) const char FAR * buf,
_In_reads_bytes_(len) const char FAR * buf,
_In_reads_bytes_opt_(tolen) const struct sockaddr FAR *to,
int PASCAL FAR setsockopt (
_In_reads_bytes_opt_(optlen) const char FAR * optval,
int PASCAL FAR shutdown (
SOCKET PASCAL FAR socket (
struct hostent FAR * PASCAL FAR gethostbyaddr(
_In_reads_bytes_(len) const char FAR * addr,
struct hostent FAR * PASCAL FAR gethostbyname(_In_z_ const char FAR * name);
struct
*
__stdcall
(
const
char
*
);
int PASCAL FAR gethostname (
_Out_writes_bytes_to_(namelen, return) char FAR * name,
struct servent FAR * PASCAL FAR getservbyport(
_In_z_ const char FAR * proto);
struct servent FAR * PASCAL FAR getservbyname(
_In_z_ const char FAR * name,
_In_z_ const char FAR * proto);
struct protoent FAR * PASCAL FAR getprotobynumber(_In_ int proto);
struct
*
__stdcall
(
int
);
struct protoent FAR * PASCAL FAR getprotobyname(_In_z_ const char FAR * name);
struct
*
__stdcall
(
const
char
*
);
int PASCAL FAR WSAStartup(
_In_ WORD wVersionRequired,
_Out_ LPWSADATA lpWSAData);
int PASCAL FAR WSACleanup(void);
void PASCAL FAR WSASetLastError(_In_ int iError);
int PASCAL FAR WSAGetLastError(void);
BOOL PASCAL FAR WSAIsBlocking(void);
int PASCAL FAR WSAUnhookBlockingHook(void);
FARPROC PASCAL FAR WSASetBlockingHook(_In_ FARPROC lpBlockFunc);
int PASCAL FAR WSACancelBlockingCall(void);
HANDLE PASCAL FAR WSAAsyncGetServByName(
_In_z_ const char FAR * name,
_In_z_ const char FAR * proto,
_Out_writes_bytes_(buflen) char FAR * buf,
HANDLE PASCAL FAR WSAAsyncGetServByPort(
_In_ const char FAR * proto,
_Out_writes_bytes_(buflen) char FAR * buf,
HANDLE PASCAL FAR WSAAsyncGetProtoByName(
_In_z_ const char FAR * name,
_Out_writes_bytes_(buflen) char FAR * buf,
HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(
_Out_writes_bytes_(buflen) char FAR * buf,
HANDLE PASCAL FAR WSAAsyncGetHostByName(
_In_z_ const char FAR * name,
_Out_writes_bytes_(buflen) char FAR * buf,
HANDLE PASCAL FAR WSAAsyncGetHostByAddr(
_In_ const char FAR * addr,
_Out_writes_bytes_(buflen) char FAR * buf,
int PASCAL FAR WSACancelAsyncRequest(_In_ HANDLE hAsyncTaskHandle);
int PASCAL FAR WSAAsyncSelect(
int PASCAL FAR WSARecvEx (
_Out_writes_bytes_to_(len, return) __out_data_source(NETWORK) char FAR * buf,
typedef
struct
{
;
;
;
;
}
, *
, *
;
#define TF_DISCONNECT 0x01
#define TF_REUSE_SOCKET 0x02
#define TF_WRITE_BEHIND 0x04
(
_In_ DWORD nNumberOfBytesToWrite,
_In_ DWORD nNumberOfBytesPerSend,
_Inout_opt_ LPOVERLAPPED lpOverlapped,
_In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
);
(
_In_ SOCKET sListenSocket,
_In_ SOCKET sAcceptSocket,
_Out_writes_bytes_to_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength,
*lpdwBytesReceived) PVOID lpOutputBuffer,
_In_ DWORD dwReceiveDataLength,
_In_ DWORD dwLocalAddressLength,
_In_ DWORD dwRemoteAddressLength,
_Out_ LPDWORD lpdwBytesReceived,
_Inout_ LPOVERLAPPED lpOverlapped
);
(
_In_reads_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer,
_In_ DWORD dwReceiveDataLength,
_In_ DWORD dwLocalAddressLength,
_In_ DWORD dwRemoteAddressLength,
_Outptr_result_bytebuffer_(*LocalSockaddrLength) struct sockaddr **LocalSockaddr,
_Out_ LPINT LocalSockaddrLength,
_Outptr_result_bytebuffer_(*RemoteSockaddrLength) struct sockaddr **RemoteSockaddr,
_Out_ LPINT RemoteSockaddrLength
);
#ifdef __cplusplus
}
#endif
typedef
struct
;
typedef
struct
*
;
typedef struct sockaddr FAR *LPSOCKADDR;
typedef
struct
;
typedef
struct
*
;
typedef struct sockaddr_in FAR *LPSOCKADDR_IN;
typedef
struct
;
typedef
struct
*
;
typedef struct linger FAR *LPLINGER;
typedef
struct
;
typedef
struct
*
;
typedef struct fd_set FAR *LPFD_SET;
typedef
struct
;
typedef
struct
*
;
typedef struct hostent FAR *LPHOSTENT;
typedef
struct
;
typedef
struct
*
;
typedef struct servent FAR *LPSERVENT;
typedef
struct
;
typedef
struct
*
;
typedef struct protoent FAR *LPPROTOENT;
typedef
struct
;
typedef
struct
*
;
typedef struct timeval FAR *LPTIMEVAL;
#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
#define WSAGETASYNCERROR(lParam) HIWORD(lParam)
#define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
#define WSAGETSELECTERROR(lParam) HIWORD(lParam)
#if(_WIN32_WINNT >= 0x0501)
#ifdef IPV6STRICT
#error WINSOCK2 required.
#endif // IPV6STRICT
#endif //(_WIN32_WINNT >= 0x0501)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* _WINSOCKAPI_ */