-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathoaut.go
9983 lines (9626 loc) · 308 KB
/
oaut.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
// The oaut package implements the OAUT client protocol.
//
// # Introduction
//
// The OLE Automation Protocol uses Distributed Component Object Model (DCOM) as its
// transport layer. It provides support for an additional set of types, a late-bound
// calling mechanism, and type description and discovery. The late-bound calling mechanism
// is based on dispatch identifiers and a dispatching table that maps the identifiers
// to specific operations. The dispatch identifiers and the dispatching table are specified
// by using IDL extensions specified in this document. Type description and discovery
// are based on a set of IDL extensions and a set of interfaces that are implemented
// by type library and type description servers.
//
// # Overview
//
// The OLE Automation Protocol extends the use of DCOM by providing support for marshaling
// an additional set of types (known as automation types) and by providing support for
// exposing COM components to automation clients (such as scripting engines) through
// a late-bound calling alternative to the traditional COM calls. Additionally, the
// OLE Automation Protocol specifies how a type browser can discover and interpret type
// information provided by a type description server.
//
// The automation client and server can be present on the same machine, or on different
// machines connected by a network. Automation takes advantage of functionality provided
// by the Microsoft Component Object Model (for more information, see [MSDN-COM]) and
// the Microsoft Distributed Component Object Model (as specified in [MS-DCOM]) for
// creating, activating, and managing the lifetime of the objects exposed by an automation
// server.
//
// To support late-bound calling, the OLE Automation Protocol specifies the following:
//
// * How a server defines a set of automation methods that can be dispatched, based
// on a dispatch ID (DISPID) ( 5583e1b8-454c-4147-9f56-f72416a15bee#gt_3792c5cc-783c-4b2a-a71e-c1ec3f432474
// ).
//
// * How the server provides a way to map a method name to the DISPID.
//
// * How the server performs the late-bound call, based on the DISPID.
//
// The automation methods are defined by using extensions to the IDL language specified
// in [C706] sections 6, 7, 8, 9, 10, 11, 12, 13, and 14. These extensions provide the
// definition of automation interfaces containing automation methods and properties.
// Each IDL definition of an automation method and property can have a unique (per interface)
// integer value associated with it. This value is defined as a DISPID and is statically
// discoverable (from the IDL specification of the method), and dynamically discoverable
// (through a call to IDispatch::GetIDsOfNames (section 3.1.4.3)). This value is then
// used by automation clients to invoke the automation method, or to set or retrieve
// an automation property (through a call to IDispatch::Invoke).
//
// To support this late-bound calling mechanism, Automation defines a set of types,
// VARIANT (section 2.2.29) being the most important of them. A VARIANT can be thought
// of as a discriminated union of all automation-supported types. The OLE Automation
// Protocol imposes the following restriction on the automation interfaces: All types
// of method arguments and properties can be stored as VARIANT structures.
//
// The following illustration shows a generic automation call sequence:
package oaut
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"
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)
_ = dcom.GoPackage
_ = dtyp.GoPackage
)
var (
// import guard
GoPackage = "dcom/oaut"
)
// VariantTrue represents the VARIANT_TRUE RPC constant
var VariantTrue = 65535
// VariantFalse represents the VARIANT_FALSE RPC constant
var VariantFalse = 0
// VarEnum type represents VARENUM RPC enumeration.
//
// The VARENUM enumeration constants are used in the discriminant field, vt, of the
// VARIANT type specified in section 2.2.29.2. When present, the VT_BYREF flag MUST
// be in an OR relation with another value to specify the byref argument for the VARIANT.
// The VT_EMPTY and VT_NULL values MUST NOT be specified with the VT_BYREF bit flag.
//
// The following values are also used in the discriminant field, vt, of the TYPEDESC
// structure specified in section 2.2.37.
//
// The meaning of each VARIANT type constant is specified as follows. The Context column
// specifies the context in which each constant is used. A constant MUST NOT be used
// in a VARIANT unless it is specified with a "V". A constant MUST NOT be used in a
// SAFEARRAY unless it is specified with an "S". A constant MUST NOT be used in a TYPEDESC
// unless it is specified with a "T".
type VarEnum uint16
var (
// VT_EMPTY:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V | The type of the contained field is undefined. When this flag is specified, the |
// | | VARIANT MUST NOT contain a data field. The VARIANT definition is specified in |
// | | section 2.2.29.2. |
// +---------+----------------------------------------------------------------------------------+
VarEmpty VarEnum = 0
// VT_NULL:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V | The type of the contained field is NULL. When this flag is specified, the |
// | | VARIANT MUST NOT contain a data field. The VARIANT definition is specified in |
// | | section 2.2.29.2. |
// +---------+----------------------------------------------------------------------------------+
VarNull VarEnum = 1
// VT_I2:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 2-byte signed integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumI2 VarEnum = 2
// VT_I4:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 4-byte signed integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumI4 VarEnum = 3
// VT_R4:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 4-byte IEEE floating-point number. |
// +---------+----------------------------------------------------------------------------------+
VarEnumR4 VarEnum = 4
// VT_R8:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | an 8-byte IEEE floating-point number. |
// +---------+----------------------------------------------------------------------------------+
VarEnumR8 VarEnum = 5
// VT_CY:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | CURRENCY (see section 2.2.24). |
// +---------+----------------------------------------------------------------------------------+
VarCurrency VarEnum = 6
// VT_DATE:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | DATE (see section 2.2.25). |
// +---------+----------------------------------------------------------------------------------+
VarEnumDate VarEnum = 7
// VT_BSTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | BSTR (see section 2.2.23). |
// +---------+----------------------------------------------------------------------------------+
VarEnumString VarEnum = 8
// VT_DISPATCH:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a pointer to IDispatch (see section 3.1.4). |
// +---------+----------------------------------------------------------------------------------+
VarEnumDispatch VarEnum = 9
// VT_ERROR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | HRESULT. |
// +---------+----------------------------------------------------------------------------------+
VarEnumError VarEnum = 10
// VT_BOOL:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | VARIANT_BOOL (see section 2.2.27). |
// +---------+----------------------------------------------------------------------------------+
VarEnumBool VarEnum = 11
// VT_VARIANT:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | VARIANT (see section 2.2.29). It MUST appear with the bit flag VT_BYREF. |
// +---------+----------------------------------------------------------------------------------+
VarEnumVariant VarEnum = 12
// VT_UNKNOWN:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a pointer to IUnknown. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUnknown VarEnum = 13
// VT_DECIMAL:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | DECIMAL (see section 2.2.26). |
// +---------+----------------------------------------------------------------------------------+
VarEnumDecimal VarEnum = 14
// VT_I1:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 1-byte integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumI1 VarEnum = 16
// VT_UI1:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 1-byte unsigned integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUI1 VarEnum = 17
// VT_UI2:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 2-byte unsigned integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUI2 VarEnum = 18
// VT_UI4:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 4-byte unsigned integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUI4 VarEnum = 19
// VT_I8:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | an 8-byte signed integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumI8 VarEnum = 20
// VT_UI8:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | an 8-byte unsigned integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUI8 VarEnum = 21
// VT_INT:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 4-byte signed integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumInt VarEnum = 22
// VT_UINT:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S, T | Either the specified type, or the type of the element or contained field MUST be |
// | | a 4-byte unsigned integer. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUint VarEnum = 23
// VT_VOID:
//
// +---------+----------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------+
// +---------+----------------------------------+
// | T | The specified type MUST be void. |
// +---------+----------------------------------+
VarEnumVoid VarEnum = 24
// VT_HRESULT:
//
// +---------+-------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+-------------------------------------+
// +---------+-------------------------------------+
// | T | The specified type MUST be HRESULT. |
// +---------+-------------------------------------+
VarEnumHResult VarEnum = 25
// VT_PTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | T | The specified type MUST be a unique pointer, as specified in [C706] section |
// | | 4.2.20.2. |
// +---------+----------------------------------------------------------------------------------+
VarEnumPointer VarEnum = 26
// VT_SAFEARRAY:
//
// +---------+--------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+--------------------------------------------------------+
// +---------+--------------------------------------------------------+
// | T | The specified type MUST be SAFEARRAY (section 2.2.30). |
// +---------+--------------------------------------------------------+
VarEnumSafeArray VarEnum = 27
// VT_CARRAY:
//
// +---------+------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+------------------------------------------------+
// +---------+------------------------------------------------+
// | T | The specified type MUST be a fixed-size array. |
// +---------+------------------------------------------------+
VarEnumCarray VarEnum = 28
// VT_USERDEFINED:
//
// +---------+------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+------------------------------------------+
// +---------+------------------------------------------+
// | T | The specified type MUST be user defined. |
// +---------+------------------------------------------+
VarEnumUserdefined VarEnum = 29
// VT_LPSTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | T | The specified type MUST be a NULL-terminated string, as specified in [C706] |
// | | section 14.3.4. |
// +---------+----------------------------------------------------------------------------------+
VarCharString VarEnum = 30
// VT_LPWSTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | T | The specified type MUST be a zero-terminated string of UNICODE characters, as |
// | | specified in [C706], section 14.3.4. |
// +---------+----------------------------------------------------------------------------------+
VarUnicodeString VarEnum = 31
// VT_RECORD:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S | The type of the element or contained field MUST be a BRECORD (see section |
// | | 2.2.28.2). |
// +---------+----------------------------------------------------------------------------------+
VarEnumRecord VarEnum = 36
// VT_INT_PTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | T | The specified type MUST be either a 4-byte or an 8-byte signed integer. The |
// | | size of the integer is platform specific and determines the system pointer size |
// | | value, as specified in section 2.2.21. |
// +---------+----------------------------------------------------------------------------------+
VarEnumIntPointer VarEnum = 37
// VT_UINT_PTR:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | T | The specified type MUST be either a 4 byte or an 8 byte unsigned integer. The |
// | | size of the integer is platform specific and determines the system pointer size |
// | | value, as specified in section 2.2.21. |
// +---------+----------------------------------------------------------------------------------+
VarEnumUintPointer VarEnum = 38
// VT_ARRAY:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S | The type of the element or contained field MUST be a SAFEARRAY (see section |
// | | 2.2.30.10). |
// +---------+----------------------------------------------------------------------------------+
VarEnumArray VarEnum = 8192
// VT_BYREF:
//
// +---------+----------------------------------------------------------------------------------+
// | | |
// | CONTEXT | DESCRIPTION |
// | | |
// +---------+----------------------------------------------------------------------------------+
// +---------+----------------------------------------------------------------------------------+
// | V, S | The type of the element or contained field MUST be a pointer to one of the types |
// | | listed in the previous rows of this table. If present, this bit flag MUST appear |
// | | in a VARIANT discriminant (see section 2.2.28) with one of the previous flags. |
// +---------+----------------------------------------------------------------------------------+
VarEnumByref VarEnum = 16384
)
func (o VarEnum) String() string {
switch o {
case VarEmpty:
return "VarEmpty"
case VarNull:
return "VarNull"
case VarEnumI2:
return "VarEnumI2"
case VarEnumI4:
return "VarEnumI4"
case VarEnumR4:
return "VarEnumR4"
case VarEnumR8:
return "VarEnumR8"
case VarCurrency:
return "VarCurrency"
case VarEnumDate:
return "VarEnumDate"
case VarEnumString:
return "VarEnumString"
case VarEnumDispatch:
return "VarEnumDispatch"
case VarEnumError:
return "VarEnumError"
case VarEnumBool:
return "VarEnumBool"
case VarEnumVariant:
return "VarEnumVariant"
case VarEnumUnknown:
return "VarEnumUnknown"
case VarEnumDecimal:
return "VarEnumDecimal"
case VarEnumI1:
return "VarEnumI1"
case VarEnumUI1:
return "VarEnumUI1"
case VarEnumUI2:
return "VarEnumUI2"
case VarEnumUI4:
return "VarEnumUI4"
case VarEnumI8:
return "VarEnumI8"
case VarEnumUI8:
return "VarEnumUI8"
case VarEnumInt:
return "VarEnumInt"
case VarEnumUint:
return "VarEnumUint"
case VarEnumVoid:
return "VarEnumVoid"
case VarEnumHResult:
return "VarEnumHResult"
case VarEnumPointer:
return "VarEnumPointer"
case VarEnumSafeArray:
return "VarEnumSafeArray"
case VarEnumCarray:
return "VarEnumCarray"
case VarEnumUserdefined:
return "VarEnumUserdefined"
case VarCharString:
return "VarCharString"
case VarUnicodeString:
return "VarUnicodeString"
case VarEnumRecord:
return "VarEnumRecord"
case VarEnumIntPointer:
return "VarEnumIntPointer"
case VarEnumUintPointer:
return "VarEnumUintPointer"
case VarEnumArray:
return "VarEnumArray"
case VarEnumByref:
return "VarEnumByref"
}
return "Invalid"
}
// AdvFeatureFlags type represents ADVFEATUREFLAGS RPC enumeration.
//
// The following values are used in the field fFeatures of a SAFEARRAY (section 2.2.30.10)
// data type.
type AdvFeatureFlags uint16
var (
// FADF_AUTO: MUST be set if the SAFEARRAY is allocated on the stack. This flag MUST
// be ignored on receipt.
AdvFeatureFlagAuto AdvFeatureFlags = 1
// FADF_STATIC: MUST be set if the SAFEARRAY is statically allocated. This flag MUST
// be ignored on receipt.
AdvFeatureFlagStatic AdvFeatureFlags = 2
// FADF_EMBEDDED: MUST be set if the SAFEARRAY is embedded in a structure. This flag
// MUST be ignored on receipt.
AdvFeatureFlagEmbedded AdvFeatureFlags = 4
// FADF_FIXEDSIZE: MUST be set if the SAFEARRAY cannot be resized or reallocated.
// This flag MUST be ignored on receipt.
AdvFeatureFlagFixedSize AdvFeatureFlags = 16
// FADF_RECORD: The SAFEARRAY MUST contain elements of a UDT (see section 2.2.28.1)
AdvFeatureFlagRecord AdvFeatureFlags = 32
// FADF_HAVEIID: The SAFEARRAY MUST contain MInterfacePointers elements.
AdvFeatureFlagHaveIID AdvFeatureFlags = 64
// FADF_HAVEVARTYPE: If this bit flag is set, the high word of the cLocks field of
// the SAFEARRAY MUST contain a VARIANT type constant that describes the type of the
// array's elements (see sections 2.2.7 and 2.2.30.10).
AdvFeatureFlagHaveVarType AdvFeatureFlags = 128
// FADF_BSTR: The SAFEARRAY MUST contain an array of BSTR elements (see section 2.2.23).
AdvFeatureFlagString AdvFeatureFlags = 256
// FADF_UNKNOWN: The SAFEARRAY MUST contain an array of pointers to IUnknown.
AdvFeatureFlagUnknown AdvFeatureFlags = 512
// FADF_DISPATCH: The SAFEARRAY MUST contain an array of pointers to IDispatch (see
// section 3.1.4).
AdvFeatureFlagDispatch AdvFeatureFlags = 1024
// FADF_VARIANT: The SAFEARRAY MUST contain an array of VARIANT instances.
AdvFeatureFlagVariant AdvFeatureFlags = 2048
)
func (o AdvFeatureFlags) String() string {
switch o {
case AdvFeatureFlagAuto:
return "AdvFeatureFlagAuto"
case AdvFeatureFlagStatic:
return "AdvFeatureFlagStatic"
case AdvFeatureFlagEmbedded:
return "AdvFeatureFlagEmbedded"
case AdvFeatureFlagFixedSize:
return "AdvFeatureFlagFixedSize"
case AdvFeatureFlagRecord:
return "AdvFeatureFlagRecord"
case AdvFeatureFlagHaveIID:
return "AdvFeatureFlagHaveIID"
case AdvFeatureFlagHaveVarType:
return "AdvFeatureFlagHaveVarType"
case AdvFeatureFlagString:
return "AdvFeatureFlagString"
case AdvFeatureFlagUnknown:
return "AdvFeatureFlagUnknown"
case AdvFeatureFlagDispatch:
return "AdvFeatureFlagDispatch"
case AdvFeatureFlagVariant:
return "AdvFeatureFlagVariant"
}
return "Invalid"
}
// SafeArrayType type represents SF_TYPE RPC enumeration.
//
// The SF_TYPE enumeration values are used in the discriminant field, sfType, of a SAFEARRAYUNION
// structure.
//
// The SAFEARRAY feature constants are defined in the SF_TYPE enumeration.
type SafeArrayType uint32
var (
// SF_ERROR: This value means that the SAFEARRAY was incorrectly marshaled. The receiver
// MUST reject any call that has a SAFEARRAY argument with this flag specified, by raising
// an RPC_X_BAD_STUB_DATA RPC exception.
//
// Hex value is 0x0000000A.
SafeArrayTypeError SafeArrayType = 10
// SF_I1: The type of the elements contained in the SAFEARRAY MUST be a 1-byte integer.
//
// Hex value is 0x00000010.
SafeArrayTypeI1 SafeArrayType = 16
// SF_I2: The type of the elements contained in the SAFEARRAY MUST be a 2-byte integer.
//
// Hex value is 0x00000002.
SafeArrayTypeI2 SafeArrayType = 2
// SF_I4: The type of the elements contained in the SAFEARRAY MUST be a 4-byte integer.
//
// Hex value is 0x00000003.
SafeArrayTypeI4 SafeArrayType = 3
// SF_I8: The type of the elements contained in the SAFEARRAY MUST be an 8-byte integer.
//
// Hex value is 0x00000014.
SafeArrayTypeI8 SafeArrayType = 20
// SF_BSTR: The type of the elements contained in the SAFEARRAY MUST be a BSTR.
//
// Hex value is 0x00000008.
SafeArrayTypeString SafeArrayType = 8
// SF_UNKNOWN: The type of the elements contained in the SAFEARRAY MUST be a pointer
// to IUnknown.
//
// Hex value is 0x0000000D.
SafeArrayTypeUnknown SafeArrayType = 13
// SF_DISPATCH: The type of the elements contained in the SAFEARRAY MUST be a pointer
// to IDispatch (see section 3.1.4).
//
// Hex value is 0x00000009.
SafeArrayTypeDispatch SafeArrayType = 9
// SF_VARIANT: The type of the elements contained in the SAFEARRAY MUST be VARIANT.
//
// Hex value is 0x0000000C.
SafeArrayTypeVariant SafeArrayType = 12
// SF_RECORD: The type of the elements contained in the SAFEARRAY is a user-defined
// type (UDT) (as defined in section 2.2.28.1.
//
// Hex value is 0x00000024.
SafeArrayTypeRecord SafeArrayType = 36
// SF_HAVEIID: The type of the elements contained in the SAFEARRAY MUST be an MInterfacePointer.
//
// Hex value is 0x0000800D.
SafeArrayTypeHaveIID SafeArrayType = 32781
)
func (o SafeArrayType) String() string {
switch o {
case SafeArrayTypeError:
return "SafeArrayTypeError"
case SafeArrayTypeI1:
return "SafeArrayTypeI1"
case SafeArrayTypeI2:
return "SafeArrayTypeI2"
case SafeArrayTypeI4:
return "SafeArrayTypeI4"
case SafeArrayTypeI8:
return "SafeArrayTypeI8"
case SafeArrayTypeString:
return "SafeArrayTypeString"
case SafeArrayTypeUnknown:
return "SafeArrayTypeUnknown"
case SafeArrayTypeDispatch:
return "SafeArrayTypeDispatch"
case SafeArrayTypeVariant:
return "SafeArrayTypeVariant"
case SafeArrayTypeRecord:
return "SafeArrayTypeRecord"
case SafeArrayTypeHaveIID:
return "SafeArrayTypeHaveIID"
}
return "Invalid"
}
// CallConv type represents CALLCONV RPC enumeration.
//
// The CALLCONV enumeration values are used in the callconv field of a FUNCDESC to identify
// the calling convention of a local method defined in the automation type library module,
// as specified in sections 2.2.42 and 2.2.49.9 .
//
// The following calling convention constants are defined in the CALLCONV enumeration:
type CallConv uint32
var (
// CC_CDECL: MUST be set if the method was declared with the cdecl keyword.
CallConvCdecl CallConv = 1
// CC_PASCAL: MUST be set if the method was declared with the pascal keyword.
CallConvPascal CallConv = 2
// CC_STDCALL: MUST be set if the method was declared with the stdcall keyword.
CallConvStdcall CallConv = 4
)
func (o CallConv) String() string {
switch o {
case CallConvCdecl:
return "CallConvCdecl"
case CallConvPascal:
return "CallConvPascal"
case CallConvStdcall:
return "CallConvStdcall"
}
return "Invalid"
}
// FuncFlags type represents FUNCFLAGS RPC enumeration.
//
// The FUNCFLAGS enumeration values are used in the wFuncFlags field of a FUNCDESC to
// identify features of a function, as specified in section 2.2.42.
//
// The function feature constants are defined in the FUNCFLAGS enumeration.
type FuncFlags uint16
var (
// FUNCFLAG_FRESTRICTED: MUST be set if the method or property was declared with the
// [restricted] attribute (as specified in section 2.2.49.5.1).
FuncFlagsRestricted FuncFlags = 1
// FUNCFLAG_FSOURCE: MUST be set if the method or property is a member of an interface
// declared with the [source] attribute (as specified in section 2.2.49.8).
FuncFlagsSource FuncFlags = 2
// FUNCFLAG_FBINDABLE: MUST be set if the property was declared with the [bindable]
// attribute (as specified in section 2.2.49.5.2).
FuncFlagsBindable FuncFlags = 4
// FUNCFLAG_FREQUESTEDIT: MUST be set if the property was declared with the [requestedit]
// attribute (as specified in section 2.2.49.5.2).
FuncFlagsRequestEdit FuncFlags = 8
// FUNCFLAG_FDISPLAYBIND: MUST be set if the property was declared with the [displaybind]
// attribute (as specified in section 2.2.49.5.2).
FuncFlagsDisplayBind FuncFlags = 16
// FUNCFLAG_FDEFAULTBIND: MUST be set if the property was declared with the [defaultbind]
// attribute (as specified in section 2.2.49.5.2).
FuncFlagsDefaultBind FuncFlags = 32
// FUNCFLAG_FHIDDEN: MUST be set if the method or property was declared with the [hidden]
// attribute (as specified in section 2.2.49.5.1).
FuncFlagsHidden FuncFlags = 64
// FUNCFLAG_FUSESGETLASTERROR: MUST be set if the method or property was declared
// with the [usesgetlasterror] attribute (as specified in section 2.2.49.9) and MUST
// be ignored on receipt.
FuncFlagsFusesgetlasterror FuncFlags = 128
// FUNCFLAG_FDEFAULTCOLLELEM: MUST be set if the method or property was declared with
// the [defaultcollelem] attribute (as specified in section 2.2.49.5.1).
FuncFlagsDefaultCollElem FuncFlags = 256
// FUNCFLAG_FUIDEFAULT: MUST be set if the method or property was declared with the
// [uidefault] attribute (as specified in section 2.2.49.5.1).
FuncFlagsUIDefault FuncFlags = 512
// FUNCFLAG_FNONBROWSABLE: MUST be set if the property was declared with the [nonbrowsable]
// attribute (as specified in section 2.2.49.5.1).
FuncFlagsNonBrowsable FuncFlags = 1024
// FUNCFLAG_FREPLACEABLE: MUST be set if the property was declared with the [replaceable]
// attribute (as specified in section 2.2.49.5.1). MUST be ignored on receipt.
FuncFlagsReplaceable FuncFlags = 2048
// FUNCFLAG_FIMMEDIATEBIND: MUST be set if the property was declared with the [immediatebind]
// attribute (as specified in section 2.2.49.5.2).
FuncFlagsImmediateBind FuncFlags = 4096
)
func (o FuncFlags) String() string {
switch o {
case FuncFlagsRestricted:
return "FuncFlagsRestricted"
case FuncFlagsSource:
return "FuncFlagsSource"
case FuncFlagsBindable:
return "FuncFlagsBindable"
case FuncFlagsRequestEdit:
return "FuncFlagsRequestEdit"
case FuncFlagsDisplayBind:
return "FuncFlagsDisplayBind"
case FuncFlagsDefaultBind:
return "FuncFlagsDefaultBind"
case FuncFlagsHidden:
return "FuncFlagsHidden"
case FuncFlagsFusesgetlasterror:
return "FuncFlagsFusesgetlasterror"
case FuncFlagsDefaultCollElem:
return "FuncFlagsDefaultCollElem"
case FuncFlagsUIDefault:
return "FuncFlagsUIDefault"
case FuncFlagsNonBrowsable:
return "FuncFlagsNonBrowsable"
case FuncFlagsReplaceable:
return "FuncFlagsReplaceable"
case FuncFlagsImmediateBind:
return "FuncFlagsImmediateBind"
}
return "Invalid"
}
// FuncKind type represents FUNCKIND RPC enumeration.
//
// The FUNCKIND enumeration values are used in the funckind field of a FUNCDESC to specify
// the way that a method is accessed, as specified in section 2.2.42.
//
// The following function access constants are defined in the FUNCKIND enumeration.
type FuncKind uint32
var (
// FUNC_PUREVIRTUAL: MUST be set if the method described by the FUNCDESC structure
// is a member of an interface whose associated TYPEKIND value is TKIND_INTERFACE (as
// specified in section 2.2.17).
FuncKindPureVirtual FuncKind = 1
// FUNC_STATIC: MUST be set if the method described by the FUNCDESC structure is a
// method member of the module defined with the automation scope (as specified in section
// 2.2.49.9).
FuncKindStatic FuncKind = 3
// FUNC_DISPATCH: MUST be set if the method described by the FUNCDESC structure is
// a member of an interface whose associated TYPEKIND value is TKIND_DISPATCH (as specified
// in section 2.2.17). MUST NOT be set if the FUNC_PUREVIRTUAL flag is set.
FuncKindDispatch FuncKind = 4
)
func (o FuncKind) String() string {
switch o {
case FuncKindPureVirtual:
return "FuncKindPureVirtual"
case FuncKindStatic:
return "FuncKindStatic"
case FuncKindDispatch:
return "FuncKindDispatch"
}
return "Invalid"
}
// ImplTypeFlags type represents IMPLTYPEFLAGS RPC enumeration.
//
// The IMPLTYPEFLAGS enumeration values are stored in the pImplTypeFlags parameter of
// the ITypeInfo::GetImplTypeFlags method to specify the implementation features of
// a COM server, as specified in section 3.7.4.7.
//
// The following implementation type feature constants are defined in the IMPLTYPEFLAGS
// enumeration.
type ImplTypeFlags uint16
var (
// IMPLTYPEFLAG_FDEFAULT: MUST be set if the interface was declared with the [default]
// attribute (as specified in section 2.2.49.8).
ImplTypeFlagsDefault ImplTypeFlags = 1
// IMPLTYPEFLAG_FSOURCE: MUST be set if the interface was declared with the [source]
// or [defaultvtable] attributes (as specified in section 2.2.49.8).
ImplTypeFlagsSource ImplTypeFlags = 2
// IMPLTYPEFLAG_FRESTRICTED: MUST be set if the interface was declared with the [restricted]
// attribute (as specified in section 2.2.49.8).
ImplTypeFlagsRestricted ImplTypeFlags = 4
// IMPLTYPEFLAG_FDEFAULTVTABLE: MUST be set if the interface was declared with the
// [defaultvtable] attribute (as specified in section 2.2.49.8).
ImplTypeFlagsDefaultVTable ImplTypeFlags = 8
)
func (o ImplTypeFlags) String() string {
switch o {
case ImplTypeFlagsDefault:
return "ImplTypeFlagsDefault"
case ImplTypeFlagsSource:
return "ImplTypeFlagsSource"
case ImplTypeFlagsRestricted:
return "ImplTypeFlagsRestricted"
case ImplTypeFlagsDefaultVTable:
return "ImplTypeFlagsDefaultVTable"
}
return "Invalid"
}
// InvokeKind type represents INVOKEKIND RPC enumeration.
//
// The INVOKEKIND enumeration values are used in the invkind field of a FUNCDESC (section
// 2.2.42) to specify the way that a method is invoked using IDispatch::Invoke (section
// 3.1.4.4). They are also used in the ITypeInfo2::GetFuncIndexOfMemId, ITypeInfo::GetDllEntry
// and ITypeComp::Bind methods to distinguish between properties and property accessor
// methods that have the same MEMBERID (section 2.2.35) but are invoked differently.
//
// Fields and parameters that contain function invocation constants MUST contain a single
// INVOKEKIND value, and MUST NOT contain bitwise combinations of multiple INVOKEKIND
// values.
//
// The function invocation constants are defined in the INVOKEKIND enumeration.
type InvokeKind uint32
var (
// INVOKE_FUNC: MUST be set if the type member is a method declared without the [propget],
// [propput], or [propputref] attributes, or to specify that a client method request
// MUST NOT return a property.
InvokeKindFunc InvokeKind = 1
// INVOKE_PROPERTYGET: MUST be set if the type member is a property declared with
// the [propget] attribute (as specified in section 2.2.49.5.1), or to specify that
// a client method request MUST NOT return anything but an ODL dispinterface property
// (as specified in section 2.2.49.5.3) or a property declared with the [propget] attribute.
InvokeKindPropertyGet InvokeKind = 2
// INVOKE_PROPERTYPUT: MUST be set if the type member is a property declared with
// the [propput] attribute (as specified in section 2.2.49.5.1), or to specify that
// a client method request MUST NOT return anything but a property declared with the
// [propput] attribute.
InvokeKindPropertyPut InvokeKind = 4
// INVOKE_PROPERTYPUTREF: MUST be set if the type member is a property declared with
// the [propputref] attribute (as specified in section 2.2.49.5.1), or to specify that
// a client method request MUST NOT return anything but a property declared with the