4 * WinSock Direct (SAN) support
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
27 #pragma GCC system_header
38 #define WSPAPI STDCALL
40 /* FIXME: Unknown definitions */
41 typedef PVOID LPWSPDATA
;
42 typedef PDWORD LPWSATHREADID
;
43 typedef PVOID LPWSPPROC_TABLE
;
44 typedef struct _WSPUPCALLTABLEEX WSPUPCALLTABLEEX
;
45 typedef WSPUPCALLTABLEEX
*LPWSPUPCALLTABLEEX
;
47 #define SO_MAX_RDMA_SIZE 0x700D
48 #define SO_RDMA_THRESHOLD_SIZE 0x700E
50 #define WSAID_REGISTERMEMORY \
51 {0xC0B422F5, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
53 #define WSAID_DEREGISTERMEMORY \
54 {0xC0B422F6, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
56 #define WSAID_REGISTERRDMAMEMORY \
57 {0xC0B422F7, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
59 #define WSAID_DEREGISTERRDMAMEMORY \
60 {0xC0B422F8, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
62 #define WSAID_RDMAWRITE \
63 {0xC0B422F9, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
65 #define WSAID_RDMAREAD \
66 {0xC0B422FA, 0xF58C, 0x11d1, {0xAD, 0x6C, 0x00, 0xC0, 0x4F, 0xA3, 0x4A, 0x2D}}
68 #define WSAID_MEMORYREGISTRATIONCACHECALLBACK \
69 {0xE5DA4AF8, 0xD824, 0x48CD, {0xA7, 0x99, 0x63, 0x37, 0xA9, 0x8E, 0xD2, 0xAF}}
71 typedef struct _WSABUFEX
{
75 } WSABUFEX
, FAR
* LPWSABUFEX
;
78 typedef struct _WSPUPCALLTABLEEX
{
79 LPWPUCLOSEEVENT lpWPUCloseEvent
;
80 LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle
;
81 LPWPUCREATEEVENT lpWPUCreateEvent
;
82 LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle
;
83 LPWPUFDISSET lpWPUFDIsSet
;
84 LPWPUGETPROVIDERPATH lpWPUGetProviderPath
;
85 LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle
;
86 LPWPUPOSTMESSAGE lpWPUPostMessage
;
87 LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback
;
88 LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext
;
89 LPWPUQUEUEAPC lpWPUQueueApc
;
90 LPWPURESETEVENT lpWPUResetEvent
;
91 LPWPUSETEVENT lpWPUSetEvent
;
92 LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread
;
93 LPWPUCLOSETHREAD lpWPUCloseThread
;
94 LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest
;
95 } WSPUPCALLTABLEEX
, FAR
* LPWSPUPCALLTABLEEX
;
100 /*IN*/ WORD wVersionRequested
,
101 /*OUT*/ LPWSPDATA lpWSPData
,
102 /*IN*/ LPWSAPROTOCOL_INFOW lpProtocolInfo
,
103 /*IN*/ LPWSPUPCALLTABLEEX lpUpcallTable
,
104 /*OUT*/ LPWSPPROC_TABLE lpProcTable
);
108 /*IN*/ WORD wVersionRequested
,
109 /*OUT*/ LPWSPDATA lpWSPData
,
110 /*IN*/ LPWSAPROTOCOL_INFOW lpProtocolInfo
,
111 /*IN*/ LPWSPUPCALLTABLEEX lpUpcallTable
,
112 /*OUT*/ LPWSPPROC_TABLE lpProcTable
);
116 #define MEM_READWRITE 3
121 /*IN*/ HANDLE Handle
,
122 /*OUT*/ LPINT lpErrno
);
125 (*LPFN_WSPDEREGISTERMEMORY
)(
127 /*IN*/ HANDLE Handle
,
128 /*OUT*/ LPINT lpErrno
);
131 WSPDeregisterRdmaMemory(
133 /*IN*/ LPVOID lpRdmaBufferDescriptor
,
134 /*IN*/ DWORD dwDescriptorLength
,
135 /*OUT*/ LPINT lpErrno
);
138 (*LPFN_WSPDEREGISTERRDMAMEMORY
)(
140 /*IN*/ LPVOID lpRdmaBufferDescriptor
,
141 /*IN*/ DWORD dwDescriptorLength
,
142 /*OUT*/ LPINT lpErrno
);
145 WSPMemoryRegistrationCacheCallback(
146 /*IN*/ PVOID lpvAddress
,
148 /*OUT*/ LPINT lpErrno
);
151 (*LPFN_WSPMEMORYREGISTRATIONCACHECALLBACK
)(
152 /*IN*/ PVOID lpvAddress
,
154 /*OUT*/ LPINT lpErrno
);
159 /*IN*/ LPWSABUFEX lpBuffers
,
160 /*IN*/ DWORD dwBufferCount
,
161 /*IN*/ LPVOID lpTargetBufferDescriptor
,
162 /*IN*/ DWORD dwTargetDescriptorLength
,
163 /*IN*/ DWORD dwTargetBufferOffset
,
164 /*OUT*/ LPDWORD lpdwNumberOfBytesRead
,
165 /*IN*/ DWORD dwFlags
,
166 /*IN*/ LPWSAOVERLAPPED lpOverlapped
,
167 /*IN*/ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
,
168 /*IN*/ LPWSATHREADID lpThreadId
,
169 /*OUT*/ LPINT lpErrno
);
174 /*IN*/ LPWSABUFEX lpBuffers
,
175 /*IN*/ DWORD dwBufferCount
,
176 /*IN*/ LPVOID lpTargetBufferDescriptor
,
177 /*IN*/ DWORD dwTargetDescriptorLength
,
178 /*IN*/ DWORD dwTargetBufferOffset
,
179 /*OUT*/ LPDWORD lpdwNumberOfBytesRead
,
180 /*IN*/ DWORD dwFlags
,
181 /*IN*/ LPWSAOVERLAPPED lpOverlapped
,
182 /*IN*/ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
,
183 /*IN*/ LPWSATHREADID lpThreadId
,
184 /*OUT*/ LPINT lpErrno
);
189 /*IN*/ LPWSABUFEX lpBuffers
,
190 /*IN*/ DWORD dwBufferCount
,
191 /*IN*/ LPVOID lpTargetBufferDescriptor
,
192 /*IN*/ DWORD dwTargetDescriptorLength
,
193 /*IN*/ DWORD dwTargetBufferOffset
,
194 /*OUT*/ LPDWORD lpdwNumberOfBytesWritten
,
195 /*IN*/ DWORD dwFlags
,
196 /*IN*/ LPWSAOVERLAPPED lpOverlapped
,
197 /*IN*/ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
,
198 /*IN*/ LPWSATHREADID lpThreadId
,
199 /*OUT*/ LPINT lpErrno
);
202 (*LPFN_WSPRDMAWRITE
)(
204 /*IN*/ LPWSABUFEX lpBuffers
,
205 /*IN*/ DWORD dwBufferCount
,
206 /*IN*/ LPVOID lpTargetBufferDescriptor
,
207 /*IN*/ DWORD dwTargetDescriptorLength
,
208 /*IN*/ DWORD dwTargetBufferOffset
,
209 /*OUT*/ LPDWORD lpdwNumberOfBytesWritten
,
210 /*IN*/ DWORD dwFlags
,
211 /*IN*/ LPWSAOVERLAPPED lpOverlapped
,
212 /*IN*/ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
,
213 /*IN*/ LPWSATHREADID lpThreadId
,
214 /*OUT*/ LPINT lpErrno
);
219 /*IN*/ PVOID lpBuffer
,
220 /*IN*/ DWORD dwBufferLength
,
221 /*IN*/ DWORD dwFlags
,
222 /*OUT*/ LPINT lpErrno
);
225 WSPRegisterRdmaMemory(
227 /*IN*/ PVOID lpBuffer
,
228 /*IN*/ DWORD dwBufferLength
,
229 /*IN*/ DWORD dwFlags
,
230 /*OUT*/ LPVOID lpRdmaBufferDescriptor
,
231 /*IN OUT*/ LPDWORD lpdwDescriptorLength
,
232 /*OUT*/ LPINT lpErrno
);
235 (*LPFN_WSPREGISTERRDMAMEMORY
)(
237 /*IN*/ PVOID lpBuffer
,
238 /*IN*/ DWORD dwBufferLength
,
239 /*IN*/ DWORD dwFlags
,
240 /*OUT*/ LPVOID lpRdmaBufferDescriptor
,
241 /*IN OUT*/ LPDWORD lpdwDescriptorLength
,
242 /*OUT*/ LPINT lpErrno
);
248 #endif /* __WS2SAN_H */