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