ReactOS 0.4.16-dev-340-g0540c21
ws2san.h
Go to the documentation of this file.
1/*
2 * ws2san.h
3 *
4 * WinSock Direct (SAN) support
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#pragma once
24
25#ifndef _WS2SAN_H_
26#define _WS2SAN_H_
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define SO_MAX_RDMA_SIZE 0x700D
33#define SO_RDMA_THRESHOLD_SIZE 0x700E
34
35#define MEM_READ 1
36#define MEM_WRITE 2
37#define MEM_READWRITE 3
38
39#define WSAID_REGISTERMEMORY \
40 {0xC0B422F5, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
41
42#define WSAID_DEREGISTERMEMORY \
43 {0xC0B422F6, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
44
45#define WSAID_REGISTERRDMAMEMORY \
46 {0xC0B422F7, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
47
48#define WSAID_DEREGISTERRDMAMEMORY \
49 {0xC0B422F8, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
50
51#define WSAID_RDMAWRITE \
52 {0xC0B422F9, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
53
54#define WSAID_RDMAREAD \
55 {0xC0B422FA, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
56
57#if(_WIN32_WINNT >= 0x0501)
58#define WSAID_MEMORYREGISTRATIONCACHECALLBACK \
59 {0xE5DA4AF8, 0xD824, 0x48CD, {0xA7, 0x99, 0x63, 0x37, 0xA9, 0x8E, 0xD2, 0xAF}}
60#endif
61
62typedef struct _WSPUPCALLTABLEEX {
80
81typedef struct _WSABUFEX {
86
87typedef
91 _In_ WORD wVersionRequested,
92 _Out_ LPWSPDATA lpWSPData,
93 _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
94 _In_ LPWSPUPCALLTABLEEX lpUpcallTable,
95 _Out_ LPWSPPROC_TABLE lpProcTable);
96
97typedef
101 _In_ SOCKET s,
102 _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
103 _In_ DWORD dwBufferLength,
105 _Out_ LPINT lpErrno);
106
107typedef int
109 _In_ SOCKET s,
111 _Out_ LPINT lpErrno);
112
113typedef
117 _In_ SOCKET s,
118 _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
119 _In_ DWORD dwBufferLength,
121 _Out_writes_bytes_(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
122 _Inout_ LPDWORD lpdwDescriptorLength,
123 _Out_ LPINT lpErrno);
124
125typedef int
127 _In_ SOCKET s,
128 _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
129 _In_ DWORD dwDescriptorLength,
130 _Out_ LPINT lpErrno);
131
132typedef int
134 _In_ SOCKET s,
135 _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers,
136 _In_ DWORD dwBufferCount,
137 _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor,
138 _In_ DWORD dwTargetDescriptorLength,
139 _In_ DWORD dwTargetBufferOffset,
140 _Out_ LPDWORD lpdwNumberOfBytesWritten,
144 _In_ LPWSATHREADID lpThreadId,
145 _Out_ LPINT lpErrno);
146
147typedef int
149 _In_ SOCKET s,
150 _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers,
151 _In_ DWORD dwBufferCount,
152 _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor,
153 _In_ DWORD dwTargetDescriptorLength,
154 _In_ DWORD dwTargetBufferOffset,
155 _Out_ LPDWORD lpdwNumberOfBytesRead,
159 _In_ LPWSATHREADID lpThreadId,
160 _Out_ LPINT lpErrno);
161
162#if(_WIN32_WINNT >= 0x0501)
163typedef
165int
166(WSPAPI *LPFN_WSPMEMORYREGISTRATIONCACHECALLBACK)(
167 _In_reads_bytes_(Size) PVOID lpvAddress,
169 _Out_ LPINT lpErrno);
170#endif
171
173int
174WSPAPI
176 _In_ WORD wVersionRequested,
177 _Out_ LPWSPDATA lpWSPData,
178 _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
179 _In_ LPWSPUPCALLTABLEEX lpUpcallTable,
180 _Out_ LPWSPPROC_TABLE lpProcTable);
181
183HANDLE
184WSPAPI
186 _In_ SOCKET s,
187 _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
188 _In_ DWORD dwBufferLength,
190 _Out_ LPINT lpErrno);
191
192int
193WSPAPI
195 _In_ SOCKET s,
197 _Out_ LPINT lpErrno);
198
200int
201WSPAPI
203 _In_ SOCKET s,
204 _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
205 _In_ DWORD dwBufferLength,
207 _Out_writes_bytes_(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
208 _Inout_ LPDWORD lpdwDescriptorLength,
209 _Out_ LPINT lpErrno);
210
211int
212WSPAPI
214 _In_ SOCKET s,
215 _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
216 _In_ DWORD dwDescriptorLength,
217 _Out_ LPINT lpErrno);
218
219int
220WSPAPI
222 _In_ SOCKET s,
223 _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers,
224 _In_ DWORD dwBufferCount,
225 _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor,
226 _In_ DWORD dwTargetDescriptorLength,
227 _In_ DWORD dwTargetBufferOffset,
228 _Out_ LPDWORD lpdwNumberOfBytesWritten,
232 _In_ LPWSATHREADID lpThreadId,
233 _Out_ LPINT lpErrno);
234
235int
236WSPAPI
238 _In_ SOCKET s,
239 _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers,
240 _In_ DWORD dwBufferCount,
241 _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor,
242 _In_ DWORD dwTargetDescriptorLength,
243 _In_ DWORD dwTargetBufferOffset,
244 _Out_ LPDWORD lpdwNumberOfBytesRead,
248 _In_ LPWSATHREADID lpThreadId,
249 _Out_ LPINT lpErrno);
250
251#if(_WIN32_WINNT >= 0x0501)
253int
254WSPAPI
255WSPMemoryRegistrationCacheCallback(
256 _In_reads_bytes_(Size) PVOID lpvAddress,
258 _Out_ LPINT lpErrno);
259#endif
260
261#ifdef __cplusplus
262}
263#endif
264
265#endif /* _WS2SAN_H_ */
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define FAR
Definition: zlib.h:34
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned long u_long
Definition: linux.h:269
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
ULONG Handle
Definition: gdb_input.c:15
GLdouble s
Definition: gl.h:2039
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _Inout_
Definition: no_sal2.h:162
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
Definition: ws2spi.h:46
u_long len
Definition: ws2san.h:82
_Field_size_bytes_(len) char FAR *buf
HANDLE handle
Definition: ws2san.h:84
LPWPUQUEUEAPC lpWPUQueueApc
Definition: ws2san.h:73
LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle
Definition: ws2san.h:66
LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback
Definition: ws2san.h:71
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest
Definition: ws2san.h:78
LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext
Definition: ws2san.h:72
LPWPUPOSTMESSAGE lpWPUPostMessage
Definition: ws2san.h:70
LPWPUSETEVENT lpWPUSetEvent
Definition: ws2san.h:75
LPWPUCREATEEVENT lpWPUCreateEvent
Definition: ws2san.h:65
LPWPURESETEVENT lpWPUResetEvent
Definition: ws2san.h:74
LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle
Definition: ws2san.h:69
LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle
Definition: ws2san.h:64
LPWPUCLOSETHREAD lpWPUCloseThread
Definition: ws2san.h:77
LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread
Definition: ws2san.h:76
LPWPUCLOSEEVENT lpWPUCloseEvent
Definition: ws2san.h:63
LPWPUFDISSET lpWPUFDIsSet
Definition: ws2san.h:67
LPWPUGETPROVIDERPATH lpWPUGetProviderPath
Definition: ws2san.h:68
PVOID HANDLE
Definition: typedefs.h:73
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
int * LPINT
Definition: windef.h:178
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
UINT_PTR SOCKET
Definition: winsock.h:47
struct _WSPUPCALLTABLEEX * LPWSPUPCALLTABLEEX
int WSPAPI WSPRdmaWrite(_In_ SOCKET s, _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers, _In_ DWORD dwBufferCount, _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, _In_ DWORD dwTargetDescriptorLength, _In_ DWORD dwTargetBufferOffset, _Out_ LPDWORD lpdwNumberOfBytesWritten, _In_ DWORD dwFlags, _In_opt_ LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, _In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
int(WSPAPI * LPFN_WSPDEREGISTERMEMORY)(_In_ SOCKET s, _In_ HANDLE Handle, _Out_ LPINT lpErrno)
Definition: ws2san.h:108
int WSPAPI WSPDeregisterRdmaMemory(_In_ SOCKET s, _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _In_ DWORD dwDescriptorLength, _Out_ LPINT lpErrno)
struct _WSABUFEX * LPWSABUFEX
struct _WSPUPCALLTABLEEX WSPUPCALLTABLEEX
int WSPAPI WSPDeregisterMemory(_In_ SOCKET s, _In_ HANDLE Handle, _Out_ LPINT lpErrno)
int WSPAPI WSPRdmaRead(_In_ SOCKET s, _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers, _In_ DWORD dwBufferCount, _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, _In_ DWORD dwTargetDescriptorLength, _In_ DWORD dwTargetBufferOffset, _Out_ LPDWORD lpdwNumberOfBytesRead, _In_ DWORD dwFlags, _In_opt_ LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, _In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
_Must_inspect_result_ HANDLE WSPAPI WSPRegisterMemory(_In_ SOCKET s, _In_reads_bytes_(dwBufferLength) PVOID lpBuffer, _In_ DWORD dwBufferLength, _In_ DWORD dwFlags, _Out_ LPINT lpErrno)
_Must_inspect_result_ HANDLE(WSPAPI * LPFN_WSPREGISTERMEMORY)(_In_ SOCKET s, _In_reads_bytes_(dwBufferLength) PVOID lpBuffer, _In_ DWORD dwBufferLength, _In_ DWORD dwFlags, _Out_ LPINT lpErrno)
Definition: ws2san.h:100
struct _WSABUFEX WSABUFEX
int(WSPAPI * LPFN_WSPDEREGISTERRDMAMEMORY)(_In_ SOCKET s, _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _In_ DWORD dwDescriptorLength, _Out_ LPINT lpErrno)
Definition: ws2san.h:126
int(WSPAPI * LPFN_WSPRDMAREAD)(_In_ SOCKET s, _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers, _In_ DWORD dwBufferCount, _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, _In_ DWORD dwTargetDescriptorLength, _In_ DWORD dwTargetBufferOffset, _Out_ LPDWORD lpdwNumberOfBytesRead, _In_ DWORD dwFlags, _In_opt_ LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, _In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2san.h:148
_Must_inspect_result_ int(WSPAPI * LPWSPSTARTUPEX)(_In_ WORD wVersionRequested, _Out_ LPWSPDATA lpWSPData, _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo, _In_ LPWSPUPCALLTABLEEX lpUpcallTable, _Out_ LPWSPPROC_TABLE lpProcTable)
Definition: ws2san.h:90
_Must_inspect_result_ int WSPAPI WSPStartupEx(_In_ WORD wVersionRequested, _Out_ LPWSPDATA lpWSPData, _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo, _In_ LPWSPUPCALLTABLEEX lpUpcallTable, _Out_ LPWSPPROC_TABLE lpProcTable)
int(WSPAPI * LPFN_WSPRDMAWRITE)(_In_ SOCKET s, _In_reads_(dwBufferCount) LPWSABUFEX lpBuffers, _In_ DWORD dwBufferCount, _In_reads_bytes_(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, _In_ DWORD dwTargetDescriptorLength, _In_ DWORD dwTargetBufferOffset, _Out_ LPDWORD lpdwNumberOfBytesWritten, _In_ DWORD dwFlags, _In_opt_ LPWSAOVERLAPPED lpOverlapped, _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, _In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2san.h:133
_Must_inspect_result_ int(WSPAPI * LPFN_WSPREGISTERRDMAMEMORY)(_In_ SOCKET s, _In_reads_bytes_(dwBufferLength) PVOID lpBuffer, _In_ DWORD dwBufferLength, _In_ DWORD dwFlags, _Out_writes_bytes_(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _Inout_ LPDWORD lpdwDescriptorLength, _Out_ LPINT lpErrno)
Definition: ws2san.h:116
_Must_inspect_result_ int WSPAPI WSPRegisterRdmaMemory(_In_ SOCKET s, _In_reads_bytes_(dwBufferLength) PVOID lpBuffer, _In_ DWORD dwBufferLength, _In_ DWORD dwFlags, _Out_writes_bytes_(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _Inout_ LPDWORD lpdwDescriptorLength, _Out_ LPINT lpErrno)
int(WSPAPI * LPWPUOPENCURRENTTHREAD)(_Out_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2spi.h:398
#define WSPAPI
Definition: ws2spi.h:39
BOOL(WSPAPI * LPWPURESETEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:388
BOOL(WSPAPI * LPWPUPOSTMESSAGE)(_In_ HWND hWnd, _In_ UINT Msg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: ws2spi.h:361
SOCKET(WSPAPI * LPWPUMODIFYIFSHANDLE)(_In_ DWORD dwCatalogEntryId, _In_ SOCKET ProposedHandle, _Out_ LPINT lpErrno)
Definition: ws2spi.h:355
int(WSPAPI * LPWPUQUERYSOCKETHANDLECONTEXT)(_In_ SOCKET s, _Out_ PDWORD_PTR lpContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:375
int(WSPAPI * LPWPUCLOSETHREAD)(_In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2spi.h:403
WSAEVENT(WSPAPI * LPWPUCREATEEVENT)(_Out_ LPINT lpErrno)
Definition: ws2spi.h:331
BOOL(WSPAPI * LPWPUSETEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:393
int(WSPAPI * LPWPUFDISSET)(_In_ SOCKET s, _In_ fd_set FAR *fdset)
Definition: ws2spi.h:343
_Must_inspect_result_ SOCKET(WSPAPI * LPWPUCREATESOCKETHANDLE)(_In_ DWORD dwCatalogEntryId, _In_ DWORD_PTR dwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:337
int(WSPAPI * LPWPUCLOSESOCKETHANDLE)(_In_ SOCKET s, _Out_ LPINT lpErrno)
Definition: ws2spi.h:326
int(WSPAPI * LPWPUQUEUEAPC)(_In_ LPWSATHREADID lpThreadId, _In_ LPWSAUSERAPC lpfnUserApc, _In_ DWORD_PTR dwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:381
int(WSPAPI * LPWPUQUERYBLOCKINGCALLBACK)(_In_ DWORD dwCatalogEntryId, _Out_ LPBLOCKINGCALLBACK FAR *lplpfnCallback, _Out_ PDWORD_PTR lpdwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:368
int(WSPAPI * LPWPUGETPROVIDERPATH)(_In_ LPGUID lpProviderId, _Out_writes_(*lpProviderDllPathLen) WCHAR FAR *lpszProviderDllPath, _Inout_ LPINT lpProviderDllPathLen, _Out_ LPINT lpErrno)
Definition: ws2spi.h:348
BOOL(WSPAPI * LPWPUCLOSEEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:321
int(WSPAPI * LPWPUCOMPLETEOVERLAPPEDREQUEST)(_In_ SOCKET s, _Inout_ LPWSAOVERLAPPED lpOverlapped, _In_ DWORD dwError, _In_ DWORD cbTransferred, _Out_ LPINT lpErrno)
Definition: ws2spi.h:408