-
Notifications
You must be signed in to change notification settings - Fork 2
/
v1.go
3161 lines (2917 loc) · 115 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 fileservervssagent
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"
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
)
var (
// import guard
GoPackage = "fsrvp"
)
var (
// Syntax UUID
FileServerVSSAgentSyntaxUUID = &uuid.UUID{TimeLow: 0xa8e0653c, TimeMid: 0x2744, TimeHiAndVersion: 0x4389, ClockSeqHiAndReserved: 0xa6, ClockSeqLow: 0x1d, Node: [6]uint8{0x73, 0x73, 0xdf, 0x8b, 0x22, 0x92}}
// Syntax ID
FileServerVSSAgentSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: FileServerVSSAgentSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)
// FileServerVssAgent interface.
type FileServerVSSAgentClient interface {
// The GetSupportedVersion method is invoked by the client to get the minimum and maximum
// versions of the protocol that the server supports.
//
// Return Values: The method returns one of the values specified in section 2.2.4. The
// most common error codes are listed below.
//
// +---------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------+--------------------------------------------------------------------+
// +---------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +---------------------------+--------------------------------------------------------------------+
GetSupportedVersion(context.Context, *GetSupportedVersionRequest, ...dcerpc.CallOption) (*GetSupportedVersionResponse, error)
// The SetContext method sets the context for the current shadow copy creation process.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed below.
//
// +------------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------------------------------+--------------------------------------------------------------------+
// +------------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +------------------------------------------------+--------------------------------------------------------------------+
// | 0x8004231B FSRVP_E_UNSUPPORTED_CONTEXT | The context value specified is invalid. |
// +------------------------------------------------+--------------------------------------------------------------------+
// | 0x80042316 FSRVP_E_SHADOW_COPY_SET_IN_PROGRESS | Creation of another shadow copy set is in progress. |
// +------------------------------------------------+--------------------------------------------------------------------+
//
// If the Context parameter contains an invalid value, the server MUST fail the call
// with FSRVP_E_UNSUPPORTED_CONTEXT.
SetContext(context.Context, *SetContextRequest, ...dcerpc.CallOption) (*SetContextResponse, error)
// The StartShadowCopySet method is called by the client to initiate a new shadow copy
// set for shadow copy creation.<6>
//
// Return Values: The method returns one of the values specified in section 2.2.4. The
// most common error codes are listed in the following table:
//
// +------------------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------------------------------+----------------------------------------------------------------------------------+
// +------------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +------------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +------------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80042316 FSRVP_E_SHADOW_COPY_SET_IN_PROGRESS | StartShadowCopySet (Opnum 2) was called while the creation of another shadow |
// | | copy set was in progress. |
// +------------------------------------------------+----------------------------------------------------------------------------------+
//
// If ContextSet is FALSE, the server MUST fail the call with FSRVP_E_BAD_STATE.
//
// If there is a ShadowCopySet in the GlobalShadowCopySetTable where ShadowCopySet.Status
// is not equal to "Recovered", the server MUST fail the call with FSRVP_E_SHADOW_COPY_SET_IN_PROGRESS.
StartShadowCopySet(context.Context, *StartShadowCopySetRequest, ...dcerpc.CallOption) (*StartShadowCopySetResponse, error)
// The AddToShadowCopySet method adds a share to an existing shadow copy set.
//
// Return Values: The method returns one of the values specified in section 2.2.4. The
// most common error codes are listed in the following table:
//
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have permission to perform the operation. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x8004230C FSRVP_E_NOT_SUPPORTED | The file store that contains the share to be shadow copied is not supported by |
// | | the server. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the state of the server. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x8004230D FSRVP_E_OBJECT_ALREADY_EXISTS | The object already exists. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+----------------------------------------------------------------------------------+
AddToShadowCopySet(context.Context, *AddToShadowCopySetRequest, ...dcerpc.CallOption) (*AddToShadowCopySetResponse, error)
// The CommitShadowCopySet method is invoked by the client to commit a given shadow
// copy set.
//
// Return Values: The method returns one of the values specified in section 2.2.4. The
// most common error codes are listed below.
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the state of the server. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042500 FSSAGENT_E_TIMEOUT | The wait for the shadow copy commit operation has timed out. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0xFFFFFFFF FSRVP_E_WAIT_FAILED | The wait for shadow copy commit operation has failed. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
CommitShadowCopySet(context.Context, *CommitShadowCopySetRequest, ...dcerpc.CallOption) (*CommitShadowCopySetResponse, error)
// The ExposeShadowCopySet method exposes all the shadow copies in a shadow copy set
// as file shares on the file server.
//
// Return Values: The method returns one of the values specified in section 2.2.4. The
// most common error codes are listed in the following table.
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the server's state. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
ExposeShadowCopySet(context.Context, *ExposeShadowCopySetRequest, ...dcerpc.CallOption) (*ExposeShadowCopySetResponse, error)
// The RecoveryCompleteShadowCopySet method is invoked by the client to indicate to
// the server that the data associated with the file shares in a shadow copy set have
// been recovered by the VSS writers.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table:
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x00000000 ZERO | The operation completed successfully. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the server's state. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
RecoveryCompleteShadowCopySet(context.Context, *RecoveryCompleteShadowCopySetRequest, ...dcerpc.CallOption) (*RecoveryCompleteShadowCopySetResponse, error)
// The AbortShadowCopySet method is invoked by the client to delete a given shadow copy
// set on the server.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table.
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the server's state. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
AbortShadowCopySet(context.Context, *AbortShadowCopySetRequest, ...dcerpc.CallOption) (*AbortShadowCopySetResponse, error)
// The IsPathSupported method is invoked by the client to query if a given share is
// supported by the server for shadow copy operations.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table:
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 0x8004230CL FSRVP_E_NOT_SUPPORTED | The file store that contains the share to be shadow copied is not supported by |
// | | the server. |
// +-----------------------------------+----------------------------------------------------------------------------------+
IsPathSupported(context.Context, *IsPathSupportedRequest, ...dcerpc.CallOption) (*IsPathSupportedResponse, error)
// The IsPathShadowCopied method is invoked by the client to query if any shadow copy
// for a share already exists.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table.
//
// +---------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------+--------------------------------------------------------------------+
// +---------------------------+--------------------------------------------------------------------+
// | 0x00000000 ZERO | The operation completed successfully. |
// +---------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +---------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +---------------------------+--------------------------------------------------------------------+
IsPathShadowCopied(context.Context, *IsPathShadowCopiedRequest, ...dcerpc.CallOption) (*IsPathShadowCopiedResponse, error)
// The GetShareMapping method is invoked by the client to get the shadow copy information
// on a given file share on the server after the shadow copy of the share has been exposed.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table:
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
//
// If the value of Level is invalid, the server MUST fail the call with E_INVALIDARG.
GetShareMapping(context.Context, *GetShareMappingRequest, ...dcerpc.CallOption) (*GetShareMappingResponse, error)
// The DeleteShareMapping method deletes the mapping of a share's shadow copy from a
// shadow copy set.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed in the following table:
//
// +----------------------------------------------+--------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+--------------------------------------------------------------------+
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have the permissions to perform the operation. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042308 FSRVP_E_OBJECT_NOT_FOUND | The specified object does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+--------------------------------------------------------------------+
DeleteShareMapping(context.Context, *DeleteShareMappingRequest, ...dcerpc.CallOption) (*DeleteShareMappingResponse, error)
// The PrepareShadowCopySet method is invoked by the client to ensure that the server
// has completed preparation for creating the shadow copy set.
//
// Return Values: The method returns one of the values as specified in section 2.2.4.
// The most common error codes are listed below.
//
// +----------------------------------------------+----------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------------------+----------------------------------------------------------------+
// +----------------------------------------------+----------------------------------------------------------------+
// | 0x80070005 E_ACCESSDENIED | The caller does not have permission to perform the operation. |
// +----------------------------------------------+----------------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +----------------------------------------------+----------------------------------------------------------------+
// | 0x80042301 FSRVP_E_BAD_STATE | The method call is invalid because of the state of the server. |
// +----------------------------------------------+----------------------------------------------------------------+
// | 0x00000102 FSRVP_E_WAIT_TIMEOUT | The wait for shadow copy preparation operation has timed out. |
// +----------------------------------------------+----------------------------------------------------------------+
// | 0xFFFFFFFF FSRVP_E_WAIT_FAILED | The wait for shadow copy preparation operation has failed. |
// +----------------------------------------------+----------------------------------------------------------------+
// | 0x80042501 FSRVP_E_SHADOWCOPYSET_ID_MISMATCH | The provided ShadowCopySetId does not exist. |
// +----------------------------------------------+----------------------------------------------------------------+
PrepareShadowCopySet(context.Context, *PrepareShadowCopySetRequest, ...dcerpc.CallOption) (*PrepareShadowCopySetResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
}
// ShareMapping1 structure represents FSSAGENT_SHARE_MAPPING_1 RPC structure.
//
// This structure contains the mapping information for a file share to its shadow copy.
type ShareMapping1 struct {
// ShadowCopySetId: The GUID of the shadow copy set.
ShadowCopySetID *dtyp.GUID `idl:"name:ShadowCopySetId" json:"shadow_copy_set_id"`
// ShadowCopyId: The GUID of the shadow copy.
ShadowCopyID *dtyp.GUID `idl:"name:ShadowCopyId" json:"shadow_copy_id"`
// ShareNameUNC: The name of the share in UNC format.
ShareNameUNC string `idl:"name:ShareNameUNC;string" json:"share_name_unc"`
// ShadowCopyShareName: The name of the share exposing the shadow copy of the base
// share identified by ShareNameUNC, in UNC format.
ShadowCopyShareName string `idl:"name:ShadowCopyShareName;string" json:"shadow_copy_share_name"`
// CreationTimestamp: The time at which the shadow copy of the share is created. This
// MUST be a 64-bit integer value containing the number of 100-nanosecond intervals
// since January 1, 1601 (UTC).
CreationTimestamp int64 `idl:"name:CreationTimestamp" json:"creation_timestamp"`
}
func (o *ShareMapping1) 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 *ShareMapping1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
if err := w.WriteAlign(8); err != nil {
return err
}
if o.ShadowCopySetID != nil {
if err := o.ShadowCopySetID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if o.ShadowCopyID != nil {
if err := o.ShadowCopyID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if o.ShareNameUNC != "" {
_ptr_ShareNameUNC := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if err := ndr.WriteUTF16NString(ctx, w, o.ShareNameUNC); err != nil {
return err
}
return nil
})
if err := w.WritePointer(&o.ShareNameUNC, _ptr_ShareNameUNC); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if o.ShadowCopyShareName != "" {
_ptr_ShadowCopyShareName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if err := ndr.WriteUTF16NString(ctx, w, o.ShadowCopyShareName); err != nil {
return err
}
return nil
})
if err := w.WritePointer(&o.ShadowCopyShareName, _ptr_ShadowCopyShareName); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteData(o.CreationTimestamp); err != nil {
return err
}
return nil
}
func (o *ShareMapping1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
if err := w.ReadAlign(8); err != nil {
return err
}
if o.ShadowCopySetID == nil {
o.ShadowCopySetID = &dtyp.GUID{}
}
if err := o.ShadowCopySetID.UnmarshalNDR(ctx, w); err != nil {
return err
}
if o.ShadowCopyID == nil {
o.ShadowCopyID = &dtyp.GUID{}
}
if err := o.ShadowCopyID.UnmarshalNDR(ctx, w); err != nil {
return err
}
_ptr_ShareNameUNC := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if err := ndr.ReadUTF16NString(ctx, w, &o.ShareNameUNC); err != nil {
return err
}
return nil
})
_s_ShareNameUNC := func(ptr interface{}) { o.ShareNameUNC = *ptr.(*string) }
if err := w.ReadPointer(&o.ShareNameUNC, _s_ShareNameUNC, _ptr_ShareNameUNC); err != nil {
return err
}
_ptr_ShadowCopyShareName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if err := ndr.ReadUTF16NString(ctx, w, &o.ShadowCopyShareName); err != nil {
return err
}
return nil
})
_s_ShadowCopyShareName := func(ptr interface{}) { o.ShadowCopyShareName = *ptr.(*string) }
if err := w.ReadPointer(&o.ShadowCopyShareName, _s_ShadowCopyShareName, _ptr_ShadowCopyShareName); err != nil {
return err
}
if err := w.ReadData(&o.CreationTimestamp); err != nil {
return err
}
return nil
}
// ShareMapping structure represents FSSAGENT_SHARE_MAPPING RPC union.
//
// The FSSAGENT_SHARE_MAPPING union contains mapping information for a share to its
// shadow copy based on the level value.
type ShareMapping struct {
// Types that are assignable to Value
//
// *ShareMapping_1
// *ShareMapping_DefaultShareMapping
Value is_ShareMapping `json:"value"`
}
func (o *ShareMapping) GetValue() any {
if o == nil {
return nil
}
switch value := (interface{})(o.Value).(type) {
case *ShareMapping_1:
if value != nil {
return value.ShareMapping1
}
}
return nil
}
type is_ShareMapping interface {
ndr.Marshaler
ndr.Unmarshaler
is_ShareMapping()
}
func (o *ShareMapping) NDRSwitchValue(sw uint32) uint32 {
if o == nil {
return uint32(0)
}
switch (interface{})(o.Value).(type) {
case *ShareMapping_1:
return uint32(1)
}
return uint32(0)
}
func (o *ShareMapping) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
if err := w.WriteSwitch(uint32(sw)); err != nil {
return err
}
// ms_union
if err := w.WriteAlign(9); err != nil {
return err
}
switch sw {
case uint32(1):
_o, _ := o.Value.(*ShareMapping_1)
if _o != nil {
if err := _o.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&ShareMapping_1{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
default:
// no-op
}
return nil
}
func (o *ShareMapping) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
return err
}
// ms_union
if err := w.ReadAlign(9); err != nil {
return err
}
switch sw {
case uint32(1):
o.Value = &ShareMapping_1{}
if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
return err
}
default:
o.Value = &ShareMapping_DefaultShareMapping{}
}
return nil
}
// ShareMapping_1 structure represents FSSAGENT_SHARE_MAPPING RPC union arm.
//
// It has following labels: 1
type ShareMapping_1 struct {
// ShareMapping1: A pointer to an FSSAGENT_SHARE_MAPPING_1 structure, as specified
// in section 2.2.1.1.
ShareMapping1 *ShareMapping1 `idl:"name:ShareMapping1" json:"share_mapping1"`
}
func (*ShareMapping_1) is_ShareMapping() {}
func (o *ShareMapping_1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if o.ShareMapping1 != nil {
_ptr_ShareMapping1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.ShareMapping1 != nil {
if err := o.ShareMapping1.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&ShareMapping1{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.ShareMapping1, _ptr_ShareMapping1); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
return nil
}
func (o *ShareMapping_1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
_ptr_ShareMapping1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.ShareMapping1 == nil {
o.ShareMapping1 = &ShareMapping1{}
}
if err := o.ShareMapping1.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_ShareMapping1 := func(ptr interface{}) { o.ShareMapping1 = *ptr.(**ShareMapping1) }
if err := w.ReadPointer(&o.ShareMapping1, _s_ShareMapping1, _ptr_ShareMapping1); err != nil {
return err
}
return nil
}
// ShareMapping_DefaultShareMapping structure represents FSSAGENT_SHARE_MAPPING RPC default union arm.
type ShareMapping_DefaultShareMapping struct {
}
func (*ShareMapping_DefaultShareMapping) is_ShareMapping() {}
func (o *ShareMapping_DefaultShareMapping) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return nil
}
func (o *ShareMapping_DefaultShareMapping) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
return nil
}
type xxx_DefaultFileServerVSSAgentClient struct {
cc dcerpc.Conn
}
func (o *xxx_DefaultFileServerVSSAgentClient) GetSupportedVersion(ctx context.Context, in *GetSupportedVersionRequest, opts ...dcerpc.CallOption) (*GetSupportedVersionResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &GetSupportedVersionResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) SetContext(ctx context.Context, in *SetContextRequest, opts ...dcerpc.CallOption) (*SetContextResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &SetContextResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) StartShadowCopySet(ctx context.Context, in *StartShadowCopySetRequest, opts ...dcerpc.CallOption) (*StartShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &StartShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) AddToShadowCopySet(ctx context.Context, in *AddToShadowCopySetRequest, opts ...dcerpc.CallOption) (*AddToShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &AddToShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) CommitShadowCopySet(ctx context.Context, in *CommitShadowCopySetRequest, opts ...dcerpc.CallOption) (*CommitShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &CommitShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) ExposeShadowCopySet(ctx context.Context, in *ExposeShadowCopySetRequest, opts ...dcerpc.CallOption) (*ExposeShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &ExposeShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) RecoveryCompleteShadowCopySet(ctx context.Context, in *RecoveryCompleteShadowCopySetRequest, opts ...dcerpc.CallOption) (*RecoveryCompleteShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &RecoveryCompleteShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) AbortShadowCopySet(ctx context.Context, in *AbortShadowCopySetRequest, opts ...dcerpc.CallOption) (*AbortShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &AbortShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) IsPathSupported(ctx context.Context, in *IsPathSupportedRequest, opts ...dcerpc.CallOption) (*IsPathSupportedResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &IsPathSupportedResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) IsPathShadowCopied(ctx context.Context, in *IsPathShadowCopiedRequest, opts ...dcerpc.CallOption) (*IsPathShadowCopiedResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &IsPathShadowCopiedResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) GetShareMapping(ctx context.Context, in *GetShareMappingRequest, opts ...dcerpc.CallOption) (*GetShareMappingResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &GetShareMappingResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) DeleteShareMapping(ctx context.Context, in *DeleteShareMappingRequest, opts ...dcerpc.CallOption) (*DeleteShareMappingResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &DeleteShareMappingResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) PrepareShadowCopySet(ctx context.Context, in *PrepareShadowCopySetRequest, opts ...dcerpc.CallOption) (*PrepareShadowCopySetResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &PrepareShadowCopySetResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != uint32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultFileServerVSSAgentClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func NewFileServerVSSAgentClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (FileServerVSSAgentClient, error) {
cc, err := cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(FileServerVSSAgentSyntaxV1_0))...)
if err != nil {
return nil, err
}
return &xxx_DefaultFileServerVSSAgentClient{cc: cc}, nil
}
// xxx_GetSupportedVersionOperation structure represents the GetSupportedVersion operation
type xxx_GetSupportedVersionOperation struct {
MinVersion uint32 `idl:"name:MinVersion" json:"min_version"`
MaxVersion uint32 `idl:"name:MaxVersion" json:"max_version"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_GetSupportedVersionOperation) OpNum() int { return 0 }
func (o *xxx_GetSupportedVersionOperation) OpName() string {
return "/FileServerVssAgent/v1/GetSupportedVersion"
}
func (o *xxx_GetSupportedVersionOperation) 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_GetSupportedVersionOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
return nil
}
func (o *xxx_GetSupportedVersionOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
return nil
}
func (o *xxx_GetSupportedVersionOperation) 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_GetSupportedVersionOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// MinVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
{
if err := w.WriteData(o.MinVersion); err != nil {
return err
}
}
// MaxVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
{
if err := w.WriteData(o.MaxVersion); err != nil {
return err
}
}
// Return {out} (1:{alias=DWORD}(uint32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_GetSupportedVersionOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// MinVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
{
if err := w.ReadData(&o.MinVersion); err != nil {
return err
}
}
// MaxVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
{
if err := w.ReadData(&o.MaxVersion); err != nil {
return err
}
}
// Return {out} (1:{alias=DWORD}(uint32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// GetSupportedVersionRequest structure represents the GetSupportedVersion operation request
type GetSupportedVersionRequest struct {
}
func (o *GetSupportedVersionRequest) xxx_ToOp(ctx context.Context) *xxx_GetSupportedVersionOperation {
if o == nil {
return &xxx_GetSupportedVersionOperation{}
}
return &xxx_GetSupportedVersionOperation{}
}
func (o *GetSupportedVersionRequest) xxx_FromOp(ctx context.Context, op *xxx_GetSupportedVersionOperation) {
if o == nil {
return
}
}
func (o *GetSupportedVersionRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *GetSupportedVersionRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_GetSupportedVersionOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// GetSupportedVersionResponse structure represents the GetSupportedVersion operation response
type GetSupportedVersionResponse struct {
// MinVersion: The minimum version of the protocol that the server supports.
MinVersion uint32 `idl:"name:MinVersion" json:"min_version"`
// MaxVersion: The maximum version of the protocol that the server supports.
MaxVersion uint32 `idl:"name:MaxVersion" json:"max_version"`
// Return: The GetSupportedVersion return value.
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *GetSupportedVersionResponse) xxx_ToOp(ctx context.Context) *xxx_GetSupportedVersionOperation {
if o == nil {
return &xxx_GetSupportedVersionOperation{}
}
return &xxx_GetSupportedVersionOperation{
MinVersion: o.MinVersion,
MaxVersion: o.MaxVersion,
Return: o.Return,
}
}
func (o *GetSupportedVersionResponse) xxx_FromOp(ctx context.Context, op *xxx_GetSupportedVersionOperation) {
if o == nil {
return
}
o.MinVersion = op.MinVersion
o.MaxVersion = op.MaxVersion
o.Return = op.Return
}
func (o *GetSupportedVersionResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *GetSupportedVersionResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_GetSupportedVersionOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_SetContextOperation structure represents the SetContext operation
type xxx_SetContextOperation struct {
Context uint32 `idl:"name:Context" json:"context"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_SetContextOperation) OpNum() int { return 1 }
func (o *xxx_SetContextOperation) OpName() string { return "/FileServerVssAgent/v1/SetContext" }
func (o *xxx_SetContextOperation) 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_SetContextOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// Context {in} (1:(uint32))
{
if err := w.WriteData(o.Context); err != nil {
return err
}
}
return nil
}
func (o *xxx_SetContextOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// Context {in} (1:(uint32))