-
Notifications
You must be signed in to change notification settings - Fork 2
/
coma.go
2698 lines (2607 loc) · 98.5 KB
/
coma.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
// The coma package implements the COMA client protocol.
//
// # Introduction
//
// This document specifies the Component Object Model Plus (COM+) Remote Administration
// Protocol (COMA), which allows clients to manage the configuration of software components
// and to control running instances of these components.
//
// # Overview
//
// The COM+ Remote Administration Protocol (COMA) enables remote clients to register,
// import, remove, configure, control, and monitor components and conglomerations for
// an Object Request Broker (ORB). The server end of the protocol is a conceptual service
// that maintains a catalog of configurations for an ORB. A COMA server exposes interfaces
// that enable a client to manage the catalog and control component instances and instance
// containers.
package coma
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"
dcom "github.com/oiweiwei/go-msrpc/msrpc/dcom"
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)
_ = dtyp.GoPackage
_ = dcom.GoPackage
)
var (
// import guard
GoPackage = "dcom/coma"
)
// PropertyMeta structure represents PropertyMeta RPC structure.
//
// The PropertyMeta structure represents the type, size, and meta-properties (specified
// in this section) of a property in a table.
type PropertyMeta struct {
// dataType: The eDataType (section 2.2.1.2) value that represents the data type of
// the property.
DataType uint32 `idl:"name:dataType" json:"data_type"`
// cbSize: A size, in bytes, associated with the property. The meaning of this value
// depends on the value of the dataType field and whether the fPROPERTY_FIXEDLENGTH
// flag is set in the flags field.
//
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | VALUE OF | FPROPERTY FIXEDLENGTH | |
// | DATATYPE | SET? | MEANING |
// | | | |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_ULONG | - | The fixed size of the property. MUST be set to 0x00000004. |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_GUID | - | The fixed size of the property. MUST be set to 0x00000010 (decimal 16). |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_BYTES | No | The maximum size of the property. A value of 0xFFFFFFFF indicates the property's |
// | | | size is unconstrained. |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_BYTES | Yes | The fixed size of the property. |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_LPWSTR | No | The maximum size of the property. A value of 0xFFFFFFFF indicates the property's |
// | | | size is unconstrained. |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
// | eDT_LPWSTR | Yes | The fixed size of the property. MUST be set to a multiple of 2. |
// +-------------------+----------------------------+----------------------------------------------------------------------------------+
Length uint32 `idl:"name:cbSize" json:"length"`
// flags: A bit field specifying the meta-properties of the property. MUST be a combination
// of zero or more of the following flags.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | | |
// | VALUE | MEANING |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | fPROPERTY_PRIMARYKEY 0x00000001 | This property is part of the primary key for its table. MUST be set if |
// | | fPROPERTY_NOTNULLABLE is set. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | fPROPERTY_NOTNULLABLE 0x00000002 | This property cannot be null. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | fPROPERTY_FIXEDLENGTH 0x00000004 | This eDT_BYTES or eDT_LPWSTR property has a fixed size. MUST NOT be set for |
// | | properties of type eDT_ULONG or eDT_GUID. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | fPROPERTY_NOTPERSISTABLE 0x00000008 | This property contains sensitive data such as passwords that MUST NOT be written |
// | | in plaintext to persistent storage. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | fPROPERTY_CASEINSENSITIVE 0x00000020 | This eDT_LPWSTR property MUST be treated as case-insensitive for purposes of |
// | | comparison. MUST NOT be set for properties of type eDT_ULONG, eDT_GUID, or |
// | | eDT_BYTES. |
// +--------------------------------------+----------------------------------------------------------------------------------+
Flags uint32 `idl:"name:flags" json:"flags"`
}
func (o *PropertyMeta) 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 *PropertyMeta) 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.DataType); err != nil {
return err
}
if err := w.WriteData(o.Length); err != nil {
return err
}
if err := w.WriteData(o.Flags); err != nil {
return err
}
return nil
}
func (o *PropertyMeta) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataType); err != nil {
return err
}
if err := w.ReadData(&o.Length); err != nil {
return err
}
if err := w.ReadData(&o.Flags); err != nil {
return err
}
return nil
}
// ComponentType type represents eComponentType RPC enumeration.
//
// The eComponentType enumeration is used to select a component bitness when multiple
// bitnesses might exist for the same component.
type ComponentType uint16
var (
// eCT_UNKNOWN: The component bitness is unknown to the client. The server MUST
// select the native bitness of the component if it exists; otherwise, the server MUST
// select the non-native bitness of the component.
ComponentTypeUnknown ComponentType = 0
// eCT_32BIT: The server MUST select the 32-bit bitness of the component.
ComponentTypeCt32Bit ComponentType = 1
// eCT_64BIT: The server MUST select the 64-bit bitness of the component.
ComponentTypeCt64Bit ComponentType = 2
// eCT_NATIVE: The server MUST select the native bitness (see section 3.1.4.4) of
// the component.
ComponentTypeNative ComponentType = 4096
)
func (o ComponentType) String() string {
switch o {
case ComponentTypeUnknown:
return "ComponentTypeUnknown"
case ComponentTypeCt32Bit:
return "ComponentTypeCt32Bit"
case ComponentTypeCt64Bit:
return "ComponentTypeCt64Bit"
case ComponentTypeNative:
return "ComponentTypeNative"
}
return "Invalid"
}
// SRPLevelInfo structure represents SRPLevelInfo RPC structure.
//
// The SRPLevelInfo structure defines a software restriction policy trust level, as
// specified in section 3.1.1.1.9, supported by the server.
type SRPLevelInfo struct {
// dwSRPLevel: The numerical identifier of the software restriction policy level.
// This MUST be between 0x00000000 and 0x00040000.
SRPLevel uint32 `idl:"name:dwSRPLevel" json:"srp_level"`
// wszFriendlyName: A user-friendly display name for the software restriction policy
// level.
FriendlyName string `idl:"name:wszFriendlyName;string" json:"friendly_name"`
}
func (o *SRPLevelInfo) 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 *SRPLevelInfo) 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.SRPLevel); err != nil {
return err
}
if o.FriendlyName != "" {
_ptr_wszFriendlyName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if err := ndr.WriteUTF16NString(ctx, w, o.FriendlyName); err != nil {
return err
}
return nil
})
if err := w.WritePointer(&o.FriendlyName, _ptr_wszFriendlyName); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
return nil
}
func (o *SRPLevelInfo) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(9); err != nil {
return err
}
if err := w.ReadData(&o.SRPLevel); err != nil {
return err
}
_ptr_wszFriendlyName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if err := ndr.ReadUTF16NString(ctx, w, &o.FriendlyName); err != nil {
return err
}
return nil
})
_s_wszFriendlyName := func(ptr interface{}) { o.FriendlyName = *ptr.(*string) }
if err := w.ReadPointer(&o.FriendlyName, _s_wszFriendlyName, _ptr_wszFriendlyName); err != nil {
return err
}
return nil
}
// CatServerServices type represents CatSrvServices RPC enumeration.
//
// The CatSrvServices enumeration identifies the optional catalog-related capabilities
// of a COMA server that can be controlled dynamically by the ICapabilitySupport (section
// 3.1.4.19) interface. The current version of COMA defines one such capability, instance
// load balancing.
type CatServerServices uint16
var (
// css_lb: Identifies the instance load balancing capability.
CatServerServicesLoadBalancer CatServerServices = 1
)
func (o CatServerServices) String() string {
switch o {
case CatServerServicesLoadBalancer:
return "CatServerServicesLoadBalancer"
}
return "Invalid"
}
// CatServerServiceState type represents CatSrvServiceState RPC enumeration.
//
// The CatSrvServiceState enumeration identifies possible run-time states for instance
// load balancing.
type CatServerServiceState uint16
var (
// css_serviceStopped: Instance load balancing is not running.
CatServerServiceStateStopped CatServerServiceState = 0
// css_serviceStartPending: Instance load balancing is not yet running, but it is
// in the process of starting.
CatServerServiceStateStartPending CatServerServiceState = 1
// css_serviceStopPending: Instance load balancing is running, but it is in the process
// of stopping.
CatServerServiceStateStopPending CatServerServiceState = 2
// css_serviceRunning: Instance load balancing is running.
CatServerServiceStateRunning CatServerServiceState = 3
// css_serviceContinuePending: Instance load balancing is running, has been paused,
// and is in the process of resuming.
CatServerServiceStateContinuePending CatServerServiceState = 4
// css_servicePausePending: Instance load balancing is running, but it is in the process
// of pausing.
CatServerServiceStatePausePending CatServerServiceState = 5
// css_servicePaused: Instance load balancing is running, but it is paused.
CatServerServiceStatePaused CatServerServiceState = 6
// css_serviceUnknownState: The server was unable to determine the state of instance
// load balancing.
CatServerServiceStateUnknownState CatServerServiceState = 7
)
func (o CatServerServiceState) String() string {
switch o {
case CatServerServiceStateStopped:
return "CatServerServiceStateStopped"
case CatServerServiceStateStartPending:
return "CatServerServiceStateStartPending"
case CatServerServiceStateStopPending:
return "CatServerServiceStateStopPending"
case CatServerServiceStateRunning:
return "CatServerServiceStateRunning"
case CatServerServiceStateContinuePending:
return "CatServerServiceStateContinuePending"
case CatServerServiceStatePausePending:
return "CatServerServiceStatePausePending"
case CatServerServiceStatePaused:
return "CatServerServiceStatePaused"
case CatServerServiceStateUnknownState:
return "CatServerServiceStateUnknownState"
}
return "Invalid"
}
// InstanceContainer structure represents InstanceContainer RPC structure.
//
// The InstanceContainer structure represents an instance container.
type InstanceContainer struct {
// ConglomerationID: The conglomeration identifier of the conglomeration associated
// with the instance container.
ConglomerationID *dtyp.GUID `idl:"name:ConglomerationID" json:"conglomeration_id"`
// PartitionID: The partition identifier of the partition that contains the conglomeration
// associated with the instance container.
PartitionID *dtyp.GUID `idl:"name:PartitionID" json:"partition_id"`
// ContainerID: The activation of the instance container.
ContainerID *dtyp.GUID `idl:"name:ContainerID" json:"container_id"`
// dwProcessID: The value of the instance container's ProcessIdentifier property,
// as described in section 3.1.1.3.21.
ProcessID uint32 `idl:"name:dwProcessID" json:"process_id"`
// bPaused: A flag that indicates whether or not the instance container is paused.
Paused bool `idl:"name:bPaused" json:"paused"`
// bRecycled: A flag that indicates whether or not the instance container has been
// recycled.
Recycled bool `idl:"name:bRecycled" json:"recycled"`
}
func (o *InstanceContainer) 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 *InstanceContainer) 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 o.ConglomerationID != nil {
if err := o.ConglomerationID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if o.PartitionID != nil {
if err := o.PartitionID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if o.ContainerID != nil {
if err := o.ContainerID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteData(o.ProcessID); err != nil {
return err
}
if !o.Paused {
if err := w.WriteData(int32(0)); err != nil {
return err
}
} else {
if err := w.WriteData(int32(1)); err != nil {
return err
}
}
if !o.Recycled {
if err := w.WriteData(int32(0)); err != nil {
return err
}
} else {
if err := w.WriteData(int32(1)); err != nil {
return err
}
}
return nil
}
func (o *InstanceContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(4); err != nil {
return err
}
if o.ConglomerationID == nil {
o.ConglomerationID = &dtyp.GUID{}
}
if err := o.ConglomerationID.UnmarshalNDR(ctx, w); err != nil {
return err
}
if o.PartitionID == nil {
o.PartitionID = &dtyp.GUID{}
}
if err := o.PartitionID.UnmarshalNDR(ctx, w); err != nil {
return err
}
if o.ContainerID == nil {
o.ContainerID = &dtyp.GUID{}
}
if err := o.ContainerID.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadData(&o.ProcessID); err != nil {
return err
}
var _bPaused int32
if err := w.ReadData(&_bPaused); err != nil {
return err
}
o.Paused = _bPaused != 0
var _bRecycled int32
if err := w.ReadData(&_bRecycled); err != nil {
return err
}
o.Recycled = _bRecycled != 0
return nil
}
// Import structure represents IImport RPC structure.
//
// The IImport interface provides methods for importing, as specified in Export and
// Import (section 1.3.7), conglomerations and partitions from installer package files
// and returning information about installer package files. This interface inherits
// from IUnknown, as specified in [MS-DCOM] section 3.1.1.5.8.
//
// To receive incoming remote calls for this interface, the server MUST implement a
// DCOM Object Class with the CLSID CLSID_COMAServer (see section 1.9) using the UUID
// {C2BE6970-DF9E-11D1-8B87-00C04FD7A924} for this interface.
//
// This interface includes the following methods beyond those of IUnknown.
//
// Methods in RPC Opnum Order
//
// +---------------------+---------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +---------------------+---------------------------------------------------------------+
// +---------------------+---------------------------------------------------------------+
// | ImportFromFile | Imports a conglomeration from a file. Opnum: 3 |
// +---------------------+---------------------------------------------------------------+
// | QueryFile | Returns information about an installer package file. Opnum: 4 |
// +---------------------+---------------------------------------------------------------+
// | Opnum5NotUsedOnWire | Reserved for local use. Opnum: 5 |
// +---------------------+---------------------------------------------------------------+
// | Opnum6NotUsedOnWire | Reserved for local use. Opnum: 6 |
// +---------------------+---------------------------------------------------------------+
//
// In the previous table, the phrase "Reserved for local use" means that the client
// MUST NOT send the opnum and the server behavior is undefined since it does not affect
// interoperability.<334>
//
// All methods MUST NOT throw exceptions.
type Import dcom.InterfacePointer
func (o *Import) InterfacePointer() *dcom.InterfacePointer { return (*dcom.InterfacePointer)(o) }
func (o *Import) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Import) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *Import) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *Import) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataCount); err != nil {
return err
}
// XXX: for opaque unmarshaling
if o.DataCount > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.DataCount)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
}
o.Data = make([]byte, sizeInfo[0])
for i1 := range o.Data {
i1 := i1
if err := w.ReadData(&o.Data[i1]); err != nil {
return err
}
}
return nil
}
// CapabilitySupport structure represents ICapabilitySupport RPC structure.
//
// The ICapabilitySupport interface provides methods for starting and stopping optional,
// dynamically controllable, catalog-related capabilities of a COMA server. This version
// of COMA defines one such capability, instance load balancing (section 1.3.9). This
// interface inherits from IUnknown, as specified in [MS-DCOM] section 3.1.1.5.8.
//
// To receive incoming remote calls for this interface, the server MUST implement a
// DCOM Object Class with the CLSID CLSID_COMAServer, specified in section 1.9, using
// the UUID {47CDE9A1-0BF6-11D2-8016-00C04FB9988E} for this interface.
//
// This interface includes the following methods beyond those of IUnknown.
//
// Methods in RPC Opnum Order
//
// +---------------------+---------------------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +---------------------+---------------------------------------------------------------------------+
// +---------------------+---------------------------------------------------------------------------+
// | Start | Starts instance load balancing. Opnum: 3 |
// +---------------------+---------------------------------------------------------------------------+
// | Stop | Stops instance load balancing. Opnum: 4 |
// +---------------------+---------------------------------------------------------------------------+
// | Opnum5NotUsedOnWire | Reserved for local use. Opnum: 5 |
// +---------------------+---------------------------------------------------------------------------+
// | Opnum6NotUsedOnWire | Reserved for local use. Opnum: 6 |
// +---------------------+---------------------------------------------------------------------------+
// | IsInstalled | Determines whether instance load balancing support is installed. Opnum: 7 |
// +---------------------+---------------------------------------------------------------------------+
// | IsRunning | Determines whether instance load balancing is running. Opnum: 8 |
// +---------------------+---------------------------------------------------------------------------+
// | Opnum9NotUsedOnWire | Reserved for local use. Opnum: 9 |
// +---------------------+---------------------------------------------------------------------------+
//
// In the previous table, the phrase "Reserved for local use" means that the client
// MUST NOT send the opnum, and the server behavior is undefined since it does not affect
// interoperability.<348>
//
// All methods MUST NOT throw exceptions.
type CapabilitySupport dcom.InterfacePointer
func (o *CapabilitySupport) InterfacePointer() *dcom.InterfacePointer {
return (*dcom.InterfacePointer)(o)
}
func (o *CapabilitySupport) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *CapabilitySupport) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *CapabilitySupport) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *CapabilitySupport) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataCount); err != nil {
return err
}
// XXX: for opaque unmarshaling
if o.DataCount > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.DataCount)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
}
o.Data = make([]byte, sizeInfo[0])
for i1 := range o.Data {
i1 := i1
if err := w.ReadData(&o.Data[i1]); err != nil {
return err
}
}
return nil
}
// Export2 structure represents IExport2 RPC structure.
//
// The IExport2 interface provides a method for exporting, as specified in Export and
// Import (section 1.3.7), a partition to an installer package file. This interface
// inherits from IUnknown, as specified in [MS-DCOM] section 3.1.1.5.8.
//
// To receive incoming remote calls for this interface, the server MUST implement a
// DCOM Object Class with the CLSID CLSID_COMAServer, as specified in section 1.9, using
// the UUID {F131EA3E-B7BE-480E-A60D-51CB2785779E} for this interface.
//
// This interface includes the following methods beyond those of IUnknown.
//
// Methods in RPC Opnum Order
//
// +-----------------+------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +-----------------+------------------------------------------------------------+
// +-----------------+------------------------------------------------------------+
// | ExportPartition | Exports a partition to an installer package file. Opnum: 3 |
// +-----------------+------------------------------------------------------------+
//
// All methods MUST NOT throw exceptions.
type Export2 dcom.InterfacePointer
func (o *Export2) InterfacePointer() *dcom.InterfacePointer { return (*dcom.InterfacePointer)(o) }
func (o *Export2) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *Export2) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *Export2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *Export2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataCount); err != nil {
return err
}
// XXX: for opaque unmarshaling
if o.DataCount > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.DataCount)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
}
o.Data = make([]byte, sizeInfo[0])
for i1 := range o.Data {
i1 := i1
if err := w.ReadData(&o.Data[i1]); err != nil {
return err
}
}
return nil
}
// CatalogUtils2 structure represents ICatalogUtils2 RPC structure.
//
// The ICatalogUtils2 interface is a miscellaneous utility interface. This interface
// inherits from IUnknown, as specified in [MS-DCOM] section 3.1.1.5.8.
//
// To receive incoming remote calls for this interface, the server MUST implement a
// DCOM Object Class with the CLSID CLSID_COMAServer, as specified in section 1.9, using
// the UUID {C726744E-5735-4F08-8286-C510EE638FB6} for this interface.
//
// This interface includes the following methods beyond those of IUnknown.
//
// Methods in RPC Opnum Order
//
// +----------------------------+----------------------------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +----------------------------+----------------------------------------------------------------------------------+
// +----------------------------+----------------------------------------------------------------------------------+
// | CopyConglomerations | Copies one or more conglomerations from one partition into another partition. |
// | | Opnum: 3 |
// +----------------------------+----------------------------------------------------------------------------------+
// | CopyComponentConfiguration | Copies a component configuration from one conglomeration into another |
// | | conglomeration. Opnum: 4 |
// +----------------------------+----------------------------------------------------------------------------------+
// | AliasComponent | Creates an alias component configuration. Opnum: 5 |
// +----------------------------+----------------------------------------------------------------------------------+
// | MoveComponentConfiguration | Moves a component configuration from one conglomeration into another |
// | | conglomeration. Opnum: 6 |
// +----------------------------+----------------------------------------------------------------------------------+
// | GetEventClassesForIID2 | Returns the event classes associated with an interface identifier (IID). Opnum: |
// | | 7 |
// +----------------------------+----------------------------------------------------------------------------------+
// | IsSafeToDelete | Determines whether it is safe to delete a file. Opnum: 8 |
// +----------------------------+----------------------------------------------------------------------------------+
// | FlushPartitionCache | Flushes a server's local cache of partition user information. Opnum: 9 |
// +----------------------------+----------------------------------------------------------------------------------+
// | EnumerateSRPLevels | Returns a list of software restriction policy levels supported by the server. |
// | | Opnum: 10 |
// +----------------------------+----------------------------------------------------------------------------------+
// | GetComponentVersions | Returns a list of component configurations for a component. Opnum: 11 |
// +----------------------------+----------------------------------------------------------------------------------+
//
// All methods MUST NOT throw exceptions.
type CatalogUtils2 dcom.InterfacePointer
func (o *CatalogUtils2) InterfacePointer() *dcom.InterfacePointer { return (*dcom.InterfacePointer)(o) }
func (o *CatalogUtils2) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *CatalogUtils2) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *CatalogUtils2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *CatalogUtils2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataCount); err != nil {
return err
}
// XXX: for opaque unmarshaling
if o.DataCount > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.DataCount)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
}
o.Data = make([]byte, sizeInfo[0])
for i1 := range o.Data {
i1 := i1
if err := w.ReadData(&o.Data[i1]); err != nil {
return err
}
}
return nil
}
// CatalogSession structure represents ICatalogSession RPC structure.
//
// The ICatalogSession interface provides methods for Catalog Version Negotiation (section
// 3.1.4.1) and for Multiple-partition Support Capability Negotiation (section 3.1.4.3).
// This interface inherits from IUnknown, as specified in [MS-DCOM] section 3.1.1.5.8.
//
// To receive incoming remote calls for this interface, the server MUST implement a
// DCOM Object Class with the CLSID CLSID_COMAServer (see section 1.9) using the UUID
// {182C40FA-32E4-11D0-818B-00A0C9231C29} for this interface.
//
// Besides the methods of IUnknown, this interface includes the following methods.
//
// Methods in RPC Opnum Order
//
// +----------------------+----------------------------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +----------------------+----------------------------------------------------------------------------------+
// +----------------------+----------------------------------------------------------------------------------+
// | Opnum3NotUsedOnWire | Reserved for local use. Opnum: 3 |
// +----------------------+----------------------------------------------------------------------------------+
// | Opnum4NotUsedOnWire | Reserved for local use. Opnum: 4 |
// +----------------------+----------------------------------------------------------------------------------+
// | Opnum5NotUsedOnWire | Reserved for local use. Opnum: 5 |
// +----------------------+----------------------------------------------------------------------------------+
// | Opnum6NotUsedOnWire | Reserved for local use. Opnum: 6 |
// +----------------------+----------------------------------------------------------------------------------+
// | InitializeSession | Performs catalog version negotiation. Opnum: 7 |
// +----------------------+----------------------------------------------------------------------------------+
// | GetServerInformation | Performs capability negotiation for the multiple-partition support capability. |
// | | Opnum: 8 |
// +----------------------+----------------------------------------------------------------------------------+
//