summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/pidl/mapi/mapi.idl
blob: 2b77f2ca10b0ba66f61cd7aa08bc12a212e1b220 (plain)
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
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
#include "idl_types.h"

import "nspi.idl";

/*
  emsmdb interface definitions
*/
[ uuid("a4f1db00-ca47-1067-b31f-00dd010662da"),
  version(0.82),
  endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]","ncacn_ip_tcp:"),
  pointer_default(unique),
  helpstring("MAPI")
] interface mapi
{
#include "mapicodes_enum.h"
#include "mapitags_enum.h"

/* Property types */
#define  PT_UNSPECIFIED    0x0
#define  PT_NULL     0x1
#define  PT_I2     0x2
#define  PT_SHORT    0x2
#define  PT_LONG     0x3
#define  PT_FLOAT    0x4
#define  PT_DOUBLE   0x5
#define  PT_CURRENCY   0x6
#define  PT_APPTIME    0x7
#define  PT_ERROR    0xa
#define  PT_BOOLEAN    0xb
#define  PT_OBJECT   0xd
#define  PT_I8     0x14
#define  PT_STRING8    0x1e
#define  PT_UNICODE    0x1f
#define  PT_SYSTIME    0x40
#define  PT_CLSID    0x48
#define  PT_SVREID   0xFB
#define  PT_SRESTRICT    0xFD
#define  PT_ACTIONS    0xFE
#define  PT_BINARY   0x102

  typedef struct datablob {
    uint8 *data;
    uint8 length;
  } DATA_BLOB;

  /******************/
  /* Function: 0x00 */
  WERROR mapi_EcDoConnect(
    [out]       policy_handle *hBinding,
    [in,string,charset(DOS)] uint8   szUserDN[],
    [in]        uint32    ulFlags,
    [in]        uint32    ulConMod,
    [in]        uint32    cbLimit,
    [in]        uint32    ulCpid,
    [in]        uint32    ulLcidString,
    [in]        uint32    ulLcidSort,
    [in]        uint32    ulIcxrLink,
    [in]        uint16    usFCanConvertCodePages,
    [out]       uint32    *pcmsPollsMax,
    [out]       uint32    *pcRetry,
    [out]       uint32    *pcmsRetryDelay,
    [out]       uint32    *picxr,
    [out,unique,ref,string,charset(DOS)] uint8 **szDNPrefix,
    [out,unique,ref,string,charset(DOS)] uint8 **szDisplayName,
    [in,string]  uint8    rgwClientVersion[6],
    [out,string] uint8    rgwServerVersion[6],
    [out,string] uint8    rgwBestVersion[6],
    [in,out]    uint32    *pullTimeStamp
    );

  /******************/
  /* Function: 0x01 */
  WERROR mapi_EcDoDisconnect(
    [in, out, ref] policy_handle *pcxh
    );

  /******************/
  /* Function: 0x02 */
  typedef [public, enum8bit, flag(NDR_PAHEX)] enum
    {
      MAPI_STORE  = 0x1,
      MAPI_ADDRBOOK = 0x2,
      MAPI_FOLDER = 0x3,
      MAPI_ABCONT = 0x4,
      MAPI_MESSAGE  = 0x5,
      MAPI_MAILUSER = 0x6, /* Individual Recipient */
      MAPI_ATTACH = 0x7,
      MAPI_DISTLIST = 0x8,
      MAPI_PROFSECT = 0x9,
      MAPI_STATUS = 0xA,
      MAPI_SESSION  = 0xB,
      MAPI_FORMINFO = 0xC
    } MAPI_OBJTYPE;

  typedef [public, v1_enum, flag(NDR_PAHEX)] enum
    {
      RightsNone    = 0x00000000,
      RightsReadItems   = 0x00000001,
      RightsCreateItems = 0x00000002,
      RightsEditOwn   = 0x00000008,
      RightsDeleteOwn   = 0x00000010,
      RightsEditAll   = 0x00000020,
      RightsDeleteAll   = 0x00000040,
      RightsCreateSubfolders  = 0x00000080,
      RightsFolderOwner = 0x00000100,
      RightsFolderContact = 0x00000200,
      RoleNone    = 0x00000400,
      RoleReviewer    = 0x00000401,
      RoleContributor   = 0x00000402,
      RoleNoneditingAuthor  = 0x00000413,
      RoleAuthor    = 0x0000041B,
      RoleEditor    = 0x0000047B,
      RolePublishAuthor = 0x0000049B,
      RolePublishEditor = 0x000004FB,
      RightsAll   = 0x000005FB,
      RoleOwner   = 0x000007FB
    } ACLRIGHTS;

  /*
    EcDoRpc opnums
  */
  typedef [public, enum8bit, flag(NDR_PAHEX)] enum
    {
      RopNone                                     = 0x00,
      RopRelease                                  = 0x01,
      RopOpenFolder                               = 0x02,
      RopOpenMessage                              = 0x03,
      RopGetHierarchyTable                        = 0x04,
      RopGetContentsTable                         = 0x05,
      RopCreateMessage                            = 0x06,
      RopGetPropertiesSpecific                    = 0x07,
      RopGetPropertiesAll                         = 0x08,
      RopGetPropertiesList                        = 0x09,
      RopSetProperties                            = 0x0a,
      RopDeleteProperties                         = 0x0b,
      RopSaveChangesMessage                       = 0x0c,
      RopRemoveAllRecipients                      = 0x0d,
      RopModifyRecipients                         = 0x0e,
      RopReadRecipients                           = 0x0f,
      RopReloadCachedInformation                  = 0x10,
      RopSetMessageReadFlag                       = 0x11,
      RopSetColumns                               = 0x12,
      RopSortTable                                = 0x13,
      RopRestrict                                 = 0x14,
      RopQueryRows                                = 0x15,
      RopGetStatus                                = 0x16,
      RopQueryPosition                            = 0x17,
      RopSeekRow                                  = 0x18,
      RopSeekRowBookmark                          = 0x19,
      RopSeekRowFractional                        = 0x1a,
      RopCreateBookmark                           = 0x1b,
      RopCreateFolder                             = 0x1c,
      RopDeleteFolder                             = 0x1d,
      RopDeleteMessages                           = 0x1e,
      RopGetMessageStatus                         = 0x1f,
      RopSetMessageStatus                         = 0x20,
      RopGetAttachmentTable                       = 0x21,
      RopOpenAttachment                           = 0x22,
      RopCreateAttachment                         = 0x23,
      RopDeleteAttachment                         = 0x24,
      RopSaveChangesAttachment                    = 0x25,
      RopSetReceiveFolder                         = 0x26,
      RopGetReceiveFolder                         = 0x27,
      RopSpoolerRules                             = 0x28,
      RopRegisterNotification                     = 0x29,
      RopNotify                                   = 0x2a,
      RopOpenStream                               = 0x2b,
      RopReadStream                               = 0x2c,
      RopWriteStream                              = 0x2d,
      RopSeekStream                               = 0x2e,
      RopSetStreamSize                            = 0x2f,
      RopSetSearchCriteria                        = 0x30,
      RopGetSearchCriteria                        = 0x31,
      RopSubmitMessage                            = 0x32,
      RopMoveCopyMessages                         = 0x33,
      RopAbortSubmit                              = 0x34,
      RopMoveFolder                               = 0x35,
      RopCopyFolder                               = 0x36,
      RopQueryColumnsAll                          = 0x37,
      RopAbort                                    = 0x38,
      RopCopyTo                                   = 0x39,
      RopCopyToStream                             = 0x3a,
      RopCloneStream                              = 0x3b,
      RopRegisterTableNotification                = 0x3c,
      RopDeregisterTableNotification              = 0x3d,
      RopGetPermissionsTable                      = 0x3e, /* RopGetACLTable */
      RopGetRulesTable                            = 0x3f,
      RopModifyPermissions                        = 0x40,
      RopModifyRules                              = 0x41,
      RopGetOwningServers                         = 0x42,
      RopLongTermIdFromId                         = 0x43,
      RopIdFromLongTermId                         = 0x44,
      RopPublicFolderIsGhosted                    = 0x45,
      RopOpenEmbeddedMessage                      = 0x46,
      RopSetSpooler                               = 0x47,
      RopSpoolerLockMessage                       = 0x48,
      RopGetAddressTypes                          = 0x49,
      RopTransportSend                            = 0x4a,
      RopFastTransferSourceCopyMessages           = 0x4b, /* NEW */
      RopFastTransferSourceCopyFolder             = 0x4c, /* NEW */
      RopFastTransferSourceCopyTo                 = 0x4d, /* NEW */
      RopFastTransferSourceGetBuffer              = 0x4e,
      RopFindRow                                  = 0x4f,
      RopProgress                                 = 0x50,
      RopTransportNewMail                         = 0x51,
      RopGetValidAttachments                      = 0x52,
      RopFastTransferDestinationConfigure         = 0x53, /* NEW */
      RopFastTransferDestinationPutBuffer         = 0x54, /* NEW */
      RopGetNamesFromPropertyIds                  = 0x55,
      RopGetPropertyIdsFromNames                  = 0x56,
      RopUpdateDeferredActionMessages             = 0x57,
      RopEmptyFolder                              = 0x58,
      RopExpandRow                                = 0x59,
      RopCollapseRow                              = 0x5a,
      RopLockRegionStream                         = 0x5b,
      RopUnlockRegionStream                       = 0x5c,
      RopCommitStream                             = 0x5d,
      RopGetStreamSize                            = 0x5e,
      RopQueryNamedProperties                     = 0x5f,
      RopGetPerUserLongTermIds                    = 0x60,
      RopGetPerUserGuid                           = 0x61,
      RopFlushPerUser                             = 0x62,
      RopReadPerUserInformation                   = 0x63,
      RopWritePerUserInformation                  = 0x64, /* NEW */
      RopCacheCcnRead                             = 0x65,
      RopSetReadFlags                             = 0x66,
      RopCopyProperties                           = 0x67,
      RopGetReceiveFolderTable                    = 0x68,
      RopFastTransferSourceCopyProperties         = 0x69, /* NEW */
      RopFastTransferDestinationCopyProperties    = 0x6a, /* NEW */
      RopGetCollapseState                         = 0x6b,
      RopSetCollapseState                         = 0x6c,
      RopGetTransportFolder                       = 0x6d,
      RopPending                                  = 0x6e,
      RopOptionsData                              = 0x6f,
      RopSynchronizationConfigure                 = 0x70,
      RopIncrState                                = 0x71,
      RopSynchronizationImportMessageChange       = 0x72,
      RopSynchronizationImportHierarchyChange     = 0x73,
      RopSynchronizationImportDeletes             = 0x74,
      RopSynchronizationUploadStateStreamBegin    = 0x75,
      RopSynchronizationUploadStateStreamContinue = 0x76,
      RopSynchronizationUploadStateStreamEnd      = 0x77,
      RopSynchronizationImportMessageMove         = 0x78,
      RopSetPropertiesNoReplicate                 = 0x79,
      RopDeletePropertiesNoReplicate              = 0x7a,
      RopGetStoreState                            = 0x7b,
      RopGetRights                                = 0x7c,
      RopGetAllPerUserLtids                       = 0x7d,
      RopSynchronizationOpenCollector             = 0x7e,
      RopGetLocalReplicaIds                       = 0x7f,
      RopSynchronizationImportReadStateChanges    = 0x80,
      RopResetTable                               = 0x81,
      RopSynchronizationGetTransferState          = 0x82,
      RopOpenAdvisor                              = 0x83,
      RopRegICSNotifs                             = 0x84,
      RopOpenCStream                              = 0x85,
      RopTellVersion                              = 0x86, /* NEW */
      RopOpenPublicFolderByName                   = 0x87,
      RopSetSyncNotificationGuid                  = 0x88,
      RopFreeBookmark                             = 0x89,
      RopWriteAndCommitStream                     = 0x90,
      RopHardDeleteMessages                       = 0x91,
      RopHardDeleteMessagesAndSubfolders          = 0x92,
      RopSetLocalReplicaMidsetDeleted             = 0x93, /* NEW */
      RopTransportDeliverMessage                  = 0x94,
      RopTransportDoneWithMessage                 = 0x95,
      RopIdFromLegacyDN                           = 0x96,
      RopSetAuthenticatedContext                  = 0x97,
      RopCopyToEx                                 = 0x98,
      RopImportMsgChangePartial                   = 0x99,
      RopSetMessageFlags                          = 0x9a,
      RopMoveCopyMessagesEx                       = 0x9b,
      RopFXSrcGetBufferEx                         = 0x9c,
      RopFXDstPutBufferEx                         = 0x9d,
      RopTransportDeliverMessage2                 = 0x9e,
      RopCreateMessageEx                          = 0x9f,
      RopMoveCopyMessagesEID                      = 0xA0,
      RopTransportDupDlvCheck                     = 0xA1,
      RopPrereadMessages                          = 0xA2,
      RopWriteStreamExtended                      = 0xA3,
      RopGetContentsTableExtended                 = 0xA4,
      RopStartScope                               = 0xA5,
      RopEndScope                                 = 0xA6,
      RopEchoString                               = 0xC8,
      RopEchoInt                                  = 0xC9,
      RopEchoBinary                               = 0xCA,
      RopBackoff                                  = 0xF9, /* NEW */
      RopExtendedError                            = 0xFA, /* NEW */
      RopBookmarkReturned                         = 0xFB,
      RopFidReturned                              = 0xFC,
      RopHsotReturned                             = 0xFd,
      RopLogon                                    = 0xFE,
      RopBufferTooSmall                           = 0xFF
    } ROP_OPNUM;

  typedef [public,noprint,flag(NDR_NOALIGN)] struct {
    uint16        cb;
    [flag(NDR_BUFFERS), size_is(cb)] uint8  lpb[];
  } SBinary_short;

  typedef [public] struct {
    uint32 cValues;
    [size_is(cValues)] uint32 lpl[];
  } mapi_MV_LONG_STRUCT;

  typedef [public] struct {
    astring lppszA;
  } mapi_LPSTR;

  typedef [public] struct {
    uint32 cValues;
    [size_is(cValues)] mapi_LPSTR strings[];
  } mapi_SLPSTRArray;

  typedef struct {
    [flag(STR_NULLTERM)] string lppszW;
  } mapi_LPWSTR;

  typedef struct {
    uint32 cValues;
    [size_is(cValues)] mapi_LPWSTR strings[];
  } mapi_SPLSTRArrayW;

  typedef [public] struct {
    uint32    cValues;
    [size_is(cValues)] SBinary_short bin[];
  } mapi_SBinaryArray;

  typedef struct {
    uint32    cValues;
    [size_is(cValues)] GUID    lpguid[];
  } mapi_SGuidArray;

  /******* part of the no-pointer deep recursion hack *******/
  typedef [nopull,nopush,noprint,flag(NDR_NOALIGN)] struct {
    uint8 wrap[0x8000];
  } mapi_SRestriction_wrap;

  typedef [nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
    uint8 wrap[0x8000];
  } mapi_SPropValue_wrap;

  typedef [nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
    uint8 wrap[0x8000];
  } mapi_SPropValue_array_wrap;
  /**********************************************************/

  typedef [enum8bit] enum {
    ActionType_OP_MOVE    = 0x1,
    ActionType_OP_COPY    = 0x2,
    ActionType_OP_REPLY   = 0x3,
    ActionType_OP_OOF_REPLY   = 0x4,
    ActionType_OP_DEFER_ACTION  = 0x5,
    ActionType_OP_BOUNCE    = 0x6,
    ActionType_OP_FORWARD   = 0x7,
    ActionType_OP_DELEGATE    = 0x8,
    ActionType_OP_TAG   = 0x9,
    ActionType_OP_DELETE    = 0xA,
    ActionType_OP_MARK_AS_READ  = 0xB
  } ActionType;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8    FolderInThisStore;
    SBinary_short   StoreEID;
    SBinary_short   FolderEID;
  } MoveCopy_Action;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper     ReplyTemplateFID;
    hyper     ReplyTemplateMID;
    GUID      ReplyTemplateGUID;
  } ReplyOOF_Action;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8       Reserved;
    mapi_SPropValue_array_wrap  PropertyValue;
  } RecipientBlock;

  typedef [flag(NDR_NOALIGN)] enum {
    BOUNCE_MESSAGE_TOO_LARGE  = 0x0000000d,
    BOUNCE_MESSAGE_NOT_DISPLAYED  = 0x0000001f,
    BOUNCE_MESSAGE_DENIED   = 0x00000026
  } BounceCode;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16      RecipientCount;
    [size_is(RecipientCount)] RecipientBlock    RecipientBlock[];
  } ForwardDelegate_Action;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(ActionType_OP_MOVE)]    MoveCopy_Action     MoveAction;
    [case(ActionType_OP_COPY)]    MoveCopy_Action     CopyAction;
    [case(ActionType_OP_REPLY)]   ReplyOOF_Action     ReplyAction;
    [case(ActionType_OP_OOF_REPLY)]   ReplyOOF_Action     ReplyOOFAction;
    [case(ActionType_OP_DEFER_ACTION)][flag(NDR_REMAINING)] DATA_BLOB DeferAction;
    [case(ActionType_OP_BOUNCE)]    BounceCode      BounceCode;
    [case(ActionType_OP_TAG)]   mapi_SPropValue_wrap          PropValue;
    [case(ActionType_OP_FORWARD)]   ForwardDelegate_Action    ForwardAction;
    [case(ActionType_OP_DELEGATE)]    ForwardDelegate_Action    DelegateAction;
    [case(ActionType_OP_DELETE)];
    [case(ActionType_OP_MARK_AS_READ)];
  } ActionData;

  typedef [flag(NDR_NOALIGN)] struct {
    ActionType      ActionType;
    uint32          ActionFlavor;
    uint32          ActionFlags;
    [switch_is(ActionType)] ActionData  ActionDataBuffer;
  } ActionBlockData;

  typedef [flag(NDR_NOALIGN)] struct {
    [flag(NDR_REMAINING)] [represent_as(uint16)] ActionBlockData ActionBlockData;
  } ActionBlock;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    count;
    [size_is(count)] ActionBlock ActionBlock[];
  } RuleAction;

   typedef struct {
     [range(0,100000)] uint32  cValues;
     [size_is(cValues)] uint16 *lpi;
   } ShortArray_r;
  
   typedef struct {
     [range(0,100000)] uint32  cValues;
     [size_is(cValues)] uint32 *lpl;
   } LongArray_r;
  
   typedef struct {
     [range(0,100000)] uint32  cValues;
     [size_is(cValues)] Binary_r *lpbin;
   } BinaryArray_r;
  
   typedef struct {
     [range(0,100000)] uint32  cValues;
     [size_is(cValues)] FILETIME *lpft;
   } DateTimeArray_r;
  
  typedef [public] struct {
   [range(0,2097152)] uint32       cb;
   [size_is(cb)] uint8   *lpb;
  } Binary_r;

  typedef [switch_type(uint32)] union {
    [case(PT_I2)]     uint16      i;
    [case(PT_LONG)]     uint32      l;
    [case(PT_DOUBLE)]   dlong     dbl;
    [case(PT_BOOLEAN)]    uint8     b;
    [case(PT_I8)]     dlong     d;
    [case(PT_STRING8)][unique][string,charset(DOS)] uint8 *lpszA;
    [case(PT_BINARY)]   Binary_r          bin;
    [case(PT_SVREID)]       SBinary_short   svreid;
    [case(PT_UNICODE)][string,charset(UTF16)] uint16  *lpszW;
    [case(PT_CLSID)]    GUID         *lpguid;
    [case(PT_SRESTRICT)]  mapi_SRestriction_wrap  Restrictions;
    [case(PT_ACTIONS)]  RuleAction    RuleAction;
    [case(PT_SYSTIME)]    FILETIME    ft;
    [case(PT_ERROR)]    MAPISTATUS    err;
    [case(PT_MV_I2)]    ShortArray_r    MVi;
    [case(PT_MV_LONG)]    LongArray_r   MVl;
    [case(PT_MV_STRING8)]   mapi_SLPSTRArray   MVszA;
    [case(PT_MV_BINARY)]    mapi_SBinaryArray   MVbin;
    [case(PT_MV_CLSID)]   mapi_SGuidArray    MVguid;
    [case(PT_MV_UNICODE)]   mapi_SPLSTRArrayW    MVszW;
    [case(PT_MV_SYSTIME)]   DateTimeArray_r   MVft;
    [case(PT_NULL)]     uint32      null;
    [case(PT_OBJECT)]   uint32      object;
  } mapi_SPropValue_CTR;

  typedef [public,flag(NDR_NOALIGN)] struct {
    MAPITAGS ulPropTag;
    [switch_is(ulPropTag & 0xFFFF)] mapi_SPropValue_CTR value;
  } mapi_SPropValue;

  typedef [public,flag(NDR_NOALIGN)] struct {
    uint16          cValues;
    [flag(NDR_REMAINING), size_is(cValues)]mapi_SPropValue  lpProps[];
  } mapi_SPropValue_array;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16          cValues;
    [size_is(cValues)] MAPITAGS        aulPropTag[];
  } mapi_SPropTagArray;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    ROW_ADD   = 0x1,
    ROW_MODIFY  = 0x2,
    ROW_REMOVE  = 0x4
  } ulRowFlags;

  /**************************/
  /* ROP: RopRelease(0x1) */
  typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } Release_req;

  typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
  } Release_repl;

  /**************************/
  /* ROP: RopOpenFolder(0x2) */
  typedef [enum8bit] enum {
    OpenModeFlags_Folder    = 0x0,
    OpenModeFlags_SoftDeleted = 0x4
  } OpenFolder_OpenModeFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    hyper   FolderId;
    OpenFolder_OpenModeFlags  OpenModeFlags;
  } OpenFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ServerCount;
    uint16    CheapServerCount;
    [size_is(ServerCount)]  astring   Servers[];
  } OpenFolder_Replicas;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)] OpenFolder_Replicas Replicas;
  } IsGhosted;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8               HasRules;
    boolean8               IsGhosted;
    [switch_is(IsGhosted)] IsGhosted  Ghost;
  } OpenFolder_Success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] OpenFolder_Success Success;
    [default];
  } OpenFolder_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8                  OutputHandleIndex;
    uint32                 ReturnValue;
    [switch_is(ReturnValue)] OpenFolder_repl_status  repl;
  } OpenFolder_repl;

  /**************************/
  /* ROP: RopOpenMessage(0x3) */
  typedef [enum8bit] enum {
    StringType_NONE     = 0x0,
    StringType_EMPTY    = 0x1,
    StringType_STRING8    = 0x2,
    StringType_UNICODE_REDUCED  = 0x3,
    StringType_UNICODE    = 0x4
  } StringType;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)];
    [case(0x2)] astring     lpszA;
    [case(0x3)] astring     lpszW_reduced;
    [case(0x4)] [flag(STR_NULLTERM)] string lpszW;
  } String;

  typedef [flag(NDR_NOALIGN)] struct {
    StringType      StringType;
    [switch_is(StringType)] String  String;
  } TypedString;

  typedef [enum8bit] enum {
    ReadOnly  = 0x0,
    ReadWrite = 0x1,
    Create    = 0x3,
    OpenSoftDelete  = 0x4
  } OpenMessage_OpenModeFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    uint16      CodePageId;
    hyper       FolderId;
    OpenMessage_OpenModeFlags OpenModeFlags;
    hyper       MessageId;
  } OpenMessage_req;

  typedef [enum16bit, flag(NDR_PAHEX)] enum {
    CP_USASCII  = 0x04E4,
    CP_UNICODE  = 0x04B0,
    CP_JAUTODETECT  = 0xC6F4,
    CP_KAUTODETECT  = 0xC705,
    CP_ISO2022JPESC = 0xC42D,
    CP_ISO2022JPSIO = 0xC42E
  } CODEPAGEID;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    MAPI_ORIG   = 0x0,
    MAPI_TO     = 0x1,
    MAPI_CC     = 0x2,
    MAPI_BCC    = 0x3
  } ulRecipClass;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    SINGLE_RECIPIENT  = 0x0,
    DISTRIBUTION_LIST = 0x1
  } addr_type;

  typedef  [flag(NDR_NOALIGN)]struct {
    uint8   organization_length;
    addr_type addr_type;
    astring   username;
  } RecipExchange;

  typedef [flag(NDR_NOALIGN)] struct {
  } RecipSMTP;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x1)] RecipExchange EXCHANGE;
    [case(0x3)] RecipSMTP   SMTP;
    [default];
  } recipient_type;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x400)] astring       lpszA;
    [case(0x600)][flag(STR_NULLTERM)] string  lpszW;
    [default];
  } recipient_SimpleDisplayName;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x60)];
    [case(0x260)];
    [case(0x20)] astring        lpszA;
    [case(0x220)][flag(STR_NULLTERM)] string  lpszW;
    [default];
  } recipient_TransmittableDisplayName;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x10)] astring        lpszA;
    [case(0x210)][flag(STR_NULLTERM)] string  lpszW;
    [default];
  } recipient_DisplayName;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x8)] astring       lpszA;
    [case(0x208)][flag(STR_NULLTERM)] string  lpszW;
    [default];
  } recipient_EmailAddress;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16                  RecipientFlags;
    [switch_is(RecipientFlags & 0x7)]   recipient_type      type;
    [switch_is(RecipientFlags & 0x208)] recipient_EmailAddress          EmailAddress;
    [switch_is(RecipientFlags & 0x210)] recipient_DisplayName   DisplayName;
    [switch_is(RecipientFlags & 0x600)] recipient_SimpleDisplayName     SimpleDisplayName;
    [switch_is(RecipientFlags & 0x260)] recipient_TransmittableDisplayName  TransmittableDisplayName;
    uint16                  prop_count;
    uint8                 layout;
    [flag(NDR_REMAINING)] DATA_BLOB           prop_values;
  } RecipientRow;

  typedef [flag(NDR_NOALIGN)] struct {
    ulRecipClass  RecipClass;
    CODEPAGEID  codepage;
    uint16    Reserved;
    [represent_as(uint16)] RecipientRow  RecipientRow;
  } OpenMessage_recipients;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8    HasNamedProperties;
    TypedString   SubjectPrefix;
    TypedString   NormalizedSubject;
    uint16      RecipientCount;
    uint16      ColumnCount;
    mapi_SPropTagArray  RecipientColumns;
    uint8     RowCount;
    [size_is(RowCount)] OpenMessage_recipients  recipients[];
  } OpenMessage_Success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] OpenMessage_Success Success;
    [default];
  } OpenMessage_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8                  OutputHandleIndex;
    uint32                 ReturnValue;
    [switch_is(ReturnValue)] OpenMessage_repl_status  repl;
  } OpenMessage_repl;

  /**************************/
  /* ROP: RopGetHierarchyTable(0x4) */
  typedef [bitmap8bit] bitmap {
    TableFlags_Depth      = 0x4,
    TableFlags_DeferredErrors   = 0x8,
    TableFlags_NoNotifications    = 0x10,
    TableFlags_SoftDeletes      = 0x20,
    TableFlags_UseUnicode     = 0x40,
    TableFlags_SuppressNotifications  = 0x80
  } TableFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    TableFlags  TableFlags;
  } GetHierarchyTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    RowCount;
  } GetHierarchyTable_repl_success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] GetHierarchyTable_repl_success Success;
    [default];
  } GetHierarchyTable_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8     OutputHandleIndex;
    uint32    ReturnValue;
    [switch_is(ReturnValue)] GetHierarchyTable_repl_status  repl;
  } GetHierarchyTable_repl;

  /**************************/
  /* ROP: RopGetContentsTable(0x5) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    TableFlags  TableFlags;
  } GetContentsTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    RowCount;
  } GetContentsTable_repl_success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] GetContentsTable_repl_success Success;
    [default];
  } GetContentsTable_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   OutputHandleIndex;
    uint32  ReturnValue;
    [switch_is(ReturnValue)] GetContentsTable_repl_status  repl;
  } GetContentsTable_repl;

  /**************************/
  /* ROP: RopCreateMessage(0x6) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    uint16    CodePageId;
    hyper   FolderId;
    boolean8  AssociatedFlag;
  } CreateMessage_req;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)] hyper MessageId;
  } CreateMessage_MessageId;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  HasMessageId;
    [switch_is(HasMessageId)] CreateMessage_MessageId MessageId;
  } CreateMessage_repl_success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] CreateMessage_repl_success Success;
    [default];
  } CreateMessage_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8     OutputHandleIndex;
    uint32    ReturnValue;
    [switch_is(ReturnValue)] CreateMessage_repl_status  repl;
  } CreateMessage_repl;

  /*************************/
  /* ROP: RopGetPropertiesSpecific(0x7) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    PropertySizeLimit;
    uint16    WantUnicode;
    uint16    prop_count;
    [size_is(prop_count)] MAPITAGS  properties[];
  } GetProps_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   layout;
    [flag(NDR_REMAINING)] DATA_BLOB prop_data;
  } GetProps_repl_success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] GetProps_repl_success Success;
    [default];
  } GetProps_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   InputHandleIndex;
    uint32  ReturnValue;
    [switch_is(ReturnValue)] GetProps_repl_status  repl;
  } GetProps_repl;

  /*************************/
  /* ROP: RopGetPropertiesAll(0x8) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    PropertySizeLimit;
    uint16    WantUnicode;
  } GetPropsAll_req;

  typedef [flag(NDR_NOALIGN)] struct {
    mapi_SPropValue_array properties;
  } GetPropsAll_repl_success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] GetPropsAll_repl_success Success;
    [default];
  } GetPropsAll_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   InputHandleIndex;
    uint32  ReturnValue;
    [switch_is(ReturnValue)] GetPropsAll_repl_status  repl;
  } GetPropsAll_repl;

  /*************************/
  /* ROP: RopGetPropertiesList(0x9) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetPropList_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    count;
    [size_is(count)] MAPITAGS  tags[];
  } GetPropList_repl;

  /*************************/
  /* ROP: RopSetProperties(0xa) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint32    index;    /* index into array of property tags */
    MAPITAGS  property_tag; /* property for which there was an error */
    MAPISTATUS  error_code;   /* the error that occurred for this property */
  } PropertyProblem;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [represent_as(uint16)] mapi_SPropValue_array values;
  } SetProps_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } SetProps_repl;

  /*************************/
  /* ROP: RopDeleteProperties(0xb) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    PropertyTagCount;
    [size_is(PropertyTagCount)] MAPITAGS  tags[];
  } DeleteProps_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } DeleteProps_repl;

  /*************************/
  /* ROP: RopSaveChangesMessage(0xc) */
  typedef [enum8bit] enum {
    KeepOpenReadOnly  = 0x9,
    KeepOpenReadWrite = 0xA,
    ForceSave   = 0xC
  } SaveFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   ResponseHandleIndex;
    uint8   InputHandleIndex;
    uint8   SaveFlags;
  } SaveChangesMessage_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   handle_idx;
    hyper   MessageId;
  } SaveChangesMessage_repl;

  /*************************/
  /* ROP: RopRemoveAllRecipients(0xd) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    ulReserved;
  } RemoveAllRecipients_req;

  typedef [flag(NDR_NOALIGN)] struct {

  } RemoveAllRecipients_repl;

  /*************************/
  /* ROP: RopModifyRecipients(0xe) */

  /*
   * MODRECIP_NULL and INVALID are not part of the msdn flags
   * but are added for printing support
   */
  typedef [enum8bit,flag(NDR_PAHEX)] enum {
    MODRECIP_NULL   = 0x0,
    MODRECIP_INVALID  = 0x1,
    MODRECIP_ADD    = 0x2,
    MODRECIP_MODIFY   = 0x4,
    MODRECIP_REMOVE   = 0x8
  } modrecip;

  typedef [flag(NDR_NOALIGN)]struct {
    uint32    idx;
    ulRecipClass  RecipClass;
    [represent_as(uint16),flag(NDR_REMAINING)] RecipientRow RecipientRow;
  } ModifyRecipientRow;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16        prop_count;
    [size_is(prop_count)] MAPITAGS      properties[];
    uint16        cValues;
    [size_is(cValues)] ModifyRecipientRow        RecipientRow[];
  } ModifyRecipients_req;

  typedef [flag(NDR_NOALIGN)] struct {

  } ModifyRecipients_repl;

  /*************************/
  /* ROP: RopReadRecipients(0xf) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    RowId;
    uint16    ulReserved;
  } ReadRecipients_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32        RowId;
    ulRecipClass      RecipientType;
    uint16        CodePageId;
    uint16        ulReserved;
    [represent_as(uint16)] RecipientRow  RecipientRow;
  } ReadRecipientRow;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8     RowCount;
    [size_is(RowCount)] ReadRecipientRow  RecipientRows[];
  } ReadRecipients_repl;

  /*************************/
  /* ROP: RopReloadCachedInformation(0x10) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    ulRecipClass    RecipientType;
    uint16      CodePageId;
    uint16      Reserved;
    [represent_as(uint16),flag(NDR_REMAINING)]RecipientRow       RecipientRow;
  } OpenRecipientRow;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    Reserved;
  } ReloadCachedInformation_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8    HasNamedProperties;
    TypedString   SubjectPrefix;
    TypedString   NormalizedSubject;
    uint16      RecipientCount;
    mapi_SPropTagArray  RecipientColumns;
    uint8     RowCount;
    [size_is(RowCount)] OpenRecipientRow  RecipientRows[];
  } ReloadCachedInformation_repl;

  /*************************/
  /* ROP: RopSetMessageReadFlag(0x11) */
  typedef [bitmap8bit] bitmap {
    SUPPRESS_RECEIPT  = 0x01,
    CLEAR_READ_FLAG   = 0x04,
    MAPI_DEFERRED_ERRORS  = 0x08,
    GENERATE_RECEIPT_ONLY = 0x10,
    CLEAR_RN_PENDING  = 0x20,
    CLEAR_NRN_PENDING = 0x40
  } MSGFLAG_READ;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   ResponseHandleIndex;
    uint8   InputHandleIndex;
    MSGFLAG_READ      ReadFlags;
    [flag(NDR_REMAINING)] DATA_BLOB clientdata;
  } SetMessageReadFlag_req;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)] uint8 LogonId;
  } SetMessageReadFlag_LogonId;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)] uint8 ClientData[24];
  } SetMessageReadFlag_ClientData;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8              ReadStatusChanged;
    [switch_is(ReadStatusChanged)] SetMessageReadFlag_LogonId LogonId;
    [switch_is(ReadStatusChanged)] SetMessageReadFlag_ClientData  ClientData;
  } SetMessageReadFlag_repl;

  /*************************/
  /* ROP: RopSetColumns(0x12) */
  typedef [enum8bit] enum {
    SetColumns_TBL_SYNC = 0x0,
    SetColumns_TBL_ASYNC  = 0x1
  } SetColumnsFlags;

  typedef [enum8bit] enum {
    TBLSTAT_COMPLETE  = 0x0,
    TBLSTAT_SORTING   = 0x9,
    TBLSTAT_SORT_ERROR  = 0xA,
    TBLSTAT_SETTING_COLS  = 0xB,
    TBLSTAT_SETCOL_ERROR  = 0xD,
    TBLSTAT_RESTRICTING = 0xE,
    TBLSTAT_RESTRICT_ERROR  = 0xF
  } TableStatus;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SetColumnsFlags SetColumnsFlags;
    uint16    prop_count;
    [size_is(prop_count)] MAPITAGS  properties[];
  } SetColumns_req;

  typedef [flag(NDR_NOALIGN)] struct {
    TableStatus TableStatus;
  } SetColumns_repl;

  /**************************/
  /* ROP: RopSortTable(0x13) */
  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    TBL_ASYNC = 0x1,
    TBL_BATCH = 0x2
  } TBL_FLAGS;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    TABLE_SORT_ASCEND = 0x0,
    TABLE_SORT_COMBINE = 0x1,
    TABLE_SORT_DESCEND = 0x2
  } TABLE_SORT;

  typedef [public, flag(NDR_NOALIGN)] struct _SSortOrder{
    MAPITAGS ulPropTag;
    TABLE_SORT ulOrder;
  } SSortOrder;

  typedef [public, flag(NDR_NOALIGN)] struct _SSortOrderSet {
    uint16    cSorts;
    uint16    cCategories;
    uint16    cExpanded;
    [size_is(cSorts)] SSortOrder  aSort[];
  } SSortOrderSet;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   SortTableFlags;
    SSortOrderSet lpSortCriteria;
  } SortTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
    TableStatus TableStatus;
  } SortTable_repl;

  /**************************/
  /* ROP: RopRestrict(0x14) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16      cRes;
    [size_is(cRes)] SRestriction_and res[];
  } mapi_SAndRestriction;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16  cRes;
    [size_is(cRes)] SRestriction_or  res[];
  } mapi_SOrRestriction;

  typedef [flag(NDR_NOALIGN)] struct {
    mapi_SRestriction_wrap  res;
  } mapi_SNotRestriction;

  typedef [noprint, bitmap32bit] bitmap {
    FL_FULLSTRING   = 0x00000,
    FL_SUBSTRING    = 0x00001,
    FL_PREFIX   = 0x00002,
    FL_IGNORECASE   = 0x10000,
    FL_IGNORENONSPACE = 0x20000,
    FL_LOOSE    = 0x40000
  } fuzzyLevel;

  typedef [flag(NDR_NOALIGN)] struct {
    fuzzyLevel  fuzzy;
    MAPITAGS  ulPropTag;
    mapi_SPropValue lpProp;
  } mapi_SContentRestriction;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    BMR_EQZ = 0x0,
    BMR_NEZ = 0x1
  } relMBR;

  typedef [flag(NDR_NOALIGN)] struct {
    relMBR    relMBR;
    MAPITAGS  ulPropTag;
    uint32    ulMask;
  } mapi_SBitmaskRestriction;

  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    RELOP_LT = 0x0,   /* <  */
    RELOP_LE = 0x1,   /* <= */
    RELOP_GT = 0x2,   /* >  */
    RELOP_GE = 0x3,   /* >= */
    RELOP_EQ = 0x4,   /* == */
    RELOP_NE = 0x5,   /* != */
    RELOP_RE = 0x6    /* LIKE (Regular expression) */
  } CompareRelop;

  typedef [flag(NDR_NOALIGN)] struct {
    CompareRelop  relop;
    MAPITAGS  ulPropTag;
    uint32    size;
  } mapi_SSizeRestriction;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   relop;
    MAPITAGS  ulPropTag;
    mapi_SPropValue lpProp;
  } mapi_SPropertyRestriction;

  typedef [flag(NDR_NOALIGN)] struct {
    CompareRelop    relop;
    MAPITAGS  ulPropTag1;
    MAPITAGS  ulPropTag2;
  } mapi_SCompareProps;

  typedef [flag(NDR_NOALIGN)] struct {
    MAPITAGS  ulPropTag;
  } mapi_SExistRestriction;

  typedef [flag(NDR_NOALIGN)] struct {
    MAPITAGS          ulSubObject;
    [size_is(ulSubObject - ulSubObject + 1)]  SRestriction_sub res[]; /* nasty hack - generates fake pointer */
  } mapi_SSubRestriction;

  typedef [nopush,nopull,noprint,nodiscriminant] union {
    [case(0x0)];
    [case(0x1)] SRestriction_comment *res;
  } RestrictionVariable;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8       TaggedValuesCount;
    [size_is(TaggedValuesCount)] mapi_SPropValue     TaggedValues[];
    boolean8      RestrictionPresent;
    [switch_is(RestrictionPresent)] RestrictionVariable Restriction;
  } mapi_SCommentRestriction;

  typedef [public,nodiscriminant] union {
    [case(RES_AND)]     mapi_SAndRestriction    resAnd;
    [case(RES_OR)]      mapi_SOrRestriction   resOr;
    [case(RES_NOT)]     mapi_SNotRestriction    resNot;
    [case(RES_CONTENT)]   mapi_SContentRestriction  resContent;
    [case(RES_PROPERTY)]    mapi_SPropertyRestriction resProperty;
    [case(RES_COMPAREPROPS)]  mapi_SCompareProps    resCompareProps;
    [case(RES_BITMASK)]   mapi_SBitmaskRestriction  resBitmask;
    [case(RES_SIZE)]    mapi_SSizeRestriction   resSize;
    [case(RES_EXIST)]   mapi_SExistRestriction    resExist;
    [case(RES_SUBRESTRICTION)]  mapi_SSubRestriction    resSub;
    [case(RES_COMMENT)]   mapi_SCommentRestriction  resComment;
    [default];
  } mapi_SRestriction_CTR;

  typedef [public,flag(NDR_NOALIGN)] struct {
    uint8 rt;
    [switch_is(rt)] mapi_SRestriction_CTR res;
  } mapi_SRestriction;

  typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction_and {
    uint8 rt;
    [switch_is(rt)] mapi_SRestriction_CTR res;
  } SRestriction_and;

  typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction_or {
    uint8 rt;
    [switch_is(rt)] mapi_SRestriction_CTR res;
  } SRestriction_or;

  typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction_sub {
    uint8 rt;
    [switch_is(rt)] mapi_SRestriction_CTR res;
  } SRestriction_sub;

  typedef [public,flag(NDR_NOALIGN)] struct _mapi_SRestriction_comment {
    uint8 rt;
    [switch_is(rt)] mapi_SRestriction_CTR res;
  } SRestriction_comment;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8 handle_idx;
    [represent_as(uint16)] mapi_SRestriction  restrictions;
  } Restrict_req;

  typedef [flag(NDR_NOALIGN)] struct {
    TableStatus TableStatus;
  } Restrict_repl;

  /**************************/
  /* ROP: RopQueryRows(0x15) */
  typedef [enum8bit] enum {
    TBL_ADVANCE   = 0x0,
    TBL_NOADVANCE   = 0x1,
    TBL_ENABLEPACKEDBUFFERS = 0x2
  } QueryRowsFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    QueryRowsFlags  QueryRowsFlags;
    uint8   ForwardRead;
    uint16    RowCount;
  } QueryRows_req;

  typedef [nopush,nopull,flag(NDR_NOALIGN)] struct {
    uint8   Origin;
    uint16    RowCount;
    [flag(NDR_REMAINING)]DATA_BLOB  RowData;
  } QueryRows_repl;

  /**************************/
  /* ROP: RopGetStatus(0x16) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetStatus_req;

  typedef [flag(NDR_NOALIGN)] struct {
    TableStatus TableStatus;
  } GetStatus_repl;

  /**************************/
  /* ROP: RopQueryPosition(0x17) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } QueryPosition_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32  Numerator;
    uint32  Denominator;
  } QueryPosition_repl;

  /**************************/
  /* ROP: RopSeekRow(0x18) */
  typedef [enum8bit] enum {
    BOOKMARK_BEGINNING  = 0x0,
    BOOKMARK_CURRENT  = 0x1,
    BOOKMARK_END    = 0x2,
    BOOKMARK_USER   = 0x3
  } BOOKMARK;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    BOOKMARK  origin;
    int32   offset;
    boolean8  WantRowMovedCount;
  } SeekRow_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  HasSoughtLess;
    uint32    RowsSought;
  } SeekRow_repl;

  /**************************/
  /* ROP: RopSeekRowBookmark(0x19) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SBinary_short Bookmark;
    uint32    RowCount;
    boolean8  WantRowMovedCount;
  } SeekRowBookmark_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  RowNoLongerVisible;
    boolean8  HasSoughtLess;
    uint32    RowsSought;
  } SeekRowBookmark_repl;

  /**************************/
  /* ROP: RopSeekRowFractional(0x1a) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    ulNumerator;
    uint32    ulDenominator;
  } SeekRowApprox_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SeekRowApprox_repl;

  /**************************/
  /* ROP: RopCreateBookmark(0x1b) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } CreateBookmark_req;

  typedef [flag(NDR_NOALIGN)] struct {
    SBinary_short bookmark;
  } CreateBookmark_repl;

  /**************************/
  /* ROP: RopCreateFolder(0x1c) */
  typedef [enum8bit] enum {
    FOLDER_GENERIC  = 0x1,
    FOLDER_SEARCH = 0x2
  } FOLDER_TYPE;

  typedef [enum8bit] enum {
    MAPI_FOLDER_ANSI        = 0x0,
    MAPI_FOLDER_UNICODE     = 0x1
  } FOLDER_STRING;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(MAPI_FOLDER_ANSI)] astring      lpszA;
    [case(MAPI_FOLDER_UNICODE)][flag(STR_NULLTERM)] string  lpszW;
  } LPTSTR;

  typedef [enum16bit] enum {
    NONE    = 0x0000,
    OPEN_IF_EXISTS  = 0x0001
  } FOLDER_FLAGS;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    FOLDER_TYPE     ulFolderType;
    FOLDER_STRING     ulType;
    FOLDER_FLAGS            ulFlags;
    [switch_is(ulType)] LPTSTR  FolderName;
    [switch_is(ulType)] LPTSTR  FolderComment;
  } CreateFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        HasRules;
    boolean8        IsGhosted;
    [switch_is(IsGhosted)] IsGhosted  Ghost;
  } CreateFolder_GhostInfo;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [case(0x1)] CreateFolder_GhostInfo  GhostInfo;
  } CreateFolder_GhostUnion;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper             folder_id;
    boolean8            IsExistingFolder;
    [switch_is(IsExistingFolder)] CreateFolder_GhostUnion GhostUnion;
  } CreateFolder_repl;

  /**************************/
  /* ROP: RopDeleteFolder(0x1d) */
  typedef [bitmap8bit] bitmap {
    DEL_MESSAGES    = 0x1,
    DEL_FOLDERS   = 0x4,
    DELETE_HARD_DELETE  = 0x10
  } DeleteFolderFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    DeleteFolderFlags       DeleteFolderFlags;
    hyper     FolderId;
  } DeleteFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8    PartialCompletion;
  } DeleteFolder_repl;

  /**************************/
  /* ROP: RopDeleteMessages(0x1e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantAsynchronous;
    boolean8  NotifyNonRead;
    uint16    cn_ids;
    [size_is(cn_ids)] hyper   message_ids[];
  } DeleteMessages_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  PartialCompletion;
  } DeleteMessages_repl;

  /**************************/
  /* ROP: RopGetMessageStatus(0x1f) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   msgid;
  } GetMessageStatus_req;

  /**************************/
  /* ROP: RopSetMessageStatus(0x20) */
  typedef [bitmap32bit] bitmap {
    MSGSTATUS_HIGHLIGHTED   = 0x1,
    MSGSTATUS_TAGGED    = 0x2,
    MSGSTATUS_HIDDEN    = 0x4,
    MSGSTATUS_DELMARKED   = 0x8,
    MSGSTATUS_REMOTE_DOWNLOAD = 0x1000,
    MSGSTATUS_REMOTE_DELETE   = 0x2000
  } ulMessageStatus;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   msgid;
    uint32    ulNewStatus;
    ulMessageStatus ulNewStatusMask;
  } SetMessageStatus_req;

  typedef [flag(NDR_NOALIGN)] struct {
    ulMessageStatus ulOldStatus;
  } SetMessageStatus_repl;

  /**************************/
  /* ROP: RopGetAttachmentTable(0x21) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    TableFlags  TableFlags;
  } GetAttachmentTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } GetAttachmentTable_repl;

  /*************************/
  /* ROP: RopOpenAttachment(0x22) */
  typedef [enum8bit] enum {
    OpenAttachmentFlags_ReadOnly  = 0x0,
    OpenAttachmentFlags_ReadWrite = 0x1,
    OpenAttachmentFlags_BestAccess  = 0x3
  } OpenAttachmentFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    OpenAttachmentFlags OpenAttachmentFlags;
    uint32      AttachmentID;
  } OpenAttach_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } OpenAttach_repl;

  /*************************/
  /* ROP: RopCreateAttachment(0x23) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
  } CreateAttach_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32  AttachmentID;
  } CreateAttach_repl;

  /*************************/
  /* ROP: RopDeleteAttachment(0x24) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    AttachmentID;
  } DeleteAttach_req;


  typedef [flag(NDR_NOALIGN)] struct {
  } DeleteAttach_repl;

  /*************************/
  /* ROP: RopSaveChangesAttachment(0x25) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   ResponseHandleIndex;
    uint8   InputHandleIndex;
    SaveFlags SaveFlags;
  } SaveChangesAttachment_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SaveChangesAttachment_repl;

  /*************************/
  /* ROP: RopSetReceiveFolder(0x26) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   fid;
    astring   lpszMessageClass;
  } SetReceiveFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SetReceiveFolder_repl;

  /*************************/
  /* ROP: RopGetReceiveFolder(0x27) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    astring   MessageClass;
  } GetReceiveFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   folder_id;
    astring   MessageClass;
  } GetReceiveFolder_repl;

  /*************************/
  /* ROP: RopRegisterNotification(0x29) */
  typedef [enum16bit] enum {
    fnevCriticalError   = 0x0001,
    fnevNewMail     = 0x0002,
    fnevObjectCreated   = 0x0004,
    fnevObjectDeleted   = 0x0008,
    fnevObjectModified    = 0x0010,
    fnevObjectMoved     = 0x0020,
    fnevObjectCopied    = 0x0040,
    fnevSearchComplete    = 0x0080,
    fnevTableModified   = 0x0100,
    fnevStatusObjectModified  = 0x0200,
    fnevReserved      = 0x0400,
    fnevTbit            = 0x1000,
    fnevUbit      = 0x2000,
    fnevSbit      = 0x4000,
    fnevMbit      = 0x8000
  } NotificationFlags;

  typedef [nodiscriminant,flag(NDR_NOALIGN)] union {
    [case(0x0)] hyper ID;
    [case(0x1)];
  } hyperbool;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    NotificationFlags     notificationFlags;
    uint8   layout;
    [switch_is(layout)] hyperbool u;
  } RegisterNotification_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } RegisterNotification_repl;

  /*************************/
  /* ROP: RopNotify(0x2a) */
  typedef [bitmap32bit] bitmap {
    MSGFLAG_READ    = 0x1,
    MSGFLAG_UNMODIFIED  = 0x2,
    MSGFLAG_SUBMIT    = 0x4,
    MSGFLAG_UNSENT    = 0x8,
    MSGFLAG_HASATTACH = 0x10,
    MSGFLAG_FROMME    = 0x20,
    MSGFLAG_ASSOCIATED  = 0x40,
    MSGFLAG_RESEND    = 0x80,
    MSGFLAG_RN_PENDING  = 0x100,
    MSGFLAG_NRN_PENDING = 0x200
  } MsgFlags;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] astring     lpszA;
    [case(0x1)][flag(STR_NULLTERM)] string  lpszW;
  } MessageClass;

  typedef [flag(NDR_NOALIGN)] struct {
    GUID    DatabaseGUID;
    uint8   GlobalCounter[6];
  } GID;

  typedef [enum16bit] enum {
    TABLE_CHANGED   = 0x1,
    TABLE_ROW_ADDED   = 0x3,
    TABLE_ROW_DELETED = 0x4,
    TABLE_ROW_MODIFIED  = 0x5,
    TABLE_RESTRICT_DONE = 0x7
  } RichTableNotificationType;

  /* NewMailNotification: case 0x2 and 0x8002 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    MsgFlags        MessageFlags;
    boolean8        UnicodeFlag;
    [switch_is(UnicodeFlag)] MessageClass MessageClass;
  } NewMailNotification;

  /* FolderCreatedNotification: case 0x4 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         ParentFID;
    uint16          TagCount;
    [size_is(TagCount)] MAPITAGS        Tags[];
  } FolderCreatedNotification;

  /* FolderDeletedNotification: case 0x8 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         ParentFID;
  } FolderDeletedNotification;

  /* FolderModifiedNotification: case 0x10 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    uint16      TagCount;
    [size_is(TagCount)] MAPITAGS    Tags[];
  } FolderModifiedNotification_10;

  /* FolderMoveCopyNotification: case 0x20 and 0x40 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    hyper     ParentFID;
    hyper     OldFID;
    hyper     OldParentFID;
  } FolderMoveCopyNotification;

  /* SearchCompleteNotification: case 0x80 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
  } SearchCompleteNotification;

  /* HierarchyTable: case 0x100 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
    hyper       InsertAfterFID;
    [represent_as(uint16)] DATA_BLOB Columns;
  } HierarchyRowAddedNotification;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
  } HierarchyRowDeletedNotification;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
    hyper       InsertAfterFID;
    [represent_as(uint16)] DATA_BLOB Columns;
  } HierarchyRowModifiedNotification;

  typedef [nodiscriminant] union {
    [case(TABLE_ROW_ADDED)] HierarchyRowAddedNotification   HierarchyRowAddedNotification;
    [case(TABLE_ROW_DELETED)] HierarchyRowDeletedNotification HierarchyRowDeletedNotification;
    [case(TABLE_ROW_MODIFIED)] HierarchyRowModifiedNotification HierarchyRowModifiedNotification;
    [default];
  } HierarchyTableChangeUnion;

  typedef [flag(NDR_NOALIGN)] struct {
    RichTableNotificationType       TableEvent;
    [switch_is(TableEvent)] HierarchyTableChangeUnion HierarchyTableChangeUnion;
  } HierarchyTableChange;

  /* IcsNotification: case 0x200 */
  typedef [flag(NDR_NOALIGN)] struct {
    boolean8          HierChanged;
    uint32      GIDCount;
    [size_is(GIDCount)] GID     GID[];
  } IcsNotification;

  /* FolderModifiedNotification: case 0x1010 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    uint16      TagCount;
    [size_is(TagCount)] MAPITAGS    Tags[];
    uint32      TotalMessageCount;
  } FolderModifiedNotification_1010;

  /* FolderModifiedNotification: case 0x2010 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    uint16      TagCount;
    [size_is(TagCount)] MAPITAGS    Tags[];
    uint32      UnreadMessageCount;
  } FolderModifiedNotification_2010;

  /* FolderModifiedNotification: case 0x3010 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    uint16      TagCount;
    [size_is(TagCount)] MAPITAGS    Tags[];
    uint32      TotalMessageCount;
    uint32      UnreadMessageCount;
  } FolderModifiedNotification_3010;

  /* MessageCreatedNotification: case 0x8004 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    uint16          TagCount;
    [size_is(TagCount)] MAPITAGS        Tags[];
  } MessageCreatedNotification;

  /* MessageDeletedNotification: case 0x8008 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
  } MessageDeletedNotification;

  /* MessageModifiedNotification: case 0x8010 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    uint16          TagCount;
    [size_is(TagCount)] MAPITAGS        Tags[];
  } MessageModifiedNotification;

  /* MessageMoveCopyNotification: case 0x8020 and 0x8040 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FID;
    hyper     MID;
    hyper     OldFID;
    hyper     OldMID;
  } MessageMoveCopyNotification;

  /* ContentsTableChange: case 0x8100 and 0xc100 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
    hyper       MID;
    uint32        Instance;
    hyper       InsertAfterFID;
    hyper       InsertAfterMID;
    uint32        InsertAfterInstance;
    [represent_as(uint16)] DATA_BLOB Columns;
  } ContentsRowAddedNotification;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
    hyper       MID;
    uint32        Instance;
  } ContentsRowDeletedNotification;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper       FID;
    hyper       MID;
    uint32        Instance;
    hyper       InsertAfterFID;
    hyper       InsertAfterMID;
    uint32        InsertAfterInstance;
    [represent_as(uint16)] DATA_BLOB Columns;
  } ContentsRowModifiedNotification;

  typedef [nodiscriminant] union {
    [case(TABLE_ROW_ADDED)] ContentsRowAddedNotification    ContentsRowAddedNotification;
    [case(TABLE_ROW_DELETED)] ContentsRowDeletedNotification  ContentsRowDeletedNotification;
    [case(TABLE_ROW_MODIFIED)] ContentsRowModifiedNotification  ContentsRowModifiedNotification;
    [default];
  } ContentsTableChangeUnion;

  typedef [flag(NDR_NOALIGN)] struct {
    RichTableNotificationType       TableEvent;
    [switch_is(TableEvent)] ContentsTableChangeUnion  ContentsTableChangeUnion;
  } ContentsTableChange;

  /* SearchMessageCreatedNotification: case 0xc004 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    hyper         SearchFID;
    uint16          TagCount;
    [size_is(TagCount)] MAPITAGS        Tags[];
  } SearchMessageCreatedNotification;

  /* SearchMessageRemovedNotification: case 0xc008 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    hyper         SearchFID;
  } SearchMessageRemovedNotification;

  /* SearchMessageModifiedNotification: 0xc010 */
  typedef [flag(NDR_NOALIGN)] struct {
    hyper         FID;
    hyper         MID;
    uint16          TagCount;
    [size_is(TagCount)] MAPITAGS        Tags[];
  } SearchMessageModifiedNotification;

  typedef [nodiscriminant] union {
    [case(0x0002)] NewMailNotification      NewMailNotification;
    [case(0x0004)] FolderCreatedNotification    FolderCreatedNotification;
    [case(0x0008)] FolderDeletedNotification    FolderDeletedNotification;
    [case(0x0010)] FolderModifiedNotification_10    FolderModifiedNotification_10;
    [case(0x0020)] FolderMoveCopyNotification   FolderMoveNotification;
    [case(0x0040)] FolderMoveCopyNotification   FolderCopyNotification;
    [case(0x0080)] SearchCompleteNotification   SearchCompleteNotification;
    [case(0x0100)] HierarchyTableChange     HierarchyTableChange;
    [case(0x0200)] IcsNotification        IcsNotification;
    [case(0x1010)] FolderModifiedNotification_1010    FolderModifiedNotification_1010;
    [case(0x2010)] FolderModifiedNotification_2010    FolderModifiedNotification_2010;
    [case(0x3010)] FolderModifiedNotification_3010    FolderModifiedNotification_3010;
    [case(0x8002)] NewMailNotification      NewMessageNotification;
    [case(0x8004)] MessageCreatedNotification   MessageCreatedNotification;
    [case(0x8008)] MessageDeletedNotification   MessageDeletedNotification;
    [case(0x8010)] MessageModifiedNotification    MessageModifiedNotification;
    [case(0x8020)] MessageMoveCopyNotification    MessageMoveNotification;
    [case(0x8040)] MessageMoveCopyNotification    MessageCopyNotification;
    [case(0x8100)] ContentsTableChange      ContentsTableChange;
    [case(0xc004)] SearchMessageCreatedNotification   SearchMessageCreatedNotification;
    [case(0xc008)] SearchMessageRemovedNotification   SearchMessageRemovedNotification;
    [case(0xc010)] SearchMessageModifiedNotification  SearchMessageModifiedNotification;
    [case(0xc100)] ContentsTableChange      SearchTableChange;
  } NotificationData;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32            NotificationHandle;
    uint8           LogonId;
    NotificationFlags       NotificationType;
    [switch_is(NotificationType)] NotificationData  NotificationData;
  } Notify_repl;

  /*************************/
  /* ROP: RopOpenStream(0x2b) */
  typedef [enum8bit] enum {
    OpenStream_ReadOnly = 0x0,
    OpenStream_ReadWrite  = 0x1,
    OpenStream_Create = 0x2,
    OpenStream_BestAccess = 0x3
  } OpenStream_OpenModeFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    MAPITAGS      PropertyTag;
    OpenStream_OpenModeFlags        OpenModeFlags;
  } OpenStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    StreamSize;
  } OpenStream_repl;

  /*************************/
  /* ROP: RopReadStream(0x2c) */
  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0xBABE)] uint32 value;
    [default];
  } MaximumByteCount;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16            ByteCount;
    [switch_is(ByteCount)]  MaximumByteCount  MaximumByteCount;
  } ReadStream_req;

  typedef [flag(NDR_ALIGN2)] struct {
    [represent_as(uint16), flag(NDR_REMAINING)] DATA_BLOB data;
  } ReadStream_repl;

  /*************************/
  /* ROP: RopWriteStream(0x2d) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [represent_as(uint16), flag(NDR_REMAINING)] DATA_BLOB  data;
  } WriteStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    WrittenSize;
  } WriteStream_repl;

  /*************************/
  /* ROP: RopSeekStream(0x2e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   Origin;
    hyper   Offset;
  } SeekStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   NewPosition;
  } SeekStream_repl;

  /*************************/
  /* ROP: RopSetStreamSize(0x2f) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   SizeStream;
  } SetStreamSize_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SetStreamSize_repl;

  /*************************/
  /* ROP: RopSetSearchCriteria(0x30) */
  typedef [bitmap32bit, flag(NDR_PAHEX)] bitmap {
    STOP_SEARCH     = 0x00000001,
    RESTART_SEARCH      = 0x00000002,
    RECURSIVE_SEARCH    = 0x00000004,
    SHALLOW_SEARCH      = 0x00000008,
    FOREGROUND_SEARCH   = 0x00000010,
    BACKGROUND_SEARCH   = 0x00000020,
    CONTENT_INDEXED_SEARCH    = 0x00010000,
    NON_CONTENT_INDEXED_SEARCH  = 0x00020000,
    STATIC_SEARCH     = 0x00040000
  } SearchFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [represent_as(uint16)] mapi_SRestriction res;
    uint16          FolderIdCount;
    [size_is(FolderIdCount)] hyper         FolderIds[];
    SearchFlags       SearchFlags;
  } SetSearchCriteria_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SetSearchCriteria_repl;

  /*************************/
  /* ROP: RopGetSearchCriteria(0x31) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  UseUnicode;
    boolean8  IncludeRestriction;
    boolean8  IncludeFolders;
  } GetSearchCriteria_req;

  typedef [flag(NDR_NOALIGN)] struct {
    [represent_as(uint16)] mapi_SRestriction res;
    uint8         unknown;
    uint16          FolderIdCount;
    [size_is(FolderIdCount)] hyper         FolderIds[];
    SearchFlags       SearchFlags;
  } GetSearchCriteria_repl;

  /*************************/
  /* ROP: RopSubmitMessage(0x32) */
  typedef [enum8bit] enum {
    None    = 0x0,  /* None */
    PreProcess  = 0x1,  /* Needs to be preprocessed by the server */
    NeedsSpooler  = 0x2 /* Is to be processed by a client spooler */
  } SubmitFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SubmitFlags     SubmitFlags;
  } SubmitMessage_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SubmitMessage_repl;

  /*************************/
  /* ROP: RopMoveCopyMessages(0x33) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint16    count;
    [size_is(count)] hyper   message_id[];
    boolean8  WantAsynchronous;
    boolean8  WantCopy;
  } MoveCopyMessages_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        PartialCompletion;
  } MoveCopyMessages_repl;

  /*************************/
  /* ROP: RopAbortSubmit(0x34) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   FolderId;
    hyper   MessageId;
  } AbortSubmit_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } AbortSubmit_repl;

  /*************************/
  /* ROP: RopMoveFolder(0x35) */
  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] astring     lpszA;
    [case(0x1)][flag(STR_NULLTERM)] string  lpszW;
  } Folder_name;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    boolean8        WantAsynchronous;
    boolean8        UseUnicode;
    hyper         FolderId;
    [switch_is(UseUnicode)] Folder_name NewFolderName;
  } MoveFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        PartialCompletion;
  } MoveFolder_repl;

  /*************************/
  /* ROP: RopCopyFolder(0x36) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    boolean8        WantAsynchronous;
    boolean8        WantRecursive;
    boolean8        UseUnicode;
    hyper         FolderId;
    [switch_is(UseUnicode)] Folder_name NewFolderName;
  } CopyFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        PartialCompletion;
  } CopyFolder_repl;

  /*************************/
  /* ROP: RopQueryColumnsAll(0x37) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } QueryColumnsAll_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyTagCount;
    [size_is(PropertyTagCount)] MAPITAGS  PropertyTags[];
  } QueryColumnsAll_repl;

  /*************************/
  /* ROP: RopAbort(0x38) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } Abort_req;

  typedef [flag(NDR_NOALIGN)] struct {
    TableStatus TableStatus;
  } Abort_repl;

  /*************************/
  /* ROP: RopCopyTo(0x39) */
  typedef [bitmap8bit] bitmap {
    CopyFlagsMove   = 0x1,  /* Move properties */
    CopyFlagsNoOverwrite  = 0x2 /* Do not overwrite existing properties */
  } CopyFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    boolean8    WantAsynchronous;
    boolean8    WantSubObjects;
    CopyFlags   CopyFlags;
    mapi_SPropTagArray  ExcludedTags;
  } CopyTo_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } CopyTo_repl;

  /*************************/
  /* ROP: RopCopyToStream(0x3a) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    hyper   ByteCount;
  } CopyToStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   ReadByteCount;
    hyper   WrittenByteCount;
  } CopyToStream_repl;

  /*************************/
  /* ROP: RopCloneStream(0x3b) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
  } CloneStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } CloneStream_repl;

  /*************************/
  /* ROP: RopGetPermissionsTable(0x3e) */
  typedef [bitmap8bit] bitmap {
    IncludeFreeBusy = 0x02
  } PermissionsTableFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    PermissionsTableFlags TableFlags;
  } GetPermissionsTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } GetPermissionsTable_repl;

  /*************************/
  /* ROP: RopGetRulesTable(0x3f) */
  typedef [bitmap8bit] bitmap {
    RulesTableFlags_Unicode = 0x40
  } RulesTableFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    RulesTableFlags TableFlags;
  } GetRulesTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } GetRulesTable_repl;

  /*************************/
  /* ROP: RopModifyPermissions(0x40) */
  typedef [bitmap8bit] bitmap {
    ModifyPerms_IncludeFreeBusy     = 0x02,
    ModifyPerms_ReplaceRows         = 0x01
  } ModifyPermissionsFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    ulRowFlags              PermissionDataFlags;
    mapi_SPropValue_array   lpProps;
  } PermissionData;

  typedef [flag(NDR_NOALIGN)] struct {
    ModifyPermissionsFlags  ModifyFlags;
    uint16                  ModifyCount;
    [size_is(ModifyCount)] PermissionData PermissionsData[];
  } mapi_PermissionsData;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    mapi_PermissionsData    rowList;
  } ModifyPermissions_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } ModifyPermissions_repl;

  /*************************/
  /* ROP: RopModifyRules(0x41) */
  typedef [flag(NDR_NOALIGN)] struct {
    ulRowFlags        RuleDataFlags;
    mapi_SPropValue_array PropertyValues;
  } RuleData;

  typedef [bitmap8bit] bitmap {
    ModifyRulesFlag_Replace = 0x01
  } ModifyRulesFlag;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    ModifyRulesFlag ModifyRulesFlags;
    uint16    RulesCount;
    [size_is(RulesCount)] RuleData  RulesData[];
  } ModifyRules_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } ModifyRules_repl;

  /*************************/
  /* ROP: RopGetOwningServers(0x42) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   FolderId;
  } GetOwningServers_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    OwningServersCount;
    uint16    CheapServersCount;
    [size_is(OwningServersCount)] astring OwningServers[];
  } GetOwningServers_repl;

  /*************************/
  /* ROP: RopLongTermIdFromId(0x43) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper Id;
  } LongTermIdFromId_req;

  typedef [flag(NDR_NOALIGN)] struct {
    GUID  DatabaseGuid;
    uint8 GlobalCounter[6];
    uint16  padding;
  } LongTermId;

  typedef [flag(NDR_NOALIGN)] struct {
    LongTermId  LongTermId;
  } LongTermIdFromId_repl_Success;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)] LongTermIdFromId_repl_Success Success;
    [default];
  } LongTermIdFromId_repl_status;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   InputHandleIndex;
    uint32  ReturnValue;
    [switch_is(ReturnValue)] LongTermIdFromId_repl_status  repl;
  } LongTermIdFromId_repl;

  /*************************/
  /* ROP: RopIdFromLongTermId(0x44) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    LongTermId  LongTermId;
  } IdFromLongTermId_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   Id;
  } IdFromLongTermId_repl;

  /*************************/
  /* ROP: RopPublicFolderIsGhosted(0x45) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   FolderId;
  } PublicFolderIsGhosted_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        IsGhosted;
    [switch_is(IsGhosted)] IsGhosted  Ghost;
  } PublicFolderIsGhosted_repl;

  /*************************/
  /* ROP: RopOpenEmbeddedMessage(0x46) */
  typedef [enum8bit, flag(NDR_PAHEX)] enum {
    MAPI_READONLY   = 0x0,
    MAPI_READWRITE  = 0x1,
    MAPI_CREATE = 0x2
  } OpenEmbeddedMessage_OpenModeFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    uint16          CodePageId;
    OpenEmbeddedMessage_OpenModeFlags OpenModeFlags;
  } OpenEmbeddedMessage_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8           Reserved;
    hyper           MessageId;
    boolean8          HasNamedProperties;
    TypedString         SubjectPrefix;
    TypedString         NormalizedSubject;
    uint16            RecipientCount;
    uint16            ColumnCount;
    [size_is(ColumnCount)] MAPITAGS RecipientColumns[];
    uint8           RowCount;
    [size_is(RowCount)] OpenRecipientRow RecipientRows[];
  } OpenEmbeddedMessage_repl;

  /*************************/
  /* ROP: RopSetSpooler(0x47) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } SetSpooler_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SetSpooler_repl;

  /*************************/
  /* ROP: RopSpoolerLockMessage(0x48) */
  typedef [enum8bit] enum {
    LockState_1stLock       = 0x0,
    LockState_1stUnlock = 0x1,
    LockState_1stFinished = 0x2
  } LockState;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   MessageId;
    LockState LockState;
  } SpoolerLockMessage_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SpoolerLockMessage_repl;

  /*************************/
  /* ROP: RopGetAddressTypes(0x49) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } AddressTypes_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    cValues;
    uint16    size;
    [size_is(cValues)] mapi_LPSTR  transport[];
  } AddressTypes_repl;

  /**************************/
  /* ROP: RopTransportSend(0x4a) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } TransportSend_req;

  typedef [nodiscriminant] union {
    [case(0x0)] mapi_SPropValue_array lpProps;
    [case(0x1)];
  } TransportSend_lpProps;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8            NoPropertiesReturned;
    [switch_is(NoPropertiesReturned)] TransportSend_lpProps properties;
  } TransportSend_repl;

  /**************************/
  /* ROP: RopFastTransferSourceCopyMessages(0x4b) */
  /* TODO */

  /**************************/
  /* ROP: RopFastTransferSourceCopyFolder(0x4c) */
  /* TODO */

  /**************************/
  /* ROP: RopFastTransferSourceCopyTo(0x4d) */
  /* TODO */

  /**************************/
  /* ROP: RopFastTransferSourceGetBuffer(0x4e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    BufferSize;
  } FastTransferSourceGetBuffer_req;

  typedef [enum16bit] enum {
    TransferStatus_Error  = 0x0,
    TransferStatus_Partial  = 0x1,
    TransferStatus_NoRoom = 0x2,
    TransferStatus_Done = 0x3
  } TransferStatus;

  typedef [flag(NDR_NOALIGN)] struct {
    TransferStatus  TransferStatus;
    uint16    InProgressCount;
    uint16    TotalStepCount;
    uint8   Reserved;
    [flag(NDR_REMAINING)] [represent_as(uint16)] DATA_BLOB TransferBuffer;
    /*uint16    TransferBufferSize;
    [subcontext(0),subcontext_size(TransferBufferSize),flag(NDR_REMAINING)] DATA_BLOB TransferBuffer;*/
  } FastTransferSourceGetBuffer_repl;

  /**************************/
  /* ROP: RopFindRow(0x4f) */
  typedef [enum8bit] enum {
    DIR_FORWARD  = 0x0,
    DIR_BACKWARD = 0x1
  } FindRow_ulFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    FindRow_ulFlags ulFlags;
      [represent_as(uint16)] mapi_SRestriction res;
    BOOKMARK  origin;
    SBinary_short bookmark;
  } FindRow_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   RowNoLongerVisible;
      uint8   HasRowData;
    [flag(NDR_NOALIGN)] DATA_BLOB row;
  } FindRow_repl;

  /**************************/
  /* ROP: RopProgress(0x50) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantCancel;
  } Progress_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    CompletedTaskCount;
    uint32    TotalTaskCount;
  } Progress_repl;

  /**************************/
  /* ROP: RopTransportNewMail(0x51) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   MessageId;
    hyper   FolderId;
    astring   MessageClass;
    uint32    MessageFlags;
  } TransportNewMail_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } TransportNewMail_repl;

  /**************************/
  /* ROP: RopGetValidAttachments(0x52) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetValidAttachments_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    AttachmentIdCount;
    [size_is(AttachmentIdCount)] uint32 AttachmentIdArray[];
  } GetValidAttachments_repl;

  /**************************/
  /* ROP: RopFastTransferDestinationConfigure(0x53) */
  /* TODO */

  /**************************/
  /* ROP: RopFastTransferDestinationPutBuffer(0x54) */
  /* TODO */

  /*************************/
  /* ROP: RopGetNamesFromPropertyIds(0x55) */
  typedef [enum8bit] enum {
    MNID_ID = 0,
    MNID_STRING = 1
  } ulKind;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8       NameSize;
    [flag(STR_NULLTERM)] string Name;
  } mapi_name;

  typedef [nodiscriminant] union {
    [case(MNID_ID)] uint32    lid;
    [case(MNID_STRING)] mapi_name lpwstr;
  } Kind;

  typedef [flag(NDR_NOALIGN)] struct {
    ulKind        ulKind;
    GUID        lpguid;
    [switch_is(ulKind)] Kind  kind;
  } MAPINAMEID;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    PropertyIdCount;
    [size_is(PropertyIdCount)] uint16 PropertyIds[];
  } GetNamesFromIDs_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    count;
    [size_is(count)] MAPINAMEID  nameid[];
  } GetNamesFromIDs_repl;

  /*************************/
  /* ROP: RopGetPropertyIdsFromNames(0x56) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   ulFlags;
    uint16    count;
    [size_is(count)] MAPINAMEID  nameid[];
  } GetIDsFromNames_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    count;
    [size_is(count)] uint16    propID[];
  } GetIDsFromNames_repl;

  /*************************/
  /* ROP: RopUpdateDeferredActionMessages(0x57) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SBinary_short ServerEntryId;
    SBinary_short ClientEntryId;
  } UpdateDeferredActionMessages_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } UpdateDeferredActionMessages_repl;

  /*************************/
  /* ROP: RopEmptyFolder(0x58) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantAsynchronous;
    boolean8  WantDeleteAssociated;
  } EmptyFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  PartialCompletion;
  } EmptyFolder_repl;

  /*************************/
  /* ROP: RopExpandRow(0x59) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint16    MaxRowCount;
    hyper   CategoryId;
  } ExpandRow_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    ExpandedRowCount;
    uint16    RowCount;
    [flag(NDR_REMAINING)]DATA_BLOB  RowData;
  } ExpandRow_repl;

  /*************************/
  /* ROP: RopCollapseRow(0x5a) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   CategoryId;
  } CollapseRow_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    CollapsedRowCount;
  } CollapseRow_repl;

  /*************************/
  /* ROP: RopLockRegionStream(0x5b) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   RegionOffset;
    hyper   RegionSize;
    uint32    LockFlags;
  } LockRegionStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } LockRegionStream_repl;

  /*************************/
  /* ROP: RopUnlockRegionStream(0x5c) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   RegionOffset;
    hyper   RegionSize;
    uint32    LockFlags;
  } UnlockRegionStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } UnlockRegionStream_repl;

  /*************************/
  /* ROP: RopCommitStream(0x5d) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } CommitStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } CommitStream_repl;

  /*************************/
  /* ROP: RopGetStreamSize(0x5e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetStreamSize_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    StreamSize;
  } GetStreamSize_repl;

  /*************************/
  /* ROP: RopQueryNamedProperties(0x5f) */
  typedef [bitmap8bit] bitmap {
    NoStrings = 0x01,
    NoIds         = 0x02
  } QueryFlags;

  typedef [nodiscriminant] union {
    [case(0x0)];
      [case(0x1)] GUID guid;
  } QueryNamedProperties_guid;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    QueryFlags    QueryFlags;
    boolean8    HasGuid;
    [switch_is(HasGuid)]  QueryNamedProperties_guid PropertyGuid;
  } QueryNamedProperties_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    IdCount;
    [size_is(IdCount)] uint16    PropertyIds[];
    [size_is(IdCount)] MAPINAMEID  PropertyNames[];
  } QueryNamedProperties_repl;

  /*************************/
  /* ROP: RopGetPerUserLongTermIds(0x60) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    GUID  DatabaseGuid;
  } GetPerUserLongTermIds_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    LongTermIdCount;
    [size_is(LongTermIdCount)] LongTermId  LongTermIds[];
  } GetPerUserLongTermIds_repl;

  /*************************/
  /* ROP: RopGetPerUserGuid(0x61) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    LongTermId  LongTermId;
  } GetPerUserGuid_req;

  typedef [flag(NDR_NOALIGN)] struct {
    GUID    DatabaseGuid;
  } GetPerUserGuid_repl;

  /*************************/
  /* ROP: RopReadPerUserInformation(0x63) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   FolderId[24];
    boolean8  WhatIfChanged;
    uint32    DataOffset;
    uint16    MaxDataSize;
  } ReadPerUserInformation_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  HasFinished;
    [flag(NDR_REMAINING)] [represent_as(uint16)] DATA_BLOB Data;
    /*uint16    DataSize;
    [subcontext(0), subcontext_size(DataSize), flag(NDR_REMAINING)] DATA_BLOB Data;*/
  } ReadPerUserInformation_repl;

  /*************************/
  /* ROP: RopWritePerUserInformation(0x64) */
  /* TODO */

  /*************************/
  /* ROP: RopSetReadFlags(0x66) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantAsynchronous;
    MSGFLAG_READ  ReadFlags;
    uint16    MessageIdCount;
    [size_is(MessageIdCount)] hyper MessageIds[];
  } SetReadFlags_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  PartialCompletion;
  } SetReadFlags_repl;

  /*************************/
  /* ROP: RopCopyProperties(0x67) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    boolean8    WantAsynchronous;
    CopyFlags   CopyFlags;
    mapi_SPropTagArray  PropertyTags;
  } CopyProperties_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } CopyProperties_repl;

  /*************************/
  /* ROP: RopGetReceiveFolderTable(0x68) */
  typedef struct {
    uint32 dwLowDateTime;
    uint32 dwHighDateTime;
  } FILETIME;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   unknown;
    hyper   fid;
    astring   lpszMessageClass;
    FILETIME  modiftime;
  } ReceiveFolder;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetReceiveFolderTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint32    cValues;
    [size_is(cValues)] ReceiveFolder entries[];
  } GetReceiveFolderTable_repl;

  /*************************/
  /* ROP: RopFastTransferSourceCopyProperties(0x69) */
  /* TODO */

  /*************************/
  /* ROP: RopGetCollapseState(0x6b) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    hyper   RowId;
      uint32    RowInstanceNumber;
  } GetCollapseState_req;

  typedef [flag(NDR_NOALIGN)] struct {
    SBinary_short CollapseState;
  } GetCollapseState_repl;

  /*************************/
  /* ROP: RopSetCollapseState(0x6c) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SBinary_short CollapseState;
  } SetCollapseState_req;

  typedef [flag(NDR_NOALIGN)] struct {
    SBinary_short bookmark;
  } SetCollapseState_repl;

  /*************************/
  /* ROP: RopGetTransportFolder(0x6d) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetTransportFolder_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   FolderId;
  } GetTransportFolder_repl;

  /*************************/
  /* ROP: RopPending(0x6e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16  SessionIndex;
  } Pending_repl;

  /*************************/
  /* ROP: RopOptionsData(0x6f) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    astring   AddressType;
    boolean8  WantWin32;
  } OptionsData_req;

  typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
    [case(0x0)];
    [default]  astring  HelpFileName;
  } OptionsData_HelpFileName;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8             Reserved;
    SBinary_short           OptionsInfo;
    uint16              HelpFileSize;
    [size_is(HelpFileSize)] uint8 HelpFile[];
    [switch_is(HelpFileSize)] OptionsData_HelpFileName  HelpFileName;
  } OptionsData_repl;

  /*************************/
  /* ROP: RopSynchronizationConfigure(0x70) */
  typedef [enum8bit] enum {
    Contents  = 0x1,
    Hierarchy = 0x2
  } SynchronizationType;

  typedef [bitmap8bit] bitmap {
    SendOptions_Unicode   = 0x1,
    SendOptions_ForUpload   = 0x3,
    SendOptions_RecoverMode   = 0x4,
    SendOptions_ForceUnicode  = 0x8,
    SendOptions_Partial   = 0x10
  } SendOptions;

  typedef [bitmap16bit] bitmap {
    SynchronizationFlag_Unicode     = 0x1,
    SynchronizationFlag_NoDeletions     = 0x2,
    SynchronizationFlag_NoSoftDeletions   = 0x4,
    SynchronizationFlag_ReadState     = 0x8,
    SynchronizationFlag_FAI       = 0x10,
    SynchronizationFlag_Normal      = 0x20,
    SynchronizationFlag_OnlySpecifiedProperties = 0x80,
    SynchronizationFlag_NoForeignIdentifiers  = 0x100,
    SynchronizationFlag_Reserved      = 0x1000,
    SynchronizationFlag_BestBody      = 0x2000,
    SynchronizationFlag_IgnoreSpecifiedOnFAI  = 0x4000,
    SynchronizationFlag_Progress      = 0x8000
  } SynchronizationFlag;

  typedef [bitmap32bit] bitmap {
    Eid     = 0x00000001,
    MessageSize   = 0x00000002,
    Cn      = 0x00000004,
    OrderByDeliveryTime = 0x00000008
  } SynchronizationExtraFlags;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    SynchronizationType     SynchronizationType;
    SendOptions       SendOptions;
    SynchronizationFlag     SynchronizationFlag;
    [flag(NDR_REMAINING)] [represent_as(uint16)] DATA_BLOB  RestrictionData;
    SynchronizationExtraFlags   SynchronizationExtraFlags;
    mapi_SPropTagArray      PropertyTags;
  } SyncConfigure_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncConfigure_repl;

  /*************************/
  /* ROP: RopSynchronizationImportMessageChange(0x72) */
  typedef [bitmap8bit] bitmap {
    ImportFlag_Associated   = 0x10,
    ImportFlag_FailOnConflict = 0x40
  } ImportFlag;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    ImportFlag    ImportFlag;
    mapi_SPropValue_array PropertyValues;
  } SyncImportMessageChange_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   MessageId;
  } SyncImportMessageChange_repl;

  /*************************/
  /* ROP: RopSynchronizationImportHierarchyChange(0x73) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    mapi_SPropValue_array HierarchyValues;
    mapi_SPropValue_array PropertyValues;
  } SyncImportHierarchyChange_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper     FolderId;
  } SyncImportHierarchyChange_repl;

  /*************************/
  /* ROP: RopSynchronizationImportDeletes(0x74) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8    IsHierarchy;
    mapi_SPropValue_array PropertyValues;
  } SyncImportDeletes_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncImportDeletes_repl;

  /*************************/
  /* ROP: RopSynchronizationUploadStateStreamBegin(0x75) */
  typedef [v1_enum,flag(NDR_PAHEX)] enum {
    PidTagIdsetGiven  = 0x40170003,
    PidTagCnsetSeen   = 0x67960102,
    PidTagCnsetSeenFAI  = 0x67da0102,
    PidTagCnsetRead   = 0x67d20102
  } StateProperty;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    StateProperty   StateProperty;
    uint32      TransferBufferSize;
  } SyncUploadStateStreamBegin_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncUploadStateStreamBegin_repl;

  /*************************/
  /* ROP: RopSynchronizationUploadStateStreamContinue(0x76) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32      StreamDataSize;
    /* Current PIDL in wireshark repo does not support inline arrays. */
    [flag(NDR_BUFFERS), size_is(cb)]uint8 StreamData[]; /* [StreamDataSize] */
  } SyncUploadStateStreamContinue_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncUploadStateStreamContinue_repl;

  /*************************/
  /* ROP: RopSynchronizationUploadStateStreamEnd(0x77) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } SyncUploadStateStreamEnd_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncUploadStateStreamEnd_repl;

  /*************************/
  /* ROP: RopSynchronizationImportMessageMove(0x78) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    SourceFolderIdSize;
    [size_is(SourceFolderIdSize)] uint8   SourceFolderId[];
    uint32    SourceMessageIdSize;
    [size_is(SourceMessageIdSize)] uint8   SourceMessageId[];
    uint32    PredecessorChangeListSize;
    [size_is(PredecessorChangeListSize)] uint8   PredecessorChangeList[];
    uint32    DestinationMessageIdSize;
    [size_is(DestinationMessageIdSize)] uint8   DestinationMessageId[];
    uint32    ChangeNumberSize;
    [size_is(ChangeNumberSize)] uint8 ChangeNumber[];
  } SyncImportMessageMove_req;

  typedef [flag(NDR_NOALIGN)] struct {
    hyper   MessageId;
  } SyncImportMessageMove_repl;

  /*************************/
  /* ROP: RopSetPropertiesNoReplicate(0x79) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [represent_as(uint16)] mapi_SPropValue_array values;
  } SetPropertiesNoReplicate_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } SetPropertiesNoReplicate_repl;

  /*************************/
  /* ROP: RopDeletePropertiesNoReplicate(0x7a) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    mapi_SPropTagArray  PropertyTags;
  } DeletePropertiesNoReplicate_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    PropertyProblemCount;
    [size_is(PropertyProblemCount)] PropertyProblem PropertyProblem[];
  } DeletePropertiesNoReplicate_repl;

  /*************************/
  /* ROP: RopGetStoreState(0x7b) */
  typedef [public,bitmap32bit] bitmap {
    STORE_HAS_SEARCHES    = 0x010000000
  } StoreState;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } GetStoreState_req;

  typedef [flag(NDR_NOALIGN)] struct {
    StoreState  StoreState;
  } GetStoreState_repl;

  /*************************/
  /* ROP: RopSynchronizationOpenCollector(0x7e) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
    boolean8  IsContentsCollector;
  } SyncOpenCollector_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncOpenCollector_repl;

  /*************************/
  /* ROP: RopGetLocalReplicaIds(0x7f) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint32    IdCount;
  } GetLocalReplicaIds_req;

  typedef [flag(NDR_NOALIGN)] struct {
    GUID    ReplGuid;
    uint8   GlobalCount[6];
  } GetLocalReplicaIds_repl;

  /*************************/
  /* ROP: RopSynchronizationImportReadStateChanges(0x80) */
  #if 0
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    MessageSize;
    uint8   MessageId[MessageSize];
    boolean8  MarkAsRead;
  } MessageReadStates;
  #endif

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [flag(NDR_REMAINING)] [represent_as(uint16)] DATA_BLOB MessageStates;
  } SyncImportReadStateChanges_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncImportReadStateChanges_repl;

  /*************************/
  /* ROP: RopResetTable(0x81) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
  } ResetTable_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } ResetTable_repl;

  /*************************/
  /* ROP: RopSynchronizationGetTransferState(0x82) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    uint8   OutputHandleIndex;
  } SyncGetTransferState_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SyncGetTransferState_repl;

  /*************************/
  /* ROP: RopTellVersion(0x86) */
  /* TODO */

  /*************************/
  /* ROP: OpenPublicFolderByName(0x87) - NOT DOCUMENTED */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   handle_idx;
    asclstr   name;
  } OpenPublicFolderByName_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8        HasRules;
    boolean8        IsGhosted;
    [switch_is(IsGhosted)] IsGhosted  Ghost;
  } OpenPublicFolderByName_repl;

  /*************************/
  /* ROP: SetSyncNotificationGuid(0x88) - NOT DOCUMENTED */
  typedef [flag(NDR_NOALIGN)] struct {
    GUID  NotificationGuid;
  } SetSyncNotificationGuid_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } SetSyncNotificationGuid_repl;

  /*************************/
  /* ROP: RopFreeBookmark(0x89) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    SBinary_short bookmark;
  } FreeBookmark_req;

  typedef [flag(NDR_NOALIGN)] struct {
  } FreeBookmark_repl;

  /*************************/
  /* ROP: RopWriteAndCommitStream(0x90) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    [represent_as(uint16), flag(NDR_REMAINING)] DATA_BLOB  data;
  } WriteAndCommitStream_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint16    WrittenSize;
  } WriteAndCommitStream_repl;

  /**************************/
  /* ROP: RopHardDeleteMessages(0x91) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantAsynchronous;
    boolean8  NotifyNonRead;
    uint16    MessageIdCount;
    [size_is(MessageIdCount)] hyper MessageIds[];
  } HardDeleteMessages_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  PartialCompletion;
  } HardDeleteMessages_repl;

  /*************************/
  /* ROP: RopHardDeleteMessagesAndSubfolders(0x92) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   InputHandleIndex;
    boolean8  WantAsynchronous;
    boolean8  WantDeleteAssociated;
  } HardDeleteMessagesAndSubfolders_req;

  typedef [flag(NDR_NOALIGN)] struct {
    boolean8  PartialCompletion;
  } HardDeleteMessagesAndSubfolders_repl;

  /*************************/
  /* ROP: RopSetLocalReplicaMidsetDeleted(0x93) */
  /* TODO */

  /*************************/
  /* ROP: RopBackoff(0xF9) */
  /* TODO */

  /*************************/
  /* ROP: RopLogon(0xFE) */
  typedef [flag(NDR_NOALIGN),public,enum8bit] enum {
    LogonPrivate  = 0x1,
    UnderCover  = 0x2,
    Ghosted   = 0x4,
    SpIProcess  = 0x8
  } LogonFlags;

  typedef [flag(NDR_NOALIGN),public,bitmap32bit] bitmap {
    PUBLIC        = 0x2,
    HOME_LOGON      = 0x4,
    TAKE_OWNERSHIP      = 0x8,
    ALTERNATE_SERVER    = 0x100,
    IGNORE_HOME_MDB     = 0x200,
    NO_MAIL       = 0x400,
    USE_PER_MDB_REPLID_MAPPING  = 0x010000000
  } OpenFlags;

  typedef [enum8bit] enum {
    DayOfWeek_Sunday  = 0x0,
    DayOfWeek_Monday  = 0x1,
    DayOfWeek_Tuesday = 0x2,
    DayOfWeek_Wednesday = 0x3,
    DayOfWeek_Thursday  = 0x4,
    DayOfWeek_Friday  = 0x5,
    DayOfWeek_Saturday  = 0x6
  } DayOfWeek;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   Seconds;
    uint8   Minutes;
    uint8   Hour;
    DayOfWeek DayOfWeek;
    uint8   Day;
    uint8   Month;
    uint16    Year;
  } LogonTime;

  typedef [bitmap8bit] bitmap {
    ResponseFlags_Reserved    = 0x1,
    ResponseFlags_OwnerRight  = 0x2,
    ResponseFlags_SendAsRight = 0x4,
    ResponseFlags_OOF   = 0x10
  } ResponseFlags;

  typedef [nopush,flag(NDR_NOALIGN)] struct {
    uint8   LogonId;
    uint8   OutputHandleIndex;
    LogonFlags  LogonFlags;
    OpenFlags OpenFlags;
    StoreState  StoreState;
    uint16 EssdnSize;
    astring   EssDN;
  } Logon_req;

  typedef [flag(NDR_NOALIGN)] struct {
    uint8   OutputHandleIndex;
    uint32  ReturnValue;
    /* Success - Private Mailboxes */
    LogonFlags  LogonFlags;
    hyper     FolderIds[13];
    uint8 ResponseFlags;
    GUID      MailboxGuid;
    uint16  ReplId;
    GUID      ReplGuid;
    hyper LogonTime; /* TODO */
    hyper GwartTime;
    StoreState  StoreState;
    /* Success - Public mailbox */
    GUID PerUserGuid;
    /* Success - Redirect */
    uint8 ServerNameSize;
    astring   ServerName;
  } Logon_repl;

  /*************************/
  /* ROP: RopBufferTooSmall(0xFF) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16 SizeNeeded;
    /* [size_is(SizeNeeded)] RequestBuffers; */
  } RopBufferTooSmall_repl;

  typedef [public, nodiscriminant] union {
    [case(RopRelease)] Release_req Release;
    [case(RopOpenFolder)] OpenFolder_req OpenFolder;
    [case(RopOpenMessage)] OpenMessage_req OpenMessage;
    [case(RopGetHierarchyTable)] GetHierarchyTable_req GetHierarchyTable;
    [case(RopGetContentsTable)] GetContentsTable_req GetContentsTable;
    [case(RopCreateMessage)] CreateMessage_req CreateMessage;
    [case(RopGetPropertiesSpecific)] GetProps_req GetProps;
    [case(RopGetPropertiesAll)] GetPropsAll_req GetPropsAll;
    [case(RopGetPropertiesList)] GetPropList_req GetPropList;
    [case(RopSetProperties)] SetProps_req SetProps;
    [case(RopDeleteProperties)] DeleteProps_req DeleteProps;
    [case(RopSaveChangesMessage)] SaveChangesMessage_req SaveChangesMessage;
    [case(RopSetMessageReadFlag)] SetMessageReadFlag_req SetMessageReadFlag;
    [case(RopReloadCachedInformation)] ReloadCachedInformation_req ReloadCachedInformation;
    [case(RopSetColumns)] SetColumns_req SetColumns;
    [case(RopSortTable)] SortTable_req SortTable;
    [case(RopRestrict)] Restrict_req Restrict;
    [case(RopRemoveAllRecipients)] RemoveAllRecipients_req RemoveAllRecipients;
    [case(RopModifyRecipients)] ModifyRecipients_req ModifyRecipients;
    [case(RopReadRecipients)] ReadRecipients_req ReadRecipients;
    [case(RopQueryRows)] QueryRows_req QueryRows;
    [case(RopGetStatus)] GetStatus_req GetStatus;
    [case(RopQueryPosition)] QueryPosition_req QueryPosition;
    [case(RopSeekRow)] SeekRow_req SeekRow;
    [case(RopSeekRowBookmark)] SeekRowBookmark_req SeekRowBookmark;
    [case(RopSeekRowFractional)] SeekRowApprox_req SeekRowApprox;
    [case(RopCreateBookmark)] CreateBookmark_req CreateBookmark;
    [case(RopCreateFolder)] CreateFolder_req CreateFolder;
    [case(RopDeleteFolder)] DeleteFolder_req DeleteFolder;
    [case(RopDeleteMessages)] DeleteMessages_req DeleteMessages;
    [case(RopGetMessageStatus)] GetMessageStatus_req GetMessageStatus;
    [case(RopSetMessageStatus)] SetMessageStatus_req SetMessageStatus;
    [case(RopGetAttachmentTable)] GetAttachmentTable_req GetAttachmentTable;
    [case(RopOpenAttachment)] OpenAttach_req OpenAttach;
    [case(RopCreateAttachment)] CreateAttach_req CreateAttach;
    [case(RopDeleteAttachment)] DeleteAttach_req DeleteAttach;
    [case(RopSaveChangesAttachment)] SaveChangesAttachment_req SaveChangesAttachment;
    [case(RopSetReceiveFolder)] SetReceiveFolder_req SetReceiveFolder;
    [case(RopGetReceiveFolder)] GetReceiveFolder_req GetReceiveFolder;
    [case(RopRegisterNotification)] RegisterNotification_req Advise;
    [case(RopOpenStream)] OpenStream_req OpenStream;
    [case(RopReadStream)] ReadStream_req ReadStream;
    [case(RopWriteStream)] WriteStream_req WriteStream;
    [case(RopSeekStream)] SeekStream_req SeekStream;
    [case(RopSetStreamSize)] SetStreamSize_req SetStreamSize;
    [case(RopSetSearchCriteria)] SetSearchCriteria_req SetSearchCriteria;
    [case(RopGetSearchCriteria)] GetSearchCriteria_req GetSearchCriteria;
    [case(RopSubmitMessage)] SubmitMessage_req SubmitMessage;
    [case(RopMoveCopyMessages)] MoveCopyMessages_req MoveCopyMessages;
    [case(RopAbortSubmit)] AbortSubmit_req AbortSubmit;
    [case(RopMoveFolder)] MoveFolder_req MoveFolder;
    [case(RopCopyFolder)] CopyFolder_req CopyFolder;
    [case(RopQueryColumnsAll)] QueryColumnsAll_req QueryColumnsAll;
    [case(RopAbort)] Abort_req Abort;
    [case(RopCopyTo)] CopyTo_req CopyTo;
    [case(RopCopyToStream)] CopyToStream_req CopyToStream;
    [case(RopCloneStream)] CloneStream_req CloneStream;
    [case(RopGetPermissionsTable)] GetPermissionsTable_req GetPermissionsTable;
    [case(RopGetRulesTable)] GetRulesTable_req GetRulesTable;
    [case(RopModifyPermissions)] ModifyPermissions_req ModifyPermissions;
    [case(RopModifyRules)] ModifyRules_req ModifyRules;
    [case(RopGetOwningServers)] GetOwningServers_req GetOwningServers;
    [case(RopLongTermIdFromId)] LongTermIdFromId_req LongTermIdFromId;
    [case(RopIdFromLongTermId)] IdFromLongTermId_req IdFromLongTermId;
    [case(RopPublicFolderIsGhosted)] PublicFolderIsGhosted_req PublicFolderIsGhosted;
    [case(RopOpenEmbeddedMessage)] OpenEmbeddedMessage_req OpenEmbeddedMessage;
    [case(RopSetSpooler)] SetSpooler_req SetSpooler;
    [case(RopSpoolerLockMessage)] SpoolerLockMessage_req SpoolerLockMessage;
    [case(RopGetAddressTypes)] AddressTypes_req AddressTypes;
    [case(RopTransportSend)] TransportSend_req TransportSend;
    [case(RopFastTransferSourceGetBuffer)] FastTransferSourceGetBuffer_req FastTransferSourceGetBuffer;
    [case(RopFindRow)] FindRow_req FindRow;
    [case(RopProgress)] Progress_req Progress;
    [case(RopTransportNewMail)] TransportNewMail_req TransportNewMail;
    [case(RopGetValidAttachments)] GetValidAttachments_req GetValidAttachments;
    [case(RopGetNamesFromPropertyIds)] GetNamesFromIDs_req GetNamesFromIDs;
    [case(RopGetPropertyIdsFromNames)] GetIDsFromNames_req GetIDsFromNames;
    [case(RopUpdateDeferredActionMessages)] UpdateDeferredActionMessages_req UpdateDeferredActionMessages;
    [case(RopEmptyFolder)] EmptyFolder_req EmptyFolder;
    [case(RopExpandRow)] ExpandRow_req ExpandRow;
    [case(RopCollapseRow)] CollapseRow_req CollapseRow;
    [case(RopLockRegionStream)] LockRegionStream_req LockRegionStream;
    [case(RopUnlockRegionStream)] UnlockRegionStream_req UnlockRegionStream;
    [case(RopCommitStream)] CommitStream_req CommitStream;
    [case(RopGetStreamSize)] GetStreamSize_req GetStreamSize;
    [case(RopQueryNamedProperties)] QueryNamedProperties_req QueryNamedProperties;
    [case(RopGetPerUserLongTermIds)] GetPerUserLongTermIds_req GetPerUserLongTermIds;
    [case(RopGetPerUserGuid)] GetPerUserGuid_req GetPerUserGuid;
    [case(RopReadPerUserInformation)] ReadPerUserInformation_req ReadPerUserInformation;
    [case(RopSetReadFlags)] SetReadFlags_req SetReadFlags;
    [case(RopCopyProperties)] CopyProperties_req CopyProperties;
    [case(RopGetReceiveFolderTable)] GetReceiveFolderTable_req GetReceiveFolderTable;
    [case(RopGetCollapseState)] GetCollapseState_req GetCollapseState;
    [case(RopSetCollapseState)] SetCollapseState_req SetCollapseState;
    [case(RopGetTransportFolder)] GetTransportFolder_req GetTransportFolder;
    [case(RopOptionsData)] OptionsData_req OptionsData;
    [case(RopSynchronizationConfigure)] SyncConfigure_req SyncConfigure;
    [case(RopSynchronizationImportMessageChange)] SyncImportMessageChange_req SyncImportMessageChange;
    [case(RopSynchronizationImportHierarchyChange)] SyncImportHierarchyChange_req SyncImportHierarchyChange;
    [case(RopSynchronizationImportDeletes)] SyncImportDeletes_req SyncImportDeletes;
    [case(RopSynchronizationUploadStateStreamBegin)] SyncUploadStateStreamBegin_req SyncUploadStateStreamBegin;
    [case(RopSynchronizationUploadStateStreamContinue)] SyncUploadStateStreamContinue_req SyncUploadStateStreamContinue;
    [case(RopSynchronizationUploadStateStreamEnd)] SyncUploadStateStreamEnd_req SyncUploadStateStreamEnd;
    [case(RopSynchronizationImportMessageMove)] SyncImportMessageMove_req SyncImportMessageMove;
    [case(RopSetPropertiesNoReplicate)] SetPropertiesNoReplicate_req SetPropertiesNoReplicate;
    [case(RopDeletePropertiesNoReplicate)] DeletePropertiesNoReplicate_req DeletePropertiesNoReplicate;
    [case(RopGetStoreState)] GetStoreState_req GetStoreState;
    [case(RopSynchronizationOpenCollector)] SyncOpenCollector_req SyncOpenCollector;
    [case(RopGetLocalReplicaIds)] GetLocalReplicaIds_req GetLocalReplicaIds;
    [case(RopSynchronizationImportReadStateChanges)] SyncImportReadStateChanges_req SyncImportReadStateChanges;
    [case(RopResetTable)] ResetTable_req ResetTable;
    [case(RopSynchronizationGetTransferState)] SyncGetTransferState_req SyncGetTransferState;
    [case(RopOpenPublicFolderByName)] OpenPublicFolderByName_req OpenPublicFolderByName;
    [case(RopSetSyncNotificationGuid)] SetSyncNotificationGuid_req SetSyncNotificationGuid;
    [case(RopFreeBookmark)] FreeBookmark_req FreeBookmark;
    [case(RopWriteAndCommitStream)] WriteAndCommitStream_req WriteAndCommitStream;
    [case(RopHardDeleteMessages)] HardDeleteMessages_req HardDeleteMessages;
    [case(RopHardDeleteMessagesAndSubfolders)] HardDeleteMessagesAndSubfolders_req HardDeleteMessagesAndSubfolders;
    [case(RopLogon)] Logon_req Logon;
    [default];
  } RopRequest;

  typedef [public, nodiscriminant] union {
    [case(RopRelease)] Release_repl Release;
    [case(RopOpenFolder)] OpenFolder_repl OpenFolder;
    [case(RopOpenMessage)] OpenMessage_repl OpenMessage;
    [case(RopGetHierarchyTable)] GetHierarchyTable_repl GetHierarchyTable;
    [case(RopGetContentsTable)] GetContentsTable_repl GetContentsTable;
    [case(RopCreateMessage)] CreateMessage_repl CreateMessage;
    [case(RopGetPropertiesSpecific)] GetProps_repl GetProps;
    [case(RopGetPropertiesAll)] GetPropsAll_repl GetPropsAll;
    [case(RopGetPropertiesList)] GetPropList_repl GetPropList;
    [case(RopSetProperties)] SetProps_repl SetProps;
    [case(RopDeleteProperties)] DeleteProps_repl DeleteProps;
    [case(RopSaveChangesMessage)] SaveChangesMessage_repl SaveChangesMessage;
    [case(RopRemoveAllRecipients)] RemoveAllRecipients_repl RemoveAllRecipients;
    [case(RopModifyRecipients)] ModifyRecipients_repl ModifyRecipients;
    [case(RopReadRecipients)] ReadRecipients_repl ReadRecipients;
    [case(RopSetMessageReadFlag)] SetMessageReadFlag_repl SetMessageReadFlag;
    [case(RopReloadCachedInformation)] ReloadCachedInformation_repl ReloadCachedInformation;
    [case(RopSetColumns)] SetColumns_repl SetColumns;
    [case(RopSortTable)] SortTable_repl SortTable;
    [case(RopRestrict)] Restrict_repl Restrict;
    [case(RopQueryRows)] QueryRows_repl QueryRows;
    [case(RopGetStatus)] GetStatus_repl GetStatus;
    [case(RopQueryPosition)] QueryPosition_repl QueryPosition;
    [case(RopSeekRow)] SeekRow_repl SeekRow;
    [case(RopSeekRowBookmark)] SeekRowBookmark_repl SeekRowBookmark;
    [case(RopSeekRowFractional)] SeekRowApprox_repl SeekRowApprox;
    [case(RopCreateBookmark)] CreateBookmark_repl CreateBookmark;
    [case(RopCreateFolder)] CreateFolder_repl CreateFolder;
    [case(RopDeleteFolder)] DeleteFolder_repl DeleteFolder;
    [case(RopDeleteMessages)] DeleteMessages_repl DeleteMessages;
    [case(RopSetMessageStatus)] SetMessageStatus_repl SetMessageStatus;
    [case(RopGetAttachmentTable)] GetAttachmentTable_repl GetAttachmentTable;
    [case(RopOpenAttachment)] OpenAttach_repl OpenAttach;
    [case(RopCreateAttachment)] CreateAttach_repl CreateAttach;
    [case(RopDeleteAttachment)] DeleteAttach_repl DeleteAttach;
    [case(RopSaveChangesAttachment)] SaveChangesAttachment_repl SaveChangesAttachment;
    [case(RopSetReceiveFolder)] SetReceiveFolder_repl SetReceiveFolder;
    [case(RopGetReceiveFolder)] GetReceiveFolder_repl GetReceiveFolder;
    [case(RopRegisterNotification)] RegisterNotification_repl Advise;
    [case(RopNotify)] Notify_repl Notify;
    [case(RopOpenStream)] OpenStream_repl OpenStream;
    [case(RopReadStream)] ReadStream_repl ReadStream;
    [case(RopWriteStream)] WriteStream_repl WriteStream;
    [case(RopSeekStream)] SeekStream_repl SeekStream;
    [case(RopSetStreamSize)] SetStreamSize_repl SetStreamSize;
    [case(RopSetSearchCriteria)] SetSearchCriteria_repl SetSearchCriteria;
    [case(RopGetSearchCriteria)] GetSearchCriteria_repl GetSearchCriteria;
    [case(RopSubmitMessage)] SubmitMessage_repl SubmitMessage;
    [case(RopMoveCopyMessages)] MoveCopyMessages_repl MoveCopyMessages;
    [case(RopAbortSubmit)] AbortSubmit_repl AbortSubmit;
    [case(RopMoveFolder)] MoveFolder_repl MoveFolder;
    [case(RopCopyFolder)] CopyFolder_repl CopyFolder;
    [case(RopQueryColumnsAll)] QueryColumnsAll_repl QueryColumnsAll;
    [case(RopAbort)] Abort_repl Abort;
    [case(RopCopyTo)] CopyTo_repl CopyTo;
    [case(RopCopyToStream)] CopyToStream_repl CopyToStream;
    [case(RopCloneStream)] CloneStream_repl CloneStream;
    [case(RopGetPermissionsTable)] GetPermissionsTable_repl GetPermissionsTable;
    [case(RopGetRulesTable)] GetRulesTable_repl GetRulesTable;
    [case(RopModifyPermissions)] ModifyPermissions_repl ModifyPermissions;
    [case(RopModifyRules)] ModifyRules_repl ModifyRules;
    [case(RopGetOwningServers)] GetOwningServers_repl GetOwningServers;
    [case(RopLongTermIdFromId)] LongTermIdFromId_repl LongTermIdFromId;
    [case(RopIdFromLongTermId)] IdFromLongTermId_repl IdFromLongTermId;
    [case(RopPublicFolderIsGhosted)] PublicFolderIsGhosted_repl PublicFolderIsGhosted;
    [case(RopOpenEmbeddedMessage)] OpenEmbeddedMessage_repl OpenEmbeddedMessage;
    [case(RopSetSpooler)] SetSpooler_repl SetSpooler;
    [case(RopSpoolerLockMessage)] SpoolerLockMessage_repl SpoolerLockMessage;
    [case(RopGetAddressTypes)] AddressTypes_repl AddressTypes;
    [case(RopTransportSend)] TransportSend_repl TransportSend;
    [case(RopFastTransferSourceGetBuffer)] FastTransferSourceGetBuffer_repl FastTransferSourceGetBuffer;
    [case(RopFindRow)] FindRow_repl FindRow;
    [case(RopProgress)] Progress_repl Progress;
    [case(RopTransportNewMail)] TransportNewMail_repl TransportNewMail;
    [case(RopGetValidAttachments)] GetValidAttachments_repl GetValidAttachments;
    [case(RopGetNamesFromPropertyIds)] GetNamesFromIDs_repl GetNamesFromIDs;
    [case(RopGetPropertyIdsFromNames)] GetIDsFromNames_repl GetIDsFromNames;
    [case(RopUpdateDeferredActionMessages)] UpdateDeferredActionMessages_repl UpdateDeferredActionMessages;
    [case(RopEmptyFolder)] EmptyFolder_repl EmptyFolder;
    [case(RopExpandRow)] ExpandRow_repl ExpandRow;
    [case(RopCollapseRow)] CollapseRow_repl CollapseRow;
    [case(RopLockRegionStream)] LockRegionStream_repl LockRegionStream;
    [case(RopUnlockRegionStream)] UnlockRegionStream_repl UnlockRegionStream;
    [case(RopCommitStream)] CommitStream_repl CommitStream;
    [case(RopGetStreamSize)] GetStreamSize_repl GetStreamSize;
    [case(RopQueryNamedProperties)] QueryNamedProperties_repl QueryNamedProperties;
    [case(RopGetPerUserLongTermIds)] GetPerUserLongTermIds_repl GetPerUserLongTermIds;
    [case(RopGetPerUserGuid)] GetPerUserGuid_repl GetPerUserGuid;
    [case(RopReadPerUserInformation)] ReadPerUserInformation_repl ReadPerUserInformation;
    [case(RopSetReadFlags)] SetReadFlags_repl SetReadFlags;
    [case(RopCopyProperties)] CopyProperties_repl CopyProperties;
    [case(RopGetReceiveFolderTable)] GetReceiveFolderTable_repl GetReceiveFolderTable;
    [case(RopPending)] Pending_repl Pending;
    [case(RopGetCollapseState)] GetCollapseState_repl GetCollapseState;
    [case(RopSetCollapseState)] SetCollapseState_repl SetCollapseState;
    [case(RopGetTransportFolder)] GetTransportFolder_repl GetTransportFolder;
    [case(RopOptionsData)] OptionsData_repl OptionsData;
    [case(RopSynchronizationConfigure)] SyncConfigure_repl SyncConfigure;
    [case(RopSynchronizationImportMessageChange)] SyncImportMessageChange_repl SyncImportMessageChange;
    [case(RopSynchronizationImportHierarchyChange)] SyncImportHierarchyChange_repl SyncImportHierarchyChange;
    [case(RopSynchronizationImportDeletes)] SyncImportDeletes_repl SyncImportDeletes;
    [case(RopSynchronizationUploadStateStreamBegin)] SyncUploadStateStreamBegin_repl SyncUploadStateStreamBegin;
    [case(RopSynchronizationUploadStateStreamContinue)] SyncUploadStateStreamContinue_repl SyncUploadStateStreamContinue;
    [case(RopSynchronizationUploadStateStreamEnd)] SyncUploadStateStreamEnd_repl SyncUploadStateStreamEnd;
    [case(RopSynchronizationImportMessageMove)] SyncImportMessageMove_repl SyncImportMessageMove;
    [case(RopSetPropertiesNoReplicate)] SetPropertiesNoReplicate_repl SetPropertiesNoReplicate;
    [case(RopDeletePropertiesNoReplicate)] DeletePropertiesNoReplicate_repl DeletePropertiesNoReplicate;
    [case(RopGetStoreState)] GetStoreState_repl GetStoreState;
    [case(RopSynchronizationOpenCollector)] SyncOpenCollector_repl SyncOpenCollector;
    [case(RopGetLocalReplicaIds)] GetLocalReplicaIds_repl GetLocalReplicaIds;
    [case(RopSynchronizationImportReadStateChanges)] SyncImportReadStateChanges_repl SyncImportReadStateChanges;
    [case(RopResetTable)] ResetTable_repl ResetTable;
    [case(RopSynchronizationGetTransferState)] SyncGetTransferState_repl SyncGetTransferState;
    [case(RopOpenPublicFolderByName)] OpenPublicFolderByName_repl OpenPublicFolderByName;
    [case(RopSetSyncNotificationGuid)] SetSyncNotificationGuid_repl SetSyncNotificationGuid;
    [case(RopFreeBookmark)] FreeBookmark_repl FreeBookmark;
    [case(RopWriteAndCommitStream)] WriteAndCommitStream_repl WriteAndCommitStream;
    [case(RopHardDeleteMessages)] HardDeleteMessages_repl HardDeleteMessages;
    [case(RopHardDeleteMessagesAndSubfolders)] HardDeleteMessagesAndSubfolders_repl HardDeleteMessagesAndSubfolders;
    [case(RopLogon)] Logon_repl Logon;
    [case(RopBufferTooSmall)] RopBufferTooSmall_repl RopBufferTooSmall;
    [default];
  } RopReply;

  typedef [public,flag(NDR_NOALIGN)] struct {
    uint8   opnum;
    [switch_is(opnum)] RopRequest u;
  } EcDoRpcMapiRequest;

  typedef [public,nopush,nopull,noprint,flag(NDR_NOALIGN)] struct {
    uint8       opnum;
    /*uint8       handle_idx;
    MAPISTATUS  error_code;*/
    [switch_is(opnum)] RopReply u;
  } EcDoRpcMapiResponse;

  typedef [public,nopull,nopush,noprint] struct {
    uint32      mapi_len; /* whole mapi_data length */
    uint16      length;   /* obfuscated: content length */
    EcDoRpcMapiRequest  rpcRequest; /* obfuscated */
    uint32      *handles; /* obfuscated: handles id array */
  } mapi_request;

  typedef [public,nopull,nopush,noprint] struct {
    uint32      mapi_len;
    uint16      length;               /* obfuscated: content length */
    EcDoRpcMapiResponse rpcResponse; /* obfuscated */
    uint32      *handles;            /* obfuscated: handles id array */
  } mapi_response;

  WERROR mapi_EcDoRpc(
    [in,out]            policy_handle *handle,
    [in,out]            uint32    *size,
    [in,out]            uint32    *offset,
    [in]  [flag(NDR_REMAINING|NDR_NOALIGN)]  mapi_request  *mapi_request,
    [out] [flag(NDR_REMAINING|NDR_NOALIGN)]  mapi_response *mapi_response,
    [in,out]            uint16    *length,
    [in]                uint16    max_data
    );

  /******************/
  /* Function: 0x03 */
  WERROR mapi_EcGetMoreRpc(
    [in, out, ref] policy_handle * pcxh,
    [in][out] [size_is(usSize), length_is(*pusLength)] uint8 *rgb,
    [in][out] uint16 *pusLength, 
    [in] uint16 usSize
    );

  /******************/
  /* Function: 0x04 */
  WERROR mapi_EcRRegisterPushNotification(
    [in, out, ref] policy_handle * handle,
    [in] uint32 iRpc,
    [in] [size_is(cbContext)] uint8 *rgbContext,
    [in] uint16 cbContext,
    [in] uint32 grbitMapiAdviseBits,
    [in, size_is(cbCallbackAddress)] uint8 *rgbCallbackAddress,
    [in] uint16 cbCallbackAddress,
    [out] uint32 *hNotification
    );

  /******************/
  /* Function: 0x05 */
  WERROR mapi_EcRUnregisterPushNotification(
   [in,out]  policy_handle   *handle,
   [in]    uint32      iRpc,
   [in]    uint32      hNotification
   );

  /******************/
  /* Function: 0x06 */
  WERROR mapi_EcDummyRpc(
    );

  /******************/
  /* Function: 0x07 */
  WERROR mapi_EcRGetDCName(
    [in,out]  policy_handle   *handle,
    [in][string] uint8* szDomainName,
    [out] uint8 rgchDomainController[16]
    );

  /******************/
  /* Function: 0x08 */
  WERROR mapi_EcRNetGetDCName(
    [in][string] uint8* szDomainName,
    [out] uint8 rgchDomainController[16]
    );

  /******************/
  /* Function: 0x09 */
  WERROR mapi_EcDoRpcExt(
    [in, out, ref]      policy_handle * pcxh,
    [in, out]           RpcExt2Flags *pulFlags,
    [in, represent_as(4)] RgbIn *rgbIn,
    [in]                uint32 cbIn,
    [out, length_is(*pcbOut), size_is(*pcbOut)] RgbOut *rgbOut,
    [in, out] [range(0x0, 0x40000)] uint32 *pcbOut,
    [in,represent_as(4),flag(NDR_NOALIGN|NDR_REMAINING)] AuxInfo  *rgbAuxIn,
    [in] uint32 cbAuxIn,
    [out] uint32 *pulTransTime
    );

  /******************/
  /* Function: 0x0a */
  typedef [enum8bit,flag(NDR_PAHEX)] enum {
    AUX_TYPE_PERF_REQUESTID   = 0x01,
    AUX_TYPE_PERF_CLIENTINFO = 0x02,
    AUX_TYPE_PERF_SERVERINFO  = 0x03,
    AUX_TYPE_PERF_SESSIONINFO = 0x04,
    AUX_TYPE_PERF_DEFMDB_SUCCESS  = 0x05,
    AUX_TYPE_PERF_DEFGC_SUCCESS = 0x06,
    AUX_TYPE_PERF_MDB_SUCCESS = 0x07,
    AUX_TYPE_PERF_GC_SUCCESS  = 0x08,
    AUX_TYPE_PERF_FAILURE   = 0x09,
    AUX_TYPE_CLIENT_CONTROL   = 0x0A,
    AUX_TYPE_PERF_PROCESSINFO = 0x0B,
    AUX_TYPE_PERF_BG_DEFMDB_SUCCESS = 0x0C,
    AUX_TYPE_PERF_BG_DEFGC_SUCCESS  = 0x0D,
    AUX_TYPE_PERF_BG_MDB_SUCCESS  = 0x0E,
    AUX_TYPE_PERF_BG_GC_SUCCESS = 0x0F,
    AUX_TYPE_PERF_BG_FAILURE  = 0x10,
    AUX_TYPE_PERF_FG_DEFMDB_SUCCESS = 0x11,
    AUX_TYPE_PERF_FG_DEFGC_SUCCESS  = 0x12,
    AUX_TYPE_PERF_FG_MDB_SUCCESS  = 0x13,
    AUX_TYPE_PERF_FG_GC_SUCCESS = 0x14,
    AUX_TYPE_PERF_FG_FAILURE  = 0x15,
    AUX_TYPE_OSVERSIONINFO    = 0x16,
    AUX_TYPE_EXORGINFO    = 0x17,
    AUX_TYPE_PERF_ACCOUNTINFO = 0x18,
    AUX_TYPE_SERVER_CAPABILITIES = 0x46,
    AUX_TYPE_ENDPOINT_CAPABILITIES = 0x48,
    AUX_CLIENT_CONNECTION_INFO = 0x4A,
    AUX_SERVER_SESSION_INFO = 0x4B,
    AUX_PROTOCOL_DEVICE_IDENTIFICATION = 0x4E
  } AUX_HEADER_TYPE_1;
 
  typedef [enum8bit,flag(NDR_PAHEX)] enum {
    AUX_TYPE_PERF_SESSIONINFO_2     = 0x04,
    AUX_TYPE_PERF_MDB_SUCCESS_2     = 0x07,
    AUX_TYPE_PERF_GC_SUCCESS_2      = 0x08,
    AUX_TYPE_PERF_FAILURE_2         = 0x09,
    AUX_TYPE_PERF_PROCESSINFO_2     = 0x0B,
    AUX_TYPE_PERF_BG_MDB_SUCCESS_2  = 0x0E,
    AUX_TYPE_PERF_BG_GC_SUCCESS_2   = 0x0F,
    AUX_TYPE_PERF_BG_FAILURE_2      = 0x10,
    AUX_TYPE_PERF_FG_MDB_SUCCESS_2  = 0x13,
    AUX_TYPE_PERF_FG_GC_SUCCESS_2   = 0x14,
    AUX_TYPE_PERF_FG_FAILURE_2      = 0x15
  } AUX_HEADER_TYPE_2;

  typedef [public,enum8bit,flag(NDR_PAHEX)] enum {
    AUX_VERSION_1 = 0x1,
    AUX_VERSION_2 = 0x2
  } AUX_VERSION;
 
  typedef [switch_type(uint8)] union {
    [case(AUX_VERSION_1)] AUX_HEADER_TYPE_1 Type;
    [case(AUX_VERSION_2)] AUX_HEADER_TYPE_2 Type_2;
    [default];
  } AUX_HEADER_TYPE_ENUM;
 
  /*************************/
  /* AUX_HEADER case (0x1) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    SessionID;
    uint16    RequestID;
  } AUX_PERF_REQUESTID;
 
  /*************************/
  /* AUX_HEADER case (0x2) */
  typedef [public,enum16bit, flag(NDR_PAHEX)] enum {
    CLIENTMODE_UNKNOWN  = 0x0,
    CLIENTMODE_CLASSIC  = 0x1,
    CLIENTMODE_CACHED = 0x2
  } ClientMode;
 
  typedef [public,flag(NDR_NOALIGN)] struct {
    uint32    AdapterSpeed;
    uint16    ClientID;
    uint16    MachineNameOffset;
    uint16    UserNameOffset;
    uint16    ClientIPSize;
    uint16    ClientIPOffset;
    uint16    ClientIPMaskSize;
    uint16    ClientIPMaskOffset;
    uint16    AdapterNameOffset;
    uint16    MacAddressSize;
    uint16    MacAddressOffset;
    ClientMode  ClientMode;
    uint16    Reserved;
    nstring   MachineName;
    nstring   UserName;
    uint8   ClientIP[0];
    uint8   ClientIPMask[0];
    nstring   AdapterName;
    uint8   MacAddress[0];
  } AUX_PERF_CLIENTINFO;
 
  /*************************/
  /* AUX_HEADER case (0x3) */
  typedef [enum16bit,flag(NDR_PAHEX)] enum {
    SERVERTYPE_UNKNOWN    = 0x0,
    SERVERTYPE_PRIVATE    = 0x1,
    SERVERTYPE_PUBLIC   = 0x2,
    SERVERTYPE_DIRECTORY    = 0x3,
    SERVERTYPE_REFERRAL   = 0x4
  } SERVERINFO_ServerType;
 
  typedef [flag(NDR_NOALIGN)] struct {
    uint16      ServerID;
    SERVERINFO_ServerType ServerType;
    uint16      ServerDNOffset;
    uint16      ServerNameOffset;
    nstring     ServerDN;
    nstring     ServerName;
  } AUX_PERF_SERVERINFO;
 
  /*************************/
  /* AUX_HEADER case (0x4) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    SessionID;
    uint16    Reserved;
    GUID    SessionGuid;
  } AUX_PERF_SESSIONINFO;
 
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    SessionID;
    uint16    Reserved;
    GUID    SessionGuid;
    uint32    ConnectionID;
  } AUX_PERF_SESSIONINFO_V2;
 
  /**************************/
  /* AUX_HEADER case (0x5)  */
  /* AUX_HEADER case (0xC)  */
  /* AUX_HEADER case (0x11) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
    uint16    RequestID;
    uint16    Reserved;
  } AUX_PERF_DEFMDB_SUCCESS;
 
  /**************************/
  /* AUX_HEADER case (0x6)  */
  /* AUX_HEADER case (0xD)  */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ServerID;
    uint16    SessionID;
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
    uint8   RequestOperation;
    uint8   Reserved[3];
  } AUX_PERF_DEFGC_SUCCESS;
 
  /**************************/
  /* AUX_HEADER case (0x7)  */
  /* AUX_HEADER case (0xE)  */

  /* AUX_HEADER case (0x13) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint16    RequestID;
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
  } AUX_PERF_MDB_SUCCESS;
 
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ProcessID;
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint16    RequestID;
    uint16    Reserved;
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
  } AUX_PERF_MDB_SUCCESS_V2;
 
  /**************************/
  /* AUX_HEADER case (0x8)  */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint16    Reserved_1;
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
    uint8   RequestOperation;
    uint8   Reserved_2[3];
  } AUX_PERF_GC_SUCCESS;
 
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ProcessID;
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint32    TimeSinceRequest;
    uint32    TimeToCompleteRequest;
    uint8   RequestOperation;
    uint8   Reserved[3];
  } AUX_PERF_GC_SUCCESS_V2;
 
  /**************************/
  /* AUX_HEADER case (0x9)  */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint16    RequestID;
    uint32    TimeSinceRequest;
    uint32    TimeToFailRequest;
    MAPISTATUS  ResultCode;
    uint8   RequestOperation;
    uint8   Reserved[3];
  } AUX_PERF_FAILURE;
 
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ProcessID;
    uint16    ClientID;
    uint16    ServerID;
    uint16    SessionID;
    uint16    RequestID;
    uint16    Reserved_1;
    uint32    TimeSinceRequest;
    uint32    TimeToFailRequest;
    MAPISTATUS  ResultCode;
    uint8   RequestOperation;
    uint8   Reserved_2[3];
  } AUX_PERF_FAILURE_V2;
 
  /**************************/
  /* AUX_HEADER case (0xA)  */
  typedef [bitmap32bit] bitmap {
    ENABLE_PERF_SENDTOSERVER  = 0x00000001,
    ENABLE_PERF_SENDTOMAILBOX = 0x00000002,
    ENABLE_COMPRESSION    = 0x00000004,
    ENABLE_HTTP_TUNNELING   = 0x00000008,
    ENABLE_PERF_SENDGCDATA    = 0x00000010
  } CLIENT_CONTROL_EnableFlags;
 
  typedef [flag(NDR_NOALIGN)] struct {
    CLIENT_CONTROL_EnableFlags  EnableFlags;
    uint32        ExpiryTime;
  } AUX_CLIENT_CONTROL;
 
  /*************************/
  /* AUX_HEADER case (0xB) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint16    ProcessID;
    uint16    Reserved1;
    GUID    ProcessGuid;
    uint16    ProcessNameOffset;
    uint16    Reserved2;
    nstring   ProcessName;
  } AUX_PERF_PROCESSINFO;
 
  /**************************/
  /* AUX_HEADER case (0x16) */
  typedef [flag(NDR_NOALIGN)] struct {
    uint32    OSVersionInfoSize;
    uint32    MajorVersion;
    uint32    MinorVersion;
    uint32    BuildNumber;
    [flag(NDR_NOALIGN|NDR_REMAINING)] DATA_BLOB Reserved_1;
    uint16    ServicePackMajor;
    uint16    ServicePackMinor;
    uint32    Reserved_2;
  } AUX_OSVERSIONINFO;
 
  /**************************/
  /* AUX_HEADER case (0x17) */
  typedef [bitmap32bit] bitmap {
    PUBLIC_FOLDERS_ENABLED  = 0x00000001
  } EXORGINFO_OrgFlags;
 
  typedef [flag(NDR_NOALIGN)] struct {
    EXORGINFO_OrgFlags  OrgFlags;
  } AUX_EXORGINFO;

  typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
    [case(AUX_TYPE_PERF_REQUESTID)]   AUX_PERF_REQUESTID    AuxiliaryPerfRequestId;
    [case(AUX_TYPE_PERF_CLIENTINFO)] AUX_PERF_CLIENTINFO   AuxiliaryPerfClientInfo;
    [case(AUX_TYPE_PERF_SERVERINFO)]  AUX_PERF_SERVERINFO   AuxiliaryPerfServerInfo;
    [case(AUX_TYPE_PERF_SESSIONINFO)] AUX_PERF_SESSIONINFO    AuxiliaryPerfSessionInfo;
    [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)]  AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfDefmdbSuccess;
    [case(AUX_TYPE_PERF_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfDefgcSuccess;
    [case(AUX_TYPE_PERF_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS    AuxiliaryPerfMdbSuccess;
    [case(AUX_TYPE_PERF_GC_SUCCESS)]  AUX_PERF_GC_SUCCESS   AuxiliaryPerfGcSuccess;
    [case(AUX_TYPE_PERF_FAILURE)]   AUX_PERF_FAILURE    AuxiliaryPerfFailure;
    [case(AUX_TYPE_CLIENT_CONTROL)]   AUX_CLIENT_CONTROL    AuxiliaryClientControl;
    [case(AUX_TYPE_PERF_PROCESSINFO)] AUX_PERF_PROCESSINFO    AuxiliaryPerfProcessInfo;
    [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfBgDefmdbSuccess;
    [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfBgDefgcSuccess;
    [case(AUX_TYPE_PERF_BG_MDB_SUCCESS)]  AUX_PERF_MDB_SUCCESS    AuxiliaryPerfBgMdbSuccess;
    [case(AUX_TYPE_PERF_BG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS   AuxiliaryPerfBgGcSuccess;
    [case(AUX_TYPE_PERF_BG_FAILURE)]  AUX_PERF_FAILURE    AuxiliaryPerfBgFailure;
    [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfFgDefmdbSuccess;
    [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfFgDefgcSuccess;
    [case(AUX_TYPE_PERF_FG_MDB_SUCCESS)]  AUX_PERF_MDB_SUCCESS    AuxiliaryPerfFgMdbSuccess;
    [case(AUX_TYPE_PERF_FG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS   AuxiliaryPerFGGCSuccess;
    [case(AUX_TYPE_PERF_FG_FAILURE)]  AUX_PERF_FAILURE    AuxiliaryPerfFgFailure;
    [case(AUX_TYPE_OSVERSIONINFO)]    AUX_OSVERSIONINFO   AuxiliaryOSVersionInfo;
    [case(AUX_TYPE_EXORGINFO)]    AUX_EXORGINFO     AuxiliaryEXOrgInfo;
    [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB  Payload;
  } AuxDataVersion1;

  typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
    [case(AUX_TYPE_PERF_REQUESTID)]   AUX_PERF_REQUESTID    AuxiliaryPerfRequestId;
    [case(AUX_TYPE_PERF_CLIENTINFO)] AUX_PERF_CLIENTINFO   AuxiliaryPerfClientInfo;
    [case(AUX_TYPE_PERF_SERVERINFO)]  AUX_PERF_SERVERINFO   AuxiliaryPerfServerInfo;
    [case(AUX_TYPE_PERF_SESSIONINFO_2)] AUX_PERF_SESSIONINFO_V2   AuxiliaryPerfSessioninfo;  /* V2 specific */
    [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)]  AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfDefmdbSuccess;
    [case(AUX_TYPE_PERF_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfDefgcSuccess;
    [case(AUX_TYPE_PERF_MDB_SUCCESS_2)] AUX_PERF_MDB_SUCCESS_V2   AuxiliaryPerfMdbSuccess;  /* V2 specific */
    [case(AUX_TYPE_PERF_GC_SUCCESS_2)]  AUX_PERF_GC_SUCCESS_V2    AuxiliaryPerfGcSuccess;   /* V2 specific */
    [case(AUX_TYPE_PERF_FAILURE_2)]   AUX_PERF_FAILURE_V2   AuxiliaryPerfFailure;    /* V2 specific*/
    [case(AUX_TYPE_CLIENT_CONTROL)]   AUX_CLIENT_CONTROL    AuxiliaryPerf;
    [case(AUX_TYPE_PERF_PROCESSINFO_2)] AUX_PERF_PROCESSINFO    AuxiliaryPerfProcessInfo;
    [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfBgDefmdbSuccess;
    [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfBgDefgcSuccess;
    [case(AUX_TYPE_PERF_BG_MDB_SUCCESS_2)]  AUX_PERF_MDB_SUCCESS_V2    AuxiliaryPerfBgMdbSuccess;
    [case(AUX_TYPE_PERF_BG_GC_SUCCESS_2)] AUX_PERF_GC_SUCCESS   AuxiliaryPerfBgGcSuccess;
    [case(AUX_TYPE_PERF_BG_FAILURE_2)]  AUX_PERF_FAILURE    AuxiliaryPerfBgFailure;
    [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS   AuxiliaryPerfFgDefmdbSuccess;
    [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)]  AUX_PERF_DEFGC_SUCCESS    AuxiliaryPerfFgDefgcSuccess;
    [case(AUX_TYPE_PERF_FG_MDB_SUCCESS_2)]  AUX_PERF_MDB_SUCCESS    AuxiliaryPerfFgMdbSuccess;
    [case(AUX_TYPE_PERF_FG_GC_SUCCESS_2)] AUX_PERF_GC_SUCCESS   AuxiliaryPerFGGCSuccess;
    [case(AUX_TYPE_PERF_FG_FAILURE_2)]  AUX_PERF_FAILURE    AuxiliaryPerfFgFailure;
    [case(AUX_TYPE_OSVERSIONINFO)]    AUX_OSVERSIONINFO   AuxiliaryOSVersionInfo;
    [case(AUX_TYPE_EXORGINFO)]    AUX_EXORGINFO     AuxiliaryEXOrgInfo;
    [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB  Payload;
  } AuxDataVersion2;

  typedef [public,switch_type(uint8)] union {
    [case(AUX_VERSION_1)] AuxDataVersion1 Version1;
    [case(AUX_VERSION_2)] AuxDataVersion2 Version2;
    [default];
  } AUX_DATA;

  typedef [public,nopull,noprint,flag(NDR_NOALIGN)] struct {
    uint16                Size;
    AUX_VERSION           Version;
    
    /* Switch based on the version. Not really a union in NDR */
    [switch_is(Version)]  AUX_HEADER_TYPE_ENUM  hdrType;

    /* Switch based on the version and header type */
    AUX_DATA  AuxData ;
  } AUX_HEADER;

  typedef [public,bitmap16bit] bitmap {
    RHEF_Compressed = 0x0001,
    RHEF_XorMagic   = 0x0002,
    RHEF_Last       = 0x0004
  } RPC_HEADER_EXT_Flags;
 
  typedef [public] struct {
    uint16      Version;
    RPC_HEADER_EXT_Flags  Flags;
    uint16      Size;
    uint16      SizeActual;
  } RPC_HEADER_EXT;

  typedef [public,nopull,noprint] struct {
    uint32 auxInSize;
    RPC_HEADER_EXT RpcHeaderExtension;
    AUX_HEADER  auxHeader[0]; /* Plain LZ77 Compressed */
  } AuxInfo;

  typedef [public,nopull,noprint] struct {
    RPC_HEADER_EXT RpcHeaderExtension;
    AUX_HEADER  auxHeader[0]; /* Plain LZ77 Compressed */
  } AuxInfoOut;

  WERROR mapi_EcDoConnectEx(
    [out]                       policy_handle *handle,
    [in,string,charset(DOS)]    uint8         szUserDN[],
    [in]        uint32          ulFlags,
    [in]        uint32          ulConMod,
    [in]        uint32          cbLimit,
    [in]        uint32          ulCpid,
    [in]        uint32          ulLcidString,
    [in]        uint32          ulLcidSort,
    [in]        uint32          ulIcxrLink,
    [in]        uint16          usFCanConvertCodePages,
    [out]       uint32          *pcmsPollsMax,
    [out]       uint32          *pcRetry,
    [out]       uint32          *pcmsRetryDelay,
    [out]       uint32          *picxr,
    [out,unique,ref,string,charset(DOS)]uint8         **szDNPrefix,
    [out,unique,ref,string,charset(DOS)]uint8         **szDisplayName,
    [in,string]  uint8    rgwClientVersion[6],
    [out,string] uint8    rgwServerVersion[6],
    [out,string] uint8    rgwBestVersion[6],
    [in,out]      uint32          *pulTimeStamp,
    [in,represent_as(4),flag(NDR_NOALIGN|NDR_REMAINING)] AuxInfo  *rgbAuxIn,
    [in]        uint32          cbAuxIn,
    [out,size_is(*pcbAuxOut),length_is(0)] AuxInfoOut *rgbAuxOut,
    [in,out][range(0,0x1008)] uint32       *pcbAuxOut
    );

  /******************/
  /* Function: 0x0b */

  typedef [noprint, bitmap32bit] bitmap {
    NoCompression = 0x00000001,
    NoXorMagic    = 0x00000002,
    Chain         = 0x00000004
  } RpcExt2Flags;

  typedef [public,flag(NDR_NOALIGN)] struct {
    ROP_OPNUM   RopId;
    [switch_is(RopId)] RopRequest u;
  } RopInput;

  typedef [public,nopull] struct {
    uint16 ropSize;
    RopInput rop[0];
    uint32 objectHandles[0]; /* ServerObjectHandleTable */
  } ROPInputBuffer;

  typedef [public,nopull] struct {
    RPC_HEADER_EXT RpcHeaderExtension;
    [flag(NDR_REMAINING|NDR_NOALIGN)] ROPInputBuffer  ropIn;
  } RgbIn;

  typedef [public,flag(NDR_NOALIGN)] struct {
    ROP_OPNUM   RopId;
    [switch_is(RopId)] RopReply u;
  } RopOutput;

  typedef [public,nopull] struct {
    uint16 ropSize;
    RopOutput rop[0];
    uint32 objectHandles[0]; /* ServerObjectHandleTable */
  } ROPOutputBuffer;

  typedef [public,nopull] struct {
    RPC_HEADER_EXT              RpcHeaderExtension;
    [flag(NDR_REMAINING|NDR_NOALIGN)] ROPOutputBuffer  ropOut;
  } RgbOut;

  WERROR mapi_EcDoRpcExt2(
    [in, out, ref]      policy_handle * pcxh,
    [in, out]           RpcExt2Flags *pulFlags,
    [in, represent_as(4)] RgbIn *rgbIn,
    [in]                uint32 cbIn,
    [out, length_is(*pcbOut), size_is(*pcbOut)] RgbOut *rgbOut,
    [in, out] [range(0x0, 0x40000)] uint32 *pcbOut,
    [in,represent_as(4),flag(NDR_NOALIGN|NDR_REMAINING)] AuxInfo  *rgbAuxIn,
    [in] uint32 cbAuxIn,
    [out,size_is(*pcbAuxOut),length_is(0)] AuxInfoOut *rgbAuxOut,
    [in, out] [range(0x0, 0x1008)] uint32 *pcbAuxOut,
    [out] uint32 *pulTransTime
    );

  /******************/
  /* Function: 0x0c */
  WERROR mapi_EcDoAsyncConnect(
    [in] policy_handle *cxh,
    [out, ref] policy_handle * pacxh
    );

  /******************/
  /* Function: 0x0d */
  WERROR mapi_EcDoAsyncWait(
    [in] policy_handle *cxh,
    [in] long ulFlagsIn, 
    [out] long *pulFlagsOut
    );

  /******************/
  /* Function: 0x0e */
  WERROR mapi_EcDoAsyncConnectEx(
    [in] policy_handle *cxh,
    [out, ref] policy_handle * pacxh
    );
}