This file is indexed.

/usr/include/wine/windows/shobjidl.idl is in wine1.6-dev 1:1.6.2-0ubuntu4.

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
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
/*
 * COM interfaces for shell objects
 *
 * Copyright (C) 1999 Juergen Schmied
 * Copyright (C) 2003 Alexandre Julliard
 *
 * 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
 */

import "objidl.idl";
import "oleidl.idl";
import "oaidl.idl";
import "docobj.idl";
import "shtypes.idl";
import "servprov.idl";
import "comcat.idl";
import "propidl.idl";
/* FIXME: import "prsht.idl";*/
import "msxml.idl";
import "wtypes.idl";
import "propsys.idl";
import "objectarray.idl";
/* FIXME: import "structuredquery.idl"; */

cpp_quote("/* FIXME: #include <sherrors.h> */")


/*****************************************************************************
 * IPersistFolder interface
 */
[
    object,
    uuid(000214ea-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IPersistFolder : IPersist
{
    typedef IPersistFolder *LPPERSISTFOLDER;

    HRESULT Initialize( [in] LPCITEMIDLIST pidl );
}


/*****************************************************************************
 * IPersistFolder2 interface
 */
[
    object,
    uuid(1ac3d9f0-175c-11d1-95be-00609797ea4f),
    pointer_default(unique)
]
interface IPersistFolder2 : IPersistFolder
{
    typedef IPersistFolder2 *LPPERSISTFOLDER2;

    HRESULT GetCurFolder( [out] LPITEMIDLIST *ppidl );
}


/*****************************************************************************
 * IPersistIDList interface
 */
[
    object,
    uuid(1079acfc-29bd-11d3-8e0d-00c04f6837d5),
    pointer_default(unique)
]
interface IPersistIDList : IPersist
{
    HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
    HRESULT GetIDList( [out] LPITEMIDLIST *ppidl );
}


/*****************************************************************************
 * IEnumIDList interface
 */
[
    object,
    uuid(000214f2-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IEnumIDList : IUnknown
{
    typedef IEnumIDList *LPENUMIDLIST;

    HRESULT Next(
        [in] ULONG celt,
        [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt,
        [out] ULONG *pceltFetched);

    HRESULT Skip( [in] ULONG celt );
    HRESULT Reset();
    HRESULT Clone( [out] IEnumIDList **ppenum );
}

/*****************************************************************************
 * IShellPropSheetExt interface
 */
cpp_quote("#if 0")
    typedef LPARAM LPFNSVADDPROPSHEETPAGE;
cpp_quote("#else")
cpp_quote("#include <prsht.h>")
cpp_quote("typedef LPFNADDPROPSHEETPAGE LPFNSVADDPROPSHEETPAGE;")
cpp_quote("#endif")

[
    object,
    uuid(000214E9-0000-0000-C000-000000000046),
    pointer_default(unique),
    local
]
interface IShellPropSheetExt : IUnknown
{
    enum tagSHELLPROPSHEETEXTPAGEID {
        EXPPS_FILETYPES = 0x1
    };

    typedef UINT EXPPS;

    HRESULT AddPages(
        [in] LPFNSVADDPROPSHEETPAGE pfnAddPage,
        [in] LPARAM lParam);
    HRESULT ReplacePage(
        [in] EXPPS uPageID,
        [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith,
        [in] LPARAM lParam);
}
typedef IShellPropSheetExt *LPSHELLPROPSHEETEXT;

/*****************************************************************************
 * IShellFolder interface
 */
[
    object,
    uuid(000214e6-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IShellFolder : IUnknown
{
    typedef IShellFolder * LPSHELLFOLDER;

    typedef enum tagSHGDN
    {
        SHGDN_NORMAL = 0,
        SHGDN_INFOLDER = 1,
        SHGDN_FOREDITING = 0x1000,
        SHGDN_INCLUDE_NONFILESYS = 0x2000,
        SHGDN_FORADDRESSBAR = 0x4000,
        SHGDN_FORPARSING = 0x8000
    } SHGNO;

    typedef DWORD SHGDNF;

    enum tagSHCONTF
    {
        SHCONTF_FOLDERS = 32,
        SHCONTF_NONFOLDERS = 64,
        SHCONTF_INCLUDEHIDDEN = 128,
        SHCONTF_INIT_ON_FIRST_NEXT = 256,
        SHCONTF_NETPRINTERSRCH = 512,
        SHCONTF_SHAREABLE = 1024,
        SHCONTF_STORAGE = 2048
    };

    typedef DWORD SHCONTF;

    cpp_quote("#define SFGAO_CANCOPY           DROPEFFECT_COPY")
    cpp_quote("#define SFGAO_CANMOVE           DROPEFFECT_MOVE")
    cpp_quote("#define SFGAO_CANLINK           DROPEFFECT_LINK")
    cpp_quote("#define SFGAO_STORAGE           0x00000008L")
    cpp_quote("#define SFGAO_CANRENAME         0x00000010L")
    cpp_quote("#define SFGAO_CANDELETE         0x00000020L")
    cpp_quote("#define SFGAO_HASPROPSHEET      0x00000040L")
    cpp_quote("#define SFGAO_DROPTARGET        0x00000100L")
    cpp_quote("#define SFGAO_CAPABILITYMASK    0x00000177L")
    cpp_quote("#define SFGAO_ENCRYPTED         0x00002000L")
    cpp_quote("#define SFGAO_ISSLOW            0x00004000L")
    cpp_quote("#define SFGAO_GHOSTED           0x00008000L")
    cpp_quote("#define SFGAO_LINK              0x00010000L")
    cpp_quote("#define SFGAO_SHARE             0x00020000L")
    cpp_quote("#define SFGAO_READONLY          0x00040000L")
    cpp_quote("#define SFGAO_HIDDEN            0x00080000L")
    cpp_quote("#define SFGAO_DISPLAYATTRMASK   0x000FC000L")
    cpp_quote("#define SFGAO_FILESYSANCESTOR   0x10000000L")
    cpp_quote("#define SFGAO_FOLDER            0x20000000L")
    cpp_quote("#define SFGAO_FILESYSTEM        0x40000000L")
    cpp_quote("#define SFGAO_HASSUBFOLDER      0x80000000L")
    cpp_quote("#define SFGAO_CONTENTSMASK      0x80000000L")
    cpp_quote("#define SFGAO_VALIDATE          0x01000000L")
    cpp_quote("#define SFGAO_REMOVABLE         0x02000000L")
    cpp_quote("#define SFGAO_COMPRESSED        0x04000000L")
    cpp_quote("#define SFGAO_BROWSABLE         0x08000000L")
    cpp_quote("#define SFGAO_NONENUMERATED     0x00100000L")
    cpp_quote("#define SFGAO_NEWCONTENT        0x00200000L")
    cpp_quote("#define SFGAO_STREAM            0x00400000L")
    cpp_quote("#define SFGAO_STORAGEANCESTOR   0x00800000L")

    typedef ULONG SFGAOF;

    HRESULT ParseDisplayName(
        [in] HWND hwndOwner,
        [in] LPBC pbcReserved,
        [in, string] LPOLESTR lpszDisplayName,
        [out] ULONG *pchEaten,
        [out] LPITEMIDLIST *ppidl,
        [in, out, unique] ULONG *pdwAttributes);

    HRESULT EnumObjects(
        [in] HWND hwndOwner,
        [in] SHCONTF grfFlags,
        [out] IEnumIDList **ppenumIDList);

    HRESULT BindToObject(
        [in] LPCITEMIDLIST pidl,
        [in] LPBC pbcReserved,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppvOut);

    HRESULT BindToStorage(
        [in] LPCITEMIDLIST pidl,
        [in] LPBC pbcReserved,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppvObj);

    HRESULT CompareIDs(
        [in] LPARAM lParam,
        [in] LPCITEMIDLIST pidl1,
        [in] LPCITEMIDLIST pidl2);

    HRESULT CreateViewObject(
        [in] HWND hwndOwner,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppvOut);

    HRESULT GetAttributesOf(
        [in] UINT cidl,
        [in, size_is(cidl)] LPCITEMIDLIST *apidl,
        [in, out] SFGAOF *rgfInOut);

    HRESULT GetUIObjectOf(
        [in] HWND hwndOwner,
        [in] UINT cidl,
        [in, size_is(cidl)] LPCITEMIDLIST *apidl,
        [in] REFIID riid,
        [in, out, unique] UINT *prgfInOut,
        [out, iid_is(riid)] void **ppvOut);

    HRESULT GetDisplayNameOf(
        [in] LPCITEMIDLIST pidl,
        [in] SHGDNF uFlags,
        [out] STRRET *lpName);

    HRESULT SetNameOf(
        [in] HWND hwnd,
        [in] LPCITEMIDLIST pidl,
        [in, string] LPCOLESTR lpszName,
        [in] SHGDNF uFlags,
        [out] LPITEMIDLIST *ppidlOut);
}


/*****************************************************************************
 * IEnumExtraSearch interface
 */
[
    object,
    uuid(0e700be1-9db6-11d1-a1ce-00c04fd75d13),
    pointer_default(unique)
]
interface IEnumExtraSearch : IUnknown
{
    typedef IEnumExtraSearch *LPENUMEXTRASEARCH;

    typedef struct
    {
        GUID guidSearch;
        WCHAR wszFriendlyName[80];
        /*
         *WCHAR wszMenuText[80];
         *WCHAR wszHelpText[MAX_PATH];
         */
        WCHAR wszUrl[2084];
        /*
         *WCHAR wszIcon[MAX_PATH+10];
         *WCHAR wszGreyIcon[MAX_PATH+10];
         *WCHAR wszClrIcon[MAX_PATH+10];
         */
    } EXTRASEARCH, *LPEXTRASEARCH;

    HRESULT Next(
        [in] ULONG celt,
        [out, size_is(celt), length_is(*pceltFetched)] EXTRASEARCH *rgelt,
        [out] ULONG *pceltFetched);

    HRESULT Skip( [in] ULONG celt );
    HRESULT Reset();
    HRESULT Clone( [out] IEnumExtraSearch **ppenum );
}


/*****************************************************************************
 * IShellFolder2 interface
 */
[
    object,
    uuid(93f2f68c-1d1b-11d3-a30e-00c04f79abd1),
    pointer_default(unique)
]
interface IShellFolder2 : IShellFolder
{
    typedef struct
    {
        GUID    fmtid;
        DWORD   pid;
    } SHCOLUMNID, *LPSHCOLUMNID;
    typedef const SHCOLUMNID *LPCSHCOLUMNID;

    HRESULT GetDefaultSearchGUID( [out] GUID *lpguid );
    HRESULT EnumSearches( [out] IEnumExtraSearch **ppenum );
    HRESULT GetDefaultColumn( [in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay );
    HRESULT GetDefaultColumnState( [in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags );
    HRESULT GetDetailsEx( [in] LPCITEMIDLIST pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv);
    HRESULT GetDetailsOf( [in] LPCITEMIDLIST pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd);
    HRESULT MapColumnToSCID( [in] UINT iColumn, [in] SHCOLUMNID *pscid );
}

/*****************************************************************************
 * IShellItem interface
 */
[
    object,
    uuid(43826d1e-e718-42ee-bc55-a1e261c37bfe),
    pointer_default(unique)
]
interface IShellItem : IUnknown
{
    typedef [v1_enum] enum {
        SIGDN_NORMALDISPLAY                = 0,
        SIGDN_PARENTRELATIVEPARSING        = 0x80018001,
        SIGDN_DESKTOPABSOLUTEPARSING       = 0x80028000,
        SIGDN_PARENTRELATIVEEDITING        = 0x80031001,
        SIGDN_DESKTOPABSOLUTEEDITING       = 0x8004c000,
        SIGDN_FILESYSPATH                  = 0x80058000,
        SIGDN_URL                          = 0x80068000,
        SIGDN_PARENTRELATIVEFORADDRESSBAR  = 0x8007c001,
        SIGDN_PARENTRELATIVE               = 0x80080001
    } SIGDN; /* & 0xFFFF => SHGDN */

    [v1_enum] enum _SICHINTF
    {
        SICHINT_DISPLAY                       = 0x00000000,
        SICHINT_CANONICAL                     = 0x10000000,
        SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000,
        SICHINT_ALLFIELDS                     = 0x80000000
    };
    typedef DWORD SICHINTF;

    HRESULT BindToHandler(
        [in] IBindCtx *pbc,
        [in] REFGUID rbhid,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppvOut);

    HRESULT GetParent( [out] IShellItem **ppsi );

    HRESULT GetDisplayName(
        [in] SIGDN sigdnName,
        [out] LPWSTR *ppszName);

    HRESULT GetAttributes(
        [in] SFGAOF sfgaoMask,
        [out] SFGAOF *psfgaoAttribs);

    HRESULT Compare(
        [in] IShellItem *psi,
        [in] SICHINTF hint,
        [out] int *piOrder);
}

/*****************************************************************************
 * IShellItem2 interface
 */
[
    object,
    uuid(7E9FB0D3-919F-4307-AB2E-9B1860310C93),
    pointer_default(unique)
]
interface IShellItem2 : IShellItem
{
    HRESULT GetPropertyStore(
        [in] GETPROPERTYSTOREFLAGS flags,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetPropertyStoreWithCreateObject(
        [in] GETPROPERTYSTOREFLAGS flags,
        [in] IUnknown *punkCreateObject,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetPropertyStoreForKeys(
        [in, size_is(cKeys)] const PROPERTYKEY *rgKeys,
        [in] UINT cKeys,
        [in] GETPROPERTYSTOREFLAGS flags,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetPropertyDescriptionList(
        [in] REFPROPERTYKEY keyType,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT Update(
        [in, unique] IBindCtx *pbc);

    HRESULT GetProperty(
        [in] REFPROPERTYKEY key,
        [out] PROPVARIANT *ppropvar);

    HRESULT GetCLSID(
        [in] REFPROPERTYKEY key,
        [out] CLSID *pclsid);

    HRESULT GetFileTime (
        [in] REFPROPERTYKEY key,
        [out] FILETIME *pft);

    HRESULT GetInt32(
        [in] REFPROPERTYKEY key,
        [out] int *pi);

    HRESULT GetString(
        [in] REFPROPERTYKEY key,
        [out, string] LPWSTR *ppsz);

    HRESULT GetUInt32(
        [in] REFPROPERTYKEY key,
        [out] ULONG *pui);

    HRESULT GetUInt64(
        [in] REFPROPERTYKEY key,
        [out] ULONGLONG *pull);

    HRESULT GetBool(
        [in] REFPROPERTYKEY key,
        [out] BOOL *pf);
}

typedef enum tagNWMF {
    NWMF_UNLOADING        = 0x0001,
    NWMF_USERINITED       = 0x0002,
    NWMF_FIRST            = 0x0004,
    NWMF_OVERRIDEKEY      = 0x0008,
    NWMF_SHOWHELP         = 0x0010,
    NWMF_HTMLDIALOG       = 0x0020,
    NWMF_FROMDIALOGCHILD  = 0x0040,
    NWMF_USERREQUESTED    = 0x0080,
    NWMF_USERALLOWED      = 0x0100
} NWMF;

[
    uuid(d2bc4c84-3f72-4a52-a604-7bcbf3982cbb),
    object,
    pointer_default(unique)
]
interface INewWindowManager : IUnknown
{
    HRESULT EvaluateNewWindow(
        [in, string] LPCWSTR pszUrl,
        [in, string] LPCWSTR pszName,
        [in, string] LPCWSTR pszUrlContext,
        [in, string] LPCWSTR pszFeatures,
        [in]         BOOL fReplace,
        [in]         DWORD dwFlags,
        [in]         DWORD dwUserActionTime);
}

cpp_quote("#define SID_SNewWindowManager IID_INewWindowManager")

/*****************************************************************************
 * IEnumShellItems interface
 */
[
 object,
 uuid(70629033-E363-4A28-A567-0DB78006E6D7),
 pointer_default(unique)
]
interface IEnumShellItems : IUnknown
{
    [local] HRESULT Next(
        [in] ULONG celt,
        [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
        [out] ULONG *pceltFetched);

    [call_as(Next)] HRESULT RemoteNext(
        [in] ULONG celt,
        [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
        [out] ULONG *pceltFetched);

    HRESULT Skip(
        [in] ULONG celt);

    HRESULT Reset();

    HRESULT Clone(
        [out] IEnumShellItems **ppenum);
}

/*****************************************************************************
 * IShellItemArray interface
 */
[
 object,
 uuid(B63EA76D-1F85-456F-A19C-48159EFA858B),
 pointer_default(unique)
]
interface IShellItemArray : IUnknown
{
    typedef [v1_enum] enum SIATTRIBFLAGS {
        SIATTRIBFLAGS_AND            = 0x0001,
        SIATTRIBFLAGS_OR             = 0x0002,
        SIATTRIBFLAGS_APPCOMPAT      = 0x0003,
        SIATTRIBFLAGS_MASK           = 0x0003,
        SIATTRIBFLAGS_ALLITEMS       = 0x4000
    } SIATTRIBFLAGS;
    cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SIATTRIBFLAGS)")

    HRESULT BindToHandler(
        [in, unique] IBindCtx *pbc,
        [in] REFGUID bhid,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppvOut);

    HRESULT GetPropertyStore(
        [in] GETPROPERTYSTOREFLAGS flags,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetPropertyDescriptionList(
        [in] REFPROPERTYKEY keyType,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetAttributes(
        [in] SIATTRIBFLAGS AttribFlags,
        [in] SFGAOF sfgaoMask,
        [out] SFGAOF *psfgaoAttribs);

    HRESULT GetCount(
        [out] DWORD *pdwNumItems);

    HRESULT GetItemAt(
        [in] DWORD dwIndex,
        [out] IShellItem **ppsi);

    HRESULT EnumItems(
        [out] IEnumShellItems **ppenumShellItems);

}

typedef [v1_enum] enum DATAOBJ_GET_ITEM_FLAGS
{
    DOGIF_DEFAULT       = 0x0,
    DOGIF_TRAVERSE_LINK = 0x1,
    DOGIF_NO_HDROP      = 0x2,
    DOGIF_NO_URL        = 0x4,
    DOGIF_ONLY_IF_ONE   = 0x8
} DATAOBJ_GET_ITEM_FLAGS;
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DATAOBJ_GET_ITEM_FLAGS)")

cpp_quote("HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);")
cpp_quote("HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);")
cpp_quote("HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);")
cpp_quote("HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv);")
cpp_quote("HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl);")
cpp_quote("HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv);")
cpp_quote("HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder* psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray);")
cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv);")
cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv);")

/*****************************************************************************
 * IShellItemFilter interface
 */
[
 object,
 uuid(2659B475-EEB8-48B7-8F07-B378810F48CF),
 pointer_default(unique)
]
interface IShellItemFilter : IUnknown
{
    HRESULT IncludeItem(
        [in] IShellItem *psi);

    HRESULT GetEnumFlagsForItem(
        [in] IShellItem *psi,
        [out] SHCONTF *pgrfFlags);
}

/*****************************************************************************
 * FOLDERSETTINGS
 */
typedef char *LPVIEWSETTINGS;

typedef enum
{
    FWF_AUTOARRANGE         = 0x00000001,
    FWF_ABBREVIATEDNAMES    = 0x00000002,
    FWF_SNAPTOGRID          = 0x00000004,
    FWF_OWNERDATA           = 0x00000008,
    FWF_BESTFITWINDOW       = 0x00000010,
    FWF_DESKTOP             = 0x00000020,
    FWF_SINGLESEL           = 0x00000040,
    FWF_NOSUBFOLDERS        = 0x00000080,
    FWF_TRANSPARENT         = 0x00000100,
    FWF_NOCLIENTEDGE        = 0x00000200,
    FWF_NOSCROLL            = 0x00000400,
    FWF_ALIGNLEFT           = 0x00000800,
    FWF_NOICONS             = 0x00001000,
    FWF_SHOWSELALWAYS       = 0x00002000,
    FWF_NOVISIBLE           = 0x00004000,
    FWF_SINGLECLICKACTIVATE = 0x00008000,
    FWF_NOWEBVIEW           = 0x00010000,
    FWF_HIDEFILENAMES       = 0x00020000,
    FWF_CHECKSELECT         = 0x00040000,
    FWF_NOENUMREFRESH       = 0x00080000,
    FWF_NOGROUPING          = 0x00100000,
    FWF_FULLROWSELECT       = 0x00200000,
    FWF_NOFILTERS           = 0x00400000,
    FWF_NOCOLUMNHEADER      = 0x00800000,
    FWF_NOHEADERINALLVIEWS  = 0x01000000,
    FWF_EXTENDEDTILES       = 0x02000000,
    FWF_TRICHECKSELECT      = 0x04000000,
    FWF_AUTOCHECKSELECT     = 0x08000000,
    FWF_NOBROWSERVIEWSTATE  = 0x10000000,
    FWF_SUBSETGROUPS        = 0x20000000,
    FWF_USESEARCHFOLDER     = 0x40000000,
    FWF_ALLOWRTLREADING     = 0x80000000
} FOLDERFLAGS;

typedef enum
{
    FVM_AUTO       =-1,
    FVM_ICON       = 1,
    FVM_FIRST      = FVM_ICON,
    FVM_SMALLICON  = 2,
    FVM_LIST       = 3,
    FVM_DETAILS    = 4,
    FVM_THUMBNAIL  = 5,
    FVM_TILE       = 6,
    FVM_THUMBSTRIP = 7,
    FVM_CONTENT    = 8,
    FVM_LAST       = FVM_CONTENT
} FOLDERVIEWMODE;

typedef struct
{
    UINT ViewMode;
    UINT fFlags;
} FOLDERSETTINGS, *PFOLDERSETTINGS, *LPFOLDERSETTINGS;
typedef const FOLDERSETTINGS *LPCFOLDERSETTINGS;

/*****************************************************************************
 * IShellIcon interface
 */
[
    uuid(000214e5-0000-0000-c000-000000000046),
    object,
    pointer_default(unique)
]
interface IShellIcon : IUnknown
{
    HRESULT GetIconOf(
        [in] PCUITEMID_CHILD pidl,
        [in] UINT flags,
        [out] int *pIconIndex);
}

/*****************************************************************************
 * IShellView interface
 */
interface IShellBrowser;  /* forward declaration */
[
    object,
    uuid(000214e3-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IShellView : IOleWindow
{
    typedef IShellView *LPSHELLVIEW;

    cpp_quote("#define SVSI_DESELECT       0x00000000")
    cpp_quote("#define SVSI_SELECT         0x00000001")
    cpp_quote("#define SVSI_EDIT           0x00000003")
    cpp_quote("#define SVSI_DESELECTOTHERS 0x00000004")
    cpp_quote("#define SVSI_ENSUREVISIBLE  0x00000008")
    cpp_quote("#define SVSI_FOCUSED        0x00000010")
    cpp_quote("#define SVSI_TRANSLATEPT    0x00000020")
    cpp_quote("#define SVSI_SELECTIONMARK  0x00000040")
    cpp_quote("#define SVSI_POSITIONITEM   0x00000080")
    cpp_quote("#define SVSI_CHECK          0x00000100")
    cpp_quote("#define SVSI_NOSTATECHANGE  0x80000000")

    typedef UINT SVSIF;

    typedef enum
    {
        SVGIO_BACKGROUND     = 0x00000000,
        SVGIO_SELECTION      = 0x00000001,
        SVGIO_ALLVIEW        = 0x00000002,
        SVGIO_CHECKED        = 0x00000003,
        SVGIO_TYPE_MASK      = 0x0000000f,
        SVGIO_FLAG_VIEWORDER = 0x80000000,
    } SVGIO;

    typedef enum
    {
        SVUIA_DEACTIVATE       = 0,
        SVUIA_ACTIVATE_NOFOCUS = 1,
        SVUIA_ACTIVATE_FOCUS   = 2,
        SVUIA_INPLACEACTIVATE  = 3
    } SVUIA_STATUS;

    HRESULT TranslateAccelerator( [in] MSG *pmsg );
    HRESULT EnableModeless( [in] BOOL fEnable );
    HRESULT UIActivate( [in] UINT uState );
    HRESULT Refresh();
    HRESULT CreateViewWindow(
        [in] IShellView *psvPrevious,
        [in] LPCFOLDERSETTINGS lpfs,
        [in] IShellBrowser *psb,
        [out] RECT *prcView,
        [out] HWND *phWnd);

    HRESULT DestroyViewWindow();
    HRESULT GetCurrentInfo( [out] LPFOLDERSETTINGS lpfs );

    [local] HRESULT AddPropertySheetPages(
        [in] DWORD dwReserved,
        [in] LPFNSVADDPROPSHEETPAGE pfn,
        [in] LPARAM lparam);

    HRESULT SaveViewState();
    HRESULT SelectItem(
        [in] LPCITEMIDLIST pidlItem,
        [in] SVSIF uFlags);
    HRESULT GetItemObject(
        [in] UINT uItem,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);
}

[
    object,
    uuid(88e39e80-3578-11cf-ae69-08002b2e1262),
    pointer_default(unique)
]
interface IShellView2 : IShellView
{
    typedef GUID SHELLVIEWID;
cpp_quote("#include <pshpack8.h>")
    typedef struct _SV2CVW2_PARAMS
    {
        DWORD cbSize;
        IShellView *psvPrev;
        LPCFOLDERSETTINGS pfs;
        IShellBrowser *psbOwner;
        RECT *prcView;
        SHELLVIEWID const *pvid;
        HWND hwndView;
    } SV2CVW2_PARAMS, *LPSV2CVW2_PARAMS;
cpp_quote("#include <poppack.h>")

    HRESULT GetView(
        [in, out] SHELLVIEWID *view_guid,
        [in] ULONG view_type
    );
    HRESULT CreateViewWindow2(
        [in] LPSV2CVW2_PARAMS view_params
    );
    HRESULT HandleRename(
        [in] LPCITEMIDLIST new_pidl
    );
    HRESULT SelectAndPositionItem(
        [in] LPCITEMIDLIST item,
        [in] UINT flags,
        [in] POINT *point
    );
}

/*****************************************************************************
 * IFolderView interface
 */
[
    uuid(cde725b0-ccc9-4519-917e-325d72fab4ce),
    object,
    pointer_default(unique)
]
interface IFolderView : IUnknown
{
    HRESULT GetCurrentViewMode( [out] UINT *mode );
    HRESULT SetCurrentViewMode( [in] UINT mode );
    HRESULT GetFolder( [in] REFIID riid, [out, iid_is(riid)] void **ppv );
    HRESULT Item(
        [in] int index,
        [out] PITEMID_CHILD *ppidl
    );
    HRESULT ItemCount(
        [in] UINT flags,
        [out] int *items
    );
    HRESULT Items(
        [in] UINT flags,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv
    );
    HRESULT GetSelectionMarkedItem( [out] int *item );
    HRESULT GetFocusedItem( [out] int *item );
    HRESULT GetItemPosition(
        [in] PCUITEMID_CHILD pidl,
        [out] POINT* ppt
    );
    HRESULT GetSpacing( [in, out, unique] POINT* pt );
    HRESULT GetDefaultSpacing( [out] POINT* pt );
    HRESULT GetAutoArrange();
    HRESULT SelectItem(
        [in] int item,
        [in] DWORD flags
    );
    HRESULT SelectAndPositionItems(
        [in] UINT cidl,
        [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
        [in, unique, size_is(cidl)] POINT* apt,
        [in] DWORD flags
    );
}

/*****************************************************************************
 * IShellBrowser interface
 */
[
    object,
    uuid(000214e2-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IShellBrowser : IOleWindow
{
    typedef IShellBrowser *LPSHELLBROWSER;

cpp_quote("#define SBSP_DEFBROWSER            0x00000000")
cpp_quote("#define SBSP_SAMEBROWSER           0x00000001")
cpp_quote("#define SBSP_NEWBROWSER            0x00000002")
cpp_quote("#define SBSP_DEFMODE               0x00000000")
cpp_quote("#define SBSP_OPENMODE              0x00000010")
cpp_quote("#define SBSP_EXPLOREMODE           0x00000020")
cpp_quote("#define SBSP_HELPMODE              0x00000040")
cpp_quote("#define SBSP_NOTRANSFERHIST        0x00000080")
cpp_quote("#define SBSP_ABSOLUTE              0x00000000")
cpp_quote("#define SBSP_RELATIVE              0x00001000")
cpp_quote("#define SBSP_PARENT                0x00002000")
cpp_quote("#define SBSP_NAVIGATEBACK          0x00004000")
cpp_quote("#define SBSP_NAVIGATEFORWARD       0x00008000")
cpp_quote("#define SBSP_ALLOW_AUTONAVIGATE    0x00010000")
cpp_quote("#define SBSP_KEEPSAMETEMPLATE      0x00020000")
cpp_quote("#define SBSP_KEEPWORDWHEELTEXT     0x00040000")
cpp_quote("#define SBSP_ACTIVATE_NOFOCUS      0x00080000")
cpp_quote("#define SBSP_CREATENOHISTORY       0x00100000")
cpp_quote("#define SBSP_PLAYNOSOUND           0x00200000")
cpp_quote("#define SBSP_CALLERUNTURUSTED      0x00800000")
cpp_quote("#define SBSP_TRUSTFIRSTDOWNLOAD    0x01000000")
cpp_quote("#define SBSP_UNTRUSTEDFORDOWNLOAD  0x02000000")
cpp_quote("#define SBSP_NOAUTOSELECT          0x04000000")
cpp_quote("#define SBSP_WRITENOHISTORY        0x08000000")
cpp_quote("#define SBSP_TRUSTEDFORACTIVEX     0x10000000")
cpp_quote("#define SBSP_FEEDNAVIGATION        0x20000000")
cpp_quote("#define SBSP_REDIRECT              0x40000000")
cpp_quote("#define SBSP_INITIATEDBYHLINKFRAME 0x80000000")

cpp_quote("#define FCW_STATUS      0x0001")
cpp_quote("#define FCW_TOOLBAR     0x0002")
cpp_quote("#define FCW_TREE        0x0003")
cpp_quote("#define FCW_INTERNETBAR 0x0006")
cpp_quote("#define FCW_PROGRESS    0x0008")

cpp_quote("#define FCT_MERGE       0x0001")
cpp_quote("#define FCT_CONFIGABLE  0x0002")
cpp_quote("#define FCT_ADDTOEND    0x0004")

cpp_quote("#if 0")
    typedef LPARAM LPTBBUTTONSB;
cpp_quote("#else")
cpp_quote("#include <commctrl.h>")
cpp_quote("typedef LPTBBUTTON LPTBBUTTONSB;")
cpp_quote("#endif")

    HRESULT InsertMenusSB(
        [in] HMENU hmenuShared,
        [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths);

    HRESULT SetMenuSB(
        [in] HMENU hmenuShared,
        [in] HOLEMENU holemenuReserved,
        [in] HWND hwndActiveObject);

    HRESULT RemoveMenusSB( [in] HMENU hmenuShared );
    HRESULT SetStatusTextSB( [in, unique] LPCOLESTR pszStatusText );
    HRESULT EnableModelessSB( [in] BOOL fEnable );
    HRESULT TranslateAcceleratorSB( [in] MSG *pmsg, [in] WORD wID );

    HRESULT BrowseObject(
        [in] LPCITEMIDLIST pidl,
        [in] UINT wFlags);

    HRESULT GetViewStateStream(
        [in] DWORD grfMode,
        [out] IStream **ppStrm);

    HRESULT GetControlWindow(
        [in] UINT id,
        [out] HWND *phwnd);

    [local] HRESULT SendControlMsg(
        [in] UINT id,
        [in] UINT uMsg,
        [in] WPARAM wParam,
        [in] LPARAM lParam,
        [in] LRESULT *pret);

    HRESULT QueryActiveShellView( [out] IShellView **ppshv );
    HRESULT OnViewWindowActive( [in] IShellView *pshv );

    [local]
    HRESULT SetToolbarItems(
        [in] LPTBBUTTONSB lpButtons,
        [in] UINT nButtons,
        [in] UINT uFlags);
}


/*****************************************************************************
 * IShellLinkA interface
 */
[
    object,
    uuid(000214ee-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IShellLinkA : IUnknown
{
    typedef enum
    {
        SLR_NO_UI               = 0x0001,
        SLR_ANY_MATCH           = 0x0002,
        SLR_UPDATE              = 0x0004,
        SLR_NOUPDATE            = 0x0008,
        SLR_NOSEARCH            = 0x0010,
        SLR_NOTRACK             = 0x0020,
        SLR_NOLINKINFO          = 0x0040,
        SLR_INVOKE_MSI          = 0x0080,
        SLR_NO_UI_WITH_MSG_PUMP = 0x0101,
    } SLR_FLAGS;

    typedef enum
    {
        SLGP_SHORTPATH   = 0x0001,
        SLGP_UNCPRIORITY = 0x0002,
        SLGP_RAWPATH     = 0x0004,
    } SLGP_FLAGS;

    HRESULT GetPath(
        [out, size_is(cch)] LPSTR pszFile,
        [in] int cch,
        [in, out, unique] WIN32_FIND_DATAA *pfd,
        [in] DWORD fFlags);

    HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );

    HRESULT SetIDList( [in] LPCITEMIDLIST pidl );

    HRESULT GetDescription(
        [out, size_is(cch)] LPSTR pszName,
        [in] int cch);

    HRESULT SetDescription( [in] LPCSTR pszName );

    HRESULT GetWorkingDirectory(
        [out, size_is(cch)] LPSTR pszDir,
        [in] int cch);

    HRESULT SetWorkingDirectory( [in] LPCSTR pszDir );

    HRESULT GetArguments(
        [out, size_is(cch)] LPSTR pszArgs,
        [in] int cch);

    HRESULT SetArguments( [in] LPCSTR pszArgs );

    HRESULT GetHotkey( [out] WORD *pwHotkey );

    HRESULT SetHotkey( [in] WORD wHotkey );

    HRESULT GetShowCmd( [out] int *piShowCmd );

    HRESULT SetShowCmd( [in] int iShowCmd );

    HRESULT GetIconLocation(
        [out, size_is(cch)] LPSTR pszIconPath,
        [in] int cch,
        [out] int *piIcon);

    HRESULT SetIconLocation(
        [in] LPCSTR pszIconPath,
        [in] int iIcon);

    HRESULT SetRelativePath(
        [in] LPCSTR pszPathRel,
        [in] DWORD dwReserved);

    HRESULT Resolve(
        [in] HWND hwnd,
        [in] DWORD fFlags);

    HRESULT SetPath( [in] LPCSTR pszFile );
}


/*****************************************************************************
 * IShellLinkW interface
 */
[
    object,
    uuid(000214f9-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface IShellLinkW : IUnknown
{
    HRESULT GetPath(
        [out, size_is(cch)] LPWSTR pszFile,
        [in] int cch,
        [in, out] WIN32_FIND_DATAW *pfd,
        [in] DWORD fFlags);

    HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );

    HRESULT SetIDList( [in] LPCITEMIDLIST pidl );

    HRESULT GetDescription(
        [out, size_is(cch)] LPWSTR pszName,
        [in] int cch);

    HRESULT SetDescription( [in] LPCWSTR pszName );

    HRESULT GetWorkingDirectory(
        [out, size_is(cch)] LPWSTR pszDir,
        [in] int cch);

    HRESULT SetWorkingDirectory( [in] LPCWSTR pszDir );

    HRESULT GetArguments(
        [out, size_is(cch)] LPWSTR pszArgs,
        [in] int cch);

    HRESULT SetArguments( [in] LPCWSTR pszArgs );

    HRESULT GetHotkey( [out] WORD *pwHotkey );

    HRESULT SetHotkey( [in] WORD wHotkey );

    HRESULT GetShowCmd( [out] int *piShowCmd );

    HRESULT SetShowCmd( [in] int iShowCmd );

    HRESULT GetIconLocation(
        [out, size_is(cch)] LPWSTR pszIconPath,
        [in] int cch,
        [out] int *piIcon);

    HRESULT SetIconLocation(
        [in] LPCWSTR pszIconPath,
        [in] int iIcon);

    HRESULT SetRelativePath(
        [in] LPCWSTR pszPathRel,
        [in] DWORD dwReserved);

    HRESULT Resolve(
        [in] HWND hwnd,
        [in] DWORD fFlags);

    HRESULT SetPath( [in] LPCWSTR pszFile );
}

cpp_quote("#define IShellLink WINELIB_NAME_AW(IShellLink)")


/*****************************************************************************
 * IShellExtInit interface
 */
[
    object,
    uuid(000214e8-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IShellExtInit : IUnknown
{
    typedef IShellExtInit *LPSHELLEXTINIT;

    HRESULT Initialize(
        [in] LPCITEMIDLIST pidlFolder,
        [in] IDataObject *pdtobj,
        [in] HKEY hkeyProgID);
}


/*******************************************************************************/
/* Note: the following interfaces are not in shobjidl.idl under Windows, they  */
/* are declared directly in shlobj.h. It hopefully won't break anything to put */
/* them here anyway.                                                           */
/*******************************************************************************/

#ifndef MAX_PATH
#define MAX_PATH 260
#endif


/*****************************************************************************
 * IPersistFolder3 interface
 */
[
    object,
    uuid(cef04fdf-fe72-11d2-87a5-00c04f6837cf),
    pointer_default(unique)
]
interface IPersistFolder3 : IPersistFolder2
{
    typedef struct
    {
        LPITEMIDLIST	pidlTargetFolder;
	WCHAR		szTargetParsingName[MAX_PATH];
	WCHAR		szNetworkProvider[MAX_PATH];
	DWORD		dwAttributes;
	int		csidl;
    } PERSIST_FOLDER_TARGET_INFO;

    HRESULT InitializeEx(
        [in] IBindCtx *pbc,
        [in] LPCITEMIDLIST pidlRoot,
        [in] const PERSIST_FOLDER_TARGET_INFO *ppfti);

    HRESULT GetFolderTargetInfo( [out] PERSIST_FOLDER_TARGET_INFO *ppfti );
}


/*****************************************************************************
 * IExtractIconA interface
 */
[
    object,
    uuid(000214eb-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IExtractIconA : IUnknown
{
cpp_quote("#define GIL_OPENICON     0x0001")
cpp_quote("#define GIL_FORSHELL     0x0002")
cpp_quote("#define GIL_ASYNC        0x0020")
cpp_quote("#define GIL_DEFAULTICON  0x0040")
cpp_quote("#define GIL_FORSHORTCUT  0x0080")

cpp_quote("#define GIL_SIMULATEDOC  0x0001")
cpp_quote("#define GIL_PERINSTANCE  0x0002")
cpp_quote("#define GIL_PERCLASS     0x0004")
cpp_quote("#define GIL_NOTFILENAME  0x0008")
cpp_quote("#define GIL_DONTCACHE    0x0010")

    typedef IExtractIconA *LPEXTRACTICONA;

    HRESULT GetIconLocation(
        [in] UINT uFlags,
        [out, size_is(cchMax)] LPSTR szIconFile,
        [in] UINT cchMax,
        [out] INT *piIndex,
        [out] UINT *pwFlags);

    HRESULT Extract(
        [in] LPCSTR pszFile,
        [in] UINT nIconIndex,
        [out] HICON *phiconLarge,
        [out] HICON *phiconSmall,
        [in] UINT nIconSize );
}


/*****************************************************************************
 * IExtractIconW interface
 */
[
    object,
    uuid(000214fa-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IExtractIconW : IUnknown
{
    typedef IExtractIconW *LPEXTRACTICONW;

    HRESULT GetIconLocation(
        [in] UINT uFlags,
        [out, size_is(cchMax)] LPWSTR szIconFile,
        [in] UINT cchMax,
        [out] INT *piIndex,
        [out] UINT *pwFlags);

    HRESULT Extract(
        [in] LPCWSTR pszFile,
        [in] UINT nIconIndex,
        [out] HICON *phiconLarge,
        [out] HICON *phiconSmall,
        [in] UINT nIconSize );
}

cpp_quote("#define LPEXTRACTICON WINELIB_NAME_AW(LPEXTRACTICON)")
cpp_quote("#define IExtractIcon WINELIB_NAME_AW(IExtractIcon)")


/*****************************************************************************
 * ICommDlgBrowser interface
 */
[
    object,
    uuid(000214f1-0000-0000-c000-000000000046),
    pointer_default(unique)
]
interface ICommDlgBrowser : IUnknown
{
cpp_quote("#define CDBOSC_SETFOCUS     0x00000000")
cpp_quote("#define CDBOSC_KILLFOCUS    0x00000001")
cpp_quote("#define CDBOSC_SELCHANGE    0x00000002")
cpp_quote("#define CDBOSC_RENAME       0x00000003")
cpp_quote("#define CDBOSC_STATECHANGE  0x00000004")

    typedef ICommDlgBrowser *LPCOMMDLGBROWSER;

    HRESULT OnDefaultCommand( [in] IShellView *shv );
    HRESULT OnStateChange( [in] IShellView *shv, [in] ULONG uChange );
    HRESULT IncludeObject( [in] IShellView *shv, [in] LPCITEMIDLIST pidl );
}


/*****************************************************************************
 * ICommDlgBrowser2 interface
 */
[
 object,
 uuid(10339516-2894-11D2-9039-00C04F8EEB3E),
 pointer_default(unique)
]
interface ICommDlgBrowser2 : ICommDlgBrowser
{

    HRESULT Notify(
        [in] IShellView *ppshv,
        [in] DWORD dwNotifyType);

    HRESULT GetDefaultMenuText(
        [in] IShellView *ppshv,
        [out, string, size_is(cchMax)] LPWSTR pszText,
        [in] int cchMax);

    HRESULT GetViewFlags(
        [out] DWORD *pdwFlags);
}


/*****************************************************************************
 * ICommDlgBrowser3 interface
 */
[
 object,
 uuid(C8AD25A1-3294-41EE-8165-71174BD01C57),
 pointer_default(unique)
]
interface ICommDlgBrowser3 : ICommDlgBrowser2
{

    HRESULT OnColumnClicked(
        [in] IShellView *ppshv,
        [in] int iColumn);

    HRESULT GetCurrentFilter(
        [out, string, size_is(cchFileSpec)] LPWSTR pszFileSpec,
        [in] int cchFileSpec);

    HRESULT OnPreviewCreated(
        [in] IShellView *ppshv);
}

/*****************************************************************************
 * IDockingWindow interface
 */
[
    object,
    uuid(012dd920-7b26-11d0-8ca9-00a0c92dbfe8)
]
interface IDockingWindow : IOleWindow
{
    HRESULT ShowDW(
        [in] BOOL fShow);

    HRESULT CloseDW(
        [in] DWORD dwReserved);

    HRESULT ResizeBorderDW(
        [in] LPCRECT prcBorder,
        [in] IUnknown *punkToolbarSite,
        [in] BOOL fReserved);
};


/*****************************************************************************
 * IDockingWindowFrame interface
 */
[
    object,
    uuid(47d2657a-7b27-11d0-8ca9-00a0c92dbfe8),
    pointer_default(unique),
    local
]
interface IDockingWindowFrame : IOleWindow
{
cpp_quote("#define DWFRF_NORMAL           0x0000")
cpp_quote("#define DWFRF_DELETECONFIGDATA 0x0001")
cpp_quote("#define DWFAF_HIDDEN           0x0001")

    HRESULT AddToolbar(
        [in] IUnknown *punkSrc,
        [in] LPCWSTR pwszItem,
        [in] DWORD dwAddFlags);

    HRESULT RemoveToolbar(
        [in] IUnknown *punkSrc,
        [in] DWORD dwRemoveFlags);

    HRESULT FindToolbar(
        [in] LPCWSTR pwszItem,
        [in] REFIID riid,
        [out] LPVOID *ppvObj);
}


/*****************************************************************************
 * IDragSourceHelper interface
 */
[
    object,
    uuid(de5bf786-477a-11d2-839d-00c04fd918d0),
    pointer_default(unique),
    local
]
interface IDragSourceHelper : IUnknown
{
    typedef struct
    {
        SIZE     sizeDragImage;
        POINT    ptOffset;
        HBITMAP  hbmpDragImage;
        COLORREF crColorKey;
    } SHDRAGIMAGE, *LPSHDRAGIMAGE;

  HRESULT InitializeFromBitmap(
      [in] LPSHDRAGIMAGE pshdi,
      [in] IDataObject *pDataObject);

  HRESULT InitializeFromWindow(
      [in] HWND hwnd,
      [in] POINT *ppt,
      [in] IDataObject *pDataObject);
}


/*****************************************************************************
 * IDropTargetHelper interface
 */
[
    object,
    uuid(4657278b-411b-11d2-839a-00c04fd918d0),
    pointer_default(unique),
    local
]
interface IDropTargetHelper : IUnknown
{
    HRESULT DragEnter(
        [in] HWND hwndTarget,
        [in] IDataObject *pDataObject,
        [in] POINT *ppt,
        [in] DWORD dwEffect);

    HRESULT DragLeave();

    HRESULT DragOver(
        [in] POINT *ppt,
        [in] DWORD dwEffect);

    HRESULT Drop(
        [in] IDataObject *pDataObject,
        [in] POINT *ppt,
        [in] DWORD dwEffect);

    HRESULT Show( [in] BOOL fShow );
}


/*****************************************************************************
 * IContextMenu interface
 */
[
    object,
    uuid(000214e4-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IContextMenu : IUnknown
{
cpp_quote("#define CMF_NORMAL        0x00000000")
cpp_quote("#define CMF_DEFAULTONLY   0x00000001")
cpp_quote("#define CMF_VERBSONLY     0x00000002")
cpp_quote("#define CMF_EXPLORE       0x00000004")
cpp_quote("#define CMF_NOVERBS       0x00000008")
cpp_quote("#define CMF_CANRENAME     0x00000010")
cpp_quote("#define CMF_NODEFAULT     0x00000020")
cpp_quote("#define CMF_INCLUDESTATIC 0x00000040")
cpp_quote("#define CMF_EXTENDEDVERBS 0x00000100")
cpp_quote("#define CMF_RESERVED      0xffff0000")

cpp_quote("#define GCS_VERBA         0x00000000")
cpp_quote("#define GCS_HELPTEXTA     0x00000001")
cpp_quote("#define GCS_VALIDATEA     0x00000002")
cpp_quote("#define GCS_VERBW         0x00000004")
cpp_quote("#define GCS_HELPTEXTW     0x00000005")
cpp_quote("#define GCS_VALIDATEW     0x00000006")
cpp_quote("#define GCS_UNICODE       0x00000004")
cpp_quote("#define GCS_VERB          WINELIB_NAME_AW(GCS_VERB)")
cpp_quote("#define GCS_HELPTEXT      WINELIB_NAME_AW(GCS_HELPTEXT)")
cpp_quote("#define GCS_VALIDATE      WINELIB_NAME_AW(GCS_VALIDATE)")

cpp_quote("#define CMDSTR_NEWFOLDERA   \"NewFolder\"")
cpp_quote("#define CMDSTR_VIEWLISTA    \"ViewList\"")
cpp_quote("#define CMDSTR_VIEWDETAILSA \"ViewDetails\"")
cpp_quote("#if defined(__GNUC__)")
cpp_quote("# define CMDSTR_NEWFOLDERW (const WCHAR []){ 'N','e','w','F','o','l','d','e','r',0 }")
cpp_quote("# define CMDSTR_VIEWLISTW (const WCHAR []){ 'V','i','e','w','L','i','s','t',0 }")
cpp_quote("# define CMDSTR_VIEWDETAILSW (const WCHAR []){ 'V','i','e','w','D','e','t','a','i','l','s',0 }")
cpp_quote("#elif defined(_MSC_VER)")
cpp_quote("# define CMDSTR_NEWFOLDERW   L\"NewFolder\"")
cpp_quote("# define CMDSTR_VIEWLISTW    L\"ViewList\"")
cpp_quote("# define CMDSTR_VIEWDETAILSW L\"ViewDetails\"")
cpp_quote("#else")
cpp_quote("static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};")
cpp_quote("static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};")
cpp_quote("static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};")
cpp_quote("#endif")
cpp_quote("#define CMDSTR_NEWFOLDER    WINELIB_NAME_AW(CMDSTR_NEWFOLDER)")
cpp_quote("#define CMDSTR_VIEWLIST     WINELIB_NAME_AW(CMDSTR_VIEWLIST)")
cpp_quote("#define CMDSTR_VIEWDETAILS  WINELIB_NAME_AW(CMDSTR_VIEWDETAILS)")

cpp_quote("#define CMIC_MASK_HOTKEY         SEE_MASK_HOTKEY")
cpp_quote("#define CMIC_MASK_ICON           SEE_MASK_ICON")
cpp_quote("#define CMIC_MASK_FLAG_NO_UI     SEE_MASK_FLAG_NO_UI")
cpp_quote("#define CMIC_MASK_UNICODE        SEE_MASK_UNICODE")
cpp_quote("#define CMIC_MASK_NO_CONSOLE     SEE_MASK_NO_CONSOLE")
cpp_quote("#define CMIC_MASK_HASLINKNAME    SEE_MASK_HASLINKNAME")
cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM   SEE_MASK_FLAG_SEPVDM")
cpp_quote("#define CMIC_MASK_HASTITLE       SEE_MASK_HASTITLE")
cpp_quote("#define CMIC_MASK_ASYNCOK        SEE_MASK_ASYNCOK")
cpp_quote("#define CMIC_MASK_NOASYNC        SEE_MASK_NOASYNC")
cpp_quote("#define CMIC_MASK_SHIFT_DOWN     0x10000000")
cpp_quote("#define CMIC_MASK_PTINVOKE       0x20000000")
cpp_quote("#define CMIC_MASK_CONTROL_DOWN   0x40000000")
cpp_quote("#define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE")
cpp_quote("#define CMIC_MASK_NOZONECHECKS   SEE_MASK_NOZONECHECKS")

    typedef IContextMenu *LPCONTEXTMENU;

    typedef struct tagCMINVOKECOMMANDINFO
    {
        DWORD cbSize;
        DWORD fMask;
        HWND hwnd;
        LPCSTR lpVerb;
        LPCSTR lpParameters;
        LPCSTR lpDirectory;
        INT nShow;
        DWORD dwHotKey;
        HANDLE hIcon;
    } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;

    typedef struct tagCMInvokeCommandInfoEx
    {
        DWORD cbSize;
        DWORD fMask;
        HWND hwnd;
        LPCSTR lpVerb;
        LPCSTR lpParameters;
        LPCSTR lpDirectory;
        INT nShow;
        DWORD dwHotKey;
        HANDLE hIcon;
        LPCSTR lpTitle;
        LPCWSTR lpVerbW;
        LPCWSTR lpParametersW;
        LPCWSTR lpDirectoryW;
        LPCWSTR lpTitleW;
        POINT ptInvoke;
    } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;

    HRESULT QueryContextMenu(
        [in] HMENU hmenu,
        [in] UINT indexMenu,
        [in] UINT idCmdFirst,
        [in] UINT idCmdLast,
        [in] UINT uFlags);

    HRESULT InvokeCommand( [in] LPCMINVOKECOMMANDINFO lpici );

    HRESULT GetCommandString(
        [in] UINT_PTR idCmd,
        [in] UINT uType,
        [out] UINT *pwReserved,
        [out, size_is(cchMax)] LPSTR pszName,
        [in] UINT cchMax);
}


/*****************************************************************************
 * IContextMenu2 interface
 */
[
    object,
    uuid(000214f4-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IContextMenu2 : IContextMenu
{
    typedef IContextMenu2 *LPCONTEXTMENU2;

    HRESULT HandleMenuMsg(
        [in] UINT uMsg,
        [in] WPARAM wParam,
        [in] LPARAM lParam);
}


/*****************************************************************************
 * IContextMenu3 interface
 */
[
    object,
    uuid(bcfce0a0-ec17-11d0-8d10-00a0c90f2719),
    pointer_default(unique),
    local
]
interface IContextMenu3 : IContextMenu2
{
    typedef IContextMenu3 *LPCONTEXTMENU3;

    HRESULT HandleMenuMsg2(
        [in] UINT uMsg,
        [in] WPARAM wParam,
        [in] LPARAM lParam,
        [out] LRESULT *plResult);
}


[
    object,
    uuid(3409e930-5a39-11d1-83fa-00a0c90dc849),
    pointer_default(unique),
    local
]
interface IContextMenuCB : IUnknown
{
    HRESULT CallBack(
        [in] IShellFolder *psf,
        [in] HWND hwndOwner,
        [in] IDataObject *pdtobj,
        [in] UINT uMsg,
        [in] WPARAM wParam,
        [in] LPARAM lParam);
}

/*****************************************************************************
 * IShellExecuteHookA interface
 */
[
    object,
    uuid(000214f5-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IShellExecuteHookA : IUnknown
{
    cpp_quote("struct _SHELLEXECUTEINFOA;")
    HRESULT Execute(
        [in, out] struct _SHELLEXECUTEINFOA* pei);
}


/*****************************************************************************
 * IShellExecuteHookW interface
 */
[
    object,
    uuid(000214fb-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface IShellExecuteHookW : IUnknown
{
    cpp_quote("struct _SHELLEXECUTEINFOW;")
    HRESULT Execute(
		[in, out] struct _SHELLEXECUTEINFOW* pei);
}

/*****************************************************************************
 * IShellLinkDataList interface
 */
[
    object,
    uuid(45e2b4ae-b1c3-11d0-b92f-00a0c90312e1),
    pointer_default(unique)
]
interface IShellLinkDataList : IUnknown
{
    [local] HRESULT AddDataBlock(
                [in] void *pDataBlock);
    [local] HRESULT CopyDataBlock(
                [in] DWORD dwSig,
                [out] void **ppDataBlock);
    HRESULT RemoveDataBlock(
                [in] DWORD dwSig);
    HRESULT GetFlags(
                [out] DWORD *pdwFlags);
    HRESULT SetFlags(
                [in] DWORD dwFlags);
}


/*****************************************************************************
 * IResolveShellLink interface
 */
[
    object,
    uuid(5cd52983-9449-11d2-963a-00c04f79adf0),
    pointer_default(unique)
]
interface IResolveShellLink : IUnknown
{
    HRESULT ResolveShellLink(
                [in] IUnknown *punk,
                [in] HWND hwnd,
                [in] DWORD fFlags);
}


/*****************************************************************************
 * IURLSearchHook interface
 */
[
    object,
    uuid(ac60f6a0-0fd9-11d0-99cb-00c04fd64497),
    pointer_default(unique),
    local
]
interface IURLSearchHook : IUnknown
{
    HRESULT Translate(
                [in, out] LPWSTR lpwszSearchURL,
                [in] DWORD cchBufferSize);
}


/*****************************************************************************
 * ISearchContext interface
 */
[
    object,
    uuid(09f656a2-41af-480c-88f7-16cc0d164615),
    pointer_default(unique),
    local
]
interface ISearchContext : IUnknown
{
    HRESULT GetSearchUrl(
                [in] BSTR *pbstrSearchUrl);
    HRESULT GetSearchText(
                [in] BSTR *pbstrSearchText);
    HRESULT GetSearchStyle(
                [in] BSTR *pdwSearchStyle);
}


/*****************************************************************************
 * IURLSearchHook2 interface
 */
[
    object,
    uuid(5ee44da4-6d32-46e3-86bc-07540dedd0e0),
    pointer_default(unique),
    local
]
interface IURLSearchHook2 : IURLSearchHook
{
    HRESULT TranslateWithSearchContext(
                [in, out] LPWSTR lpwszSearchURL,
                [in] DWORD cchBufferSize,
                [in] ISearchContext *pSearchContext);
}


cpp_quote("#define INewShortcutHook WINELIB_NAME_AW(INewShortcutHook)")

/*****************************************************************************
 * INewShortcutHookA interface
 */
[
    object,
    uuid(000214e1-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface INewShortcutHookA : IUnknown
{
    HRESULT SetReferent(
                [in] LPCSTR pcszReferent,
                [in] HWND hwnd);
    HRESULT GetReferent(
                [out] LPSTR pcszReferent,
                [in] int cchReferent);
    HRESULT SetFolder(
                [in] LPCSTR pcszReferent);
    HRESULT GetFolder(
                [out] LPSTR pcszReferent,
                [in] int cchFolder);
    HRESULT GetName(
                [out] LPSTR pszName,
                [in] int cchName);
    HRESULT GetExtension(
                [out] LPSTR pszExtension,
                [in] int cchExtension);
} 


/*****************************************************************************
 * INewShortcutHookW interface
 */
[
    object,
    uuid(000214f7-0000-0000-c000-000000000046),
    pointer_default(unique),
    local
]
interface INewShortcutHookW : IUnknown
{
    HRESULT SetReferent(
                [in] LPCWSTR pcszReferent,
                [in] HWND hwnd);
    HRESULT GetReferent(
                [out] LPWSTR pcszReferent,
                [in] int cchReferent);
    HRESULT SetFolder(
                [in] LPCWSTR pcszReferent);
    HRESULT GetFolder(
                [out] LPWSTR pcszReferent,
                [in] int cchFolder);
    HRESULT GetName(
                [out] LPWSTR pszName,
                [in] int cchName);
    HRESULT GetExtension(
                [out] LPWSTR pszExtension,
                [in] int cchExtension);
} 

/*****************************************************************************
 * IRunnableTask interface
 */
[
    object,
    uuid(85788d00-6807-11d0-b810-00c04fd706ec),
    pointer_default(unique),
    local
]
interface IRunnableTask : IUnknown
{
    HRESULT Run();
    HRESULT Kill([in] BOOL fWait);
    HRESULT Suspend();
    HRESULT Resume();
    ULONG IsRunning();
}

/*****************************************************************************
 * IShellChangeNotify interface
 */
[
    object,
    uuid(d82be2b1-5764-11d0-a96e-00c04fd705a2),
    pointer_default(unique),
    local
]
interface IShellChangeNotify : IUnknown
{
    HRESULT OnChange(
                [in] LONG lEvent,
                [in] LPCITEMIDLIST pidl1,
                [in] LPCITEMIDLIST pidl2);
}

/*****************************************************************************
 * IFileSystemBindData interface
 */
[
    object,
    uuid(01e18d10-4d8b-11d2-855d-006008059367),
    pointer_default(unique),
    local
]
interface IFileSystemBindData : IUnknown
{
    HRESULT SetFindData(
                [in] const WIN32_FIND_DATAW *pfd);
    HRESULT GetFindData(
                [out] WIN32_FIND_DATAW *pfd);
}

/*****************************************************************************
 *    ITaskbarList interface
 */
[
    object,
    uuid(56FDF342-FD6D-11d0-958A-006097C9A090),
    pointer_default(unique)
]
interface ITaskbarList : IUnknown
{
    HRESULT HrInit();

    HRESULT AddTab(
        [in] HWND hwnd);

    HRESULT DeleteTab(
        [in] HWND hwnd);

    HRESULT ActivateTab(
        [in] HWND hwnd);

    HRESULT SetActiveAlt(
        [in] HWND hwnd);
}

/*****************************************************************************
 *    ITaskbarList2 interface
 */
[
    object,
    uuid(602D4995-B13A-429B-A66E-1935E44F4317),
    pointer_default(unique)
]
interface ITaskbarList2 : ITaskbarList
{
    HRESULT MarkFullscreenWindow(
        [in] HWND hwnd,
        [in] BOOL fullscreen);
}

cpp_quote("#ifdef MIDL_PASS")
typedef IUnknown* HIMAGELIST;
cpp_quote("#endif")

typedef [v1_enum] enum THUMBBUTTONFLAGS {
    THBF_ENABLED         = 0x0000,
    THBF_DISABLED        = 0x0001,
    THBF_DISMISSONCLICK  = 0x0002,
    THBF_NOBACKGROUND    = 0x0004,
    THBF_HIDDEN          = 0x0008,
    THBF_NONINTERACTIVE  = 0x0010
} THUMBBUTTONFLAGS;

cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONFLAGS)")

typedef [v1_enum] enum THUMBBUTTONMASK {
    THB_BITMAP   = 0x0001,
    THB_ICON     = 0x0002,
    THB_TOOLTIP  = 0x0004,
    THB_FLAGS    = 0x0008
} THUMBBUTTONMASK;

cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONMASK)")

cpp_quote("#include <pshpack8.h>")
typedef struct THUMBBUTTON {
    THUMBBUTTONMASK dwMask;
    UINT iId;
    UINT iBitmap;
    HICON hIcon;
    WCHAR szTip[260];
    THUMBBUTTONFLAGS dwFlags;
} THUMBBUTTON, *LPTHUMBBUTTON;
cpp_quote("#include <poppack.h>")

[
    uuid(ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf),
    object
]
interface ITaskbarList3 : ITaskbarList2
{
    typedef [v1_enum] enum TBPFLAG {
        TBPF_NOPROGRESS     = 0x0000,
        TBPF_INDETERMINATE  = 0x0001,
        TBPF_NORMAL         = 0x0002,
        TBPF_ERROR          = 0x0004,
        TBPF_PAUSED         = 0x0008
    } TBPFLAG;

    cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(TBPFLAG)")

    HRESULT SetProgressValue(
            [in] HWND hwnd,
            [in] ULONGLONG ullCompleted,
            [in] ULONGLONG ullTotal);

    HRESULT SetProgressState(
            [in] HWND hwnd,
            [in] TBPFLAG tbpFlags);

    HRESULT RegisterTab(
            [in] HWND hwndTab,
            [in] HWND hwndMDI);

    HRESULT UnregisterTab([in] HWND hwndTab);

    HRESULT SetTabOrder(
            [in] HWND hwndTab,
            [in] HWND hwndInsertBefore);

    HRESULT SetTabActive(
            [in] HWND hwndTab,
            [in] HWND hwndMDI,
            [in] DWORD dwReserved);

    HRESULT ThumbBarAddButtons(
            [in] HWND hwnd,
            [in] UINT cButtons,
            [in, size_is(cButtons)] LPTHUMBBUTTON pButton);

    HRESULT ThumbBarUpdateButtons(
            [in] HWND hwnd,
            [in] UINT cButtons,
            [in, size_is(cButtons)] LPTHUMBBUTTON pButton);

    HRESULT ThumbBarSetImageList(
            [in] HWND hwnd,
            [in] HIMAGELIST himl);

    HRESULT SetOverlayIcon(
            [in] HWND hwnd,
            [in] HICON hIcon,
            [in, unique, string] LPCWSTR pszDescription);

    HRESULT SetThumbnailTooltip(
            [in] HWND hwnd,
            [in, unique, string] LPCWSTR pszTip);

    HRESULT SetThumbnailClip(
            [in] HWND hwnd,
            [in] RECT *prcClip);
}

[
    uuid(c43dc798-95d1-4bea-9030-bb99e2983a1a),
    object
]
interface ITaskbarList4 : ITaskbarList3
{
    typedef [v1_enum] enum STPFLAG {
        STPF_NONE                       = 0x0000,
        STPF_USEAPPTHUMBNAILALWAYS      = 0x0001,
        STPF_USEAPPTHUMBNAILWHENACTIVE  = 0x0002,
        STPF_USEAPPPEEKALWAYS           = 0x0004,
        STPF_USEAPPPEEKWHENACTIVE       = 0x0008
    } STPFLAG;

    cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(STPFLAG)")

    HRESULT SetTabProperties(
            [in] HWND hwndTab,
            [in] STPFLAG stpFlags);
}

/*****************************************************************************
 *    IAutoCompleteDropDown interface
 */
[
    object,
    uuid(3CD141F4-3C6A-11d2-BCAA-00C04FD929DB),
    pointer_default(unique)
]
interface IAutoCompleteDropDown : IUnknown
{
cpp_quote("#define ACDD_VISIBLE   0x0001")

    HRESULT GetDropDownStatus(
        [out] DWORD *pdwFlags,
        [out, string] LPWSTR *ppwszString);

    HRESULT ResetEnumerator();
}

[
    object,
    uuid(cb728b20-f786-11ce-92ad-00aa00a74cd0),
    pointer_default(unique)
]
interface IProfferService : IUnknown
{
    HRESULT ProfferService(
        [in] REFGUID service,
        [in] IServiceProvider *pService,
        [out] DWORD *pCookie);

    HRESULT RevokeService([in] DWORD cookie);
}

/*****************************************************************************
 * IExplorerBrowserEvents interface
 */
[
 object,
 uuid(361BBDC7-E6EE-4E13-BE58-58E2240C810F)
]
interface IExplorerBrowserEvents : IUnknown
{
    HRESULT OnNavigationPending(
        [in] PCIDLIST_ABSOLUTE pidlFolder);

    HRESULT OnViewCreated(
        [in] IShellView *psv);

    HRESULT OnNavigationComplete(
        [in] PCIDLIST_ABSOLUTE pidlFolder);

    HRESULT OnNavigationFailed(
        [in] PCIDLIST_ABSOLUTE pidlFolder);
}

typedef GUID EXPLORERPANE;
typedef EXPLORERPANE *REFEXPLORERPANE;

cpp_quote("#define SID_ExplorerPaneVisibility IID_IExplorerPaneVisibility")

/*****************************************************************************
 * IExplorerPaneVisibility interface
 */
[
 object,
 uuid(E07010EC-BC17-44C0-97B0-46C7C95B9EDC)
]
interface IExplorerPaneVisibility : IUnknown
{
    typedef enum tagEXPLORERPANESTATE {
        EPS_DONTCARE     = 0x0,
        EPS_DEFAULT_ON   = 0x1,
        EPS_DEFAULT_OFF  = 0x2,
        EPS_STATE_MASK   = 0xffff,
        EPS_INITIALSTATE = 0x10000,
        EPS_FORCE        = 0x20000
    } EXPLORERPANESTATE;

    HRESULT GetPaneState(
        [in] REFEXPLORERPANE ep,
        [out] EXPLORERPANESTATE *peps);
}

typedef [v1_enum] enum tagEXPLORER_BROWSER_FILL_FLAGS {
    EBF_NONE                     = 0,
    EBF_SELECTFROMDATAOBJECT     = 0x100,
    EBF_NODROPTARGET             = 0x200
} EXPLORER_BROWSER_FILL_FLAGS;

typedef [v1_enum] enum tagEXPLORER_BROWSER_OPTIONS {
    EBO_NONE               = 0x00,
    EBO_NAVIGATEONCE       = 0x01,
    EBO_SHOWFRAMES         = 0x02,
    EBO_ALWAYSNAVIGATE     = 0x04,
    EBO_NOTRAVELLOG        = 0x08,
    EBO_NOWRAPPERWINDOW    = 0x10,
    EBO_HTMLSHAREPOINTVIEW = 0x20
} EXPLORER_BROWSER_OPTIONS;

cpp_quote("#define SID_SExplorerBrowserFrame IID_ICommDlgBrowser")

/*****************************************************************************
 * IExplorerBrowser interface
 */
[
 object,
 uuid(DFD3B6B5-C10C-4BE9-85F6-A66969F402F6),
 pointer_default(unique)
]
interface IExplorerBrowser : IUnknown
{

    [local] HRESULT Initialize(
        [in] HWND hwndParent,
        [in] const RECT *prc,
        [in, unique] const FOLDERSETTINGS *pfs);

    HRESULT Destroy();

    [local] HRESULT SetRect(
        [in,out,unique] HDWP *phdwp,
        [in] RECT rcBrowser);

    HRESULT SetPropertyBag(
        [in, string] LPCWSTR pszPropertyBag);

    HRESULT SetEmptyText(
        [in, string] LPCWSTR pszEmptyText);

    HRESULT SetFolderSettings(
        [in] const FOLDERSETTINGS *pfs);

    HRESULT Advise(
        [in] IExplorerBrowserEvents *psbe,
        [out] DWORD *pdwCookie);

    HRESULT Unadvise(
        [in] DWORD dwCookie);

    HRESULT SetOptions(
        [in] EXPLORER_BROWSER_OPTIONS dwFlag);

    HRESULT GetOptions(
        [out] EXPLORER_BROWSER_OPTIONS *pdwFlag);

    HRESULT BrowseToIDList(
        [in] PCUIDLIST_RELATIVE pidl,
        [in] UINT uFlags);

    HRESULT BrowseToObject(
        [in] IUnknown *punk,
        [in] UINT uFlags);

    HRESULT FillFromObject(
        [in] IUnknown *punk,
        [in] EXPLORER_BROWSER_FILL_FLAGS dwFlags);

    HRESULT RemoveAll();

    HRESULT GetCurrentView(
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);
}

/*****************************************************************************
 * INameSpaceTreeControl interface
 */
[
 object,
 uuid(028212A3-B627-47E9-8856-C14265554E4F)
]
interface INameSpaceTreeControl : IUnknown
{
    [v1_enum] enum _NSTCSTYLE {
        NSTCS_HASEXPANDOS                 = 0x00000001,
        NSTCS_HASLINES                    = 0x00000002,
        NSTCS_SINGLECLICKEXPAND           = 0x00000004,
        NSTCS_FULLROWSELECT               = 0x00000008,
        NSTCS_SPRINGEXPAND                = 0x00000010,
        NSTCS_HORIZONTALSCROLL            = 0x00000020,
        NSTCS_ROOTHASEXPANDO              = 0x00000040,
        NSTCS_SHOWSELECTIONALWAYS         = 0x00000080,
        NSTCS_NOINFOTIP                   = 0x00000200,
        NSTCS_EVENHEIGHT                  = 0x00000400,
        NSTCS_NOREPLACEOPEN               = 0x00000800,
        NSTCS_DISABLEDRAGDROP             = 0x00001000,
        NSTCS_NOORDERSTREAM               = 0x00002000,
        NSTCS_RICHTOOLTIP                 = 0x00004000,
        NSTCS_BORDER                      = 0x00008000,
        NSTCS_NOEDITLABELS                = 0x00010000,
        NSTCS_TABSTOP                     = 0x00020000,
        NSTCS_FAVORITESMODE               = 0x00080000,
        NSTCS_AUTOHSCROLL                 = 0x00100000,
        NSTCS_FADEINOUTEXPANDOS           = 0x00200000,
        NSTCS_EMPTYTEXT                   = 0x00400000,
        NSTCS_CHECKBOXES                  = 0x00800000,
        NSTCS_PARTIALCHECKBOXES           = 0x01000000,
        NSTCS_EXCLUSIONCHECKBOXES         = 0x02000000,
        NSTCS_DIMMEDCHECKBOXES            = 0x04000000,
        NSTCS_NOINDENTCHECKS              = 0x08000000,
        NSTCS_ALLOWJUNCTIONS              = 0x10000000,
        NSTCS_SHOWTABSBUTTON              = 0x20000000,
        NSTCS_SHOWDELETEBUTTON            = 0x40000000,
        NSTCS_SHOWREFRESHBUTTON      = (int)0x80000000
    };
    typedef DWORD NSTCSTYLE;

    [v1_enum] enum _NSTCROOTSTYLE {
        NSTCRS_VISIBLE                    = 0x0000,
        NSTCRS_HIDDEN                     = 0x0001,
        NSTCRS_EXPANDED                   = 0x0002
    };
    typedef DWORD NSTCROOTSTYLE;

    [v1_enum] enum _NSTCITEMSTATE {
        NSTCIS_NONE                       = 0x0000,
        NSTCIS_SELECTED                   = 0x0001,
        NSTCIS_EXPANDED                   = 0x0002,
        NSTCIS_BOLD                       = 0x0004,
        NSTCIS_DISABLED                   = 0x0008,
        NSTCIS_SELECTEDNOEXPAND           = 0x0010
    };
    typedef DWORD NSTCITEMSTATE;

    typedef [v1_enum] enum NSTCGNI {
        NSTCGNI_NEXT                      = 0,
        NSTCGNI_NEXTVISIBLE               = 1,
        NSTCGNI_PREV                      = 2,
        NSTCGNI_PREVVISIBLE               = 3,
        NSTCGNI_PARENT                    = 4,
        NSTCGNI_CHILD                     = 5,
        NSTCGNI_FIRSTVISIBLE              = 6,
        NSTCGNI_LASTVISIBLE               = 7
    } NSTCGNI;

    HRESULT Initialize(
        [in] HWND hwndParent,
        [in, unique] RECT *prc,
        [in] NSTCSTYLE nstcsFlags);

    HRESULT TreeAdvise(
        [in] IUnknown *punk,
        [out] DWORD *pdwCookie);

    HRESULT TreeUnadvise(
        [in] DWORD dwCookie);

    HRESULT AppendRoot(
        [in] IShellItem *psiRoot,
        [in] SHCONTF grfEnumFlags,
        [in] NSTCROOTSTYLE grfRootStyle,
        [in, unique] IShellItemFilter *pif);

    HRESULT InsertRoot(
        [in] int iIndex,
        [in] IShellItem *psiRoot,
        [in] SHCONTF grfEnumFlags,
        [in] NSTCROOTSTYLE grfRootStyle,
        [in, unique] IShellItemFilter *pif);

    HRESULT RemoveRoot(
        [in] IShellItem *psiRoot);

    HRESULT RemoveAllRoots();

    HRESULT GetRootItems(
        [out] IShellItemArray **ppsiaRootItems);

    HRESULT SetItemState(
        [in] IShellItem *psi,
        [in] NSTCITEMSTATE nstcisMask,
        [in] NSTCITEMSTATE nstcisFlags);

    HRESULT GetItemState(
        [in] IShellItem *psi,
        [in] NSTCITEMSTATE nstcismask,
        [out] NSTCITEMSTATE *pnstcisFlags);

    HRESULT GetSelectedItems(
        [out] IShellItemArray **psiaItems);

    HRESULT GetItemCustomState(
        [in] IShellItem *psi,
        [out] int *piStateNumber);

    HRESULT SetItemCustomState(
        [in] IShellItem *psi,
        [in] int iStateNumber);

    HRESULT EnsureItemVisible(
        [in] IShellItem *psi);

    HRESULT SetTheme(
        [in, string] LPCWSTR pszTheme);

    HRESULT GetNextItem(
        [in, unique] IShellItem *psi,
        [in] NSTCGNI nstcgi,
        [out] IShellItem **ppsiNext);

    HRESULT HitTest(
        [in] POINT *ppt,
        [out] IShellItem **ppsiOut);

    HRESULT GetItemRect(
        [in] IShellItem *psi,
        [out] RECT *prect);

    HRESULT CollapseAll();
}

/*****************************************************************************
 * INameSpaceTreeControl2 interface
 */
[
 object,
 uuid(7CC7AED8-290E-49BC-8945-C1401CC9306C)
]
interface INameSpaceTreeControl2 : INameSpaceTreeControl
{
    typedef [v1_enum] enum NSTCSTYLE2 {
        NSTCS2_DEFAULT                     = 0x00,
        NSTCS2_INTERRUPTNOTIFICATIONS      = 0x01,
        NSTCS2_SHOWNULLSPACEMENU           = 0x02,
        NSTCS2_DISPLAYPADDING              = 0x04,
        NSTCS2_DISPLAYPINNEDONLY           = 0x08,
        NTSCS2_NOSINGLETONAUTOEXPAND       = 0x10,  /* The apparent typo here is   */
        NTSCS2_NEVERINSERTNONENUMERATED    = 0x20   /* present also in the Win SDK */
    } NSTCSTYLE2;
    cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NSTCSTYLE2)")

    HRESULT SetControlStyle(
        [in] NSTCSTYLE nstcsMask,
        [in] NSTCSTYLE nstcsStyle);

    HRESULT GetControlStyle(
        [in] NSTCSTYLE nstcsMask,
        [out] NSTCSTYLE *pnstcsStyle);

    HRESULT SetControlStyle2(
        [in] NSTCSTYLE2 nstcsMask,
        [in] NSTCSTYLE2 nstcsStyle);

    HRESULT GetControlStyle2(
        [in] NSTCSTYLE2 nstcsMask,
        [out] NSTCSTYLE2 *pnstcsStyle);
}

/*****************************************************************************
 * INameSpaceTreeControlEvents interface
 */

[
 object,
 uuid(93D77985-B3D8-4484-8318-672CDDA002CE),
 local
]
interface INameSpaceTreeControlEvents : IUnknown
{
    [v1_enum] enum _NSTCEHITTEST {
        NSTCEHT_NOWHERE                    = 0x0001,
        NSTCEHT_ONITEMICON                 = 0x0002,
        NSTCEHT_ONITEMLABEL                = 0x0004,
        NSTCEHT_ONITEMIDENT                = 0x0008,
        NSTCEHT_ONITEMBUTTON               = 0x0010,
        NSTCEHT_ONITEMRIGHT                = 0x0020,
        NSTCEHT_ONITEMSTATEICON            = 0x0040,
        NSTCEHT_ONITEM                     = 0x0046,
        NSTCEHT_ONITEMTABBUTTON            = 0x1000
    };
    typedef DWORD NSTCEHITTEST;

    [v1_enum] enum _NSTCECLICKTYPE {
        NSTCECT_LBUTTON                    = 0x1,
        NSTCECT_MBUTTON                    = 0x2,
        NSTCECT_RBUTTON                    = 0x3,
        NSTCECT_BUTTON                     = 0x3,
        NSTCECT_DBLCLICK                   = 0x4
    };
    typedef DWORD NSTCECLICKTYPE;

    HRESULT OnItemClick(
        [in] IShellItem *psi,
        [in] NSTCEHITTEST nstceHitTest,
        [in] NSTCECLICKTYPE nstceClickType);

    HRESULT OnPropertyItemCommit(
        [in] IShellItem *psi);

    HRESULT OnItemStateChanging(
        [in] IShellItem *psi,
        [in] NSTCITEMSTATE nstcisMask,
        [in] NSTCITEMSTATE nstcisState);

    HRESULT OnItemStateChanged(
        [in] IShellItem *psi,
        [in] NSTCITEMSTATE nstcisMask,
        [in] NSTCITEMSTATE nstcisState);

    HRESULT OnSelectionChanged(
        [in] IShellItemArray *psiaSelection);

    HRESULT OnKeyboardInput(
        [in] UINT uMsg,
        [in] WPARAM wParam,
        [in] LPARAM lParam);

    HRESULT OnBeforeExpand(
        [in] IShellItem *psi);

    HRESULT OnAfterExpand(
        [in] IShellItem *psi);

    HRESULT OnBeginLabelEdit(
        [in] IShellItem *psi);

    HRESULT OnEndLabelEdit(
        [in] IShellItem *psi);

    HRESULT OnGetToolTip(
        [in] IShellItem *psi,
        [out, string, size_is(cchTip)] LPWSTR pszTip,
        [in] int cchTip);

    HRESULT OnBeforeItemDelete(
        [in] IShellItem *psi);

    HRESULT OnItemAdded(
        [in] IShellItem *psi,
        [in] BOOL fIsRoot);

    HRESULT OnItemDeleted(
        [in] IShellItem *psi,
        [in] BOOL fIsRoot);

    HRESULT OnBeforeContextMenu(
        [in, unique] IShellItem *psi,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT OnAfterContextMenu(
        [in] IShellItem *psi,
        [in] IContextMenu *pcmIn,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT OnBeforeStateImageChange(
        [in] IShellItem *psi);

    HRESULT OnGetDefaultIconIndex(
        [in] IShellItem *psi,
        [out] int *piDefaultIcon,
        [out] int *piOpenIcon);
}

/*****************************************************************************
 * INameSpaceTreeControlCustomDraw interface
 */
[
 object,
 uuid(2D3BA758-33EE-42D5-BB7B-5F3431D86C78),
 local
]

interface INameSpaceTreeControlCustomDraw : IUnknown
{
    typedef struct NSTCCUSTOMDRAW
    {
        IShellItem *psi;
        UINT uItemState;
        NSTCITEMSTATE nstcis;
        LPCWSTR pszText;
        int iImage;
        HIMAGELIST himl;
        int iLevel;
        int iIndent;
    } NSTCCUSTOMDRAW;

    HRESULT PrePaint(
        [in] HDC hdc,
        [in] RECT *prc,
        [out] LRESULT *plres);

    HRESULT PostPaint(
        [in] HDC hdc,
        [in] RECT *prc);

    HRESULT ItemPrePaint(
        [in] HDC hdc,
        [in] RECT *prc,
        [in, out] COLORREF *pclrText,
        [in, out] COLORREF *pclrTextBk,
        [out] LRESULT *plres);

    HRESULT ItemPostPaint(
        [in] HDC hdc,
        [in] RECT *prc,
        [in] NSTCCUSTOMDRAW *pnstccdItem);
}

/*****************************************************************************
 * INameSpaceTreeControlDropHandler interface
 */
[
 object,
 uuid(F9C665D6-C2F2-4C19-BF33-8322D7352F51),
 local
]
interface INameSpaceTreeControlDropHandler : IUnknown
{
    HRESULT OnDragEnter(
        [in, unique] IShellItem *psiOver,
        [in] IShellItemArray *psiaData,
        [in] BOOL fOutsideSource,
        [in] DWORD grfKeyState,
        [in, out] DWORD *pdwEffect);

    HRESULT OnDragOver(
        [in, unique] IShellItem *psiOver,
        [in] IShellItemArray *psiaData,
        [in] DWORD grfKeyState,
        [in, out] DWORD *pdwEffect);

    HRESULT OnDragPosition(
        [in, unique] IShellItem *psiOver,
        [in] IShellItemArray *psiaData,
        [in] int iNewPosition,
        [in] int iOldPosition);

    HRESULT OnDrop(
        [in, unique] IShellItem *psiOver,
        [in] IShellItemArray *psiaData,
        [in] int iPosition,
        [in] DWORD grfKeyState,
        [in, out] DWORD *pdwEffect);

    HRESULT OnDropPosition(
        [in, unique] IShellItem *psiOver,
        [in] IShellItemArray *psiaData,
        [in] int iNewPosition,
        [in] int iOldPosition);

    HRESULT OnDragLeave(
        [in, unique] IShellItem *psiOver);
}
cpp_quote("#define NSTCDHPOS_ONTOP -1")

interface IFileDialog;

typedef [v1_enum] enum FDE_OVERWRITE_RESPONSE
{
    FDEOR_DEFAULT  = 0,
    FDEOR_ACCCEP   = 1,
    FDEOR_REFUSE   = 2
} FDE_OVERWRITE_RESPONSE;

typedef [v1_enum] enum FDE_SHAREVIOLATION_RESPONSE
{
    FDESVR_DEFAULT = 0,
    FDESVR_ACCEPT  = 1,
    FDESVR_REFUSE  = 2
} FDE_SHAREVIOLATION_RESPONSE;

/*****************************************************************************
 * IFileDialogEvents interface
 */
[
 object,
 uuid(973510DB-7D7F-452B-8975-74A85828D354),
 pointer_default(unique)
]
interface IFileDialogEvents : IUnknown
{
    HRESULT OnFileOk(
        [in] IFileDialog *pfd);

    HRESULT OnFolderChanging(
        [in] IFileDialog *pfd,
        [in] IShellItem *psiFolder);

    HRESULT OnFolderChange(
        [in] IFileDialog *pfd);

    HRESULT OnSelectionChange(
        [in] IFileDialog *pfd);

    HRESULT OnShareViolation(
        [in] IFileDialog *pfd,
        [in] IShellItem *psi,
        [out] FDE_SHAREVIOLATION_RESPONSE *pResponse);

    HRESULT OnTypeChange(
        [in] IFileDialog *pfd);

    HRESULT OnOverwrite(
        [in] IFileDialog *pfd,
        [in] IShellItem *psi,
        [out] FDE_OVERWRITE_RESPONSE *pResponse);
}

/*****************************************************************************
 * IModalWindow interface
 */
[
 object,
 uuid(B4DB1657-70D7-485E-8E3E-6FCB5A5C1802),
 pointer_default(unique)
]
interface IModalWindow : IUnknown
{
    [local]
    HRESULT Show(
        [in, unique, annotation("__in_opt")] HWND hwndOwner);

    [call_as(Show)]
    HRESULT RemoteShow(
        [in, unique] HWND hwndOwner);
}

typedef [v1_enum] enum FDAP
{
    FDAP_BOTTOM    = 0,
    FDAP_TOP       = 1
} FDAP;

/*****************************************************************************
 * IFileDialog interface
 */
[
 object,
 uuid(42F85136-DB7E-439C-85F1-E4075D135FC8),
 pointer_default(unique)
]
interface IFileDialog : IModalWindow
{
    [v1_enum] enum _FILEOPENDIALOGOPTIONS
    {
        FOS_OVERWRITEPROMPT     = 0x00000002,
        FOS_STRICTFILETYPES     = 0x00000004,
        FOS_NOCHANGEDIR         = 0x00000008,
        FOS_PICKFOLDERS         = 0x00000020,
        FOS_FORCEFILESYSTEM     = 0x00000040,
        FOS_ALLNONSTORAGEITEMS  = 0x00000080,
        FOS_NOVALIDATE          = 0x00000100,
        FOS_ALLOWMULTISELECT    = 0x00000200,
        FOS_PATHMUSTEXIST       = 0x00000800,
        FOS_FILEMUSTEXIST       = 0x00001000,
        FOS_CREATEPROMPT        = 0x00002000,
        FOS_SHAREAWARE          = 0x00004000,
        FOS_NOREADONLYRETURN    = 0x00008000,
        FOS_NOTESTFILECREATE    = 0x00010000,
        FOS_HIDEMRUPLACES       = 0x00020000,
        FOS_HIDEPINNEDPLACES    = 0x00040000,
        FOS_NODEREFERENCELINKS  = 0x00100000,
        FOS_DONTADDTORECENT     = 0x02000000,
        FOS_FORCESHOWHIDDEN     = 0x10000000,
        FOS_DEFAULTNOMINIMODE   = 0x20000000,
        FOS_FORCEPREVIEWPANEON  = 0x40000000
    };
    typedef DWORD FILEOPENDIALOGOPTIONS;

    HRESULT SetFileTypes(
        [in] UINT cFileTypes,
        [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFilterSpec);

    HRESULT SetFileTypeIndex(
        [in] UINT iFileType);

    HRESULT GetFileTypeIndex(
        [out] UINT *piFileType);

    HRESULT Advise(
        [in] IFileDialogEvents *pfde,
        [out] DWORD *pdwCookie);

    HRESULT Unadvise(
        [in] DWORD dwCookie);

    HRESULT SetOptions(
        [in] FILEOPENDIALOGOPTIONS fos);

    HRESULT GetOptions(
        [in] FILEOPENDIALOGOPTIONS *pfos);

    HRESULT SetDefaultFolder(
        [in] IShellItem *psi);

    HRESULT SetFolder(
        [in] IShellItem *psi);

    HRESULT GetFolder(
        [out] IShellItem **ppsi);

    HRESULT GetCurrentSelection(
        [out] IShellItem **ppsi);

    HRESULT SetFileName(
        [in, string] LPCWSTR pszName);

    HRESULT GetFileName(
        [out, string] LPWSTR *pszName);

    HRESULT SetTitle(
        [in, string] LPCWSTR pszTitle);

    HRESULT SetOkButtonLabel(
        [in, string] LPCWSTR pszText);

    HRESULT SetFileNameLabel(
        [in, string] LPCWSTR pszLabel);

    HRESULT GetResult(
        [out] IShellItem **ppsi);

    HRESULT AddPlace(
        [in] IShellItem *psi,
        [in] FDAP fdap);

    HRESULT SetDefaultExtension(
        [in, string] LPCWSTR pszDefaultExtension);

    HRESULT Close(
        [in] HRESULT hr);

    HRESULT SetClientGuid(
        [in] REFGUID guid);

    HRESULT ClearClientData();

    HRESULT SetFilter(
        [in] IShellItemFilter *pFilter);
}

/*****************************************************************************
 * IFileDialog2 interface
 */
[
 object,
 uuid(61744FC7-85B5-4791-A9B0-272276309B13),
 pointer_default(unique)
]
interface IFileDialog2 : IFileDialog
{
    HRESULT SetCancelButtonLabel(
        [in] LPCWSTR pszLabel);

    HRESULT SetNavigationRoot(
        [in] IShellItem *psi);
}

/*****************************************************************************
 * IFileOperationProgressSink interface
 */
[
 object,
 uuid(04B0F1A7-9490-44BC-96E1-4296A31252E2),
 pointer_default(unique)
]
interface IFileOperationProgressSink : IUnknown
{
    HRESULT StartOperations();

    HRESULT FinishOperations(
        [in] HRESULT hrResult);

    HRESULT PreRenameItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in, unique, string] LPCWSTR pszNewName);

    HRESULT PostRenameItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in, string] LPCWSTR pszNewName,
        [in] HRESULT hrRename,
        [in] IShellItem *psiNewlyCreated);

    HRESULT PreMoveItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName);

    HRESULT PostMoveItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName,
        [in] HRESULT hrMove,
        [in] IShellItem *psiNewlyCreated);

    HRESULT PreCopyItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName);

    HRESULT PostCopyItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName,
        [in] HRESULT hrCopy,
        [in] IShellItem *psiNewlyCreated);

    HRESULT PreDeleteItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem);

    HRESULT PostDeleteItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiItem,
        [in] HRESULT hrDelete,
        [in] IShellItem *psiNewlyCreated);

    HRESULT PreNewItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName);

    HRESULT PostNewItem(
        [in] DWORD dwFlags,
        [in] IShellItem *psiDestinationFolder,
        [in, unique, string] LPCWSTR pszNewName,
        [in, unique, string] LPCWSTR pszTemplateName,
        [in] DWORD dwFileAttributes,
        [in] HRESULT hrNew,
        [in] IShellItem *psiNewItem);

    HRESULT UpdateProgress(
        [in] UINT iWorkTotal,
        [in] UINT iWorkSoFar);

    HRESULT ResetTimer();

    HRESULT PauseTimer();

    HRESULT ResumeTimer();
}

/*****************************************************************************
 * IFileSaveDialog interface
 */
[
 object,
 uuid(84BCCD23-5FDE-4CDB-AEA4-AF64B83D78AB),
 pointer_default(unique)
]
interface IFileSaveDialog : IFileDialog
{
    HRESULT SetSaveAsItem(
        [in] IShellItem *psi);

    HRESULT SetProperties(
        [in] IPropertyStore *pStore);

    HRESULT SetCollectedProperties(
        [in] IPropertyDescriptionList *pList,
        [in] BOOL fAppendDefault);

    HRESULT GetProperties(
        [in] IPropertyStore **ppStore);

    HRESULT ApplyProperties(
        [in] IShellItem *psi,
        [in] IPropertyStore *pStore,
        [in, unique] HWND hwnd,
        [in, unique] IFileOperationProgressSink *pSink);
}


/*****************************************************************************
 * IFileOpenDialog interface
 */
[
 object,
 uuid(D57C7288-D4AD-4768-BE02-9D969532D960),
 pointer_default(unique)
]
interface IFileOpenDialog : IFileDialog
{
    HRESULT GetResults(
        [out] IShellItemArray **ppenum);

    HRESULT GetSelectedItems(
        [out] IShellItemArray **ppsai);
}

typedef [v1_enum] enum CDCONTROLSTATEF
{
    CDCS_INACTIVE       = 0x0,
    CDCS_ENABLED        = 0x1,
    CDCS_VISIBLE        = 0x2,
    CDCS_ENABLEDVISIBLE = 0x3
} CDCONTROLSTATEF;
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CDCONTROLSTATEF)")
/*****************************************************************************
 * IFileDialogCustomize interface
 */
[
 object,
 uuid(E6FDD21A-163F-4975-9C8C-A69F1BA37034),
 pointer_default(unique)
]
interface IFileDialogCustomize : IUnknown
{
    HRESULT EnableOpenDropDown(
        [in] DWORD dwIDCtl);

    HRESULT AddMenu(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszLabel);

    HRESULT AddPushButton(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszLabel);

    HRESULT AddComboBox(
        [in] DWORD dwIDCtl);

    HRESULT AddRadioButtonList(
        [in] DWORD dwIDCtl);

    HRESULT AddCheckButton(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszLabel,
        [in] BOOL bChecked);

    HRESULT AddEditBox(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszText);

    HRESULT AddSeparator(
        [in] DWORD dwIDCtl);

    HRESULT AddText(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszText);

    HRESULT SetControlLabel(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszLabel);

    HRESULT GetControlState(
        [in] DWORD dwIDCtl,
        [out] CDCONTROLSTATEF *pdwState);

    HRESULT SetControlState(
        [in] DWORD dwIDCtl,
        [in] CDCONTROLSTATEF dwState);

    HRESULT GetEditBoxText(
        [in] DWORD dwIDCtl,
        [out, string] WCHAR **ppszText);

    HRESULT SetEditBoxText(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszText);

    HRESULT GetCheckButtonState(
        [in] DWORD dwIDCtl,
        [out] BOOL *pbChecked);

    HRESULT SetCheckButtonState(
        [in] DWORD dwIDCtl,
        [in] BOOL bChecked);

    HRESULT AddControlItem(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem,
        [in] LPCWSTR pszLabel);

    HRESULT RemoveControlItem(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem);

    HRESULT RemoveAllControlItems(
        [in] DWORD dwIDCtl);

    HRESULT GetControlItemState(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem,
        [out] CDCONTROLSTATEF *pdwState);

    HRESULT SetControlItemState(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem,
        [in] CDCONTROLSTATEF dwState);

    HRESULT GetSelectedControlItem(
        [in] DWORD dwIDCtl,
        [out] DWORD *pdwIDItem);

    HRESULT SetSelectedControlItem(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem);

    HRESULT StartVisualGroup(
        [in] DWORD dwIDCtl,
        [in, string] LPCWSTR pszLabel);

    HRESULT EndVisualGroup();

    HRESULT MakeProminent(
        [in] DWORD dwIDCtl);

    HRESULT SetControlItemText(
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem,
        [in, string] LPCWSTR pszLabel);
}

/*****************************************************************************
 * IFileDialogControlEvents interface
 */
[
 object,
 uuid(36116642-D713-4B97-9B83-7484A9D00433),
 pointer_default(unique)
]
interface IFileDialogControlEvents : IUnknown
{
    HRESULT OnItemSelected(
        [in] IFileDialogCustomize *pfdc,
        [in] DWORD dwIDCtl,
        [in] DWORD dwIDItem);

    HRESULT OnButtonClicked(
        [in] IFileDialogCustomize *pfdc,
        [in] DWORD dwIDCtl);

    HRESULT OnCheckButtonToggled(
        [in] IFileDialogCustomize *pfdc,
        [in] BOOL dwIDCtl,
        [in] BOOL bChecked);

    HRESULT OnControlActivating(
        [in] IFileDialogCustomize *pfdc,
        [in] DWORD dwIDCtl);
}

typedef [v1_enum] enum tagKF_CATEGORY
{
    KF_CATEGORY_VIRTUAL = 0x00000001,
    KF_CATEGORY_FIXED   = 0x00000002,
    KF_CATEGORY_COMMON  = 0x00000003,
    KF_CATEGORY_PERUSER = 0x00000004
} KF_CATEGORY;

typedef [v1_enum] enum tagKF_REDIRECTION_CAPABILITIES
{
    KF_REDIRECTION_CAPABILITIES_ALLOW_ALL               = 0x000000ff,
    KF_REDIRECTION_CAPABILITIES_REDIRECTABLE            = 0x00000001,
    KF_REDIRECTION_CAPABILITIES_DENY_ALL                = 0x000fff00,
    KF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED  = 0x00000100,
    KF_REDIRECTION_CAPABILITIES_DENY_POLICY             = 0x00000200,
    KF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS        = 0x00000400
} KF_REDIRECTION_CAPABILITIES;

typedef [v1_enum] enum tagKF_DEFINITION_FLAGS
{
    KFDF_LOCAL_REDIRECT_ONLY    = 0x00000002,
    KFDF_ROAMABLE               = 0x00000004,
    KFDF_PRECREATE              = 0x00000008,
    KFDF_STREAM                 = 0x00000010,
    KFDF_PUBLISHEXPANDEDPATH    = 0x00000020
} KF_DEFINITION_FLAGS;

typedef struct tagKNOWNFOLDER_DEFINITION
{
    KF_CATEGORY         category;
    LPWSTR              pszName;
    LPWSTR              pszDescription;
    KNOWNFOLDERID       fidParent;
    LPWSTR              pszRelativePath;
    LPWSTR              pszParsingName;
    LPWSTR              pszTooltip;
    LPWSTR              pszLocalizedName;
    LPWSTR              pszIcon;
    LPWSTR              pszSecurity;
    DWORD               dwAttributes;
    KF_DEFINITION_FLAGS kfdFlags;
    FOLDERTYPEID        ftidType;
} KNOWNFOLDER_DEFINITION;

[
 object,
 uuid(3aa7af7e-9b36-420C-a8e3-f77d4674a488),
 pointer_default(ref)
]
interface IKnownFolder : IUnknown
{
    HRESULT GetId(
        [out] KNOWNFOLDERID *pkfid);

    HRESULT GetCategory(
        [out] KF_CATEGORY *pCategory);

    HRESULT GetShellItem(
        [in] DWORD dwFlags,
        [in] REFIID riid,
        [out, iid_is(riid)] void **ppv);

    HRESULT GetPath(
        [in] DWORD dwFlags,
        [out, string] LPWSTR *ppszPath);

    HRESULT SetPath(
        [in] DWORD dwFlags,
        [in, string] LPCWSTR pszPath);

    HRESULT GetIDList(
        [in] DWORD dwFlags,
        [out] PIDLIST_ABSOLUTE *ppidl);

    HRESULT GetFolderType(
        [out] FOLDERTYPEID *pftid);

    HRESULT GetRedirectionCapabilities(
        [out] KF_REDIRECTION_CAPABILITIES *pCapabilities);

    HRESULT GetFolderDefinition(
        [out] KNOWNFOLDER_DEFINITION *pKFD);
}

typedef [v1_enum] enum tagKF_REDIRECT_FLAGS
{
    KF_REDIRECT_USER_EXCLUSIVE      = 0x00000001,
    KF_REDIRECT_COPY_SOURCE_DACL    = 0x00000002,
    KF_REDIRECT_OWNER_USER          = 0x00000004,
    KF_REDIRECT_SET_OWNER_EXPLICIT  = 0x00000008,
    KF_REDIRECT_CHECK_ONLY          = 0x00000010,
    KF_REDIRECT_WITH_UI             = 0x00000020,
    KF_REDIRECT_UNPIN               = 0x00000040,
    KF_REDIRECT_PIN                 = 0x00000080,
    KF_REDIRECT_COPY_CONTENTS       = 0x00000200,
    KF_REDIRECT_DEL_SOURCE_CONTENTS = 0x00000400,
    KF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS = 0x00000800
} KF_REDIRECT_FLAGS;

[
    object,
    uuid(8BE2D872-86AA-4d47-B776-32CCA40C7018),
    pointer_default(ref)
]
interface IKnownFolderManager : IUnknown
{
    typedef [v1_enum] enum tagFFFP_MODE
    {
        FFFP_EXACTMATCH,
        FFFP_NEARESTPARENTMATCH
    } FFFP_MODE;

    HRESULT FolderIdFromCsidl(
        [in] int nCsidl,
        [out] KNOWNFOLDERID *pfid);

    HRESULT FolderIdToCsidl(
        [in] REFKNOWNFOLDERID rfid,
        [out] int *pnCsidl);

    HRESULT GetFolderIds(
        [out, size_is(, *pCount)] KNOWNFOLDERID **ppKFId,
        [in, out] UINT *pCount);

    HRESULT GetFolder(
        [in] REFKNOWNFOLDERID rfid,
        [out] IKnownFolder **ppkf);

    HRESULT GetFolderByName(
        [in, string] LPCWSTR pszCanonicalName,
        [out] IKnownFolder **ppkf);

    HRESULT RegisterFolder(
        [in] REFKNOWNFOLDERID rfid,
        [in] KNOWNFOLDER_DEFINITION const *pKFD);

    HRESULT UnregisterFolder(
        [in] REFKNOWNFOLDERID rfid);

    HRESULT FindFolderFromPath(
        [in, string] LPCWSTR pszPath,
        [in] FFFP_MODE mode,
        [out] IKnownFolder **ppkf);

    HRESULT FindFolderFromIDList(
        [in] PCIDLIST_ABSOLUTE pidl,
        [out] IKnownFolder **ppkf);

    HRESULT Redirect(
        [in] REFKNOWNFOLDERID rfid,
        [in, unique] HWND hwnd,
        [in] KF_REDIRECT_FLAGS flags,
        [in, unique, string] LPCWSTR pszTargetPath,
        [in] UINT cFolders,
        [in, size_is(cFolders), unique] KNOWNFOLDERID const *pExclusion,
        [out, string] LPWSTR *ppszError);
}

/* function for releasing structure returned from IKnownFolder::GetFolderDefinition */
cpp_quote("static inline void FreeKnownFolderDefinitionFields(KNOWNFOLDER_DEFINITION *pKFD)")
cpp_quote("{")
cpp_quote("    CoTaskMemFree(pKFD->pszName);")
cpp_quote("    CoTaskMemFree(pKFD->pszDescription);")
cpp_quote("    CoTaskMemFree(pKFD->pszRelativePath);")
cpp_quote("    CoTaskMemFree(pKFD->pszParsingName);")
cpp_quote("    CoTaskMemFree(pKFD->pszTooltip);")
cpp_quote("    CoTaskMemFree(pKFD->pszLocalizedName);")
cpp_quote("    CoTaskMemFree(pKFD->pszIcon);")
cpp_quote("    CoTaskMemFree(pKFD->pszSecurity);")
cpp_quote("}")

typedef [v1_enum] enum ASSOCIATIONLEVEL {
    AL_MACHINE,
    AL_EFFECTIVE,
    AL_USER
} ASSOCIATIONLEVEL;

typedef [v1_enum] enum ASSOCIATIONTYPE {
    AT_FILEEXTENSION,
    AT_URLPROTOCOL,
    AT_STARTMENUCLIENT,
    AT_MIMETYPE
} ASSOCIATIONTYPE;

[
    object,
    uuid(4e530b0a-e611-4c77-a3ac-9031d022281b),
    pointer_default(unique)
]
interface IApplicationAssociationRegistration : IUnknown
{
    HRESULT QueryCurrentDefault(
        [in, string] LPCWSTR pszQuery,
        [in] ASSOCIATIONTYPE atQueryType,
        [in] ASSOCIATIONLEVEL alQueryLevel,
        [out, string] LPWSTR *ppszAssociation);

    HRESULT QueryAppIsDefault(
        [in, string] LPCWSTR pszQuery,
        [in] ASSOCIATIONTYPE atQueryType,
        [in] ASSOCIATIONLEVEL alQueryLevel,
        [in, string] LPCWSTR pszAppRegistryName,
        [out] BOOL *pfDefault);

    HRESULT QueryAppIsDefaultAll(
        [in] ASSOCIATIONLEVEL alQueryLevel,
        [in, string] LPCWSTR pszAppRegistryName,
        [out] BOOL* pfDefault);

    HRESULT SetAppAsDefault(
        [in, string] LPCWSTR pszAppRegistryName,
        [in, string] LPCWSTR pszSet,
        [in] ASSOCIATIONTYPE atSetType);

    HRESULT SetAppAsDefaultAll(
        [in, string] LPCWSTR pszAppRegistryName);

    HRESULT ClearUserAssociations();
}

[
    uuid(6332debf-87b5-4670-90c0-5e57b408a49e),
    object,
    pointer_default(unique)
]
interface ICustomDestinationList : IUnknown
{
    typedef [v1_enum] enum KNOWNDESTCATEGORY {
        KDC_FREQUENT = 1,
        KDC_RECENT
    } KNOWNDESTCATEGORY;

    HRESULT SetAppID([in, string] LPCWSTR pszAppID);

    HRESULT BeginList(
            [out] UINT *pcMinSlots,
            [in] REFIID riid,
            [out, iid_is(riid)] void **ppv);

    HRESULT AppendCategory(
            [in, string] LPCWSTR pszCategory,
            [in] IObjectArray *poa);

    HRESULT AppendKnownCategory([in] KNOWNDESTCATEGORY category);
    HRESULT AddUserTasks([in] IObjectArray *poa);
    HRESULT CommitList();

    HRESULT GetRemovedDestinations(
            [in] REFIID riid,
            [out, iid_is(riid)] void **ppv);

    HRESULT DeleteList([in, unique, string] LPCWSTR pszAppID);
    HRESULT AbortList();
}

/*****************************************************************************
 * ShellObjects typelibrary
 */
[
 uuid(50A7E9B1-70EF-11D1-B75A-00A0C90564FE),
 lcid(0x0000),
 version(1.0)
]
library ShellObjects
{
    [
        uuid(71F96385-DDD6-48D3-A0C1-AE06E8B055FB)
    ]
    coclass ExplorerBrowser
    {
        interface IExplorerBrowser;
    }

    [
        uuid(DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7)
    ]
    coclass FileOpenDialog
    {
        interface IFileOpenDialog;
    }

    [
        uuid(C0B4E2F3-BA21-4773-8DBA-335EC946EB8B)
    ]
    coclass FileSaveDialog
    {
        interface IFileSaveDialog;
    }

    [
        uuid(AE054212-3535-4430-83ED-D501AA6680E6)
    ]
    coclass NamespaceTreeControl
    {
        interface INameSpaceTreeControl2;
    }

    [
        uuid(4df0c730-df9d-4ae3-9153-aa6b82e9795a)
    ]
    coclass KnownFolderManager
    {
        interface IKnownFolderManager;
    }

    [
        uuid(591209c7-767b-42b2-9fba-44ee4615f2c7)
    ]
    coclass ApplicationAssociationRegistration
    {
        interface IApplicationAssociationRegistration;
    }

    [
         uuid(00021401-0000-0000-c000-000000000046)
    ]
    coclass ShellLink
    {
        interface IShellLinkW;
    }

    [
        uuid(56fdf344-fd6d-11d0-958a-006097c9a090)
    ]
    coclass TaskbarList
    {
        interface ITaskbarList4;
    }

    [
        uuid(77f10cf0-3db5-4966-b520-b7c54fd35ed6)
    ]
    coclass DestinationList {
        interface ICustomDestinationList;
    }

    [
        uuid(2d3468c1-36a7-43b6-ac24-d3f02fd9607a)
    ]
    coclass EnumerableObjectCollection
    {
        interface IEnumObjects;
    }
}