ReactOS  0.4.14-dev-608-gd495a4f
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
17 extern "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 
80 typedef struct _TRANSMIT_FILE_BUFFERS {
86 
87 typedef BOOL
88 (PASCAL FAR *LPFN_TRANSMITFILE)(
89  _In_ SOCKET hSocket,
96 
97 typedef BOOL
98 (PASCAL FAR *LPFN_ACCEPTEX)(
99  _In_ SOCKET sListenSocket,
107 
108 typedef VOID
109 (PASCAL FAR *LPFN_GETACCEPTEXSOCKADDRS)(
118 
119 #if(_WIN32_WINNT >= 0x0501)
120 
121 typedef struct _TRANSMIT_PACKETS_ELEMENT {
122  ULONG dwElFlags;
123  ULONG cLength;
124  union {
125  struct {
126  LARGE_INTEGER nFileOffset;
127  HANDLE hFile;
128  };
129  PVOID pBuffer;
130  };
131 } TRANSMIT_PACKETS_ELEMENT, *PTRANSMIT_PACKETS_ELEMENT, FAR *LPTRANSMIT_PACKETS_ELEMENT;
132 
133 typedef 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,
140  _In_ DWORD dwFlags);
141 
142 #define WSAID_TRANSMITPACKETS \
143  {0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}
144 
145 typedef BOOL
146 (PASCAL FAR *LPFN_CONNECTEX)(
147  _In_ SOCKET s,
148  _In_reads_bytes_(namelen) const struct sockaddr FAR *name,
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 
158 typedef 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 
179 typedef 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 
187 typedef 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 
194 typedef enum _NLA_INTERNET {
195  NLA_INTERNET_UNKNOWN = 0,
196  NLA_INTERNET_NO = 1,
197  NLA_INTERNET_YES = 2,
198 } NLA_INTERNET, *PNLA_INTERNET;
199 
200 typedef struct _NLA_BLOB {
201  struct {
202  NLA_BLOB_DATA_TYPE type;
203  DWORD dwSize;
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 
232 typedef 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 
257 typedef struct {
258  int result;
259  ULONG fds;
260  INT timeout;
261  WSAPOLLFD fdArray[0];
262 } WSAPOLLDATA, *LPWSAPOLLDATA;
263 
264 typedef struct {
265  LPWSAMSG lpMsg;
266  DWORD dwFlags;
267  LPDWORD lpNumberOfBytesSent;
269  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine;
270 } WSASENDMSG, *LPWSASENDMSG;
271 
272 typedef 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 
284 typedef INT
285 (WSAAPI *LPFN_WSAPOLL)(
286  _Inout_ LPWSAPOLLFD fdarray,
287  _In_ ULONG nfds,
288  _In_ INT timeout);
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)
296 int
297 PASCAL
298 FAR
299 WSARecvEx(
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
305 INT
306 PASCAL
307 FAR
308 WSARecvEx(
309  _In_ SOCKET s,
311  _In_ INT len,
312  _Inout_ INT FAR *flags);
313 #endif /* (_WIN32_WINNT < 0x0600) */
314 
315 BOOL
316 PASCAL
317 FAR
319  _In_ SOCKET hSocket,
320  _In_ HANDLE hFile,
326 
327 BOOL
328 PASCAL
329 FAR
330 AcceptEx(
331  _In_ SOCKET sListenSocket,
339 
340 VOID
341 PASCAL
342 FAR
352 
353 #ifdef __cplusplus
354 }
355 #endif
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr ** LocalSockaddr
Definition: mswsock.h:114
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpdwBytesReceived
Definition: mswsock.h:102
struct _TRANSMIT_FILE_BUFFERS * LPTRANSMIT_FILE_BUFFERS
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT LocalSockaddrLength
Definition: mswsock.h:114
#define _Out_writes_bytes_to_(size, count)
Definition: no_sal2.h:374
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
typedef BOOL(PASCAL FAR *LPFN_TRANSMITFILE)(_In_ SOCKET hSocket
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)
char CHAR
Definition: xmlstorage.h:175
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
#define INT
Definition: polytest.cpp:20
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
_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
GLint namelen
Definition: glext.h:7232
int32_t INT
Definition: typedefs.h:56
GLbitfield GLuint64 timeout
Definition: glext.h:7164
#define _In_opt_
Definition: no_sal2.h:213
int PASCAL FAR WSARecvEx(_In_ SOCKET s, _Out_writes_bytes_to_(len, return) char FAR *buf, _In_ int len, _Inout_ int FAR *flags)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD dwRemoteAddressLength
Definition: mswsock.h:102
#define FAR
Definition: guiddef.h:36
PVOID pBuffer
#define _Out_
Definition: no_sal2.h:323
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)
_In_ HANDLE _In_ DWORD _In_ DWORD nNumberOfBytesPerSend
Definition: mswsock.h:90
#define _Out_opt_
Definition: no_sal2.h:339
struct _TRANSMIT_FILE_BUFFERS * PTRANSMIT_FILE_BUFFERS
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _TRANSMIT_FILE_BUFFERS TRANSMIT_FILE_BUFFERS
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _Inout_
Definition: no_sal2.h:244
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
_In_ SOCKET sAcceptSocket
Definition: mswsock.h:100
_In_ SOCKET _In_ DWORD _In_ DWORD dwLocalAddressLength
Definition: mswsock.h:102
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static int state
Definition: maze.c:121
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define PASCAL
Definition: windef.h:133
_In_ HANDLE hFile
Definition: mswsock.h:90
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define _In_
Definition: no_sal2.h:204
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)
typedef VOID(PASCAL FAR *LPFN_GETACCEPTEXSOCKADDRS)(_In_reads_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
#define WSAAPI
Definition: winsock2.h:584
_In_ SOCKET _In_ DWORD dwReceiveDataLength
Definition: mswsock.h:102
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers
Definition: mswsock.h:90
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
uint32_t * LPDWORD
Definition: typedefs.h:57
static PDB_INFORMATION information
Definition: db.cpp:176
#define _Outptr_result_bytebuffer_(size)
Definition: no_sal2.h:420
unsigned int ULONG
Definition: retypes.h:1
_In_ SOCKET _Out_writes_bytes_(dwReceiveDataLength+dwLocalAddressLength+dwRemoteAddressLength) PVOID lpOutputBuffer
Definition: mswsock.h:101
UINT_PTR SOCKET
Definition: winsock.h:47
_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:116
static unsigned char rawData[2356]
Definition: data.c:565
_In_ HANDLE _In_ DWORD nNumberOfBytesToWrite
Definition: mswsock.h:90
GLuint64EXT * result
Definition: glext.h:11304
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
struct CFHEADER header
Definition: fdi.c:101
#define _Inout_opt_
Definition: no_sal2.h:258
int * LPINT
Definition: windef.h:178
GLuint const GLchar * name
Definition: glext.h:6031