ReactOS  0.4.14-dev-337-gf981a68
msafd.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Ancillary Function Driver DLL
4  * FILE: dll/win32/msafd/msafd.h
5  * PURPOSE: Ancillary Function Driver DLL header
6  */
7 
8 #ifndef __MSAFD_H
9 #define __MSAFD_H
10 
11 #include <stdarg.h>
12 
13 #define WIN32_NO_STATUS
14 #define _INC_WINDOWS
15 #define COM_NO_WINDOWS_H
16 
17 #include <windef.h>
18 #include <winbase.h>
19 #include <ws2spi.h>
20 #define NTOS_MODE_USER
21 #include <ndk/exfuncs.h>
22 #include <ndk/iofuncs.h>
23 #include <ndk/obfuncs.h>
24 #include <ndk/rtlfuncs.h>
25 
26 /* This includes ntsecapi.h so it needs to come after the NDK */
27 #include <wsahelp.h>
28 #include <tdi.h>
29 #include <afd/shared.h>
30 #include <mswsock.h>
31 
32 #include <wine/debug.h>
34 
35 #include "include/helpers.h"
36 
37 extern HANDLE GlobalHeap;
38 extern WSPUPCALLTABLE Upcalls;
41 extern HANDLE SockEvent;
44 
45 typedef enum _SOCKET_STATE {
52 
53 typedef struct _SOCK_SHARED_INFO {
67  struct {
80  }; // Flags
97 
98 typedef struct _SOCKET_INFORMATION {
118 
119 
120 typedef struct _SOCKET_CONTEXT {
126  /* Plus Helper Data */
128 
129 typedef struct _ASYNC_DATA {
135 
136 typedef struct _AFDAPCCONTEXT
137 {
142 
144 SOCKET
145 WSPAPI
146 WSPAccept(
147  _In_ SOCKET s,
148  _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR * addr,
149  _Inout_opt_ LPINT addrlen,
150  _In_opt_ LPCONDITIONPROC lpfnCondition,
151  _In_opt_ DWORD_PTR dwCallbackData,
152  _Out_ LPINT lpErrno);
153 
154 INT
155 WSPAPI
157  IN LPSOCKADDR lpsaAddress,
158  IN DWORD dwAddressLength,
159  IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
160  OUT LPWSTR lpszAddressString,
161  IN OUT LPDWORD lpdwAddressStringLength,
162  OUT LPINT lpErrno);
163 
164 INT
165 WSPAPI
167  IN SOCKET s,
168  IN HWND hWnd,
169  IN UINT wMsg,
170  IN LONG lEvent,
171  OUT LPINT lpErrno);
172 
173 INT
175  IN SOCKET s,
177  IN INT namelen,
178  OUT LPINT lpErrno);
179 
180 INT
181 WSPAPI
183  OUT LPINT lpErrno);
184 
185 INT
186 WSPAPI
187 WSPCleanup(
188  OUT LPINT lpErrno);
189 
190 INT
191 WSPAPI
193  IN SOCKET s,
194  OUT LPINT lpErrno);
195 
196 INT
197 WSPAPI
198 WSPConnect(
199  IN SOCKET s,
201  IN INT namelen,
202  IN LPWSABUF lpCallerData,
203  OUT LPWSABUF lpCalleeData,
204  IN LPQOS lpSQOS,
205  IN LPQOS lpGQOS,
206  OUT LPINT lpErrno);
207 
208 INT
209 WSPAPI
211  IN SOCKET s,
212  IN DWORD dwProcessId,
213  OUT LPWSAPROTOCOL_INFOW lpProtocolInfo,
214  OUT LPINT lpErrno);
215 
216 INT
217 WSPAPI
219  IN SOCKET s,
220  IN WSAEVENT hEventObject,
221  OUT LPWSANETWORKEVENTS lpNetworkEvents,
222  OUT LPINT lpErrno);
223 
224 INT
225 WSPAPI
227  IN SOCKET s,
228  IN WSAEVENT hEventObject,
229  IN LONG lNetworkEvents,
230  OUT LPINT lpErrno);
231 
232 BOOL
233 WSPAPI
235  IN SOCKET s,
237  OUT LPDWORD lpcbTransfer,
238  IN BOOL fWait,
239  OUT LPDWORD lpdwFlags,
240  OUT LPINT lpErrno);
241 
242 INT
243 WSPAPI
245  IN SOCKET s,
248  OUT LPINT lpErrno);
249 
250 BOOL
251 WSPAPI
253  IN SOCKET s,
254  IN OUT LPWSABUF lpQOSName,
255  OUT LPQOS lpQOS,
256  OUT LPINT lpErrno);
257 
258 INT
259 WSPAPI
261  IN SOCKET s,
264  OUT LPINT lpErrno);
265 
266 INT
267 WSPAPI
269  IN SOCKET s,
270  IN INT level,
271  IN INT optname,
272  OUT CHAR FAR* optval,
273  IN OUT LPINT optlen,
274  OUT LPINT lpErrno);
275 
276 INT
277 WSPAPI
278 WSPIoctl(
279  IN SOCKET s,
281  IN LPVOID lpvInBuffer,
282  IN DWORD cbInBuffer,
283  OUT LPVOID lpvOutBuffer,
284  IN DWORD cbOutBuffer,
285  OUT LPDWORD lpcbBytesReturned,
287  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
288  IN LPWSATHREADID lpThreadId,
289  OUT LPINT lpErrno);
290 
291 SOCKET
292 WSPAPI
294  IN SOCKET s,
296  IN INT namelen,
297  IN LPWSABUF lpCallerData,
298  OUT LPWSABUF lpCalleeData,
299  IN LPQOS lpSQOS,
300  IN LPQOS lpGQOS,
301  IN DWORD dwFlags,
302  OUT LPINT lpErrno);
303 
304 INT
305 WSPAPI
306 WSPListen(
307  IN SOCKET s,
308  IN INT backlog,
309  OUT LPINT lpErrno);
310 
311 INT
312 WSPAPI
313 WSPRecv(
314  IN SOCKET s,
315  IN OUT LPWSABUF lpBuffers,
316  IN DWORD dwBufferCount,
317  OUT LPDWORD lpNumberOfBytesRecvd,
318  IN OUT LPDWORD lpFlags,
320  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
321  IN LPWSATHREADID lpThreadId,
322  OUT LPINT lpErrno);
323 
324 INT
325 WSPAPI
327  IN SOCKET s,
328  OUT LPWSABUF lpInboundDisconnectData,
329  OUT LPINT lpErrno);
330 
331 INT
332 WSPAPI
334  IN SOCKET s,
335  IN OUT LPWSABUF lpBuffers,
336  IN DWORD dwBufferCount,
337  OUT LPDWORD lpNumberOfBytesRecvd,
338  IN OUT LPDWORD lpFlags,
339  OUT LPSOCKADDR lpFrom,
340  IN OUT LPINT lpFromlen,
342  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
343  IN LPWSATHREADID lpThreadId,
344  OUT LPINT lpErrno);
345 
346 INT
347 WSPAPI
348 WSPSelect(
349  IN INT nfds,
350  IN OUT fd_set *readfds,
351  IN OUT fd_set *writefds,
352  IN OUT fd_set *exceptfds,
353  IN CONST struct timeval *timeout,
354  OUT LPINT lpErrno);
355 
356 INT
357 WSPAPI
358 WSPSend(
359  IN SOCKET s,
360  IN LPWSABUF lpBuffers,
361  IN DWORD dwBufferCount,
362  OUT LPDWORD lpNumberOfBytesSent,
363  IN DWORD dwFlags,
365  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
366  IN LPWSATHREADID lpThreadId,
367  OUT LPINT lpErrno);
368 
369 INT
370 WSPAPI
372  IN SOCKET s,
373  IN LPWSABUF lpOutboundDisconnectData,
374  OUT LPINT lpErrno);
375 
376 INT
377 WSPAPI
378 WSPSendTo(
379  IN SOCKET s,
380  IN LPWSABUF lpBuffers,
381  IN DWORD dwBufferCount,
382  OUT LPDWORD lpNumberOfBytesSent,
383  IN DWORD dwFlags,
384  IN CONST SOCKADDR *lpTo,
385  IN INT iTolen,
387  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
388  IN LPWSATHREADID lpThreadId,
389  OUT LPINT lpErrno);
390 
391 INT
392 WSPAPI
394  IN SOCKET s,
395  IN INT level,
396  IN INT optname,
397  IN CONST CHAR FAR* optval,
398  IN INT optlen,
399  OUT LPINT lpErrno);
400 
401 INT
402 WSPAPI
404  IN SOCKET s,
405  IN INT how,
406  OUT LPINT lpErrno);
407 
408 SOCKET
409 WSPAPI
410 WSPSocket(
411  IN INT af,
412  IN INT type,
413  IN INT protocol,
414  IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
415  IN GROUP g,
416  IN DWORD dwFlags,
417  OUT LPINT lpErrno);
418 
419 INT
420 WSPAPI
422  IN LPWSTR AddressString,
424  IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
425  OUT LPSOCKADDR lpAddress,
426  IN OUT LPINT lpAddressLength,
427  OUT LPINT lpErrno);
428 
429 BOOL
430 WSPAPI
432  IN SOCKET sListenSocket,
434  OUT PVOID lpOutputBuffer,
440 
441 BOOL
442 WSPAPI
444  IN SOCKET s,
445  IN const struct sockaddr *name,
446  IN int namelen,
447  IN PVOID lpSendBuffer,
448  IN DWORD dwSendDataLength,
449  OUT LPDWORD lpdwBytesSent,
451 
452 BOOL
453 WSPAPI
455  IN SOCKET hSocket,
457  IN DWORD dwFlags,
458  IN DWORD reserved);
459 
460 VOID
461 WSPAPI
463  IN PVOID lpOutputBuffer,
467  OUT struct sockaddr **LocalSockaddr,
469  OUT struct sockaddr **RemoteSockaddr,
471 
473  SOCKET Handle
474 );
475 
477 
479 
481  PSOCKET_INFORMATION Socket,
482  ULONG AfdInformationClass,
483  PBOOLEAN Boolean OPTIONAL,
485  PLARGE_INTEGER LargeInteger OPTIONAL,
486  LPWSAOVERLAPPED Overlapped OPTIONAL,
488 );
489 
491  PSOCKET_INFORMATION Socket,
492  ULONG AfdInformationClass,
493  PBOOLEAN Boolean OPTIONAL,
495  PLARGE_INTEGER LargeInteger OPTIONAL,
496  LPWSAOVERLAPPED Overlapped OPTIONAL,
498 );
499 
500 int CreateContext(
501  PSOCKET_INFORMATION Socket
502 );
503 
504 ULONG
505 NTAPI
507  PVOID ThreadParam
508 );
509 
510 VOID
512  PSOCKET_INFORMATION Socket,
513  PASYNC_DATA AsyncData
514 );
515 
516 VOID
518  PVOID Context,
520 );
521 
522 BOOLEAN
524  VOID
525 );
526 
528  VOID
529 );
530 
532  PVOID Context,
534 );
535 
536 VOID
538  IN PSOCKET_INFORMATION Socket,
539  IN ULONG Event
540  );
541 
543 
545 DWORD
547  LPINT Errno,
548  DWORD Received,
549  LPDWORD ReturnedBytes)
550 {
551  if (Errno)
552  {
553  *Errno = TranslateNtStatusError(Status);
554 
555  if (ReturnedBytes)
556  *ReturnedBytes = (*Errno == 0) ? Received : 0;
557 
558  return (*Errno == 0) ? 0 : SOCKET_ERROR;
559  }
560  else
561  {
562  DbgPrint("%s: Received invalid lpErrno pointer!\n", __FUNCTION__);
563 
564  if (ReturnedBytes)
565  *ReturnedBytes = (Status == STATUS_SUCCESS) ? Received : 0;
566 
567  return (Status == STATUS_SUCCESS) ? 0 : SOCKET_ERROR;
568  }
569 }
570 
571 #endif /* __MSAFD_H */
Definition: winsock.h:66
#define SOCKET_ERROR
Definition: winsock.h:333
SOCKET WSPAPI WSPJoinLeaf(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS, IN DWORD dwFlags, OUT LPINT lpErrno)
Definition: stubs.c:40
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr ** LocalSockaddr
Definition: mswsock.h:114
HANDLE EventObject
Definition: msafd.h:110
INT WSPAPI WSPAsyncSelect(IN SOCKET s, IN HWND hWnd, IN UINT wMsg, IN LONG lEvent, OUT LPINT lpErrno)
Definition: sndrcv.c:17
INT WSPAPI WSPConnect(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS, OUT LPINT lpErrno)
INT AddressFamily
Definition: msafd.h:56
_SOCKET_STATE
Definition: msafd.h:45
GLint level
Definition: gl.h:1546
#define IN
Definition: typedefs.h:38
INT WSPAPI WSPSelect(IN INT nfds, IN OUT fd_set *readfds, IN OUT fd_set *writefds, IN OUT fd_set *exceptfds, IN CONST struct timeval *timeout, OUT LPINT lpErrno)
int(CALLBACK * LPCONDITIONPROC)(IN LPWSABUF lpCallerId, IN LPWSABUF lpCallerData, IN OUT LPQOS lpSQOS, IN OUT LPQOS lpGQOS, IN LPWSABUF lpCalleeId, IN LPWSABUF lpCalleeData, OUT GROUP FAR *g, IN DWORD_PTR dwCallbackData)
Definition: winsock2.h:711
HANDLE SockEvent
DWORD SequenceNumber
Definition: msafd.h:131
struct _SOCKET_CONTEXT SOCKET_CONTEXT
HANDLE SockAsyncCompletionPort
Definition: dllmain.c:28
#define _Must_inspect_result_
Definition: no_sal2.h:314
BOOLEAN Listening
Definition: msafd.h:68
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
BOOLEAN SockGetAsyncSelectHelperAfdHandle(VOID)
Definition: dllmain.c:3675
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpdwBytesReceived
Definition: mswsock.h:102
SOCKADDR WSRemoteAddress
Definition: msafd.h:95
BOOLEAN ExclusiveAddressUse
Definition: msafd.h:73
INT WSPAPI WSPCloseSocket(IN SOCKET s, OUT LPINT lpErrno)
Definition: dllmain.c:623
struct _SOCKET_INFORMATION * PSOCKET_INFORMATION
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_result_bytebuffer_ LocalSockaddrLength struct sockaddr _Out_ LPINT LocalSockaddrLength
Definition: mswsock.h:114
#define DbgPrint
Definition: loader.c:25
INT WSPAPI WSPSend(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
#define _Out_writes_bytes_to_opt_(size, count)
Definition: no_sal2.h:375
INT WSPAPI WSPStringToAddress(IN LPWSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength, OUT LPINT lpErrno)
Definition: dllmain.c:3110
BOOL WSPAPI WSPAcceptEx(IN SOCKET sListenSocket, IN SOCKET sAcceptSocket, OUT PVOID lpOutputBuffer, IN DWORD dwReceiveDataLength, IN DWORD dwLocalAddressLength, IN DWORD dwRemoteAddressLength, OUT LPDWORD lpdwBytesReceived, IN OUT LPOVERLAPPED lpOverlapped)
Definition: stubs.c:58
ULONG ConnectTime
Definition: msafd.h:66
char CHAR
Definition: xmlstorage.h:175
#define WSAEVENT
Definition: winsock2.h:585
SOCKADDR WSLocalAddress
Definition: msafd.h:94
SOCKET Handle
Definition: msafd.h:99
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN Broadcast
Definition: msafd.h:69
HWND hWnd
Definition: settings.c:17
BOOLEAN OobInline
Definition: msafd.h:71
struct _AFDAPCCONTEXT * PAFDAPCCONTEXT
BOOLEAN SendShutdown
Definition: msafd.h:77
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL WSPAPI WSPDisconnectEx(IN SOCKET hSocket, IN LPOVERLAPPED lpOverlapped, IN DWORD dwFlags, IN DWORD reserved)
Definition: stubs.c:91
BOOLEAN UseDelayedAcceptance
Definition: msafd.h:78
DWORD SequenceNumber
Definition: msafd.h:90
Definition: dhcpd.h:245
int SetSocketInformation(PSOCKET_INFORMATION Socket, ULONG AfdInformationClass, PBOOLEAN Boolean OPTIONAL, PULONG Ulong OPTIONAL, PLARGE_INTEGER LargeInteger OPTIONAL, LPWSAOVERLAPPED Overlapped OPTIONAL, LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL)
Definition: dllmain.c:3384
_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
struct _AFDAPCCONTEXT AFDAPCCONTEXT
INT WSPAPI WSPCancelBlockingCall(OUT LPINT lpErrno)
Definition: stubs.c:15
struct _SOCK_SHARED_INFO SOCK_SHARED_INFO
GLint namelen
Definition: glext.h:7232
VOID WSPAPI WSPGetAcceptExSockaddrs(IN PVOID lpOutputBuffer, IN DWORD dwReceiveDataLength, IN DWORD dwLocalAddressLength, IN DWORD dwRemoteAddressLength, OUT struct sockaddr **LocalSockaddr, OUT LPINT LocalSockaddrLength, OUT struct sockaddr **RemoteSockaddr, OUT LPINT RemoteSockaddrLength)
Definition: stubs.c:104
int32_t INT
Definition: typedefs.h:56
INT WSPAPI WSPRecv(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
INT WSPAPI WSPListen(IN SOCKET s, IN INT backlog, OUT LPINT lpErrno)
#define _In_opt_
Definition: no_sal2.h:213
struct _SOCKET_INFORMATION * NextSocket
Definition: msafd.h:116
VOID DeleteSocketStructure(SOCKET Handle)
WSAPROTOCOL_INFOW ProtocolInfo
Definition: msafd.h:115
INT WSPAPI WSPGetPeerName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
Definition: dllmain.c:2254
DWORD CreateFlags
Definition: msafd.h:81
ULONG SizeOfHelperData
Definition: msafd.h:122
PSOCKADDR RemoteAddress
Definition: msafd.h:106
BOOLEAN ReuseAddresses
Definition: msafd.h:72
BOOLEAN SockAsyncSelectCalled
Definition: dllmain.c:29
CRITICAL_SECTION Lock
Definition: msafd.h:112
BOOL WSPAPI WSPGetOverlappedResult(IN SOCKET s, IN LPWSAOVERLAPPED lpOverlapped, OUT LPDWORD lpcbTransfer, IN BOOL fWait, OUT LPDWORD lpdwFlags, OUT LPINT lpErrno)
Definition: sndrcv.c:96
INT WSPAPI WSPGetSockOpt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT LPINT optlen, OUT LPINT lpErrno)
Definition: dllmain.c:2600
INT WSPAPI WSPShutdown(IN SOCKET s, IN INT how, OUT LPINT lpErrno)
DWORD ProviderFlags
Definition: msafd.h:83
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
INT WSPAPI WSPSetSockOpt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen, OUT LPINT lpErrno)
Definition: dllmain.c:2776
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOLEAN UseSAN
Definition: msafd.h:79
long LONG
Definition: pedump.c:60
_In_ SOCKET _In_ DWORD _In_ DWORD _In_ DWORD dwRemoteAddressLength
Definition: mswsock.h:102
enum _SOCKET_STATE SOCKET_STATE
PSOCK_SHARED_INFO SharedData
Definition: msafd.h:100
INT WSPAPI WSPBind(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, OUT LPINT lpErrno)
INT WSPAPI WSPGetSockName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
Definition: dllmain.c:2152
#define FAR
Definition: guiddef.h:36
INT WSPAPI WSPSendTo(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN CONST SOCKADDR *lpTo, IN INT iTolen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
r reserved
Definition: btrfs.c:2865
ULONG SizeOfSendBuffer
Definition: msafd.h:65
struct _SOCKET_CONTEXT * PSOCKET_CONTEXT
unsigned char BOOLEAN
#define FORCEINLINE
Definition: ntbasedef.h:221
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest
Definition: dllmain.c:22
#define _Out_
Definition: no_sal2.h:323
ULONG Padding
Definition: msafd.h:123
PHELPER_DATA HelperData
Definition: msafd.h:103
AFD_POLL_INFO AsyncSelectInfo
Definition: msafd.h:133
INT WSPAPI WSPEnumNetworkEvents(IN SOCKET s, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents, OUT LPINT lpErrno)
Definition: event.c:133
int GetSocketInformation(PSOCKET_INFORMATION Socket, ULONG AfdInformationClass, PBOOLEAN Boolean OPTIONAL, PULONG Ulong OPTIONAL, PLARGE_INTEGER LargeInteger OPTIONAL, LPWSAOVERLAPPED Overlapped OPTIONAL, LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL)
Definition: dllmain.c:3257
_Must_inspect_result_ SOCKET WSPAPI WSPAccept(_In_ SOCKET s, _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR *addr, _Inout_opt_ LPINT addrlen, _In_opt_ LPCONDITIONPROC lpfnCondition, _In_opt_ DWORD_PTR dwCallbackData, _Out_ LPINT lpErrno)
Definition: dllmain.c:1434
BOOLEAN ReceiveShutdown
Definition: msafd.h:76
INT WSPAPI WSPDuplicateSocket(IN SOCKET s, IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPINT lpErrno)
Definition: dllmain.c:449
BOOLEAN Debug
Definition: msafd.h:70
LONG RefCount
Definition: msafd.h:55
BOOLEAN NonBlocking
Definition: msafd.h:74
_In_ HANDLE Handle
Definition: extypes.h:390
GLboolean GLboolean g
Definition: glext.h:6204
DWORD ServiceFlags1
Definition: msafd.h:82
DWORD HelperEvents
Definition: msafd.h:102
INT SocketType
Definition: msafd.h:57
VOID SockProcessAsyncSelect(PSOCKET_INFORMATION Socket, PASYNC_DATA AsyncData)
Definition: dllmain.c:3866
GROUP GroupID
Definition: msafd.h:84
BOOLEAN SockCreateOrReferenceAsyncThread(VOID)
Definition: dllmain.c:3580
struct _SOCK_SHARED_INFO * PSOCK_SHARED_INFO
LPWSAOVERLAPPED lpOverlapped
Definition: msafd.h:138
unsigned int GROUP
Definition: winsock2.h:640
unsigned long DWORD
Definition: ntddk_ex.h:95
INT SizeOfRemoteAddress
Definition: msafd.h:60
FORCEINLINE DWORD MsafdReturnWithErrno(NTSTATUS Status, LPINT Errno, DWORD Received, LPDWORD ReturnedBytes)
Definition: msafd.h:546
WSPUPCALLTABLE Upcalls
Definition: dllmain.c:20
PSOCKET_INFORMATION ParentSocket
Definition: msafd.h:130
WINE_DEFAULT_DEBUG_CHANNEL(msafd)
_In_ SOCKET sAcceptSocket
Definition: mswsock.h:100
BOOL WSPAPI WSPConnectEx(IN SOCKET s, IN const struct sockaddr *name, IN int namelen, IN PVOID lpSendBuffer, IN DWORD dwSendDataLength, OUT LPDWORD lpdwBytesSent, IN OUT LPOVERLAPPED lpOverlapped)
Definition: stubs.c:75
INT WSPAPI WSPRecvDisconnect(IN SOCKET s, OUT LPWSABUF lpInboundDisconnectData, OUT LPINT lpErrno)
Definition: sndrcv.c:919
char * PBOOLEAN
Definition: retypes.h:11
PSOCKET_INFORMATION GetSocketStructure(SOCKET Handle)
Definition: dllmain.c:3507
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ SOCKET _In_ DWORD _In_ DWORD dwLocalAddressLength
Definition: mswsock.h:102
INT SizeOfLocalAddress
Definition: msafd.h:59
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define VOID
Definition: acefi.h:82
INT TranslateNtStatusError(NTSTATUS Status)
Definition: dllmain.c:537
BOOLEAN DontUseWildcard
Definition: msafd.h:75
HANDLE lEvent
Definition: tftpd.cpp:56
struct _ASYNC_DATA * PASYNC_DATA
GLdouble s
Definition: gl.h:2039
Definition: typedefs.h:117
INT WSPAPI WSPEventSelect(IN SOCKET s, IN WSAEVENT hEventObject, IN LONG lNetworkEvents, OUT LPINT lpErrno)
Definition: event.c:17
uint32_t DWORD_PTR
Definition: typedefs.h:63
HANDLE TdiConnectionHandle
Definition: msafd.h:108
HANDLE TdiAddressHandle
Definition: msafd.h:107
int(WSPAPI * LPWPUCOMPLETEOVERLAPPEDREQUEST)(_In_ SOCKET s, _Inout_ LPWSAOVERLAPPED lpOverlapped, _In_ DWORD dwError, _In_ DWORD cbTransferred, _Out_ LPINT lpErrno)
Definition: ws2spi.h:408
Status
Definition: gdiplustypes.h:24
SOCKADDR RemoteAddress
Definition: msafd.h:125
IO_STATUS_BLOCK IoStatusBlock
Definition: msafd.h:132
#define _In_
Definition: no_sal2.h:204
VOID(* PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
Definition: msafd.h:542
ULONG NTAPI SockAsyncThread(PVOID ThreadParam)
Definition: dllmain.c:3641
struct _SOCKET_INFORMATION SOCKET_INFORMATION
INT WSPAPI WSPCleanup(OUT LPINT lpErrno)
Definition: dllmain.c:3234
struct linger LingerData
Definition: msafd.h:61
ULONG SizeOfRecvBuffer
Definition: msafd.h:64
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
PSOCKADDR LocalAddress
Definition: msafd.h:105
LONG Unknown
Definition: msafd.h:89
LONG AsyncDisabledEvents
Definition: msafd.h:93
INT WSPAPI WSPRecvFrom(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, OUT LPSOCKADDR lpFrom, IN OUT LPINT lpFromlen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int * PULONG
Definition: retypes.h:1
_In_ SOCKET _In_ DWORD dwReceiveDataLength
Definition: mswsock.h:102
unsigned int UINT
Definition: ndis.h:50
INT WSPAPI WSPIoctl(IN SOCKET s, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
Definition: dllmain.c:2357
PSOCKET_INFORMATION lpSocket
Definition: msafd.h:140
struct _ASYNC_DATA ASYNC_DATA
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
Definition: msafd.h:139
ULONG RecvTimeout
Definition: msafd.h:63
INT SocketLastError
Definition: msafd.h:87
Definition: name.c:36
SOCKET_STATE State
Definition: msafd.h:54
#define OUT
Definition: typedefs.h:39
SOCK_SHARED_INFO SharedData
Definition: msafd.h:121
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
SOCKADDR LocalAddress
Definition: msafd.h:124
uint32_t * LPDWORD
Definition: typedefs.h:57
HANDLE GlobalHeap
Definition: dllmain.c:19
struct tagContext Context
Definition: acpixf.h:1024
_In_ PIRP _In_opt_ PVOID _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
Definition: fsrtlfuncs.h:673
LIST_ENTRY SockHelpersListHead
Definition: dllmain.c:25
unsigned int ULONG
Definition: retypes.h:1
ULONG SendTimeout
Definition: msafd.h:62
DWORD GroupType
Definition: msafd.h:85
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
SOCKET WSPAPI WSPSocket(IN INT af, IN INT type, IN INT protocol, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, IN GROUP g, IN DWORD dwFlags, OUT LPINT lpErrno)
LONG NetworkEvents
Definition: msafd.h:111
INT GroupPriority
Definition: msafd.h:86
PVOID HelperContext
Definition: msafd.h:104
enum _SOCKET_STATE * PSOCKET_STATE
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned long Ulong
Definition: utypes.h:42
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define __FUNCTION__
Definition: types.h:112
LONG AsyncEvents
Definition: msafd.h:92
UINT Received
Definition: arping.c:40
HANDLE SharedDataHandle
Definition: msafd.h:101
#define CONST
Definition: pedump.c:81
INT WSPAPI WSPAddressToString(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, OUT LPINT lpErrno)
Definition: dllmain.c:3050
int CreateContext(PSOCKET_INFORMATION Socket)
Definition: dllmain.c:3530
VOID SockAsyncSelectCompletionRoutine(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
Definition: dllmain.c:3737
VOID SockProcessQueuedAsyncSelect(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
Definition: dllmain.c:3949
VOID SockReenableAsyncSelectEvent(IN PSOCKET_INFORMATION Socket, IN ULONG Event)
Definition: dllmain.c:3983
#define _Inout_opt_
Definition: no_sal2.h:258
int * LPINT
Definition: windef.h:178
INT WSPAPI WSPSendDisconnect(IN SOCKET s, IN LPWSABUF lpOutboundDisconnectData, OUT LPINT lpErrno)
Definition: sndrcv.c:931
BOOL WSPAPI WSPGetQOSByName(IN SOCKET s, IN OUT LPWSABUF lpQOSName, OUT LPQOS lpQOS, OUT LPINT lpErrno)
Definition: stubs.c:26
#define WSPAPI
Definition: ws2spi.h:39
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700