-
Notifications
You must be signed in to change notification settings - Fork 2
/
v0.go
777 lines (729 loc) · 22.7 KB
/
v0.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
package iwbemremoterefresher
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"
iunknown "github.com/oiweiwei/go-msrpc/msrpc/dcom/iunknown/v0"
wmi "github.com/oiweiwei/go-msrpc/msrpc/dcom/wmi"
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)
_ = dcom.GoPackage
_ = iunknown.GoPackage
_ = wmi.GoPackage
)
var (
// import guard
GoPackage = "dcom/wmi"
)
var (
// IWbemRemoteRefresher interface identifier f1e9c5b2-f59b-11d2-b362-00105a1f8177
RemoteRefresherIID = &dcom.IID{Data1: 0xf1e9c5b2, Data2: 0xf59b, Data3: 0x11d2, Data4: []byte{0xb3, 0x62, 0x00, 0x10, 0x5a, 0x1f, 0x81, 0x77}}
// Syntax UUID
RemoteRefresherSyntaxUUID = &uuid.UUID{TimeLow: 0xf1e9c5b2, TimeMid: 0xf59b, TimeHiAndVersion: 0x11d2, ClockSeqHiAndReserved: 0xb3, ClockSeqLow: 0x62, Node: [6]uint8{0x0, 0x10, 0x5a, 0x1f, 0x81, 0x77}}
// Syntax ID
RemoteRefresherSyntaxV0_0 = &dcerpc.SyntaxID{IfUUID: RemoteRefresherSyntaxUUID, IfVersionMajor: 0, IfVersionMinor: 0}
)
// IWbemRemoteRefresher interface.
type RemoteRefresherClient interface {
// IUnknown retrieval method.
Unknown() iunknown.UnknownClient
// The IWbemRemoteRefresher::RemoteRefresh method MUST return the updated collection
// of CIM instances and enumerations previously configured by the IWbemRefreshingServices
// interface pointer.
//
// Return Values: This method MUST return an HRESULT value that MUST indicate the status
// of the method call.
//
// The server MUST return WBEM_S_NO_ERROR (specified in section 2.2.11) to indicate
// the successful completion of the method.
//
// The IWbemRemoteRefresher::RemoteRefresh method MUST be called on the IWbemRemoteRefresher
// interface pointer returned as a member of the _WBEM_REFRESH_INFO structure from IWbemRefreshingServices
// methods or on the interface returned by IWbemRefreshingServices::GetRemoteRefresher
// method invocation.
RemoteRefresh(context.Context, *RemoteRefreshRequest, ...dcerpc.CallOption) (*RemoteRefreshResponse, error)
// The IWbemRemoteRefresher::StopRefreshing method MUST remove a set of CIM instances
// or enumerations from the collection previously configured by the IWbemRefreshingServices
// interface pointer.
//
// Return Values: This method MUST return an HRESULT value that MUST indicate the status
// of the method call. In case of success, the server MUST return WBEM_S_NO_ERROR (as
// specified in section 2.2.11) to indicate the successful completion of the method.
//
// The IWbemRemoteRefresher::StopRefreshing method MUST be called on the IWbemRemoteRefresher
// interface pointer that is returned as a member of the _WBEM_REFRESH_INFO structure
// from the methods of the IWbemRefreshingServices interface or on the interface that
// is returned by the IWbemRefreshingServices::GetRemoteRefresher method invocation.
StopRefreshing(context.Context, *StopRefreshingRequest, ...dcerpc.CallOption) (*StopRefreshingResponse, error)
// The IWbemRemoteRefresher::Opnum5NotUsedOnWire method MUST return a random GUID that
// identifies the server object that receives the call.
//
//
// Return Values: This method MUST return an HRESULT value that MUST indicate the status
// of the method call. The server MUST return WBEM_S_NO_ERROR (specified in section
// 2.2.11) to indicate the successful completion of the method.
//
// Opnum5NotUsedOnWire
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
// IPID sets the object interface identifier.
IPID(context.Context, *dcom.IPID) RemoteRefresherClient
}
type xxx_DefaultRemoteRefresherClient struct {
iunknown.UnknownClient
cc dcerpc.Conn
ipid *dcom.IPID
}
func (o *xxx_DefaultRemoteRefresherClient) Unknown() iunknown.UnknownClient {
return o.UnknownClient
}
func (o *xxx_DefaultRemoteRefresherClient) RemoteRefresh(ctx context.Context, in *RemoteRefreshRequest, opts ...dcerpc.CallOption) (*RemoteRefreshResponse, error) {
op := in.xxx_ToOp(ctx)
if _, ok := dcom.HasIPID(opts); !ok {
if o.ipid != nil {
opts = append(opts, dcom.WithIPID(o.ipid))
} else {
return nil, fmt.Errorf("%s: ipid is missing", op.OpName())
}
}
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &RemoteRefreshResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != int32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultRemoteRefresherClient) StopRefreshing(ctx context.Context, in *StopRefreshingRequest, opts ...dcerpc.CallOption) (*StopRefreshingResponse, error) {
op := in.xxx_ToOp(ctx)
if _, ok := dcom.HasIPID(opts); !ok {
if o.ipid != nil {
opts = append(opts, dcom.WithIPID(o.ipid))
} else {
return nil, fmt.Errorf("%s: ipid is missing", op.OpName())
}
}
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &StopRefreshingResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != int32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultRemoteRefresherClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func (o *xxx_DefaultRemoteRefresherClient) IPID(ctx context.Context, ipid *dcom.IPID) RemoteRefresherClient {
if ipid == nil {
ipid = &dcom.IPID{}
}
return &xxx_DefaultRemoteRefresherClient{
UnknownClient: o.UnknownClient.IPID(ctx, ipid),
cc: o.cc,
ipid: ipid,
}
}
func NewRemoteRefresherClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (RemoteRefresherClient, error) {
var err error
if !dcom.IsSuperclass(opts) {
cc, err = cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(RemoteRefresherSyntaxV0_0))...)
if err != nil {
return nil, err
}
}
base, err := iunknown.NewUnknownClient(ctx, cc, append(opts, dcom.Superclass(cc))...)
if err != nil {
return nil, err
}
ipid, ok := dcom.HasIPID(opts)
if ok {
base = base.IPID(ctx, ipid)
}
return &xxx_DefaultRemoteRefresherClient{
UnknownClient: base,
cc: cc,
ipid: ipid,
}, nil
}
// xxx_RemoteRefreshOperation structure represents the RemoteRefresh operation
type xxx_RemoteRefreshOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
Flags int32 `idl:"name:lFlags" json:"flags"`
ObjectsLength int32 `idl:"name:plNumObjects" json:"objects_length"`
Objects []*wmi.RefreshedObject `idl:"name:paObjects;size_is:(, plNumObjects)" json:"objects"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_RemoteRefreshOperation) OpNum() int { return 3 }
func (o *xxx_RemoteRefreshOperation) OpName() string { return "/IWbemRemoteRefresher/v0/RemoteRefresh" }
func (o *xxx_RemoteRefreshOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_RemoteRefreshOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This != nil {
if err := o.This.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThis{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// lFlags {in} (1:(int32))
{
if err := w.WriteData(o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_RemoteRefreshOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This == nil {
o.This = &dcom.ORPCThis{}
}
if err := o.This.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// lFlags {in} (1:(int32))
{
if err := w.ReadData(&o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_RemoteRefreshOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if o.Objects != nil && o.ObjectsLength == 0 {
o.ObjectsLength = int32(len(o.Objects))
}
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_RemoteRefreshOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That != nil {
if err := o.That.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThat{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// plNumObjects {out} (1:{pointer=ref}*(1)(int32))
{
if err := w.WriteData(o.ObjectsLength); err != nil {
return err
}
}
// paObjects {out} (1:{pointer=ref}*(2)*(1))(2:{alias=WBEM_REFRESHED_OBJECT}[dim:0,size_is=plNumObjects](struct))
{
if o.Objects != nil || o.ObjectsLength > 0 {
_ptr_paObjects := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
dimSize1 := uint64(o.ObjectsLength)
if err := w.WriteSize(dimSize1); err != nil {
return err
}
sizeInfo := []uint64{
dimSize1,
}
for i1 := range o.Objects {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if o.Objects[i1] != nil {
if err := o.Objects[i1].MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&wmi.RefreshedObject{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
}
for i1 := len(o.Objects); uint64(i1) < sizeInfo[0]; i1++ {
if err := (&wmi.RefreshedObject{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.Objects, _ptr_paObjects); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_RemoteRefreshOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That == nil {
o.That = &dcom.ORPCThat{}
}
if err := o.That.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// plNumObjects {out} (1:{pointer=ref}*(1)(int32))
{
if err := w.ReadData(&o.ObjectsLength); err != nil {
return err
}
}
// paObjects {out} (1:{pointer=ref}*(2)*(1))(2:{alias=WBEM_REFRESHED_OBJECT}[dim:0,size_is=plNumObjects](struct))
{
_ptr_paObjects := 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
}
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Objects", sizeInfo[0])
}
o.Objects = make([]*wmi.RefreshedObject, sizeInfo[0])
for i1 := range o.Objects {
i1 := i1
if o.Objects[i1] == nil {
o.Objects[i1] = &wmi.RefreshedObject{}
}
if err := o.Objects[i1].UnmarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
_s_paObjects := func(ptr interface{}) { o.Objects = *ptr.(*[]*wmi.RefreshedObject) }
if err := w.ReadPointer(&o.Objects, _s_paObjects, _ptr_paObjects); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// RemoteRefreshRequest structure represents the RemoteRefresh operation request
type RemoteRefreshRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
// lFlags: This parameter is not used, and its value MUST be 0x0.
Flags int32 `idl:"name:lFlags" json:"flags"`
}
func (o *RemoteRefreshRequest) xxx_ToOp(ctx context.Context) *xxx_RemoteRefreshOperation {
if o == nil {
return &xxx_RemoteRefreshOperation{}
}
return &xxx_RemoteRefreshOperation{
This: o.This,
Flags: o.Flags,
}
}
func (o *RemoteRefreshRequest) xxx_FromOp(ctx context.Context, op *xxx_RemoteRefreshOperation) {
if o == nil {
return
}
o.This = op.This
o.Flags = op.Flags
}
func (o *RemoteRefreshRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *RemoteRefreshRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_RemoteRefreshOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// RemoteRefreshResponse structure represents the RemoteRefresh operation response
type RemoteRefreshResponse struct {
// That: ORPCTHAT structure that is used to return ORPC extension data to the client.
That *dcom.ORPCThat `idl:"name:That" json:"that"`
// plNumObjects: If successful, plNumObjects MUST be a pointer to the number of CIM
// instances and enumerations that the method returns. It MUST NOT be NULL.
ObjectsLength int32 `idl:"name:plNumObjects" json:"objects_length"`
// paObjects: If successful, paObjects MUST be a pointer to an array of WBEM_REFRESHED_OBJECT
// objects specified in section 2.2.15. The array MUST contain CIM instances and enumerations.
// It MUST NOT be NULL.
Objects []*wmi.RefreshedObject `idl:"name:paObjects;size_is:(, plNumObjects)" json:"objects"`
// Return: The RemoteRefresh return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *RemoteRefreshResponse) xxx_ToOp(ctx context.Context) *xxx_RemoteRefreshOperation {
if o == nil {
return &xxx_RemoteRefreshOperation{}
}
return &xxx_RemoteRefreshOperation{
That: o.That,
ObjectsLength: o.ObjectsLength,
Objects: o.Objects,
Return: o.Return,
}
}
func (o *RemoteRefreshResponse) xxx_FromOp(ctx context.Context, op *xxx_RemoteRefreshOperation) {
if o == nil {
return
}
o.That = op.That
o.ObjectsLength = op.ObjectsLength
o.Objects = op.Objects
o.Return = op.Return
}
func (o *RemoteRefreshResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *RemoteRefreshResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_RemoteRefreshOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_StopRefreshingOperation structure represents the StopRefreshing operation
type xxx_StopRefreshingOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
IDsLength int32 `idl:"name:lNumIds" json:"ids_length"`
IDs []int32 `idl:"name:aplIds;size_is:(lNumIds)" json:"ids"`
Flags int32 `idl:"name:lFlags" json:"flags"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_StopRefreshingOperation) OpNum() int { return 4 }
func (o *xxx_StopRefreshingOperation) OpName() string {
return "/IWbemRemoteRefresher/v0/StopRefreshing"
}
func (o *xxx_StopRefreshingOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if o.IDs != nil && o.IDsLength == 0 {
o.IDsLength = int32(len(o.IDs))
}
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_StopRefreshingOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This != nil {
if err := o.This.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThis{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// lNumIds {in} (1:(int32))
{
if err := w.WriteData(o.IDsLength); err != nil {
return err
}
}
// aplIds {in} (1:{pointer=ref}*(1)[dim:0,size_is=lNumIds](int32))
{
dimSize1 := uint64(o.IDsLength)
if err := w.WriteSize(dimSize1); err != nil {
return err
}
sizeInfo := []uint64{
dimSize1,
}
for i1 := range o.IDs {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.IDs[i1]); err != nil {
return err
}
}
for i1 := len(o.IDs); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(int32(0)); err != nil {
return err
}
}
}
// lFlags {in} (1:(int32))
{
if err := w.WriteData(o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_StopRefreshingOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This == nil {
o.This = &dcom.ORPCThis{}
}
if err := o.This.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// lNumIds {in} (1:(int32))
{
if err := w.ReadData(&o.IDsLength); err != nil {
return err
}
}
// aplIds {in} (1:{pointer=ref}*(1)[dim:0,size_is=lNumIds](int32))
{
sizeInfo := []uint64{
0,
}
for sz1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
return err
}
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.IDs", sizeInfo[0])
}
o.IDs = make([]int32, sizeInfo[0])
for i1 := range o.IDs {
i1 := i1
if err := w.ReadData(&o.IDs[i1]); err != nil {
return err
}
}
}
// lFlags {in} (1:(int32))
{
if err := w.ReadData(&o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_StopRefreshingOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_StopRefreshingOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That != nil {
if err := o.That.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThat{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_StopRefreshingOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That == nil {
o.That = &dcom.ORPCThat{}
}
if err := o.That.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// StopRefreshingRequest structure represents the StopRefreshing operation request
type StopRefreshingRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
// lNumIds: MUST be the number of identifiers in the array of object identifiers in
// the aplIds parameter.
IDsLength int32 `idl:"name:lNumIds" json:"ids_length"`
// aplIds: MUST be an array of object identifiers that MUST identify the CIM instances
// and enumerations to stop refreshing. The object identifier is the m_lCancelId member
// from the _WBEM_REFRESH_INFO structure that is specified in section 2.2.20 and MUST
// be obtained from a previous call to the IWbemRefreshingServices::AddObjectToRefresher,
// IWbemRefreshingServices::AddObjectToRefresherByTemplate, or IWbemRefreshingServices::AddEnumToRefresher
// method specified in section 3.1.4.12.
IDs []int32 `idl:"name:aplIds;size_is:(lNumIds)" json:"ids"`
// lFlags: This parameter is not used, and its value MUST be 0x0.
Flags int32 `idl:"name:lFlags" json:"flags"`
}
func (o *StopRefreshingRequest) xxx_ToOp(ctx context.Context) *xxx_StopRefreshingOperation {
if o == nil {
return &xxx_StopRefreshingOperation{}
}
return &xxx_StopRefreshingOperation{
This: o.This,
IDsLength: o.IDsLength,
IDs: o.IDs,
Flags: o.Flags,
}
}
func (o *StopRefreshingRequest) xxx_FromOp(ctx context.Context, op *xxx_StopRefreshingOperation) {
if o == nil {
return
}
o.This = op.This
o.IDsLength = op.IDsLength
o.IDs = op.IDs
o.Flags = op.Flags
}
func (o *StopRefreshingRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *StopRefreshingRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_StopRefreshingOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// StopRefreshingResponse structure represents the StopRefreshing operation response
type StopRefreshingResponse struct {
// That: ORPCTHAT structure that is used to return ORPC extension data to the client.
That *dcom.ORPCThat `idl:"name:That" json:"that"`
// Return: The StopRefreshing return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *StopRefreshingResponse) xxx_ToOp(ctx context.Context) *xxx_StopRefreshingOperation {
if o == nil {
return &xxx_StopRefreshingOperation{}
}
return &xxx_StopRefreshingOperation{
That: o.That,
Return: o.Return,
}
}
func (o *StopRefreshingResponse) xxx_FromOp(ctx context.Context, op *xxx_StopRefreshingOperation) {
if o == nil {
return
}
o.That = op.That
o.Return = op.Return
}
func (o *StopRefreshingResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *StopRefreshingResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_StopRefreshingOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}