winverbs: add new windows based verbs library and driver
[mirror/winof/.git] / inc / user / rdma / winverbs.h
1 /*\r
2  * Copyright (c) 1996-2008 Intel Corporation. All rights reserved.\r
3  *\r
4  * This software is available to you under the OpenIB.org BSD license\r
5  * below:\r
6  *\r
7  *     Redistribution and use in source and binary forms, with or\r
8  *     without modification, are permitted provided that the following\r
9  *     conditions are met:\r
10  *\r
11  *      - Redistributions of source code must retain the above\r
12  *        copyright notice, this list of conditions and the following\r
13  *        disclaimer.\r
14  *\r
15  *      - Redistributions in binary form must reproduce the above\r
16  *        copyright notice, this list of conditions and the following\r
17  *        disclaimer in the documentation and/or other materials\r
18  *        provided with the distribution.\r
19  *\r
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV\r
23  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
24  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
25  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
26  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
27  * SOFTWARE.\r
28  */\r
29 \r
30 #pragma once\r
31 \r
32 #ifndef _WINVERBS_H_\r
33 #define _WINVERBS_H_\r
34 \r
35 #include <initguid.h>\r
36 \r
37 #include <winsock2.h>\r
38 #include <unknwn.h>\r
39 #include <rdma\wvstatus.h>\r
40 \r
41 typedef UINT16 NET16;\r
42 typedef UINT32 NET32;\r
43 typedef UINT64 NET64;\r
44 \r
45 typedef union _WV_GID                                   // Network byte order\r
46 {\r
47         UINT8                   Raw[16];\r
48 \r
49 }       WV_GID;\r
50 \r
51 // Device/port capability flags\r
52 #define WV_DEVICE_RESIZE_MAX_WR                 0x00000001\r
53 #define WV_DEVICE_BAD_PKEY_COUNTER              0x00000002\r
54 #define WV_DEVICE_BAD_QKEY_COUNTER              0x00000004\r
55 // reserved                                                             0x00000008\r
56 #define WV_DEVICE_PATH_MIGRATION                0x00000010\r
57 #define WV_DEVICE_CHANGE_PHYSICAL_PORT  0x00000020\r
58 #define WV_DEVICE_AH_PORT_CHECKING              0x00000040\r
59 #define WV_DEVICE_QP_STATE_MODIFIER             0x00000080\r
60 #define WV_DEVICE_SHUTDOWN_PORT                 0x00000100\r
61 #define WV_DEVICE_INIT_TYPE                             0x00000200\r
62 #define WV_DEVICE_PORT_ACTIVE_EVENT             0x00000400\r
63 #define WV_DEVICE_SYSTEM_IMAGE_GUID             0x00000800\r
64 #define WV_DEVICE_RC_RNR_NAK_GENERATION 0x00001000\r
65 #define WV_DEVICE_SRQ_RESIZE                    0x00002000\r
66 #define WV_DEVICE_BATCH_NOTIFY_CQ               0x00004000\r
67 \r
68 typedef enum _WV_DEVICE_TYPE\r
69 {\r
70         WvDeviceUnknown,\r
71         WvDeviceInfiniband,\r
72         WvDeviceIwarp\r
73 \r
74 }       WV_DEVICE_TYPE;\r
75 \r
76 typedef enum _WV_ATOMIC_CAPABILITIES\r
77 {\r
78         WvAtomicNone,\r
79         WvAtomicDevice,\r
80         WvAtomicNode\r
81 \r
82 }       WV_ATOMIC_CAPABILITIES;\r
83 \r
84 typedef struct _WV_DEVICE_ATTRIBUTES\r
85 {\r
86         UINT64                                  FwVersion;\r
87         NET64                                   NodeGuid;\r
88         NET64                                   SystemImageGuid;\r
89         UINT32                                  VendorId;\r
90         UINT32                                  VendorPartId;\r
91         UINT32                                  HwVersion;\r
92         DWORD                                   CapabilityFlags;\r
93         WV_ATOMIC_CAPABILITIES  AtomicCapability;\r
94         DWORD                                   PageSizeCapabilityFlags;\r
95         SIZE_T                                  MaxMrSize;\r
96         SIZE_T                                  MaxQp;\r
97         SIZE_T                                  MaxQpWr;\r
98         SIZE_T                                  MaxSge;\r
99         SIZE_T                                  MaxCq;\r
100         SIZE_T                                  MaxCqEntries;\r
101         SIZE_T                                  MaxMr;\r
102         SIZE_T                                  MaxPd;\r
103         SIZE_T                                  MaxQpResponderResources;\r
104         SIZE_T                                  MaxResponderResources;\r
105         SIZE_T                                  MaxQpInitiatorDepth;\r
106         SIZE_T                                  MaxInlineSend;\r
107         SIZE_T                                  MaxMw;\r
108         SIZE_T                                  MaxMulticast;\r
109         SIZE_T                                  MaxQpAttach;\r
110         SIZE_T                                  MaxMulticastQp;\r
111         SIZE_T                                  MaxAh;\r
112         SIZE_T                                  MaxFmr;\r
113         SIZE_T                                  MaxMapPerFmr;\r
114         SIZE_T                                  MaxSrq;\r
115         SIZE_T                                  MaxSrqWr;\r
116         SIZE_T                                  MaxSrqSge;\r
117         SIZE_T                                  MaxPkeys;\r
118         WV_DEVICE_TYPE                  DeviceType;\r
119         UINT8                                   LocalAckDelay;\r
120         UINT8                                   PhysPortCount;\r
121 \r
122 }       WV_DEVICE_ATTRIBUTES;\r
123 \r
124 typedef enum _WV_PORT_STATE\r
125 {\r
126         WvPortNop,\r
127         WvPortDown,\r
128         WvPortInit,\r
129         WvPortArmed,\r
130         WvPortActive,\r
131         WvPortActiveDefer\r
132 \r
133 }       WV_PORT_STATE;\r
134 \r
135 typedef struct _WV_PORT_ATTRIBUTES\r
136 {\r
137         DWORD                   PortCabilityFlags;\r
138         WV_PORT_STATE   State;\r
139         UINT32                  MaxMtu;\r
140         UINT32                  ActiveMtu;\r
141         UINT32                  GidTableLength;\r
142         UINT32                  MaxMessageSize;\r
143         UINT32                  BadPkeyCounter;\r
144         UINT32                  QkeyViolationCounter;\r
145         UINT16                  PkeyTableLength;\r
146         NET16                   Lid;\r
147         NET16                   SmLid;\r
148         UINT8                   Lmc;\r
149         UINT8                   MaxVls;\r
150         UINT8                   SmSl;\r
151         UINT8                   SubnetTimeout;\r
152         UINT8                   InitTypeReply;\r
153         UINT8                   ActiveWidth;\r
154         UINT8                   ActiveSpeed;\r
155         UINT8                   PhysicalState;\r
156 \r
157 }       WV_PORT_ATTRIBUTES;\r
158 \r
159 typedef struct _WV_ADDRESS\r
160 {\r
161         SOCKET_ADDRESS  Address;\r
162         NET64                   DeviceGuid;\r
163         NET16                   Pkey;\r
164         UINT8                   PortNumber;\r
165 \r
166 }       WV_ADDRESS;\r
167 \r
168 typedef struct _WV_ADDRESS_LIST\r
169 {\r
170         SIZE_T                  Count;\r
171         WV_ADDRESS              Address[1];\r
172 \r
173 }       WV_ADDRESS_LIST;\r
174 \r
175 // Port notification flags\r
176 #define WV_EVENT_ERROR                          0x00000001\r
177 #define WV_EVENT_STATE                          0x00000002\r
178 #define WV_EVENT_ADDRESS                        0x00000004\r
179 #define WV_EVENT_LINK_ADDRESS           0x00000008\r
180 #define WV_EVENT_PARTITION                      0x00000010\r
181 #define WV_EVENT_MANAGEMENT                     0x00000020\r
182 \r
183 typedef enum _WV_CQ_NOTIFY_TYPE\r
184 {\r
185         WvCqError,\r
186         WvCqSolicited,\r
187         WvCqNextCompletion\r
188 \r
189 }       WV_CQ_NOTIFY_TYPE;\r
190 \r
191 typedef enum _WV_OPCODE\r
192 {\r
193         WvSend,\r
194         WvRdmaWrite,\r
195         WvRdmaRead,\r
196         WvCompareExchange,\r
197         WvFetchAdd,\r
198         WvBindWindow,\r
199         WvReceive = (1 << 7),\r
200         WvReceiveRdmaWrite\r
201 \r
202 }       WV_OPCODE;\r
203 \r
204 // Completion flags\r
205 #define WV_WC_IMMEDIATE         0x00000001\r
206 // reserved                                     0x00000002\r
207 #define WV_WC_GRH_VALID         0x00000004\r
208 \r
209 // Defined to allow casts to WinOF / OFED WCs\r
210 typedef struct _WV_COMPLETION\r
211 {\r
212         VOID*                   QpContext;\r
213         UINT64                  WrId;\r
214         WV_OPCODE               Opcode;\r
215         UINT32                  Length;\r
216         UINT64                  VendorCode;\r
217         HRESULT                 Status;\r
218 \r
219         // Receive completion data\r
220         DWORD                   Flags;\r
221         NET32                   ImmediateData;\r
222         NET32                   SourceQpn;\r
223         UINT16                  PkeyIndex;\r
224         NET16                   SLid;\r
225         UINT8                   SL;\r
226         UINT8                   DLidPathBits;\r
227 \r
228 }       WV_COMPLETION;\r
229 \r
230 typedef struct _WV_MEMORY_KEYS\r
231 {\r
232         UINT32                  Lkey;\r
233         NET32                   Rkey;\r
234 \r
235 }       WV_MEMORY_KEYS;\r
236 \r
237 // Access flags\r
238 #define WV_ACCESS_REMOTE_READ                   0x00000001\r
239 #define WV_ACCESS_REMOTE_WRITE                  0x0000000A\r
240 #define WV_ACCESS_REMOTE_ATOMIC                 0x00000004\r
241 #define WV_ACCESS_LOCAL_WRITE                   0x00000008\r
242 #define WV_ACCESS_MW_BIND                               0x00000010\r
243 \r
244 // Send queue operation flags\r
245 #define WV_SEND_IMMEDIATE                               0x00000001\r
246 #define WV_SEND_FENCE                                   0x00000002\r
247 #define WV_SEND_SIGNALED                                0x00000004\r
248 #define WV_SEND_SOLICITED                               0x00000008\r
249 #define WV_SEND_INLINE                                  0x00000010\r
250 \r
251 // Defined to allow casts to WinOF / OFED SGEs\r
252 #if defined(_WIN64)\r
253 typedef struct _WV_SGE\r
254 {\r
255         VOID*                   pAddress;\r
256         UINT32                  Length;\r
257         UINT32                  Lkey;\r
258 \r
259 }       WV_SGE;\r
260 #else\r
261 // 32-bit: little endian support only\r
262 typedef struct _WV_SGE\r
263 {\r
264         VOID*                   pAddress;\r
265         UINT32                  Reserved;\r
266         UINT32                  Length;\r
267         UINT32                  Lkey;\r
268 \r
269 }       WV_SGE;\r
270 #endif\r
271 \r
272 typedef struct _WV_SEND_DATAGRAM\r
273 {\r
274         UINT64                  WrId;\r
275         ULONG_PTR               AhKey;\r
276 \r
277         WV_SGE*                 pSgl;\r
278         SIZE_T                  nSge;\r
279         DWORD                   Flags;\r
280         NET32                   ImmediateData;\r
281         NET32                   DestinationQpn;\r
282         NET32                   DestinationQkey;\r
283 \r
284 }       WV_SEND_DATAGRAM;\r
285 \r
286 // Defined to allow casts to WinOF / OFED WRs\r
287 typedef struct _WV_SEND_REQUEST\r
288 {\r
289         UINT64                                  WrId;\r
290         struct _WV_SEND_REQUEST *pNext;\r
291         WV_SGE                                  *pSgl;\r
292         UINT32                                  nSge;\r
293         WV_OPCODE                               Opcode;\r
294         DWORD                                   Flags;\r
295         NET32                                   ImmediateData;\r
296 \r
297         union\r
298         {\r
299                 struct\r
300                 {\r
301                         NET64                   RemoteAddress;\r
302                         NET32                   Rkey;\r
303 \r
304                 }       Rdma;\r
305 \r
306                 struct\r
307                 {\r
308                         NET64                   RemoteAddress;\r
309                         NET32                   Rkey;\r
310                         NET64                   Compare;\r
311                         NET64                   Exchange;\r
312 \r
313                 }       CompareExchange;\r
314 \r
315                 struct\r
316                 {\r
317                         NET64                   RemoteAddress;\r
318                         NET32                   Rkey;\r
319                         NET64                   Add;\r
320                         UINT64                  Reserved;\r
321 \r
322                 }       FetchAdd;\r
323 \r
324                 struct\r
325                 {\r
326                         ULONG_PTR               AhKey;\r
327                         NET32                   DestinationQpn;\r
328                         NET32                   DestinationQkey;\r
329 \r
330                 }       Datagram;\r
331         }       Wr;\r
332 \r
333 }       WV_SEND_REQUEST;\r
334 \r
335 typedef struct _WV_NETWORK_ROUTE\r
336 {\r
337         UINT8                           Valid;\r
338         UINT8                           Reserved;\r
339         UINT8                           HopLimit;\r
340         UINT8                           TrafficClass;\r
341         NET32                           FlowLabel;\r
342         WV_GID                          SGid;\r
343         WV_GID                          DGid;\r
344 \r
345 }       WV_NETWORK_ROUTE;\r
346 \r
347 typedef struct _WV_ADDRESS_VECTOR\r
348 {\r
349         WV_NETWORK_ROUTE        Route;\r
350 \r
351         UINT16                          Reserved;\r
352         NET16                           DLid;\r
353         UINT8                           ServiceLevel;\r
354         UINT8                           SourcePathBits;\r
355         UINT8                           StaticRate;\r
356         UINT8                           PortNumber;\r
357 \r
358 }       WV_ADDRESS_VECTOR;\r
359 \r
360 typedef enum _WV_QP_TYPE\r
361 {\r
362         WvQpTypeRc,\r
363         WvQpTypeUc,\r
364         WvQpTypeReserved,\r
365         WvQpTypeUd\r
366 \r
367 }       WV_QP_TYPE;\r
368 \r
369 typedef enum _WV_QP_STATE\r
370 {\r
371         WvQpStateReset,\r
372         WvQpStateInit,\r
373         WvQpStateRtr,\r
374         WvQpStateRts,\r
375         WvQpStateSqd,\r
376         WvQpStateSqError,\r
377         WvQpStateError\r
378 \r
379 }       WV_QP_STATE;\r
380 \r
381 typedef enum _WV_APM_STATE\r
382 {\r
383         WvApmMigrated = 1,\r
384         WvApmRearm,\r
385         WvApmArmed\r
386 \r
387 }       WV_APM_STATE;\r
388 \r
389 #define WV_QP_SIGNAL_SENDS                              0x00000001\r
390 #define WV_QP_MEMORY_MANAGEMENT                 0x00000002\r
391 \r
392 typedef struct _WV_QP_CREATE\r
393 {\r
394         interface IWVCompletionQueue*           pSendCq;\r
395         interface IWVCompletionQueue*           pReceiveCq;\r
396         interface IWVSharedReceiveQueue*        pSharedReceiveQueue;\r
397         VOID*                   Context;\r
398 \r
399         SIZE_T                  SendDepth;\r
400         SIZE_T                  SendSge;\r
401         SIZE_T                  ReceiveDepth;\r
402         SIZE_T                  ReceiveSge;\r
403         SIZE_T                  MaxInlineSend;\r
404         SIZE_T                  InitiatorDepth;\r
405         SIZE_T                  ResponderResources;\r
406 \r
407         WV_QP_TYPE              QpType;\r
408         DWORD                   QpFlags;\r
409 \r
410 }       WV_QP_CREATE;\r
411 \r
412 // QP attribute mask\r
413 #define WV_QP_ATTR_CAPABILITIES                 0x00000001\r
414 #define WV_QP_ATTR_INITIATOR_DEPTH              0x00000002\r
415 #define WV_QP_ATTR_RESPONDER_RESOURCES  0x00000004\r
416 #define WV_QP_ATTR_CURRENT_STATE                0x00000008\r
417 #define WV_QP_ATTR_STATE                                0x00000010\r
418 #define WV_QP_ATTR_PATH_MIG_STATE               0x00000020\r
419 #define WV_QP_ATTR_DESTINATION_QPN              0x00000040\r
420 #define WV_QP_ATTR_QKEY                                 0x00000080\r
421 #define WV_QP_ATTR_SEND_PSN                             0x00000100\r
422 #define WV_QP_ATTR_RECEIVE_PSN                  0x00000200\r
423 #define WV_QP_ATTR_FLAGS                                0x00000400\r
424 #define WV_QP_ATTR_ACCESS_FLAGS                 0x00000800\r
425 #define WV_QP_ATTR_AV                                   0x00001000\r
426 #define WV_QP_ATTR_ALTERNATE_AV                 0x00002000\r
427 #define WV_QP_ATTR_PORT_NUMBER                  0x00004000\r
428 #define WV_QP_ATTR_PKEY_INDEX                   0x00008000\r
429 #define WV_QP_ATTR_ACK_TIMEOUT                  0x00010000\r
430 #define WV_QP_ATTR_RNR_NAK_TIMEOUT              0x00020000\r
431 #define WV_QP_ATTR_ERROR_RETRY_COUNT    0x00040000\r
432 #define WV_QP_ATTR_RNR_RETRY_COUNT              0x00080000\r
433 \r
434 typedef struct _WV_QP_ATTRIBUTES\r
435 {\r
436         interface IWVProtectionDomain*          pPd;\r
437         interface IWVCompletionQueue*           pSendCq;\r
438         interface IWVCompletionQueue*           pReceiveCq;\r
439         interface IWVSharedReceiveQueue*        pSharedReceiveQueue;\r
440 \r
441         SIZE_T                          SendDepth;\r
442         SIZE_T                          SendSge;\r
443         SIZE_T                          ReceiveDepth;\r
444         SIZE_T                          ReceiveSge;\r
445         SIZE_T                          MaxInlineSend;\r
446         SIZE_T                          InitiatorDepth;\r
447         SIZE_T                          ResponderResources;\r
448 \r
449         WV_QP_TYPE                      QpType;\r
450         WV_QP_STATE                     CurrentQpState;\r
451         WV_QP_STATE                     QpState;\r
452         WV_APM_STATE            ApmState;\r
453         NET32                           Qpn;\r
454         NET32                           DestinationQpn;\r
455         NET32                           Qkey;\r
456         NET32                           SendPsn;\r
457         NET32                           ReceivePsn;\r
458 \r
459         DWORD                           QpFlags;\r
460         DWORD                           AccessFlags;\r
461 \r
462         WV_ADDRESS_VECTOR       AddressVector;\r
463         WV_ADDRESS_VECTOR       AlternateAddressVector;\r
464         UINT32                          PathMtu;\r
465         UINT32                          AlternatePathMtu;\r
466         UINT16                          PkeyIndex;\r
467         UINT16                          AlternatePkeyIndex;\r
468         UINT8                           LocalAckTimeout;\r
469         UINT8                           AlternateLocalAckTimeout;\r
470 \r
471         UINT8                           RnrNakTimeout;\r
472         UINT8                           SequenceErrorRetryCount;\r
473         UINT8                           RnrRetryCount;\r
474 \r
475 }       WV_QP_ATTRIBUTES;\r
476 \r
477 #define WV_CM_UDP_QKEY  0x01234567\r
478 \r
479 #pragma warning(push)\r
480 #pragma warning(disable: 4200)\r
481 typedef struct _WV_CONNECT_PARAM\r
482 {\r
483         SIZE_T                          DataLength;\r
484         SIZE_T                          ResponderResources;\r
485         SIZE_T                          InitiatorDepth;\r
486         UINT8                           RetryCount;                     // Ignored when accepting\r
487         UINT8                           RnrRetryCount;\r
488         UINT8                           Reserved[2];\r
489         UINT8                           Data[];\r
490 \r
491 }       WV_CONNECT_PARAM;\r
492 \r
493 typedef struct _WV_DATAGRAM_PARAM\r
494 {\r
495         SIZE_T                          DataLength;\r
496         WV_ADDRESS_VECTOR       AddressVector;\r
497         NET32                           Qpn;\r
498         NET32                           Qkey;\r
499         UINT8                           Data[];\r
500 \r
501 }       WV_DATAGRAM_PARAM;\r
502 #pragma warning(pop)\r
503 \r
504 typedef struct _WV_CONNECT_ATTRIBUTES\r
505 {\r
506         WV_ADDRESS                      LocalAddress;\r
507         SOCKET_ADDRESS          PeerAddress;\r
508         WV_CONNECT_PARAM        Param;\r
509 \r
510 }       WV_CONNECT_ATTRIBUTES;\r
511 \r
512 typedef struct _WV_DATAGRAM_ATTRIBUTES\r
513 {\r
514         WV_ADDRESS                      LocalAddress;\r
515         SOCKET_ADDRESS          PeerAddress;            // Specify when querying\r
516         WV_DATAGRAM_PARAM       Param;\r
517 \r
518 }       WV_DATAGRAM_ATTRIBUTES;\r
519 \r
520 #undef INTERFACE\r
521 #define INTERFACE IWVOverlapped\r
522 // {64687592-aa67-4b55-bc4b-e189bdd2fc4f}\r
523 DEFINE_GUID(IID_IWVOverlapped, 0x64687592, 0xaa67, 0x4b55,\r
524                         0xbc, 0x4b, 0xe1, 0x89, 0xbd, 0xd2, 0xfc, 0x4f);\r
525 \r
526 DECLARE_INTERFACE_(IWVOverlapped, IUnknown)\r
527 {\r
528         // IUnknown methods\r
529         __override STDMETHOD(QueryInterface)(\r
530                 THIS_\r
531                 REFIID riid,\r
532                 LPVOID FAR* ppvObj\r
533                 ) PURE;\r
534 \r
535         __override STDMETHOD_(ULONG,AddRef)(\r
536                 THIS\r
537                 ) PURE;\r
538 \r
539         __override STDMETHOD_(ULONG,Release)(\r
540                 THIS\r
541                 ) PURE;\r
542 \r
543         // IWVOverlapped methods\r
544         STDMETHOD(CancelOverlappedRequests)(\r
545                 THIS\r
546                 ) PURE;\r
547 \r
548         STDMETHOD(GetOverlappedResult)(\r
549                 THIS_\r
550                 __inout_opt OVERLAPPED *pOverlapped,\r
551                 __out DWORD *pNumberOfBytesTransferred,\r
552                 __in BOOL bWait\r
553                 ) PURE;\r
554 };\r
555 \r
556 \r
557 #undef INTERFACE\r
558 #define INTERFACE IWVCompletionQueue\r
559 // {a5f6a8de-18a6-4086-aa93-7b66607a290a}\r
560 DEFINE_GUID(IID_IWVCompletionQueue, 0xa5f6a8de, 0x18a6, 0x4086,\r
561                         0xaa, 0x93, 0x7b, 0x66, 0x60, 0x7a, 0x29, 0x0a);\r
562 \r
563 DECLARE_INTERFACE_(IWVCompletionQueue, IWVOverlapped)\r
564 {\r
565         // IUnknown methods\r
566         __override STDMETHOD(QueryInterface)(\r
567                 THIS_\r
568                 REFIID riid,\r
569                 LPVOID FAR* ppvObj\r
570                 ) PURE;\r
571 \r
572         __override STDMETHOD_(ULONG,AddRef)(\r
573                 THIS\r
574                 ) PURE;\r
575 \r
576         __override STDMETHOD_(ULONG,Release)(\r
577                 THIS\r
578                 ) PURE;\r
579 \r
580         // IWVOverlapped methods\r
581         __override STDMETHOD(CancelOverlappedRequests)(\r
582                 THIS\r
583                 ) PURE;\r
584 \r
585         __override STDMETHOD(GetOverlappedResult)(\r
586                 THIS_\r
587                 __inout_opt OVERLAPPED *pOverlapped,\r
588                 __out DWORD *pNumberOfBytesTransferred,\r
589                 __in BOOL bWait\r
590                 ) PURE;\r
591 \r
592         // IWVCompletionQueue methods\r
593         STDMETHOD(Resize)(\r
594                 THIS_\r
595                 __inout SIZE_T* pEntries\r
596                 ) PURE;\r
597 \r
598         STDMETHOD(Peek)(\r
599                 THIS_\r
600                 __out SIZE_T* pCompletedEntries\r
601                 ) PURE;\r
602 \r
603         STDMETHOD(Notify)(\r
604                 THIS_\r
605                 __in WV_CQ_NOTIFY_TYPE Type,\r
606                 __in_opt OVERLAPPED* pOverlapped\r
607                 ) PURE;\r
608 \r
609         STDMETHOD(BatchNotify)(\r
610                 THIS_\r
611                 __in SIZE_T CompletedEntries,\r
612                 __in_opt OVERLAPPED* pOverlapped\r
613                 ) PURE;\r
614 \r
615         STDMETHOD_(SIZE_T,Poll)(\r
616                 THIS_\r
617                 __inout_ecount(Entries) WV_COMPLETION Completions[],\r
618                 __in SIZE_T Entries\r
619                 ) PURE;\r
620 };\r
621 \r
622 \r
623 #undef INTERFACE\r
624 #define INTERFACE IWVMemoryWindow\r
625 // {e8ae206f-b31f-4709-8dc9-6e87625f93fc}\r
626 DEFINE_GUID(IID_IWVMemoryWindow, 0xe8ae206f, 0xb31f, 0x4709,\r
627                         0x8d, 0xc9, 0x6e, 0x87, 0x62, 0x5f, 0x93, 0xfc);\r
628 \r
629 DECLARE_INTERFACE_(IWVMemoryWindow, IUnknown)\r
630 {\r
631         // IUnknown methods\r
632         __override STDMETHOD(QueryInterface)(\r
633                 THIS_\r
634                 REFIID riid,\r
635                 LPVOID FAR* ppvObj\r
636                 ) PURE;\r
637 \r
638         __override STDMETHOD_(ULONG,AddRef)(\r
639                 THIS\r
640                 ) PURE;\r
641 \r
642         __override STDMETHOD_(ULONG,Release)(\r
643                 THIS\r
644                 ) PURE;\r
645 };\r
646 \r
647 \r
648 #undef INTERFACE\r
649 #define INTERFACE IWVAddressHandle\r
650 // {95903fde-fdac-4007-92b7-e01286cd36e8}\r
651 DEFINE_GUID(IID_IWVAddressHandle, 0x95903fde, 0xfdac, 0x4007,\r
652                         0x92, 0xb7, 0xe0, 0x12, 0x86, 0xcd, 0x36, 0xe8);\r
653 \r
654 DECLARE_INTERFACE_(IWVAddressHandle, IUnknown)\r
655 {\r
656         // IUnknown methods\r
657         __override STDMETHOD(QueryInterface)(\r
658                 THIS_\r
659                 REFIID riid,\r
660                 LPVOID FAR* ppvObj\r
661                 ) PURE;\r
662 \r
663         __override STDMETHOD_(ULONG,AddRef)(\r
664                 THIS\r
665                 ) PURE;\r
666 \r
667         __override STDMETHOD_(ULONG,Release)(\r
668                 THIS\r
669                 ) PURE;\r
670 };\r
671 \r
672 \r
673 #undef INTERFACE\r
674 #define INTERFACE IWVSharedReceiveQueue\r
675 // {b2bf30e4-8c2e-4659-ac7a-4c5e0d2c7114}\r
676 DEFINE_GUID(IID_IWVSharedReceiveQueue, 0xb2bf30e4, 0x8c2e, 0x4659,\r
677                         0xac, 0x7a, 0x4c, 0x5e, 0x0d, 0x2c, 0x71, 0x14);\r
678 \r
679 DECLARE_INTERFACE_(IWVSharedReceiveQueue, IWVOverlapped)\r
680 {\r
681         // IUnknown methods\r
682         __override STDMETHOD(QueryInterface)(\r
683                 THIS_\r
684                 REFIID riid,\r
685                 LPVOID FAR* ppvObj\r
686                 ) PURE;\r
687 \r
688         __override STDMETHOD_(ULONG,AddRef)(\r
689                 THIS\r
690                 ) PURE;\r
691 \r
692         __override STDMETHOD_(ULONG,Release)(\r
693                 THIS\r
694                 ) PURE;\r
695 \r
696         // IWVOverlapped methods\r
697         __override STDMETHOD(CancelOverlappedRequests)(\r
698                 THIS\r
699                 ) PURE;\r
700 \r
701         __override STDMETHOD(GetOverlappedResult)(\r
702                 THIS_\r
703                 __inout_opt OVERLAPPED *pOverlapped,\r
704                 __out DWORD *pNumberOfBytesTransferred,\r
705                 __in BOOL bWait\r
706                 ) PURE;\r
707 \r
708         // IWVSharedReceiveQueue methods\r
709         STDMETHOD(Query)(\r
710                 THIS_\r
711                 __out SIZE_T* pMaxWr,\r
712                 __out SIZE_T* pMaxSge,\r
713                 __out SIZE_T* pSrqLimit\r
714                 ) PURE;\r
715 \r
716         STDMETHOD(Modify)(\r
717                 THIS_\r
718                 __in SIZE_T MaxWr,\r
719                 __in SIZE_T SrqLimit\r
720                 ) PURE;\r
721 \r
722         STDMETHOD(PostReceive)(\r
723                 THIS_\r
724                 __in UINT64 WrId,\r
725                 __in_ecount(nSge) WV_SGE* pSgl,\r
726                 __in SIZE_T nSge\r
727                 ) PURE;\r
728 \r
729         /* Signaled on limit reached event */\r
730         STDMETHOD(Notify)(\r
731                 THIS_\r
732                 __in_opt OVERLAPPED* pOverlapped\r
733                 ) PURE;\r
734 };\r
735 \r
736 \r
737 #undef INTERFACE\r
738 #define INTERFACE IWVQueuePair\r
739 // {a847c13c-e617-489c-b0ab-2da73eb0adfd}\r
740 DEFINE_GUID(IID_IWVQueuePair, 0xa847c13c, 0xe617, 0x489c,\r
741                         0xb0, 0xab, 0x2d, 0xa7, 0x3e, 0xb0, 0xad, 0xfd);\r
742 \r
743 DECLARE_INTERFACE_(IWVQueuePair, IWVOverlapped)\r
744 {\r
745         // IUnknown methods\r
746         __override STDMETHOD(QueryInterface)(\r
747                 THIS_\r
748                 REFIID riid,\r
749                 LPVOID FAR* ppvObj\r
750                 ) PURE;\r
751 \r
752         __override STDMETHOD_(ULONG,AddRef)(\r
753                 THIS\r
754                 ) PURE;\r
755 \r
756         __override STDMETHOD_(ULONG,Release)(\r
757                 THIS\r
758                 ) PURE;\r
759 \r
760         // IWVOverlapped methods\r
761         __override STDMETHOD(CancelOverlappedRequests)(\r
762                 THIS\r
763                 ) PURE;\r
764 \r
765         __override STDMETHOD(GetOverlappedResult)(\r
766                 THIS_\r
767                 __inout_opt OVERLAPPED *pOverlapped,\r
768                 __out DWORD *pNumberOfBytesTransferred,\r
769                 __in BOOL bWait\r
770                 ) PURE;\r
771 \r
772         // IWVQueuePair methods\r
773         STDMETHOD(Query)(\r
774                 THIS_\r
775                 __out WV_QP_ATTRIBUTES* pAttributes\r
776                 ) PURE;\r
777 \r
778         STDMETHOD(Modify)(\r
779                 THIS_\r
780                 __in WV_QP_ATTRIBUTES* pAttributes,\r
781                 __in DWORD Options,\r
782                 __in_opt OVERLAPPED* pOverlapped\r
783                 ) PURE;\r
784 \r
785         STDMETHOD(PostReceive)(\r
786                 THIS_\r
787                 __in UINT64 WrId,\r
788                 __in_ecount(nSge) WV_SGE* pSgl,\r
789                 __in SIZE_T nSge\r
790                 ) PURE;\r
791 \r
792         STDMETHOD(PostSend)(\r
793                 THIS_\r
794                 __in WV_SEND_REQUEST *pSend,\r
795                 __out_opt WV_SEND_REQUEST **ppFailed\r
796                 ) PURE;\r
797 };\r
798 \r
799 \r
800 #undef INTERFACE\r
801 #define INTERFACE IWVConnectQueuePair\r
802 // {A791309C-4244-4194-AD63-7D372CADE5E0}\r
803 DEFINE_GUID(IID_IWVConnectQueuePair, 0xa791309c, 0x4244, 0x4194,\r
804                         0xad, 0x63, 0x7d, 0x37, 0x2c, 0xad, 0xe5, 0xe0);\r
805 \r
806 DECLARE_INTERFACE_(IWVConnectQueuePair, IWVQueuePair)\r
807 {\r
808         // IUnknown methods\r
809         __override STDMETHOD(QueryInterface)(\r
810                 THIS_\r
811                 REFIID riid,\r
812                 LPVOID FAR* ppvObj\r
813                 ) PURE;\r
814 \r
815         __override STDMETHOD_(ULONG,AddRef)(\r
816                 THIS\r
817                 ) PURE;\r
818 \r
819         __override STDMETHOD_(ULONG,Release)(\r
820                 THIS\r
821                 ) PURE;\r
822 \r
823         // IWVOverlapped methods\r
824         __override STDMETHOD(CancelOverlappedRequests)(\r
825                 THIS\r
826                 ) PURE;\r
827 \r
828         __override STDMETHOD(GetOverlappedResult)(\r
829                 THIS_\r
830                 __inout_opt OVERLAPPED *pOverlapped,\r
831                 __out DWORD *pNumberOfBytesTransferred,\r
832                 __in BOOL bWait\r
833                 ) PURE;\r
834 \r
835         // IWVQueuePair methods\r
836         STDMETHOD(Query)(\r
837                 THIS_\r
838                 __out WV_QP_ATTRIBUTES* pAttributes\r
839                 ) PURE;\r
840 \r
841         STDMETHOD(Modify)(\r
842                 THIS_\r
843                 __in WV_QP_ATTRIBUTES* pAttributes,\r
844                 __in DWORD Options,\r
845                 __in_opt OVERLAPPED* pOverlapped\r
846                 ) PURE;\r
847 \r
848         STDMETHOD(PostReceive)(\r
849                 THIS_\r
850                 __in UINT64 WrId,\r
851                 __in_ecount(nSge) WV_SGE* pSgl,\r
852                 __in SIZE_T nSge\r
853                 ) PURE;\r
854 \r
855         STDMETHOD(PostSend)(\r
856                 THIS_\r
857                 __in WV_SEND_REQUEST *pSend,\r
858                 __out_opt WV_SEND_REQUEST **ppFailed\r
859                 ) PURE;\r
860 \r
861         // IWVConnectQueuePair methods\r
862         STDMETHOD(Send)(\r
863                 THIS_\r
864                 __in UINT64 WrId,\r
865                 __in_ecount(nSge) WV_SGE* pSgl,\r
866                 __in SIZE_T nSge,\r
867                 __in DWORD Flags,\r
868                 __in NET32 ImmediateData\r
869                 ) PURE;\r
870 \r
871         STDMETHOD(Read)(\r
872                 THIS_\r
873                 __in UINT64 WrId,\r
874                 __in_ecount(nSge) WV_SGE* pSgl,\r
875                 __in SIZE_T nSge,\r
876                 __in DWORD Flags,\r
877                 __in NET64 Address,\r
878                 __in NET32 Rkey\r
879                 ) PURE;\r
880 \r
881         STDMETHOD(Write)(\r
882                 THIS_\r
883                 __in UINT64 WrId,\r
884                 __in_ecount(nSge) WV_SGE* pSgl,\r
885                 __in SIZE_T nSge,\r
886                 __in DWORD Flags,\r
887                 __in NET32 ImmediateData,\r
888                 __in NET64 Address,\r
889                 __in NET32 Rkey\r
890                 ) PURE;\r
891 \r
892         STDMETHOD(CompareExchange)(\r
893                 THIS_\r
894                 __in UINT64 WrId,\r
895                 __in WV_SGE* pSge,\r
896                 __in DWORD Flags,\r
897                 __in NET64 Compare,\r
898                 __in NET64 Exchange,\r
899                 __in NET64 Address,\r
900                 __in NET32 Rkey\r
901                 ) PURE;\r
902 \r
903         STDMETHOD(FetchAdd)(\r
904                 THIS_\r
905                 __in UINT64 WrId,\r
906                 __in WV_SGE* pSge,\r
907                 __in DWORD Flags,\r
908                 __in NET64 Value,\r
909                 __in NET64 Address,\r
910                 __in NET32 Rkey\r
911                 ) PURE;\r
912 \r
913         STDMETHOD(BindMemoryWindow)(\r
914                 THIS_\r
915                 __in IWVMemoryWindow* pMw,\r
916                 __in UINT64 WrId,\r
917                 __in UINT32 Lkey,\r
918                 __in DWORD AccessFlags,\r
919                 __in DWORD SendFlags,\r
920                 __in_bcount(BufferLength) const VOID* pBuffer,\r
921                 __in SIZE_T BufferLength,\r
922                 __out NET32 *pRkey\r
923                 ) PURE;\r
924 };\r
925 \r
926 \r
927 #undef INTERFACE\r
928 #define INTERFACE IWVDatagramQueuePair\r
929 // {3BA2F15E-D961-4df8-8FC2-6043A6D67826}\r
930 DEFINE_GUID(IID_IWVDatagramQueuePair, 0x3ba2f15e, 0xd961, 0x4df8,\r
931                         0x8f, 0xc2, 0x60, 0x43, 0xa6, 0xd6, 0x78, 0x26);\r
932 \r
933 DECLARE_INTERFACE_(IWVDatagramQueuePair, IWVQueuePair)\r
934 {\r
935         // IUnknown methods\r
936         __override STDMETHOD(QueryInterface)(\r
937                 THIS_\r
938                 REFIID riid,\r
939                 LPVOID FAR* ppvObj\r
940                 ) PURE;\r
941 \r
942         __override STDMETHOD_(ULONG,AddRef)(\r
943                 THIS\r
944                 ) PURE;\r
945 \r
946         __override STDMETHOD_(ULONG,Release)(\r
947                 THIS\r
948                 ) PURE;\r
949 \r
950         // IWVOverlapped methods\r
951         __override STDMETHOD(CancelOverlappedRequests)(\r
952                 THIS\r
953                 ) PURE;\r
954 \r
955         __override STDMETHOD(GetOverlappedResult)(\r
956                 THIS_\r
957                 __inout_opt OVERLAPPED *pOverlapped,\r
958                 __out DWORD *pNumberOfBytesTransferred,\r
959                 __in BOOL bWait\r
960                 ) PURE;\r
961 \r
962         // IWVQueuePair methods\r
963         STDMETHOD(Query)(\r
964                 THIS_\r
965                 __out WV_QP_ATTRIBUTES* pAttributes\r
966                 ) PURE;\r
967 \r
968         STDMETHOD(Modify)(\r
969                 THIS_\r
970                 __in WV_QP_ATTRIBUTES* pAttributes,\r
971                 __in DWORD Options,\r
972                 __in_opt OVERLAPPED* pOverlapped\r
973                 ) PURE;\r
974 \r
975         STDMETHOD(PostReceive)(\r
976                 THIS_\r
977                 __in UINT64 WrId,\r
978                 __in_ecount(nSge) WV_SGE* pSgl,\r
979                 __in SIZE_T nSge\r
980                 ) PURE;\r
981 \r
982         STDMETHOD(PostSend)(\r
983                 THIS_\r
984                 __in WV_SEND_REQUEST *pSend,\r
985                 __out_opt WV_SEND_REQUEST **ppFailed\r
986                 ) PURE;\r
987 \r
988         // IWVDatagramQueuePair Methods\r
989         STDMETHOD(Send)(\r
990                 THIS_\r
991                 __in UINT64 WrId,\r
992                 __in ULONG_PTR AhKey,\r
993                 __in WV_SGE* pSge,\r
994                 __in DWORD Flags,\r
995                 __in NET32 DestinationQpn,\r
996                 __in NET32 DestinationQkey\r
997                 ) PURE;\r
998 \r
999         STDMETHOD(SendMessage)(\r
1000                 THIS_\r
1001                 __in WV_SEND_DATAGRAM* pSend\r
1002                 ) PURE;\r
1003 \r
1004         STDMETHOD(AttachMulticast)(\r
1005                 THIS_\r
1006                 __in WV_GID *pGid,\r
1007                 __in NET16 Lid,\r
1008                 __in_opt OVERLAPPED* pOverlapped\r
1009                 ) PURE;\r
1010 \r
1011         STDMETHOD(DetachMulticast)(\r
1012                 THIS_\r
1013                 __in WV_GID *pGid,\r
1014                 __in NET16 Lid,\r
1015                 __in_opt OVERLAPPED* pOverlapped\r
1016                 ) PURE;\r
1017 };\r
1018 \r
1019 \r
1020 #undef INTERFACE\r
1021 #define INTERFACE IWVProtectionDomain\r
1022 // {a5633a12-dffc-4060-927d-9a600d7efb63}\r
1023 DEFINE_GUID(IID_IWVProtectionDomain, 0xa5633a12, 0xdffc, 0x4060,\r
1024                         0x92, 0x7d, 0x9a, 0x60, 0x0d, 0x7e, 0xfb, 0x63);\r
1025 \r
1026 DECLARE_INTERFACE_(IWVProtectionDomain, IUnknown)\r
1027 {\r
1028         // IUnknown methods\r
1029         __override STDMETHOD(QueryInterface)(\r
1030                 THIS_\r
1031                 REFIID riid,\r
1032                 LPVOID FAR* ppvObj\r
1033                 ) PURE;\r
1034 \r
1035         __override STDMETHOD_(ULONG,AddRef)(\r
1036                 THIS\r
1037                 ) PURE;\r
1038 \r
1039         __override STDMETHOD_(ULONG,Release)(\r
1040                 THIS\r
1041                 ) PURE;\r
1042 \r
1043         // IWVProtectionDomain methods\r
1044         STDMETHOD(CreateSharedReceiveQueue)(\r
1045                 THIS_\r
1046                 __in SIZE_T MaxWr,\r
1047                 __in SIZE_T MaxSge,\r
1048                 __in SIZE_T SrqLimit,\r
1049                 __deref_out IWVSharedReceiveQueue** ppSrq\r
1050                 ) PURE;\r
1051 \r
1052         STDMETHOD(CreateConnectQueuePair)(\r
1053                 THIS_\r
1054                 __in WV_QP_CREATE* pAttributes,\r
1055                 __deref_out IWVConnectQueuePair** ppQp\r
1056                 ) PURE;\r
1057 \r
1058         STDMETHOD(CreateDatagramQueuePair)(\r
1059                 THIS_\r
1060                 __in WV_QP_CREATE* pAttributes,\r
1061                 __deref_out IWVDatagramQueuePair** ppQp\r
1062                 ) PURE;\r
1063 \r
1064         STDMETHOD(RegisterMemory)(\r
1065                 THIS_\r
1066                 __in_bcount(BufferLength) const VOID* pBuffer,\r
1067                 __in SIZE_T BufferLength,\r
1068                 __in DWORD AccessFlags,\r
1069                 __in_opt OVERLAPPED* pOverlapped,\r
1070                 __out WV_MEMORY_KEYS* pKeys\r
1071                 ) PURE;\r
1072 \r
1073         STDMETHOD(DeregisterMemory)(\r
1074                 THIS_\r
1075                 __in UINT32 Lkey,\r
1076                 __in_opt OVERLAPPED* pOverlapped\r
1077                 ) PURE;\r
1078 \r
1079         STDMETHOD(AllocateMemoryWindow)(\r
1080                 THIS_\r
1081                 __deref_out IWVMemoryWindow** ppMw\r
1082                 ) PURE;\r
1083 \r
1084         STDMETHOD(CreateAddressHandle)(\r
1085                 THIS_\r
1086                 __in WV_ADDRESS_VECTOR* pAddress,\r
1087                 __deref_out IWVAddressHandle** ppAh,\r
1088                 __out ULONG_PTR* pAhKey\r
1089                 ) PURE;\r
1090 };\r
1091 \r
1092 \r
1093 #undef INTERFACE\r
1094 #define INTERFACE IWVEndpoint\r
1095 // {eb2fbd8e-b9b6-4b24-9a5e-94c26ae265f0}\r
1096 DEFINE_GUID(IID_IWVEndpoint, 0xeb2fbd8e, 0xb9b6, 0x4b24,\r
1097                         0x9a, 0x5e, 0x94, 0xc2, 0x6a, 0xe2, 0x65, 0xf0);\r
1098 \r
1099 DECLARE_INTERFACE_(IWVEndpoint, IWVOverlapped)\r
1100 {\r
1101         // IUnknown methods\r
1102         __override STDMETHOD(QueryInterface)(\r
1103                 THIS_\r
1104                 REFIID riid,\r
1105                 LPVOID FAR* ppvObj\r
1106                 ) PURE;\r
1107 \r
1108         __override STDMETHOD_(ULONG,AddRef)(\r
1109                 THIS\r
1110                 ) PURE;\r
1111 \r
1112         __override STDMETHOD_(ULONG,Release)(\r
1113                 THIS\r
1114                 ) PURE;\r
1115 \r
1116         // IWVOverlapped methods\r
1117         __override STDMETHOD(CancelOverlappedRequests)(\r
1118                 THIS\r
1119                 ) PURE;\r
1120 \r
1121         __override STDMETHOD(GetOverlappedResult)(\r
1122                 THIS_\r
1123                 __inout_opt OVERLAPPED *pOverlapped,\r
1124                 __out DWORD *pNumberOfBytesTransferred,\r
1125                 __in BOOL bWait\r
1126                 ) PURE;\r
1127 \r
1128         // IWVEndpoint methods\r
1129         STDMETHOD(BindAddress)(\r
1130                 THIS_\r
1131                 __in const struct sockaddr* pAddress\r
1132                 ) PURE;\r
1133 \r
1134         STDMETHOD(Reject)(\r
1135                 THIS_\r
1136                 __in_bcount_opt(PrivateDataLength) const VOID* pPrivateData,\r
1137                 __in SIZE_T PrivateDataLength\r
1138                 ) PURE;\r
1139 };\r
1140 \r
1141 \r
1142 #undef INTERFACE\r
1143 #define INTERFACE IWVConnectEndpoint\r
1144 // {ac670274-1934-4759-a39c-eee01a8130b3}\r
1145 DEFINE_GUID(IID_IWVConnectEndpoint, 0xac670274, 0x1934, 0x4759,\r
1146                         0xa3, 0x9c, 0xee, 0xe0, 0x1a, 0x81, 0x30, 0xb3);\r
1147 \r
1148 DECLARE_INTERFACE_(IWVConnectEndpoint, IWVEndpoint)\r
1149 {\r
1150         // IUnknown methods\r
1151         __override STDMETHOD(QueryInterface)(\r
1152                 THIS_\r
1153                 REFIID riid,\r
1154                 LPVOID FAR* ppvObj\r
1155                 ) PURE;\r
1156 \r
1157         __override STDMETHOD_(ULONG,AddRef)(\r
1158                 THIS\r
1159                 ) PURE;\r
1160 \r
1161         __override STDMETHOD_(ULONG,Release)(\r
1162                 THIS\r
1163                 ) PURE;\r
1164 \r
1165         // IWVOverlapped methods\r
1166         __override STDMETHOD(CancelOverlappedRequests)(\r
1167                 THIS\r
1168                 ) PURE;\r
1169 \r
1170         __override STDMETHOD(GetOverlappedResult)(\r
1171                 THIS_\r
1172                 __inout_opt OVERLAPPED *pOverlapped,\r
1173                 __out DWORD *pNumberOfBytesTransferred,\r
1174                 __in BOOL bWait\r
1175                 ) PURE;\r
1176 \r
1177         // IWVEndpoint methods\r
1178         __override STDMETHOD(BindAddress)(\r
1179                 THIS_\r
1180                 __in const struct sockaddr* pAddress\r
1181                 ) PURE;\r
1182 \r
1183         __override STDMETHOD(Reject)(\r
1184                 THIS_\r
1185                 __in_bcount_opt(PrivateDataLength) const VOID* pPrivateData,\r
1186                 __in SIZE_T PrivateDataLength\r
1187                 ) PURE;\r
1188 \r
1189         // IWVConnectEndpoint methods\r
1190         STDMETHOD(Connect)(\r
1191                 THIS_\r
1192                 __in IWVConnectQueuePair* pQp,\r
1193                 __in WV_CONNECT_PARAM* pParam,\r
1194                 __in_opt OVERLAPPED* pOverlapped\r
1195                 ) PURE;\r
1196 \r
1197         STDMETHOD(Accept)(\r
1198                 THIS_\r
1199                 __in IWVConnectQueuePair* pQp,\r
1200                 __in WV_CONNECT_PARAM* pParam,\r
1201                 __in_opt OVERLAPPED* pOverlapped\r
1202                 ) PURE;\r
1203 \r
1204         STDMETHOD(Disconnect)(\r
1205                 THIS_\r
1206                 __in_opt OVERLAPPED* pOverlapped\r
1207                 ) PURE;\r
1208 \r
1209         STDMETHOD(NotifyDisconnect)(\r
1210                 THIS_\r
1211                 __in_opt OVERLAPPED* pOverlapped\r
1212                 ) PURE;\r
1213 \r
1214         STDMETHOD(Query)(\r
1215                 THIS_\r
1216                 __out WV_CONNECT_ATTRIBUTES* pAttributes\r
1217                 ) PURE;\r
1218 };\r
1219 \r
1220 \r
1221 #undef INTERFACE\r
1222 #define INTERFACE IWVDatagramEndpoint\r
1223 // {1d879de6-f2af-4a8a-8893-52e0ab868130}\r
1224 DEFINE_GUID(IID_IWVDatagramEndpoint, 0x1d879de6, 0xf2af, 0x4a8a,\r
1225                         0x88, 0x93, 0x52, 0xe0, 0xab, 0x86, 0x81, 0x30);\r
1226 \r
1227 DECLARE_INTERFACE_(IWVDatagramEndpoint, IWVEndpoint)\r
1228 {\r
1229         // IUnknown methods\r
1230         __override STDMETHOD(QueryInterface)(\r
1231                 THIS_\r
1232                 REFIID riid,\r
1233                 LPVOID FAR* ppvObj\r
1234                 ) PURE;\r
1235 \r
1236         __override STDMETHOD_(ULONG,AddRef)(\r
1237                 THIS\r
1238                 ) PURE;\r
1239 \r
1240         __override STDMETHOD_(ULONG,Release)(\r
1241                 THIS\r
1242                 ) PURE;\r
1243 \r
1244         // IWVOverlapped methods\r
1245         __override STDMETHOD(CancelOverlappedRequests)(\r
1246                 THIS\r
1247                 ) PURE;\r
1248 \r
1249         __override STDMETHOD(GetOverlappedResult)(\r
1250                 THIS_\r
1251                 __inout_opt OVERLAPPED *pOverlapped,\r
1252                 __out DWORD *pNumberOfBytesTransferred,\r
1253                 __in BOOL bWait\r
1254                 ) PURE;\r
1255 \r
1256         // IWVEndpoint methods\r
1257         __override STDMETHOD(BindAddress)(\r
1258                 THIS_\r
1259                 __in const struct sockaddr* pAddress\r
1260                 ) PURE;\r
1261 \r
1262         __override STDMETHOD(Reject)(\r
1263                 THIS_\r
1264                 __in_bcount_opt(PrivateDataLength) const VOID* pPrivateData,\r
1265                 __in SIZE_T PrivateDataLength\r
1266                 ) PURE;\r
1267 \r
1268         // IWVDatagramEndpoint methods\r
1269         STDMETHOD(Lookup)(\r
1270                 THIS_\r
1271                 __in const struct sockaddr* pAddress,\r
1272                 __in_bcount_opt(PrivateDataLength) const VOID* pPrivateData,\r
1273                 __in SIZE_T PrivateDataLength,\r
1274                 __in_opt OVERLAPPED* pOverlapped\r
1275                 ) PURE;\r
1276 \r
1277         STDMETHOD(Accept)(\r
1278                 THIS_\r
1279                 __in WV_DATAGRAM_PARAM* pParam,\r
1280                 __in_opt OVERLAPPED* pOverlapped\r
1281                 ) PURE;\r
1282 \r
1283         STDMETHOD(JoinMulticast)(\r
1284                 THIS_\r
1285                 __in const struct sockaddr* pAddress,\r
1286                 __in_opt OVERLAPPED* pOverlapped\r
1287                 ) PURE;\r
1288 \r
1289         STDMETHOD(LeaveMulticast)(\r
1290                 THIS_\r
1291                 __in const struct sockaddr* pAddress,\r
1292                 __in_opt OVERLAPPED* pOverlapped\r
1293                 ) PURE;\r
1294 \r
1295         STDMETHOD(Query)(\r
1296                 THIS_\r
1297                 __inout WV_DATAGRAM_ATTRIBUTES* pAttributes\r
1298                 ) PURE;\r
1299 };\r
1300 \r
1301 \r
1302 #undef INTERFACE\r
1303 #define INTERFACE IWVListen\r
1304 // {5b839fd4-7410-441f-a2d9-5d75b1d8599b}\r
1305 DEFINE_GUID(IID_IWVListen, 0x5b839fd4, 0x7410, 0x441f,\r
1306                         0xa2, 0xd9, 0x5d, 0x75, 0xb1, 0xd8, 0x59, 0x9b);\r
1307 \r
1308 DECLARE_INTERFACE_(IWVListen, IWVOverlapped)\r
1309 {\r
1310         // IUnknown methods\r
1311         __override STDMETHOD(QueryInterface)(\r
1312                 THIS_\r
1313                 REFIID riid,\r
1314                 LPVOID FAR* ppvObj\r
1315                 ) PURE;\r
1316 \r
1317         __override STDMETHOD_(ULONG,AddRef)(\r
1318                 THIS\r
1319                 ) PURE;\r
1320 \r
1321         __override STDMETHOD_(ULONG,Release)(\r
1322                 THIS\r
1323                 ) PURE;\r
1324 \r
1325         // IWVOverlapped methods\r
1326         __override STDMETHOD(CancelOverlappedRequests)(\r
1327                 THIS\r
1328                 ) PURE;\r
1329 \r
1330         __override STDMETHOD(GetOverlappedResult)(\r
1331                 THIS_\r
1332                 __inout_opt OVERLAPPED *pOverlapped,\r
1333                 __out DWORD *pNumberOfBytesTransferred,\r
1334                 __in BOOL bWait\r
1335                 ) PURE;\r
1336 \r
1337         // IWVListen methods\r
1338         STDMETHOD(GetRequest)(\r
1339                 THIS_\r
1340                 __in IWVEndpoint* pEndpoint,\r
1341                 __in_opt OVERLAPPED* pOverlapped\r
1342                 ) PURE;\r
1343 };\r
1344 \r
1345 \r
1346 #undef INTERFACE\r
1347 #define INTERFACE IWVDevice\r
1348 // {244af78c-b1ac-40e4-9896-271d58d591b8}\r
1349 DEFINE_GUID(IID_IWVDevice, 0x244af78c, 0xb1ac, 0x40e4,\r
1350                         0x98, 0x96, 0x27, 0x1d, 0x58, 0xd5, 0x91, 0xb8);\r
1351 \r
1352 DECLARE_INTERFACE_(IWVDevice, IWVOverlapped)\r
1353 {\r
1354         // IUnknown methods\r
1355         __override STDMETHOD(QueryInterface)(\r
1356                 THIS_\r
1357                 REFIID riid,\r
1358                 LPVOID FAR* ppvObj\r
1359                 ) PURE;\r
1360 \r
1361         __override STDMETHOD_(ULONG,AddRef)(\r
1362                 THIS\r
1363                 ) PURE;\r
1364 \r
1365         __override STDMETHOD_(ULONG,Release)(\r
1366                 THIS\r
1367                 ) PURE;\r
1368 \r
1369         // IWVOverlapped methods\r
1370         __override STDMETHOD(CancelOverlappedRequests)(\r
1371                 THIS\r
1372                 ) PURE;\r
1373 \r
1374         __override STDMETHOD(GetOverlappedResult)(\r
1375                 THIS_\r
1376                 __inout_opt OVERLAPPED *pOverlapped,\r
1377                 __out DWORD *pNumberOfBytesTransferred,\r
1378                 __in BOOL bWait\r
1379                 ) PURE;\r
1380 \r
1381         // IWVDevice methods\r
1382         STDMETHOD(Query)(\r
1383                 THIS_\r
1384                 __out WV_DEVICE_ATTRIBUTES* pAttributes\r
1385                 ) PURE;\r
1386 \r
1387         STDMETHOD(QueryPort)(\r
1388                 THIS_\r
1389                 __in UINT8 PortNumber,\r
1390                 __out WV_PORT_ATTRIBUTES* pAttributes\r
1391                 ) PURE;\r
1392 \r
1393         STDMETHOD(QueryGid)(\r
1394                 THIS_\r
1395                 __in UINT8 PortNumber,\r
1396                 __in DWORD Index,\r
1397                 __out WV_GID* pGid\r
1398                 ) PURE;\r
1399 \r
1400         STDMETHOD(QueryPkey)(\r
1401                 THIS_\r
1402                 __in UINT8 PortNumber,\r
1403                 __in DWORD Index,\r
1404                 __out NET16* pPkey\r
1405                 ) PURE;\r
1406 \r
1407         STDMETHOD(CreateCompletionQueue)(\r
1408                 THIS_\r
1409                 __inout SIZE_T *pEntries,\r
1410                 __deref_out IWVCompletionQueue** ppCq\r
1411                 ) PURE;\r
1412 \r
1413         STDMETHOD(AllocateProtectionDomain)(\r
1414                 THIS_\r
1415                 __deref_out IWVProtectionDomain** ppPd\r
1416                 ) PURE;\r
1417 \r
1418         STDMETHOD(Notify)(\r
1419                 THIS_\r
1420                 __in UINT8 PortNumber,\r
1421                 __in_opt OVERLAPPED* pOverlapped,\r
1422                 __out DWORD* pFlags\r
1423                 ) PURE;\r
1424 };\r
1425 \r
1426 \r
1427 #undef INTERFACE\r
1428 #define INTERFACE IWVProvider\r
1429 // {6901010c-17af-4894-a1dc-794d3611f262}\r
1430 DEFINE_GUID(IID_IWVProvider, 0x6901010c, 0x17af, 0x4894,\r
1431                         0xa1, 0xdc, 0x79, 0x4d, 0x36, 0x11, 0xf2, 0x62);\r
1432 \r
1433 DECLARE_INTERFACE_(IWVProvider, IUnknown)\r
1434 {\r
1435         // IUnknown methods\r
1436         __override STDMETHOD(QueryInterface)(\r
1437                 THIS_\r
1438                 REFIID riid,\r
1439                 LPVOID FAR* ppvObj\r
1440                 ) PURE;\r
1441 \r
1442         __override STDMETHOD_(ULONG,AddRef)(\r
1443                 THIS\r
1444                 ) PURE;\r
1445 \r
1446         __override STDMETHOD_(ULONG,Release)(\r
1447                 THIS\r
1448                 ) PURE;\r
1449 \r
1450         // IWVProvider methods\r
1451         STDMETHOD_(HANDLE,GetFileHandle)(\r
1452                 THIS\r
1453                 ) PURE;\r
1454 \r
1455         STDMETHOD(QueryDeviceList)(\r
1456                 THIS_\r
1457                 __inout_bcount_part_opt(*pBufferSize, *pBufferSize) NET64* pGuidList,\r
1458                 __inout SIZE_T* pBufferSize\r
1459                 ) PURE;\r
1460 \r
1461         STDMETHOD(QueryDevice)(\r
1462                 THIS_\r
1463                 __in NET64 Guid,\r
1464                 __out WV_DEVICE_ATTRIBUTES* pAttributes\r
1465                 ) PURE;\r
1466 \r
1467         STDMETHOD(QueryAddressList)(\r
1468                 THIS_\r
1469                 __inout_bcount_part_opt(*pBufferSize, *pBufferSize) WV_ADDRESS_LIST* pAddressList,\r
1470                 __inout SIZE_T* pBufferSize\r
1471                 ) PURE;\r
1472 \r
1473         STDMETHOD(OpenDevice)(\r
1474                 THIS_\r
1475                 __in NET64 Guid,\r
1476                 __deref_out IWVDevice** ppDevice\r
1477                 ) PURE;\r
1478 \r
1479         STDMETHOD(CreateConnectEndpoint)(\r
1480                 THIS_\r
1481                 __deref_out IWVConnectEndpoint** ppConnectEndpoint\r
1482                 ) PURE;\r
1483 \r
1484         STDMETHOD(CreateDatagramEndpoint)(\r
1485                 THIS_\r
1486                 __deref_out IWVDatagramEndpoint** ppDatagramEndpoint\r
1487                 ) PURE;\r
1488 \r
1489         STDMETHOD(CreateListen)(\r
1490                 THIS_\r
1491                 __in const struct sockaddr* pAddress,\r
1492                 __in SIZE_T Backlog,\r
1493                 __deref_out IWVListen** ppListen\r
1494                 ) PURE;\r
1495 };\r
1496 \r
1497 __declspec(dllexport) HRESULT WvGetObject(REFIID riid, LPVOID FAR* ppvObj);\r
1498 \r
1499 #endif // _WINVERBS_H_\r