-
Notifications
You must be signed in to change notification settings - Fork 2
/
v1.go
11422 lines (10837 loc) · 398 KB
/
v1.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
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package ieventservice
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"
dcetypes "github.com/oiweiwei/go-msrpc/msrpc/dcetypes"
dtyp "github.com/oiweiwei/go-msrpc/msrpc/dtyp"
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)
_ = dcetypes.GoPackage
_ = dtyp.GoPackage
)
var (
// import guard
GoPackage = "even6"
)
var (
// Syntax UUID
EventServiceSyntaxUUID = &uuid.UUID{TimeLow: 0xf6beaff7, TimeMid: 0x1e19, TimeHiAndVersion: 0x4fbb, ClockSeqHiAndReserved: 0x9f, ClockSeqLow: 0x8f, Node: [6]uint8{0xb8, 0x9e, 0x20, 0x18, 0x33, 0x7c}}
// Syntax ID
EventServiceSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: EventServiceSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)
// IEventService interface.
type EventServiceClient interface {
// The EvtRpcRegisterRemoteSubscription (Opnum 0) method is used by a client to create
// either a push or a pull subscription. In push subscriptions, the server calls the
// client when new events are ready. In pull subscriptions, the client polls the server
// for new events. Subscriptions can be to either a single channel and its associated
// log, or to multiple channels and their logs.
//
// A client can use bookmarks to ensure a reliable subscription even if the client is
// not continuously connected. A client can create a bookmark locally based on the contents
// of an event that the client has processed. If the client disconnects and later reconnects,
// it can use the bookmark to pick up where it left off. For information on bookmarks,
// see section 2.2.14.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RegisterRemoteSubscription(context.Context, *RegisterRemoteSubscriptionRequest, ...dcerpc.CallOption) (*RegisterRemoteSubscriptionResponse, error)
// The EvtRpcRemoteSubscriptionNextAsync (Opnum 1) method is used by a client to request
// asynchronous delivery of events that are delivered to a subscription.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RemoteSubscriptionNextAsync(context.Context, *RemoteSubscriptionNextAsyncRequest, ...dcerpc.CallOption) (*RemoteSubscriptionNextAsyncResponse, error)
// This EvtRpcRemoteSubscriptionNext (Opnum 2) method is a synchronous request for events
// that have been delivered to a subscription. This method is only used for pull subscriptions
// in which the client polls for events. The EvtRpcRemoteSubscriptionWaitAsync (section
// 3.1.4.11) method can be used along with this method to minimize the frequency of
// polling.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success. The
// method MUST return ERROR_TIMEOUT (0x000005b4) if fewer than numRequestedRecords records
// are found within the time-out period. Otherwise, it MUST return a different implementation-specific
// nonzero value as specified in [MS-ERREF].
RemoteSubscriptionNext(context.Context, *RemoteSubscriptionNextRequest, ...dcerpc.CallOption) (*RemoteSubscriptionNextResponse, error)
// Pull subscriptions are subscriptions in which the client requests records. The requests
// can be done by using a polling mechanism. The EvtRpcRemoteSubscriptionWaitAsync (Opnum
// 3) method can be used to enable the client to only poll when results are likely,
// and is typically used in conjunction with the EvtRpcRemoteSubscriptionNext (Opnum
// 2) (section 3.1.4.10) method, which is a blocking call; so this asynchronous method
// is used to provide a way for the caller to not have to block or continuously poll
// the server.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RemoteSubscriptionWaitAsync(context.Context, *RemoteSubscriptionWaitAsyncRequest, ...dcerpc.CallOption) (*RemoteSubscriptionWaitAsyncResponse, error)
// The EvtRpcRegisterControllableOperation (Opnum 4) method obtains a CONTEXT_HANDLE_OPERATION_CONTROL
// handle that can be used to cancel other operations.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RegisterControllableOperation(context.Context, *RegisterControllableOperationRequest, ...dcerpc.CallOption) (*RegisterControllableOperationResponse, error)
// The EvtRpcRegisterLogQuery (Opnum 5) method is used to query one or more channels.
// It can also be used to query a specific file. Actual retrieval of events is done
// by subsequent calls to the EvtRpcQueryNext (section 3.1.4.13) method.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RegisterLogQuery(context.Context, *RegisterLogQueryRequest, ...dcerpc.CallOption) (*RegisterLogQueryResponse, error)
// The EvtRpcClearLog (Opnum 6) method instructs the server to clear all the events
// in a live channel, and optionally, to create a backup event log before the clear
// takes place.
//
// Return Values: The method returns 0 (ERROR_SUCCESS) on success; otherwise, it MUST
// return an implementation-specific nonzero value as specified in [MS-ERREF].
//
// The server does not validate the control handle passed to EvtRpcClearLog and it SHOULD
// assume that this parameter is always valid when the method is invoked.
ClearLog(context.Context, *ClearLogRequest, ...dcerpc.CallOption) (*ClearLogResponse, error)
// The EvtRpcExportLog (Opnum 7) method instructs the server to create a backup event
// log at a specified file name.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
//
// The server does not validate the control handle passed to EvtRpcExportLog, and it
// SHOULD assume that this parameter is always valid when the method is invoked.
ExportLog(context.Context, *ExportLogRequest, ...dcerpc.CallOption) (*ExportLogResponse, error)
// The EvtRpcLocalizeExportLog (Opnum 8) method is used by a client to add localized
// information to a previously created backup event log, because the backup event log
// does not contain the localized strings for event descriptions. An example of how
// this can be useful is if a backup event log needs to be copied to other computers
// so that support personnel on those other computers can access it; if this method
// has been called, such support personnel can access or view the localized backup event
// log, which will then contain events with localized strings. Note that a discussion
// of tools by which administrators or support personnel can work with localized backup
// event log files in scenarios such as this is out of scope with respect to this protocol
// specification.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an error value as specified in the processing rules in this section.<33>
// Callers SHOULD treat all return values other than ERROR_SUCCESS equally and not alter
// their behavior based on any specific error values.
//
// The server does not validate the control handle passed to EvtRpcLocalizeExportLog,
// and it SHOULD assume that this parameter is always valid when the method is invoked.
LocalizeExportLog(context.Context, *LocalizeExportLogRequest, ...dcerpc.CallOption) (*LocalizeExportLogResponse, error)
// The EvtRpcMessageRender (Opnum 9) method is used by a client to get localized descriptive
// strings for an event.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success. The
// method MUST return ERROR_INSUFFICIENT_BUFFER (0x0000007A) if maxSizeString is too
// small to hold the result string. In that case, neededSizeString MUST be set to the
// necessary size. Otherwise, the method MUST return a different implementation-specific
// nonzero value as specified in [MS-ERREF].
MessageRender(context.Context, *MessageRenderRequest, ...dcerpc.CallOption) (*MessageRenderResponse, error)
// The EvtRpcMessageRenderDefault (Opnum 10) method is used by a client to get localized
// strings for common values of opcodes, tasks, or keywords, as specified in section
// 3.1.4.31.
//
// Return Values: The method MUST return the following value on success.
//
// ERROR_SUCCESS (0x00000000)
//
// The method MUST return ERROR_INSUFFICIENT_BUFFER (0x0000007A) if maxSizeString is
// too small to hold the result string. In that case, neededSizeString MUST be set to
// the necessary size.
//
// Otherwise, the method MUST return a different implementation-specific nonzero value
// as specified in [MS-ERREF].
//
// This method is the same as the EvtRpcMessageRender (section 3.1.4.31) method, except
// that this method always uses the server's default strings (default strings come from
// the server's default publisher, so a publisher handle is not required), whereas the
// EvtRpcMessageRender (section 3.1.4.31) method uses only the default strings in the
// case of level, task, opcode, and keyword values that fall in certain ranges. Therefore
// it takes only 6 possible format flags. The server MUST fail the method with ERROR_INVALID_PARAMETER
// (0x00000057) for any other flags than the 6 values given in the flags table.
MessageRenderDefault(context.Context, *MessageRenderDefaultRequest, ...dcerpc.CallOption) (*MessageRenderDefaultResponse, error)
// The EvtRpcQueryNext (Opnum 11) method is used by a client to get the next batch of
// records from a query result set.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success. The
// method MUST return ERROR_TIMEOUT (0x000005bf) if no records are found within the
// time-out period. The method MUST return ERROR_NO_MORE_ITEMS (0x00000103) once the
// query has finished going through all the log(s); otherwise, it MUST return a different
// implementation-specific nonzero value as specified in [MS-ERREF].
QueryNext(context.Context, *QueryNextRequest, ...dcerpc.CallOption) (*QueryNextResponse, error)
// The EvtRpcQuerySeek (Opnum 12) method is used by a client to move a query cursor
// within a result set.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
QuerySeek(context.Context, *QuerySeekRequest, ...dcerpc.CallOption) (*QuerySeekResponse, error)
// The EvtRpcClose (Opnum 13) method is used by a client to close context handles that
// are opened by other methods in this protocol.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
Close(context.Context, *CloseRequest, ...dcerpc.CallOption) (*CloseResponse, error)
// The EvtRpcCancel (Opnum 14) method is used by a client to cancel another method.
// This can be used to terminate long-running methods gracefully. Methods that can be
// canceled include the subscription and query functions, and other functions that take
// a CONTEXT_HANDLE_OPERATION_CONTROL argument.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
Cancel(context.Context, *CancelRequest, ...dcerpc.CallOption) (*CancelResponse, error)
// The EvtRpcAssertConfig (Opnum 15) method indicates to the server that the publisher
// or channel configuration has been updated.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
AssertConfig(context.Context, *AssertConfigRequest, ...dcerpc.CallOption) (*AssertConfigResponse, error)
// The EvtRpcRetractConfig (Opnum 16) method indicates to the server that the publisher
// or channel is to be removed.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
RetractConfig(context.Context, *RetractConfigRequest, ...dcerpc.CallOption) (*RetractConfigResponse, error)
// The EvtRpcOpenLogHandle (Opnum 17) method is used by a client to get information
// about a channel or a backup event log.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
OpenLog(context.Context, *OpenLogRequest, ...dcerpc.CallOption) (*OpenLogResponse, error)
// The EvtRpcGetLogFileInfo (Opnum 18) method is used by a client to get information
// about a live channel or a backup event log.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success. The
// method MUST return ERROR_INSUFFICIENT_BUFFER (0x0000007A) if the buffer is too small;
// otherwise, it MUST return a different implementation-specific nonzero value as specified
// in [MS-ERREF].
GetLogFileInfo(context.Context, *GetLogFileInfoRequest, ...dcerpc.CallOption) (*GetLogFileInfoResponse, error)
// The EvtRpcGetChannelList (Opnum 19) method is used to enumerate the set of available
// channels.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetChannelList(context.Context, *GetChannelListRequest, ...dcerpc.CallOption) (*GetChannelListResponse, error)
// The EvtRpcGetChannelConfig (opnum 20) method is used by a client to get the configuration
// for a channel.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetChannelConfig(context.Context, *GetChannelConfigRequest, ...dcerpc.CallOption) (*GetChannelConfigResponse, error)
// The EvtRpcPutChannelConfig (Opnum 21) method is used by a client to update the configuration
// for a channel.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].<42>
PutChannelConfig(context.Context, *PutChannelConfigRequest, ...dcerpc.CallOption) (*PutChannelConfigResponse, error)
// The EvtRpcGetPublisherList (Opnum 22) method is used by a client to get the list
// of publishers.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetPublisherList(context.Context, *GetPublisherListRequest, ...dcerpc.CallOption) (*GetPublisherListResponse, error)
// The EvtRpcGetPublisherListForChannel (Opnum 23) method is used by a client to get
// the list of publishers that write events to a particular channel.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetPublisherListForChannel(context.Context, *GetPublisherListForChannelRequest, ...dcerpc.CallOption) (*GetPublisherListForChannelResponse, error)
// The EvtRpcGetPublisherMetadata (Opnum 24) method is used by a client to open a handle
// to publisher metadata. It also gets some initial information from the metadata.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetPublisherMetadata(context.Context, *GetPublisherMetadataRequest, ...dcerpc.CallOption) (*GetPublisherMetadataResponse, error)
// The EvtRpcGetPublisherResourceMetadata (Opnum 25) method obtains information from
// the publisher metadata.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetPublisherResourceMetadata(context.Context, *GetPublisherResourceMetadataRequest, ...dcerpc.CallOption) (*GetPublisherResourceMetadataResponse, error)
// The EvtRpcGetEventMetadataEnum (Opnum 26) method obtains a handle for enumerating
// a publisher's event metadata.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetEventMetadataEnum(context.Context, *GetEventMetadataEnumRequest, ...dcerpc.CallOption) (*GetEventMetadataEnumResponse, error)
// The EvtRpcGetNextEventMetadata (Opnum 27) method gets details about a possible event
// and also returns the next event metadata in the enumeration. It is used to enumerate
// through the event definitions for the publisher associated with the handle. The enumeration
// is in the forward direction only, and there is no reset functionality.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetNextEventMetadata(context.Context, *GetNextEventMetadataRequest, ...dcerpc.CallOption) (*GetNextEventMetadataResponse, error)
// The EvtRpcGetClassicLogDisplayName (Opnum 28) method obtains a descriptive name for
// a channel.
//
// Return Values: The method MUST return ERROR_SUCCESS (0x00000000) on success; otherwise,
// it MUST return an implementation-specific nonzero value as specified in [MS-ERREF].
GetClassicLogDisplayName(context.Context, *GetClassicLogDisplayNameRequest, ...dcerpc.CallOption) (*GetClassicLogDisplayNameResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
}
// SubscribePull represents the EvtRpcSubscribePull RPC constant
var SubscribePull = 268435456
// VarFlagsModified represents the EvtRpcVarFlagsModified RPC constant
var VarFlagsModified = 1
// RemoteSubscription structure represents PCONTEXT_HANDLE_REMOTE_SUBSCRIPTION RPC structure.
type RemoteSubscription dcetypes.ContextHandle
func (o *RemoteSubscription) ContextHandle() *dcetypes.ContextHandle {
return (*dcetypes.ContextHandle)(o)
}
func (o *RemoteSubscription) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *RemoteSubscription) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *RemoteSubscription) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// LogQuery structure represents PCONTEXT_HANDLE_LOG_QUERY RPC structure.
type LogQuery dcetypes.ContextHandle
func (o *LogQuery) ContextHandle() *dcetypes.ContextHandle { return (*dcetypes.ContextHandle)(o) }
func (o *LogQuery) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *LogQuery) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *LogQuery) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// Log structure represents PCONTEXT_HANDLE_LOG_HANDLE RPC structure.
type Log dcetypes.ContextHandle
func (o *Log) ContextHandle() *dcetypes.ContextHandle { return (*dcetypes.ContextHandle)(o) }
func (o *Log) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Log) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *Log) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// OperationControl structure represents PCONTEXT_HANDLE_OPERATION_CONTROL RPC structure.
type OperationControl dcetypes.ContextHandle
func (o *OperationControl) ContextHandle() *dcetypes.ContextHandle {
return (*dcetypes.ContextHandle)(o)
}
func (o *OperationControl) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *OperationControl) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *OperationControl) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// PublisherMetadata structure represents PCONTEXT_HANDLE_PUBLISHER_METADATA RPC structure.
type PublisherMetadata dcetypes.ContextHandle
func (o *PublisherMetadata) ContextHandle() *dcetypes.ContextHandle {
return (*dcetypes.ContextHandle)(o)
}
func (o *PublisherMetadata) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *PublisherMetadata) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *PublisherMetadata) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// EventMetadataEnum structure represents PCONTEXT_HANDLE_EVENT_METADATA_ENUM RPC structure.
type EventMetadataEnum dcetypes.ContextHandle
func (o *EventMetadataEnum) ContextHandle() *dcetypes.ContextHandle {
return (*dcetypes.ContextHandle)(o)
}
func (o *EventMetadataEnum) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *EventMetadataEnum) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Attributes); err != nil {
return err
}
if o.UUID != nil {
if err := o.UUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *EventMetadataEnum) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Attributes); err != nil {
return err
}
if o.UUID == nil {
o.UUID = &dtyp.GUID{}
}
if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
}
// Info structure represents RpcInfo RPC structure.
//
// The RpcInfo structure is used for certain methods that return additional information
// about errors.
type Info struct {
// m_error: A Win32 error code that contains a general operation success or failure
// status. A value of 0x00000000 indicates success; any other value indicates failure.
// Unless noted otherwise, all failure values MUST be treated equally.
Error uint32 `idl:"name:m_error" json:"error"`
// m_subErr: MUST be zero unless specified otherwise in the method using this structure.
// Unless noted otherwise, all nonzero values MUST be treated equally.
SubError uint32 `idl:"name:m_subErr" json:"sub_error"`
// m_subErrParam: MUST be zero unless specified otherwise in the method using this
// structure. Unless noted otherwise, all nonzero values MUST be treated equally.
SubErrorParam uint32 `idl:"name:m_subErrParam" json:"sub_error_param"`
}
func (o *Info) xxx_PreparePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Info) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.Error); err != nil {
return err
}
if err := w.WriteData(o.SubError); err != nil {
return err
}
if err := w.WriteData(o.SubErrorParam); err != nil {
return err
}
return nil
}
func (o *Info) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.Error); err != nil {
return err
}
if err := w.ReadData(&o.SubError); err != nil {
return err
}
if err := w.ReadData(&o.SubErrorParam); err != nil {
return err
}
return nil
}
// BooleanArray structure represents BooleanArray RPC structure.
//
// The BooleanArray structure is defined as follows.
type BooleanArray struct {
// count: A 32-bit unsigned integer that contains the number of BOOLEAN values pointed
// to by ptr.
Count uint32 `idl:"name:count" json:"count"`
// ptr: A pointer to an array of BOOLEAN values.
Array []bool `idl:"name:ptr;size_is:(count)" json:"array"`
}
func (o *BooleanArray) xxx_PreparePayload(ctx context.Context) error {
if o.Array != nil && o.Count == 0 {
o.Count = uint32(len(o.Array))
}
if o.Count > uint32(524288) {
return fmt.Errorf("Count is out of range")
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *BooleanArray) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(9); err != nil {
return err
}
if err := w.WriteData(o.Count); err != nil {
return err
}
if o.Array != nil || o.Count > 0 {
_ptr_ptr := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
dimSize1 := uint64(o.Count)
if err := w.WriteSize(dimSize1); err != nil {
return err
}
sizeInfo := []uint64{
dimSize1,
}
for i1 := range o.Array {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Array[i1]); err != nil {
return err
}
}
for i1 := len(o.Array); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(false); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.Array, _ptr_ptr); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
return nil
}
func (o *BooleanArray) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(9); err != nil {
return err
}
if err := w.ReadData(&o.Count); err != nil {
return err
}
_ptr_ptr := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
sizeInfo := []uint64{
0,
}
for sz1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
return err
}
}
// XXX: for opaque unmarshaling
if o.Count > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.Count)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Array", sizeInfo[0])
}
o.Array = make([]bool, sizeInfo[0])
for i1 := range o.Array {
i1 := i1
if err := w.ReadData(&o.Array[i1]); err != nil {
return err
}
}
return nil
})
_s_ptr := func(ptr interface{}) { o.Array = *ptr.(*[]bool) }
if err := w.ReadPointer(&o.Array, _s_ptr, _ptr_ptr); err != nil {
return err
}
return nil
}
// Uint32Array structure represents UInt32Array RPC structure.
//
// The UInt32Array structure is defined as follows.
type Uint32Array struct {
// count: An unsigned 32-bit integer that contains the number of unsigned 32-bit integers
// pointed to by ptr.
Count uint32 `idl:"name:count" json:"count"`
// ptr: A pointer to an array of unsigned 32-bit integers.
Array []uint32 `idl:"name:ptr;size_is:(count)" json:"array"`
}
func (o *Uint32Array) xxx_PreparePayload(ctx context.Context) error {
if o.Array != nil && o.Count == 0 {
o.Count = uint32(len(o.Array))
}
if o.Count > uint32(524288) {
return fmt.Errorf("Count is out of range")
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Uint32Array) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(9); err != nil {
return err
}
if err := w.WriteData(o.Count); err != nil {
return err
}
if o.Array != nil || o.Count > 0 {
_ptr_ptr := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
dimSize1 := uint64(o.Count)
if err := w.WriteSize(dimSize1); err != nil {
return err
}
sizeInfo := []uint64{
dimSize1,
}
for i1 := range o.Array {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Array[i1]); err != nil {
return err
}
}
for i1 := len(o.Array); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint32(0)); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.Array, _ptr_ptr); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
return nil
}
func (o *Uint32Array) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(9); err != nil {
return err
}
if err := w.ReadData(&o.Count); err != nil {
return err
}
_ptr_ptr := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
sizeInfo := []uint64{
0,
}
for sz1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
return err
}
}
// XXX: for opaque unmarshaling
if o.Count > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.Count)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Array", sizeInfo[0])
}
o.Array = make([]uint32, sizeInfo[0])
for i1 := range o.Array {
i1 := i1
if err := w.ReadData(&o.Array[i1]); err != nil {
return err
}
}
return nil
})
_s_ptr := func(ptr interface{}) { o.Array = *ptr.(*[]uint32) }
if err := w.ReadPointer(&o.Array, _s_ptr, _ptr_ptr); err != nil {
return err
}
return nil
}
// Uint64Array structure represents UInt64Array RPC structure.
//
// The UInt64Array structure is defined as follows.
type Uint64Array struct {
// count: A 32-bit unsigned integer that contains the number of 64-bit integers pointed
// to by ptr.
Count uint32 `idl:"name:count" json:"count"`
// ptr: A pointer to an array of unsigned 64-bit integers.
Array []uint64 `idl:"name:ptr;size_is:(count)" json:"array"`
}
func (o *Uint64Array) xxx_PreparePayload(ctx context.Context) error {
if o.Array != nil && o.Count == 0 {
o.Count = uint32(len(o.Array))
}
if o.Count > uint32(262144) {
return fmt.Errorf("Count is out of range")
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Uint64Array) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(9); err != nil {
return err
}
if err := w.WriteData(o.Count); err != nil {
return err
}
if o.Array != nil || o.Count > 0 {
_ptr_ptr := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
dimSize1 := uint64(o.Count)
if err := w.WriteSize(dimSize1); err != nil {
return err
}
sizeInfo := []uint64{
dimSize1,
}
for i1 := range o.Array {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Array[i1]); err != nil {
return err
}
}
for i1 := len(o.Array); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint64(0)); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.Array, _ptr_ptr); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
return nil
}
func (o *Uint64Array) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(9); err != nil {
return err
}
if err := w.ReadData(&o.Count); err != nil {
return err
}
_ptr_ptr := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
sizeInfo := []uint64{
0,
}
for sz1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
return err
}
}
// XXX: for opaque unmarshaling
if o.Count > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.Count)