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