-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.go
602 lines (579 loc) · 26.8 KB
/
server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
package remoteread
import (
"context"
"fmt"
"strings"
"unicode/utf16"
dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
ndr "github.com/oiweiwei/go-msrpc/ndr"
)
var (
_ = context.Background
_ = fmt.Errorf
_ = utf16.Encode
_ = strings.TrimPrefix
_ = ndr.ZeroString
_ = (*uuid.UUID)(nil)
_ = (*dcerpc.SyntaxID)(nil)
_ = (*errors.Error)(nil)
)
// RemoteRead server interface.
type RemoteReadServer interface {
// The R_GetServerPort method returns the RPC endpoint port for the client to use in
// subsequent method calls on the RemoteRead interface.
//
// Return Values: On success, this method MUST return a nonzero TCP port value for the
// RPC interface. If an error occurs, the server MUST return 0x00000000.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
//
// As specified in section 3.1.3, this protocol configures a fixed listening endpoint
// at an RPC port number that can vary. This method returns the RPC port number determined
// at server initialization time.
GetServerPort(context.Context, *GetServerPortRequest) (*GetServerPortResponse, error)
// Opnum1NotUsedOnWire operation.
// Opnum1NotUsedOnWire
// The R_OpenQueue method opens a queue in preparation for subsequent operations against
// it. This method MUST be called prior to calling any of the following operations:
//
// * R_CreateCursor (Opnum 4) (section 3.1.4.4) ( 142d17a9-7fb3-481a-8d07-2170fd22e5ec
// )
//
// * R_CloseCursor (Opnum 5) (section 3.1.4.5) ( dee84ebb-3d4a-4c26-ab11-3fa3b6e1acbe
// )
//
// * R_PurgeQueue (Opnum 6) (section 3.1.4.6) ( 9807ff2d-be58-456c-ac96-be23be8561f4
// )
//
// * R_StartReceive (Opnum 7) (section 3.1.4.7) ( 1bd20827-f774-4279-ae8d-4898d6faf6e9
// )
//
// * R_CancelReceive (Opnum 8) (section 3.1.4.8) ( 471d411a-2757-478e-b121-ef24ad0543a5
// )
//
// * R_EndReceive (Opnum 9) (section 3.1.4.9) ( 7e10ff5b-2991-4d73-b712-f3916bf4e85d
// )
//
// * R_MoveMessage (Opnum 10) (section 3.1.4.10) ( 81c28eb5-5658-4089-b8ac-7edc5d629e28
// ) for the source queue only.
//
// * R_StartTransactionalReceive (Opnum 13) (section 3.1.4.13) ( c5296e0c-9e12-4fe8-a25d-56924982ac3e
// )
//
// * R_SetUserAcknowledgementClass (Opnum 14) (section 3.1.4.14) ( add5b3ed-7b02-48df-af90-a304ed0b9eea
// )
//
// * R_EndTransactionalReceive (Opnum 15) (section 3.1.4.15) ( f15f7fba-9259-4641-ab05-08a0485f5a8a
// )
//
// This method returns a QUEUE_CONTEXT_HANDLE_SERIALIZE (section 2.2.4.2) handle value,
// which is required as input in the operations listed preceding.
//
// Return Values: The method has no return values. If the method fails, an RPC exception
// is thrown.
//
// Exceptions Thrown:
//
// In addition to the exceptions thrown by the underlying RPC protocol, as specified
// in [MS-RPCE], the method throws HRESULT failure codes as RPC exceptions. The client
// MUST treat all thrown HRESULT codes identically. The client MUST disregard all output
// parameter values when any failure HRESULT is thrown.
OpenQueue(context.Context, *OpenQueueRequest) (*OpenQueueResponse, error)
// The R_CloseQueue method closes a QUEUE_CONTEXT_HANDLE_SERIALIZE (section 2.2.4.2)
// handle that was previously opened by using a call to the R_OpenQueue (Opnum 2) (section
// 3.1.4.2) method or the R_OpenQueueForMove (Opnum 11) (section 3.1.4.11) method.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
CloseQueue(context.Context, *CloseQueueRequest) (*CloseQueueResponse, error)
// The R_CreateCursor method creates a cursor and returns a handle to it. The handle
// can be used in subsequent calls to the R_StartReceive (Opnum 7) (section 3.1.4.7)
// method or the R_StartTransactionalReceive (Opnum 13) (section 3.1.4.13) method to
// specify a relative location in the queue from which to receive a message.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure, and the client MUST treat all
// failure HRESULTs identically.
//
// The client MUST disregard all out-parameter values when any failure HRESULT is returned.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
CreateCursor(context.Context, *CreateCursorRequest) (*CreateCursorResponse, error)
// The R_CloseCursor method closes the handle for a previously created cursor. The client
// MUST call this method to reclaim resources on the server allocated by the R_CreateCursor
// (Opnum 4) (section 3.1.4.4) method.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those that are thrown by the underlying RPC protocol,
// as specified in [MS-RPCE].
CloseCursor(context.Context, *CloseCursorRequest) (*CloseCursorResponse, error)
// The R_PurgeQueue method removes all messages from the queue.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
PurgeQueue(context.Context, *PurgeQueueRequest) (*PurgeQueueResponse, error)
// The R_StartReceive method peeks or receives a message from an open queue.
//
// If the R_StartReceive method is invoked with a Peek action type, as specified in
// the ulAction parameter, the operation completes when the R_StartReceive method returns.
//
// If the R_StartReceive method is invoked with a Receive action type, as specified
// in the ulAction parameter, the client MUST pair each call to the R_StartReceive method
// with a call to the R_EndReceive (Opnum 9) (section 3.1.4.9) method to complete the
// operation, or to the R_CancelReceive (Opnum 8) (section 3.1.4.8) method to cancel
// the operation. The call to the R_EndReceive method or the R_CancelReceive method
// is correlated to a call to the R_StartReceive method through matching dwRequestId
// parameters.
//
// If the client specifies a nonzero ulTimeout parameter, and a message is not available
// in the queue at the time of the call, the server waits up to the specified time-out
// for a message to become available in the queue before responding to the call. The
// client can call the R_CancelReceive method with a matching dwRequestId parameter
// to cancel the pending R_StartReceive method request.
//
// The message to be returned can be specified in one of three ways:
//
// * LookupId: A nonzero LookupId parameter value specifies the unique identifier for
// the message to be returned. The ulAction parameter further specifies whether the
// message to be returned is the one identified by the LookupId parameter or the first
// unlocked message immediately preceding or following it. For more details, see the
// description of the ulAction parameter.
//
// * Cursor: A nonzero cursor ( b23ea276-dfad-4083-bc48-d0f8a40255fd#gt_aa5e9c2d-16c1-4301-8bfe-18a0913ed275
// ) handle specifies the cursor to be used to identify the message to be returned.
// The cursor specifies a location in the queue. The ulAction parameter further specifies
// whether the message to be returned is the one identified by the cursor or the first
// unlocked message immediately following it. For more details, see the description
// of the ulAction parameter.
//
// * First: if the LookupId parameter is set to zero and the hCursor parameter is set
// to zero, the first unlocked message in the queue can be returned. The ulAction parameter
// further specifies whether the first message is to be received or peeked.
//
// The ppPacketSections parameter is the address of one or more pointers to one or more
// SectionBuffer (section 2.2.6) structures. The pSectionBuffer member of the first
// SectionBuffer structure points to the beginning of the message packet. If more than
// one SectionBuffer structure is present, the packet sections are concatenated in the
// order in which they appear in the array to form the entire packet. The size of each
// section is stored in the SectionSizeAlloc member of the SectionBuffer structure.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically. The client MUST disregard all output parameter
// values when any failure HRESULT is returned. For descriptions of the following error
// codes, see [MS-MQMQ] section 2.4. For error codes not described in [MS-MQMQ], refer
// to [MSDN-MQEIC].
//
// +----------------------------------------------+-------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+-------------+
// +----------------------------------------------+-------------+
// | 0x00000000 MQ_OK | |
// +----------------------------------------------+-------------+
// | 0xC00E0007 MQ_ERROR_INVALID_HANDLE | |
// +----------------------------------------------+-------------+
// | 0xC00E001B MQ_ERROR_IO_TIMEOUT | |
// +----------------------------------------------+-------------+
// | 0xC00E0088 MQ_ERROR_MESSAGE_NOT_FOUND | |
// +----------------------------------------------+-------------+
// | 0xC00E001D MQ_ERROR_MESSAGE_ALREADY_RECEIVED | |
// +----------------------------------------------+-------------+
// | 0xC00E0008 MQ_ERROR_OPERATION_CANCELLED | |
// +----------------------------------------------+-------------+
// | 0xC00E0006 MQ_ERROR_INVALID_PARAMETER | |
// +----------------------------------------------+-------------+
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
StartReceive(context.Context, *StartReceiveRequest) (*StartReceiveResponse, error)
// The R_CancelReceive method cancels a pending call to the R_StartReceive (Opnum 7)
// (section 3.1.4.7) method or the R_StartTransactionalReceive (Opnum 13) (section 3.1.4.13)
// method. Each of those methods takes a time-out parameter that can cause the server
// to not return a response until a message becomes available or the time-out expires.
// The R_CancelReceive method provides a way for the client to cancel a blocked request.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
CancelReceive(context.Context, *CancelReceiveRequest) (*CancelReceiveResponse, error)
// The client MUST invoke the R_EndReceive method to advise the server that the message
// packet returned by the R_StartReceive (Opnum 7) (section 3.1.4.7) method has been
// received.
//
// The combination of the R_StartReceive method and the positive acknowledgment of the
// R_EndReceive method ensures that a message packet is not lost in transit from the
// server to the client due to a network outage during the call sequence.
//
// Note that a call to the R_StartTransactionalReceive (Opnum 13) (section 3.1.4.13)
// method is ended through a corresponding call to the R_EndTransactionalReceive (Opnum
// 15) (section 3.1.4.15) method, not through a call to this method.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol [MS-RPCE].
EndReceive(context.Context, *EndReceiveRequest) (*EndReceiveResponse, error)
// The R_MoveMessage method moves a message from one queue to another.<20> The source
// and destination queues MUST be related as follows:
//
// * The source is a queue, and the destination is a subqueue ( b23ea276-dfad-4083-bc48-d0f8a40255fd#gt_328fe8aa-d006-44dd-8cc8-dba7c862aaf8
// ) of the source queue, or
//
// * The destination is a queue, and the source is a subqueue of the destination queue,
// or
//
// * The source and destination are two subqueues of the same queue.
//
// HRESULT R_MoveMessage(
//
// [in] handle_t hBind,
//
// [in] QUEUE_CONTEXT_HANDLE_NOSERIALIZE phContextFrom,
//
// [in] ULONGLONG ullContextTo,
//
// [in] ULONGLONG LookupId,
//
// * );
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client treat
// all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
//
// The R_MoveMessage method provides both transactional and non-transactional operations.
// When using a transaction identifier, this method provisionally moves a message from
// the source queue to the destination queue, pending notification of the transaction
// outcome. See section 3.1.6. The non-transactional operation moves a message from
// the source queue to the destination queue without enlisting in a transaction.
MoveMessage(context.Context, *MoveMessageRequest) (*MoveMessageResponse, error)
// The R_OpenQueueForMove method opens the queue and returns a QUEUE_CONTEXT_HANDLE_SERIALIZE
// (section 2.2.4.2) handle that can subsequently be used as the ullContextTo (destination
// queue) parameter of a call to the R_MoveMessage (Opnum 10) (section 3.1.4.10) method.
// This method MUST be called before the R_MoveMessage method.<21>
//
// Return Values: The method has no return values. If the method fails, an RPC exception
// is thrown.
//
// Exceptions Thrown:
//
// In addition to the exceptions thrown by the underlying RPC protocol [MS-RPCE], the
// method throws HRESULT failure codes as RPC exceptions. The client MUST treat all
// thrown HRESULT codes identically.
//
// The client MUST disregard all out-parameter values when any failure HRESULT is thrown.
OpenQueueForMove(context.Context, *OpenQueueForMoveRequest) (*OpenQueueForMoveResponse, error)
// The R_QMEnlistRemoteTransaction method propagates a distributed atomic transaction
// context to the server. The server MUST enlist in the transaction context. The client
// MUST call this method prior to the R_StartTransactionalReceive (Opnum 13) (section
// 3.1.4.13) method or the R_MoveMessage (Opnum 10) (section 3.1.4.10) method calls.<27>
// Subsequent calls to the R_StartTransactionalReceive method and the R_MoveMessage
// method that use the same transaction identifier are coordinated such that either
// all occur or none occurs, depending on whether the transaction outcome is Commit
// or Rollback.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// MQ_OK (0x00000000)
//
// Exceptions Thrown:
//
// No exceptions are thrown except those that are thrown by the underlying RPC protocol,
// as specified in [MS-RPCE].
EnlistRemoteTransaction(context.Context, *EnlistRemoteTransactionRequest) (*EnlistRemoteTransactionResponse, error)
// The R_StartTransactionalReceive method peeks or receives a message from the opened
// queue.<29> If a transaction identifier is provided, a message is received inside
// the specified transaction.
//
// If the R_StartTransactionalReceive method is invoked with a Peek action type, as
// specified in the ulAction parameter, the operation completes when the R_StartTransactionalReceive
// method returns.
//
// If the R_StartTransactionalReceive method is invoked with a Receive action type,
// as specified in the ulAction parameter, the client MUST pair each call to the R_StartTransactionalReceive
// method with a call to the R_EndTransactionalReceive (Opnum 15) (section 3.1.4.15)
// method to complete the operation or to the R_CancelReceive (Opnum 8) (section 3.1.4.8)
// method to cancel the operation. The call to the R_EndTransactionalReceive method
// or the R_CancelReceive method is correlated to a call to the R_StartTransactionalReceive
// method through matching dwRequestId parameters.
//
// If the client specifies a nonzero ulTimeout parameter and a message is not available
// in the queue at the time of the call, the server waits up to the specified time-out
// for a message to become available in the queue before responding to the call. The
// client can call the R_CancelReceive method with a matching dwRequestId parameter
// to cancel the pending R_StartTransactionalReceive method request.
//
// The message to be returned can be specified in one of three ways:
//
// * LookupId: A nonzero LookupId parameter value that specifies the unique identifier
// for the message to be returned. The ulAction parameter further specifies whether
// the message to be returned is the one identified by the LookupId parameter or the
// first unlocked message immediately preceding or following it. For more details, see
// the description of the ulAction parameter.
//
// * Cursor: A nonzero cursor ( b23ea276-dfad-4083-bc48-d0f8a40255fd#gt_aa5e9c2d-16c1-4301-8bfe-18a0913ed275
// ) handle that specifies the cursor to be used to identify the message to be returned.
// The cursor specifies a location in the queue. The ulAction parameter further specifies
// whether the message to be returned is the one identified by the cursor or the first
// unlocked message immediately following it. For more details, see the description
// of the ulAction parameter.
//
// * First: If the LookupId parameter is set to 0x0000000000000000 and hCursor is set
// to 0x00000000, the first unlocked message in the queue can be returned. For more
// details, see the description of the ulAction parameter.
//
// The ppPacketSections parameter is the address of one or more pointers to one or more
// SectionBuffer (section 2.2.6) structures. The pSectionBuffer member of the first
// SectionBuffer structure points to the beginning of the message packet. If more than
// one SectionBuffer structure is present, the packet sections are concatenated in the
// order in which they appear in the array to form the entire packet. The size of each
// section is stored in the SectionSizeAlloc member of the SectionBuffer structure.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically. The client MUST disregard all output parameter
// values when any failure HRESULT is returned.
//
// +-----------------------------------------+-------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------------+-------------+
// +-----------------------------------------+-------------+
// | 0x00000000 MQ_OK | |
// +-----------------------------------------+-------------+
// | 0xC00E0007 MQ_ERROR_INVALID_HANDLE | |
// +-----------------------------------------+-------------+
// | 0xC00E0088 MQ_ERROR_MESSAGE_NOT_FOUND | |
// +-----------------------------------------+-------------+
// | 0xC00E001B MQ_ERROR_IO_TIMEOUT | |
// +-----------------------------------------+-------------+
// | 0xC00E0050 MQ_ERROR_TRANSACTION_USAGE | |
// +-----------------------------------------+-------------+
// | 0xC00E0008 MQ_ERROR_OPERATION_CANCELLED | |
// +-----------------------------------------+-------------+
// | 0xC00E0006 MQ_ERROR_INVALID_PARAMETER | |
// +-----------------------------------------+-------------+
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
StartTransactionalReceive(context.Context, *StartTransactionalReceiveRequest) (*StartTransactionalReceiveResponse, error)
// The R_SetUserAcknowledgementClass method sets the acknowledgment class property of
// a message in the queue. This allows marking the message as rejected.<30> This method
// MUST be called subsequent to calls to R_StartTransactionalReceive and R_EndTransactionalReceive
// (Opnum 15) (section 3.1.4.15) and before the transaction is committed or aborted.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// MQ_OK (0x00000000)
//
// MQ_ERROR_INVALID_HANDLE (0xC00E0007)
//
// MQ_ERROR_TRANSACTION_USAGE (0xC00E0050)
//
// MQ_ERROR_MESSAGE_NOT_FOUND (0xC00E0088)
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
SetUserAcknowledgementClass(context.Context, *SetUserAcknowledgementClassRequest) (*SetUserAcknowledgementClassResponse, error)
// The client MUST invoke the R_EndTransactionalReceive method to advise the server
// that the message packet returned by the R_StartTransactionalReceive (Opnum 13) (section
// 3.1.4.13) method has been received by the client.<31>
//
// The combination of the R_StartTransactionalReceive method and the positive acknowledgment
// of the R_EndTransactionalReceive method ensures that a message packet is not lost
// in transit from the server to the client due to a network outage during the call
// sequence.
//
// Return Values: On success, this method MUST return MQ_OK (0x00000000).
//
// If an error occurs, the server MUST return a failure HRESULT, and the client MUST
// treat all failure HRESULTs identically.
//
// Exceptions Thrown:
//
// No exceptions are thrown except those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
EndTransactionalReceive(context.Context, *EndTransactionalReceiveRequest) (*EndTransactionalReceiveResponse, error)
}
func RegisterRemoteReadServer(conn dcerpc.Conn, o RemoteReadServer, opts ...dcerpc.Option) {
conn.RegisterServer(NewRemoteReadServerHandle(o), append(opts, dcerpc.WithAbstractSyntax(RemoteReadSyntaxV1_0))...)
}
func NewRemoteReadServerHandle(o RemoteReadServer) dcerpc.ServerHandle {
return func(ctx context.Context, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
return RemoteReadServerHandle(ctx, o, opNum, r)
}
}
func RemoteReadServerHandle(ctx context.Context, o RemoteReadServer, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
switch opNum {
case 0: // R_GetServerPort
in := &GetServerPortRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetServerPort(ctx, in)
return resp.xxx_ToOp(ctx), err
case 1: // Opnum1NotUsedOnWire
// Opnum1NotUsedOnWire
return nil, nil
case 2: // R_OpenQueue
in := &OpenQueueRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.OpenQueue(ctx, in)
return resp.xxx_ToOp(ctx), err
case 3: // R_CloseQueue
in := &CloseQueueRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.CloseQueue(ctx, in)
return resp.xxx_ToOp(ctx), err
case 4: // R_CreateCursor
in := &CreateCursorRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.CreateCursor(ctx, in)
return resp.xxx_ToOp(ctx), err
case 5: // R_CloseCursor
in := &CloseCursorRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.CloseCursor(ctx, in)
return resp.xxx_ToOp(ctx), err
case 6: // R_PurgeQueue
in := &PurgeQueueRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.PurgeQueue(ctx, in)
return resp.xxx_ToOp(ctx), err
case 7: // R_StartReceive
in := &StartReceiveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.StartReceive(ctx, in)
return resp.xxx_ToOp(ctx), err
case 8: // R_CancelReceive
in := &CancelReceiveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.CancelReceive(ctx, in)
return resp.xxx_ToOp(ctx), err
case 9: // R_EndReceive
in := &EndReceiveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.EndReceive(ctx, in)
return resp.xxx_ToOp(ctx), err
case 10: // R_MoveMessage
in := &MoveMessageRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.MoveMessage(ctx, in)
return resp.xxx_ToOp(ctx), err
case 11: // R_OpenQueueForMove
in := &OpenQueueForMoveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.OpenQueueForMove(ctx, in)
return resp.xxx_ToOp(ctx), err
case 12: // R_QMEnlistRemoteTransaction
in := &EnlistRemoteTransactionRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.EnlistRemoteTransaction(ctx, in)
return resp.xxx_ToOp(ctx), err
case 13: // R_StartTransactionalReceive
in := &StartTransactionalReceiveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.StartTransactionalReceive(ctx, in)
return resp.xxx_ToOp(ctx), err
case 14: // R_SetUserAcknowledgementClass
in := &SetUserAcknowledgementClassRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetUserAcknowledgementClass(ctx, in)
return resp.xxx_ToOp(ctx), err
case 15: // R_EndTransactionalReceive
in := &EndTransactionalReceiveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.EndTransactionalReceive(ctx, in)
return resp.xxx_ToOp(ctx), err
}
return nil, nil
}