ReactOS  0.4.15-dev-506-ga3ec01c
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
29 extern "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 
62 typedef struct _WSPUPCALLTABLEEX {
80 
81 typedef struct _WSABUFEX {
86 
87 typedef
89 int
91  _In_ WORD wVersionRequested,
92  _Out_ LPWSPDATA lpWSPData,
93  _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
94  _In_ LPWSPUPCALLTABLEEX lpUpcallTable,
95  _Out_ LPWSPPROC_TABLE lpProcTable);
96 
97 typedef
99 HANDLE
101  _In_ SOCKET s,
102  _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
103  _In_ DWORD dwBufferLength,
105  _Out_ LPINT lpErrno);
106 
107 typedef int
109  _In_ SOCKET s,
111  _Out_ LPINT lpErrno);
112 
113 typedef
115 int
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 
125 typedef int
127  _In_ SOCKET s,
128  _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
129  _In_ DWORD dwDescriptorLength,
130  _Out_ LPINT lpErrno);
131 
132 typedef 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,
143  _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
144  _In_ LPWSATHREADID lpThreadId,
145  _Out_ LPINT lpErrno);
146 
147 typedef 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,
158  _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
159  _In_ LPWSATHREADID lpThreadId,
160  _Out_ LPINT lpErrno);
161 
162 #if(_WIN32_WINNT >= 0x0501)
163 typedef
165 int
166 (WSPAPI *LPFN_WSPMEMORYREGISTRATIONCACHECALLBACK)(
167  _In_reads_bytes_(Size) PVOID lpvAddress,
168  _In_ SIZE_T Size,
169  _Out_ LPINT lpErrno);
170 #endif
171 
173 int
174 WSPAPI
176  _In_ WORD wVersionRequested,
177  _Out_ LPWSPDATA lpWSPData,
178  _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
179  _In_ LPWSPUPCALLTABLEEX lpUpcallTable,
180  _Out_ LPWSPPROC_TABLE lpProcTable);
181 
183 HANDLE
184 WSPAPI
186  _In_ SOCKET s,
187  _In_reads_bytes_(dwBufferLength) PVOID lpBuffer,
188  _In_ DWORD dwBufferLength,
190  _Out_ LPINT lpErrno);
191 
192 int
193 WSPAPI
195  _In_ SOCKET s,
197  _Out_ LPINT lpErrno);
198 
200 int
201 WSPAPI
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 
211 int
212 WSPAPI
214  _In_ SOCKET s,
215  _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor,
216  _In_ DWORD dwDescriptorLength,
217  _Out_ LPINT lpErrno);
218 
219 int
220 WSPAPI
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,
231  _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
232  _In_ LPWSATHREADID lpThreadId,
233  _Out_ LPINT lpErrno);
234 
235 int
236 WSPAPI
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,
247  _In_opt_ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
248  _In_ LPWSATHREADID lpThreadId,
249  _Out_ LPINT lpErrno);
250 
251 #if(_WIN32_WINNT >= 0x0501)
253 int
254 WSPAPI
255 WSPMemoryRegistrationCacheCallback(
256  _In_reads_bytes_(Size) PVOID lpvAddress,
257  _In_ SIZE_T Size,
258  _Out_ LPINT lpErrno);
259 #endif
260 
261 #ifdef __cplusplus
262 }
263 #endif
264 
265 #endif /* _WS2SAN_H_ */
LPWPURESETEVENT lpWPUResetEvent
Definition: ws2san.h:74
#define _Must_inspect_result_
Definition: no_sal2.h:314
unsigned long u_long
Definition: linux.h:269
LPWPUGETPROVIDERPATH lpWPUGetProviderPath
Definition: ws2san.h:68
LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread
Definition: ws2san.h:76
_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 WSPDeregisterMemory(_In_ SOCKET s, _In_ HANDLE Handle, _Out_ LPINT lpErrno)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _In_reads_(size)
Definition: no_sal2.h:228
HANDLE handle
Definition: ws2san.h:84
int(WSPAPI * LPWPUCLOSETHREAD)(_In_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2spi.h:403
BOOL(WSPAPI * LPWPUCLOSEEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:321
_Must_inspect_result_ SOCKET(WSPAPI * LPWPUCREATESOCKETHANDLE)(_In_ DWORD dwCatalogEntryId, _In_ DWORD_PTR dwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:337
LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle
Definition: ws2san.h:69
LPWPUCREATEEVENT lpWPUCreateEvent
Definition: ws2san.h:65
LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext
Definition: ws2san.h:72
int WSPAPI WSPDeregisterRdmaMemory(_In_ SOCKET s, _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _In_ DWORD dwDescriptorLength, _Out_ LPINT lpErrno)
int(WSPAPI * LPWPUGETPROVIDERPATH)(_In_ LPGUID lpProviderId, _Out_writes_(*lpProviderDllPathLen) WCHAR FAR *lpszProviderDllPath, _Inout_ LPINT lpProviderDllPathLen, _Out_ LPINT lpErrno)
Definition: ws2spi.h:348
BOOL(WSPAPI * LPWPUSETEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:393
#define _In_opt_
Definition: no_sal2.h:213
int(WSPAPI * LPWPUFDISSET)(_In_ SOCKET s, _In_ fd_set FAR *fdset)
Definition: ws2spi.h:343
LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle
Definition: ws2san.h:66
struct _WSABUFEX * LPWSABUFEX
LPWPUSETEVENT lpWPUSetEvent
Definition: ws2san.h:75
#define FAR
Definition: guiddef.h:36
int(WSPAPI * LPWPUOPENCURRENTTHREAD)(_Out_ LPWSATHREADID lpThreadId, _Out_ LPINT lpErrno)
Definition: ws2spi.h:398
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
LPWPUPOSTMESSAGE lpWPUPostMessage
Definition: ws2san.h:70
Definition: ws2spi.h:46
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
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)
struct _WSABUFEX WSABUFEX
int(WSPAPI * LPWPUCLOSESOCKETHANDLE)(_In_ SOCKET s, _Out_ LPINT lpErrno)
Definition: ws2spi.h:326
LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback
Definition: ws2san.h:71
_In_ HANDLE Handle
Definition: extypes.h:390
WSAEVENT(WSPAPI * LPWPUCREATEEVENT)(_Out_ LPINT lpErrno)
Definition: ws2spi.h:331
unsigned short WORD
Definition: ntddk_ex.h:93
_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
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:72
#define _Inout_
Definition: no_sal2.h:244
_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_ HANDLE WSPAPI WSPRegisterMemory(_In_ SOCKET s, _In_reads_bytes_(dwBufferLength) PVOID lpBuffer, _In_ DWORD dwBufferLength, _In_ DWORD dwFlags, _Out_ LPINT lpErrno)
u_long len
Definition: ws2san.h:82
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
_Field_size_bytes_(len) char FAR *buf
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
BOOL(WSPAPI * LPWPURESETEVENT)(_In_ WSAEVENT hEvent, _Out_ LPINT lpErrno)
Definition: ws2spi.h:388
int(WSPAPI * LPWPUCOMPLETEOVERLAPPEDREQUEST)(_In_ SOCKET s, _Inout_ LPWSAOVERLAPPED lpOverlapped, _In_ DWORD dwError, _In_ DWORD cbTransferred, _Out_ LPINT lpErrno)
Definition: ws2spi.h:408
LPWPUCLOSETHREAD lpWPUCloseThread
Definition: ws2san.h:77
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
struct _WSPUPCALLTABLEEX * LPWSPUPCALLTABLEEX
#define _In_
Definition: no_sal2.h:204
ULONG_PTR SIZE_T
Definition: typedefs.h:79
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)
LPWPUCLOSEEVENT lpWPUCloseEvent
Definition: ws2san.h:63
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
struct _WSPUPCALLTABLEEX WSPUPCALLTABLEEX
int(WSPAPI * LPWPUQUERYSOCKETHANDLECONTEXT)(_In_ SOCKET s, _Out_ PDWORD_PTR lpContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:375
LPWPUQUEUEAPC lpWPUQueueApc
Definition: ws2san.h:73
BOOL(WSPAPI * LPWPUPOSTMESSAGE)(_In_ HWND hWnd, _In_ UINT Msg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: ws2spi.h:361
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
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:58
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest
Definition: ws2san.h:78
LPWPUFDISSET lpWPUFDIsSet
Definition: ws2san.h:67
_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
int(WSPAPI * LPFN_WSPDEREGISTERRDMAMEMORY)(_In_ SOCKET s, _In_reads_bytes_(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, _In_ DWORD dwDescriptorLength, _Out_ LPINT lpErrno)
Definition: ws2san.h:126
_Must_inspect_result_ int WSPAPI WSPStartupEx(_In_ WORD wVersionRequested, _Out_ LPWSPDATA lpWSPData, _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo, _In_ LPWSPUPCALLTABLEEX lpUpcallTable, _Out_ LPWSPPROC_TABLE lpProcTable)
UINT_PTR SOCKET
Definition: winsock.h:47
int(WSPAPI * LPFN_WSPDEREGISTERMEMORY)(_In_ SOCKET s, _In_ HANDLE Handle, _Out_ LPINT lpErrno)
Definition: ws2san.h:108
int(WSPAPI * LPWPUQUEUEAPC)(_In_ LPWSATHREADID lpThreadId, _In_ LPWSAUSERAPC lpfnUserApc, _In_ DWORD_PTR dwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:381
LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle
Definition: ws2san.h:64
SOCKET(WSPAPI * LPWPUMODIFYIFSHANDLE)(_In_ DWORD dwCatalogEntryId, _In_ SOCKET ProposedHandle, _Out_ LPINT lpErrno)
Definition: ws2spi.h:355
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int * LPINT
Definition: windef.h:178
#define WSPAPI
Definition: ws2spi.h:39
int(WSPAPI * LPWPUQUERYBLOCKINGCALLBACK)(_In_ DWORD dwCatalogEntryId, _Out_ LPBLOCKINGCALLBACK FAR *lplpfnCallback, _Out_ PDWORD_PTR lpdwContext, _Out_ LPINT lpErrno)
Definition: ws2spi.h:368