-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpla.go
4349 lines (4255 loc) · 272 KB
/
pla.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 pla
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"
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
)
var (
// import guard
GoPackage = "dcom/pla"
)
// DataCollectorType type represents DataCollectorType RPC enumeration.
//
// The DataCollectorType enumeration defines the data collector types.
//
// The DataCollectorType (Get) method retrieves the DataCollectorType property.
type DataCollectorType uint16
var (
// plaPerformanceCounter: Collects performance counter data. The IPerformanceCounterDataCollector
// interface represents this data collector.
DataCollectorTypePerformanceCounter DataCollectorType = 0
// plaTrace: Collects events from an event trace session. The ITraceDataCollector
// interface represents this data collector.
DataCollectorTypeTrace DataCollectorType = 1
// plaConfiguration: Collects computer configuration information. The IConfigurationDataCollector
// interface represents this data collector.
DataCollectorTypeConfiguration DataCollectorType = 2
// plaAlert: Monitors performance counters and performs actions if the counter value
// crosses the given threshold. The IAlertDataCollector interface represents this data
// collector.
DataCollectorTypeAlert DataCollectorType = 3
// plaApiTrace: Logs API calls made by the process. The IApiTracingDataCollector interface
// represents this data collector.
DataCollectorTypeAPITrace DataCollectorType = 4
)
func (o DataCollectorType) String() string {
switch o {
case DataCollectorTypePerformanceCounter:
return "DataCollectorTypePerformanceCounter"
case DataCollectorTypeTrace:
return "DataCollectorTypeTrace"
case DataCollectorTypeConfiguration:
return "DataCollectorTypeConfiguration"
case DataCollectorTypeAlert:
return "DataCollectorTypeAlert"
case DataCollectorTypeAPITrace:
return "DataCollectorTypeAPITrace"
}
return "Invalid"
}
// FileFormat type represents FileFormat RPC enumeration.
//
// The FileFormat enumeration defines the format of the data in the log file.
type FileFormat uint16
var (
// plaCommaSeparated: Comma-separated log file. The first line in the text file contains
// column headers followed by comma-separated data in the remaining lines of the log
// file.
FileFormatCommaSeparated FileFormat = 0
// plaTabSeparated: Tab-separated log file. The first line in the text file contains
// column headers followed by tab-separated data in the remaining lines of the log file.
FileFormatTabSeparated FileFormat = 1
// plaSql: The data is saved into a SQL database, instead of to a file. The SQL database
// contains three tables: CounterData, CounterDetails, and DisplayToId. All three tables
// are specified below.
//
// The CounterData table contains a row for each counter that is collected at a particular
// time. There will be a large number of these rows. The GUID, CounterID, and RecordIndex
// fields make up the primary key for this table.
//
// * GUID(uniqueidentifier, NOT NULL): GUID, as specified in [MS-DTYP] ( ../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2
// ) section 2.3.4 ( ../ms-dtyp/4926e530-816e-41c2-b251-ec5c7aca018a ) , for this data
// set. Use this key to join with the DisplayToID table.
//
// * CounterID(int, NOT NULL): Identifies the counter. Use this key to join with the
// CounterDetails table.
//
// * RecordIndex(int, NOT NULL): The sample index for a specific counter identifier
// and collection PLA-UID ( f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_1a61d947-4d31-4365-b2b4-5249de682b56
// ). The value increases for each successive sample in this log file.
//
// * CounterDateTime(char(24), NOT NULL): The time the collection was started, in UTC
// time.
//
// * CounterValue(float, NOT NULL): The formatted value of the counter. This value can
// be zero for the first record if the counter requires two samples to compute a displayable
// value.
//
// * FirstValueA(int): Combine this 32-bit value with the value of FirstValueB to create
// the FirstValue member of PDH_RAW_COUNTER. FirstValueA contains the low-order bits.
//
// * FirstValueB(int): Combine this 32-bit value with the value of FirstValueA to create
// the FirstValue member of PDH_RAW_COUNTER. FirstValueB contains the high-order bits.
//
// * SecondValueA(int): Combine this 32-bit value with the value of SecondValueB to
// create the SecondValue member of PDH_RAW_COUNTER. SecondValueA contains the low-order
// bits.
//
// * SecondValueB(int): Combine this 32-bit value with the value of SecondValueA to
// create the SecondValue member of PDH_RAW_COUNTER. SecondValueB contains the high
// order bits.
//
// The CounterDetails table describes a specific counter on a particular computer. The
// CounterDetails table defines the following fields:
//
// * CounterID(int, IDENTITY PRIMARY KEY): A unique identifier in the database that
// maps to a specific counter name text string. This field is the primary key of this
// table.
//
// * MachineName(varchar(1024), NOT NULL): The name of the computer that logged this
// data set.
//
// * ObjectName(varchar(1024), NOT NULL): The name of the performance object ( f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_8bb43a65-7a8c-4585-a7ed-23044772f8ca
// ).
//
// * CounterName(varchar(1024), NOT NULL): The name of the counter.
//
// * CounterType(int, NOT NULL): The counter type.
//
// * DefaultScale(int, NOT NULL): The default scaling to be applied to the raw performance
// counter ( f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_35645a67-9e0b-4c05-b2d9-3b2b25f2beac
// ) data.
//
// * InstanceName(varchar(1024)): The name of the counter instance.
//
// * InstanceIndex(int): The index number of the counter instance.
//
// * ParentName(varchar(1024)): Some counters are logically associated with others,
// and are referred to as parents. For example, the parent of a thread is a process
// and the parent of a logical disk ( f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_c4133b2a-a990-4042-ba44-7fda3090f118
// ) driver is a physical drive. This field contains the name of the parent. Either
// the value in this field or the ParentObjectID field identifies a specific parent
// instance. If the value in this field is NULL, the value in the ParentObjectID field
// will be checked to identify the parent. If the values in both fields are NULL, the
// counter does not have a parent.
//
// * ParentObjectID(int): The unique identifier of the parent. The value in either this
// field or the ParentName field identifies a specific parent instance. If the value
// in this field is NULL, the value in the ParentName field will be checked to identify
// the parent.
//
// The DisplayToID table relates the user-friendly string displayed by the System Monitor
// to the PLA-UID stored in the other tables. The DisplayToID table defines the following
// fields:
//
// * GUID(uniqueidentifier, NOT NULL PRIMARY KEY): A PLA-UID generated for a log. This
// field is the primary key of this table. Note that these do not correspond to the
// values in: HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \SysmonLog \Log
// Queries\
//
// * RunID(int): Reserved for internal use.
//
// * DisplayString(varchar(1024), NOT NULL UNIQUE): Name of the log file as displayed
// in the System Monitor.
//
// * LogStartTime(char(24)): Time the logging process started in yyyy-mm-dd hh:mm:ss:nnn
// format.
//
// * LogStopTime(char(24)): Time the logging process stopped in yyyy-mm-dd hh:mm:ss:nnn
// format. Multiple log files with the same DisplayString value can be differentiated
// by using the value in this and the LogStartTime fields. The values in the LogStartTime
// and LogStopTime fields also allow the total collection time to be accessed quickly.
//
// * NumberOfRecords(int): Number of samples stored in the table for each log collection.
//
// * MinutesToUTC(int): Value used to convert the row data stored in UTC time to local
// time.
//
// * TimeZoneName(char(32)): Name of the time zone where the data was collected. If
// collecting or analyzing relogged data from a file collected on systems in the user's
// time zone, this field will state the location.
FileFormatSQL FileFormat = 2
// plaBinary: Binary log file.
FileFormatBinary FileFormat = 3
)
func (o FileFormat) String() string {
switch o {
case FileFormatCommaSeparated:
return "FileFormatCommaSeparated"
case FileFormatTabSeparated:
return "FileFormatTabSeparated"
case FileFormatSQL:
return "FileFormatSQL"
case FileFormatBinary:
return "FileFormatBinary"
}
return "Invalid"
}
// AutoPathFormat type represents AutoPathFormat RPC enumeration.
//
// The AutoPathFormat enumeration defines the information to be appended to the file
// name or subdirectory name. Any combination of the bits is allowed; multiple bits
// specify strings to be appended to the file name. When a combination with than one
// of these bits is specified, the strings are appended in the following order: plaComputer,
// plaPattern, plaMonthDayHour, plaSerialNumber, plaYearDayOfYear, plaYearMonth, plaYearMonthDay,
// plaYearMonthDayHour, plaMonthDayHourMinute. Consequently, if all bits are set, the
// name is represented as follows: [plaComputer]base_name[plaPattern][plaMonthDayHour][plaSerialNumber][plaYearDayOfYear][plaYearMonth][plaYearMonthDay][plaYearMonthDayHour][plaMonthDayHourMinute].
type AutoPathFormat uint16
var (
// plaNone: Does not append any information to the name.
AutoPathFormatNone AutoPathFormat = 0
// plaPattern: Adds a pattern specified in IDataCollectorSet::SubdirectoryFormatPattern
// 3.2.4.1.32 or IDataCollector::FileNameFormatPattern 3.2.4.5.7 to the name.
AutoPathFormatPattern AutoPathFormat = 1
// plaComputer: Prefixes the name with the computer name.
AutoPathFormatComputer AutoPathFormat = 2
// plaMonthDayHour: Appends the month, day, and hour to the name in the form, MMddHH.
AutoPathFormatMonthDayHour AutoPathFormat = 256
// plaSerialNumber: Appends the serial number specified in IDataCollectorSet::SerialNumber
// to the subdirectory name in the form, NNNNNN.
AutoPathFormatSerialNumber AutoPathFormat = 512
// plaYearDayOfYear: Appends the year and day of the year to the name in the form,
// yyyyDDD.
AutoPathFormatYearDayOfYear AutoPathFormat = 1024
// plaYearMonth: Appends the year and month to the name in the form, yyyyMM.
AutoPathFormatYearMonth AutoPathFormat = 2048
// plaYearMonthDay: Appends the year, month, and day to the name in the form, yyyyMMdd.
AutoPathFormatYearMonthDay AutoPathFormat = 4096
// plaYearMonthDayHour: Appends the year, month, day, and hour to the name in the
// form, yyyyMMddHH.
AutoPathFormatYearMonthDayHour AutoPathFormat = 8192
// plaMonthDayHourMinute: Appends the month, day, hour, and minute to the name in
// the form, MMddHHmm.
AutoPathFormatMonthDayHourMinute AutoPathFormat = 16384
)
func (o AutoPathFormat) String() string {
switch o {
case AutoPathFormatNone:
return "AutoPathFormatNone"
case AutoPathFormatPattern:
return "AutoPathFormatPattern"
case AutoPathFormatComputer:
return "AutoPathFormatComputer"
case AutoPathFormatMonthDayHour:
return "AutoPathFormatMonthDayHour"
case AutoPathFormatSerialNumber:
return "AutoPathFormatSerialNumber"
case AutoPathFormatYearDayOfYear:
return "AutoPathFormatYearDayOfYear"
case AutoPathFormatYearMonth:
return "AutoPathFormatYearMonth"
case AutoPathFormatYearMonthDay:
return "AutoPathFormatYearMonthDay"
case AutoPathFormatYearMonthDayHour:
return "AutoPathFormatYearMonthDayHour"
case AutoPathFormatMonthDayHourMinute:
return "AutoPathFormatMonthDayHourMinute"
}
return "Invalid"
}
// DataCollectorSetStatus type represents DataCollectorSetStatus RPC enumeration.
//
// The DataCollectorSetStatus enumeration defines the running status of the data collector
// set.
type DataCollectorSetStatus uint16
var (
// plaStopped: The data collector set is stopped.
DataCollectorSetStatusStopped DataCollectorSetStatus = 0
// plaRunning: The data collector set is running.
DataCollectorSetStatusRunning DataCollectorSetStatus = 1
// plaCompiling: The data collector set is performing data management (see section
// 3.2.4.2). A running data collector set transitions from running to compiling if the
// data manager is enabled.
DataCollectorSetStatusCompiling DataCollectorSetStatus = 2
// plaPending: Not used.
DataCollectorSetStatusPending DataCollectorSetStatus = 3
// plaUndefined: Cannot determine the status but no error has occurred. Typically,
// this status is set for boot trace sessions.
DataCollectorSetStatusUndefined DataCollectorSetStatus = 4
)
func (o DataCollectorSetStatus) String() string {
switch o {
case DataCollectorSetStatusStopped:
return "DataCollectorSetStatusStopped"
case DataCollectorSetStatusRunning:
return "DataCollectorSetStatusRunning"
case DataCollectorSetStatusCompiling:
return "DataCollectorSetStatusCompiling"
case DataCollectorSetStatusPending:
return "DataCollectorSetStatusPending"
case DataCollectorSetStatusUndefined:
return "DataCollectorSetStatusUndefined"
}
return "Invalid"
}
// ClockType type represents ClockType RPC enumeration.
//
// The ClockType enumeration defines the clock resolution to use when tracing events.
type ClockType uint16
var (
// plaTimeStamp: Use the raw (unconverted) time stamp.
ClockTypeTimestamp ClockType = 0
// plaPerformance: Query performance counter (QPC). Provides a high-resolution (100
// nanoseconds) time stamp that is more expensive to retrieve.
ClockTypePerformance ClockType = 1
// plaSystem: System time. Provides a low-resolution (10 milliseconds) time stamp
// that is less expensive to retrieve.
ClockTypeSystem ClockType = 2
// plaCycle: CPU cycle counter. MAY provide the highest resolution time stamp and
// is the least expensive to retrieve. However, the CPU counter is unreliable and its
// use is not recommended.
ClockTypeCycle ClockType = 3
)
func (o ClockType) String() string {
switch o {
case ClockTypeTimestamp:
return "ClockTypeTimestamp"
case ClockTypePerformance:
return "ClockTypePerformance"
case ClockTypeSystem:
return "ClockTypeSystem"
case ClockTypeCycle:
return "ClockTypeCycle"
}
return "Invalid"
}
// StreamMode type represents StreamMode RPC enumeration.
//
// The StreamMode enumeration defines where the trace events are delivered.
type StreamMode uint16
var (
// plaFile: Writes the trace events to a log file.
StreamModeFile StreamMode = 1
// plaRealTime: Delivers the trace events to a real time consumer.
StreamModeRealTime StreamMode = 2
// plaBoth: Writes the trace events to a log file and delivers them to a real-time
// consumer.
StreamModeBoth StreamMode = 3
// plaBuffering: Keeps events in a circular buffer in memory only. For more information,
// see the EVENT_TRACE_BUFFERING_MODE logging mode in [MSDN-LMC].
StreamModeBuffering StreamMode = 4
)
func (o StreamMode) String() string {
switch o {
case StreamModeFile:
return "StreamModeFile"
case StreamModeRealTime:
return "StreamModeRealTime"
case StreamModeBoth:
return "StreamModeBoth"
case StreamModeBuffering:
return "StreamModeBuffering"
}
return "Invalid"
}
// CommitMode type represents CommitMode RPC enumeration.
//
// The CommitMode enumeration defines the type of actions to be performed when the changes
// are committed to the data collector set. Any combination of bits MUST be allowed.
type CommitMode uint16
var (
// plaCreateNew: For a persistent data collector set, save it to storage. The set
// MUST not have existed previously on storage.
CommitModeCreateNew CommitMode = 1
// plaModify: Update a previously committed data collector set.
CommitModeModify CommitMode = 2
// plaCreateOrModify: For a persistent data collector set, save it to storage. If
// the set already exists, the PLA Protocol will update it.
CommitModeCreateOrModify CommitMode = 3
// plaUpdateRunningInstance: If the data collector set is running, apply the updated
// property values to it.
CommitModeUpdateRunningInstance CommitMode = 16
// plaFlushTrace: If multiple data collector sets are running, flush the event trace
// data collectors memory buffers to storage or real-time consumers.
CommitModeFlushTrace CommitMode = 32
// plaValidateOnly: Perform validation only on the data collector set.
CommitModeValidateOnly CommitMode = 4096
)
func (o CommitMode) String() string {
switch o {
case CommitModeCreateNew:
return "CommitModeCreateNew"
case CommitModeModify:
return "CommitModeModify"
case CommitModeCreateOrModify:
return "CommitModeCreateOrModify"
case CommitModeUpdateRunningInstance:
return "CommitModeUpdateRunningInstance"
case CommitModeFlushTrace:
return "CommitModeFlushTrace"
case CommitModeValidateOnly:
return "CommitModeValidateOnly"
}
return "Invalid"
}
// ValueMapType type represents ValueMapType RPC enumeration.
//
// The ValueMapType enumeration defines a value map type. A value map defines a named-value
// pair. A value map can be used in different ways. A value map type defines which way
// the value map is to be used; each type has a different way of evaluating the "value"
// of the "value map" based on the "values" of each individual "value map item".
type ValueMapType uint16
var (
// plaIndex: Only one item in the collection can be enabled. The enabled item is the
// value of IValueMap::Value. If more than one is enabled, the first enabled item MUST
// be used as the value.
ValueMapTypeIndex ValueMapType = 1
// plaFlag: One or more items in the collection can be enabled. The enabled items
// in the collection are combined together by using the bitwise OR operation to become
// the value of IValueMap::Value.
ValueMapTypeFlag ValueMapType = 2
// plaFlagArray: One or more items in the collection can be enabled. An item in the
// collection represents a 32-bit unsigned value (ULONG). The enabled items are not
// combined together as they are for the plaFlag type, but rather each item can be retrieved
// separately.<2>
ValueMapTypeFlagArray ValueMapType = 3
// plaValidation: The collection contains a list of HRESULT values that are returned
// in an IValueMap by the validation process. The validation process occurs when IDataCollectorSet::Commit
// is called. In the validation process, the PLA Protocol analyzes the values of all
// the properties in the IDataCollectorSet, including the values of the IDataCollectors
// contained in the IDataCollectorSet and inserts a ValueMapItem into the ValueMap for
// any property that is problematic. The ValueMapItem holds the name of the property
// and the HRESULT describing why it is problematic. The following codes can be set
// in a validation ValueMap:
//
// +------------------------------------------+----------------------------------------------------------------------------------+
// | | |
// | NAME/VALUE | DESCRIPTION |
// | | |
// +------------------------------------------+----------------------------------------------------------------------------------+
// +------------------------------------------+----------------------------------------------------------------------------------+
// | PLA_S_PROPERTY_IGNORED/(0x00300100) | This value can be returned anytime the value of a property is being ignored |
// | | by this implementation of the protocol. The code is intended to inform the |
// | | client when a property is not needed or supported by an implementation. The |
// | | following is a list of properties for the different types of data collectors |
// | | (that are encapsulated within a data collector set) that MUST be ignored |
// | | by the server when the client calls the Commit method on the data collector |
// | | set; the server MUST return the property name and PLA_S_PROPERTY_IGNORED |
// | | in the IValueMapItem for each property that it ignored. Note that certain |
// | | properties can pertain to the base DataCollector interface. If there is no |
// | | task specified, the TaskArguments property of the DataCollectorSet MUST be |
// | | ignored. If the SubdirectoryFormat property is not set to plaPattern, the |
// | | SubdirectoryFormatPattern property is ignored. For the base DataCollector, |
// | | if the SegmentMaxSize property is zero and LogCircular is false, LogCircular |
// | | is ignored. If the LogOverwrite property is true or the LogCircular is |
// | | true, and the LogAppend property is false, LogAppend is ignored. For the |
// | | AlertDataCollector data collector, the following properties MUST be ignored: |
// | | FileName, FileNameFormat, FileNameFormatPattern, LogAppend, LogCircular, and |
// | | LogOverwrite. For the ApiTracingDataCollector data collector, the following |
// | | properties MUST be ignored: FileNameFormat, FileNameFormatPattern, LogAppend, |
// | | and LogOverwrite. For the ApiTracingDataCollector data collector, the |
// | | following properties MUST be ignored: FileName and LogCircular. <3> For the |
// | | ConfigurationDataCollector data collector, the following properties MUST be |
// | | ignored: LogCircular and LogAppend. For the PerformanceCounterDataCollector |
// | | data collector, the following properties MUST be ignored if the LogFileFormat |
// | | property is set to plaSql: LogCircular, LogOverwrite, and LogAppend. LogAppend |
// | | is also returned if the LogFileFormat property is set to plaTabSeparated |
// | | or plaCommaSeparated. For the TraceDataCollector data collector, the |
// | | following properties MUST be ignored if the StreamMode is not plaFile: |
// | | FileName, LogAppend, LogCircular, LogOverwrite, FileNameFormat, and |
// | | FileNameFormatPattern. For TraceSession, the following properties MUST be |
// | | ignored: RootPath, Duration, Description, Keywords, Segment, SegmentMaxDuration, |
// | | SerialNumber, Subdirectory, SubdirectoryFormat, SubdirectoryFormatPattern, |
// | | Task, Schedules, TraceDataCollector[1]/FileNameFormat, |
// | | TraceDataCollector[1]/FileNameFormatPattern, and |
// | | TraceDataCollector[1]/LogOverwrite. If IDataCollectorSet::Commit() with the |
// | | flag plaUpdateRunningInstance set is called on an IDataCollectorSet of type |
// | | TraceSession, as specified in section 3.2.1, the following properties MUST be |
// | | ignored: TraceDataCollector[1]/BufferSize, TraceDataCollector[1]/MinimumBuffers, |
// | | TraceDataCollector[1]/NumberOfBuffers, TraceDataCollector[1]/ClockType, |
// | | TraceDataCollector[1]/ProcessMode, TraceDataCollector[1]/PreallocateFile, and |
// | | SegmentMaxSize. |
// +------------------------------------------+----------------------------------------------------------------------------------+
// | PLA_E_PROPERTY_CONFLICT/(0x80300101) | This value can be returned anytime two properties are in conflict. This |
// | | code can be returned for the following properties under the following |
// | | conditions: IApiTracingDataCollector::ExePath: Returned when ExePath is equal |
// | | to the empty string. IDataCollector::FileNameFormatPattern: Returned when |
// | | IDataCollector::FileNameFormat is equal to plaPattern and FileNameFormatPattern |
// | | is equal to the empty string. IDataCollector::LogCircular: Returned |
// | | when IDataCollectorSet::SegmentMaxSize is equal to 0 and LogCircular |
// | | is equal to true. IDataCollector::LogAppend: Returned when either |
// | | IDataCollector::LogCircular is true or IDataCollector::LogOverwrite is true |
// | | and LogAppend is true. IPerformanceCounterDataCollector::DataSourceName: |
// | | Returned when DataSourceName is equal to the empty string and |
// | | IPerformanceCounterDataCollector::LogFileFormat is set to plaSql. |
// | | ITraceDataCollector::MaximumBuffers: Returned when MaximumBuffers is less than |
// | | ITraceDataCollector::MinimumBuffers.<4> ITraceDataCollector::TraceDataProviders: |
// | | Returned if ITraceDataProviderCollection::Count is greater than 1 and |
// | | isKernelTrace is TRUE. ITraceDataCollector::Guid: Returned if isKernelTrace is |
// | | true and the specific PLA-UID does not match the kernel PLA-UID.<5> |
// +------------------------------------------+----------------------------------------------------------------------------------+
// | PLA_E_EXE_FULL_PATH_REQUIRED/0x8030010E) | This value can be returned anytime a relative path, with respect to the current |
// | | working directory, to a file is provided when a full path is required. This code |
// | | can be returned for the following properties under the following conditions: |
// | | IApiTracingDataCollector::ExePath: Returned when the provided path is relative |
// | | to the current working directory instead of absolute. |
// +------------------------------------------+----------------------------------------------------------------------------------+
// | PLA_E_EXE_PATH_NOT_VALID/(0x80300108) | This value can be returned when the executable referenced by the ExePath |
// | | property for an IApiTracingDataCollector does not exist. This code can |
// | | be returned for the following properties under the following conditions: |
// | | IApiTracingDataCollector::ExePath: Returned when the executable referenced by |
// | | the ExePath property does not exist. |
// +------------------------------------------+----------------------------------------------------------------------------------+
// | PLA_E_NETWORK_EXE_NOT_VALID/(0x80300106 | This value can be returned when the executable referenced by the ExePath is on |
// | | a remote machine. This code can be returned for the following properties under |
// | | the following conditions: IApiTracingDataCollector::ExePath: Returned when the |
// | | executable referenced by the ExePath is on a remote machine. |
// +------------------------------------------+----------------------------------------------------------------------------------+
ValueMapTypeValidation ValueMapType = 4
)
func (o ValueMapType) String() string {
switch o {
case ValueMapTypeIndex:
return "ValueMapTypeIndex"
case ValueMapTypeFlag:
return "ValueMapTypeFlag"
case ValueMapTypeFlagArray:
return "ValueMapTypeFlagArray"
case ValueMapTypeValidation:
return "ValueMapTypeValidation"
}
return "Invalid"
}
// WeekDays type represents WeekDays RPC enumeration.
//
// The WeekDays enumeration defines the days of the week on which to run the data collector
// set. Any combination of the bits MUST be allowed.
type WeekDays uint16
var (
// plaRunOnce: Run only once on the given start date and time.
WeekDaysRunOnce WeekDays = 0
// plaSunday: Run on Sunday.
WeekDaysSunday WeekDays = 1
// plaMonday: Run on Monday.
WeekDaysMonday WeekDays = 2
// plaTuesday: Run on Tuesday.
WeekDaysTuesday WeekDays = 4
// plaWednesday: Run on Wednesday.
WeekDaysWednesday WeekDays = 8
// plaThursday: Run on Thursday.
WeekDaysThursday WeekDays = 16
// plaFriday: Run on Friday.
WeekDaysFriday WeekDays = 32
// plaSaturday: Run on Saturday.
WeekDaysSaturday WeekDays = 64
// plaEveryday: Run every day of the week.
WeekDaysEveryday WeekDays = 127
)
func (o WeekDays) String() string {
switch o {
case WeekDaysRunOnce:
return "WeekDaysRunOnce"
case WeekDaysSunday:
return "WeekDaysSunday"
case WeekDaysMonday:
return "WeekDaysMonday"
case WeekDaysTuesday:
return "WeekDaysTuesday"
case WeekDaysWednesday:
return "WeekDaysWednesday"
case WeekDaysThursday:
return "WeekDaysThursday"
case WeekDaysFriday:
return "WeekDaysFriday"
case WeekDaysSaturday:
return "WeekDaysSaturday"
case WeekDaysEveryday:
return "WeekDaysEveryday"
}
return "Invalid"
}
// ResourcePolicy type represents ResourcePolicy RPC enumeration.
//
// The ResourcePolicy enumeration defines the order in which folders are deleted when
// one of the disk resource limits is exceeded.
type ResourcePolicy uint16
var (
// plaDeleteLargest: Deletes the largest folders first.
ResourcePolicyDeleteLargest ResourcePolicy = 0
// plaDeleteOldest: Deletes the oldest folders first.
ResourcePolicyDeleteOldest ResourcePolicy = 1
)
func (o ResourcePolicy) String() string {
switch o {
case ResourcePolicyDeleteLargest:
return "ResourcePolicyDeleteLargest"
case ResourcePolicyDeleteOldest:
return "ResourcePolicyDeleteOldest"
}
return "Invalid"
}
// DataManagerSteps type represents DataManagerSteps RPC enumeration.
//
// The DataManagerSteps enumeration defines the actions that the data manager takes
// when it runs. Any combination of the bits are allowed.
type DataManagerSteps uint16
var (
// plaCreateReport: Creates a report if data is available. The file name MUST be IDataManager::RuleTargetFileName,
// and IDataManager::ReportSchema can be used to customize the way the report is created.
// This value indicates the run of TraceRpt.exe by using as input all of the binary
// performance files (.blg) and event trace files (.etl) in the collection.
DataManagerStepsCreateReport DataManagerSteps = 1
// plaRunRules: If a report exists, the PLA Protocol MUST apply the rules specified
// in IDataManager::Rules to the report. The IDataManager::RuleTargetFileName(Get) returns
// the name of the file to which the rules are applied.
DataManagerStepsRunRules DataManagerSteps = 2
// plaCreateHtml: Converts the XML file obtained by IDataManager::RuleTargetFileName(Get)
// to HTML format. The HTML format is written to the file specified in IDataManager::ReportFileName.
DataManagerStepsCreateHTML DataManagerSteps = 4
// plaFolderActions: Apply the folder actions obtained by IDataManager::FolderActions(Get)
// to all folders defined in the collection.
DataManagerStepsFolderActions DataManagerSteps = 8
// plaResourceFreeing: If IDataManager::MaxFolderCount, IDataManager::MaxSize, or
// MinFreeDisk exceeds its limit, the PLA Protocol MUST apply the resource policy specified
// in IDataManager::ResourcePolicy.
DataManagerStepsResourceFreeing DataManagerSteps = 16
)
func (o DataManagerSteps) String() string {
switch o {
case DataManagerStepsCreateReport:
return "DataManagerStepsCreateReport"
case DataManagerStepsRunRules:
return "DataManagerStepsRunRules"
case DataManagerStepsCreateHTML:
return "DataManagerStepsCreateHTML"
case DataManagerStepsFolderActions:
return "DataManagerStepsFolderActions"
case DataManagerStepsResourceFreeing:
return "DataManagerStepsResourceFreeing"
}
return "Invalid"
}
// FolderActionSteps type represents FolderActionSteps RPC enumeration.
//
// The FolderActionSteps enumeration defines the action that the data manager takes
// when both the age and size limits are met. Any combination of the bits MUST be allowed.
type FolderActionSteps uint16
var (
// plaCreateCab: Creates a cabinet file. The name of the cabinet file is <name of
// the subfolder>.cab. For example, if the name of the subfolder was "MyFolder", the
// cab file would be named "MyFolder.cab". The name of the subfolder is specified by
// the combination of the Subdirectory, SubdirectoryFormat, and SubdirectoryFormatPattern
// properties of the IDataCollectorSet. The Subdirectory property provides the base
// name for the Subfolder, the SubdirectoryFormat property specifies the suffix and
// prefix that will be appended and prepended to the base name, and the SubdirectoryFormatPattern
// specifies the pattern that will be used in the suffix. The SubdirectoryFormat is
// specified in section 2.2.2.1. The SubdirectoryFormatPattern is specified in section
// 2.2.3.1.
FolderActionStepsCreateCab FolderActionSteps = 1
// plaDeleteData: Deletes all files in the folder, except the report and cabinet file.
FolderActionStepsDeleteData FolderActionSteps = 2
// plaSendCab: Sends the cabinet file to the location specified in the IFolderAction::SendCabTo
// property.
FolderActionStepsSendCab FolderActionSteps = 4
// plaDeleteCab: Deletes the cabinet file.
FolderActionStepsDeleteCab FolderActionSteps = 8
// plaDeleteReport: Deletes the report file.
FolderActionStepsDeleteReport FolderActionSteps = 16
)
func (o FolderActionSteps) String() string {
switch o {
case FolderActionStepsCreateCab:
return "FolderActionStepsCreateCab"
case FolderActionStepsDeleteData:
return "FolderActionStepsDeleteData"
case FolderActionStepsSendCab:
return "FolderActionStepsSendCab"
case FolderActionStepsDeleteCab:
return "FolderActionStepsDeleteCab"
case FolderActionStepsDeleteReport:
return "FolderActionStepsDeleteReport"
}
return "Invalid"
}
// PerformanceCounterDataCollector structure represents IPerformanceCounterDataCollector RPC structure.
//
// The IPerformanceCounterDataCollector interface is used to specify the performance
// counters to query and the log file to which the counter data is written.
//
// The following properties MUST be implemented by the objects that implement the IPerformanceCounterDataCollector
// interface.
//
// +---------------------+------------+----------------------------------------------------------------------------------+
// | | | |
// | PROPERTY | READ/WRITE | DESCRIPTION |
// | | | |
// +---------------------+------------+----------------------------------------------------------------------------------+
// +---------------------+------------+----------------------------------------------------------------------------------+
// | DataSourceName | RW | The data source name if the log file is an SQL log file. |
// +---------------------+------------+----------------------------------------------------------------------------------+
// | LogFileFormat | RW | The format in which data MUST be stored. The format is specified by the |
// | | | FileFormat enumeration. |
// +---------------------+------------+----------------------------------------------------------------------------------+
// | PerformanceCounters | RW | List of performance counters to be collected. |
// +---------------------+------------+----------------------------------------------------------------------------------+
// | SampleInterval | RW | The time, in seconds, between two consecutive samples. The default is 15 |
// | | | seconds. The minimum interval is 1 second. There is no maximum interval. |
// +---------------------+------------+----------------------------------------------------------------------------------+
// | SegmentMaxRecords | RW | Maximum number of samples to log in a segment. If set to 0, there is no segment |
// | | | record limit. Any unsigned long is a valid value for this property. |
// +---------------------+------------+----------------------------------------------------------------------------------+
//
// A data collector can be represented as an XML file, which can be used to serialize
// (using Xml (Get) 3.2.4.5.21) and deserialize (using SetXml 3.2.4.5.22) it. The format
// of the XML that defines a performance counter data collector is as follows(the full
// XML specification of the data collector set XML is in section 3.2.4.19):
//
// The XML given above does not show the property elements inherited from IDataCollector
// that also need to be specified.
//
// Methods in RPC Opnum Order
//
// +---------------------------+-------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +---------------------------+-------------------------------------------------------+
// +---------------------------+-------------------------------------------------------+
// | DataSourceName (Get) | Retrieves the DataSourceName property. Opnum: 32 |
// +---------------------------+-------------------------------------------------------+
// | DataSourceName (Put) | Sets the DataSourceName property. Opnum: 33 |
// +---------------------------+-------------------------------------------------------+
// | PerformanceCounters (Get) | Retrieves the PerformanceCounters property. Opnum: 34 |
// +---------------------------+-------------------------------------------------------+
// | PerformanceCounters (Put) | Sets the PerformanceCounters property. Opnum: 35 |
// +---------------------------+-------------------------------------------------------+
// | LogFileFormat (Get) | Retrieves the LogFileFormat property. Opnum: 36 |
// +---------------------------+-------------------------------------------------------+
// | LogFileFormat (Put) | Sets the LogFileFormat property. Opnum: 37 |
// +---------------------------+-------------------------------------------------------+
// | SampleInterval (Get) | Retrieves the SampleInterval property. Opnum: 38 |
// +---------------------------+-------------------------------------------------------+
// | SampleInterval (Put) | Sets the SampleInterval property. Opnum: 39 |
// +---------------------------+-------------------------------------------------------+
// | SegmentMaxRecords (Get) | Retrieves the SegmentMaxRecords property. Opnum: 40 |
// +---------------------------+-------------------------------------------------------+
// | SegmentMaxRecords (Put) | Sets the SegmentMaxRecords property. Opnum: 41 |
// +---------------------------+-------------------------------------------------------+
//
// Opnums 0, 1, and 2 are reserved for the IUnknown interface. Opnums 3, 4, 5, and 6
// are reserved for the IDispatch interface. Opnums 7–31 are used by IDataCollector.
type PerformanceCounterDataCollector dcom.InterfacePointer
func (o *PerformanceCounterDataCollector) InterfacePointer() *dcom.InterfacePointer {
return (*dcom.InterfacePointer)(o)
}
func (o *PerformanceCounterDataCollector) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *PerformanceCounterDataCollector) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *PerformanceCounterDataCollector) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *PerformanceCounterDataCollector) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.ReadAlign(4); err != nil {
return err
}
if err := w.ReadData(&o.DataCount); err != nil {
return err
}
// XXX: for opaque unmarshaling
if o.DataCount > 0 && sizeInfo[0] == 0 {
sizeInfo[0] = uint64(o.DataCount)
}
if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
}
o.Data = make([]byte, sizeInfo[0])
for i1 := range o.Data {
i1 := i1
if err := w.ReadData(&o.Data[i1]); err != nil {
return err
}
}
return nil
}
// FolderActionCollection structure represents IFolderActionCollection RPC structure.
//
// The IFolderActionCollection interface is used to manage a collection of FolderAction
// objects.
//
// The following properties MUST be implemented by the objects that implement the IFolderActionCollection
// interface.
//
// +----------+------------+----------------------------------------------------------------------------------+
// | | | |
// | PROPERTY | READ/WRITE | DESCRIPTION |
// | | | |
// +----------+------------+----------------------------------------------------------------------------------+
// +----------+------------+----------------------------------------------------------------------------------+
// | _NewEnum | R | An enumeration object of type IEnumVariant containing a snapshot of the |
// | | | IFolderAction in this collection. The enumeration object is specified in |
// | | | [MS-OAUT] section 3.3 |
// +----------+------------+----------------------------------------------------------------------------------+
// | Count | R | Number of folder actions in this collection. |
// +----------+------------+----------------------------------------------------------------------------------+
// | Item | R | Retrieves the requested folder action from the collection. |
// +----------+------------+----------------------------------------------------------------------------------+
//
// Methods in RPC Opnum Order
//
// +--------------------+--------------------------------------------------------------+
// | | |
// | METHOD | DESCRIPTION |
// | | |
// +--------------------+--------------------------------------------------------------+
// +--------------------+--------------------------------------------------------------+
// | Count (Get) | Retrieves the Count property. Opnum: 7 |
// +--------------------+--------------------------------------------------------------+
// | Item (Get) | Retrieves the Item property. Opnum: 8 |
// +--------------------+--------------------------------------------------------------+
// | _NewEnum (Get) | Retrieves the NewEnum property. Opnum: 9 |
// +--------------------+--------------------------------------------------------------+
// | Add | Adds a folder action to the collection. Opnum: 10 |
// +--------------------+--------------------------------------------------------------+
// | Remove | Removes a folder action from the collection. Opnum: 11 |
// +--------------------+--------------------------------------------------------------+
// | Clear | Removes all folder actions from the collection. Opnum: 12 |
// +--------------------+--------------------------------------------------------------+
// | AddRange | Adds one or more folder actions to the collection. Opnum: 13 |
// +--------------------+--------------------------------------------------------------+
// | CreateFolderAction | Creates a folder action object. Opnum: 14 |
// +--------------------+--------------------------------------------------------------+
//
// Opnums 0, 1, and 2 are reserved for the IUnknown interface. Opnums 3, 4, 5, and 6
// are reserved for the IDispatch interface.
type FolderActionCollection dcom.InterfacePointer
func (o *FolderActionCollection) InterfacePointer() *dcom.InterfacePointer {
return (*dcom.InterfacePointer)(o)
}
func (o *FolderActionCollection) xxx_PreparePayload(ctx context.Context) error {
if o.Data != nil && o.DataCount == 0 {
o.DataCount = uint32(len(o.Data))
}
if hook, ok := (interface{})(o).(interface{ AfterPreparePayload(context.Context) error }); ok {
if err := hook.AfterPreparePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *FolderActionCollection) NDRSizeInfo() []uint64 {
dimSize1 := uint64(o.DataCount)
return []uint64{
dimSize1,
}
}
func (o *FolderActionCollection) MarshalNDR(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PreparePayload(ctx); err != nil {
return err
}
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for sz1 := range sizeInfo {
if err := w.WriteSize(sizeInfo[sz1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)
}
if err := w.WriteAlign(4); err != nil {
return err
}
if err := w.WriteData(o.DataCount); err != nil {
return err
}
for i1 := range o.Data {
i1 := i1
if uint64(i1) >= sizeInfo[0] {
break
}
if err := w.WriteData(o.Data[i1]); err != nil {
return err
}
}
for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
if err := w.WriteData(uint8(0)); err != nil {
return err
}
}
return nil
}
func (o *FolderActionCollection) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
sizeInfo, ok := ctx.Value(ndr.SizeInfo).([]uint64)
if !ok {
sizeInfo = o.NDRSizeInfo()
for i1 := range sizeInfo {
if err := w.ReadSize(&sizeInfo[i1]); err != nil {
return err
}
}
ctx = context.WithValue(ctx, ndr.SizeInfo, sizeInfo)