home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / WINSOCK2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  93.8 KB  |  3,655 lines

  1. /* Winsock2.h -- definitions to be used with the WinSock 2 DLL and
  2.  *               WinSock 2 applications.
  3.  *
  4.  * This header file corresponds to version 2.2.x of the WinSock API
  5.  * specification.
  6.  *
  7.  * This file includes parts which are Copyright (c) 1982-1986 Regents
  8.  * of the University of California.  All rights reserved.  The
  9.  * Berkeley Software License Agreement specifies the terms and
  10.  * conditions for redistribution.
  11.  */
  12.  
  13. #ifndef _WINSOCK2API_
  14. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  15. #define _WINSOCK2API_
  16. #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
  17.  
  18. /*
  19.  * Ensure structures are packed consistently.
  20.  */
  21.  
  22. #include <pshpack4.h>
  23.  
  24. /*
  25.  * Default: include function prototypes, don't include function typedefs.
  26.  */
  27.  
  28. #ifndef INCL_WINSOCK_API_PROTOTYPES
  29. #define INCL_WINSOCK_API_PROTOTYPES 1
  30. #endif
  31.  
  32. #ifndef INCL_WINSOCK_API_TYPEDEFS
  33. #define INCL_WINSOCK_API_TYPEDEFS 0
  34. #endif
  35.  
  36. /*
  37.  * Pull in WINDOWS.H if necessary
  38.  */
  39. #ifndef _INC_WINDOWS
  40. #include <windows.h>
  41. #endif /* _INC_WINDOWS */
  42.  
  43. /*
  44.  * Define the current Winsock version. To build an earlier Winsock version
  45.  * application redefine this value prior to including Winsock2.h.
  46.  */
  47.  
  48. #if !defined(MAKEWORD)
  49. #define MAKEWORD(low,high) \
  50.         ((WORD)((BYTE)(low)) | (((WORD)(BYTE)(high))<<8)))
  51. #endif
  52.  
  53. #ifndef WINSOCK_VERSION
  54. #define WINSOCK_VERSION MAKEWORD(2,2)
  55. #endif
  56.  
  57. /*
  58.  * Establish DLL function linkage if supported by the current build
  59.  * environment and not previously defined.
  60.  */
  61.  
  62. #ifndef WINSOCK_API_LINKAGE
  63. #ifdef DECLSPEC_IMPORT
  64. #define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
  65. #else
  66. #define WINSOCK_API_LINKAGE
  67. #endif
  68. #endif
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73.  
  74. /*
  75.  * Basic system type definitions, taken from the BSD file sys/types.h.
  76.  */
  77. typedef unsigned char   u_char;
  78. typedef unsigned short  u_short;
  79. typedef unsigned int    u_int;
  80. typedef unsigned long   u_long;
  81.  
  82. /*
  83.  * The new type to be used in all
  84.  * instances which refer to sockets.
  85.  */
  86. typedef u_int           SOCKET;
  87.  
  88. /*
  89.  * Select uses arrays of SOCKETs.  These macros manipulate such
  90.  * arrays.  FD_SETSIZE may be defined by the user before including
  91.  * this file, but the default here should be >= 64.
  92.  *
  93.  * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE
  94.  * INCLUDED IN WINSOCK2.H EXACTLY AS SHOWN HERE.
  95.  */
  96. #ifndef FD_SETSIZE
  97. #define FD_SETSIZE      64
  98. #endif /* FD_SETSIZE */
  99.  
  100. typedef struct fd_set {
  101.         u_int fd_count;               /* how many are SET? */
  102.         SOCKET  fd_array[FD_SETSIZE];   /* an array of SOCKETs */
  103. } fd_set;
  104.  
  105. extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
  106.  
  107. #define FD_CLR(fd, set) do { \
  108.     u_int __i; \
  109.     for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
  110.         if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
  111.             while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
  112.                 ((fd_set FAR *)(set))->fd_array[__i] = \
  113.                     ((fd_set FAR *)(set))->fd_array[__i+1]; \
  114.                 __i++; \
  115.             } \
  116.             ((fd_set FAR *)(set))->fd_count--; \
  117.             break; \
  118.         } \
  119.     } \
  120. } while(0)
  121.  
  122. #define FD_SET(fd, set) do { \
  123.     u_int __i; \
  124.     for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \
  125.         if (((fd_set FAR *)(set))->fd_array[__i] == (fd)) { \
  126.             break; \
  127.         } \
  128.     } \
  129.     if (__i == ((fd_set FAR *)(set))->fd_count) { \
  130.         if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \
  131.             ((fd_set FAR *)(set))->fd_array[__i] = (fd); \
  132.             ((fd_set FAR *)(set))->fd_count++; \
  133.         } \
  134.     } \
  135. } while(0)
  136.  
  137. #define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0)
  138.  
  139. #define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set))
  140.  
  141. /*
  142.  * Structure used in select() call, taken from the BSD file sys/time.h.
  143.  */
  144. struct timeval {
  145.         long    tv_sec;         /* seconds */
  146.         long    tv_usec;        /* and microseconds */
  147. };
  148.  
  149. /*
  150.  * Operations on timevals.
  151.  *
  152.  * NB: timercmp does not work for >= or <=.
  153.  */
  154. #define timerisset(tvp)         ((tvp)->tv_sec || (tvp)->tv_usec)
  155. #define timercmp(tvp, uvp, cmp) \
  156.         ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  157.          (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  158. #define timerclear(tvp)         (tvp)->tv_sec = (tvp)->tv_usec = 0
  159.  
  160. /*
  161.  * Commands for ioctlsocket(),  taken from the BSD file fcntl.h.
  162.  *
  163.  *
  164.  * Ioctl's have the command encoded in the lower word,
  165.  * and the size of any in or out parameters in the upper
  166.  * word.  The high 2 bits of the upper word are used
  167.  * to encode the in/out status of the parameter; for now
  168.  * we restrict parameters to at most 128 bytes.
  169.  */
  170. #define IOCPARM_MASK    0x7f            /* parameters must be < 128 bytes */
  171. #define IOC_VOID        0x20000000      /* no parameters */
  172. #define IOC_OUT         0x40000000      /* copy out parameters */
  173. #define IOC_IN          0x80000000      /* copy in parameters */
  174. #define IOC_INOUT       (IOC_IN|IOC_OUT)
  175.                                         /* 0x20000000 distinguishes new &
  176.                                            old ioctl's */
  177. #define _IO(x,y)        (IOC_VOID|((x)<<8)|(y))
  178.  
  179. #define _IOR(x,y,t)     (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
  180.  
  181. #define _IOW(x,y,t)     (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
  182.  
  183. #define FIONREAD    _IOR('f', 127, u_long) /* get # bytes to read */
  184. #define FIONBIO     _IOW('f', 126, u_long) /* set/clear non-blocking i/o */
  185. #define FIOASYNC    _IOW('f', 125, u_long) /* set/clear async i/o */
  186.  
  187. /* Socket I/O Controls */
  188. #define SIOCSHIWAT  _IOW('s',  0, u_long)  /* set high watermark */
  189. #define SIOCGHIWAT  _IOR('s',  1, u_long)  /* get high watermark */
  190. #define SIOCSLOWAT  _IOW('s',  2, u_long)  /* set low watermark */
  191. #define SIOCGLOWAT  _IOR('s',  3, u_long)  /* get low watermark */
  192. #define SIOCATMARK  _IOR('s',  7, u_long)  /* at oob mark? */
  193.  
  194. /*
  195.  * Structures returned by network data base library, taken from the
  196.  * BSD file netdb.h.  All addresses are supplied in host order, and
  197.  * returned in network order (suitable for use in system calls).
  198.  */
  199.  
  200. struct  hostent {
  201.         char    FAR * h_name;           /* official name of host */
  202.         char    FAR * FAR * h_aliases;  /* alias list */
  203.         short   h_addrtype;             /* host address type */
  204.         short   h_length;               /* length of address */
  205.         char    FAR * FAR * h_addr_list; /* list of addresses */
  206. #define h_addr  h_addr_list[0]          /* address, for backward compat */
  207. };
  208.  
  209. /*
  210.  * It is assumed here that a network number
  211.  * fits in 32 bits.
  212.  */
  213. struct  netent {
  214.         char    FAR * n_name;           /* official name of net */
  215.         char    FAR * FAR * n_aliases;  /* alias list */
  216.         short   n_addrtype;             /* net address type */
  217.         u_long  n_net;                  /* network # */
  218. };
  219.  
  220. struct  servent {
  221.         char    FAR * s_name;           /* official service name */
  222.         char    FAR * FAR * s_aliases;  /* alias list */
  223.         short   s_port;                 /* port # */
  224.         char    FAR * s_proto;          /* protocol to use */
  225. };
  226.  
  227. struct  protoent {
  228.         char    FAR * p_name;           /* official protocol name */
  229.         char    FAR * FAR * p_aliases;  /* alias list */
  230.         short   p_proto;                /* protocol # */
  231. };
  232.  
  233. /*
  234.  * Constants and structures defined by the internet system,
  235.  * Per RFC 790, September 1981, taken from the BSD file netinet/in.h.
  236.  */
  237.  
  238. /*
  239.  * Protocols
  240.  */
  241. #define IPPROTO_IP              0               /* dummy for IP */
  242. #define IPPROTO_ICMP            1               /* control message protocol */
  243. #define IPPROTO_IGMP            2               /* internet group management protocol */
  244. #define IPPROTO_GGP             3               /* gateway^2 (deprecated) */
  245. #define IPPROTO_TCP             6               /* tcp */
  246. #define IPPROTO_PUP             12              /* pup */
  247. #define IPPROTO_UDP             17              /* user datagram protocol */
  248. #define IPPROTO_IDP             22              /* xns idp */
  249. #define IPPROTO_ND              77              /* UNOFFICIAL net disk proto */
  250.  
  251. #define IPPROTO_RAW             255             /* raw IP packet */
  252. #define IPPROTO_MAX             256
  253.  
  254. /*
  255.  * Port/socket numbers: network standard functions
  256.  */
  257. #define IPPORT_ECHO             7
  258. #define IPPORT_DISCARD          9
  259. #define IPPORT_SYSTAT           11
  260. #define IPPORT_DAYTIME          13
  261. #define IPPORT_NETSTAT          15
  262. #define IPPORT_FTP              21
  263. #define IPPORT_TELNET           23
  264. #define IPPORT_SMTP             25
  265. #define IPPORT_TIMESERVER       37
  266. #define IPPORT_NAMESERVER       42
  267. #define IPPORT_WHOIS            43
  268. #define IPPORT_MTP              57
  269.  
  270. /*
  271.  * Port/socket numbers: host specific functions
  272.  */
  273. #define IPPORT_TFTP             69
  274. #define IPPORT_RJE              77
  275. #define IPPORT_FINGER           79
  276. #define IPPORT_TTYLINK          87
  277. #define IPPORT_SUPDUP           95
  278.  
  279. /*
  280.  * UNIX TCP sockets
  281.  */
  282. #define IPPORT_EXECSERVER       512
  283. #define IPPORT_LOGINSERVER      513
  284. #define IPPORT_CMDSERVER        514
  285. #define IPPORT_EFSSERVER        520
  286.  
  287. /*
  288.  * UNIX UDP sockets
  289.  */
  290. #define IPPORT_BIFFUDP          512
  291. #define IPPORT_WHOSERVER        513
  292. #define IPPORT_ROUTESERVER      520
  293.                                         /* 520+1 also used */
  294.  
  295. /*
  296.  * Ports < IPPORT_RESERVED are reserved for
  297.  * privileged processes (e.g. root).
  298.  */
  299. #define IPPORT_RESERVED         1024
  300.  
  301. /*
  302.  * Link numbers
  303.  */
  304. #define IMPLINK_IP              155
  305. #define IMPLINK_LOWEXPER        156
  306. #define IMPLINK_HIGHEXPER       158
  307.  
  308. /*
  309.  * Internet address (old style... should be updated)
  310.  */
  311. struct in_addr {
  312.         union {
  313.                 struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
  314.                 struct { u_short s_w1,s_w2; } S_un_w;
  315.                 u_long S_addr;
  316.         } S_un;
  317. #define s_addr  S_un.S_addr
  318.                                 /* can be used for most tcp & ip code */
  319. #define s_host  S_un.S_un_b.s_b2
  320.                                 /* host on imp */
  321. #define s_net   S_un.S_un_b.s_b1
  322.                                 /* network */
  323. #define s_imp   S_un.S_un_w.s_w2
  324.                                 /* imp */
  325. #define s_impno S_un.S_un_b.s_b4
  326.                                 /* imp # */
  327. #define s_lh    S_un.S_un_b.s_b3
  328.                                 /* logical host */
  329. };
  330.  
  331. /*
  332.  * Definitions of bits in internet address integers.
  333.  * On subnets, the decomposition of addresses to host and net parts
  334.  * is done according to subnet mask, not the masks here.
  335.  */
  336. #define IN_CLASSA(i)            (((long)(i) & 0x80000000) == 0)
  337. #define IN_CLASSA_NET           0xff000000
  338. #define IN_CLASSA_NSHIFT        24
  339. #define IN_CLASSA_HOST          0x00ffffff
  340. #define IN_CLASSA_MAX           128
  341.  
  342. #define IN_CLASSB(i)            (((long)(i) & 0xc0000000) == 0x80000000)
  343. #define IN_CLASSB_NET           0xffff0000
  344. #define IN_CLASSB_NSHIFT        16
  345. #define IN_CLASSB_HOST          0x0000ffff
  346. #define IN_CLASSB_MAX           65536
  347.  
  348. #define IN_CLASSC(i)            (((long)(i) & 0xe0000000) == 0xc0000000)
  349. #define IN_CLASSC_NET           0xffffff00
  350. #define IN_CLASSC_NSHIFT        8
  351. #define IN_CLASSC_HOST          0x000000ff
  352.  
  353. #define IN_CLASSD(i)            (((long)(i) & 0xf0000000) == 0xe0000000)
  354. #define IN_CLASSD_NET           0xf0000000       /* These ones aren't really */
  355. #define IN_CLASSD_NSHIFT        28               /* net and host fields, but */
  356. #define IN_CLASSD_HOST          0x0fffffff       /* routing needn't know.    */
  357. #define IN_MULTICAST(i)         IN_CLASSD(i)
  358.  
  359. #define INADDR_ANY              (u_long)0x00000000
  360. #define INADDR_LOOPBACK         0x7f000001
  361. #define INADDR_BROADCAST        (u_long)0xffffffff
  362. #define INADDR_NONE             0xffffffff
  363.  
  364. #define ADDR_ANY                INADDR_ANY
  365.  
  366. /*
  367.  * Socket address, internet style.
  368.  */
  369. struct sockaddr_in {
  370.         short   sin_family;
  371.         u_short sin_port;
  372.         struct  in_addr sin_addr;
  373.         char    sin_zero[8];
  374. };
  375.  
  376. #define WSADESCRIPTION_LEN      256
  377. #define WSASYS_STATUS_LEN       128
  378.  
  379. typedef struct WSAData {
  380.         WORD                    wVersion;
  381.         WORD                    wHighVersion;
  382.         char                    szDescription[WSADESCRIPTION_LEN+1];
  383.         char                    szSystemStatus[WSASYS_STATUS_LEN+1];
  384.         unsigned short          iMaxSockets;
  385.         unsigned short          iMaxUdpDg;
  386.         char FAR *              lpVendorInfo;
  387. } WSADATA, FAR * LPWSADATA;
  388.  
  389. /*
  390.  * Definitions related to sockets: types, address families, options,
  391.  * taken from the BSD file sys/socket.h.
  392.  */
  393.  
  394. /*
  395.  * This is used instead of -1, since the
  396.  * SOCKET type is unsigned.
  397.  */
  398. #define INVALID_SOCKET  (SOCKET)(~0)
  399. #define SOCKET_ERROR            (-1)
  400.  
  401. /*
  402.  * The  following  may  be used in place of the address family, socket type, or
  403.  * protocol  in  a  call  to WSASocket to indicate that the corresponding value
  404.  * should  be taken from the supplied WSAPROTOCOL_INFO structure instead of the
  405.  * parameter itself.
  406.  */
  407. #define FROM_PROTOCOL_INFO (-1)
  408.  
  409. /*
  410.  * Types
  411.  */
  412. #define SOCK_STREAM     1               /* stream socket */
  413. #define SOCK_DGRAM      2               /* datagram socket */
  414. #define SOCK_RAW        3               /* raw-protocol interface */
  415. #define SOCK_RDM        4               /* reliably-delivered message */
  416. #define SOCK_SEQPACKET  5               /* sequenced packet stream */
  417.  
  418. /*
  419.  * Option flags per-socket.
  420.  */
  421. #define SO_DEBUG        0x0001          /* turn on debugging info recording */
  422. #define SO_ACCEPTCONN   0x0002          /* socket has had listen() */
  423. #define SO_REUSEADDR    0x0004          /* allow local address reuse */
  424. #define SO_KEEPALIVE    0x0008          /* keep connections alive */
  425. #define SO_DONTROUTE    0x0010          /* just use interface addresses */
  426. #define SO_BROADCAST    0x0020          /* permit sending of broadcast msgs */
  427. #define SO_USELOOPBACK  0x0040          /* bypass hardware when possible */
  428. #define SO_LINGER       0x0080          /* linger on close if data present */
  429. #define SO_OOBINLINE    0x0100          /* leave received OOB data in line */
  430.  
  431. #define SO_DONTLINGER   (int)(~SO_LINGER)
  432.  
  433. /*
  434.  * Additional options.
  435.  */
  436. #define SO_SNDBUF       0x1001          /* send buffer size */
  437. #define SO_RCVBUF       0x1002          /* receive buffer size */
  438. #define SO_SNDLOWAT     0x1003          /* send low-water mark */
  439. #define SO_RCVLOWAT     0x1004          /* receive low-water mark */
  440. #define SO_SNDTIMEO     0x1005          /* send timeout */
  441. #define SO_RCVTIMEO     0x1006          /* receive timeout */
  442. #define SO_ERROR        0x1007          /* get error status and clear */
  443. #define SO_TYPE         0x1008          /* get socket type */
  444.  
  445. /*
  446.  * WinSock 2 extension -- new options
  447.  */
  448. #define SO_GROUP_ID       0x2001      /* ID of a socket group */
  449. #define SO_GROUP_PRIORITY 0x2002      /* the relative priority within a group*/
  450. #define SO_MAX_MSG_SIZE   0x2003      /* maximum message size */
  451. #define SO_PROTOCOL_INFOA 0x2004      /* WSAPROTOCOL_INFOA structure */
  452. #define SO_PROTOCOL_INFOW 0x2005      /* WSAPROTOCOL_INFOW structure */
  453. #ifdef UNICODE
  454. #define SO_PROTOCOL_INFO  SO_PROTOCOL_INFOW
  455. #else
  456. #define SO_PROTOCOL_INFO  SO_PROTOCOL_INFOA
  457. #endif /* UNICODE */
  458. #define PVD_CONFIG        0x3001          /* configuration info for service provider */
  459.  
  460. /*
  461.  * TCP options.
  462.  */
  463. #define TCP_NODELAY     0x0001
  464.  
  465. /*
  466.  * Address families.
  467.  */
  468. #define AF_UNSPEC       0               /* unspecified */
  469. /*
  470.  * Although  AF_UNSPEC  is  defined for backwards compatibility, using
  471.  * AF_UNSPEC for the "af" parameter when creating a socket is STRONGLY
  472.  * DISCOURAGED.    The  interpretation  of  the  "protocol"  parameter
  473.  * depends  on the actual address family chosen.  As environments grow
  474.  * to  include  more  and  more  address families that use overlapping
  475.  * protocol  values  there  is  more  and  more  chance of choosing an
  476.  * undesired address family when AF_UNSPEC is used.
  477.  */
  478. #define AF_UNIX         1               /* local to host (pipes, portals) */
  479. #define AF_INET         2               /* internetwork: UDP, TCP, etc. */
  480. #define AF_IMPLINK      3               /* arpanet imp addresses */
  481. #define AF_PUP          4               /* pup protocols: e.g. BSP */
  482. #define AF_CHAOS        5               /* mit CHAOS protocols */
  483. #define AF_NS           6               /* XEROX NS protocols */
  484. #define AF_IPX          AF_NS           /* IPX protocols: IPX, SPX, etc. */
  485. #define AF_ISO          7               /* ISO protocols */
  486. #define AF_OSI          AF_ISO          /* OSI is ISO */
  487. #define AF_ECMA         8               /* european computer manufacturers */
  488. #define AF_DATAKIT      9               /* datakit protocols */
  489. #define AF_CCITT        10              /* CCITT protocols, X.25 etc */
  490. #define AF_SNA          11              /* IBM SNA */
  491. #define AF_DECnet       12              /* DECnet */
  492. #define AF_DLI          13              /* Direct data link interface */
  493. #define AF_LAT          14              /* LAT */
  494. #define AF_HYLINK       15              /* NSC Hyperchannel */
  495. #define AF_APPLETALK    16              /* AppleTalk */
  496. #define AF_NETBIOS      17              /* NetBios-style addresses */
  497. #define AF_VOICEVIEW    18              /* VoiceView */
  498. #define AF_FIREFOX      19              /* Protocols from Firefox */
  499. #define AF_UNKNOWN1     20              /* Somebody is using this! */
  500. #define AF_BAN          21              /* Banyan */
  501. #define AF_ATM          22              /* Native ATM Services */
  502. #define AF_INET6        23              /* Internetwork Version 6 */
  503. #define AF_CLUSTER      24              /* Microsoft Wolfpack */
  504. #define AF_12844        25              /* IEEE 1284.4 WG AF */
  505.  
  506.  
  507. #define AF_MAX          26
  508.  
  509. /*
  510.  * Structure used by kernel to store most
  511.  * addresses.
  512.  */
  513. struct sockaddr {
  514.         u_short sa_family;              /* address family */
  515.         char    sa_data[14];            /* up to 14 bytes of direct address */
  516. };
  517.  
  518. /*
  519.  * Structure used by kernel to pass protocol
  520.  * information in raw sockets.
  521.  */
  522. struct sockproto {
  523.         u_short sp_family;              /* address family */
  524.         u_short sp_protocol;            /* protocol */
  525. };
  526.  
  527. /*
  528.  * Protocol families, same as address families for now.
  529.  */
  530. #define PF_UNSPEC       AF_UNSPEC
  531. #define PF_UNIX         AF_UNIX
  532. #define PF_INET         AF_INET
  533. #define PF_IMPLINK      AF_IMPLINK
  534. #define PF_PUP          AF_PUP
  535. #define PF_CHAOS        AF_CHAOS
  536. #define PF_NS           AF_NS
  537. #define PF_IPX          AF_IPX
  538. #define PF_ISO          AF_ISO
  539. #define PF_OSI          AF_OSI
  540. #define PF_ECMA         AF_ECMA
  541. #define PF_DATAKIT      AF_DATAKIT
  542. #define PF_CCITT        AF_CCITT
  543. #define PF_SNA          AF_SNA
  544. #define PF_DECnet       AF_DECnet
  545. #define PF_DLI          AF_DLI
  546. #define PF_LAT          AF_LAT
  547. #define PF_HYLINK       AF_HYLINK
  548. #define PF_APPLETALK    AF_APPLETALK
  549. #define PF_VOICEVIEW    AF_VOICEVIEW
  550. #define PF_FIREFOX      AF_FIREFOX
  551. #define PF_UNKNOWN1     AF_UNKNOWN1
  552. #define PF_BAN          AF_BAN
  553. #define PF_ATM          AF_ATM
  554. #define PF_INET6        AF_INET6
  555.  
  556. #define PF_MAX          AF_MAX
  557.  
  558. /*
  559.  * Structure used for manipulating linger option.
  560.  */
  561. struct  linger {
  562.         u_short l_onoff;                /* option on/off */
  563.         u_short l_linger;               /* linger time */
  564. };
  565.  
  566. /*
  567.  * Level number for (get/set)sockopt() to apply to socket itself.
  568.  */
  569. #define SOL_SOCKET      0xffff          /* options for socket level */
  570.  
  571. /*
  572.  * Maximum queue length specifiable by listen.
  573.  */
  574. #define SOMAXCONN       0x7fffffff
  575.  
  576. #define MSG_OOB         0x1             /* process out-of-band data */
  577. #define MSG_PEEK        0x2             /* peek at incoming message */
  578. #define MSG_DONTROUTE   0x4             /* send without using routing tables */
  579.  
  580. #define MSG_PARTIAL     0x8000          /* partial send or recv for message xport */
  581.  
  582. /*
  583.  * WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and
  584.  *                          WSARecvFrom()
  585.  */
  586. #define MSG_INTERRUPT   0x10            /* send/recv in the interrupt context */
  587.  
  588. #define MSG_MAXIOVLEN   16
  589.  
  590. /*
  591.  * Define constant based on rfc883, used by gethostbyxxxx() calls.
  592.  */
  593. #define MAXGETHOSTSTRUCT        1024
  594.  
  595. /*
  596.  * WinSock 2 extension -- bit values and indices for FD_XXX network events
  597.  */
  598. #define FD_READ_BIT      0
  599. #define FD_READ          (1 << FD_READ_BIT)
  600.  
  601. #define FD_WRITE_BIT     1
  602. #define FD_WRITE         (1 << FD_WRITE_BIT)
  603.  
  604. #define FD_OOB_BIT       2
  605. #define FD_OOB           (1 << FD_OOB_BIT)
  606.  
  607. #define FD_ACCEPT_BIT    3
  608. #define FD_ACCEPT        (1 << FD_ACCEPT_BIT)
  609.  
  610. #define FD_CONNECT_BIT   4
  611. #define FD_CONNECT       (1 << FD_CONNECT_BIT)
  612.  
  613. #define FD_CLOSE_BIT     5
  614. #define FD_CLOSE         (1 << FD_CLOSE_BIT)
  615.  
  616. #define FD_QOS_BIT       6
  617. #define FD_QOS           (1 << FD_QOS_BIT)
  618.  
  619. #define FD_GROUP_QOS_BIT 7
  620. #define FD_GROUP_QOS     (1 << FD_GROUP_QOS_BIT)
  621.  
  622. #define FD_ROUTING_INTERFACE_CHANGE_BIT 8
  623. #define FD_ROUTING_INTERFACE_CHANGE     (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
  624.  
  625. #define FD_ADDRESS_LIST_CHANGE_BIT 9
  626. #define FD_ADDRESS_LIST_CHANGE     (1 << FD_ADDRESS_LIST_CHANGE_BIT)
  627.  
  628. #define FD_MAX_EVENTS    10
  629. #define FD_ALL_EVENTS    ((1 << FD_MAX_EVENTS) - 1)
  630.  
  631.  
  632. /*
  633.  * All Windows Sockets error constants are biased by WSABASEERR from
  634.  * the "normal"
  635.  */
  636. #define WSABASEERR              10000
  637. /*
  638.  * Windows Sockets definitions of regular Microsoft C error constants
  639.  */
  640. #define WSAEINTR                (WSABASEERR+4)
  641. #define WSAEBADF                (WSABASEERR+9)
  642. #define WSAEACCES               (WSABASEERR+13)
  643. #define WSAEFAULT               (WSABASEERR+14)
  644. #define WSAEINVAL               (WSABASEERR+22)
  645. #define WSAEMFILE               (WSABASEERR+24)
  646.  
  647. /*
  648.  * Windows Sockets definitions of regular Berkeley error constants
  649.  */
  650. #define WSAEWOULDBLOCK          (WSABASEERR+35)
  651. #define WSAEINPROGRESS          (WSABASEERR+36)
  652. #define WSAEALREADY             (WSABASEERR+37)
  653. #define WSAENOTSOCK             (WSABASEERR+38)
  654. #define WSAEDESTADDRREQ         (WSABASEERR+39)
  655. #define WSAEMSGSIZE             (WSABASEERR+40)
  656. #define WSAEPROTOTYPE           (WSABASEERR+41)
  657. #define WSAENOPROTOOPT          (WSABASEERR+42)
  658. #define WSAEPROTONOSUPPORT      (WSABASEERR+43)
  659. #define WSAESOCKTNOSUPPORT      (WSABASEERR+44)
  660. #define WSAEOPNOTSUPP           (WSABASEERR+45)
  661. #define WSAEPFNOSUPPORT         (WSABASEERR+46)
  662. #define WSAEAFNOSUPPORT         (WSABASEERR+47)
  663. #define WSAEADDRINUSE           (WSABASEERR+48)
  664. #define WSAEADDRNOTAVAIL        (WSABASEERR+49)
  665. #define WSAENETDOWN             (WSABASEERR+50)
  666. #define WSAENETUNREACH          (WSABASEERR+51)
  667. #define WSAENETRESET            (WSABASEERR+52)
  668. #define WSAECONNABORTED         (WSABASEERR+53)
  669. #define WSAECONNRESET           (WSABASEERR+54)
  670. #define WSAENOBUFS              (WSABASEERR+55)
  671. #define WSAEISCONN              (WSABASEERR+56)
  672. #define WSAENOTCONN             (WSABASEERR+57)
  673. #define WSAESHUTDOWN            (WSABASEERR+58)
  674. #define WSAETOOMANYREFS         (WSABASEERR+59)
  675. #define WSAETIMEDOUT            (WSABASEERR+60)
  676. #define WSAECONNREFUSED         (WSABASEERR+61)
  677. #define WSAELOOP                (WSABASEERR+62)
  678. #define WSAENAMETOOLONG         (WSABASEERR+63)
  679. #define WSAEHOSTDOWN            (WSABASEERR+64)
  680. #define WSAEHOSTUNREACH         (WSABASEERR+65)
  681. #define WSAENOTEMPTY            (WSABASEERR+66)
  682. #define WSAEPROCLIM             (WSABASEERR+67)
  683. #define WSAEUSERS               (WSABASEERR+68)
  684. #define WSAEDQUOT               (WSABASEERR+69)
  685. #define WSAESTALE               (WSABASEERR+70)
  686. #define WSAEREMOTE              (WSABASEERR+71)
  687.  
  688. /*
  689.  * Extended Windows Sockets error constant definitions
  690.  */
  691. #define WSASYSNOTREADY          (WSABASEERR+91)
  692. #define WSAVERNOTSUPPORTED      (WSABASEERR+92)
  693. #define WSANOTINITIALISED       (WSABASEERR+93)
  694. #define WSAEDISCON              (WSABASEERR+101)
  695. #define WSAENOMORE              (WSABASEERR+102)
  696. #define WSAECANCELLED           (WSABASEERR+103)
  697. #define WSAEINVALIDPROCTABLE    (WSABASEERR+104)
  698. #define WSAEINVALIDPROVIDER     (WSABASEERR+105)
  699. #define WSAEPROVIDERFAILEDINIT  (WSABASEERR+106)
  700. #define WSASYSCALLFAILURE       (WSABASEERR+107)
  701. #define WSASERVICE_NOT_FOUND    (WSABASEERR+108)
  702. #define WSATYPE_NOT_FOUND       (WSABASEERR+109)
  703. #define WSA_E_NO_MORE           (WSABASEERR+110)
  704. #define WSA_E_CANCELLED         (WSABASEERR+111)
  705. #define WSAEREFUSED             (WSABASEERR+112)
  706.  
  707. /*
  708.  * Error return codes from gethostbyname() and gethostbyaddr()
  709.  * (when using the resolver). Note that these errors are
  710.  * retrieved via WSAGetLastError() and must therefore follow
  711.  * the rules for avoiding clashes with error numbers from
  712.  * specific implementations or language run-time systems.
  713.  * For this reason the codes are based at WSABASEERR+1001.
  714.  * Note also that [WSA]NO_ADDRESS is defined only for
  715.  * compatibility purposes.
  716.  */
  717.  
  718. #define h_errno         WSAGetLastError()
  719.  
  720. /* Authoritative Answer: Host not found */
  721. #define WSAHOST_NOT_FOUND       (WSABASEERR+1001)
  722. #define HOST_NOT_FOUND          WSAHOST_NOT_FOUND
  723.  
  724. /* Non-Authoritative: Host not found, or SERVERFAIL */
  725. #define WSATRY_AGAIN            (WSABASEERR+1002)
  726. #define TRY_AGAIN               WSATRY_AGAIN
  727.  
  728. /* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
  729. #define WSANO_RECOVERY          (WSABASEERR+1003)
  730. #define NO_RECOVERY             WSANO_RECOVERY
  731.  
  732. /* Valid name, no data record of requested type */
  733. #define WSANO_DATA              (WSABASEERR+1004)
  734. #define NO_DATA                 WSANO_DATA
  735.  
  736. /* no address, look for MX record */
  737. #define WSANO_ADDRESS           WSANO_DATA
  738. #define NO_ADDRESS              WSANO_ADDRESS
  739.  
  740. /*
  741.  * Define QOS related error return codes
  742.  *
  743.  */
  744. #define  WSA_QOS_RECEIVERS               (WSABASEERR + 1005)
  745.          /* at least one Reserve has arrived */
  746. #define  WSA_QOS_SENDERS                 (WSABASEERR + 1006)
  747.          /* at least one Path has arrived */
  748. #define  WSA_QOS_NO_SENDERS              (WSABASEERR + 1007)  
  749.          /* there are no senders */
  750. #define  WSA_QOS_NO_RECEIVERS            (WSABASEERR + 1008) 
  751.          /* there are no receivers */
  752. #define  WSA_QOS_REQUEST_CONFIRMED       (WSABASEERR + 1009)
  753.          /* Reserve has been confirmed */
  754. #define  WSA_QOS_ADMISSION_FAILURE       (WSABASEERR + 1010)
  755.          /* error due to lack of resources */
  756. #define  WSA_QOS_POLICY_FAILURE          (WSABASEERR + 1011)
  757.          /* rejected for administrative reasons - bad credentials */
  758. #define  WSA_QOS_BAD_STYLE               (WSABASEERR + 1012)
  759.          /* unknown or conflicting style */
  760. #define  WSA_QOS_BAD_OBJECT              (WSABASEERR + 1013)
  761.          /* problem with some part of the filterspec or providerspecific
  762.           * buffer in general */
  763. #define  WSA_QOS_TRAFFIC_CTRL_ERROR      (WSABASEERR + 1014)
  764.          /* problem with some part of the flowspec */
  765. #define  WSA_QOS_GENERIC_ERROR           (WSABASEERR + 1015) 
  766.          /* general error */
  767.  
  768. /*
  769.  * Windows Sockets errors redefined as regular Berkeley error constants.
  770.  * These are commented out in Windows NT to avoid conflicts with errno.h.
  771.  * Use the WSA constants instead.
  772.  */
  773. #if 0
  774. #define EWOULDBLOCK             WSAEWOULDBLOCK
  775. #define EINPROGRESS             WSAEINPROGRESS
  776. #define EALREADY                WSAEALREADY
  777. #define ENOTSOCK                WSAENOTSOCK
  778. #define EDESTADDRREQ            WSAEDESTADDRREQ
  779. #define EMSGSIZE                WSAEMSGSIZE
  780. #define EPROTOTYPE              WSAEPROTOTYPE
  781. #define ENOPROTOOPT             WSAENOPROTOOPT
  782. #define EPROTONOSUPPORT         WSAEPROTONOSUPPORT
  783. #define ESOCKTNOSUPPORT         WSAESOCKTNOSUPPORT
  784. #define EOPNOTSUPP              WSAEOPNOTSUPP
  785. #define EPFNOSUPPORT            WSAEPFNOSUPPORT
  786. #define EAFNOSUPPORT            WSAEAFNOSUPPORT
  787. #define EADDRINUSE              WSAEADDRINUSE
  788. #define EADDRNOTAVAIL           WSAEADDRNOTAVAIL
  789. #define ENETDOWN                WSAENETDOWN
  790. #define ENETUNREACH             WSAENETUNREACH
  791. #define ENETRESET               WSAENETRESET
  792. #define ECONNABORTED            WSAECONNABORTED
  793. #define ECONNRESET              WSAECONNRESET
  794. #define ENOBUFS                 WSAENOBUFS
  795. #define EISCONN                 WSAEISCONN
  796. #define ENOTCONN                WSAENOTCONN
  797. #define ESHUTDOWN               WSAESHUTDOWN
  798. #define ETOOMANYREFS            WSAETOOMANYREFS
  799. #define ETIMEDOUT               WSAETIMEDOUT
  800. #define ECONNREFUSED            WSAECONNREFUSED
  801. #define ELOOP                   WSAELOOP
  802. #define ENAMETOOLONG            WSAENAMETOOLONG
  803. #define EHOSTDOWN               WSAEHOSTDOWN
  804. #define EHOSTUNREACH            WSAEHOSTUNREACH
  805. #define ENOTEMPTY               WSAENOTEMPTY
  806. #define EPROCLIM                WSAEPROCLIM
  807. #define EUSERS                  WSAEUSERS
  808. #define EDQUOT                  WSAEDQUOT
  809. #define ESTALE                  WSAESTALE
  810. #define EREMOTE                 WSAEREMOTE
  811. #endif
  812.  
  813. /*
  814.  * WinSock 2 extension -- new error codes and type definition
  815.  */
  816.  
  817. #ifdef WIN32
  818.  
  819. #define WSAAPI                  FAR PASCAL
  820. #define WSAEVENT                HANDLE
  821. #define LPWSAEVENT              LPHANDLE
  822. #define WSAOVERLAPPED           OVERLAPPED
  823. typedef struct _OVERLAPPED *    LPWSAOVERLAPPED;
  824.  
  825. #define WSA_IO_PENDING          (ERROR_IO_PENDING)
  826. #define WSA_IO_INCOMPLETE       (ERROR_IO_INCOMPLETE)
  827. #define WSA_INVALID_HANDLE      (ERROR_INVALID_HANDLE)
  828. #define WSA_INVALID_PARAMETER   (ERROR_INVALID_PARAMETER)
  829. #define WSA_NOT_ENOUGH_MEMORY   (ERROR_NOT_ENOUGH_MEMORY)
  830. #define WSA_OPERATION_ABORTED   (ERROR_OPERATION_ABORTED)
  831.  
  832. #define WSA_INVALID_EVENT       ((WSAEVENT)NULL)
  833. #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
  834. #define WSA_WAIT_FAILED         ((DWORD)-1L)
  835. #define WSA_WAIT_EVENT_0        (WAIT_OBJECT_0)
  836. #define WSA_WAIT_IO_COMPLETION  (WAIT_IO_COMPLETION)
  837. #define WSA_WAIT_TIMEOUT        (WAIT_TIMEOUT)
  838. #define WSA_INFINITE            (INFINITE)
  839.  
  840. #else /* WIN16 */
  841.  
  842. #define WSAAPI                  FAR PASCAL
  843. typedef DWORD                   WSAEVENT, FAR * LPWSAEVENT;
  844.  
  845. typedef struct _WSAOVERLAPPED {
  846.     DWORD    Internal;
  847.     DWORD    InternalHigh;
  848.     DWORD    Offset;
  849.     DWORD    OffsetHigh;
  850.     WSAEVENT hEvent;
  851. } WSAOVERLAPPED, FAR * LPWSAOVERLAPPED;
  852.  
  853. #define WSA_IO_PENDING          (WSAEWOULDBLOCK)
  854. #define WSA_IO_INCOMPLETE       (WSAEWOULDBLOCK)
  855. #define WSA_INVALID_HANDLE      (WSAENOTSOCK)
  856. #define WSA_INVALID_PARAMETER   (WSAEINVAL)
  857. #define WSA_NOT_ENOUGH_MEMORY   (WSAENOBUFS)
  858. #define WSA_OPERATION_ABORTED   (WSAEINTR)
  859.  
  860. #define WSA_INVALID_EVENT       ((WSAEVENT)NULL)
  861. #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
  862. #define WSA_WAIT_FAILED         ((DWORD)-1L)
  863. #define WSA_WAIT_EVENT_0        ((DWORD)0)
  864. #define WSA_WAIT_TIMEOUT        ((DWORD)0x102L)
  865. #define WSA_INFINITE            ((DWORD)-1L)
  866.  
  867. #endif  /* WIN32 */
  868.  
  869. /*
  870.  * WinSock 2 extension -- WSABUF and QOS struct, include qos.h
  871.  * to pull in FLOWSPEC and related definitions
  872.  */
  873.  
  874. typedef struct _WSABUF {
  875.     u_long      len;     /* the length of the buffer */
  876.     char FAR *  buf;     /* the pointer to the buffer */
  877. } WSABUF, FAR * LPWSABUF;
  878.  
  879. #include <qos.h>
  880.  
  881. typedef struct _QualityOfService
  882. {
  883.     FLOWSPEC      SendingFlowspec;       /* the flow spec for data sending */
  884.     FLOWSPEC      ReceivingFlowspec;     /* the flow spec for data receiving */
  885.     WSABUF        ProviderSpecific;      /* additional provider specific stuff */
  886. } QOS, FAR * LPQOS;
  887.  
  888. /*
  889.  * WinSock 2 extension -- manifest constants for return values of the condition function
  890.  */
  891. #define CF_ACCEPT       0x0000
  892. #define CF_REJECT       0x0001
  893. #define CF_DEFER        0x0002
  894.  
  895. /*
  896.  * WinSock 2 extension -- manifest constants for shutdown()
  897.  */
  898. #define SD_RECEIVE      0x00
  899. #define SD_SEND         0x01
  900. #define SD_BOTH         0x02
  901.  
  902. /*
  903.  * WinSock 2 extension -- data type and manifest constants for socket groups
  904.  */
  905. typedef unsigned int             GROUP;
  906.  
  907. #define SG_UNCONSTRAINED_GROUP   0x01
  908. #define SG_CONSTRAINED_GROUP     0x02
  909.  
  910. /*
  911.  * WinSock 2 extension -- data type for WSAEnumNetworkEvents()
  912.  */
  913. typedef struct _WSANETWORKEVENTS {
  914.        long lNetworkEvents;
  915.        int iErrorCode[FD_MAX_EVENTS];
  916. } WSANETWORKEVENTS, FAR * LPWSANETWORKEVENTS;
  917.  
  918. /*
  919.  * WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated
  920.  * manifest constants
  921.  */
  922.  
  923. #ifndef GUID_DEFINED
  924. #define GUID_DEFINED
  925. typedef struct _GUID
  926. {
  927.     unsigned long  Data1;
  928.     unsigned short Data2;
  929.     unsigned short Data3;
  930.     unsigned char  Data4[8];
  931. } GUID;
  932. #endif /* GUID_DEFINED */
  933.  
  934. #ifndef __LPGUID_DEFINED__
  935. #define __LPGUID_DEFINED__
  936. typedef GUID *LPGUID;
  937. #endif
  938.  
  939. #define MAX_PROTOCOL_CHAIN 7
  940.  
  941. #define BASE_PROTOCOL      1
  942. #define LAYERED_PROTOCOL   0
  943.  
  944. typedef struct _WSAPROTOCOLCHAIN {
  945.     int ChainLen;                                 /* the length of the chain,     */
  946.                                                   /* length = 0 means layered protocol, */
  947.                                                   /* length = 1 means base protocol, */
  948.                                                   /* length > 1 means protocol chain */
  949.     DWORD ChainEntries[MAX_PROTOCOL_CHAIN];       /* a list of dwCatalogEntryIds */
  950. } WSAPROTOCOLCHAIN, FAR * LPWSAPROTOCOLCHAIN;
  951.  
  952. #define WSAPROTOCOL_LEN  255
  953.  
  954. typedef struct _WSAPROTOCOL_INFOA {
  955.     DWORD dwServiceFlags1;
  956.     DWORD dwServiceFlags2;
  957.     DWORD dwServiceFlags3;
  958.     DWORD dwServiceFlags4;
  959.     DWORD dwProviderFlags;
  960.     GUID ProviderId;
  961.     DWORD dwCatalogEntryId;
  962.     WSAPROTOCOLCHAIN ProtocolChain;
  963.     int iVersion;
  964.     int iAddressFamily;
  965.     int iMaxSockAddr;
  966.     int iMinSockAddr;
  967.     int iSocketType;
  968.     int iProtocol;
  969.     int iProtocolMaxOffset;
  970.     int iNetworkByteOrder;
  971.     int iSecurityScheme;
  972.     DWORD dwMessageSize;
  973.     DWORD dwProviderReserved;
  974.     CHAR   szProtocol[WSAPROTOCOL_LEN+1];
  975. } WSAPROTOCOL_INFOA, FAR * LPWSAPROTOCOL_INFOA;
  976. typedef struct _WSAPROTOCOL_INFOW {
  977.     DWORD dwServiceFlags1;
  978.     DWORD dwServiceFlags2;
  979.     DWORD dwServiceFlags3;
  980.     DWORD dwServiceFlags4;
  981.     DWORD dwProviderFlags;
  982.     GUID ProviderId;
  983.     DWORD dwCatalogEntryId;
  984.     WSAPROTOCOLCHAIN ProtocolChain;
  985.     int iVersion;
  986.     int iAddressFamily;
  987.     int iMaxSockAddr;
  988.     int iMinSockAddr;
  989.     int iSocketType;
  990.     int iProtocol;
  991.     int iProtocolMaxOffset;
  992.     int iNetworkByteOrder;
  993.     int iSecurityScheme;
  994.     DWORD dwMessageSize;
  995.     DWORD dwProviderReserved;
  996.     WCHAR  szProtocol[WSAPROTOCOL_LEN+1];
  997. } WSAPROTOCOL_INFOW, FAR * LPWSAPROTOCOL_INFOW;
  998. #ifdef UNICODE
  999. typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO;
  1000. typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO;
  1001. #else
  1002. typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO;
  1003. typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO;
  1004. #endif // UNICODE
  1005.  
  1006. /* Flag bit definitions for dwProviderFlags */
  1007. #define PFL_MULTIPLE_PROTO_ENTRIES          0x00000001
  1008. #define PFL_RECOMMENDED_PROTO_ENTRY         0x00000002
  1009. #define PFL_HIDDEN                          0x00000004
  1010. #define PFL_MATCHES_PROTOCOL_ZERO           0x00000008
  1011.  
  1012. /* Flag bit definitions for dwServiceFlags1 */
  1013. #define XP1_CONNECTIONLESS                  0x00000001
  1014. #define XP1_GUARANTEED_DELIVERY             0x00000002
  1015. #define XP1_GUARANTEED_ORDER                0x00000004
  1016. #define XP1_MESSAGE_ORIENTED                0x00000008
  1017. #define XP1_PSEUDO_STREAM                   0x00000010
  1018. #define XP1_GRACEFUL_CLOSE                  0x00000020
  1019. #define XP1_EXPEDITED_DATA                  0x00000040
  1020. #define XP1_CONNECT_DATA                    0x00000080
  1021. #define XP1_DISCONNECT_DATA                 0x00000100
  1022. #define XP1_SUPPORT_BROADCAST               0x00000200
  1023. #define XP1_SUPPORT_MULTIPOINT              0x00000400
  1024. #define XP1_MULTIPOINT_CONTROL_PLANE        0x00000800
  1025. #define XP1_MULTIPOINT_DATA_PLANE           0x00001000
  1026. #define XP1_QOS_SUPPORTED                   0x00002000
  1027. #define XP1_INTERRUPT                       0x00004000
  1028. #define XP1_UNI_SEND                        0x00008000
  1029. #define XP1_UNI_RECV                        0x00010000
  1030. #define XP1_IFS_HANDLES                     0x00020000
  1031. #define XP1_PARTIAL_MESSAGE                 0x00040000
  1032.  
  1033. #define BIGENDIAN                           0x0000
  1034. #define LITTLEENDIAN                        0x0001
  1035.  
  1036. #define SECURITY_PROTOCOL_NONE              0x0000
  1037.  
  1038. /*
  1039.  * WinSock 2 extension -- manifest constants for WSAJoinLeaf()
  1040.  */
  1041. #define JL_SENDER_ONLY    0x01
  1042. #define JL_RECEIVER_ONLY  0x02
  1043. #define JL_BOTH           0x04
  1044.  
  1045. /*
  1046.  * WinSock 2 extension -- manifest constants for WSASocket()
  1047.  */
  1048. #define WSA_FLAG_OVERLAPPED           0x01
  1049. #define WSA_FLAG_MULTIPOINT_C_ROOT    0x02
  1050. #define WSA_FLAG_MULTIPOINT_C_LEAF    0x04
  1051. #define WSA_FLAG_MULTIPOINT_D_ROOT    0x08
  1052. #define WSA_FLAG_MULTIPOINT_D_LEAF    0x10
  1053.  
  1054. /*
  1055.  * WinSock 2 extension -- manifest constants for WSAIoctl()
  1056.  */
  1057. #define IOC_UNIX                      0x00000000
  1058. #define IOC_WS2                       0x08000000
  1059. #define IOC_PROTOCOL                  0x10000000
  1060. #define IOC_VENDOR                    0x18000000
  1061.  
  1062. #define _WSAIO(x,y)                   (IOC_VOID|(x)|(y))
  1063. #define _WSAIOR(x,y)                  (IOC_OUT|(x)|(y))
  1064. #define _WSAIOW(x,y)                  (IOC_IN|(x)|(y))
  1065. #define _WSAIORW(x,y)                 (IOC_INOUT|(x)|(y))
  1066.  
  1067. #define SIO_ASSOCIATE_HANDLE          _WSAIOW(IOC_WS2,1)
  1068. #define SIO_ENABLE_CIRCULAR_QUEUEING  _WSAIO(IOC_WS2,2)
  1069. #define SIO_FIND_ROUTE                _WSAIOR(IOC_WS2,3)
  1070. #define SIO_FLUSH                     _WSAIO(IOC_WS2,4)
  1071. #define SIO_GET_BROADCAST_ADDRESS     _WSAIOR(IOC_WS2,5)
  1072. #define SIO_GET_EXTENSION_FUNCTION_POINTER  _WSAIORW(IOC_WS2,6)
  1073. #define SIO_GET_QOS                   _WSAIORW(IOC_WS2,7)
  1074. #define SIO_GET_GROUP_QOS             _WSAIORW(IOC_WS2,8)
  1075. #define SIO_MULTIPOINT_LOOPBACK       _WSAIOW(IOC_WS2,9)
  1076. #define SIO_MULTICAST_SCOPE           _WSAIOW(IOC_WS2,10)
  1077. #define SIO_SET_QOS                   _WSAIOW(IOC_WS2,11)
  1078. #define SIO_SET_GROUP_QOS             _WSAIOW(IOC_WS2,12)
  1079. #define SIO_TRANSLATE_HANDLE          _WSAIORW(IOC_WS2,13)
  1080. #define SIO_ROUTING_INTERFACE_QUERY   _WSAIORW(IOC_WS2,20)
  1081. #define SIO_ROUTING_INTERFACE_CHANGE  _WSAIOW(IOC_WS2,21)
  1082. #define SIO_ADDRESS_LIST_QUERY        _WSAIOR(IOC_WS2,22)
  1083. #define SIO_ADDRESS_LIST_CHANGE       _WSAIO(IOC_WS2,23)
  1084. #define SIO_QUERY_TARGET_PNP_HANDLE   _WSAIOR(IOC_W32,24)
  1085.  
  1086. /*
  1087.  * WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl
  1088.  */
  1089. #define TH_NETDEV        0x00000001
  1090. #define TH_TAPI          0x00000002
  1091.  
  1092.  
  1093. /*
  1094.  * Microsoft Windows Extended data types required for the functions to
  1095.  * convert   back  and  forth  between  binary  and  string  forms  of
  1096.  * addresses.
  1097.  */
  1098. typedef struct sockaddr SOCKADDR;
  1099. typedef struct sockaddr *PSOCKADDR;
  1100. typedef struct sockaddr FAR *LPSOCKADDR;
  1101.  
  1102. /*
  1103.  * Manifest constants and type definitions related to name resolution and
  1104.  * registration (RNR) API
  1105.  */
  1106.  
  1107. #ifndef _tagBLOB_DEFINED
  1108. #define _tagBLOB_DEFINED
  1109. #define _BLOB_DEFINED
  1110. #define _LPBLOB_DEFINED
  1111. typedef struct _BLOB {
  1112.     ULONG cbSize ;
  1113. #ifdef MIDL_PASS
  1114.     [size_is(cbSize)] BYTE *pBlobData;
  1115. #else  /* MIDL_PASS */
  1116.     BYTE *pBlobData ;
  1117. #endif /* MIDL_PASS */
  1118. } BLOB, *LPBLOB ;
  1119. #endif
  1120.  
  1121. /*
  1122.  * Service Install Flags
  1123.  */
  1124.  
  1125. #define SERVICE_MULTIPLE       (0x00000001)
  1126.  
  1127. /*
  1128.  *& Name Spaces
  1129.  */
  1130.  
  1131. #define NS_ALL                      (0)
  1132.  
  1133. #define NS_SAP                      (1)
  1134. #define NS_NDS                      (2)
  1135. #define NS_PEER_BROWSE              (3)
  1136.  
  1137. #define NS_TCPIP_LOCAL              (10)
  1138. #define NS_TCPIP_HOSTS              (11)
  1139. #define NS_DNS                      (12)
  1140. #define NS_NETBT                    (13)
  1141. #define NS_WINS                     (14)
  1142.  
  1143. #define NS_NBP                      (20)
  1144.  
  1145. #define NS_MS                       (30)
  1146. #define NS_STDA                     (31)
  1147. #define NS_NTDS                     (32)
  1148.  
  1149. #define NS_X500                     (40)
  1150. #define NS_NIS                      (41)
  1151. #define NS_NISPLUS                  (42)
  1152.  
  1153. #define NS_WRQ                      (50)
  1154.  
  1155. /*
  1156.  * Resolution flags for WSAGetAddressByName().
  1157.  * Note these are also used by the 1.1 API GetAddressByName, so
  1158.  * leave them around.
  1159.  */
  1160. #define RES_UNUSED_1                (0x00000001)
  1161. #define RES_FLUSH_CACHE             (0x00000002)
  1162. #ifndef RES_SERVICE
  1163. #define RES_SERVICE                 (0x00000004)
  1164. #endif /* RES_SERVICE */
  1165.  
  1166. /*
  1167.  * Well known value names for Service Types
  1168.  */
  1169.  
  1170. #define SERVICE_TYPE_VALUE_IPXPORTA      "IpxSocket"
  1171. #define SERVICE_TYPE_VALUE_IPXPORTW     L"IpxSocket"
  1172. #define SERVICE_TYPE_VALUE_SAPIDA        "SapId"
  1173. #define SERVICE_TYPE_VALUE_SAPIDW       L"SapId"
  1174.  
  1175. #define SERVICE_TYPE_VALUE_TCPPORTA      "TcpPort"
  1176. #define SERVICE_TYPE_VALUE_TCPPORTW     L"TcpPort"
  1177.  
  1178. #define SERVICE_TYPE_VALUE_UDPPORTA      "UdpPort"
  1179. #define SERVICE_TYPE_VALUE_UDPPORTW     L"UdpPort"
  1180.  
  1181. #define SERVICE_TYPE_VALUE_OBJECTIDA     "ObjectId"
  1182. #define SERVICE_TYPE_VALUE_OBJECTIDW    L"ObjectId"
  1183.  
  1184. #ifdef UNICODE
  1185.  
  1186. #define SERVICE_TYPE_VALUE_SAPID        SERVICE_TYPE_VALUE_SAPIDW
  1187. #define SERVICE_TYPE_VALUE_TCPPORT      SERVICE_TYPE_VALUE_TCPPORTW
  1188. #define SERVICE_TYPE_VALUE_UDPPORT      SERVICE_TYPE_VALUE_UDPPORTW
  1189. #define SERVICE_TYPE_VALUE_OBJECTID     SERVICE_TYPE_VALUE_OBJECTIDW
  1190.  
  1191. #else /* not UNICODE */
  1192.  
  1193. #define SERVICE_TYPE_VALUE_SAPID        SERVICE_TYPE_VALUE_SAPIDA
  1194. #define SERVICE_TYPE_VALUE_TCPPORT      SERVICE_TYPE_VALUE_TCPPORTA
  1195. #define SERVICE_TYPE_VALUE_UDPPORT      SERVICE_TYPE_VALUE_UDPPORTA
  1196. #define SERVICE_TYPE_VALUE_OBJECTID     SERVICE_TYPE_VALUE_OBJECTIDA
  1197.  
  1198. #endif
  1199.  
  1200. #ifndef __CSADDR_DEFINED__
  1201. #define __CSADDR_DEFINED__
  1202.  
  1203.  
  1204. /*
  1205.  * SockAddr Information
  1206.  */
  1207. typedef struct _SOCKET_ADDRESS {
  1208.     LPSOCKADDR lpSockaddr ;
  1209.     INT iSockaddrLength ;
  1210. } SOCKET_ADDRESS, *PSOCKET_ADDRESS, FAR * LPSOCKET_ADDRESS ;
  1211.  
  1212. /*
  1213.  * CSAddr Information
  1214.  */
  1215. typedef struct _CSADDR_INFO {
  1216.     SOCKET_ADDRESS LocalAddr ;
  1217.     SOCKET_ADDRESS RemoteAddr ;
  1218.     INT iSocketType ;
  1219.     INT iProtocol ;
  1220. } CSADDR_INFO, *PCSADDR_INFO, FAR * LPCSADDR_INFO ;
  1221. #endif // __CSADDR_DEFINED__
  1222.  
  1223. /*
  1224.  * Address list returned via SIO_ADDRESS_LIST_QUERY
  1225.  */
  1226. typedef struct _SOCKET_ADDRESS_LIST {
  1227.     INT             iAddressCount;
  1228.     SOCKET_ADDRESS  Address[1];
  1229. } SOCKET_ADDRESS_LIST, FAR * LPSOCKET_ADDRESS_LIST;
  1230.  
  1231. /*
  1232.  *  Address Family/Protocol Tuples
  1233.  */
  1234. typedef struct _AFPROTOCOLS {
  1235.     INT iAddressFamily;
  1236.     INT iProtocol;
  1237. } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
  1238.  
  1239. /*
  1240.  * Client Query API Typedefs
  1241.  */
  1242.  
  1243. /*
  1244.  * The comparators
  1245.  */
  1246. typedef enum _WSAEcomparator
  1247. {
  1248.     COMP_EQUAL = 0,
  1249.     COMP_NOTLESS
  1250. } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
  1251.  
  1252. typedef struct _WSAVersion
  1253. {
  1254.     DWORD           dwVersion;
  1255.     WSAECOMPARATOR  ecHow;
  1256. }WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
  1257.  
  1258. typedef struct _WSAQuerySetA
  1259. {
  1260.     DWORD           dwSize;
  1261.     LPSTR           lpszServiceInstanceName;
  1262.     LPGUID          lpServiceClassId;
  1263.     LPWSAVERSION    lpVersion;
  1264.     LPSTR           lpszComment;
  1265.     DWORD           dwNameSpace;
  1266.     LPGUID          lpNSProviderId;
  1267.     LPSTR           lpszContext;
  1268.     DWORD           dwNumberOfProtocols;
  1269.     LPAFPROTOCOLS   lpafpProtocols;
  1270.     LPSTR           lpszQueryString;
  1271.     DWORD           dwNumberOfCsAddrs;
  1272.     LPCSADDR_INFO   lpcsaBuffer;
  1273.     DWORD           dwOutputFlags;
  1274.     LPBLOB          lpBlob;
  1275. } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
  1276. typedef struct _WSAQuerySetW
  1277. {
  1278.     DWORD           dwSize;
  1279.     LPWSTR          lpszServiceInstanceName;
  1280.     LPGUID          lpServiceClassId;
  1281.     LPWSAVERSION    lpVersion;
  1282.     LPWSTR          lpszComment;
  1283.     DWORD           dwNameSpace;
  1284.     LPGUID          lpNSProviderId;
  1285.     LPWSTR          lpszContext;
  1286.     DWORD           dwNumberOfProtocols;
  1287.     LPAFPROTOCOLS   lpafpProtocols;
  1288.     LPWSTR          lpszQueryString;
  1289.     DWORD           dwNumberOfCsAddrs;
  1290.     LPCSADDR_INFO   lpcsaBuffer;
  1291.     DWORD           dwOutputFlags;
  1292.     LPBLOB          lpBlob;
  1293. } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;
  1294. #ifdef UNICODE
  1295. typedef WSAQUERYSETW WSAQUERYSET;
  1296. typedef PWSAQUERYSETW PWSAQUERYSET;
  1297. typedef LPWSAQUERYSETW LPWSAQUERYSET;
  1298. #else
  1299. typedef WSAQUERYSETA WSAQUERYSET;
  1300. typedef PWSAQUERYSETA PWSAQUERYSET;
  1301. typedef LPWSAQUERYSETA LPWSAQUERYSET;
  1302. #endif // UNICODE
  1303.  
  1304. #define LUP_DEEP                0x0001
  1305. #define LUP_CONTAINERS          0x0002
  1306. #define LUP_NOCONTAINERS        0x0004
  1307. #define LUP_NEAREST             0x0008
  1308. #define LUP_RETURN_NAME         0x0010
  1309. #define LUP_RETURN_TYPE         0x0020
  1310. #define LUP_RETURN_VERSION      0x0040
  1311. #define LUP_RETURN_COMMENT      0x0080
  1312. #define LUP_RETURN_ADDR         0x0100
  1313. #define LUP_RETURN_BLOB         0x0200
  1314. #define LUP_RETURN_ALIASES      0x0400
  1315. #define LUP_RETURN_QUERY_STRING 0x0800
  1316. #define LUP_RETURN_ALL          0x0FF0
  1317. #define LUP_RES_SERVICE         0x8000
  1318.  
  1319. #define LUP_FLUSHCACHE       0x1000
  1320. #define LUP_FLUSHPREVIOUS    0x2000
  1321.  
  1322.  
  1323. //
  1324. // Return flags
  1325. //
  1326.  
  1327. #define RESULT_IS_ALIAS      0x0001
  1328.  
  1329. /*
  1330.  * Service Address Registration and Deregistration Data Types.
  1331.  */
  1332.  
  1333. typedef enum _WSAESETSERVICEOP
  1334. {
  1335.     RNRSERVICE_REGISTER=0,
  1336.     RNRSERVICE_DEREGISTER,
  1337.     RNRSERVICE_DELETE
  1338. } WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP;
  1339.  
  1340. /*
  1341.  * Service Installation/Removal Data Types.
  1342.  */
  1343.  
  1344. typedef struct _WSANSClassInfoA
  1345. {
  1346.     LPSTR   lpszName;
  1347.     DWORD   dwNameSpace;
  1348.     DWORD   dwValueType;
  1349.     DWORD   dwValueSize;
  1350.     LPVOID  lpValue;
  1351. }WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA;
  1352. typedef struct _WSANSClassInfoW
  1353. {
  1354.     LPWSTR  lpszName;
  1355.     DWORD   dwNameSpace;
  1356.     DWORD   dwValueType;
  1357.     DWORD   dwValueSize;
  1358.     LPVOID  lpValue;
  1359. }WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW;
  1360. #ifdef UNICODE
  1361. typedef WSANSCLASSINFOW WSANSCLASSINFO;
  1362. typedef PWSANSCLASSINFOW PWSANSCLASSINFO;
  1363. typedef LPWSANSCLASSINFOW LPWSANSCLASSINFO;
  1364. #else
  1365. typedef WSANSCLASSINFOA WSANSCLASSINFO;
  1366. typedef PWSANSCLASSINFOA PWSANSCLASSINFO;
  1367. typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO;
  1368. #endif // UNICODE
  1369.  
  1370. typedef struct _WSAServiceClassInfoA
  1371. {
  1372.     LPGUID              lpServiceClassId;
  1373.     LPSTR               lpszServiceClassName;
  1374.     DWORD               dwCount;
  1375.     LPWSANSCLASSINFOA   lpClassInfos;
  1376. }WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA;
  1377. typedef struct _WSAServiceClassInfoW
  1378. {
  1379.     LPGUID              lpServiceClassId;
  1380.     LPWSTR              lpszServiceClassName;
  1381.     DWORD               dwCount;
  1382.     LPWSANSCLASSINFOW   lpClassInfos;
  1383. }WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW;
  1384. #ifdef UNICODE
  1385. typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO;
  1386. typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO;
  1387. typedef LPWSASERVICECLASSINFOW LPWSASERVICECLASSINFO;
  1388. #else
  1389. typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO;
  1390. typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO;
  1391. typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO;
  1392. #endif // UNICODE
  1393.  
  1394. typedef struct _WSANAMESPACE_INFOA {
  1395.     GUID                NSProviderId;
  1396.     DWORD               dwNameSpace;
  1397.     BOOL                fActive;
  1398.     DWORD               dwVersion;
  1399.     LPSTR               lpszIdentifier;
  1400. } WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA;
  1401. typedef struct _WSANAMESPACE_INFOW {
  1402.     GUID                NSProviderId;
  1403.     DWORD               dwNameSpace;
  1404.     BOOL                fActive;
  1405.     DWORD               dwVersion;
  1406.     LPWSTR              lpszIdentifier;
  1407. } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW;
  1408. #ifdef UNICODE
  1409. typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO;
  1410. typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO;
  1411. typedef LPWSANAMESPACE_INFOW LPWSANAMESPACE_INFO;
  1412. #else
  1413. typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO;
  1414. typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO;
  1415. typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO;
  1416. #endif // UNICODE
  1417.  
  1418. /* Socket function prototypes */
  1419.  
  1420. #if INCL_WINSOCK_API_PROTOTYPES
  1421. WINSOCK_API_LINKAGE
  1422. SOCKET
  1423. WSAAPI
  1424. accept(
  1425.     SOCKET s,
  1426.     struct sockaddr FAR * addr,
  1427.     int FAR * addrlen
  1428.     );
  1429. #endif // INCL_WINSOCK_API_PROTOTYPES
  1430.  
  1431. #if INCL_WINSOCK_API_TYPEDEFS
  1432. typedef
  1433. SOCKET
  1434. (WSAAPI * LPFN_ACCEPT)(
  1435.     SOCKET s,
  1436.     struct sockaddr FAR * addr,
  1437.     int FAR * addrlen
  1438.     );
  1439. #endif // INCL_WINSOCK_API_TYPEDEFS
  1440.  
  1441. #if INCL_WINSOCK_API_PROTOTYPES
  1442. WINSOCK_API_LINKAGE
  1443. int
  1444. WSAAPI
  1445. bind(
  1446.     SOCKET s,
  1447.     const struct sockaddr FAR * name,
  1448.     int namelen
  1449.     );
  1450. #endif // INCL_WINSOCK_API_PROTOTYPES
  1451.  
  1452. #if INCL_WINSOCK_API_TYPEDEFS
  1453. typedef
  1454. int
  1455. (WSAAPI * LPFN_BIND)(
  1456.     SOCKET s,
  1457.     const struct sockaddr FAR * name,
  1458.     int namelen
  1459.     );
  1460. #endif // INCL_WINSOCK_API_TYPEDEFS
  1461.  
  1462. #if INCL_WINSOCK_API_PROTOTYPES
  1463. WINSOCK_API_LINKAGE
  1464. int
  1465. WSAAPI
  1466. closesocket(
  1467.     SOCKET s
  1468.     );
  1469. #endif // INCL_WINSOCK_API_PROTOTYPES
  1470.  
  1471. #if INCL_WINSOCK_API_TYPEDEFS
  1472. typedef
  1473. int
  1474. (WSAAPI * LPFN_CLOSESOCKET)(
  1475.     SOCKET s
  1476.     );
  1477. #endif // INCL_WINSOCK_API_TYPEDEFS
  1478.  
  1479. #if INCL_WINSOCK_API_PROTOTYPES
  1480. WINSOCK_API_LINKAGE
  1481. int
  1482. WSAAPI
  1483. connect(
  1484.     SOCKET s,
  1485.     const struct sockaddr FAR * name,
  1486.     int namelen
  1487.     );
  1488. #endif // INCL_WINSOCK_API_PROTOTYPES
  1489.  
  1490. #if INCL_WINSOCK_API_TYPEDEFS
  1491. typedef
  1492. int
  1493. (WSAAPI * LPFN_CONNECT)(
  1494.     SOCKET s,
  1495.     const struct sockaddr FAR * name,
  1496.     int namelen
  1497.     );
  1498. #endif // INCL_WINSOCK_API_TYPEDEFS
  1499.  
  1500. #if INCL_WINSOCK_API_PROTOTYPES
  1501. WINSOCK_API_LINKAGE
  1502. int
  1503. WSAAPI
  1504. ioctlsocket(
  1505.     SOCKET s,
  1506.     long cmd,
  1507.     u_long FAR * argp
  1508.     );
  1509. #endif // INCL_WINSOCK_API_PROTOTYPES
  1510.  
  1511. #if INCL_WINSOCK_API_TYPEDEFS
  1512. typedef
  1513. int
  1514. (WSAAPI * LPFN_IOCTLSOCKET)(
  1515.     SOCKET s,
  1516.     long cmd,
  1517.     u_long FAR * argp
  1518.     );
  1519. #endif // INCL_WINSOCK_API_TYPEDEFS
  1520.  
  1521. #if INCL_WINSOCK_API_PROTOTYPES
  1522. WINSOCK_API_LINKAGE
  1523. int
  1524. WSAAPI
  1525. getpeername(
  1526.     SOCKET s,
  1527.     struct sockaddr FAR * name,
  1528.     int FAR * namelen
  1529.     );
  1530. #endif // INCL_WINSOCK_API_PROTOTYPES
  1531.  
  1532. #if INCL_WINSOCK_API_TYPEDEFS
  1533. typedef
  1534. int
  1535. (WSAAPI * LPFN_GETPEERNAME)(
  1536.     SOCKET s,
  1537.     struct sockaddr FAR * name,
  1538.     int FAR * namelen
  1539.     );
  1540. #endif // INCL_WINSOCK_API_TYPEDEFS
  1541.  
  1542. #if INCL_WINSOCK_API_PROTOTYPES
  1543. WINSOCK_API_LINKAGE
  1544. int
  1545. WSAAPI
  1546. getsockname(
  1547.     SOCKET s,
  1548.     struct sockaddr FAR * name,
  1549.     int FAR * namelen
  1550.     );
  1551. #endif // INCL_WINSOCK_API_PROTOTYPES
  1552.  
  1553. #if INCL_WINSOCK_API_TYPEDEFS
  1554. typedef
  1555. int
  1556. (WSAAPI * LPFN_GETSOCKNAME)(
  1557.     SOCKET s,
  1558.     struct sockaddr FAR * name,
  1559.     int FAR * namelen
  1560.     );
  1561. #endif // INCL_WINSOCK_API_TYPEDEFS
  1562.  
  1563. #if INCL_WINSOCK_API_PROTOTYPES
  1564. WINSOCK_API_LINKAGE
  1565. int
  1566. WSAAPI
  1567. getsockopt(
  1568.     SOCKET s,
  1569.     int level,
  1570.     int optname,
  1571.     char FAR * optval,
  1572.     int FAR * optlen
  1573.     );
  1574. #endif // INCL_WINSOCK_API_PROTOTYPES
  1575.  
  1576. #if INCL_WINSOCK_API_TYPEDEFS
  1577. typedef
  1578. int
  1579. (WSAAPI * LPFN_GETSOCKOPT)(
  1580.     SOCKET s,
  1581.     int level,
  1582.     int optname,
  1583.     char FAR * optval,
  1584.     int FAR * optlen
  1585.     );
  1586. #endif // INCL_WINSOCK_API_TYPEDEFS
  1587.  
  1588. #if INCL_WINSOCK_API_PROTOTYPES
  1589. WINSOCK_API_LINKAGE
  1590. u_long
  1591. WSAAPI
  1592. htonl(
  1593.     u_long hostlong
  1594.     );
  1595. #endif // INCL_WINSOCK_API_PROTOTYPES
  1596.  
  1597. #if INCL_WINSOCK_API_TYPEDEFS
  1598. typedef
  1599. u_long
  1600. (WSAAPI * LPFN_HTONL)(
  1601.     u_long hostlong
  1602.     );
  1603. #endif // INCL_WINSOCK_API_TYPEDEFS
  1604.  
  1605. #if INCL_WINSOCK_API_PROTOTYPES
  1606. WINSOCK_API_LINKAGE
  1607. u_short
  1608. WSAAPI
  1609. htons(
  1610.     u_short hostshort
  1611.     );
  1612. #endif // INCL_WINSOCK_API_PROTOTYPES
  1613.  
  1614. #if INCL_WINSOCK_API_TYPEDEFS
  1615. typedef
  1616. u_short
  1617. (WSAAPI * LPFN_HTONS)(
  1618.     u_short hostshort
  1619.     );
  1620. #endif // INCL_WINSOCK_API_TYPEDEFS
  1621.  
  1622. #if INCL_WINSOCK_API_PROTOTYPES
  1623. WINSOCK_API_LINKAGE
  1624. unsigned long
  1625. WSAAPI
  1626. inet_addr(
  1627.     const char FAR * cp
  1628.     );
  1629. #endif // INCL_WINSOCK_API_PROTOTYPES
  1630.  
  1631. #if INCL_WINSOCK_API_TYPEDEFS
  1632. typedef
  1633. unsigned long
  1634. (WSAAPI * LPFN_INET_ADDR)(
  1635.     const char FAR * cp
  1636.     );
  1637. #endif // INCL_WINSOCK_API_TYPEDEFS
  1638.  
  1639. #if INCL_WINSOCK_API_PROTOTYPES
  1640. WINSOCK_API_LINKAGE
  1641. char FAR *
  1642. WSAAPI
  1643. inet_ntoa(
  1644.     struct in_addr in
  1645.     );
  1646. #endif // INCL_WINSOCK_API_PROTOTYPES
  1647.  
  1648. #if INCL_WINSOCK_API_TYPEDEFS
  1649. typedef
  1650. char FAR *
  1651. (WSAAPI * LPFN_INET_NTOA)(
  1652.     struct in_addr in
  1653.     );
  1654. #endif // INCL_WINSOCK_API_TYPEDEFS
  1655.  
  1656. #if INCL_WINSOCK_API_PROTOTYPES
  1657. WINSOCK_API_LINKAGE
  1658. int
  1659. WSAAPI
  1660. listen(
  1661.     SOCKET s,
  1662.     int backlog
  1663.     );
  1664. #endif // INCL_WINSOCK_API_PROTOTYPES
  1665.  
  1666. #if INCL_WINSOCK_API_TYPEDEFS
  1667. typedef
  1668. int
  1669. (WSAAPI * LPFN_LISTEN)(
  1670.     SOCKET s,
  1671.     int backlog
  1672.     );
  1673. #endif // INCL_WINSOCK_API_TYPEDEFS
  1674.  
  1675. #if INCL_WINSOCK_API_PROTOTYPES
  1676. WINSOCK_API_LINKAGE
  1677. u_long
  1678. WSAAPI
  1679. ntohl(
  1680.     u_long netlong
  1681.     );
  1682. #endif // INCL_WINSOCK_API_PROTOTYPES
  1683.  
  1684. #if INCL_WINSOCK_API_TYPEDEFS
  1685. typedef
  1686. u_long
  1687. (WSAAPI * LPFN_NTOHL)(
  1688.     u_long netlong
  1689.     );
  1690. #endif // INCL_WINSOCK_API_TYPEDEFS
  1691.  
  1692. #if INCL_WINSOCK_API_PROTOTYPES
  1693. WINSOCK_API_LINKAGE
  1694. u_short
  1695. WSAAPI
  1696. ntohs(
  1697.     u_short netshort
  1698.     );
  1699. #endif // INCL_WINSOCK_API_PROTOTYPES
  1700.  
  1701. #if INCL_WINSOCK_API_TYPEDEFS
  1702. typedef
  1703. u_short
  1704. (WSAAPI * LPFN_NTOHS)(
  1705.     u_short netshort
  1706.     );
  1707. #endif // INCL_WINSOCK_API_TYPEDEFS
  1708.  
  1709. #if INCL_WINSOCK_API_PROTOTYPES
  1710. WINSOCK_API_LINKAGE
  1711. int
  1712. WSAAPI
  1713. recv(
  1714.     SOCKET s,
  1715.     char FAR * buf,
  1716.     int len,
  1717.     int flags
  1718.     );
  1719. #endif // INCL_WINSOCK_API_PROTOTYPES
  1720.  
  1721. #if INCL_WINSOCK_API_TYPEDEFS
  1722. typedef
  1723. int
  1724. (WSAAPI * LPFN_RECV)(
  1725.     SOCKET s,
  1726.     char FAR * buf,
  1727.     int len,
  1728.     int flags
  1729.     );
  1730. #endif // INCL_WINSOCK_API_TYPEDEFS
  1731.  
  1732. #if INCL_WINSOCK_API_PROTOTYPES
  1733. WINSOCK_API_LINKAGE
  1734. int
  1735. WSAAPI
  1736. recvfrom(
  1737.     SOCKET s,
  1738.     char FAR * buf,
  1739.     int len,
  1740.     int flags,
  1741.     struct sockaddr FAR * from,
  1742.     int FAR * fromlen
  1743.     );
  1744. #endif // INCL_WINSOCK_API_PROTOTYPES
  1745.  
  1746. #if INCL_WINSOCK_API_TYPEDEFS
  1747. typedef
  1748. int
  1749. (WSAAPI * LPFN_RECVFROM)(
  1750.     SOCKET s,
  1751.     char FAR * buf,
  1752.     int len,
  1753.     int flags,
  1754.     struct sockaddr FAR * from,
  1755.     int FAR * fromlen
  1756.     );
  1757. #endif // INCL_WINSOCK_API_TYPEDEFS
  1758.  
  1759. #if INCL_WINSOCK_API_PROTOTYPES
  1760. WINSOCK_API_LINKAGE
  1761. int
  1762. WSAAPI
  1763. select(
  1764.     int nfds,
  1765.     fd_set FAR * readfds,
  1766.     fd_set FAR * writefds,
  1767.     fd_set FAR *exceptfds,
  1768.     const struct timeval FAR * timeout
  1769.     );
  1770. #endif // INCL_WINSOCK_API_PROTOTYPES
  1771.  
  1772. #if INCL_WINSOCK_API_TYPEDEFS
  1773. typedef
  1774. int
  1775. (WSAAPI * LPFN_SELECT)(
  1776.     int nfds,
  1777.     fd_set FAR * readfds,
  1778.     fd_set FAR * writefds,
  1779.     fd_set FAR *exceptfds,
  1780.     const struct timeval FAR * timeout
  1781.     );
  1782. #endif // INCL_WINSOCK_API_TYPEDEFS
  1783.  
  1784. #if INCL_WINSOCK_API_PROTOTYPES
  1785. WINSOCK_API_LINKAGE
  1786. int
  1787. WSAAPI
  1788. send(
  1789.     SOCKET s,
  1790.     const char FAR * buf,
  1791.     int len,
  1792.     int flags
  1793.     );
  1794. #endif // INCL_WINSOCK_API_PROTOTYPES
  1795.  
  1796. #if INCL_WINSOCK_API_TYPEDEFS
  1797. typedef
  1798. int
  1799. (WSAAPI * LPFN_SEND)(
  1800.     SOCKET s,
  1801.     const char FAR * buf,
  1802.     int len,
  1803.     int flags
  1804.     );
  1805. #endif // INCL_WINSOCK_API_TYPEDEFS
  1806.  
  1807. #if INCL_WINSOCK_API_PROTOTYPES
  1808. WINSOCK_API_LINKAGE
  1809. int
  1810. WSAAPI
  1811. sendto(
  1812.     SOCKET s,
  1813.     const char FAR * buf,
  1814.     int len,
  1815.     int flags,
  1816.     const struct sockaddr FAR * to,
  1817.     int tolen
  1818.     );
  1819. #endif // INCL_WINSOCK_API_PROTOTYPES
  1820.  
  1821. #if INCL_WINSOCK_API_TYPEDEFS
  1822. typedef
  1823. int
  1824. (WSAAPI * LPFN_SENDTO)(
  1825.     SOCKET s,
  1826.     const char FAR * buf,
  1827.     int len,
  1828.     int flags,
  1829.     const struct sockaddr FAR * to,
  1830.     int tolen
  1831.     );
  1832. #endif // INCL_WINSOCK_API_TYPEDEFS
  1833.  
  1834. #if INCL_WINSOCK_API_PROTOTYPES
  1835. WINSOCK_API_LINKAGE
  1836. int
  1837. WSAAPI
  1838. setsockopt(
  1839.     SOCKET s,
  1840.     int level,
  1841.     int optname,
  1842.     const char FAR * optval,
  1843.     int optlen
  1844.     );
  1845. #endif // INCL_WINSOCK_API_PROTOTYPES
  1846.  
  1847. #if INCL_WINSOCK_API_TYPEDEFS
  1848. typedef
  1849. int
  1850. (WSAAPI * LPFN_SETSOCKOPT)(
  1851.     SOCKET s,
  1852.     int level,
  1853.     int optname,
  1854.     const char FAR * optval,
  1855.     int optlen
  1856.     );
  1857. #endif // INCL_WINSOCK_API_TYPEDEFS
  1858.  
  1859. #if INCL_WINSOCK_API_PROTOTYPES
  1860. WINSOCK_API_LINKAGE
  1861. int
  1862. WSAAPI
  1863. shutdown(
  1864.     SOCKET s,
  1865.     int how
  1866.     );
  1867. #endif // INCL_WINSOCK_API_PROTOTYPES
  1868.  
  1869. #if INCL_WINSOCK_API_TYPEDEFS
  1870. typedef
  1871. int
  1872. (WSAAPI * LPFN_SHUTDOWN)(
  1873.     SOCKET s,
  1874.     int how
  1875.     );
  1876. #endif // INCL_WINSOCK_API_TYPEDEFS
  1877.  
  1878. #if INCL_WINSOCK_API_PROTOTYPES
  1879. WINSOCK_API_LINKAGE
  1880. SOCKET
  1881. WSAAPI
  1882. socket(
  1883.     int af,
  1884.     int type,
  1885.     int protocol
  1886.     );
  1887. #endif // INCL_WINSOCK_API_PROTOTYPES
  1888.  
  1889. #if INCL_WINSOCK_API_TYPEDEFS
  1890. typedef
  1891. SOCKET
  1892. (WSAAPI * LPFN_SOCKET)(
  1893.     int af,
  1894.     int type,
  1895.     int protocol
  1896.     );
  1897. #endif // INCL_WINSOCK_API_TYPEDEFS
  1898.  
  1899. /* Database function prototypes */
  1900.  
  1901. #if INCL_WINSOCK_API_PROTOTYPES
  1902. WINSOCK_API_LINKAGE
  1903. struct hostent FAR *
  1904. WSAAPI
  1905. gethostbyaddr(
  1906.     const char FAR * addr,
  1907.     int len,
  1908.     int type
  1909.     );
  1910. #endif // INCL_WINSOCK_API_PROTOTYPES
  1911.  
  1912. #if INCL_WINSOCK_API_TYPEDEFS
  1913. typedef
  1914. struct hostent FAR *
  1915. (WSAAPI * LPFN_GETHOSTBYADDR)(
  1916.     const char FAR * addr,
  1917.     int len,
  1918.     int type
  1919.     );
  1920. #endif // INCL_WINSOCK_API_TYPEDEFS
  1921.  
  1922. #if INCL_WINSOCK_API_PROTOTYPES
  1923. WINSOCK_API_LINKAGE
  1924. struct hostent FAR *
  1925. WSAAPI
  1926. gethostbyname(
  1927.     const char FAR * name
  1928.     );
  1929. #endif // INCL_WINSOCK_API_PROTOTYPES
  1930.  
  1931. #if INCL_WINSOCK_API_TYPEDEFS
  1932. typedef
  1933. struct hostent FAR *
  1934. (WSAAPI * LPFN_GETHOSTBYNAME)(
  1935.     const char FAR * name
  1936.     );
  1937. #endif // INCL_WINSOCK_API_TYPEDEFS
  1938.  
  1939. #if INCL_WINSOCK_API_PROTOTYPES
  1940. WINSOCK_API_LINKAGE
  1941. int
  1942. WSAAPI
  1943. gethostname(
  1944.     char FAR * name,
  1945.     int namelen
  1946.     );
  1947. #endif // INCL_WINSOCK_API_PROTOTYPES
  1948.  
  1949. #if INCL_WINSOCK_API_TYPEDEFS
  1950. typedef
  1951. int
  1952. (WSAAPI * LPFN_GETHOSTNAME)(
  1953.     char FAR * name,
  1954.     int namelen
  1955.     );
  1956. #endif // INCL_WINSOCK_API_TYPEDEFS
  1957.  
  1958. #if INCL_WINSOCK_API_PROTOTYPES
  1959. WINSOCK_API_LINKAGE
  1960. struct servent FAR *
  1961. WSAAPI
  1962. getservbyport(
  1963.     int port,
  1964.     const char FAR * proto
  1965.     );
  1966. #endif // INCL_WINSOCK_API_PROTOTYPES
  1967.  
  1968. #if INCL_WINSOCK_API_TYPEDEFS
  1969. typedef
  1970. struct servent FAR *
  1971. (WSAAPI * LPFN_GETSERVBYPORT)(
  1972.     int port,
  1973.     const char FAR * proto
  1974.     );
  1975. #endif // INCL_WINSOCK_API_TYPEDEFS
  1976.  
  1977. #if INCL_WINSOCK_API_PROTOTYPES
  1978. WINSOCK_API_LINKAGE
  1979. struct servent FAR *
  1980. WSAAPI
  1981. getservbyname(
  1982.     const char FAR * name,
  1983.     const char FAR * proto
  1984.     );
  1985. #endif // INCL_WINSOCK_API_PROTOTYPES
  1986.  
  1987. #if INCL_WINSOCK_API_TYPEDEFS
  1988. typedef
  1989. struct servent FAR *
  1990. (WSAAPI * LPFN_GETSERVBYNAME)(
  1991.     const char FAR * name,
  1992.     const char FAR * proto
  1993.     );
  1994. #endif // INCL_WINSOCK_API_TYPEDEFS
  1995.  
  1996. #if INCL_WINSOCK_API_PROTOTYPES
  1997. WINSOCK_API_LINKAGE
  1998. struct protoent FAR *
  1999. WSAAPI
  2000. getprotobynumber(
  2001.     int number
  2002.     );
  2003. #endif // INCL_WINSOCK_API_PROTOTYPES
  2004.  
  2005. #if INCL_WINSOCK_API_TYPEDEFS
  2006. typedef
  2007. struct protoent FAR *
  2008. (WSAAPI * LPFN_GETPROTOBYNUMBER)(
  2009.     int number
  2010.     );
  2011. #endif // INCL_WINSOCK_API_TYPEDEFS
  2012.  
  2013. #if INCL_WINSOCK_API_PROTOTYPES
  2014. WINSOCK_API_LINKAGE
  2015. struct protoent FAR *
  2016. WSAAPI
  2017. getprotobyname(
  2018.     const char FAR * name
  2019.     );
  2020. #endif // INCL_WINSOCK_API_PROTOTYPES
  2021.  
  2022. #if INCL_WINSOCK_API_TYPEDEFS
  2023. typedef
  2024. struct protoent FAR *
  2025. (WSAAPI * LPFN_GETPROTOBYNAME)(
  2026.     const char FAR * name
  2027.     );
  2028. #endif // INCL_WINSOCK_API_TYPEDEFS
  2029.  
  2030. /* Microsoft Windows Extension function prototypes */
  2031.  
  2032. #if INCL_WINSOCK_API_PROTOTYPES
  2033. WINSOCK_API_LINKAGE
  2034. int
  2035. WSAAPI
  2036. WSAStartup(
  2037.     WORD wVersionRequested,
  2038.     LPWSADATA lpWSAData
  2039.     );
  2040. #endif // INCL_WINSOCK_API_PROTOTYPES
  2041.  
  2042. #if INCL_WINSOCK_API_TYPEDEFS
  2043. typedef
  2044. int
  2045. (WSAAPI * LPFN_WSASTARTUP)(
  2046.     WORD wVersionRequested,
  2047.     LPWSADATA lpWSAData
  2048.     );
  2049. #endif // INCL_WINSOCK_API_TYPEDEFS
  2050.  
  2051. #if INCL_WINSOCK_API_PROTOTYPES
  2052. WINSOCK_API_LINKAGE
  2053. int
  2054. WSAAPI
  2055. WSACleanup(
  2056.     void
  2057.     );
  2058. #endif // INCL_WINSOCK_API_PROTOTYPES
  2059.  
  2060. #if INCL_WINSOCK_API_TYPEDEFS
  2061. typedef
  2062. int
  2063. (WSAAPI * LPFN_WSACLEANUP)(
  2064.     void
  2065.     );
  2066. #endif // INCL_WINSOCK_API_TYPEDEFS
  2067.  
  2068. #if INCL_WINSOCK_API_PROTOTYPES
  2069. WINSOCK_API_LINKAGE
  2070. void
  2071. WSAAPI
  2072. WSASetLastError(
  2073.     int iError
  2074.     );
  2075. #endif // INCL_WINSOCK_API_PROTOTYPES
  2076.  
  2077. #if INCL_WINSOCK_API_TYPEDEFS
  2078. typedef
  2079. void
  2080. (WSAAPI * LPFN_WSASETLASTERROR)(
  2081.     int iError
  2082.     );
  2083. #endif // INCL_WINSOCK_API_TYPEDEFS
  2084.  
  2085. #if INCL_WINSOCK_API_PROTOTYPES
  2086. WINSOCK_API_LINKAGE
  2087. int
  2088. WSAAPI
  2089. WSAGetLastError(
  2090.     void
  2091.     );
  2092. #endif // INCL_WINSOCK_API_PROTOTYPES
  2093.  
  2094. #if INCL_WINSOCK_API_TYPEDEFS
  2095. typedef
  2096. int
  2097. (WSAAPI * LPFN_WSAGETLASTERROR)(
  2098.     void
  2099.     );
  2100. #endif // INCL_WINSOCK_API_TYPEDEFS
  2101.  
  2102. #if INCL_WINSOCK_API_PROTOTYPES
  2103. WINSOCK_API_LINKAGE
  2104. BOOL
  2105. WSAAPI
  2106. WSAIsBlocking(
  2107.     void
  2108.     );
  2109. #endif // INCL_WINSOCK_API_PROTOTYPES
  2110.  
  2111. #if INCL_WINSOCK_API_TYPEDEFS
  2112. typedef
  2113. BOOL
  2114. (WSAAPI * LPFN_WSAISBLOCKING)(
  2115.     void
  2116.     );
  2117. #endif // INCL_WINSOCK_API_TYPEDEFS
  2118.  
  2119. #if INCL_WINSOCK_API_PROTOTYPES
  2120. WINSOCK_API_LINKAGE
  2121. int
  2122. WSAAPI
  2123. WSAUnhookBlockingHook(
  2124.     void
  2125.     );
  2126. #endif // INCL_WINSOCK_API_PROTOTYPES
  2127.  
  2128. #if INCL_WINSOCK_API_TYPEDEFS
  2129. typedef
  2130. int
  2131. (WSAAPI * LPFN_WSAUNHOOKBLOCKINGHOOK)(
  2132.     void
  2133.     );
  2134. #endif // INCL_WINSOCK_API_TYPEDEFS
  2135.  
  2136. #if INCL_WINSOCK_API_PROTOTYPES
  2137. WINSOCK_API_LINKAGE
  2138. FARPROC
  2139. WSAAPI
  2140. WSASetBlockingHook(
  2141.     FARPROC lpBlockFunc
  2142.     );
  2143. #endif // INCL_WINSOCK_API_PROTOTYPES
  2144.  
  2145. #if INCL_WINSOCK_API_TYPEDEFS
  2146. typedef
  2147. FARPROC
  2148. (WSAAPI * LPFN_WSASETBLOCKINGHOOK)(
  2149.     FARPROC lpBlockFunc
  2150.     );
  2151. #endif // INCL_WINSOCK_API_TYPEDEFS
  2152.  
  2153. #if INCL_WINSOCK_API_PROTOTYPES
  2154. WINSOCK_API_LINKAGE
  2155. int
  2156. WSAAPI
  2157. WSACancelBlockingCall(
  2158.     void
  2159.     );
  2160. #endif // INCL_WINSOCK_API_PROTOTYPES
  2161.  
  2162. #if INCL_WINSOCK_API_TYPEDEFS
  2163. typedef
  2164. int
  2165. (WSAAPI * LPFN_WSACANCELBLOCKINGCALL)(
  2166.     void
  2167.     );
  2168. #endif // INCL_WINSOCK_API_TYPEDEFS
  2169.  
  2170. #if INCL_WINSOCK_API_PROTOTYPES
  2171. WINSOCK_API_LINKAGE
  2172. HANDLE
  2173. WSAAPI
  2174. WSAAsyncGetServByName(
  2175.     HWND hWnd,
  2176.     u_int wMsg,
  2177.     const char FAR * name,
  2178.     const char FAR * proto,
  2179.     char FAR * buf,
  2180.     int buflen
  2181.     );
  2182. #endif // INCL_WINSOCK_API_PROTOTYPES
  2183.  
  2184. #if INCL_WINSOCK_API_TYPEDEFS
  2185. typedef
  2186. HANDLE
  2187. (WSAAPI * LPFN_WSAASYNCGETSERVBYNAME)(
  2188.     HWND hWnd,
  2189.     u_int wMsg,
  2190.     const char FAR * name,
  2191.     const char FAR * proto,
  2192.     char FAR * buf,
  2193.     int buflen
  2194.     );
  2195. #endif // INCL_WINSOCK_API_TYPEDEFS
  2196.  
  2197. #if INCL_WINSOCK_API_PROTOTYPES
  2198. WINSOCK_API_LINKAGE
  2199. HANDLE
  2200. WSAAPI
  2201. WSAAsyncGetServByPort(
  2202.     HWND hWnd,
  2203.     u_int wMsg,
  2204.     int port,
  2205.     const char FAR * proto,
  2206.     char FAR * buf,
  2207.     int buflen
  2208.     );
  2209. #endif // INCL_WINSOCK_API_PROTOTYPES
  2210.  
  2211. #if INCL_WINSOCK_API_TYPEDEFS
  2212. typedef
  2213. HANDLE
  2214. (WSAAPI * LPFN_WSAASYNCGETSERVBYPORT)(
  2215.     HWND hWnd,
  2216.     u_int wMsg,
  2217.     int port,
  2218.     const char FAR * proto,
  2219.     char FAR * buf,
  2220.     int buflen
  2221.     );
  2222. #endif // INCL_WINSOCK_API_TYPEDEFS
  2223.  
  2224. #if INCL_WINSOCK_API_PROTOTYPES
  2225. WINSOCK_API_LINKAGE
  2226. HANDLE
  2227. WSAAPI
  2228. WSAAsyncGetProtoByName(
  2229.     HWND hWnd,
  2230.     u_int wMsg,
  2231.     const char FAR * name,
  2232.     char FAR * buf,
  2233.     int buflen
  2234.     );
  2235. #endif // INCL_WINSOCK_API_PROTOTYPES
  2236.  
  2237. #if INCL_WINSOCK_API_TYPEDEFS
  2238. typedef
  2239. HANDLE
  2240. (WSAAPI * LPFN_WSAASYNCGETPROTOBYNAME)(
  2241.     HWND hWnd,
  2242.     u_int wMsg,
  2243.     const char FAR * name,
  2244.     char FAR * buf,
  2245.     int buflen
  2246.     );
  2247. #endif // INCL_WINSOCK_API_TYPEDEFS
  2248.  
  2249. #if INCL_WINSOCK_API_PROTOTYPES
  2250. WINSOCK_API_LINKAGE
  2251. HANDLE
  2252. WSAAPI
  2253. WSAAsyncGetProtoByNumber(
  2254.     HWND hWnd,
  2255.     u_int wMsg,
  2256.     int number,
  2257.     char FAR * buf,
  2258.     int buflen
  2259.     );
  2260. #endif // INCL_WINSOCK_API_PROTOTYPES
  2261.  
  2262. #if INCL_WINSOCK_API_TYPEDEFS
  2263. typedef
  2264. HANDLE
  2265. (WSAAPI * LPFN_WSAASYNCGETPROTOBYNUMBER)(
  2266.     HWND hWnd,
  2267.     u_int wMsg,
  2268.     int number,
  2269.     char FAR * buf,
  2270.     int buflen
  2271.     );
  2272. #endif // INCL_WINSOCK_API_TYPEDEFS
  2273.  
  2274. #if INCL_WINSOCK_API_PROTOTYPES
  2275. WINSOCK_API_LINKAGE
  2276. HANDLE
  2277. WSAAPI
  2278. WSAAsyncGetHostByName(
  2279.     HWND hWnd,
  2280.     u_int wMsg,
  2281.     const char FAR * name,
  2282.     char FAR * buf,
  2283.     int buflen
  2284.     );
  2285. #endif // INCL_WINSOCK_API_PROTOTYPES
  2286.  
  2287. #if INCL_WINSOCK_API_TYPEDEFS
  2288. typedef
  2289. HANDLE
  2290. (WSAAPI * LPFN_WSAASYNCGETHOSTBYNAME)(
  2291.     HWND hWnd,
  2292.     u_int wMsg,
  2293.     const char FAR * name,
  2294.     char FAR * buf,
  2295.     int buflen
  2296.     );
  2297. #endif // INCL_WINSOCK_API_TYPEDEFS
  2298.  
  2299. #if INCL_WINSOCK_API_PROTOTYPES
  2300. WINSOCK_API_LINKAGE
  2301. HANDLE
  2302. WSAAPI
  2303. WSAAsyncGetHostByAddr(
  2304.     HWND hWnd,
  2305.     u_int wMsg,
  2306.     const char FAR * addr,
  2307.     int len,
  2308.     int type,
  2309.     char FAR * buf,
  2310.     int buflen
  2311.     );
  2312. #endif // INCL_WINSOCK_API_PROTOTYPES
  2313.  
  2314. #if INCL_WINSOCK_API_TYPEDEFS
  2315. typedef
  2316. HANDLE
  2317. (WSAAPI * LPFN_WSAASYNCGETHOSTBYADDR)(
  2318.     HWND hWnd,
  2319.     u_int wMsg,
  2320.     const char FAR * addr,
  2321.     int len,
  2322.     int type,
  2323.     char FAR * buf,
  2324.     int buflen
  2325.     );
  2326. #endif // INCL_WINSOCK_API_TYPEDEFS
  2327.  
  2328. #if INCL_WINSOCK_API_PROTOTYPES
  2329. WINSOCK_API_LINKAGE
  2330. int
  2331. WSAAPI
  2332. WSACancelAsyncRequest(
  2333.     HANDLE hAsyncTaskHandle
  2334.     );
  2335. #endif // INCL_WINSOCK_API_PROTOTYPES
  2336.  
  2337. #if INCL_WINSOCK_API_TYPEDEFS
  2338. typedef
  2339. int
  2340. (WSAAPI * LPFN_WSACANCELASYNCREQUEST)(
  2341.     HANDLE hAsyncTaskHandle
  2342.     );
  2343. #endif // INCL_WINSOCK_API_TYPEDEFS
  2344.  
  2345. #if INCL_WINSOCK_API_PROTOTYPES
  2346. WINSOCK_API_LINKAGE
  2347. int
  2348. WSAAPI
  2349. WSAAsyncSelect(
  2350.     SOCKET s,
  2351.     HWND hWnd,
  2352.     u_int wMsg,
  2353.     long lEvent
  2354.     );
  2355. #endif // INCL_WINSOCK_API_PROTOTYPES
  2356.  
  2357. #if INCL_WINSOCK_API_TYPEDEFS
  2358. typedef
  2359. int
  2360. (WSAAPI * LPFN_WSAASYNCSELECT)(
  2361.     SOCKET s,
  2362.     HWND hWnd,
  2363.     u_int wMsg,
  2364.     long lEvent
  2365.     );
  2366. #endif // INCL_WINSOCK_API_TYPEDEFS
  2367.  
  2368. /*
  2369.  * WinSock 2 extensions -- data types for the condition function in
  2370.  * WSAAccept() and overlapped I/O completion routine.
  2371.  */
  2372.  
  2373. typedef
  2374. int
  2375. (CALLBACK * LPCONDITIONPROC)(
  2376.     LPWSABUF lpCallerId,
  2377.     LPWSABUF lpCallerData,
  2378.     LPQOS lpSQOS,
  2379.     LPQOS lpGQOS,
  2380.     LPWSABUF lpCalleeId,
  2381.     LPWSABUF lpCalleeData,
  2382.     GROUP FAR * g,
  2383.     DWORD dwCallbackData
  2384.     );
  2385.  
  2386. typedef
  2387. void
  2388. (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(
  2389.     DWORD dwError,
  2390.     DWORD cbTransferred,
  2391.     LPWSAOVERLAPPED lpOverlapped,
  2392.     DWORD dwFlags
  2393.     );
  2394.  
  2395. /* WinSock 2 API new function prototypes */
  2396.  
  2397. #if INCL_WINSOCK_API_PROTOTYPES
  2398. WINSOCK_API_LINKAGE
  2399. SOCKET
  2400. WSAAPI
  2401. WSAAccept(
  2402.     SOCKET s,
  2403.     struct sockaddr FAR * addr,
  2404.     LPINT addrlen,
  2405.     LPCONDITIONPROC lpfnCondition,
  2406.     DWORD dwCallbackData
  2407.     );
  2408. #endif // INCL_WINSOCK_API_PROTOTYPES
  2409.  
  2410. #if INCL_WINSOCK_API_TYPEDEFS
  2411. typedef
  2412. SOCKET
  2413. (WSAAPI * LPFN_WSAACCEPT)(
  2414.     SOCKET s,
  2415.     struct sockaddr FAR * addr,
  2416.     LPINT addrlen,
  2417.     LPCONDITIONPROC lpfnCondition,
  2418.     DWORD dwCallbackData
  2419.     );
  2420. #endif // INCL_WINSOCK_API_TYPEDEFS
  2421.  
  2422. #if INCL_WINSOCK_API_PROTOTYPES
  2423. WINSOCK_API_LINKAGE
  2424. BOOL
  2425. WSAAPI
  2426. WSACloseEvent(
  2427.     WSAEVENT hEvent
  2428.     );
  2429. #endif // INCL_WINSOCK_API_PROTOTYPES
  2430.  
  2431. #if INCL_WINSOCK_API_TYPEDEFS
  2432. typedef
  2433. BOOL
  2434. (WSAAPI * LPFN_WSACLOSEEVENT)(
  2435.     WSAEVENT hEvent
  2436.     );
  2437. #endif // INCL_WINSOCK_API_TYPEDEFS
  2438.  
  2439. #if INCL_WINSOCK_API_PROTOTYPES
  2440. WINSOCK_API_LINKAGE
  2441. int
  2442. WSAAPI
  2443. WSAConnect(
  2444.     SOCKET s,
  2445.     const struct sockaddr FAR * name,
  2446.     int namelen,
  2447.     LPWSABUF lpCallerData,
  2448.     LPWSABUF lpCalleeData,
  2449.     LPQOS lpSQOS,
  2450.     LPQOS lpGQOS
  2451.     );
  2452. #endif // INCL_WINSOCK_API_PROTOTYPES
  2453.  
  2454. #if INCL_WINSOCK_API_TYPEDEFS
  2455. typedef
  2456. int
  2457. (WSAAPI * LPFN_WSACONNECT)(
  2458.     SOCKET s,
  2459.     const struct sockaddr FAR * name,
  2460.     int namelen,
  2461.     LPWSABUF lpCallerData,
  2462.     LPWSABUF lpCalleeData,
  2463.     LPQOS lpSQOS,
  2464.     LPQOS lpGQOS
  2465.     );
  2466. #endif // INCL_WINSOCK_API_TYPEDEFS
  2467.  
  2468. #if INCL_WINSOCK_API_PROTOTYPES
  2469. WINSOCK_API_LINKAGE
  2470. WSAEVENT
  2471. WSAAPI
  2472. WSACreateEvent(
  2473.     void
  2474.     );
  2475. #endif // INCL_WINSOCK_API_PROTOTYPES
  2476.  
  2477. #if INCL_WINSOCK_API_TYPEDEFS
  2478. typedef
  2479. WSAEVENT
  2480. (WSAAPI * LPFN_WSACREATEEVENT)(
  2481.     void
  2482.     );
  2483. #endif // INCL_WINSOCK_API_TYPEDEFS
  2484.  
  2485. #if INCL_WINSOCK_API_PROTOTYPES
  2486. WINSOCK_API_LINKAGE
  2487. int
  2488. WSAAPI
  2489. WSADuplicateSocketA(
  2490.     SOCKET s,
  2491.     DWORD dwProcessId,
  2492.     LPWSAPROTOCOL_INFOA lpProtocolInfo
  2493.     );
  2494. WINSOCK_API_LINKAGE
  2495. int
  2496. WSAAPI
  2497. WSADuplicateSocketW(
  2498.     SOCKET s,
  2499.     DWORD dwProcessId,
  2500.     LPWSAPROTOCOL_INFOW lpProtocolInfo
  2501.     );
  2502. #ifdef UNICODE
  2503. #define WSADuplicateSocket  WSADuplicateSocketW
  2504. #else
  2505. #define WSADuplicateSocket  WSADuplicateSocketA
  2506. #endif // !UNICODE
  2507. #endif // INCL_WINSOCK_API_PROTOTYPES
  2508.  
  2509. #if INCL_WINSOCK_API_TYPEDEFS
  2510. typedef
  2511. int
  2512. (WSAAPI * LPFN_WSADUPLICATESOCKETA)(
  2513.     SOCKET s,
  2514.     DWORD dwProcessId,
  2515.     LPWSAPROTOCOL_INFOA lpProtocolInfo
  2516.     );
  2517. typedef
  2518. int
  2519. (WSAAPI * LPFN_WSADUPLICATESOCKETW)(
  2520.     SOCKET s,
  2521.     DWORD dwProcessId,
  2522.     LPWSAPROTOCOL_INFOW lpProtocolInfo
  2523.     );
  2524. #ifdef UNICODE
  2525. #define LPFN_WSADUPLICATESOCKET  LPFN_WSADUPLICATESOCKETW
  2526. #else
  2527. #define LPFN_WSADUPLICATESOCKET  LPFN_WSADUPLICATESOCKETA
  2528. #endif // !UNICODE
  2529. #endif // INCL_WINSOCK_API_TYPEDEFS
  2530.  
  2531. #if INCL_WINSOCK_API_PROTOTYPES
  2532. WINSOCK_API_LINKAGE
  2533. int
  2534. WSAAPI
  2535. WSAEnumNetworkEvents(
  2536.     SOCKET s,
  2537.     WSAEVENT hEventObject,
  2538.     LPWSANETWORKEVENTS lpNetworkEvents
  2539.     );
  2540. #endif // INCL_WINSOCK_API_PROTOTYPES
  2541.  
  2542. #if INCL_WINSOCK_API_TYPEDEFS
  2543. typedef
  2544. int
  2545. (WSAAPI * LPFN_WSAENUMNETWORKEVENTS)(
  2546.     SOCKET s,
  2547.     WSAEVENT hEventObject,
  2548.     LPWSANETWORKEVENTS lpNetworkEvents
  2549.     );
  2550. #endif // INCL_WINSOCK_API_TYPEDEFS
  2551.  
  2552. #if INCL_WINSOCK_API_PROTOTYPES
  2553. WINSOCK_API_LINKAGE
  2554. int
  2555. WSAAPI
  2556. WSAEnumProtocolsA(
  2557.     LPINT lpiProtocols,
  2558.     LPWSAPROTOCOL_INFOA lpProtocolBuffer,
  2559.     LPDWORD lpdwBufferLength
  2560.     );
  2561. WINSOCK_API_LINKAGE
  2562. int
  2563. WSAAPI
  2564. WSAEnumProtocolsW(
  2565.     LPINT lpiProtocols,
  2566.     LPWSAPROTOCOL_INFOW lpProtocolBuffer,
  2567.     LPDWORD lpdwBufferLength
  2568.     );
  2569. #ifdef UNICODE
  2570. #define WSAEnumProtocols  WSAEnumProtocolsW
  2571. #else
  2572. #define WSAEnumProtocols  WSAEnumProtocolsA
  2573. #endif // !UNICODE
  2574. #endif // INCL_WINSOCK_API_PROTOTYPES
  2575.  
  2576. #if INCL_WINSOCK_API_TYPEDEFS
  2577. typedef
  2578. int
  2579. (WSAAPI * LPFN_WSAENUMPROTOCOLSA)(
  2580.     LPINT lpiProtocols,
  2581.     LPWSAPROTOCOL_INFOA lpProtocolBuffer,
  2582.     LPDWORD lpdwBufferLength
  2583.     );
  2584. typedef
  2585. int
  2586. (WSAAPI * LPFN_WSAENUMPROTOCOLSW)(
  2587.     LPINT lpiProtocols,
  2588.     LPWSAPROTOCOL_INFOW lpProtocolBuffer,
  2589.     LPDWORD lpdwBufferLength
  2590.     );
  2591. #ifdef UNICODE
  2592. #define LPFN_WSAENUMPROTOCOLS  LPFN_WSAENUMPROTOCOLSW
  2593. #else
  2594. #define LPFN_WSAENUMPROTOCOLS  LPFN_WSAENUMPROTOCOLSA
  2595. #endif // !UNICODE
  2596. #endif // INCL_WINSOCK_API_TYPEDEFS
  2597.  
  2598. #if INCL_WINSOCK_API_PROTOTYPES
  2599. WINSOCK_API_LINKAGE
  2600. int
  2601. WSAAPI
  2602. WSAEventSelect(
  2603.     SOCKET s,
  2604.     WSAEVENT hEventObject,
  2605.     long lNetworkEvents
  2606.     );
  2607. #endif // INCL_WINSOCK_API_PROTOTYPES
  2608.  
  2609. #if INCL_WINSOCK_API_TYPEDEFS
  2610. typedef
  2611. int
  2612. (WSAAPI * LPFN_WSAEVENTSELECT)(
  2613.     SOCKET s,
  2614.     WSAEVENT hEventObject,
  2615.     long lNetworkEvents
  2616.     );
  2617. #endif // INCL_WINSOCK_API_TYPEDEFS
  2618.  
  2619. #if INCL_WINSOCK_API_PROTOTYPES
  2620. WINSOCK_API_LINKAGE
  2621. BOOL
  2622. WSAAPI
  2623. WSAGetOverlappedResult(
  2624.     SOCKET s,
  2625.     LPWSAOVERLAPPED lpOverlapped,
  2626.     LPDWORD lpcbTransfer,
  2627.     BOOL fWait,
  2628.     LPDWORD lpdwFlags
  2629.     );
  2630. #endif // INCL_WINSOCK_API_PROTOTYPES
  2631.  
  2632. #if INCL_WINSOCK_API_TYPEDEFS
  2633. typedef
  2634. BOOL
  2635. (WSAAPI * LPFN_WSAGETOVERLAPPEDRESULT)(
  2636.     SOCKET s,
  2637.     LPWSAOVERLAPPED lpOverlapped,
  2638.     LPDWORD lpcbTransfer,
  2639.     BOOL fWait,
  2640.     LPDWORD lpdwFlags
  2641.     );
  2642. #endif // INCL_WINSOCK_API_TYPEDEFS
  2643.  
  2644. #if INCL_WINSOCK_API_PROTOTYPES
  2645. WINSOCK_API_LINKAGE
  2646. BOOL
  2647. WSAAPI
  2648. WSAGetQOSByName(
  2649.     SOCKET s,
  2650.     LPWSABUF lpQOSName,
  2651.     LPQOS lpQOS
  2652.     );
  2653. #endif // INCL_WINSOCK_API_PROTOTYPES
  2654.  
  2655. #if INCL_WINSOCK_API_TYPEDEFS
  2656. typedef
  2657. BOOL
  2658. (WSAAPI * LPFN_WSAGETQOSBYNAME)(
  2659.     SOCKET s,
  2660.     LPWSABUF lpQOSName,
  2661.     LPQOS lpQOS
  2662.     );
  2663. #endif // INCL_WINSOCK_API_TYPEDEFS
  2664.  
  2665. #if INCL_WINSOCK_API_PROTOTYPES
  2666. WINSOCK_API_LINKAGE
  2667. int
  2668. WSAAPI
  2669. WSAHtonl(
  2670.     SOCKET s,
  2671.     u_long hostlong,
  2672.     u_long FAR * lpnetlong
  2673.     );
  2674. #endif // INCL_WINSOCK_API_PROTOTYPES
  2675.  
  2676. #if INCL_WINSOCK_API_TYPEDEFS
  2677. typedef
  2678. int
  2679. (WSAAPI * LPFN_WSAHTONL)(
  2680.     SOCKET s,
  2681.     u_long hostlong,
  2682.     u_long FAR * lpnetlong
  2683.     );
  2684. #endif // INCL_WINSOCK_API_TYPEDEFS
  2685.  
  2686. #if INCL_WINSOCK_API_PROTOTYPES
  2687. WINSOCK_API_LINKAGE
  2688. int
  2689. WSAAPI
  2690. WSAHtons(
  2691.     SOCKET s,
  2692.     u_short hostshort,
  2693.     u_short FAR * lpnetshort
  2694.     );
  2695. #endif // INCL_WINSOCK_API_PROTOTYPES
  2696.  
  2697. #if INCL_WINSOCK_API_TYPEDEFS
  2698. typedef
  2699. int
  2700. (WSAAPI * LPFN_WSAHTONS)(
  2701.     SOCKET s,
  2702.     u_short hostshort,
  2703.     u_short FAR * lpnetshort
  2704.     );
  2705. #endif // INCL_WINSOCK_API_TYPEDEFS
  2706.  
  2707. #if INCL_WINSOCK_API_PROTOTYPES
  2708. WINSOCK_API_LINKAGE
  2709. int
  2710. WSAAPI
  2711. WSAIoctl(
  2712.     SOCKET s,
  2713.     DWORD dwIoControlCode,
  2714.     LPVOID lpvInBuffer,
  2715.     DWORD cbInBuffer,
  2716.     LPVOID lpvOutBuffer,
  2717.     DWORD cbOutBuffer,
  2718.     LPDWORD lpcbBytesReturned,
  2719.     LPWSAOVERLAPPED lpOverlapped,
  2720.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2721.     );
  2722. #endif // INCL_WINSOCK_API_PROTOTYPES
  2723.  
  2724. #if INCL_WINSOCK_API_TYPEDEFS
  2725. typedef
  2726. int
  2727. (WSAAPI * LPFN_WSAIOCTL)(
  2728.     SOCKET s,
  2729.     DWORD dwIoControlCode,
  2730.     LPVOID lpvInBuffer,
  2731.     DWORD cbInBuffer,
  2732.     LPVOID lpvOutBuffer,
  2733.     DWORD cbOutBuffer,
  2734.     LPDWORD lpcbBytesReturned,
  2735.     LPWSAOVERLAPPED lpOverlapped,
  2736.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2737.     );
  2738. #endif // INCL_WINSOCK_API_TYPEDEFS
  2739.  
  2740. #if INCL_WINSOCK_API_PROTOTYPES
  2741. WINSOCK_API_LINKAGE
  2742. SOCKET
  2743. WSAAPI
  2744. WSAJoinLeaf(
  2745.     SOCKET s,
  2746.     const struct sockaddr FAR * name,
  2747.     int namelen,
  2748.     LPWSABUF lpCallerData,
  2749.     LPWSABUF lpCalleeData,
  2750.     LPQOS lpSQOS,
  2751.     LPQOS lpGQOS,
  2752.     DWORD dwFlags
  2753.     );
  2754. #endif // INCL_WINSOCK_API_PROTOTYPES
  2755.  
  2756. #if INCL_WINSOCK_API_TYPEDEFS
  2757. typedef
  2758. SOCKET
  2759. (WSAAPI * LPFN_WSAJOINLEAF)(
  2760.     SOCKET s,
  2761.     const struct sockaddr FAR * name,
  2762.     int namelen,
  2763.     LPWSABUF lpCallerData,
  2764.     LPWSABUF lpCalleeData,
  2765.     LPQOS lpSQOS,
  2766.     LPQOS lpGQOS,
  2767.     DWORD dwFlags
  2768.     );
  2769. #endif // INCL_WINSOCK_API_TYPEDEFS
  2770.  
  2771. #if INCL_WINSOCK_API_PROTOTYPES
  2772. WINSOCK_API_LINKAGE
  2773. int
  2774. WSAAPI
  2775. WSANtohl(
  2776.     SOCKET s,
  2777.     u_long netlong,
  2778.     u_long FAR * lphostlong
  2779.     );
  2780. #endif // INCL_WINSOCK_API_PROTOTYPES
  2781.  
  2782. #if INCL_WINSOCK_API_TYPEDEFS
  2783. typedef
  2784. int
  2785. (WSAAPI * LPFN_WSANTOHL)(
  2786.     SOCKET s,
  2787.     u_long netlong,
  2788.     u_long FAR * lphostlong
  2789.     );
  2790. #endif // INCL_WINSOCK_API_TYPEDEFS
  2791.  
  2792. #if INCL_WINSOCK_API_PROTOTYPES
  2793. WINSOCK_API_LINKAGE
  2794. int
  2795. WSAAPI
  2796. WSANtohs(
  2797.     SOCKET s,
  2798.     u_short netshort,
  2799.     u_short FAR * lphostshort
  2800.     );
  2801. #endif // INCL_WINSOCK_API_PROTOTYPES
  2802.  
  2803. #if INCL_WINSOCK_API_TYPEDEFS
  2804. typedef
  2805. int
  2806. (WSAAPI * LPFN_WSANTOHS)(
  2807.     SOCKET s,
  2808.     u_short netshort,
  2809.     u_short FAR * lphostshort
  2810.     );
  2811. #endif // INCL_WINSOCK_API_TYPEDEFS
  2812.  
  2813. #if INCL_WINSOCK_API_PROTOTYPES
  2814. WINSOCK_API_LINKAGE
  2815. int
  2816. WSAAPI
  2817. WSARecv(
  2818.     SOCKET s,
  2819.     LPWSABUF lpBuffers,
  2820.     DWORD dwBufferCount,
  2821.     LPDWORD lpNumberOfBytesRecvd,
  2822.     LPDWORD lpFlags,
  2823.     LPWSAOVERLAPPED lpOverlapped,
  2824.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2825.     );
  2826. #endif // INCL_WINSOCK_API_PROTOTYPES
  2827.  
  2828. #if INCL_WINSOCK_API_TYPEDEFS
  2829. typedef
  2830. int
  2831. (WSAAPI * LPFN_WSARECV)(
  2832.     SOCKET s,
  2833.     LPWSABUF lpBuffers,
  2834.     DWORD dwBufferCount,
  2835.     LPDWORD lpNumberOfBytesRecvd,
  2836.     LPDWORD lpFlags,
  2837.     LPWSAOVERLAPPED lpOverlapped,
  2838.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2839.     );
  2840. #endif // INCL_WINSOCK_API_TYPEDEFS
  2841.  
  2842. #if INCL_WINSOCK_API_PROTOTYPES
  2843. WINSOCK_API_LINKAGE
  2844. int
  2845. WSAAPI
  2846. WSARecvDisconnect(
  2847.     SOCKET s,
  2848.     LPWSABUF lpInboundDisconnectData
  2849.     );
  2850. #endif // INCL_WINSOCK_API_PROTOTYPES
  2851.  
  2852. #if INCL_WINSOCK_API_TYPEDEFS
  2853. typedef
  2854. int
  2855. (WSAAPI * LPFN_WSARECVDISCONNECT)(
  2856.     SOCKET s,
  2857.     LPWSABUF lpInboundDisconnectData
  2858.     );
  2859. #endif // INCL_WINSOCK_API_TYPEDEFS
  2860.  
  2861. #if INCL_WINSOCK_API_PROTOTYPES
  2862. WINSOCK_API_LINKAGE
  2863. int
  2864. WSAAPI
  2865. WSARecvFrom(
  2866.     SOCKET s,
  2867.     LPWSABUF lpBuffers,
  2868.     DWORD dwBufferCount,
  2869.     LPDWORD lpNumberOfBytesRecvd,
  2870.     LPDWORD lpFlags,
  2871.     struct sockaddr FAR * lpFrom,
  2872.     LPINT lpFromlen,
  2873.     LPWSAOVERLAPPED lpOverlapped,
  2874.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2875.     );
  2876. #endif // INCL_WINSOCK_API_PROTOTYPES
  2877.  
  2878. #if INCL_WINSOCK_API_TYPEDEFS
  2879. typedef
  2880. int
  2881. (WSAAPI * LPFN_WSARECVFROM)(
  2882.     SOCKET s,
  2883.     LPWSABUF lpBuffers,
  2884.     DWORD dwBufferCount,
  2885.     LPDWORD lpNumberOfBytesRecvd,
  2886.     LPDWORD lpFlags,
  2887.     struct sockaddr FAR * lpFrom,
  2888.     LPINT lpFromlen,
  2889.     LPWSAOVERLAPPED lpOverlapped,
  2890.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2891.     );
  2892. #endif // INCL_WINSOCK_API_TYPEDEFS
  2893.  
  2894. #if INCL_WINSOCK_API_PROTOTYPES
  2895. WINSOCK_API_LINKAGE
  2896. BOOL
  2897. WSAAPI
  2898. WSAResetEvent(
  2899.     WSAEVENT hEvent
  2900.     );
  2901. #endif // INCL_WINSOCK_API_PROTOTYPES
  2902.  
  2903. #if INCL_WINSOCK_API_TYPEDEFS
  2904. typedef
  2905. BOOL
  2906. (WSAAPI * LPFN_WSARESETEVENT)(
  2907.     WSAEVENT hEvent
  2908.     );
  2909. #endif // INCL_WINSOCK_API_TYPEDEFS
  2910.  
  2911. #if INCL_WINSOCK_API_PROTOTYPES
  2912. WINSOCK_API_LINKAGE
  2913. int
  2914. WSAAPI
  2915. WSASend(
  2916.     SOCKET s,
  2917.     LPWSABUF lpBuffers,
  2918.     DWORD dwBufferCount,
  2919.     LPDWORD lpNumberOfBytesSent,
  2920.     DWORD dwFlags,
  2921.     LPWSAOVERLAPPED lpOverlapped,
  2922.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2923.     );
  2924. #endif // INCL_WINSOCK_API_PROTOTYPES
  2925.  
  2926. #if INCL_WINSOCK_API_TYPEDEFS
  2927. typedef
  2928. int
  2929. (WSAAPI * LPFN_WSASEND)(
  2930.     SOCKET s,
  2931.     LPWSABUF lpBuffers,
  2932.     DWORD dwBufferCount,
  2933.     LPDWORD lpNumberOfBytesSent,
  2934.     DWORD dwFlags,
  2935.     LPWSAOVERLAPPED lpOverlapped,
  2936.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2937.     );
  2938. #endif // INCL_WINSOCK_API_TYPEDEFS
  2939.  
  2940. #if INCL_WINSOCK_API_PROTOTYPES
  2941. WINSOCK_API_LINKAGE
  2942. int
  2943. WSAAPI
  2944. WSASendDisconnect(
  2945.     SOCKET s,
  2946.     LPWSABUF lpOutboundDisconnectData
  2947.     );
  2948. #endif // INCL_WINSOCK_API_PROTOTYPES
  2949.  
  2950. #if INCL_WINSOCK_API_TYPEDEFS
  2951. typedef
  2952. int
  2953. (WSAAPI * LPFN_WSASENDDISCONNECT)(
  2954.     SOCKET s,
  2955.     LPWSABUF lpOutboundDisconnectData
  2956.     );
  2957. #endif // INCL_WINSOCK_API_TYPEDEFS
  2958.  
  2959. #if INCL_WINSOCK_API_PROTOTYPES
  2960. WINSOCK_API_LINKAGE
  2961. int
  2962. WSAAPI
  2963. WSASendTo(
  2964.     SOCKET s,
  2965.     LPWSABUF lpBuffers,
  2966.     DWORD dwBufferCount,
  2967.     LPDWORD lpNumberOfBytesSent,
  2968.     DWORD dwFlags,
  2969.     const struct sockaddr FAR * lpTo,
  2970.     int iTolen,
  2971.     LPWSAOVERLAPPED lpOverlapped,
  2972.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2973.     );
  2974. #endif // INCL_WINSOCK_API_PROTOTYPES
  2975.  
  2976. #if INCL_WINSOCK_API_TYPEDEFS
  2977. typedef
  2978. int
  2979. (WSAAPI * LPFN_WSASENDTO)(
  2980.     SOCKET s,
  2981.     LPWSABUF lpBuffers,
  2982.     DWORD dwBufferCount,
  2983.     LPDWORD lpNumberOfBytesSent,
  2984.     DWORD dwFlags,
  2985.     const struct sockaddr FAR * lpTo,
  2986.     int iTolen,
  2987.     LPWSAOVERLAPPED lpOverlapped,
  2988.     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  2989.     );
  2990. #endif // INCL_WINSOCK_API_TYPEDEFS
  2991.  
  2992. #if INCL_WINSOCK_API_PROTOTYPES
  2993. WINSOCK_API_LINKAGE
  2994. BOOL
  2995. WSAAPI
  2996. WSASetEvent(
  2997.     WSAEVENT hEvent
  2998.     );
  2999. #endif // INCL_WINSOCK_API_PROTOTYPES
  3000.  
  3001. #if INCL_WINSOCK_API_TYPEDEFS
  3002. typedef
  3003. BOOL
  3004. (WSAAPI * LPFN_WSASETEVENT)(
  3005.     WSAEVENT hEvent
  3006.     );
  3007. #endif // INCL_WINSOCK_API_TYPEDEFS
  3008.  
  3009. #if INCL_WINSOCK_API_PROTOTYPES
  3010. WINSOCK_API_LINKAGE
  3011. SOCKET
  3012. WSAAPI
  3013. WSASocketA(
  3014.     int af,
  3015.     int type,
  3016.     int protocol,
  3017.     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3018.     GROUP g,
  3019.     DWORD dwFlags
  3020.     );
  3021. WINSOCK_API_LINKAGE
  3022. SOCKET
  3023. WSAAPI
  3024. WSASocketW(
  3025.     int af,
  3026.     int type,
  3027.     int protocol,
  3028.     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3029.     GROUP g,
  3030.     DWORD dwFlags
  3031.     );
  3032. #ifdef UNICODE
  3033. #define WSASocket  WSASocketW
  3034. #else
  3035. #define WSASocket  WSASocketA
  3036. #endif // !UNICODE
  3037. #endif // INCL_WINSOCK_API_PROTOTYPES
  3038.  
  3039. #if INCL_WINSOCK_API_TYPEDEFS
  3040. typedef
  3041. SOCKET
  3042. (WSAAPI * LPFN_WSASOCKETA)(
  3043.     int af,
  3044.     int type,
  3045.     int protocol,
  3046.     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3047.     GROUP g,
  3048.     DWORD dwFlags
  3049.     );
  3050. typedef
  3051. SOCKET
  3052. (WSAAPI * LPFN_WSASOCKETW)(
  3053.     int af,
  3054.     int type,
  3055.     int protocol,
  3056.     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3057.     GROUP g,
  3058.     DWORD dwFlags
  3059.     );
  3060. #ifdef UNICODE
  3061. #define LPFN_WSASOCKET  LPFN_WSASOCKETW
  3062. #else
  3063. #define LPFN_WSASOCKET  LPFN_WSASOCKETA
  3064. #endif // !UNICODE
  3065. #endif // INCL_WINSOCK_API_TYPEDEFS
  3066.  
  3067. #if INCL_WINSOCK_API_PROTOTYPES
  3068. WINSOCK_API_LINKAGE
  3069. DWORD
  3070. WSAAPI
  3071. WSAWaitForMultipleEvents(
  3072.     DWORD cEvents,
  3073.     const WSAEVENT FAR * lphEvents,
  3074.     BOOL fWaitAll,
  3075.     DWORD dwTimeout,
  3076.     BOOL fAlertable
  3077.     );
  3078. #endif // INCL_WINSOCK_API_PROTOTYPES
  3079.  
  3080. #if INCL_WINSOCK_API_TYPEDEFS
  3081. typedef
  3082. DWORD
  3083. (WSAAPI * LPFN_WSAWAITFORMULTIPLEEVENTS)(
  3084.     DWORD cEvents,
  3085.     const WSAEVENT FAR * lphEvents,
  3086.     BOOL fWaitAll,
  3087.     DWORD dwTimeout,
  3088.     BOOL fAlertable
  3089.     );
  3090. #endif // INCL_WINSOCK_API_TYPEDEFS
  3091.  
  3092. #if INCL_WINSOCK_API_PROTOTYPES
  3093. WINSOCK_API_LINKAGE
  3094. INT
  3095. WSAAPI
  3096. WSAAddressToStringA(
  3097.     IN     LPSOCKADDR          lpsaAddress,
  3098.     IN     DWORD               dwAddressLength,
  3099.     IN     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3100.     IN OUT LPSTR             lpszAddressString,
  3101.     IN OUT LPDWORD             lpdwAddressStringLength
  3102.     );
  3103. WINSOCK_API_LINKAGE
  3104. INT
  3105. WSAAPI
  3106. WSAAddressToStringW(
  3107.     IN     LPSOCKADDR          lpsaAddress,
  3108.     IN     DWORD               dwAddressLength,
  3109.     IN     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3110.     IN OUT LPWSTR             lpszAddressString,
  3111.     IN OUT LPDWORD             lpdwAddressStringLength
  3112.     );
  3113. #ifdef UNICODE
  3114. #define WSAAddressToString  WSAAddressToStringW
  3115. #else
  3116. #define WSAAddressToString  WSAAddressToStringA
  3117. #endif // !UNICODE
  3118. #endif // INCL_WINSOCK_API_PROTOTYPES
  3119.  
  3120. #if INCL_WINSOCK_API_TYPEDEFS
  3121. typedef
  3122. INT
  3123. (WSAAPI * LPFN_WSAADDRESSTOSTRINGA)(
  3124.     IN     LPSOCKADDR          lpsaAddress,
  3125.     IN     DWORD               dwAddressLength,
  3126.     IN     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3127.     IN OUT LPSTR             lpszAddressString,
  3128.     IN OUT LPDWORD             lpdwAddressStringLength
  3129.     );
  3130. typedef
  3131. INT
  3132. (WSAAPI * LPFN_WSAADDRESSTOSTRINGW)(
  3133.     IN     LPSOCKADDR          lpsaAddress,
  3134.     IN     DWORD               dwAddressLength,
  3135.     IN     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3136.     IN OUT LPWSTR             lpszAddressString,
  3137.     IN OUT LPDWORD             lpdwAddressStringLength
  3138.     );
  3139. #ifdef UNICODE
  3140. #define LPFN_WSAADDRESSTOSTRING  LPFN_WSAADDRESSTOSTRINGW
  3141. #else
  3142. #define LPFN_WSAADDRESSTOSTRING  LPFN_WSAADDRESSTOSTRINGA
  3143. #endif // !UNICODE
  3144. #endif // INCL_WINSOCK_API_TYPEDEFS
  3145.  
  3146. #if INCL_WINSOCK_API_PROTOTYPES
  3147. WINSOCK_API_LINKAGE
  3148. INT
  3149. WSAAPI
  3150. WSAStringToAddressA(
  3151.     IN     LPSTR             AddressString,
  3152.     IN     INT                 AddressFamily,
  3153.     IN     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3154.     IN OUT LPSOCKADDR          lpAddress,
  3155.     IN OUT LPINT               lpAddressLength
  3156.     );
  3157. WINSOCK_API_LINKAGE
  3158. INT
  3159. WSAAPI
  3160. WSAStringToAddressW(
  3161.     IN     LPWSTR             AddressString,
  3162.     IN     INT                 AddressFamily,
  3163.     IN     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3164.     IN OUT LPSOCKADDR          lpAddress,
  3165.     IN OUT LPINT               lpAddressLength
  3166.     );
  3167. #ifdef UNICODE
  3168. #define WSAStringToAddress  WSAStringToAddressW
  3169. #else
  3170. #define WSAStringToAddress  WSAStringToAddressA
  3171. #endif // !UNICODE
  3172. #endif // INCL_WINSOCK_API_PROTOTYPES
  3173.  
  3174. #if INCL_WINSOCK_API_TYPEDEFS
  3175. typedef
  3176. INT
  3177. (WSAAPI * LPFN_WSASTRINGTOADDRESSA)(
  3178.     IN     LPSTR             AddressString,
  3179.     IN     INT                 AddressFamily,
  3180.     IN     LPWSAPROTOCOL_INFOA lpProtocolInfo,
  3181.     IN OUT LPSOCKADDR          lpAddress,
  3182.     IN OUT LPINT               lpAddressLength
  3183.     );
  3184. typedef
  3185. INT
  3186. (WSAAPI * LPFN_WSASTRINGTOADDRESSW)(
  3187.     IN     LPWSTR             AddressString,
  3188.     IN     INT                 AddressFamily,
  3189.     IN     LPWSAPROTOCOL_INFOW lpProtocolInfo,
  3190.     IN OUT LPSOCKADDR          lpAddress,
  3191.     IN OUT LPINT               lpAddressLength
  3192.     );
  3193. #ifdef UNICODE
  3194. #define LPFN_WSASTRINGTOADDRESS  LPFN_WSASTRINGTOADDRESSW
  3195. #else
  3196. #define LPFN_WSASTRINGTOADDRESS  LPFN_WSASTRINGTOADDRESSA
  3197. #endif // !UNICODE
  3198. #endif // INCL_WINSOCK_API_TYPEDEFS
  3199.  
  3200. /* Registration and Name Resolution API functions */
  3201.  
  3202.  
  3203. #if INCL_WINSOCK_API_PROTOTYPES
  3204. WINSOCK_API_LINKAGE
  3205. INT
  3206. WSAAPI
  3207. WSALookupServiceBeginA(
  3208.     IN  LPWSAQUERYSETA lpqsRestrictions,
  3209.     IN  DWORD          dwControlFlags,
  3210.     OUT LPHANDLE       lphLookup
  3211.     );
  3212. WINSOCK_API_LINKAGE
  3213. INT
  3214. WSAAPI
  3215. WSALookupServiceBeginW(
  3216.     IN  LPWSAQUERYSETW lpqsRestrictions,
  3217.     IN  DWORD          dwControlFlags,
  3218.     OUT LPHANDLE       lphLookup
  3219.     );
  3220. #ifdef UNICODE
  3221. #define WSALookupServiceBegin  WSALookupServiceBeginW
  3222. #else
  3223. #define WSALookupServiceBegin  WSALookupServiceBeginA
  3224. #endif // !UNICODE
  3225. #endif // INCL_WINSOCK_API_PROTOTYPES
  3226.  
  3227. #if INCL_WINSOCK_API_TYPEDEFS
  3228. typedef
  3229. INT
  3230. (WSAAPI * LPFN_WSALOOKUPSERVICEBEGINA)(
  3231.     IN  LPWSAQUERYSETA lpqsRestrictions,
  3232.     IN  DWORD          dwControlFlags,
  3233.     OUT LPHANDLE       lphLookup
  3234.     );
  3235. typedef
  3236. INT
  3237. (WSAAPI * LPFN_WSALOOKUPSERVICEBEGINW)(
  3238.     IN  LPWSAQUERYSETW lpqsRestrictions,
  3239.     IN  DWORD          dwControlFlags,
  3240.     OUT LPHANDLE       lphLookup
  3241.     );
  3242. #ifdef UNICODE
  3243. #define LPFN_WSALOOKUPSERVICEBEGIN  LPFN_WSALOOKUPSERVICEBEGINW
  3244. #else
  3245. #define LPFN_WSALOOKUPSERVICEBEGIN  LPFN_WSALOOKUPSERVICEBEGINA
  3246. #endif // !UNICODE
  3247. #endif // INCL_WINSOCK_API_TYPEDEFS
  3248.  
  3249. #if INCL_WINSOCK_API_PROTOTYPES
  3250. WINSOCK_API_LINKAGE
  3251. INT
  3252. WSAAPI
  3253. WSALookupServiceNextA(
  3254.     IN     HANDLE           hLookup,
  3255.     IN     DWORD            dwControlFlags,
  3256.     IN OUT LPDWORD          lpdwBufferLength,
  3257.     OUT    LPWSAQUERYSETA   lpqsResults
  3258.     );
  3259. WINSOCK_API_LINKAGE
  3260. INT
  3261. WSAAPI
  3262. WSALookupServiceNextW(
  3263.     IN     HANDLE           hLookup,
  3264.     IN     DWORD            dwControlFlags,
  3265.     IN OUT LPDWORD          lpdwBufferLength,
  3266.     OUT    LPWSAQUERYSETW   lpqsResults
  3267.     );
  3268. #ifdef UNICODE
  3269. #define WSALookupServiceNext  WSALookupServiceNextW
  3270. #else
  3271. #define WSALookupServiceNext  WSALookupServiceNextA
  3272. #endif // !UNICODE
  3273. #endif // INCL_WINSOCK_API_PROTOTYPES
  3274.  
  3275. #if INCL_WINSOCK_API_TYPEDEFS
  3276. typedef
  3277. INT
  3278. (WSAAPI * LPFN_WSALOOKUPSERVICENEXTA)(
  3279.     IN     HANDLE           hLookup,
  3280.     IN     DWORD            dwControlFlags,
  3281.     IN OUT LPDWORD          lpdwBufferLength,
  3282.     OUT    LPWSAQUERYSETA   lpqsResults
  3283.     );
  3284. typedef
  3285. INT
  3286. (WSAAPI * LPFN_WSALOOKUPSERVICENEXTW)(
  3287.     IN     HANDLE           hLookup,
  3288.     IN     DWORD            dwControlFlags,
  3289.     IN OUT LPDWORD          lpdwBufferLength,
  3290.     OUT    LPWSAQUERYSETW   lpqsResults
  3291.     );
  3292. #ifdef UNICODE
  3293. #define LPFN_WSALOOKUPSERVICENEXT  LPFN_WSALOOKUPSERVICENEXTW
  3294. #else
  3295. #define LPFN_WSALOOKUPSERVICENEXT  LPFN_WSALOOKUPSERVICENEXTA
  3296. #endif // !UNICODE
  3297. #endif // INCL_WINSOCK_API_TYPEDEFS
  3298.  
  3299. #if INCL_WINSOCK_API_PROTOTYPES
  3300. WINSOCK_API_LINKAGE
  3301. INT
  3302. WSAAPI
  3303. WSALookupServiceEnd(
  3304.     IN HANDLE  hLookup
  3305.     );
  3306. #endif // INCL_WINSOCK_API_PROTOTYPES
  3307.  
  3308. #if INCL_WINSOCK_API_TYPEDEFS
  3309. typedef
  3310. INT
  3311. (WSAAPI * LPFN_WSALOOKUPSERVICEEND)(
  3312.     IN HANDLE  hLookup
  3313.     );
  3314. #endif // INCL_WINSOCK_API_TYPEDEFS
  3315.  
  3316. #if INCL_WINSOCK_API_PROTOTYPES
  3317. WINSOCK_API_LINKAGE
  3318. INT
  3319. WSAAPI
  3320. WSAInstallServiceClassA(
  3321.     IN  LPWSASERVICECLASSINFOA   lpServiceClassInfo
  3322.     );
  3323. WINSOCK_API_LINKAGE
  3324. INT
  3325. WSAAPI
  3326. WSAInstallServiceClassW(
  3327.     IN  LPWSASERVICECLASSINFOW   lpServiceClassInfo
  3328.     );
  3329. #ifdef UNICODE
  3330. #define WSAInstallServiceClass  WSAInstallServiceClassW
  3331. #else
  3332. #define WSAInstallServiceClass  WSAInstallServiceClassA
  3333. #endif // !UNICODE
  3334. #endif // INCL_WINSOCK_API_PROTOTYPES
  3335.  
  3336. #if INCL_WINSOCK_API_TYPEDEFS
  3337. typedef
  3338. INT
  3339. (WSAAPI * LPFN_WSAINSTALLSERVICECLASSA)(
  3340.     IN  LPWSASERVICECLASSINFOA   lpServiceClassInfo
  3341.     );
  3342. typedef
  3343. INT
  3344. (WSAAPI * LPFN_WSAINSTALLSERVICECLASSW)(
  3345.     IN  LPWSASERVICECLASSINFOW   lpServiceClassInfo
  3346.     );
  3347. #ifdef UNICODE
  3348. #define LPFN_WSAINSTALLSERVICECLASS  LPFN_WSAINSTALLSERVICECLASSW
  3349. #else
  3350. #define LPFN_WSAINSTALLSERVICECLASS  LPFN_WSAINSTALLSERVICECLASSA
  3351. #endif // !UNICODE
  3352. #endif // INCL_WINSOCK_API_TYPEDEFS
  3353.  
  3354. #if INCL_WINSOCK_API_PROTOTYPES
  3355. WINSOCK_API_LINKAGE
  3356. INT
  3357. WSAAPI
  3358. WSARemoveServiceClass(
  3359.     IN  LPGUID  lpServiceClassId
  3360.     );
  3361. #endif // INCL_WINSOCK_API_PROTOTYPES
  3362.  
  3363. #if INCL_WINSOCK_API_TYPEDEFS
  3364. typedef
  3365. INT
  3366. (WSAAPI * LPFN_WSAREMOVESERVICECLASS)(
  3367.     IN  LPGUID  lpServiceClassId
  3368.     );
  3369. #endif // INCL_WINSOCK_API_TYPEDEFS
  3370.  
  3371. #if INCL_WINSOCK_API_PROTOTYPES
  3372. WINSOCK_API_LINKAGE
  3373. INT
  3374. WSAAPI
  3375. WSAGetServiceClassInfoA(
  3376.     IN  LPGUID  lpProviderId,
  3377.     IN  LPGUID  lpServiceClassId,
  3378.     IN OUT LPDWORD  lpdwBufSize,
  3379.     OUT LPWSASERVICECLASSINFOA lpServiceClassInfo
  3380.     );
  3381. WINSOCK_API_LINKAGE
  3382. INT
  3383. WSAAPI
  3384. WSAGetServiceClassInfoW(
  3385.     IN  LPGUID  lpProviderId,
  3386.     IN  LPGUID  lpServiceClassId,
  3387.     IN OUT LPDWORD  lpdwBufSize,
  3388.     OUT LPWSASERVICECLASSINFOW lpServiceClassInfo
  3389.     );
  3390. #ifdef UNICODE
  3391. #define WSAGetServiceClassInfo  WSAGetServiceClassInfoW
  3392. #else
  3393. #define WSAGetServiceClassInfo  WSAGetServiceClassInfoA
  3394. #endif // !UNICODE
  3395. #endif // INCL_WINSOCK_API_PROTOTYPES
  3396.  
  3397. #if INCL_WINSOCK_API_TYPEDEFS
  3398. typedef
  3399. INT
  3400. (WSAAPI * LPFN_WSAGETSERVICECLASSINFOA)(
  3401.     IN  LPGUID  lpProviderId,
  3402.     IN  LPGUID  lpServiceClassId,
  3403.     IN OUT LPDWORD  lpdwBufSize,
  3404.     OUT LPWSASERVICECLASSINFOA lpServiceClassInfo
  3405.     );
  3406. typedef
  3407. INT
  3408. (WSAAPI * LPFN_WSAGETSERVICECLASSINFOW)(
  3409.     IN  LPGUID  lpProviderId,
  3410.     IN  LPGUID  lpServiceClassId,
  3411.     IN OUT LPDWORD  lpdwBufSize,
  3412.     OUT LPWSASERVICECLASSINFOW lpServiceClassInfo
  3413.     );
  3414. #ifdef UNICODE
  3415. #define LPFN_WSAGETSERVICECLASSINFO  LPFN_WSAGETSERVICECLASSINFOW
  3416. #else
  3417. #define LPFN_WSAGETSERVICECLASSINFO  LPFN_WSAGETSERVICECLASSINFOA
  3418. #endif // !UNICODE
  3419. #endif // INCL_WINSOCK_API_TYPEDEFS
  3420.  
  3421. #if INCL_WINSOCK_API_PROTOTYPES
  3422. WINSOCK_API_LINKAGE
  3423. INT
  3424. WSAAPI
  3425. WSAEnumNameSpaceProvidersA(
  3426.     IN OUT LPDWORD              lpdwBufferLength,
  3427.     IN     LPWSANAMESPACE_INFOA lpnspBuffer
  3428.     );
  3429. WINSOCK_API_LINKAGE
  3430. INT
  3431. WSAAPI
  3432. WSAEnumNameSpaceProvidersW(
  3433.     IN OUT LPDWORD              lpdwBufferLength,
  3434.     IN     LPWSANAMESPACE_INFOW lpnspBuffer
  3435.     );
  3436. #ifdef UNICODE
  3437. #define WSAEnumNameSpaceProviders  WSAEnumNameSpaceProvidersW
  3438. #else
  3439. #define WSAEnumNameSpaceProviders  WSAEnumNameSpaceProvidersA
  3440. #endif // !UNICODE
  3441. #endif // INCL_WINSOCK_API_PROTOTYPES
  3442.  
  3443. #if INCL_WINSOCK_API_TYPEDEFS
  3444. typedef
  3445. INT
  3446. (WSAAPI * LPFN_WSAENUMNAMESPACEPROVIDERSA)(
  3447.     IN OUT LPDWORD              lpdwBufferLength,
  3448.     IN     LPWSANAMESPACE_INFOA lpnspBuffer
  3449.     );
  3450. typedef
  3451. INT
  3452. (WSAAPI * LPFN_WSAENUMNAMESPACEPROVIDERSW)(
  3453.     IN OUT LPDWORD              lpdwBufferLength,
  3454.     IN     LPWSANAMESPACE_INFOW lpnspBuffer
  3455.     );
  3456. #ifdef UNICODE
  3457. #define LPFN_WSAENUMNAMESPACEPROVIDERS  LPFN_WSAENUMNAMESPACEPROVIDERSW
  3458. #else
  3459. #define LPFN_WSAENUMNAMESPACEPROVIDERS  LPFN_WSAENUMNAMESPACEPROVIDERSA
  3460. #endif // !UNICODE
  3461. #endif // INCL_WINSOCK_API_TYPEDEFS
  3462.  
  3463. #if INCL_WINSOCK_API_PROTOTYPES
  3464. WINSOCK_API_LINKAGE
  3465. INT
  3466. WSAAPI
  3467. WSAGetServiceClassNameByClassIdA(
  3468.     IN      LPGUID  lpServiceClassId,
  3469.     OUT     LPSTR lpszServiceClassName,
  3470.     IN OUT  LPDWORD lpdwBufferLength
  3471.     );
  3472. WINSOCK_API_LINKAGE
  3473. INT
  3474. WSAAPI
  3475. WSAGetServiceClassNameByClassIdW(
  3476.     IN      LPGUID  lpServiceClassId,
  3477.     OUT     LPWSTR lpszServiceClassName,
  3478.     IN OUT  LPDWORD lpdwBufferLength
  3479.     );
  3480. #ifdef UNICODE
  3481. #define WSAGetServiceClassNameByClassId  WSAGetServiceClassNameByClassIdW
  3482. #else
  3483. #define WSAGetServiceClassNameByClassId  WSAGetServiceClassNameByClassIdA
  3484. #endif // !UNICODE
  3485. #endif // INCL_WINSOCK_API_PROTOTYPES
  3486.  
  3487. #if INCL_WINSOCK_API_TYPEDEFS
  3488. typedef
  3489. INT
  3490. (WSAAPI * LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(
  3491.     IN      LPGUID  lpServiceClassId,
  3492.     OUT     LPSTR lpszServiceClassName,
  3493.     IN OUT  LPDWORD lpdwBufferLength
  3494.     );
  3495. typedef
  3496. INT
  3497. (WSAAPI * LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(
  3498.     IN      LPGUID  lpServiceClassId,
  3499.     OUT     LPWSTR lpszServiceClassName,
  3500.     IN OUT  LPDWORD lpdwBufferLength
  3501.     );
  3502. #ifdef UNICODE
  3503. #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID  LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
  3504. #else
  3505. #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID  LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
  3506. #endif // !UNICODE
  3507. #endif // INCL_WINSOCK_API_TYPEDEFS
  3508.  
  3509. #if INCL_WINSOCK_API_PROTOTYPES
  3510. WINSOCK_API_LINKAGE
  3511. INT
  3512. WSAAPI
  3513. WSASetServiceA(
  3514.     IN LPWSAQUERYSETA lpqsRegInfo,
  3515.     IN WSAESETSERVICEOP essoperation,
  3516.     IN DWORD dwControlFlags
  3517.     );
  3518. WINSOCK_API_LINKAGE
  3519. INT
  3520. WSAAPI
  3521. WSASetServiceW(
  3522.     IN LPWSAQUERYSETW lpqsRegInfo,
  3523.     IN WSAESETSERVICEOP essoperation,
  3524.     IN DWORD dwControlFlags
  3525.     );
  3526. #ifdef UNICODE
  3527. #define WSASetService  WSASetServiceW
  3528. #else
  3529. #define WSASetService  WSASetServiceA
  3530. #endif // !UNICODE
  3531. #endif // INCL_WINSOCK_API_PROTOTYPES
  3532.  
  3533. #if INCL_WINSOCK_API_TYPEDEFS
  3534. typedef
  3535. INT
  3536. (WSAAPI * LPFN_WSASETSERVICEA)(
  3537.     IN LPWSAQUERYSETA lpqsRegInfo,
  3538.     IN WSAESETSERVICEOP essoperation,
  3539.     IN DWORD dwControlFlags
  3540.     );
  3541. typedef
  3542. INT
  3543. (WSAAPI * LPFN_WSASETSERVICEW)(
  3544.     IN LPWSAQUERYSETW lpqsRegInfo,
  3545.     IN WSAESETSERVICEOP essoperation,
  3546.     IN DWORD dwControlFlags
  3547.     );
  3548. #ifdef UNICODE
  3549. #define LPFN_WSASETSERVICE  LPFN_WSASETSERVICEW
  3550. #else
  3551. #define LPFN_WSASETSERVICE  LPFN_WSASETSERVICEA
  3552. #endif // !UNICODE
  3553. #endif // INCL_WINSOCK_API_TYPEDEFS
  3554.  
  3555. #if INCL_WINSOCK_API_PROTOTYPES
  3556. WINSOCK_API_LINKAGE
  3557. INT
  3558. WSAAPI
  3559. WSAProviderConfigChange(
  3560.     IN OUT LPHANDLE lpNotificationHandle,
  3561.     IN LPWSAOVERLAPPED lpOverlapped,
  3562.     IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  3563.     );
  3564. #endif // INCL_WINSOCK_API_PROTOTYPES
  3565.  
  3566. #if INCL_WINSOCK_API_TYPEDEFS
  3567. typedef
  3568. INT
  3569. (WSAAPI * LPFN_WSAPROVIDERCONFIGCHANGE)(
  3570.     IN OUT LPHANDLE lpNotificationHandle,
  3571.     IN LPWSAOVERLAPPED lpOverlapped,
  3572.     IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  3573.     );
  3574. #endif // INCL_WINSOCK_API_TYPEDEFS
  3575.  
  3576. /* Microsoft Windows Extended data types */
  3577. typedef struct sockaddr_in SOCKADDR_IN;
  3578. typedef struct sockaddr_in *PSOCKADDR_IN;
  3579. typedef struct sockaddr_in FAR *LPSOCKADDR_IN;
  3580.  
  3581. typedef struct linger LINGER;
  3582. typedef struct linger *PLINGER;
  3583. typedef struct linger FAR *LPLINGER;
  3584.  
  3585. typedef struct in_addr IN_ADDR;
  3586. typedef struct in_addr *PIN_ADDR;
  3587. typedef struct in_addr FAR *LPIN_ADDR;
  3588.  
  3589. typedef struct fd_set FD_SET;
  3590. typedef struct fd_set *PFD_SET;
  3591. typedef struct fd_set FAR *LPFD_SET;
  3592.  
  3593. typedef struct hostent HOSTENT;
  3594. typedef struct hostent *PHOSTENT;
  3595. typedef struct hostent FAR *LPHOSTENT;
  3596.  
  3597. typedef struct servent SERVENT;
  3598. typedef struct servent *PSERVENT;
  3599. typedef struct servent FAR *LPSERVENT;
  3600.  
  3601. typedef struct protoent PROTOENT;
  3602. typedef struct protoent *PPROTOENT;
  3603. typedef struct protoent FAR *LPPROTOENT;
  3604.  
  3605. typedef struct timeval TIMEVAL;
  3606. typedef struct timeval *PTIMEVAL;
  3607. typedef struct timeval FAR *LPTIMEVAL;
  3608.  
  3609. /*
  3610.  * Windows message parameter composition and decomposition
  3611.  * macros.
  3612.  *
  3613.  * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation
  3614.  * when constructing the response to a WSAAsyncGetXByY() routine.
  3615.  */
  3616. #define WSAMAKEASYNCREPLY(buflen,error)     MAKELONG(buflen,error)
  3617. /*
  3618.  * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation
  3619.  * when constructing the response to WSAAsyncSelect().
  3620.  */
  3621. #define WSAMAKESELECTREPLY(event,error)     MAKELONG(event,error)
  3622. /*
  3623.  * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application
  3624.  * to extract the buffer length from the lParam in the response
  3625.  * to a WSAAsyncGetXByY().
  3626.  */
  3627. #define WSAGETASYNCBUFLEN(lParam)           LOWORD(lParam)
  3628. /*
  3629.  * WSAGETASYNCERROR is intended for use by the Windows Sockets application
  3630.  * to extract the error code from the lParam in the response
  3631.  * to a WSAGetXByY().
  3632.  */
  3633. #define WSAGETASYNCERROR(lParam)            HIWORD(lParam)
  3634. /*
  3635.  * WSAGETSELECTEVENT is intended for use by the Windows Sockets application
  3636.  * to extract the event code from the lParam in the response
  3637.  * to a WSAAsyncSelect().
  3638.  */
  3639. #define WSAGETSELECTEVENT(lParam)           LOWORD(lParam)
  3640. /*
  3641.  * WSAGETSELECTERROR is intended for use by the Windows Sockets application
  3642.  * to extract the error code from the lParam in the response
  3643.  * to a WSAAsyncSelect().
  3644.  */
  3645. #define WSAGETSELECTERROR(lParam)           HIWORD(lParam)
  3646.  
  3647. #ifdef __cplusplus
  3648. }
  3649. #endif
  3650.  
  3651. #include <poppack.h>
  3652.  
  3653. #pragma option pop /*P_O_Pop*/
  3654. #endif  /* _WINSOCK2API_ */
  3655.