-
Notifications
You must be signed in to change notification settings - Fork 2
/
v4.go
1674 lines (1529 loc) · 60.2 KB
/
v4.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 w32time
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"
w32t "github.com/oiweiwei/go-msrpc/msrpc/w32t"
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)
_ = w32t.GoPackage
)
var (
// import guard
GoPackage = "w32t"
)
var (
// Syntax UUID
W32TimeSyntaxUUID = &uuid.UUID{TimeLow: 0x8fb6d884, TimeMid: 0x2388, TimeHiAndVersion: 0x11d0, ClockSeqHiAndReserved: 0x8c, ClockSeqLow: 0x35, Node: [6]uint8{0x0, 0xc0, 0x4f, 0xda, 0x27, 0x95}}
// Syntax ID
W32TimeSyntaxV4_1 = &dcerpc.SyntaxID{IfUUID: W32TimeSyntaxUUID, IfVersionMajor: 4, IfVersionMinor: 1}
)
// W32Time interface.
type W32TimeClient interface {
// The W32TimeSync method is invoked to request that the time service immediately initiate
// an attempt to synchronize its time. The MIDL syntax of this method is specified as
// follows.
//
// Return Values: If the TimeSyncFlag_ReturnResult flag is specified, the return value
// MUST be one of the following specific TimeSync_ReturnResult codes. Otherwise, this
// method MUST return zero on success or an implementation-specific nonzero error code
// on failure.<36>
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 0x00000000 ResyncResult_Success | Synchronization between the time provider and the caller was successful. For |
// | | asynchronous calls, this result does not guarantee that the server has acquired |
// | | a new time sample. It merely states that the synchronization attempt has been |
// | | successfully initiated. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 0x00000001 ResyncResult_NoData | The time service could not obtain a new time sample from the time provider. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 0x00000002 ResyncResult_StaleData | The time service received data that was time stamped earlier than the last good |
// | | sample. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 0x00000003 ResyncResult_ChangeTooBig | The time service received data in which the time difference from the local clock |
// | | was too large to trust. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 0x00000004 ResyncResult_Shutdown | The time service was shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
Sync(context.Context, *SyncRequest, ...dcerpc.CallOption) (*SyncResponse, error)
// The W32TimeGetNetlogonServiceBits method returns information about the functionality
// that the time service provides. The MIDL syntax of this method is specified as follows.
//
// Return Values: This method returns an unsigned 32-bit field that contains information
// about the functionality that the time service provides. Multiple bits can be set
// in the return value. Any bits not defined as follows MUST be set to zero by servers
// and ignored by clients.
//
// +----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------+----------------------------------------------------------------------------------+
// +----------------------------------+----------------------------------------------------------------------------------+
// | 0x00000040 DS_TIMESERV_FLAG | The time service provides a time source with which clients can synchronize using |
// | | NTP, as specified in [RFC1305]. |
// +----------------------------------+----------------------------------------------------------------------------------+
// | 0x00000200 DS_GOOD_TIMESERV_FLAG | The time service provides a reliable time source with which clients can |
// | | synchronize using NTP, as specified in [RFC1305]. |
// +----------------------------------+----------------------------------------------------------------------------------+
GetNetlogonServiceBits(context.Context, *GetNetlogonServiceBitsRequest, ...dcerpc.CallOption) (*GetNetlogonServiceBitsResponse, error)
// The W32TimeQueryProviderStatus method returns operational information for a specified
// time provider (either an NTP or a hardware time provider) within the time service's
// list of time providers.<39> The MIDL syntax of this method is specified as follows.
//
// Return Values: This method MUST return zero on success; on failure, it returns a
// nonzero error code. The values transmitted in this field are implementation specific.
// All nonzero values MUST be treated as equivalent for protocol purposes.<41>
QueryProviderStatus(context.Context, *QueryProviderStatusRequest, ...dcerpc.CallOption) (*QueryProviderStatusResponse, error)
// The W32TimeQuerySource method returns the current time source of the time service.
// The MIDL syntax of this method is specified as follows.
//
// Return Values: This method MUST return 0 on success; on failure, it returns a nonzero
// error code. The values transmitted in this field are implementation specific. All
// nonzero values MUST be treated as equivalent for the purposes of this protocol.<42>
QuerySource(context.Context, *QuerySourceRequest, ...dcerpc.CallOption) (*QuerySourceResponse, error)
// The W32TimeQueryProviderConfiguration method returns configuration data for a specific
// time provider within the time service's list of time providers.<44> The MIDL syntax
// of this method is specified as follows.
//
// Return Values: This method MUST return zero on success; on failure, it returns a
// nonzero error code. The values transmitted in this field are implementation specific.
// All nonzero values MUST be treated as equivalent for the purposes of this protocol.<46>
QueryProviderConfiguration(context.Context, *QueryProviderConfigurationRequest, ...dcerpc.CallOption) (*QueryProviderConfigurationResponse, error)
// The W32TimeQueryConfiguration method returns the configuration data of the time service.<47>
// The MIDL syntax of this method is specified as follows.
//
// Return Values: This method MUST return 0 on success; on failure, it returns a nonzero
// error code. The values transmitted in this field are implementation specific. All
// nonzero values MUST be treated as equivalent for the purposes of this protocol.<48>
QueryConfiguration(context.Context, *QueryConfigurationRequest, ...dcerpc.CallOption) (*QueryConfigurationResponse, error)
// The W32TimeQueryStatus method returns the service status data of the time service.<49>
// The MIDL syntax of this method is specified as follows.
//
// Return Values: This method MUST return 0 on success; on failure, it returns a nonzero
// error code. The values transmitted in this field are implementation specific. All
// nonzero values MUST be treated as equivalent for the purposes of this protocol.<50>
QueryStatus(context.Context, *QueryStatusRequest, ...dcerpc.CallOption) (*QueryStatusResponse, error)
// The W32TimeLog method is invoked to request that the time service update its logging
// configuration.<51> The logging of the time service is implementation specific.<52>
//
// The MIDL syntax of this method is specified as follows.
//
// Return Values: This method MUST return 0 on success; on failure, it returns a nonzero
// error code. The values transmitted in this field are implementation specific. All
// nonzero values MUST be treated as equivalent for protocol purposes.<53>
Log(context.Context, *LogRequest, ...dcerpc.CallOption) (*LogResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
}
type xxx_DefaultW32TimeClient struct {
cc dcerpc.Conn
}
func (o *xxx_DefaultW32TimeClient) Sync(ctx context.Context, in *SyncRequest, opts ...dcerpc.CallOption) (*SyncResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &SyncResponse{}
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_DefaultW32TimeClient) GetNetlogonServiceBits(ctx context.Context, in *GetNetlogonServiceBitsRequest, opts ...dcerpc.CallOption) (*GetNetlogonServiceBitsResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &GetNetlogonServiceBitsResponse{}
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_DefaultW32TimeClient) QueryProviderStatus(ctx context.Context, in *QueryProviderStatusRequest, opts ...dcerpc.CallOption) (*QueryProviderStatusResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &QueryProviderStatusResponse{}
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_DefaultW32TimeClient) QuerySource(ctx context.Context, in *QuerySourceRequest, opts ...dcerpc.CallOption) (*QuerySourceResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &QuerySourceResponse{}
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_DefaultW32TimeClient) QueryProviderConfiguration(ctx context.Context, in *QueryProviderConfigurationRequest, opts ...dcerpc.CallOption) (*QueryProviderConfigurationResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &QueryProviderConfigurationResponse{}
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_DefaultW32TimeClient) QueryConfiguration(ctx context.Context, in *QueryConfigurationRequest, opts ...dcerpc.CallOption) (*QueryConfigurationResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &QueryConfigurationResponse{}
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_DefaultW32TimeClient) QueryStatus(ctx context.Context, in *QueryStatusRequest, opts ...dcerpc.CallOption) (*QueryStatusResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &QueryStatusResponse{}
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_DefaultW32TimeClient) Log(ctx context.Context, in *LogRequest, opts ...dcerpc.CallOption) (*LogResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &LogResponse{}
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_DefaultW32TimeClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func NewW32TimeClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (W32TimeClient, error) {
cc, err := cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(W32TimeSyntaxV4_1))...)
if err != nil {
return nil, err
}
return &xxx_DefaultW32TimeClient{cc: cc}, nil
}
// xxx_SyncOperation structure represents the W32TimeSync operation
type xxx_SyncOperation struct {
Wait uint32 `idl:"name:uWait" json:"wait"`
Flags uint32 `idl:"name:ulFlags" json:"flags"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_SyncOperation) OpNum() int { return 0 }
func (o *xxx_SyncOperation) OpName() string { return "/W32Time/v4.1/W32TimeSync" }
func (o *xxx_SyncOperation) 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_SyncOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// uWait {in} (1:(uint32))
{
if err := w.WriteData(o.Wait); err != nil {
return err
}
}
// ulFlags {in} (1:(uint32))
{
if err := w.WriteData(o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_SyncOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// uWait {in} (1:(uint32))
{
if err := w.ReadData(&o.Wait); err != nil {
return err
}
}
// ulFlags {in} (1:(uint32))
{
if err := w.ReadData(&o.Flags); err != nil {
return err
}
}
return nil
}
func (o *xxx_SyncOperation) 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_SyncOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// Return {out} (1:(uint32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_SyncOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// Return {out} (1:(uint32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// SyncRequest structure represents the W32TimeSync operation request
type SyncRequest struct {
// uWait: Blocking status of the call. The value MUST be one of the following.
//
// +--------------------+----------------------------------------------------------------------------------+
// | | |
// | VALUE | MEANING |
// | | |
// +--------------------+----------------------------------------------------------------------------------+
// +--------------------+----------------------------------------------------------------------------------+
// | 0 | Method MUST return RPC_S_OK without waiting for the outcome of time |
// | | synchronization. In this case, the final outcome of the attempt is not available |
// | | to the caller. |
// +--------------------+----------------------------------------------------------------------------------+
// | Non-zero 0 < value | Method MUST NOT return until time synchronization is complete. The server must |
// | | block the response to the caller until the attempt at time synchronization is |
// | | complete, regardless of the status. An implementation can choose to respond to |
// | | the caller after an implementation-specific timeout occurs.<34> |
// +--------------------+----------------------------------------------------------------------------------+
Wait uint32 `idl:"name:uWait" json:"wait"`
// ulFlags: Time synchronization behaviors.
//
// The following values SHOULD be mutually exclusive. When multiple values are set,
// the value whose bit is least significant SHOULD take precedence.<35>
//
// Note The TimeSyncFlag_SoftResync value MUST NOT be used in conjunction with any
// other value in the following table.
//
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | | |
// | VALUE | MEANING |
// | | |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_SoftResync 0x00000000 | The time service MUST synchronize itself with the currently available time |
// | | samples. It MUST NOT poll the network or hardware time providers for new time |
// | | data. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_HardResync 0x00000001 | The time service MUST discard its old time samples and MUST acquire new samples |
// | | from the network or hardware time providers. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_Rediscover 0x00000004 | Identical to the TimeSyncFlag_HardResync flag, except that the time service MUST |
// | | attempt to discover new network time sources prior to discarding and reacquiring |
// | | new time samples. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_UpdateAndResync 0x00000008 | Identical to the TimeSyncFlag_Rediscover flag, except that prior to attempting |
// | | to discover new time sources, the time service MUST update its configuration. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_ForceResync 0x00000010 | Identical to the TimeSyncFlag_HardResync flag, except that it causes the |
// | | processing of the next time sample to ignore any phase correction boundaries |
// | | imposed by W32Time. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
//
// The following value can be joined in a bitwise OR with the preceding values. If uWait
// is set to zero, the following value MUST be ignored.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | | |
// | VALUE | MEANING |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | TimeSyncFlag_ReturnResult 0x00000002 | Used only for synchronous calls. If set, the method MUST return one of the |
// | | following return values. |
// +--------------------------------------+----------------------------------------------------------------------------------+
Flags uint32 `idl:"name:ulFlags" json:"flags"`
}
func (o *SyncRequest) xxx_ToOp(ctx context.Context) *xxx_SyncOperation {
if o == nil {
return &xxx_SyncOperation{}
}
return &xxx_SyncOperation{
Wait: o.Wait,
Flags: o.Flags,
}
}
func (o *SyncRequest) xxx_FromOp(ctx context.Context, op *xxx_SyncOperation) {
if o == nil {
return
}
o.Wait = op.Wait
o.Flags = op.Flags
}
func (o *SyncRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *SyncRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_SyncOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// SyncResponse structure represents the W32TimeSync operation response
type SyncResponse struct {
// Return: The W32TimeSync return value.
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *SyncResponse) xxx_ToOp(ctx context.Context) *xxx_SyncOperation {
if o == nil {
return &xxx_SyncOperation{}
}
return &xxx_SyncOperation{
Return: o.Return,
}
}
func (o *SyncResponse) xxx_FromOp(ctx context.Context, op *xxx_SyncOperation) {
if o == nil {
return
}
o.Return = op.Return
}
func (o *SyncResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *SyncResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_SyncOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_GetNetlogonServiceBitsOperation structure represents the W32TimeGetNetlogonServiceBits operation
type xxx_GetNetlogonServiceBitsOperation struct {
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_GetNetlogonServiceBitsOperation) OpNum() int { return 1 }
func (o *xxx_GetNetlogonServiceBitsOperation) OpName() string {
return "/W32Time/v4.1/W32TimeGetNetlogonServiceBits"
}
func (o *xxx_GetNetlogonServiceBitsOperation) 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_GetNetlogonServiceBitsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
return nil
}
func (o *xxx_GetNetlogonServiceBitsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
return nil
}
func (o *xxx_GetNetlogonServiceBitsOperation) 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_GetNetlogonServiceBitsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// Return {out} (1:(uint32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_GetNetlogonServiceBitsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// Return {out} (1:(uint32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// GetNetlogonServiceBitsRequest structure represents the W32TimeGetNetlogonServiceBits operation request
type GetNetlogonServiceBitsRequest struct {
}
func (o *GetNetlogonServiceBitsRequest) xxx_ToOp(ctx context.Context) *xxx_GetNetlogonServiceBitsOperation {
if o == nil {
return &xxx_GetNetlogonServiceBitsOperation{}
}
return &xxx_GetNetlogonServiceBitsOperation{}
}
func (o *GetNetlogonServiceBitsRequest) xxx_FromOp(ctx context.Context, op *xxx_GetNetlogonServiceBitsOperation) {
if o == nil {
return
}
}
func (o *GetNetlogonServiceBitsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *GetNetlogonServiceBitsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_GetNetlogonServiceBitsOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// GetNetlogonServiceBitsResponse structure represents the W32TimeGetNetlogonServiceBits operation response
type GetNetlogonServiceBitsResponse struct {
// Return: The W32TimeGetNetlogonServiceBits return value.
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *GetNetlogonServiceBitsResponse) xxx_ToOp(ctx context.Context) *xxx_GetNetlogonServiceBitsOperation {
if o == nil {
return &xxx_GetNetlogonServiceBitsOperation{}
}
return &xxx_GetNetlogonServiceBitsOperation{
Return: o.Return,
}
}
func (o *GetNetlogonServiceBitsResponse) xxx_FromOp(ctx context.Context, op *xxx_GetNetlogonServiceBitsOperation) {
if o == nil {
return
}
o.Return = op.Return
}
func (o *GetNetlogonServiceBitsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *GetNetlogonServiceBitsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_GetNetlogonServiceBitsOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_QueryProviderStatusOperation structure represents the W32TimeQueryProviderStatus operation
type xxx_QueryProviderStatusOperation struct {
Flags uint32 `idl:"name:ulFlags" json:"flags"`
Provider string `idl:"name:pwszProvider;string" json:"provider"`
ProviderInfo *w32t.ProviderInfo `idl:"name:pProviderInfo;pointer:ref" json:"provider_info"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_QueryProviderStatusOperation) OpNum() int { return 2 }
func (o *xxx_QueryProviderStatusOperation) OpName() string {
return "/W32Time/v4.1/W32TimeQueryProviderStatus"
}
func (o *xxx_QueryProviderStatusOperation) 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_QueryProviderStatusOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// ulFlags {in} (1:(uint32))
{
if err := w.WriteData(o.Flags); err != nil {
return err
}
}
// pwszProvider {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
{
if err := ndr.WriteUTF16NString(ctx, w, o.Provider); err != nil {
return err
}
}
return nil
}
func (o *xxx_QueryProviderStatusOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// ulFlags {in} (1:(uint32))
{
if err := w.ReadData(&o.Flags); err != nil {
return err
}
}
// pwszProvider {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
{
if err := ndr.ReadUTF16NString(ctx, w, &o.Provider); err != nil {
return err
}
}
return nil
}
func (o *xxx_QueryProviderStatusOperation) 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_QueryProviderStatusOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// pProviderInfo {out} (1:{pointer=ref}*(2))(2:{alias=PW32TIME_PROVIDER_INFO}*(1))(3:{alias=W32TIME_PROVIDER_INFO}(struct))
{
if o.ProviderInfo != nil {
_ptr_pProviderInfo := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.ProviderInfo != nil {
if err := o.ProviderInfo.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&w32t.ProviderInfo{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.ProviderInfo, _ptr_pProviderInfo); 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:(uint32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_QueryProviderStatusOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// pProviderInfo {out} (1:{pointer=ref}*(2))(2:{alias=PW32TIME_PROVIDER_INFO,pointer=ref}*(1))(3:{alias=W32TIME_PROVIDER_INFO}(struct))
{
_ptr_pProviderInfo := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.ProviderInfo == nil {
o.ProviderInfo = &w32t.ProviderInfo{}
}
if err := o.ProviderInfo.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_pProviderInfo := func(ptr interface{}) { o.ProviderInfo = *ptr.(**w32t.ProviderInfo) }
if err := w.ReadPointer(&o.ProviderInfo, _s_pProviderInfo, _ptr_pProviderInfo); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:(uint32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// QueryProviderStatusRequest structure represents the W32TimeQueryProviderStatus operation request
type QueryProviderStatusRequest struct {
// ulFlags: Reserved. This parameter MUST be set to zero and MUST be ignored on receipt.
Flags uint32 `idl:"name:ulFlags" json:"flags"`
// pwszProvider: Name of the time provider to query. This name is implementation specific.<40>
Provider string `idl:"name:pwszProvider;string" json:"provider"`
}
func (o *QueryProviderStatusRequest) xxx_ToOp(ctx context.Context) *xxx_QueryProviderStatusOperation {
if o == nil {
return &xxx_QueryProviderStatusOperation{}
}
return &xxx_QueryProviderStatusOperation{
Flags: o.Flags,
Provider: o.Provider,
}
}
func (o *QueryProviderStatusRequest) xxx_FromOp(ctx context.Context, op *xxx_QueryProviderStatusOperation) {
if o == nil {
return
}
o.Flags = op.Flags
o.Provider = op.Provider
}
func (o *QueryProviderStatusRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *QueryProviderStatusRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QueryProviderStatusOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// QueryProviderStatusResponse structure represents the W32TimeQueryProviderStatus operation response
type QueryProviderStatusResponse struct {
// pProviderInfo: A pointer that receives a pointer to a W32TIME_PROVIDER_INFO structure
// containing operational information for the time provider.
ProviderInfo *w32t.ProviderInfo `idl:"name:pProviderInfo;pointer:ref" json:"provider_info"`
// Return: The W32TimeQueryProviderStatus return value.
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *QueryProviderStatusResponse) xxx_ToOp(ctx context.Context) *xxx_QueryProviderStatusOperation {
if o == nil {
return &xxx_QueryProviderStatusOperation{}
}
return &xxx_QueryProviderStatusOperation{
ProviderInfo: o.ProviderInfo,
Return: o.Return,
}
}
func (o *QueryProviderStatusResponse) xxx_FromOp(ctx context.Context, op *xxx_QueryProviderStatusOperation) {
if o == nil {
return
}
o.ProviderInfo = op.ProviderInfo
o.Return = op.Return
}
func (o *QueryProviderStatusResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *QueryProviderStatusResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QueryProviderStatusOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_QuerySourceOperation structure represents the W32TimeQuerySource operation
type xxx_QuerySourceOperation struct {
Source string `idl:"name:pwszSource;string" json:"source"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_QuerySourceOperation) OpNum() int { return 3 }
func (o *xxx_QuerySourceOperation) OpName() string { return "/W32Time/v4.1/W32TimeQuerySource" }
func (o *xxx_QuerySourceOperation) 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_QuerySourceOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
return nil
}
func (o *xxx_QuerySourceOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
return nil
}
func (o *xxx_QuerySourceOperation) 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_QuerySourceOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// pwszSource {out} (1:{string, pointer=ref}*(2)*(1)[dim:0,string,null](wchar))
{
if o.Source != "" {
_ptr_pwszSource := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if err := ndr.WriteUTF16NString(ctx, w, o.Source); err != nil {
return err
}
return nil
})
if err := w.WritePointer(&o.Source, _ptr_pwszSource); 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:(uint32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_QuerySourceOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// pwszSource {out} (1:{string, pointer=ref}*(2)*(1)[dim:0,string,null](wchar))
{
_ptr_pwszSource := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if err := ndr.ReadUTF16NString(ctx, w, &o.Source); err != nil {
return err
}
return nil
})
_s_pwszSource := func(ptr interface{}) { o.Source = *ptr.(*string) }
if err := w.ReadPointer(&o.Source, _s_pwszSource, _ptr_pwszSource); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:(uint32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// QuerySourceRequest structure represents the W32TimeQuerySource operation request
type QuerySourceRequest struct {
}
func (o *QuerySourceRequest) xxx_ToOp(ctx context.Context) *xxx_QuerySourceOperation {
if o == nil {
return &xxx_QuerySourceOperation{}
}
return &xxx_QuerySourceOperation{}
}
func (o *QuerySourceRequest) xxx_FromOp(ctx context.Context, op *xxx_QuerySourceOperation) {
if o == nil {
return
}
}
func (o *QuerySourceRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *QuerySourceRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QuerySourceOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// QuerySourceResponse structure represents the W32TimeQuerySource operation response
type QuerySourceResponse struct {
// pwszSource: A pointer to a null-terminated string that is the name of the time source
// that the time service is synchronizing with. If the time service is not synchronizing
// with any time source, the string MUST be set to a null-terminated empty string. This
// string SHOULD be either the FQDN or the IP address of the time source in the form
// of a string, for example, "ntp1.nist.gov" or "10.0.0.1".
Source string `idl:"name:pwszSource;string" json:"source"`
// Return: The W32TimeQuerySource return value.
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *QuerySourceResponse) xxx_ToOp(ctx context.Context) *xxx_QuerySourceOperation {
if o == nil {
return &xxx_QuerySourceOperation{}
}
return &xxx_QuerySourceOperation{
Source: o.Source,
Return: o.Return,
}
}
func (o *QuerySourceResponse) xxx_FromOp(ctx context.Context, op *xxx_QuerySourceOperation) {
if o == nil {
return
}
o.Source = op.Source
o.Return = op.Return
}
func (o *QuerySourceResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *QuerySourceResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_QuerySourceOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_QueryProviderConfigurationOperation structure represents the W32TimeQueryProviderConfiguration operation
type xxx_QueryProviderConfigurationOperation struct {
Flags uint32 `idl:"name:ulFlags" json:"flags"`
Provider string `idl:"name:pwszProvider;string" json:"provider"`
ConfigurationProviderInfo *w32t.ConfigurationProvider `idl:"name:pConfigurationProviderInfo;pointer:ref" json:"configuration_provider_info"`
Return uint32 `idl:"name:Return" json:"return"`
}
func (o *xxx_QueryProviderConfigurationOperation) OpNum() int { return 4 }