-
Notifications
You must be signed in to change notification settings - Fork 1
/
v0.go
845 lines (781 loc) · 23.6 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
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
package ivdsasync
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"
vds "github.com/oiweiwei/go-msrpc/msrpc/dcom/vds"
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
_ = vds.GoPackage
)
var (
// import guard
GoPackage = "dcom/vds"
)
var (
// IVdsAsync interface identifier d5d23b6d-5a55-4492-9889-397a3c2d2dbc
AsyncIID = &dcom.IID{Data1: 0xd5d23b6d, Data2: 0x5a55, Data3: 0x4492, Data4: []byte{0x98, 0x89, 0x39, 0x7a, 0x3c, 0x2d, 0x2d, 0xbc}}
// Syntax UUID
AsyncSyntaxUUID = &uuid.UUID{TimeLow: 0xd5d23b6d, TimeMid: 0x5a55, TimeHiAndVersion: 0x4492, ClockSeqHiAndReserved: 0x98, ClockSeqLow: 0x89, Node: [6]uint8{0x39, 0x7a, 0x3c, 0x2d, 0x2d, 0xbc}}
// Syntax ID
AsyncSyntaxV0_0 = &dcerpc.SyntaxID{IfUUID: AsyncSyntaxUUID, IfVersionMajor: 0, IfVersionMinor: 0}
)
// IVdsAsync interface.
type AsyncClient interface {
// IUnknown retrieval method.
Unknown() iunknown.UnknownClient
// The Cancel method cancels the asynchronous operation.
//
// This method has no parameters.
//
// Return Values: The method MUST return zero or a non-error HRESULT (as specified in
// [MS-ERREF]) to indicate success or return an implementation-specific nonzero error
// code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service
// Remote Protocol, see section 2.2.3.
Cancel(context.Context, *CancelRequest, ...dcerpc.CallOption) (*CancelResponse, error)
// The Wait method blocks and returns when the asynchronous operation has either finished
// successfully or failed.
//
// Return Values: The method MUST return zero or a non-error HRESULT (as specified in
// [MS-ERREF]) to indicate success or return an implementation-specific nonzero error
// code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service
// Remote Protocol, see section 2.2.3.
Wait(context.Context, *WaitRequest, ...dcerpc.CallOption) (*WaitResponse, error)
// The QueryStatus method retrieves the status of the asynchronous operation.
//
// Return Values: The method MUST return zero or a non-error HRESULT (as specified in
// [MS-ERREF]) to indicate success or return an implementation-specific nonzero error
// code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service
// Remote Protocol, see section 2.2.3.
QueryStatus(context.Context, *QueryStatusRequest, ...dcerpc.CallOption) (*QueryStatusResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
// IPID sets the object interface identifier.
IPID(context.Context, *dcom.IPID) AsyncClient
}
type xxx_DefaultAsyncClient struct {
iunknown.UnknownClient
cc dcerpc.Conn
ipid *dcom.IPID
}
func (o *xxx_DefaultAsyncClient) Unknown() iunknown.UnknownClient {
return o.UnknownClient
}
func (o *xxx_DefaultAsyncClient) Cancel(ctx context.Context, in *CancelRequest, opts ...dcerpc.CallOption) (*CancelResponse, 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 := &CancelResponse{}
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_DefaultAsyncClient) Wait(ctx context.Context, in *WaitRequest, opts ...dcerpc.CallOption) (*WaitResponse, 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 := &WaitResponse{}
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_DefaultAsyncClient) QueryStatus(ctx context.Context, in *QueryStatusRequest, opts ...dcerpc.CallOption) (*QueryStatusResponse, 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 := &QueryStatusResponse{}
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_DefaultAsyncClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func (o *xxx_DefaultAsyncClient) IPID(ctx context.Context, ipid *dcom.IPID) AsyncClient {
if ipid == nil {
ipid = &dcom.IPID{}
}
return &xxx_DefaultAsyncClient{
UnknownClient: o.UnknownClient.IPID(ctx, ipid),
cc: o.cc,
ipid: ipid,
}
}
func NewAsyncClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (AsyncClient, error) {
var err error
if !dcom.IsSuperclass(opts) {
cc, err = cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(AsyncSyntaxV0_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_DefaultAsyncClient{
UnknownClient: base,
cc: cc,
ipid: ipid,
}, nil
}
// xxx_CancelOperation structure represents the Cancel operation
type xxx_CancelOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_CancelOperation) OpNum() int { return 3 }
func (o *xxx_CancelOperation) OpName() string { return "/IVdsAsync/v0/Cancel" }
func (o *xxx_CancelOperation) 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_CancelOperation) 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
}
}
return nil
}
func (o *xxx_CancelOperation) 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
}
}
return nil
}
func (o *xxx_CancelOperation) 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_CancelOperation) 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, names=LONG}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_CancelOperation) 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, names=LONG}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// CancelRequest structure represents the Cancel operation request
type CancelRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
}
func (o *CancelRequest) xxx_ToOp(ctx context.Context) *xxx_CancelOperation {
if o == nil {
return &xxx_CancelOperation{}
}
return &xxx_CancelOperation{
This: o.This,
}
}
func (o *CancelRequest) xxx_FromOp(ctx context.Context, op *xxx_CancelOperation) {
if o == nil {
return
}
o.This = op.This
}
func (o *CancelRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *CancelRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_CancelOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// CancelResponse structure represents the Cancel operation response
type CancelResponse 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 Cancel return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *CancelResponse) xxx_ToOp(ctx context.Context) *xxx_CancelOperation {
if o == nil {
return &xxx_CancelOperation{}
}
return &xxx_CancelOperation{
That: o.That,
Return: o.Return,
}
}
func (o *CancelResponse) xxx_FromOp(ctx context.Context, op *xxx_CancelOperation) {
if o == nil {
return
}
o.That = op.That
o.Return = op.Return
}
func (o *CancelResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *CancelResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_CancelOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_WaitOperation structure represents the Wait operation
type xxx_WaitOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
HResult int32 `idl:"name:pHrResult" json:"hresult"`
AsyncOutput *vds.AsyncOutput `idl:"name:pAsyncOut" json:"async_output"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_WaitOperation) OpNum() int { return 4 }
func (o *xxx_WaitOperation) OpName() string { return "/IVdsAsync/v0/Wait" }
func (o *xxx_WaitOperation) 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_WaitOperation) 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
}
}
return nil
}
func (o *xxx_WaitOperation) 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
}
}
return nil
}
func (o *xxx_WaitOperation) 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_WaitOperation) 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
}
}
// pHrResult {out} (1:{pointer=ref}*(1))(2:{alias=HRESULT, names=LONG}(int32))
{
if err := w.WriteData(o.HResult); err != nil {
return err
}
}
// pAsyncOut {out} (1:{pointer=ref}*(1))(2:{alias=VDS_ASYNC_OUTPUT}(struct))
{
if o.AsyncOutput != nil {
if err := o.AsyncOutput.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&vds.AsyncOutput{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_WaitOperation) 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
}
}
// pHrResult {out} (1:{pointer=ref}*(1))(2:{alias=HRESULT, names=LONG}(int32))
{
if err := w.ReadData(&o.HResult); err != nil {
return err
}
}
// pAsyncOut {out} (1:{pointer=ref}*(1))(2:{alias=VDS_ASYNC_OUTPUT}(struct))
{
if o.AsyncOutput == nil {
o.AsyncOutput = &vds.AsyncOutput{}
}
if err := o.AsyncOutput.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// WaitRequest structure represents the Wait operation request
type WaitRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
}
func (o *WaitRequest) xxx_ToOp(ctx context.Context) *xxx_WaitOperation {
if o == nil {
return &xxx_WaitOperation{}
}
return &xxx_WaitOperation{
This: o.This,
}
}
func (o *WaitRequest) xxx_FromOp(ctx context.Context, op *xxx_WaitOperation) {
if o == nil {
return
}
o.This = op.This
}
func (o *WaitRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *WaitRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_WaitOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// WaitResponse structure represents the Wait operation response
type WaitResponse struct {
// That: ORPCTHAT structure that is used to return ORPC extension data to the client.
That *dcom.ORPCThat `idl:"name:That" json:"that"`
// pHrResult: A pointer to a variable which, if the Wait method successfully completes,
// receives the returned HRESULT.
HResult int32 `idl:"name:pHrResult" json:"hresult"`
// pAsyncOut: A pointer to a VDS_ASYNC_OUTPUT structure that, if the asynchronous operation
// is successfully completed, receives extra information about the operation, if any
// information exists. Multiple methods from other interfaces also return async objects.
// Consult the method that returned the async object to determine what extra information
// to return, if any. If the asynchronous operation fails, pAsyncOut MAY be left as
// is without returning any value.
AsyncOutput *vds.AsyncOutput `idl:"name:pAsyncOut" json:"async_output"`
// Return: The Wait return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *WaitResponse) xxx_ToOp(ctx context.Context) *xxx_WaitOperation {
if o == nil {
return &xxx_WaitOperation{}
}
return &xxx_WaitOperation{
That: o.That,
HResult: o.HResult,
AsyncOutput: o.AsyncOutput,
Return: o.Return,
}
}
func (o *WaitResponse) xxx_FromOp(ctx context.Context, op *xxx_WaitOperation) {
if o == nil {
return
}
o.That = op.That
o.HResult = op.HResult
o.AsyncOutput = op.AsyncOutput
o.Return = op.Return
}
func (o *WaitResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *WaitResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_WaitOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_QueryStatusOperation structure represents the QueryStatus operation
type xxx_QueryStatusOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
HResult int32 `idl:"name:pHrResult" json:"hresult"`
PercentCompleted uint32 `idl:"name:pulPercentCompleted" json:"percent_completed"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_QueryStatusOperation) OpNum() int { return 5 }
func (o *xxx_QueryStatusOperation) OpName() string { return "/IVdsAsync/v0/QueryStatus" }
func (o *xxx_QueryStatusOperation) 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_QueryStatusOperation) 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
}
}
return nil
}
func (o *xxx_QueryStatusOperation) 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
}
}
return nil
}
func (o *xxx_QueryStatusOperation) 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_QueryStatusOperation) 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
}
}
// pHrResult {out} (1:{pointer=ref}*(1))(2:{alias=HRESULT, names=LONG}(int32))
{
if err := w.WriteData(o.HResult); err != nil {
return err
}
}
// pulPercentCompleted {out} (1:{pointer=ref}*(1)(uint32))
{
if err := w.WriteData(o.PercentCompleted); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_QueryStatusOperation) 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
}
}
// pHrResult {out} (1:{pointer=ref}*(1))(2:{alias=HRESULT, names=LONG}(int32))
{
if err := w.ReadData(&o.HResult); err != nil {
return err
}
}
// pulPercentCompleted {out} (1:{pointer=ref}*(1)(uint32))
{
if err := w.ReadData(&o.PercentCompleted); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// QueryStatusRequest structure represents the QueryStatus operation request
type QueryStatusRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
}
func (o *QueryStatusRequest) xxx_ToOp(ctx context.Context) *xxx_QueryStatusOperation {
if o == nil {
return &xxx_QueryStatusOperation{}
}
return &xxx_QueryStatusOperation{
This: o.This,
}
}
func (o *QueryStatusRequest) xxx_FromOp(ctx context.Context, op *xxx_QueryStatusOperation) {
if o == nil {
return
}
o.This = op.This
}
func (o *QueryStatusRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *QueryStatusRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QueryStatusOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// QueryStatusResponse structure represents the QueryStatus operation response
type QueryStatusResponse struct {
// That: ORPCTHAT structure that is used to return ORPC extension data to the client.
That *dcom.ORPCThat `idl:"name:That" json:"that"`
// pHrResult: A pointer to a variable that receives the HRESULT that signals the current
// state of the asynchronous operation.
HResult int32 `idl:"name:pHrResult" json:"hresult"`
// pulPercentCompleted: A pointer to a variable that receives the completion percentage
// of the asynchronous operation. If the asynchronous operation is in progress, the
// value MUST be between 0 and 99. If the operation has finished, the value MUST be
// 100. If the progress of the operation cannot be estimated, the value MUST be 0.
PercentCompleted uint32 `idl:"name:pulPercentCompleted" json:"percent_completed"`
// Return: The QueryStatus return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *QueryStatusResponse) xxx_ToOp(ctx context.Context) *xxx_QueryStatusOperation {
if o == nil {
return &xxx_QueryStatusOperation{}
}
return &xxx_QueryStatusOperation{
That: o.That,
HResult: o.HResult,
PercentCompleted: o.PercentCompleted,
Return: o.Return,
}
}
func (o *QueryStatusResponse) xxx_FromOp(ctx context.Context, op *xxx_QueryStatusOperation) {
if o == nil {
return
}
o.That = op.That
o.HResult = op.HResult
o.PercentCompleted = op.PercentCompleted
o.Return = op.Return
}
func (o *QueryStatusResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *QueryStatusResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QueryStatusOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}