Removed "elfdll" load order option and updated documentation.
[wine/multimedia.git] / include / winsock2.h
bloba473675c08d7eba8e86ec9b3d43f8ba4c23eb163
1 /*
2 * Winsock 2 definitions - used for ws2_32.dll
4 * FIXME: Still missing required Winsock 2 definitions.
5 */
7 #ifndef __WINSOCK2API__
8 #define __WINSOCK2API__
10 #include "winsock.h"
12 /* proper 4-byte packing */
13 #include "pshpack4.h"
15 #define WS_SO_GROUP_ID 0x2001
16 #define WS_SO_GROUP_PRIORITY 0x2002
17 #define WS_SO_MAX_MSG_SIZE 0x2003
18 #define WS_SO_PROTOCOL_INFOA 0x2004
19 #define WS_SO_PROTOCOL_INFOW 0x2005
20 #define WS_SO_PROTOCOL_INFO WINELIB_NAME_AW(WS_SO_PROTOCOL_INFO)
22 #define PVD_CONFIG 0x3001
23 #define SO_CONDITIONAL_ACCEPT 0x3002
26 /* option flags per socket */
28 #define FD_MAX_EVENTS 10
29 #define FD_READ_BIT 0
30 #define FD_WRITE_BIT 1
31 #define FD_OOB_BIT 2
32 #define FD_ACCEPT_BIT 3
33 #define FD_CONNECT_BIT 4
34 #define FD_CLOSE_BIT 5
37 * Constants for WSAIoctl()
39 #define IOC_UNIX 0x00000000
40 #define IOC_WS2 0x08000000
41 #define IOC_PROTOCOL 0x10000000
42 #define IOC_VENDOR 0x18000000
43 #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
44 #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
45 #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
46 #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
47 #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
48 #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
49 #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
50 #define SIO_FLUSH _WSAIO(IOC_WS2,4)
51 #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
52 #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
53 #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
54 #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
55 #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
56 #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
57 #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
58 #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
59 #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
60 #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
61 #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
62 #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
63 #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
64 #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_W32,24)
65 #define SIO_GET_INTERFACE_LIST WS_IOR ('t', 127, u_long)
67 /* Unfortunately the sockaddr_in6 structure doesn't
68 seem to be defined in a standard place, even across
69 different Linux distributions. Until IPv6 support settles
70 down, let's do our own here so the sockaddr_gen
71 union is the correct size.*/
72 #ifdef s6_addr
73 #undef s6_addr
74 #endif
76 struct ws_in_addr6
78 unsigned char s6_addr[16]; /* IPv6 address */
80 struct ws_sockaddr_in6
82 short sin6_family; /* AF_INET6 */
83 u_short sin6_port; /* Transport level port number */
84 u_long sin6_flowinfo; /* IPv6 flow information */
85 struct ws_in_addr6 sin6_addr; /* IPv6 address */
88 typedef union sockaddr_gen
90 struct sockaddr Address;
91 struct ws_sockaddr_in AddressIn;
92 struct ws_sockaddr_in6 AddressIn6;
93 } sockaddr_gen;
95 /* ws_hostent, ws_protoent, ws_servent, ws_netent are 4-byte aligned here ! */
97 typedef struct ws_hostent32
99 char *h_name; /* official name of host */
100 char **h_aliases; /* alias list */
101 short h_addrtype; /* host address type */
102 short h_length; /* length of address */
103 char **h_addr_list; /* list of addresses from name server */
104 } _ws_hostent32;
106 typedef struct ws_protoent32
108 char *p_name; /* official protocol name */
109 char **p_aliases; /* alias list */
110 short p_proto; /* protocol # */
111 } _ws_protoent32;
113 typedef struct ws_servent32
115 char *s_name; /* official service name */
116 char **s_aliases; /* alias list */
117 short s_port; /* port # */
118 char *s_proto; /* protocol to use */
119 } _ws_servent32;
121 typedef struct ws_netent32
123 char *n_name; /* official name of net */
124 char **n_aliases; /* alias list */
125 short n_addrtype; /* net address type */
126 u_long n_net; /* network # */
127 } _ws_netent32;
129 /* Structure to keep interface specific information */
130 typedef struct _INTERFACE_INFO
132 u_long iiFlags; /* Interface flags */
133 sockaddr_gen iiAddress; /* Interface address */
134 sockaddr_gen iiBroadcastAddress; /* Broadcast address */
135 sockaddr_gen iiNetmask; /* Network mask */
136 } INTERFACE_INFO, * LPINTERFACE_INFO;
138 /* Possible flags for the iiFlags - bitmask */
139 #ifndef HAVE_NET_IF_H
140 # define IFF_UP 0x00000001 /* Interface is up */
141 # define IFF_BROADCAST 0x00000002 /* Broadcast is supported */
142 # define IFF_LOOPBACK 0x00000004 /* this is loopback interface */
143 # define IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */
144 # define IFF_MULTICAST 0x00000010 /* multicast is supported */
145 #endif
147 #ifndef GUID_DEFINED
148 #include "guiddef.h"
149 #endif
151 #define MAX_PROTOCOL_CHAIN 7
152 #define BASE_PROTOCOL 1
153 #define LAYERED_PROTOCOL 0
155 typedef struct _WSAPROTOCOLCHAIN
157 int ChainLen; /* the length of the chain, */
158 /* length = 0 means layered protocol, */
159 /* length = 1 means base protocol, */
160 /* length > 1 means protocol chain */
161 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
162 } WSAPROTOCOLCHAIN, * LPWSAPROTOCOLCHAIN;
163 #define WSAPROTOCOL_LEN 255
165 typedef struct _WSAPROTOCOL_INFOA
167 DWORD dwServiceFlags1;
168 DWORD dwServiceFlags2;
169 DWORD dwServiceFlags3;
170 DWORD dwServiceFlags4;
171 DWORD dwProviderFlags;
172 GUID ProviderId;
173 DWORD dwCatalogEntryId;
174 WSAPROTOCOLCHAIN ProtocolChain;
175 int iVersion;
176 int iAddressFamily;
177 int iMaxSockAddr;
178 int iMinSockAddr;
179 int iSocketType;
180 int iProtocol;
181 int iProtocolMaxOffset;
182 int iNetworkByteOrder;
183 int iSecurityScheme;
184 DWORD dwMessageSize;
185 DWORD dwProviderReserved;
186 CHAR szProtocol[WSAPROTOCOL_LEN+1];
187 } WSAPROTOCOL_INFOA, * LPWSAPROTOCOL_INFOA;
189 typedef struct _WSANETWORKEVENTS
191 long lNetworkEvents;
192 int iErrorCode[FD_MAX_EVENTS];
193 } WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
195 typedef struct _OVERLAPPED * LPWSAOVERLAPPED;
196 typedef HANDLE WSAEVENT;
197 typedef unsigned int GROUP;
199 typedef void
200 (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)
202 DWORD dwError,
203 DWORD cbTransferred,
204 LPWSAOVERLAPPED lpOverlapped,
205 DWORD dwFlags
209 /* Function declarations */
210 int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents);
211 int WINAPI WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents);
212 WSAEVENT WINAPI WSACreateEvent(void);
213 BOOL WINAPI WSACloseEvent(WSAEVENT event);
214 SOCKET WINAPI WSASocketA(int af, int type, int protocol,
215 LPWSAPROTOCOL_INFOA lpProtocolInfo,
216 GROUP g, DWORD dwFlags);
218 #include "poppack.h"
220 #endif