ReactOS 0.4.15-dev-7924-g5949c20
mswsock.h
Go to the documentation of this file.
1/*
2 * mswsock.h
3 * MS-specific extensions to Windows Sockets, exported from mswsock.dll.
4 * These functions are N/A on Windows9x.
5 *
6 * This file is part of a free library for the Win32 API.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11
12#pragma once
13
14#define _MSWSOCK_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <mswsockdef.h>
21
22#define SO_CONNDATA 0x7000
23#define SO_CONNOPT 0x7001
24#define SO_DISCDATA 0x7002
25#define SO_DISCOPT 0x7003
26#define SO_CONNDATALEN 0x7004
27#define SO_CONNOPTLEN 0x7005
28#define SO_DISCDATALEN 0x7006
29#define SO_DISCOPTLEN 0x7007
30#define SO_OPENTYPE 0x7008
31#define SO_SYNCHRONOUS_ALERT 0x10
32#define SO_SYNCHRONOUS_NONALERT 0x20
33#define SO_MAXDG 0x7009
34#define SO_MAXPATHDG 0x700A
35#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
36#define SO_CONNECT_TIME 0x700C
37#if(_WIN32_WINNT >= 0x0501)
38#define SO_UPDATE_CONNECT_CONTEXT 0x7010
39#endif
40
41#define TCP_BSDURGENT 0x7000
42
43#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
44
45#if((_WIN32_WINNT < 0x0600) && (_WIN32_WINNT >= 0x0501))
46#define SIO_SOCKET_CLOSE_NOTIFY _WSAIOW(IOC_VENDOR,13)
47#endif
48
49#define SIO_UDP_NETRESET _WSAIOW(IOC_VENDOR,15)
50
51#define TF_DISCONNECT 1
52#define TF_REUSE_SOCKET 2
53#define TF_WRITE_BEHIND 4
54
55#define TF_USE_DEFAULT_WORKER 0
56#define TF_USE_SYSTEM_THREAD 16
57#define TF_USE_KERNEL_APC 32
58
59#if(_WIN32_WINNT >= 0x0501)
60#define TP_ELEMENT_MEMORY 1
61#define TP_ELEMENT_FILE 2
62#define TP_ELEMENT_EOP 4
63#endif
64
65#define TP_DISCONNECT TF_DISCONNECT
66#define TP_REUSE_SOCKET TF_REUSE_SOCKET
67#define TP_USE_DEFAULT_WORKER TF_USE_DEFAULT_WORKER
68#define TP_USE_SYSTEM_THREAD TF_USE_SYSTEM_THREAD
69#define TP_USE_KERNEL_APC TF_USE_KERNEL_APC
70
71#define WSAID_TRANSMITFILE \
72 {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
73
74#define WSAID_ACCEPTEX \
75 {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
76
77#define WSAID_GETACCEPTEXSOCKADDRS \
78 {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
79
80typedef struct _TRANSMIT_FILE_BUFFERS {
86
87typedef BOOL
88(PASCAL FAR *LPFN_TRANSMITFILE)(
89 _In_ SOCKET hSocket,
96
97typedef BOOL
98(PASCAL FAR *LPFN_ACCEPTEX)(
99 _In_ SOCKET sListenSocket,
107
108typedef VOID
109(PASCAL FAR *LPFN_GETACCEPTEXSOCKADDRS)(
118
119#if(_WIN32_WINNT >= 0x0501)
120
121typedef struct _TRANSMIT_PACKETS_ELEMENT {
122 ULONG dwElFlags;
123 ULONG cLength;
124 union {
125 struct {
126 LARGE_INTEGER nFileOffset;
128 };
130 };
131} TRANSMIT_PACKETS_ELEMENT, *PTRANSMIT_PACKETS_ELEMENT, FAR *LPTRANSMIT_PACKETS_ELEMENT;
132
133typedef BOOL
134(PASCAL FAR *LPFN_TRANSMITPACKETS)(
135 _In_ SOCKET hSocket,
136 _In_opt_ LPTRANSMIT_PACKETS_ELEMENT lpPacketArray,
137 _In_ DWORD nElementCount,
138 _In_ DWORD nSendSize,
141
142#define WSAID_TRANSMITPACKETS \
143 {0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}
144
145typedef BOOL
146(PASCAL FAR *LPFN_CONNECTEX)(
147 _In_ SOCKET s,
149 _In_ int namelen,
150 _In_reads_bytes_opt_(dwSendDataLength) PVOID lpSendBuffer,
151 _In_ DWORD dwSendDataLength,
152 _Out_ LPDWORD lpdwBytesSent,
154
155#define WSAID_CONNECTEX \
156 {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
157
158typedef BOOL
159(PASCAL FAR *LPFN_DISCONNECTEX)(
160 _In_ SOCKET s,
164
165#define WSAID_DISCONNECTEX \
166 {0x7fda2e11,0x8630,0x436f,{0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
167
168#define DE_REUSE_SOCKET TF_REUSE_SOCKET
169
170#define NLA_NAMESPACE_GUID \
171 {0x6642243a,0x3ba8,0x4aa6,{0xba,0xa5,0x2e,0xb,0xd7,0x1f,0xdd,0x83}}
172
173#define NLA_SERVICE_CLASS_GUID \
174 {0x37e515,0xb5c9,0x4a43,{0xba,0xda,0x8b,0x48,0xa8,0x7a,0xd2,0x39}}
175
176#define NLA_ALLUSERS_NETWORK 0x00000001
177#define NLA_FRIENDLY_NAME 0x00000002
178
179typedef enum _NLA_BLOB_DATA_TYPE {
180 NLA_RAW_DATA = 0,
181 NLA_INTERFACE = 1,
182 NLA_802_1X_LOCATION = 2,
183 NLA_CONNECTIVITY = 3,
184 NLA_ICS = 4,
185} NLA_BLOB_DATA_TYPE, *PNLA_BLOB_DATA_TYPE;
186
187typedef enum _NLA_CONNECTIVITY_TYPE {
188 NLA_NETWORK_AD_HOC = 0,
189 NLA_NETWORK_MANAGED = 1,
190 NLA_NETWORK_UNMANAGED = 2,
191 NLA_NETWORK_UNKNOWN = 3,
192} NLA_CONNECTIVITY_TYPE, *PNLA_CONNECTIVITY_TYPE;
193
194typedef enum _NLA_INTERNET {
195 NLA_INTERNET_UNKNOWN = 0,
196 NLA_INTERNET_NO = 1,
197 NLA_INTERNET_YES = 2,
198} NLA_INTERNET, *PNLA_INTERNET;
199
200typedef struct _NLA_BLOB {
201 struct {
202 NLA_BLOB_DATA_TYPE type;
204 DWORD nextOffset;
205 } header;
206 union {
207 CHAR rawData[1];
208 struct {
209 DWORD dwType;
210 DWORD dwSpeed;
211 CHAR adapterName[1];
212 } interfaceData;
213 struct {
214 CHAR information[1];
215 } locationData;
216 struct {
217 NLA_CONNECTIVITY_TYPE type;
218 NLA_INTERNET internet;
219 } connectivity;
220 struct {
221 struct {
222 DWORD speed;
223 DWORD type;
224 DWORD state;
225 WCHAR machineName[256];
226 WCHAR sharedAdapterName[256];
227 } remote;
228 } ICS;
229 } data;
230} NLA_BLOB, *PNLA_BLOB, * FAR LPNLA_BLOB;
231
232typedef INT
233(PASCAL FAR *LPFN_WSARECVMSG)(
234 _In_ SOCKET s,
235 _Inout_ LPWSAMSG lpMsg,
236 _Out_opt_ LPDWORD lpdwNumberOfBytesRecvd,
238 _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
239
240#define WSAID_WSARECVMSG \
241 {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}}
242
243#endif /* (_WIN32_WINNT >= 0x0501) */
244
245#if(_WIN32_WINNT >= 0x0600)
246
247#define SIO_BSP_HANDLE _WSAIOR(IOC_WS2,27)
248#define SIO_BSP_HANDLE_SELECT _WSAIOR(IOC_WS2,28)
249#define SIO_BSP_HANDLE_POLL _WSAIOR(IOC_WS2,29)
250
251#define SIO_BASE_HANDLE _WSAIOR(IOC_WS2,34)
252
253#define SIO_EXT_SELECT _WSAIORW(IOC_WS2,30)
254#define SIO_EXT_POLL _WSAIORW(IOC_WS2,31)
255#define SIO_EXT_SENDMSG _WSAIORW(IOC_WS2,32)
256
257typedef struct {
258 int result;
259 ULONG fds;
260 INT timeout;
261 WSAPOLLFD fdArray[0];
262} WSAPOLLDATA, *LPWSAPOLLDATA;
263
264typedef struct {
265 LPWSAMSG lpMsg;
267 LPDWORD lpNumberOfBytesSent;
269 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine;
270} WSASENDMSG, *LPWSASENDMSG;
271
272typedef INT
273(PASCAL FAR *LPFN_WSASENDMSG)(
274 _In_ SOCKET s,
275 _In_ LPWSAMSG lpMsg,
277 _Out_opt_ LPDWORD lpNumberOfBytesSent,
279 _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
280
281#define WSAID_WSASENDMSG \
282 {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}}
283
284typedef INT
285(WSAAPI *LPFN_WSAPOLL)(
286 _Inout_ LPWSAPOLLFD fdarray,
287 _In_ ULONG nfds,
289
290#define WSAID_WSAPOLL \
291 {0x18C76F85,0xDC66,0x4964,{0x97,0x2E,0x23,0xC2,0x72,0x38,0x31,0x2B}}
292
293#endif /* (_WIN32_WINNT >= 0x0600) */
294
295#if(_WIN32_WINNT < 0x0600)
296int
297PASCAL
298FAR
300 _In_ SOCKET s,
301 _Out_writes_bytes_to_(len, return) char FAR *buf,
302 _In_ int len,
303 _Inout_ int FAR *flags);
304#else
305INT
306PASCAL
307FAR
309 _In_ SOCKET s,
311 _In_ INT len,
313#endif /* (_WIN32_WINNT < 0x0600) */
314
315BOOL
316PASCAL
317FAR
319 _In_ SOCKET hSocket,
326
327BOOL
328PASCAL
329FAR
331 _In_ SOCKET sListenSocket,
339
340VOID
341PASCAL
342FAR
352
353#ifdef __cplusplus
354}
355#endif
#define VOID
Definition: acefi.h:82
static int state
Definition: maze.c:121
static PDB_INFORMATION information
Definition: db.cpp:178
#define FAR
Definition: zlib.h:34
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint namelen
Definition: glext.h:7232
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
static unsigned char rawData[2356]
Definition: data.c:573
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_bytes_to_(size, count)
Definition: ms_sal.h:360
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr ** LocalSockaddr
Definition: mswsock.h:114
_In_ SOCKET sAcceptSocket
Definition: mswsock.h:100
VOID PASCAL FAR GetAcceptExSockaddrs(_In_reads_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer, _In_ DWORD dwReceiveDataLength, _In_ DWORD dwLocalAddressLength, _In_ DWORD dwRemoteAddressLength, _Outptr_result_bytebuffer_(*LocalSockaddrLength) struct sockaddr **LocalSockaddr, _Out_ LPINT LocalSockaddrLength, _Outptr_result_bytebuffer_(*RemoteSockaddrLength) struct sockaddr **RemoteSockaddr, _Out_ LPINT RemoteSockaddrLength)
int PASCAL FAR WSARecvEx(_In_ SOCKET s, _Out_writes_bytes_to_(len, return) char FAR *buf, _In_ int len, _Inout_ int FAR *flags)
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT LocalSockaddrLength
Definition: mswsock.h:115
struct _TRANSMIT_FILE_BUFFERS * PTRANSMIT_FILE_BUFFERS
_In_ HANDLE _In_ DWORD _In_ DWORD nNumberOfBytesPerSend
Definition: mswsock.h:92
struct _TRANSMIT_FILE_BUFFERS * LPTRANSMIT_FILE_BUFFERS
_In_ HANDLE hFile
Definition: mswsock.h:90
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT _Outptr_result_bytebuffer_ RemoteSockaddrLength struct sockaddr ** RemoteSockaddr
Definition: mswsock.h:116
_In_ HANDLE _In_ DWORD nNumberOfBytesToWrite
Definition: mswsock.h:91
_In_ SOCKET _Out_writes_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer
Definition: mswsock.h:101
struct _TRANSMIT_FILE_BUFFERS TRANSMIT_FILE_BUFFERS
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpdwBytesReceived
Definition: mswsock.h:105
BOOL PASCAL FAR AcceptEx(_In_ SOCKET sListenSocket, _In_ SOCKET sAcceptSocket, _Out_writes_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer, _In_ DWORD dwReceiveDataLength, _In_ DWORD dwLocalAddressLength, _In_ DWORD dwRemoteAddressLength, _Out_ LPDWORD lpdwBytesReceived, _Inout_ LPOVERLAPPED lpOverlapped)
BOOL PASCAL FAR TransmitFile(_In_ SOCKET hSocket, _In_ HANDLE hFile, _In_ DWORD nNumberOfBytesToWrite, _In_ DWORD nNumberOfBytesPerSend, _Inout_opt_ LPOVERLAPPED lpOverlapped, _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, _In_ DWORD dwReserved)
_In_ SOCKET _In_ DWORD dwReceiveDataLength
Definition: mswsock.h:102
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT _Outptr_result_bytebuffer_ RemoteSockaddrLength struct sockaddr _Out_ LPINT RemoteSockaddrLength
Definition: mswsock.h:117
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD dwRemoteAddressLength
Definition: mswsock.h:104
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers
Definition: mswsock.h:94
_In_ SOCKET _In_ DWORD _In_ DWORD dwLocalAddressLength
Definition: mswsock.h:103
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
#define BOOL
Definition: nt_native.h:43
#define INT
Definition: polytest.cpp:20
PVOID pBuffer
Definition: name.c:39
Definition: dhcpd.h:245
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
int * LPINT
Definition: windef.h:178
#define PASCAL
Definition: windef.h:133
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
#define WSAAPI
Definition: winsock2.h:605
UINT_PTR SOCKET
Definition: winsock.h:47
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175