ReactOS 0.4.16-dev-297-gc569aee
msafdlib.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock 2 NSP
4 * FILE: include/reactos/winsock/msafdlib.h
5 * PURPOSE: Winsock 2 SPI Utility Header
6 */
7
8#define NO_BLOCKING_HOOK 0
9#define MAYBE_BLOCKING_HOOK 1
10#define ALWAYS_BLOCKING_HOOK 2
11
12#define NO_TIMEOUT 0
13#define SEND_TIMEOUT 1
14#define RECV_TIMEOUT 2
15
16#define MAX_TDI_ADDRESS_LENGTH 32
17
18#define WSA_FLAG_MULTIPOINT_ALL (WSA_FLAG_MULTIPOINT_C_ROOT |\
19 WSA_FLAG_MULTIPOINT_C_LEAF |\
20 WSA_FLAG_MULTIPOINT_D_ROOT |\
21 WSA_FLAG_MULTIPOINT_D_LEAF)
22
23
24/* Socket State */
25typedef enum _SOCKET_STATE
26{
34
35/*
36 * Shared Socket Information.
37 * It's called shared because we send it to Kernel-Mode for safekeeping
38 */
39typedef struct _SOCK_SHARED_INFO {
46 struct linger LingerData;
51 struct {
52 BOOLEAN Listening:1;
53 BOOLEAN Broadcast:1;
54 BOOLEAN Debug:1;
55 BOOLEAN OobInline:1;
56 BOOLEAN ReuseAddresses:1;
57 BOOLEAN ExclusiveAddressUse:1;
58 BOOLEAN NonBlocking:1;
59 BOOLEAN DontUseWildcard:1;
60 BOOLEAN ReceiveShutdown:1;
61 BOOLEAN SendShutdown:1;
62 BOOLEAN UseDelayedAcceptance:1;
63 BOOLEAN UseSAN:1;
64 }; // Flags
73 HWND hWnd;
76 UINT wMsg;
80
81/* Socket Helper Data. Holds information about the WSH Libraries */
82typedef struct _HELPER_DATA {
106
107typedef struct _ASYNC_DATA
108{
114
115/* The actual Socket Structure represented by a handle. Internal to us */
116typedef struct _SOCKET_INFORMATION {
117 union {
119 struct {
122 };
123 };
140
141/* The blob of data we send to Kernel-Mode for safekeeping */
142typedef struct _SOCKET_CONTEXT {
148 /* Plus Helper Data */
150
151typedef struct _SOCK_RW_LOCK
152{
157
158typedef struct _WINSOCK_TEB_DATA
159{
168
169typedef INT
170(WINAPI *PICF_CONNECT)(PVOID IcfData);
171
172typedef struct _SOCK_ICF_DATA
173{
180
181typedef PVOID
183 IN HANDLE Heap,
184 IN ULONG Flags,
186);
187
202extern LONG gWSM_NSPCallRef;
211
212BOOL
213WSPAPI
215
216BOOL
217WSPAPI
219
220INT
221WSPAPI
223
224PVOID
225WSPAPI
227 IN ULONG Flags,
228 IN ULONG Size);
229
231WSPAPI
234 IN ULONG SpinCount
235);
236
237VOID
238WSPAPI
240
241VOID
242WSPAPI
244
245VOID
246WSPAPI
248
249VOID
250WSPAPI
252
254WSPAPI
256
257INT
258WSPAPI
260 IN ULONG Ioctl,
263 OUT PULONG BufferReturned);
264
265INT
266WSPAPI
268 IN GROUP Group,
269 IN PSOCKADDR SocketAddress,
270 IN INT SocketAddressLength);
271
272BOOL
273WSPAPI
275 IN SOCKET SocketHandle,
276 IN DWORD BlockingFlags,
277 IN DWORD TimeoutFlags);
278
280WSPAPI
282
283INT
284WSPAPI
286 IN DWORD Event);
287
288INT
289WSPAPI
292
293INT
294WSPAPI
296 IN PSOCKADDR Sockaddr,
297 IN INT SockaddrLength);
298
299INT
300WSPAPI
302 OUT PINT SockaddrLength,
303 IN PTRANSPORT_ADDRESS TdiAddress);
304
305INT
306WSPAPI
308
309VOID
310WSPAPI
314
315VOID
316WSPAPI
318
319INT
320WSPAPI
322 IN ULONG AfdInformationClass,
323 IN PVOID ExtraData OPTIONAL,
325 IN OUT PBOOLEAN Boolean OPTIONAL,
327 IN OUT PLARGE_INTEGER LargeInteger OPTIONAL);
328
329INT
330WSPAPI
332 IN ULONG AfdInformationClass,
333 IN PBOOLEAN Boolean OPTIONAL,
335 IN PLARGE_INTEGER LargeInteger OPTIONAL);
336
337INT
338WSPAPI
340
341VOID
342WSPAPI
344
345VOID
346WSPAPI
348
350WSPAPI
352 IN BOOLEAN Import);
353
354INT
355WSPAPI
357
358VOID
359WSPAPI
361
362VOID
363WSPAPI
365
366VOID
367WSPAPI
369
370VOID
371WSPAPI
373
374VOID
375WSPAPI
377
378INT
379WSPAPI
381
382INT
383WSPAPI
387 LPGUID ProviderId,
388 GROUP g,
390 DWORD ProviderFlags,
391 DWORD ServiceFlags,
393 PSOCKET_INFORMATION *NewSocket);
394
395INT
396WSPAPI
398
400INT
401WSPAPI
403{
404 /* Make sure we aren't terminating and get our thread data */
405 if (!(SockProcessTerminating) &&
406 (SockWspStartupCount > 0) &&
407 ((*ThreadData = NtCurrentTeb()->WinSockData)))
408 {
409 /* Everything is good, return */
410 return NO_ERROR;
411 }
412
413 /* Something didn't work out, use the slow path */
415}
416
418VOID
419WSPAPI
421{
422 /* Dereference and see if it's the last count */
423 if (!InterlockedDecrement(&Helper->RefCount))
424 {
425 /* Destroy the Helper DLL */
426 SockFreeHelperDll(Helper);
427 }
428}
429
430#define MSAFD_IS_DGRAM_SOCK(s) \
431 (s->SharedData.ServiceFlags1 & XP1_CONNECTIONLESS)
432
433/* Global data that we want to share access with */
437
438typedef VOID
442);
443
444/* Internal Helper Functions */
445INT
446WSPAPI
448 PWSTR TransportName,
450 PHELPER_DATA *HelperDllData
451);
452
453INT
454WSPAPI
456 PWSTR TransportName,
458);
459
460INT
461WSPAPI
463 PWSTR *TransportList
464);
465
466BOOL
467WSPAPI
470 OUT PBOOLEAN AfMatch,
472 OUT PBOOLEAN SockMatch,
474 OUT PBOOLEAN ProtoMatch);
475
476INT
477WSPAPI
479 IN HWND hWnd,
480 IN UINT wMsg,
481 IN LONG Events);
482
483INT
484WSPAPI
486 IN WSAEVENT EventObject,
487 IN LONG Events);
488
490WSPAPI
492
494WSPAPI
496
497INT
498WSPAPI
502 LPGUID ProviderId,
503 GROUP Group,
504 DWORD Flags,
505 PUNICODE_STRING TransportName,
506 PVOID *HelperDllContext,
507 PHELPER_DATA *HelperDllData,
508 PDWORD Events);
509
510INT
511WSPAPI
513 PVOID ThreadParam
514);
515
516VOID
517WSPAPI
519 PASYNC_DATA AsyncData);
520
521VOID
522WSPAPI
526
527INT
528WSPAPI
530 IN ULONG Event);
531
532VOID
533WSPAPI
536
537VOID
538WSPAPI
542);
543
544/* Public functions, but not exported! */
545SOCKET
546WSPAPI
548 IN SOCKET s,
550 IN OUT LPINT addrlen,
551 IN LPCONDITIONPROC lpfnCondition,
552 IN DWORD dwCallbackData,
553 OUT LPINT lpErrno);
554
555INT
556WSPAPI
558 IN LPSOCKADDR lpsaAddress,
559 IN DWORD dwAddressLength,
560 IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
561 OUT LPWSTR lpszAddressString,
562 IN OUT LPDWORD lpdwAddressStringLength,
563 OUT LPINT lpErrno);
564
565INT
566WSPAPI
568 IN SOCKET s,
569 IN HWND hWnd,
570 IN UINT wMsg,
571 IN LONG lEvent,
572 OUT LPINT lpErrno);
573
574INT
576 IN SOCKET s,
578 IN INT namelen,
579 OUT LPINT lpErrno);
580
581INT
582WSPAPI
584 OUT LPINT lpErrno);
585
586INT
587WSPAPI
589 OUT LPINT lpErrno);
590
591INT
592WSPAPI
594 IN SOCKET s,
595 OUT LPINT lpErrno);
596
597INT
598WSPAPI
600 IN SOCKET s,
602 IN INT namelen,
603 IN LPWSABUF lpCallerData,
604 OUT LPWSABUF lpCalleeData,
605 IN LPQOS lpSQOS,
606 IN LPQOS lpGQOS,
607 OUT LPINT lpErrno);
608
609INT
610WSPAPI
612 IN SOCKET s,
613 IN DWORD dwProcessId,
614 OUT LPWSAPROTOCOL_INFOW lpProtocolInfo,
615 OUT LPINT lpErrno);
616
617INT
618WSPAPI
620 IN SOCKET s,
621 IN WSAEVENT hEventObject,
622 OUT LPWSANETWORKEVENTS lpNetworkEvents,
623 OUT LPINT lpErrno);
624
625INT
626WSPAPI
628 IN SOCKET s,
629 IN WSAEVENT hEventObject,
630 IN LONG lNetworkEvents,
631 OUT LPINT lpErrno);
632
633BOOL
634WSPAPI
636 IN SOCKET s,
638 OUT LPDWORD lpcbTransfer,
639 IN BOOL fWait,
640 OUT LPDWORD lpdwFlags,
641 OUT LPINT lpErrno);
642
643INT
644WSPAPI
646 IN SOCKET s,
649 OUT LPINT lpErrno);
650
651BOOL
652WSPAPI
654 IN SOCKET s,
655 IN OUT LPWSABUF lpQOSName,
656 OUT LPQOS lpQOS,
657 OUT LPINT lpErrno);
658
659INT
660WSPAPI
662 IN SOCKET s,
665 OUT LPINT lpErrno);
666
667INT
668WSPAPI
670 IN SOCKET s,
671 IN INT level,
672 IN INT optname,
673 OUT CHAR FAR* optval,
674 IN OUT LPINT optlen,
675 OUT LPINT lpErrno);
676
677INT
678WSPAPI
680 IN SOCKET s,
682 IN LPVOID lpvInBuffer,
683 IN DWORD cbInBuffer,
684 OUT LPVOID lpvOutBuffer,
685 IN DWORD cbOutBuffer,
686 OUT LPDWORD lpcbBytesReturned,
688 IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
689 IN LPWSATHREADID lpThreadId,
690 OUT LPINT lpErrno);
691
692SOCKET
693WSPAPI
695 IN SOCKET s,
697 IN INT namelen,
698 IN LPWSABUF lpCallerData,
699 OUT LPWSABUF lpCalleeData,
700 IN LPQOS lpSQOS,
701 IN LPQOS lpGQOS,
703 OUT LPINT lpErrno);
704
705INT
706WSPAPI
708 IN SOCKET s,
709 IN INT backlog,
710 OUT LPINT lpErrno);
711
712INT
713WSPAPI
715 IN SOCKET s,
716 IN OUT LPWSABUF lpBuffers,
717 IN DWORD dwBufferCount,
718 OUT LPDWORD lpNumberOfBytesRecvd,
719 IN OUT LPDWORD lpFlags,
721 IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
722 IN LPWSATHREADID lpThreadId,
723 OUT LPINT lpErrno);
724
725INT
726WSPAPI
728 IN SOCKET s,
729 OUT LPWSABUF lpInboundDisconnectData,
730 OUT LPINT lpErrno);
731
732INT
733WSPAPI
735 IN SOCKET s,
736 IN OUT LPWSABUF lpBuffers,
737 IN DWORD dwBufferCount,
738 OUT LPDWORD lpNumberOfBytesRecvd,
739 IN OUT LPDWORD lpFlags,
740 OUT LPSOCKADDR lpFrom,
741 IN OUT LPINT lpFromlen,
743 IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
744 IN LPWSATHREADID lpThreadId,
745 OUT LPINT lpErrno);
746
747INT
748WSPAPI
750 IN INT nfds,
751 IN OUT LPFD_SET readfds,
752 IN OUT LPFD_SET writefds,
753 IN OUT LPFD_SET exceptfds,
755 OUT LPINT lpErrno);
756
757INT
758WSPAPI
760 IN SOCKET s,
761 IN LPWSABUF lpBuffers,
762 IN DWORD dwBufferCount,
763 OUT LPDWORD lpNumberOfBytesSent,
766 IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
767 IN LPWSATHREADID lpThreadId,
768 OUT LPINT lpErrno);
769
770INT
771WSPAPI
773 IN SOCKET s,
774 IN LPWSABUF lpOutboundDisconnectData,
775 OUT LPINT lpErrno);
776
777INT
778WSPAPI
780 IN SOCKET s,
781 IN LPWSABUF lpBuffers,
782 IN DWORD dwBufferCount,
783 OUT LPDWORD lpNumberOfBytesSent,
785 IN CONST SOCKADDR *lpTo,
786 IN INT iTolen,
788 IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
789 IN LPWSATHREADID lpThreadId,
790 OUT LPINT lpErrno);
791
792INT
793WSPAPI
795 IN SOCKET s,
796 IN INT level,
797 IN INT optname,
798 IN CONST CHAR FAR* optval,
799 IN INT optlen,
800 OUT LPINT lpErrno);
801
802INT
803WSPAPI
805 IN SOCKET s,
806 IN INT how,
807 OUT LPINT lpErrno);
808
809SOCKET
810WSPAPI
812 IN INT af,
813 IN INT type,
815 IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
816 IN GROUP g,
818 OUT LPINT lpErrno);
819
820INT
821WSPAPI
823 IN LPWSTR AddressString,
825 IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
826 OUT LPSOCKADDR lpAddress,
827 IN OUT LPINT lpAddressLength,
828 OUT LPINT lpErrno);
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
#define InterlockedDecrement
Definition: armddk.h:52
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
HANDLE Events[3]
Definition: schedsvc.c:40
_Inout_ PVCB _In_ BOOLEAN Force
Definition: cdprocs.h:1417
Definition: bufpool.h:45
_In_ const GUID _In_ ULONG ExtraDataSize
Definition: classpnp.h:1430
#define NO_ERROR
Definition: dderror.h:5
#define FAR
Definition: zlib.h:34
DWORD CatalogEntryId
Definition: dllmain.c:21
enum _SOCKET_STATE SOCKET_STATE
_SOCKET_STATE
Definition: msafd.h:45
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint namelen
Definition: glext.h:7232
GLenum const GLvoid * addr
Definition: glext.h:9621
GLboolean GLboolean g
Definition: glext.h:6204
#define NtCurrentTeb
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
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:3063
VOID WSPAPI SockProcessAsyncSelect(PSOCKET_INFORMATION Socket, PASYNC_DATA AsyncData)
Definition: dllmain.c:3879
DWORD SockReceiveBufferWindow
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:2785
VOID WSPAPI SockReleaseRwLockExclusive(IN PSOCK_RW_LOCK Lock)
HINSTANCE SockModuleHandle
LPWSPUPCALLTABLE SockUpcallTable
VOID WSPAPI SockAsyncSelectCompletion(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI WSPCancelBlockingCall(OUT LPINT lpErrno)
Definition: stubs.c:15
VOID WSPAPI SockSanInitialize(VOID)
VOID WSPAPI SockAcquireRwLockExclusive(IN PSOCK_RW_LOCK Lock)
INT WSPAPI WSPShutdown(IN SOCKET s, IN INT how, OUT LPINT lpErrno)
INT WSPAPI WSPSendDisconnect(IN SOCKET s, IN LPWSABUF lpOutboundDisconnectData, OUT LPINT lpErrno)
Definition: sndrcv.c:938
INT WSPAPI WSPCleanup(OUT LPINT lpErrno)
Definition: dllmain.c:3247
INT WSPAPI SockBuildSockaddr(OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength, IN PTRANSPORT_ADDRESS TdiAddress)
VOID WSPAPI SockIoCompletion(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, DWORD Reserved)
struct _SOCK_SHARED_INFO * PSOCK_SHARED_INFO
INT WSPAPI WSPEnumNetworkEvents(IN SOCKET s, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents, OUT LPINT lpErrno)
Definition: event.c:133
struct _SOCKET_INFORMATION * PSOCKET_INFORMATION
INT WSPAPI SockAsyncThread(PVOID ThreadParam)
Definition: dllmain.c:3654
LONG SockWspStartupCount
struct _WINSOCK_TEB_DATA * PWINSOCK_TEB_DATA
struct _WINSOCK_TEB_DATA WINSOCK_TEB_DATA
struct _SOCK_ICF_DATA * PSOCK_ICF_DATA
LONG gWSM_NSPStartupRef
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)
VOID WSPAPI NewIcfConnection(IN PSOCK_ICF_DATA IcfData)
VOID WSPAPI CloseIcfConnection(IN PSOCK_ICF_DATA IcfData)
struct _ASYNC_DATA ASYNC_DATA
PWAH_HANDLE_TABLE SockContextTable
PVOID WSPAPI SockInitializeHeap(IN HANDLE Heap, IN ULONG Flags, IN ULONG Size)
INT WSPAPI WSPCloseSocket(IN SOCKET s, OUT LPINT lpErrno)
Definition: dllmain.c:623
INT WSPAPI SockEventSelectHelper(IN PSOCKET_INFORMATION Socket, IN WSAEVENT EventObject, IN LONG Events)
VOID WSPAPI SockReleaseRwLockShared(IN PSOCK_RW_LOCK Lock)
INT WSPAPI SockGetTdiName(PINT AddressFamily, PINT SocketType, PINT Protocol, LPGUID ProviderId, GROUP Group, DWORD Flags, PUNICODE_STRING TransportName, PVOID *HelperDllContext, PHELPER_DATA *HelperDllData, PDWORD Events)
HANDLE SockSanCleanUpCompleteEvent
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)
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)
struct _SOCKET_INFORMATION SOCKET_INFORMATION
VOID WSPAPI SockCancelIo(IN SOCKET Handle)
enum _SOCKET_STATE SOCKET_STATE
CRITICAL_SECTION MSWSOCK_SocketLock
INT WSPAPI SockEnterApiSlow(OUT PWINSOCK_TEB_DATA *ThreadData)
INT WSPAPI WSPGetPeerName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
Definition: dllmain.c:2258
VOID WSPAPI SockProcessQueuedAsyncSelect(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
Definition: dllmain.c:3962
LONG SockProcessPendingAPCCount
BOOL WSPAPI MSWSOCK_Initialize(VOID)
BOOLEAN WSPAPI SockCheckAndInitAsyncSelectHelper(VOID)
BOOLEAN WSPAPI SockCheckAndReferenceAsyncThread(VOID)
SOCK_RW_LOCK SocketGlobalLock
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)
BOOL SockProcessTerminating
PVOID(NTAPI * PRTL_HEAP_ALLOCATE)(IN HANDLE Heap, IN ULONG Flags, IN ULONG Size)
Definition: msafdlib.h:182
BOOL WSPAPI MSAFD_SockThreadInitialize(VOID)
PRTL_HEAP_ALLOCATE SockAllocateHeapRoutine
INT WSPAPI WSPAsyncSelect(IN SOCKET s, IN HWND hWnd, IN UINT wMsg, IN LONG lEvent, OUT LPINT lpErrno)
Definition: sndrcv.c:17
struct _SOCK_RW_LOCK * PSOCK_RW_LOCK
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:2609
VOID WSPAPI SockHandleAsyncIndication(IN PASYNC_COMPLETION_ROUTINE Callback, IN PVOID Context, IN PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI SockLoadTransportMapping(PWSTR TransportName, PWINSOCK_MAPPING *Mapping)
Definition: helpers.c:161
INT WSPAPI SockSetHandleContext(IN PSOCKET_INFORMATION Socket)
BOOLEAN WSPAPI SockIsSocketConnected(IN PSOCKET_INFORMATION Socket)
struct _ASYNC_DATA * PASYNC_DATA
INT(WINAPI * PICF_CONNECT)(PVOID IcfData)
Definition: msafdlib.h:170
NTSTATUS WSPAPI SockInitializeRwLockAndSpinCount(IN PSOCK_RW_LOCK Lock, IN ULONG SpinCount)
INT WSPAPI WSPGetSockName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
Definition: dllmain.c:2156
ULONG SockBufferKeyTableSize
enum _SOCKET_STATE * PSOCKET_STATE
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
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:2361
INT WSPAPI NtStatusToSocketError(IN NTSTATUS Status)
VOID WSPAPI SockAcquireRwLockShared(IN PSOCK_RW_LOCK Lock)
HANDLE SockAsyncQueuePort
NTSTATUS WSPAPI SockDeleteRwLock(IN PSOCK_RW_LOCK Lock)
DWORD SockSendBufferWindow
INT WSPAPI WSPDuplicateSocket(IN SOCKET s, IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPINT lpErrno)
Definition: dllmain.c:449
LIST_ENTRY SockHelperDllListHead
INT WSPAPI SockLoadHelperDll(PWSTR TransportName, PWINSOCK_MAPPING Mapping, PHELPER_DATA *HelperDllData)
Definition: helpers.c:298
INT WSPAPI SockIsAddressConsistentWithConstrainedGroup(IN PSOCKET_INFORMATION Socket, IN GROUP Group, IN PSOCKADDR SocketAddress, IN INT SocketAddressLength)
struct _HELPER_DATA * PHELPER_DATA
INT WSPAPI WSPListen(IN SOCKET s, IN INT backlog, OUT LPINT lpErrno)
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)
INT WSPAPI SockReenableAsyncSelectEvent(IN PSOCKET_INFORMATION Socket, IN ULONG Event)
Definition: dllmain.c:3996
INT WSPAPI SockLoadTransportList(PWSTR *TransportList)
Definition: helpers.c:232
INT WSPAPI SockGetTdiHandles(IN PSOCKET_INFORMATION Socket)
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:3123
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
FORCEINLINE VOID WSPAPI SockDereferenceHelperDll(IN PHELPER_DATA Helper)
Definition: msafdlib.h:420
INT WSPAPI SockSetInformation(IN PSOCKET_INFORMATION Socket, IN ULONG AfdInformationClass, IN PBOOLEAN Boolean OPTIONAL, IN PULONG Ulong OPTIONAL, IN PLARGE_INTEGER LargeInteger OPTIONAL)
VOID(WSPAPI * PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
Definition: msafdlib.h:439
INT WSPAPI SockAsyncSelectHelper(IN PSOCKET_INFORMATION Socket, IN HWND hWnd, IN UINT wMsg, IN LONG Events)
SOCKET WSPAPI WSPAccept(IN SOCKET s, OUT LPSOCKADDR addr, IN OUT LPINT addrlen, IN LPCONDITIONPROC lpfnCondition, IN DWORD dwCallbackData, OUT LPINT lpErrno)
struct _SOCKET_CONTEXT SOCKET_CONTEXT
INT WSPAPI SockCreateAsyncQueuePort(VOID)
INT WSPAPI SockCloseSocket(IN PSOCKET_INFORMATION Socket)
VOID WSPAPI SockFreeHelperDll(IN PHELPER_DATA Helper)
BOOLEAN SockSanEnabled
LONG gWSM_NSPCallRef
INT WSPAPI WSPBind(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, OUT LPINT lpErrno)
BOOL WSPAPI SockWaitForSingleObject(IN HANDLE Handle, IN SOCKET SocketHandle, IN DWORD BlockingFlags, IN DWORD TimeoutFlags)
HANDLE SockPrivateHeap
BOOLEAN g_fRnrLockInit
PSOCKET_INFORMATION WSPAPI SockFindAndReferenceSocket(IN SOCKET Handle, IN BOOLEAN Import)
INT WSPAPI SockSocket(INT AddressFamily, INT SocketType, INT Protocol, LPGUID ProviderId, GROUP g, DWORD dwFlags, DWORD ProviderFlags, DWORD ServiceFlags, DWORD CatalogEntryId, PSOCKET_INFORMATION *NewSocket)
BOOL WSPAPI WSPGetQOSByName(IN SOCKET s, IN OUT LPWSABUF lpQOSName, OUT LPQOS lpQOS, OUT LPINT lpErrno)
Definition: stubs.c:26
HINSTANCE NlsMsgSourcemModuleHandle
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 WSPAPI SockGetInformation(IN PSOCKET_INFORMATION Socket, IN ULONG AfdInformationClass, IN PVOID ExtraData OPTIONAL, IN ULONG ExtraDataSize, IN OUT PBOOLEAN Boolean OPTIONAL, IN OUT PULONG Ulong OPTIONAL, IN OUT PLARGE_INTEGER LargeInteger OPTIONAL)
struct _SOCK_ICF_DATA SOCK_ICF_DATA
FORCEINLINE INT WSPAPI SockEnterApiFast(OUT PWINSOCK_TEB_DATA *ThreadData)
Definition: msafdlib.h:402
struct _SOCK_RW_LOCK SOCK_RW_LOCK
INT WSPAPI SockGetConnectData(IN PSOCKET_INFORMATION Socket, IN ULONG Ioctl, IN PVOID Buffer, IN ULONG BufferLength, OUT PULONG BufferReturned)
INT WSPAPI WSPEventSelect(IN SOCKET s, IN WSAEVENT hEventObject, IN LONG lNetworkEvents, OUT LPINT lpErrno)
Definition: event.c:17
struct _SOCK_SHARED_INFO SOCK_SHARED_INFO
VOID WSPAPI SockSanGetTcpipCatalogId(VOID)
struct _SOCKET_CONTEXT * PSOCKET_CONTEXT
PVOID SockBufferKeyTable
VOID WSPAPI SockDereferenceSocket(IN PSOCKET_INFORMATION Socket)
BOOL WSPAPI SockIsTripleInMapping(IN PWINSOCK_MAPPING Mapping, IN INT AddressFamily, OUT PBOOLEAN AfMatch, IN INT SocketType, OUT PBOOLEAN SockMatch, IN INT Protocol, OUT PBOOLEAN ProtoMatch)
WSAPROTOCOL_INFOW SockTcpProviderInfo
BOOLEAN SockAsyncSelectCalled
Definition: dllmain.c:29
INT WSPAPI WSPRecvDisconnect(IN SOCKET s, OUT LPWSABUF lpInboundDisconnectData, OUT LPINT lpErrno)
Definition: sndrcv.c:926
INT WSPAPI WSPSelect(IN INT nfds, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST LPTIMEVAL timeout, OUT LPINT lpErrno)
LONG SockAsyncThreadReferenceCount
struct _HELPER_DATA HELPER_DATA
@ SocketBound
Definition: msafdlib.h:29
@ SocketConnected
Definition: msafdlib.h:31
@ SocketUndefined
Definition: msafdlib.h:27
@ SocketClosed
Definition: msafdlib.h:32
@ SocketBoundUdp
Definition: msafdlib.h:30
@ SocketOpen
Definition: msafdlib.h:28
CRITICAL_SECTION g_RnrLock
INT WSPAPI SockBuildTdiAddress(OUT PTRANSPORT_ADDRESS TdiAddress, IN PSOCKADDR Sockaddr, IN INT SockaddrLength)
VOID WSPAPI InitializeIcfConnection(IN PSOCK_ICF_DATA IcfData)
INT WSPAPI SockNotifyHelperDll(IN PSOCKET_INFORMATION Socket, IN DWORD Event)
INT WSPAPI SockUpdateWindowSizes(IN PSOCKET_INFORMATION Socket, IN BOOLEAN Force)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
unsigned int UINT
Definition: ndis.h:50
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
Definition: iofuncs.h:727
_In_opt_ PSID Group
Definition: rtlfuncs.h:1658
#define CONST
Definition: pedump.c:81
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
AFD_POLL_INFO AsyncSelectInfo
Definition: msafd.h:133
DWORD SequenceNumber
Definition: msafd.h:131
struct _SOCKET_INFORMATION * ParentSocket
Definition: msafdlib.h:109
IO_STATUS_BLOCK IoStatusBlock
Definition: msafd.h:132
BOOLEAN UseDelayedAcceptance
Definition: helpers.h:20
INT MaxTDIAddressLength
Definition: helpers.h:19
PWSH_GET_SOCKADDR_TYPE WSHGetSockaddrType
Definition: helpers.h:28
PWSH_JOIN_LEAF WSHJoinLeaf
Definition: helpers.h:24
HANDLE hInstance
Definition: helpers.h:15
PWSH_GET_SOCKET_INFORMATION WSHGetSocketInformation
Definition: helpers.h:26
INT MinWSAddressLength
Definition: helpers.h:16
PWSH_STRING_TO_ADDRESS WSHStringToAddress
Definition: helpers.h:32
PWSH_ADDRESS_TO_STRING WSHAddressToString
Definition: helpers.h:31
PWSH_IOCTL WSHIoctl
Definition: helpers.h:33
PWSH_OPEN_SOCKET WSHOpenSocket
Definition: helpers.h:22
PWSH_SET_SOCKET_INFORMATION WSHSetSocketInformation
Definition: helpers.h:27
PWSH_NOTIFY WSHNotify
Definition: helpers.h:25
INT MaxWSAddressLength
Definition: helpers.h:17
PWSH_GET_BROADCAST_SOCKADDR WSHGetBroadcastSockaddr
Definition: helpers.h:30
PWINSOCK_MAPPING Mapping
Definition: helpers.h:21
INT MinTDIAddressLength
Definition: helpers.h:18
LONG RefCount
Definition: helpers.h:14
WCHAR TransportName[1]
Definition: helpers.h:34
LIST_ENTRY Helpers
Definition: helpers.h:13
PWSH_OPEN_SOCKET2 WSHOpenSocket2
Definition: helpers.h:23
PWSH_GET_WILDCARD_SOCKADDR WSHGetWildcardSockaddr
Definition: helpers.h:29
Definition: typedefs.h:120
SOCK_SHARED_INFO SharedData
Definition: msafd.h:121
ULONG Padding
Definition: msafd.h:123
SOCKADDR RemoteAddress
Definition: msafd.h:125
SOCKADDR LocalAddress
Definition: msafd.h:124
ULONG SizeOfHelperData
Definition: msafd.h:122
PVOID HelperContext
Definition: msafd.h:104
PASYNC_DATA AsyncData
Definition: msafdlib.h:133
SOCK_SHARED_INFO SharedData
Definition: msafdlib.h:124
WSH_HANDLE WshContext
Definition: msafdlib.h:118
LONG NetworkEvents
Definition: msafd.h:111
HANDLE TdiConnectionHandle
Definition: msafd.h:108
PSOCKADDR LocalAddress
Definition: msafd.h:105
CRITICAL_SECTION Lock
Definition: msafd.h:112
HANDLE EventObject
Definition: msafd.h:110
PHELPER_DATA HelperData
Definition: msafd.h:103
PSOCKADDR RemoteAddress
Definition: msafd.h:106
SOCKET Handle
Definition: msafd.h:99
HANDLE TdiAddressHandle
Definition: msafd.h:107
DWORD HelperEvents
Definition: msafd.h:102
HINSTANCE DllHandle
Definition: msafdlib.h:178
PVOID IcfOpenDynamicFwPort
Definition: msafdlib.h:175
HANDLE IcfHandle
Definition: msafdlib.h:174
PICF_CONNECT IcfConnect
Definition: msafdlib.h:176
PVOID IcfDisconnect
Definition: msafdlib.h:177
HANDLE WriterWaitEvent
Definition: msafdlib.h:154
volatile LONG ReaderCount
Definition: msafdlib.h:153
RTL_CRITICAL_SECTION Lock
Definition: msafdlib.h:155
DWORD GroupType
Definition: msafd.h:85
LONG AsyncDisabledEvents
Definition: msafd.h:93
INT SizeOfLocalAddress
Definition: msafd.h:59
ULONG RecvTimeout
Definition: msafd.h:63
SOCKET_STATE State
Definition: msafd.h:54
INT AddressFamily
Definition: msafd.h:56
ULONG SizeOfSendBuffer
Definition: msafd.h:65
LONG AsyncEvents
Definition: msafd.h:92
ULONG SizeOfRecvBuffer
Definition: msafd.h:64
INT SocketLastError
Definition: msafd.h:87
struct linger LingerData
Definition: msafd.h:61
DWORD SequenceNumber
Definition: msafd.h:90
DWORD ProviderFlags
Definition: msafd.h:83
INT SizeOfRemoteAddress
Definition: msafd.h:60
ULONG SendTimeout
Definition: msafd.h:62
INT GroupPriority
Definition: msafd.h:86
INT SocketType
Definition: msafd.h:57
LONG Unknown
Definition: msafd.h:89
DWORD ServiceFlags1
Definition: msafd.h:82
GROUP GroupID
Definition: msafd.h:84
DWORD CatalogEntryId
Definition: msafdlib.h:66
DWORD CreateFlags
Definition: msafd.h:81
HANDLE EventHandle
Definition: msafdlib.h:160
PAFD_ACCEPT_DATA AcceptData
Definition: msafdlib.h:162
PVOID RnrThreadData
Definition: msafdlib.h:166
BOOLEAN CancelIo
Definition: msafdlib.h:164
SOCKET SocketHandle
Definition: msafdlib.h:161
Definition: winsock.h:66
Definition: name.c:39
Definition: dhcpd.h:245
HANDLE lEvent
Definition: tftpd.cpp:56
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
unsigned long Ulong
Definition: utypes.h:42
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700
int * LPINT
Definition: windef.h:178
int * PINT
Definition: windef.h:177
#define WINAPI
Definition: msvc.h:6
unsigned int GROUP
Definition: winsock2.h:640
DWORD WSAEVENT
Definition: winsock2.h:606
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
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
UINT_PTR SOCKET
Definition: winsock.h:47
#define WSPAPI
Definition: ws2spi.h:39
INT(WINAPI * PWSH_GET_BROADCAST_SOCKADDR)(PVOID, PSOCKADDR, PINT)
Definition: wsahelp.h:69
INT(WINAPI * PWSH_GET_WILDCARD_SOCKADDR)(PVOID, PSOCKADDR, PINT)
Definition: wsahelp.h:73
INT(WINAPI * PWSH_SET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, INT)
Definition: wsahelp.h:83
INT(WINAPI * PWSH_GET_SOCKADDR_TYPE)(PSOCKADDR, DWORD, PSOCKADDR_INFO)
Definition: wsahelp.h:71
INT(WINAPI * PWSH_OPEN_SOCKET2)(PINT, PINT, PINT, GROUP, DWORD, PUNICODE_STRING, PVOID *, PDWORD)
Definition: wsahelp.h:82
INT(WINAPI * PWSH_NOTIFY)(PVOID, SOCKET, HANDLE, HANDLE, DWORD)
Definition: wsahelp.h:80
INT(WINAPI * PWSH_JOIN_LEAF)(PVOID, SOCKET, HANDLE, HANDLE, PVOID, SOCKET, PSOCKADDR, DWORD, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD)
Definition: wsahelp.h:78
INT(WINAPI * PWSH_STRING_TO_ADDRESS)(LPWSTR, DWORD, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPDWORD)
Definition: wsahelp.h:84
INT(WINAPI * PWSH_OPEN_SOCKET)(PINT, PINT, PINT, PUNICODE_STRING, PVOID, PDWORD)
Definition: wsahelp.h:81
INT(WINAPI * PWSH_IOCTL)(PVOID, SOCKET, HANDLE, HANDLE, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE, LPBOOL)
Definition: wsahelp.h:76
INT(WINAPI * PWSH_ADDRESS_TO_STRING)(LPSOCKADDR, INT, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD)
Definition: wsahelp.h:67
INT(WINAPI * PWSH_GET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, LPINT)
Definition: wsahelp.h:72
_In_ USHORT SocketType
Definition: wsk.h:182
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175