This file is indexed.

/usr/include/wine/windows/oaidl.idl is in libwine-dev 1.8.7-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
/*
 * Copyright 2002 Ove Kaaven
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef DO_NO_IMPORTS
import "objidl.idl";
#endif

interface IDispatch;
interface ITypeInfo;
interface ITypeLib;
interface IRecordInfo;

[
  version(1.0),
  pointer_default(unique)
]
interface IOleAutomationTypes
{

typedef CY CURRENCY;

/* Safe Array */

typedef struct tagSAFEARRAYBOUND {
  ULONG cElements;
  LONG lLbound;
} SAFEARRAYBOUND, *LPSAFEARRAYBOUND;

typedef [unique] struct _wireVARIANT *wireVARIANT;
typedef [unique] struct _wireBRECORD *wireBRECORD;

typedef struct _wireSAFEARR_BSTR {
  ULONG Size;
  [size_is(Size), ref] wireBSTR *aBstr;
} SAFEARR_BSTR;

typedef struct _wireSAFEARR_UNKNOWN {
  ULONG Size;
  [size_is(Size), ref] IUnknown **apUnknown;
} SAFEARR_UNKNOWN;

typedef struct _wireSAFEARR_DISPATCH {
  ULONG Size;
  [size_is(Size), ref] IDispatch **apDispatch;
} SAFEARR_DISPATCH;

typedef struct _wireSAFEARR_VARIANT {
  ULONG Size;
  [size_is(Size), ref] wireVARIANT *aVariant;
} SAFEARR_VARIANT;

typedef struct _wireSAFEARR_BRECORD {
  ULONG Size;
  [size_is(Size), ref] wireBRECORD *aRecord;
} SAFEARR_BRECORD;

typedef struct _wireSAFEARR_HAVEIID {
  ULONG Size;
  [size_is(Size), ref] IUnknown **apUnknown;
  IID iid;
} SAFEARR_HAVEIID;

typedef [v1_enum] enum tagSF_TYPE {
  SF_ERROR    = VT_ERROR,
  SF_I1       = VT_I1,
  SF_I2       = VT_I2,
  SF_I4       = VT_I4,
  SF_I8       = VT_I8,
  SF_BSTR     = VT_BSTR,
  SF_UNKNOWN  = VT_UNKNOWN,
  SF_DISPATCH = VT_DISPATCH,
  SF_VARIANT  = VT_VARIANT,
  SF_RECORD   = VT_RECORD,
  SF_HAVEIID  = VT_UNKNOWN|VT_RESERVED,
} SF_TYPE;

typedef union _wireSAFEARRAY_UNION switch(ULONG sfType) u {
  case SF_BSTR:     SAFEARR_BSTR BstrStr;
  case SF_UNKNOWN:  SAFEARR_UNKNOWN UnknownStr;
  case SF_DISPATCH: SAFEARR_DISPATCH DispatchStr;
  case SF_VARIANT:  SAFEARR_VARIANT VariantStr;
  case SF_RECORD:   SAFEARR_BRECORD RecordStr;
  case SF_HAVEIID:  SAFEARR_HAVEIID HaveIidStr;
  case SF_I1:       BYTE_SIZEDARR ByteStr;
  case SF_I2:       WORD_SIZEDARR WordStr;
  case SF_I4:       DWORD_SIZEDARR LongStr;
  case SF_I8:       HYPER_SIZEDARR HyperStr;
} SAFEARRAYUNION;

typedef [unique] struct _wireSAFEARRAY {
  USHORT cDims;
  USHORT fFeatures;
  ULONG cbElements;
  ULONG cLocks;
  SAFEARRAYUNION uArrayStructs;
  [size_is(cDims)] SAFEARRAYBOUND rgsabound[];
} *wireSAFEARRAY;

typedef [unique] wireSAFEARRAY *wirePSAFEARRAY;

typedef struct tagSAFEARRAY {
  USHORT cDims;
  USHORT fFeatures;
  ULONG cbElements;
  ULONG cLocks;
  PVOID pvData;
  SAFEARRAYBOUND rgsabound[];
} SAFEARRAY;

typedef [wire_marshal(wirePSAFEARRAY)] SAFEARRAY *LPSAFEARRAY;

const USHORT FADF_AUTO        = 0x0001;
const USHORT FADF_STATIC      = 0x0002;
const USHORT FADF_EMBEDDED    = 0x0004;
const USHORT FADF_FIXEDSIZE   = 0x0010;
const USHORT FADF_RECORD      = 0x0020;
const USHORT FADF_HAVEIID     = 0x0040;
const USHORT FADF_HAVEVARTYPE = 0x0080;
const USHORT FADF_BSTR        = 0x0100;
const USHORT FADF_UNKNOWN     = 0x0200;
const USHORT FADF_DISPATCH    = 0x0400;
const USHORT FADF_VARIANT     = 0x0800;
const USHORT FADF_RESERVED    = 0xF008;
/* Undocumented flags */
const USHORT FADF_DATADELETED  = 0x1000; /* Data in a vector has been deleted */
const USHORT FADF_CREATEVECTOR = 0x2000; /* This array is a vector */

/* Variant */

cpp_quote("#if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)")
cpp_quote("#define __VARIANT_NAME_1 n1")
cpp_quote("#define __VARIANT_NAME_2 n2")
cpp_quote("#define __VARIANT_NAME_3 n3")
cpp_quote("#define __VARIANT_NAME_4 brecVal")
cpp_quote("#else")
cpp_quote("#define __tagVARIANT")
cpp_quote("#define __VARIANT_NAME_1")
cpp_quote("#define __VARIANT_NAME_2")
cpp_quote("#define __VARIANT_NAME_3")
cpp_quote("#define __tagBRECORD")
cpp_quote("#define __VARIANT_NAME_4")
cpp_quote("#endif")

typedef [wire_marshal(wireVARIANT)] struct tagVARIANT VARIANT;

struct tagVARIANT {
  union {
    struct __tagVARIANT {
      VARTYPE vt;
      WORD wReserved1;
      WORD wReserved2;
      WORD wReserved3;
      union {
        signed char cVal;
        USHORT uiVal;
        ULONG ulVal;
        INT intVal;
        UINT uintVal;
        BYTE bVal;
        SHORT iVal;
        LONG lVal;
        FLOAT fltVal;
        DOUBLE dblVal;
        VARIANT_BOOL boolVal;
#if 0 /* illegal in C++ */
        _VARIANT_BOOL bool;
#endif
        SCODE scode;
        DATE date;
        BSTR bstrVal;
        CY cyVal;
        IUnknown *punkVal;
        IDispatch *pdispVal;
        SAFEARRAY *parray;
        LONGLONG llVal;
        ULONGLONG ullVal;
        signed char *pcVal;
        USHORT *puiVal;
        ULONG *pulVal;
        INT *pintVal;
        UINT *puintVal;
        BYTE *pbVal;
        SHORT *piVal;
        LONG *plVal;
        FLOAT *pfltVal;
        DOUBLE *pdblVal;
        VARIANT_BOOL *pboolVal;
#if 0
        _VARIANT_BOOL *pbool;
#endif
        SCODE *pscode;
        DATE *pdate;
        BSTR *pbstrVal;
        VARIANT *pvarVal;
        PVOID byref;
        CY *pcyVal;
        DECIMAL *pdecVal;
        IUnknown **ppunkVal;
        IDispatch **ppdispVal;
        SAFEARRAY **pparray;
        LONGLONG *pllVal;
        ULONGLONG *pullVal;
        struct __tagBRECORD {
          PVOID pvRecord;
          IRecordInfo *pRecInfo;
        } __VARIANT_NAME_4;
      } __VARIANT_NAME_3;
    } __VARIANT_NAME_2;

    DECIMAL decVal;
  } __VARIANT_NAME_1;
};

typedef VARIANT *LPVARIANT;
typedef VARIANT VARIANTARG;
typedef VARIANTARG *LPVARIANTARG;

cpp_quote("#if 0")
typedef const VARIANT *REFVARIANT;
cpp_quote("#elif !defined(_REFVARIANT_DEFINED)")
cpp_quote("#define _REFVARIANT_DEFINED")
cpp_quote("#ifdef __cplusplus")
cpp_quote("#define REFVARIANT const VARIANT &")
cpp_quote("#else")
cpp_quote("#define REFVARIANT const VARIANT *__MIDL_CONST")
cpp_quote("#endif")
cpp_quote("#endif")

struct _wireBRECORD {
  ULONG fFlags;
  ULONG clSize;
  IRecordInfo *pRecInfo;
  [size_is(clSize)] byte *pRecord;
};

struct _wireVARIANT {
  DWORD clSize;
  DWORD rpcReserved;
  USHORT vt;
  USHORT wReserved1;
  USHORT wReserved2;
  USHORT wReserved3;
  [switch_is(vt)] union {
  [case(VT_EMPTY, VT_NULL)]    ;
  [case(VT_I1)]                signed char cVal;
  [case(VT_UI2)]               USHORT uiVal;
  [case(VT_UI4)]               ULONG ulVal;
  [case(VT_INT)]               INT intVal;
  [case(VT_UINT)]              UINT uintVal;
  [case(VT_UI1)]               BYTE bVal;
  [case(VT_I2)]                SHORT iVal;
  [case(VT_I4)]                LONG lVal;
  [case(VT_R4)]                FLOAT fltVal;
  [case(VT_R8)]                DOUBLE dblVal;
  [case(VT_BOOL)]              VARIANT_BOOL boolVal;
  [case(VT_ERROR)]             SCODE scode;
  [case(VT_DATE)]              DATE date;
  [case(VT_BSTR)]              wireBSTR bstrVal;
  [case(VT_CY)]                CY cyVal;
  [case(VT_DECIMAL)]           DECIMAL decVal;
  [case(VT_UNKNOWN)]           IUnknown *punkVal;
  [case(VT_DISPATCH)]          IDispatch *pdispVal;
  [case(VT_ARRAY)]             wireSAFEARRAY parray;
  [case(VT_I1|VT_BYREF)]       signed char *pcVal;
  [case(VT_UI2|VT_BYREF)]      USHORT *puiVal;
  [case(VT_UI4|VT_BYREF)]      ULONG *pulVal;
  [case(VT_INT|VT_BYREF)]      INT *pintVal;
  [case(VT_UINT|VT_BYREF)]     UINT *puintVal;
  [case(VT_UI1|VT_BYREF)]      BYTE *pbVal;
  [case(VT_I2|VT_BYREF)]       SHORT *piVal;
  [case(VT_I4|VT_BYREF)]       LONG *plVal;
  [case(VT_R4|VT_BYREF)]       FLOAT *pfltVal;
  [case(VT_R8|VT_BYREF)]       DOUBLE *pdblVal;
  [case(VT_BOOL|VT_BYREF)]     VARIANT_BOOL *pboolVal;
  [case(VT_ERROR|VT_BYREF)]    SCODE *pscode;
  [case(VT_DATE|VT_BYREF)]     DATE *pdate;
  [case(VT_BSTR|VT_BYREF)]     wireBSTR *pbstrVal;
  [case(VT_VARIANT|VT_BYREF)]  wireVARIANT *pvarVal;
  [case(VT_CY|VT_BYREF)]       CY *pcyVal;
  [case(VT_DECIMAL|VT_BYREF)]  DECIMAL *pdecVal;
  [case(VT_UNKNOWN|VT_BYREF)]  IUnknown **ppunkVal;
  [case(VT_DISPATCH|VT_BYREF)] IDispatch **ppdispVal;
  [case(VT_ARRAY|VT_BYREF)]    wireSAFEARRAY *pparray;
  [case(VT_RECORD, VT_RECORD|VT_BYREF)] wireBRECORD brecVal;
  } DUMMYUNIONNAME;
};

/* Dispatch */

typedef LONG DISPID;
typedef DWORD HREFTYPE;
typedef DISPID MEMBERID;

typedef [v1_enum] enum tagTYPEKIND {
  TKIND_ENUM = 0,
  TKIND_RECORD,
  TKIND_MODULE,
  TKIND_INTERFACE,
  TKIND_DISPATCH,
  TKIND_COCLASS,
  TKIND_ALIAS,
  TKIND_UNION,
  TKIND_MAX
} TYPEKIND;

typedef struct tagTYPEDESC {
  [switch_is(vt)] union {
  [case(VT_PTR, VT_SAFEARRAY)] struct tagTYPEDESC *lptdesc;
  [case(VT_CARRAY)]            struct tagARRAYDESC *lpadesc;
  [case(VT_USERDEFINED)]       HREFTYPE hreftype;
  [default]                    ;
  } DUMMYUNIONNAME;
  VARTYPE vt;
} TYPEDESC;

typedef struct tagARRAYDESC {
  TYPEDESC tdescElem;
  USHORT cDims;
  [size_is(cDims)] SAFEARRAYBOUND rgbounds[];
} ARRAYDESC;

typedef struct tagPARAMDESCEX {
  ULONG cBytes;
  VARIANTARG varDefaultValue;
} PARAMDESCEX, *LPPARAMDESCEX;

typedef struct tagPARAMDESC {
  LPPARAMDESCEX pparamdescex;
  USHORT wParamFlags;
} PARAMDESC, *LPPARAMDESC;

const USHORT PARAMFLAG_NONE         = 0x00;
const USHORT PARAMFLAG_FIN          = 0x01;
const USHORT PARAMFLAG_FOUT         = 0x02;
const USHORT PARAMFLAG_FLCID        = 0x04;
const USHORT PARAMFLAG_FRETVAL      = 0x08;
const USHORT PARAMFLAG_FOPT         = 0x10;
const USHORT PARAMFLAG_FHASDEFAULT  = 0x20;
const USHORT PARAMFLAG_FHASCUSTDATA = 0x40;

typedef struct tagIDLDESC {
  ULONG_PTR dwReserved;
  USHORT wIDLFlags;
} IDLDESC, *LPIDLDESC;

const USHORT IDLFLAG_NONE    = PARAMFLAG_NONE;
const USHORT IDLFLAG_FIN     = PARAMFLAG_FIN;
const USHORT IDLFLAG_FOUT    = PARAMFLAG_FOUT;
const USHORT IDLFLAG_FLCID   = PARAMFLAG_FLCID;
const USHORT IDLFLAG_FRETVAL = PARAMFLAG_FRETVAL;

cpp_quote("#if 0") /* for IDL only */
typedef struct tagELEMDESC {
  TYPEDESC tdesc;
  PARAMDESC paramdesc;
} ELEMDESC;
cpp_quote("#else") /* C/C++ defs */
cpp_quote("typedef struct tagELEMDESC {")
cpp_quote("  TYPEDESC tdesc;")
cpp_quote("  union {")
cpp_quote("    IDLDESC idldesc;")
cpp_quote("    PARAMDESC paramdesc;")
cpp_quote("  } DUMMYUNIONNAME;")
cpp_quote("} ELEMDESC, *LPELEMDESC;")
cpp_quote("#endif")

typedef struct tagTYPEATTR {
  GUID guid;
  LCID lcid;
  DWORD dwReserved;
  MEMBERID memidConstructor;
  MEMBERID memidDestructor;
  LPOLESTR lpstrSchema;
  ULONG cbSizeInstance;
  TYPEKIND typekind;
  WORD cFuncs;
  WORD cVars;
  WORD cImplTypes;
  WORD cbSizeVft;
  WORD cbAlignment;
  WORD wTypeFlags;
  WORD wMajorVerNum;
  WORD wMinorVerNum;
  TYPEDESC tdescAlias;
  IDLDESC idldescType;
} TYPEATTR, *LPTYPEATTR;

typedef struct tagDISPPARAMS {
  [size_is(cArgs)] VARIANTARG *rgvarg;
  [size_is(cNamedArgs)] DISPID *rgdispidNamedArgs;
  UINT cArgs;
  UINT cNamedArgs;
} DISPPARAMS;

cpp_quote("#if 0") /* for IDL only */
typedef struct tagEXCEPINFO {
  WORD wCode;
  WORD wReserved;
  BSTR bstrSource;
  BSTR bstrDescription;
  BSTR bstrHelpFile;
  DWORD dwHelpContext;
  ULONG_PTR pvReserved;
  ULONG_PTR pfnDeferredFillIn;
  SCODE scode;
} EXCEPINFO;
cpp_quote("#else")
cpp_quote("typedef struct tagEXCEPINFO {")
cpp_quote("  WORD wCode;")
cpp_quote("  WORD wReserved;")
cpp_quote("  BSTR bstrSource;")
cpp_quote("  BSTR bstrDescription;")
cpp_quote("  BSTR bstrHelpFile;")
cpp_quote("  DWORD dwHelpContext;")
cpp_quote("  PVOID pvReserved;")
cpp_quote("  HRESULT (__stdcall *pfnDeferredFillIn)(struct tagEXCEPINFO *);")
cpp_quote("  SCODE scode;")
cpp_quote("} EXCEPINFO, *LPEXCEPINFO;")
cpp_quote("#endif")

typedef [v1_enum] enum tagCALLCONV {
  CC_FASTCALL = 0,
  CC_CDECL = 1,
  CC_MSCPASCAL,
  CC_PASCAL = CC_MSCPASCAL,
  CC_MACPASCAL,
  CC_STDCALL,
  CC_FPFASTCALL,
  CC_SYSCALL,
  CC_MPWCDECL,
  CC_MPWPASCAL,
  CC_MAX
} CALLCONV;

typedef [v1_enum] enum tagFUNCKIND {
  FUNC_VIRTUAL,
  FUNC_PUREVIRTUAL,
  FUNC_NONVIRTUAL,
  FUNC_STATIC,
  FUNC_DISPATCH
} FUNCKIND;

typedef [v1_enum] enum tagINVOKEKIND {
  INVOKE_FUNC = 1,
  INVOKE_PROPERTYGET = 2,
  INVOKE_PROPERTYPUT = 4,
  INVOKE_PROPERTYPUTREF = 8
} INVOKEKIND;

typedef struct tagFUNCDESC {
  MEMBERID memid;
  [size_is(cScodes)] SCODE *lprgscode;
  [size_is(cParams)] ELEMDESC *lprgelemdescParam;
  FUNCKIND funckind;
  INVOKEKIND invkind;
  CALLCONV callconv;
  SHORT cParams;
  SHORT cParamsOpt;
  SHORT oVft;
  SHORT cScodes;
  ELEMDESC elemdescFunc;
  WORD wFuncFlags;
} FUNCDESC, *LPFUNCDESC;

typedef [v1_enum] enum tagVARKIND {
  VAR_PERINSTANCE,
  VAR_STATIC,
  VAR_CONST,
  VAR_DISPATCH
} VARKIND;

const USHORT IMPLTYPEFLAG_FDEFAULT       = 0x1;
const USHORT IMPLTYPEFLAG_FSOURCE        = 0x2;
const USHORT IMPLTYPEFLAG_FRESTRICTED    = 0x4;
const USHORT IMPLTYPEFLAG_FDEFAULTVTABLE = 0x8;

typedef struct tagVARDESC {
  MEMBERID memid;
  LPOLESTR lpstrSchema;
  [switch_is(varkind)] union {
  [case(VAR_PERINSTANCE, VAR_DISPATCH, VAR_STATIC)] ULONG oInst;
  [case(VAR_CONST)] VARIANT *lpvarValue;
  } DUMMYUNIONNAME;
  ELEMDESC elemdescVar;
  WORD wVarFlags;
  VARKIND varkind;
} VARDESC, *LPVARDESC;

typedef enum tagTYPEFLAGS {
  TYPEFLAG_FAPPOBJECT     = 0x0001,
  TYPEFLAG_FCANCREATE     = 0x0002,
  TYPEFLAG_FLICENSED      = 0x0004,
  TYPEFLAG_FPREDECLID     = 0x0008,
  TYPEFLAG_FHIDDEN        = 0x0010,
  TYPEFLAG_FCONTROL       = 0x0020,
  TYPEFLAG_FDUAL          = 0x0040,
  TYPEFLAG_FNONEXTENSIBLE = 0x0080,
  TYPEFLAG_FOLEAUTOMATION = 0x0100,
  TYPEFLAG_FRESTRICTED    = 0x0200,
  TYPEFLAG_FAGGREGATABLE  = 0x0400,
  TYPEFLAG_FREPLACEABLE   = 0x0800,
  TYPEFLAG_FDISPATCHABLE  = 0x1000,
  TYPEFLAG_FREVERSEBIND   = 0x2000,
  TYPEFLAG_FPROXY         = 0x4000
} TYPEFLAGS;

typedef enum tagFUNCFLAGS {
  FUNCFLAG_FRESTRICTED       = 0x0001,
  FUNCFLAG_FSOURCE           = 0x0002,
  FUNCFLAG_FBINDABLE         = 0x0004,
  FUNCFLAG_FREQUESTEDIT      = 0x0008,
  FUNCFLAG_FDISPLAYBIND      = 0x0010,
  FUNCFLAG_FDEFAULTBIND      = 0x0020,
  FUNCFLAG_FHIDDEN           = 0x0040,
  FUNCFLAG_FUSESGETLASTERROR = 0x0080,
  FUNCFLAG_FDEFAULTCOLLELEM  = 0x0100,
  FUNCFLAG_FUIDEFAULT        = 0x0200,
  FUNCFLAG_FNONBROWSABLE     = 0x0400,
  FUNCFLAG_FREPLACEABLE      = 0x0800,
  FUNCFLAG_FIMMEDIATEBIND    = 0x1000
} FUNCFLAGS;

typedef enum tagVARFLAGS {
  VARFLAG_FREADONLY        = 0x0001,
  VARFLAG_FSOURCE          = 0x0002,
  VARFLAG_FBINDABLE        = 0x0004,
  VARFLAG_FREQUESTEDIT     = 0x0008,
  VARFLAG_FDISPLAYBIND     = 0x0010,
  VARFLAG_FDEFAULTBIND     = 0x0020,
  VARFLAG_FHIDDEN          = 0x0040,
  VARFLAG_FRESTRICTED      = 0x0080,
  VARFLAG_FDEFAULTCOLLELEM = 0x0100,
  VARFLAG_FUIDEFAULT       = 0x0200,
  VARFLAG_FNONBROWSABLE    = 0x0400,
  VARFLAG_FREPLACEABLE     = 0x0800,
  VARFLAG_FIMMEDIATEBIND   = 0x1000
} VARFLAGS;

typedef [wire_marshal(DWORD)] struct tagCLEANLOCALSTORAGE {
  IUnknown *pInterface;
  PVOID pStorage;
  DWORD flags;
} CLEANLOCALSTORAGE;

typedef struct tagCUSTDATAITEM {
  GUID guid;
  VARIANTARG varValue;
} CUSTDATAITEM, *LPCUSTDATAITEM;

typedef struct tagCUSTDATA {
  DWORD cCustData;
  [size_is(cCustData)] LPCUSTDATAITEM prgCustData;
} CUSTDATA, *LPCUSTDATA;

} /* interface IOleAutomationTypes */

/******************** INTERFACES ********************/

[
  object,
  uuid(00020400-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface IDispatch : IUnknown
{
  typedef [unique] IDispatch *LPDISPATCH;

  const DISPID DISPID_UNKNOWN     = -1;
  const DISPID DISPID_VALUE       =  0;
  const DISPID DISPID_PROPERTYPUT = -3;
  const DISPID DISPID_NEWENUM     = -4;
  const DISPID DISPID_EVALUATE    = -5;
  const DISPID DISPID_CONSTRUCTOR = -6;
  const DISPID DISPID_DESTRUCTOR  = -7;
  const DISPID DISPID_COLLECT     = -8;

  HRESULT GetTypeInfoCount(
    [out] UINT *pctinfo);

  HRESULT GetTypeInfo(
    [in] UINT iTInfo,
    [in] LCID lcid,
    [out] ITypeInfo **ppTInfo);

  HRESULT GetIDsOfNames(
    [in] REFIID riid,
    [in, size_is(cNames)] LPOLESTR *rgszNames,
    [in] UINT cNames,
    [in] LCID lcid,
    [out, size_is(cNames)] DISPID *rgDispId);

  [local]
  HRESULT Invoke(
    [in] DISPID dispIdMember,
    [in] REFIID riid,
    [in] LCID lcid,
    [in] WORD wFlags,
    [in, out] DISPPARAMS *pDispParams,
    [out] VARIANT *pVarResult,
    [out] EXCEPINFO *pExcepInfo,
    [out] UINT *puArgErr);

  [call_as(Invoke)]
  HRESULT RemoteInvoke(
    [in] DISPID dispIdMember,
    [in] REFIID riid,
    [in] LCID lcid,
    [in] DWORD dwFlags,
    [in] DISPPARAMS *pDispParams,
    [out] VARIANT *pVarResult,
    [out] EXCEPINFO *pExcepInfo,
    [out] UINT *pArgErr,
    [in] UINT cVarRef,
    [in, size_is(cVarRef)] UINT *rgVarRefIdx,
    [in, out, size_is(cVarRef)] VARIANTARG *rgVarRef);
}

[
  object,
  uuid(00020404-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface IEnumVARIANT : IUnknown
{
  typedef [unique] IEnumVARIANT *LPENUMVARIANT;

  [local]
  HRESULT Next(
    [in] ULONG celt,
    [out] VARIANT *rgVar,
    [out] ULONG *pCeltFetched);

  [call_as(Next)]
  HRESULT RemoteNext(
    [in] ULONG celt,
    [out, size_is(celt), length_is(*pCeltFetched)]
    VARIANT *rgVar,
    [out] ULONG *pCeltFetched);

  HRESULT Skip(
    [in] ULONG celt);

  HRESULT Reset();

  HRESULT Clone(
    [out] IEnumVARIANT **ppEnum);
}

[
  object,
  uuid(00020403-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeComp : IUnknown
{
  typedef [unique] ITypeComp *LPTYPECOMP;

  typedef [v1_enum] enum tagDESCKIND {
    DESCKIND_NONE = 0,
    DESCKIND_FUNCDESC,
    DESCKIND_VARDESC,
    DESCKIND_TYPECOMP,
    DESCKIND_IMPLICITAPPOBJ,
    DESCKIND_MAX
  } DESCKIND;

  typedef union tagBINDPTR {
    FUNCDESC *lpfuncdesc;
    VARDESC *lpvardesc;
    ITypeComp *lptcomp;
  } BINDPTR, *LPBINDPTR;

  [local]
  HRESULT Bind(
    [in] LPOLESTR szName,
    [in] ULONG lHashVal,
    [in] WORD wFlags,
    [out] ITypeInfo **ppTInfo,
    [out] DESCKIND *pDescKind,
    [out] BINDPTR *pBindPtr);

  [call_as(Bind)]
  HRESULT RemoteBind(
    [in] LPOLESTR szName,
    [in] ULONG lHashVal,
    [in] WORD wFlags,
    [out] ITypeInfo **ppTInfo,
    [out] DESCKIND *pDescKind,
    [out] LPFUNCDESC *ppFuncDesc,
    [out] LPVARDESC *ppVarDesc,
    [out] ITypeComp **ppTypeComp,
    [out] CLEANLOCALSTORAGE *pDummy);

  [local]
  HRESULT BindType(
    [in] LPOLESTR szName,
    [in] ULONG lHashVal,
    [out] ITypeInfo **ppTInfo,
    [out] ITypeComp **ppTComp);

  [call_as(BindType)]
  HRESULT RemoteBindType(
    [in] LPOLESTR szName,
    [in] ULONG lHashVal,
    [out] ITypeInfo **ppTInfo);
}

[
  object,
  uuid(00020401-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeInfo : IUnknown
{
  typedef [unique] ITypeInfo *LPTYPEINFO;

  [local]
  HRESULT GetTypeAttr(
    [out] TYPEATTR **ppTypeAttr);

  [call_as(GetTypeAttr)]
  HRESULT RemoteGetTypeAttr(
    [out] LPTYPEATTR *ppTypeAttr,
    [out] CLEANLOCALSTORAGE *pDummy);

  HRESULT GetTypeComp(
    [out] ITypeComp **ppTComp);

  [local]
  HRESULT GetFuncDesc(
    [in] UINT index,
    [out] FUNCDESC **ppFuncDesc);

  [call_as(GetFuncDesc)]
  HRESULT RemoteGetFuncDesc(
    [in] UINT index,
    [out] LPFUNCDESC *ppFuncDesc,
    [out] CLEANLOCALSTORAGE *pDummy);

  [local]
  HRESULT GetVarDesc(
    [in] UINT index,
    [out] VARDESC **ppVarDesc);

  [call_as(GetVarDesc)]
  HRESULT RemoteGetVarDesc(
    [in] UINT index,
    [out] LPVARDESC *ppVarDesc,
    [out] CLEANLOCALSTORAGE *pDummy);

  [local]
  HRESULT GetNames(
    [in] MEMBERID memid,
    [out, size_is(cMaxNames), length_is(*pcNames)] BSTR *rgBstrNames,
    [in] UINT cMaxNames,
    [out] UINT *pcNames);

  [call_as(GetNames)]
  HRESULT RemoteGetNames(
    [in] MEMBERID memid,
    [out, size_is(cMaxNames), length_is(*pcNames)] BSTR *rgBstrNames,
    [in] UINT cMaxNames,
    [out] UINT *pcNames);

  HRESULT GetRefTypeOfImplType(
    [in] UINT index,
    [out] HREFTYPE *pRefType);

  HRESULT GetImplTypeFlags(
    [in] UINT index,
    [out] INT *pImplTypeFlags);

  [local]
  HRESULT GetIDsOfNames(
    [in, size_is(cNames)] LPOLESTR *rgszNames,
    [in] UINT cNames,
    [out, size_is(cNames)] MEMBERID *pMemId);

  [call_as(GetIDsOfNames)]
  HRESULT LocalGetIDsOfNames();

  [local]
  HRESULT Invoke(
    [in] PVOID pvInstance,
    [in] MEMBERID memid,
    [in] WORD wFlags,
    [in, out] DISPPARAMS *pDispParams,
    [out] VARIANT *pVarResult,
    [out] EXCEPINFO *pExcepInfo,
    [out] UINT *puArgErr);

  [call_as(Invoke)]
  HRESULT LocalInvoke();

  [local]
  HRESULT GetDocumentation(
    [in] MEMBERID memid,
    [out] BSTR *pBstrName,
    [out] BSTR *pBstrDocString,
    [out] DWORD *pdwHelpContext,
    [out] BSTR *pBstrHelpFile);

  [call_as(GetDocumentation)]
  HRESULT RemoteGetDocumentation(
    [in] MEMBERID memid,
    [in] DWORD refPtrFlags,
    [out] BSTR *pBstrName,
    [out] BSTR *pBstrDocString,
    [out] DWORD *pdwHelpContext,
    [out] BSTR *pBstrHelpFile);

  [local]
  HRESULT GetDllEntry(
    [in] MEMBERID memid,
    [in] INVOKEKIND invKind,
    [out] BSTR *pBstrDllName,
    [out] BSTR *pBstrName,
    [out] WORD *pwOrdinal);

  [call_as(GetDllEntry)]
  HRESULT RemoteGetDllEntry(
    [in] MEMBERID memid,
    [in] INVOKEKIND invKind,
    [in] DWORD refPtrFlags,
    [out] BSTR *pBstrDllName,
    [out] BSTR *pBstrName,
    [out] WORD *pwOrdinal);

  HRESULT GetRefTypeInfo(
    [in] HREFTYPE hRefType,
    [out] ITypeInfo **ppTInfo);

  [local]
  HRESULT AddressOfMember(
    [in] MEMBERID memid,
    [in] INVOKEKIND invKind,
    [out] PVOID *ppv);

  [call_as(AddressOfMember)]
  HRESULT LocalAddressOfMember();

  [local]
  HRESULT CreateInstance(
    [in] IUnknown *pUnkOuter,
    [in] REFIID riid,
    [out, iid_is(riid)] PVOID *ppvObj);

  [call_as(CreateInstance)]
  HRESULT RemoteCreateInstance(
    [in] REFIID riid,
    [out, iid_is(riid)] IUnknown **ppvObj);

  HRESULT GetMops(
    [in] MEMBERID memid,
    [out] BSTR *pBstrMops);

  [local]
  HRESULT GetContainingTypeLib(
    [out] ITypeLib **ppTLib,
    [out] UINT *pIndex);

  [call_as(GetContainingTypeLib)]
  HRESULT RemoteGetContainingTypeLib(
    [out] ITypeLib **ppTLib,
    [out] UINT *pIndex);

  [local]
  void ReleaseTypeAttr(
    [in] TYPEATTR *pTypeAttr);

  [call_as(ReleaseTypeAttr)]
  HRESULT LocalReleaseTypeAttr();

  [local]
  void ReleaseFuncDesc(
    [in] FUNCDESC *pFuncDesc);

  [call_as(ReleaseFuncDesc)]
  HRESULT LocalReleaseFuncDesc();

  [local]
  void ReleaseVarDesc(
    [in] VARDESC *pVarDesc);

  [call_as(ReleaseVarDesc)]
  HRESULT LocalReleaseVarDesc();
}

[
  object,
  uuid(00020412-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeInfo2 : ITypeInfo
{
  typedef [unique] ITypeInfo2 *LPTYPEINFO2;

  HRESULT GetTypeKind(
    [out] TYPEKIND *pTypeKind);

  HRESULT GetTypeFlags(
    [out] ULONG *pTypeFlags);

  HRESULT GetFuncIndexOfMemId(
    [in] MEMBERID memid,
    [in] INVOKEKIND invKind,
    [out] UINT *pFuncIndex);

  HRESULT GetVarIndexOfMemId(
    [in] MEMBERID memid,
    [out] UINT *pVarIndex);

  HRESULT GetCustData(
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  HRESULT GetFuncCustData(
    [in] UINT index,
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  HRESULT GetParamCustData(
    [in] UINT indexFunc,
    [in] UINT indexParam,
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  HRESULT GetVarCustData(
    [in] UINT index,
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  HRESULT GetImplTypeCustData(
    [in] UINT index,
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  [local]
  HRESULT GetDocumentation2(
    [in] MEMBERID memid,
    [in] LCID lcid,
    [out] BSTR *pbstrHelpString,
    [out] DWORD *pdwHelpStringContext,
    [out] BSTR *pbstrHelpStringDll);

  [call_as(GetDocumentation2)]
  HRESULT RemoteGetDocumentation2(
    [in] MEMBERID memid,
    [in] LCID lcid,
    [in] DWORD refPtrFlags,
    [out] BSTR *pbstrHelpString,
    [out] DWORD *pdwHelpStringContext,
    [out] BSTR *pbstrHelpStringDll);

  HRESULT GetAllCustData(
    [out] CUSTDATA *pCustData);

  HRESULT GetAllFuncCustData(
    [in] UINT index,
    [out] CUSTDATA *pCustData);

  HRESULT GetAllParamCustData(
    [in] UINT indexFunc,
    [in] UINT indexParam,
    [out] CUSTDATA *pCustData);

  HRESULT GetAllVarCustData(
    [in] UINT index,
    [out] CUSTDATA *pCustData);

  HRESULT GetAllImplTypeCustData(
    [in] UINT index,
    [out] CUSTDATA *pCustData);
}

[
  object,
  uuid(00020402-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeLib : IUnknown
{
  typedef [unique] ITypeLib *LPTYPELIB;

  typedef [v1_enum] enum tagSYSKIND {
    SYS_WIN16 = 0,
    SYS_WIN32,
    SYS_MAC,
    SYS_WIN64
  } SYSKIND;

  typedef [v1_enum] enum tagLIBFLAGS {
    LIBFLAG_FRESTRICTED   = 0x01,
    LIBFLAG_FCONTROL      = 0x02,
    LIBFLAG_FHIDDEN       = 0x04,
    LIBFLAG_FHASDISKIMAGE = 0x08
  } LIBFLAGS;

  typedef struct tagTLIBATTR {
    GUID guid;
    LCID lcid;
    SYSKIND syskind;
    WORD wMajorVerNum;
    WORD wMinorVerNum;
    WORD wLibFlags;
  } TLIBATTR, *LPTLIBATTR;

  [local]
  UINT GetTypeInfoCount();

  [call_as(GetTypeInfoCount)]
  HRESULT RemoteGetTypeInfoCount(
    [out] UINT *pcTInfo);

  HRESULT GetTypeInfo(
    [in] UINT index,
    [out] ITypeInfo **ppTInfo);

  HRESULT GetTypeInfoType(
    [in] UINT index,
    [out] TYPEKIND *pTKind);

  HRESULT GetTypeInfoOfGuid(
    [in] REFGUID guid,
    [out] ITypeInfo **ppTinfo);

  [local]
  HRESULT GetLibAttr(
    [out] TLIBATTR **ppTLibAttr);

  [call_as(GetLibAttr)]
  HRESULT RemoteGetLibAttr(
    [out] LPTLIBATTR *ppTLibAttr,
    [out] CLEANLOCALSTORAGE *pDummy);

  HRESULT GetTypeComp(
    [out] ITypeComp **ppTComp);

  [local]
  HRESULT GetDocumentation(
    [in] INT index,
    [out] BSTR *pBstrName,
    [out] BSTR *pBstrDocString,
    [out] DWORD *pdwHelpContext,
    [out] BSTR *pBstrHelpFile);

  [call_as(GetDocumentation)]
  HRESULT RemoteGetDocumentation(
    [in] INT index,
    [in] DWORD refPtrFlags,
    [out] BSTR *pBstrName,
    [out] BSTR *pBstrDocString,
    [out] DWORD *pdwHelpContext,
    [out] BSTR *pBstrHelpFile);

  [local]
  HRESULT IsName(
    [in, out] LPOLESTR szNameBuf,
    [in] ULONG lHashVal,
    [out] BOOL *pfName);

  [call_as(IsName)]
  HRESULT RemoteIsName(
    [in] LPOLESTR szNameBuf,
    [in] ULONG lHashVal,
    [out] BOOL *pfName,
    [out] BSTR *pBstrLibName);

  [local]
  HRESULT FindName(
    [in, out] LPOLESTR szNameBuf,
    [in] ULONG lHashVal,
    [out, size_is(*pcFound), length_is(*pcFound)] ITypeInfo **ppTInfo,
    [out, size_is(*pcFound), length_is(*pcFound)] MEMBERID *rgMemId,
    [in, out] USHORT *pcFound);

  [call_as(FindName)]
  HRESULT RemoteFindName(
    [in] LPOLESTR szNameBuf,
    [in] ULONG lHashVal,
    [out, size_is(*pcFound), length_is(*pcFound)] ITypeInfo **ppTInfo,
    [out, size_is(*pcFound), length_is(*pcFound)] MEMBERID *rgMemId,
    [in, out] USHORT *pcFound,
    [out] BSTR *pBstrLibName);

  [local]
  void ReleaseTLibAttr(
    [in] TLIBATTR *pTLibAttr);

  [call_as(ReleaseTLibAttr)]
  HRESULT LocalReleaseTLibAttr();
}

[
  object,
  uuid(00020411-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeLib2 : ITypeLib
{
  typedef [unique] ITypeLib2 *LPTYPELIB2;

  HRESULT GetCustData(
    [in] REFGUID guid,
    [out] VARIANT *pVarVal);

  [local]
  HRESULT GetLibStatistics(
    [out] ULONG *pcUniqueNames,
    [out] ULONG *pcchUniqueNames);

  [call_as(GetLibStatistics)]
  HRESULT RemoteGetLibStatistics(
    [out] ULONG *pcUniqueNames,
    [out] ULONG *pcchUniqueNames);

  [local]
  HRESULT GetDocumentation2(
    [in] INT index,
    [in] LCID lcid,
    [out] BSTR *pbstrHelpString,
    [out] DWORD *pdwHelpStringContext,
    [out] BSTR *pbstrHelpStringDll);

  [call_as(GetDocumentation2)]
  HRESULT RemoteGetDocumentation2(
    [in] INT index,
    [in] LCID lcid,
    [in] DWORD refPtrFlags,
    [out] BSTR *pbstrHelpString,
    [out] DWORD *pdwHelpStringContext,
    [out] BSTR *pbstrHelpStringDll);

  HRESULT GetAllCustData(
    [out] CUSTDATA *pCustData);
}

[
  local,
  object,
  uuid(00020410-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ITypeChangeEvents : IUnknown
{
  typedef [unique] ITypeChangeEvents *LPTYPECHANGEEVENTS;

  typedef enum tagCHANGEKIND {
    CHANGEKIND_ADDMEMBER,
    CHANGEKIND_DELETEMEMBER,
    CHANGEKIND_SETNAMES,
    CHANGEKIND_SETDOCUMENTATION,
    CHANGEKIND_GENERAL,
    CHANGEKIND_INVALIDATE,
    CHANGEKIND_CHANGEFAILED,
    CHANGEKIND_MAX
  } CHANGEKIND;

  HRESULT RequestTypeChange(
    [in] CHANGEKIND changeKind,
    [in] ITypeInfo *pTInfoBefore,
    [in] LPOLESTR pStrName,
    [out] INT *pfCancel);
  
  HRESULT AfterTypeChange(
    [in] CHANGEKIND changeKind,
    [in] ITypeInfo *pTInfoAfter,
    [in] LPOLESTR pStrName);
}

[
  object,
  uuid(1CF2B120-547D-101B-8E65-08002B2BD119),
  pointer_default(unique)
]
interface IErrorInfo : IUnknown
{
  typedef [unique] IErrorInfo *LPERRORINFO;

  HRESULT GetGUID(
    [out] GUID *pGUID);

  HRESULT GetSource(
    [out] BSTR *pBstrSource);

  HRESULT GetDescription(
    [out] BSTR *pBstrDescription);

  HRESULT GetHelpFile(
    [out] BSTR *pBstrHelpFile);

  HRESULT GetHelpContext(
    [out] DWORD *pdwHelpContext);
}

[
  object,
  uuid(22F03340-547D-101B-8E65-08002B2BD119),
  pointer_default(unique)
]
interface ICreateErrorInfo : IUnknown
{
  typedef [unique] ICreateErrorInfo *LPCREATEERRORINFO;

  HRESULT SetGUID(
    [in] REFGUID rguid);

  HRESULT SetSource(
    [in] LPOLESTR szSource);

  HRESULT SetDescription(
    [in] LPOLESTR szDescription);

  HRESULT SetHelpFile(
    [in] LPOLESTR szHelpFile);

  HRESULT SetHelpContext(
    [in] DWORD dwHelpContext);
}

[
  object,
  uuid(DF0B3D60-548F-101B-8E65-08002B2BD119),
  pointer_default(unique)
]
interface ISupportErrorInfo : IUnknown
{
  typedef [unique] ISupportErrorInfo *LPSUPPORTERRORINFO;

  HRESULT InterfaceSupportsErrorInfo(
    [in] REFIID riid);
}

[
  object,
  uuid(0000002E-0000-0000-C000-000000000046)
]
interface ITypeFactory : IUnknown
{
  HRESULT CreateFromTypeInfo(
    [in] ITypeInfo *pTypeInfo,
    [in] REFIID riid,
    [out, iid_is(riid)] IUnknown **ppv);
}

[
  local,
  object,
  uuid(0000002D-0000-0000-C000-000000000046)
]
interface ITypeMarshal : IUnknown
{
  HRESULT Size(
    [in] PVOID pvType,
    [in] DWORD dwDestContext,
    [in] PVOID pvDestContext,
    [out] ULONG *pSize);

  HRESULT Marshal(
    [in] PVOID pvType,
    [in] DWORD dwDestContext,
    [in] PVOID pvDestContext,
    [in] ULONG cbBufferLength,
    [out] BYTE *pBuffer,
    [out] ULONG *pcbWritten);

  HRESULT Unmarshal(
    [out] PVOID pvType,
    [in] DWORD dwFlags,
    [in] ULONG cbBufferLength,
    [in] BYTE *pBuffer,
    [out] ULONG *pcbRead);

  HRESULT Free(
    [in] PVOID pvType);
}

[
  local,
  object,
  uuid(0000002F-0000-0000-C000-000000000046)
]
interface IRecordInfo : IUnknown
{
  typedef [unique] IRecordInfo *LPRECORDINFO;

  HRESULT RecordInit(
    [out] PVOID pvNew);

  HRESULT RecordClear(
    [in] PVOID pvExisting);

  HRESULT RecordCopy(
    [in] PVOID pvExisting,
    [out] PVOID pvNew);

  HRESULT GetGuid(
    [out] GUID *pguid);

  HRESULT GetName(
    [out] BSTR *pbstrName);

  HRESULT GetSize(
    [out] ULONG *pcbSize);

  HRESULT GetTypeInfo(
    [out] ITypeInfo **ppTypeInfo);

  HRESULT GetField(
    [in] PVOID pvData,
    [in] LPCOLESTR szFieldName,
    [out] VARIANT *pvarField);

  HRESULT GetFieldNoCopy(
    [in] PVOID pvData,
    [in] LPCOLESTR szFieldName,
    [out] VARIANT *pvarField,
    [out] PVOID *ppvDataCArray);

  HRESULT PutField(
    [in] ULONG wFlags,
    [in, out] PVOID pvData,
    [in] LPCOLESTR szFieldName,
    [in] VARIANT *pvarField);

  HRESULT PutFieldNoCopy(
    [in] ULONG wFlags,
    [in, out] PVOID pvData,
    [in] LPCOLESTR szFieldName,
    [in] VARIANT *pvarField);

  HRESULT GetFieldNames(
    [in, out] ULONG *pcNames,
    [out, size_is(*pcNames), length_is(*pcNames)] BSTR *rgBstrNames);

  BOOL IsMatchingType(
    [in] IRecordInfo *pRecordInfo);

  PVOID RecordCreate();

  HRESULT RecordCreateCopy(
    [in] PVOID pvSource,
    [out] PVOID *ppvDest);

  HRESULT RecordDestroy(
    [in] PVOID pvRecord);
}

[
  local,
  object,
  uuid(00020405-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ICreateTypeInfo : IUnknown
{
  typedef [unique] ICreateTypeInfo *LPCREATETYPEINFO;

  HRESULT SetGuid(
    [in] REFGUID guid);

  HRESULT SetTypeFlags(
    [in] UINT uTypeFlags);

  HRESULT SetDocString(
    [in] LPOLESTR pStrDoc);

  HRESULT SetHelpContext(
    [in] DWORD dwHelpContext);

  HRESULT SetVersion(
    [in] WORD wMajorVerNum,
    [in] WORD wMinorVerNum);

  HRESULT AddRefTypeInfo(
    [in] ITypeInfo *pTInfo,
    [in] HREFTYPE *phRefType);

  HRESULT AddFuncDesc(
    [in] UINT index,
    [in] FUNCDESC *pFuncDesc);

  HRESULT AddImplType(
    [in] UINT index,
    [in] HREFTYPE hRefType);

  HRESULT SetImplTypeFlags(
    [in] UINT index,
    [in] INT implTypeFlags);

  HRESULT SetAlignment(
    [in] WORD cbAlignment);

  HRESULT SetSchema(
    [in] LPOLESTR pStrSchema);

  HRESULT AddVarDesc(
    [in] UINT index,
    [in] VARDESC *pVarDesc);

  HRESULT SetFuncAndParamNames(
    [in] UINT index,
    [in, size_is(cNames)] LPOLESTR *rgszNames,
    [in] UINT cNames);

  HRESULT SetVarName(
    [in] UINT index,
    [in] LPOLESTR szName);

  HRESULT SetTypeDescAlias(
    [in] TYPEDESC *pTDescAlias);

  HRESULT DefineFuncAsDllEntry(
    [in] UINT index,
    [in] LPOLESTR szDllName,
    [in] LPOLESTR szProcName);

  HRESULT SetFuncDocString(
    [in] UINT index,
    [in] LPOLESTR szDocString);

  HRESULT SetVarDocString(
    [in] UINT index,
    [in] LPOLESTR szDocString);

  HRESULT SetFuncHelpContext(
    [in] UINT index,
    [in] DWORD dwHelpContext);

  HRESULT SetVarHelpContext(
    [in] UINT index,
    [in] DWORD dwHelpContext);

  HRESULT SetMops(
    [in] UINT index,
    [in] BSTR bstrMops);

  HRESULT SetTypeIdldesc(
    [in] IDLDESC * pIdlDesc);

  HRESULT LayOut();
}

[
  local,
  object,
  uuid(0002040E-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ICreateTypeInfo2 : ICreateTypeInfo
{
  typedef [unique] ICreateTypeInfo2 *LPCREATETYPEINFO2;

  HRESULT DeleteFuncDesc(
    [in] UINT index);

  HRESULT DeleteFuncDescByMemId(
    [in] MEMBERID memid,
    [in] INVOKEKIND invKind);

  HRESULT DeleteVarDesc(
    [in] UINT index);

  HRESULT DeleteVarDescByMemId(
    [in] MEMBERID memid);

  HRESULT DeleteImplType(
    [in] UINT index);

  HRESULT SetCustData(
    [in] REFGUID guid,
    [in] VARIANT *pVarVal);

  HRESULT SetFuncCustData( 
    [in] UINT index, 
    [in] REFGUID guid, 
    [in] VARIANT *pVarVal);
  
  HRESULT SetParamCustData( 
    [in] UINT indexFunc, 
    [in] UINT indexParam, 
    [in] REFGUID guid, 
    [in] VARIANT *pVarVal);

  HRESULT SetVarCustData( 
    [in] UINT index, 
    [in] REFGUID guid, 
    [in] VARIANT *pVarVal);

  HRESULT SetImplTypeCustData( 
    [in] UINT index, 
    [in] REFGUID guid, 
    [in] VARIANT *pVarVal);

  HRESULT SetHelpStringContext(
    [in] ULONG dwHelpStringContext);

  HRESULT SetFuncHelpStringContext(
    [in] UINT index,
    [in] ULONG dwHelpStringContext);

  HRESULT SetVarHelpStringContext(
    [in] UINT index,
    [in] ULONG dwHelpStringContext);

  HRESULT Invalidate();

  HRESULT SetName(
    [in] LPOLESTR szName);
}

[
  local,
  object,
  uuid(00020406-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ICreateTypeLib : IUnknown
{
  typedef [unique] ICreateTypeLib *LPCREATETYPELIB;

  HRESULT CreateTypeInfo(
    [in] LPOLESTR szName,
    [in] TYPEKIND tkind,
    [out] ICreateTypeInfo **ppCTInfo);

  HRESULT SetName(
    [in] LPOLESTR szName);

  HRESULT SetVersion(
    [in] WORD wMajorVerNum,
    [in] WORD wMinorVerNum);

  HRESULT SetGuid(
    [in] REFGUID guid);

  HRESULT SetDocString(
    [in] LPOLESTR szDoc);

  HRESULT SetHelpFileName(
    [in] LPOLESTR szHelpFileName);

  HRESULT SetHelpContext(
    [in] DWORD dwHelpContext);

  HRESULT SetLcid(
    [in] LCID lcid);

  HRESULT SetLibFlags(
    [in] UINT uLibFlags);

  HRESULT SaveAllChanges();
}

[
  local,
  object,
  uuid(0002040F-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface ICreateTypeLib2 : ICreateTypeLib
{
  typedef [unique] ICreateTypeLib2 *LPCREATETYPELIB2;

  HRESULT DeleteTypeInfo(
    [in] LPOLESTR szName);

  HRESULT SetCustData(
    [in] REFGUID guid,
    [in] VARIANT *pVarVal);

  HRESULT SetHelpStringContext(
    [in] ULONG dwHelpStringContext);

  HRESULT SetHelpStringDll(
    [in] LPOLESTR szFileName);
}


/*****************************************************************************
 * IErrorLog interface
 */
[
  object,
  uuid(3127ca40-446e-11ce-8135-00aa004bb851),
  pointer_default(unique)
]
interface IErrorLog : IUnknown
{
  typedef IErrorLog *LPERRORLOG;

  HRESULT AddError(
    [in] LPCOLESTR pszPropName,
    [in] EXCEPINFO *pExcepInfo);
}


/*****************************************************************************
 * IPropertyBag interface
 */
[
  object,
  uuid(55272a00-42cb-11ce-8135-00aa004bb851),
  pointer_default(unique)
]
interface IPropertyBag : IUnknown
{
  typedef IPropertyBag *LPPROPERTYBAG;

  [local]
  HRESULT Read(
    [in] LPCOLESTR pszPropName,
    [in, out] VARIANT *pVar,
    [in] IErrorLog *pErrorLog);

  [call_as(Read)]
  HRESULT RemoteRead(
    [in] LPCOLESTR pszPropName,
    [out] VARIANT *pVar,
    [in] IErrorLog *pErrorLog,
    [in] DWORD varType,
    [in] IUnknown *pUnkObj);

  HRESULT Write(
    [in] LPCOLESTR pszPropName,
    [in] VARIANT *pVar);
}