aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include/any-windows-any/mi.h
blob: fd582ae1d5b2c106f5b6850d0e90c1e25dca1c76 (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
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the mingw-w64 runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */

#include <winapifamily.h>

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

#ifndef _MI_h
#define _MI_h

#include <stddef.h>
#include <stdio.h>
#include <string.h>

#pragma pack(push, 8)

#if defined(MI_CHAR_TYPE)
#if (MI_CHAR_TYPE != 1) && (MI_CHAR_TYPE != 2)
#error "MI_CHAR_TYPE must be 1 or 2"
#endif
#else
#define MI_CHAR_TYPE 2
#endif

#if (MI_CHAR_TYPE == 2)
#define MI_USE_WCHAR
#endif

#ifndef MI_CONST
#define MI_CONST const
#endif

#define MI_MAJOR ((MI_Uint32)1)
#define MI_MINOR ((MI_Uint32)0)
#define MI_REVISON ((MI_Uint32)0)
#define MI_MAKE_VERSION(MAJ, MIN, REV) ((MAJ << 16) | (MIN << 8) | REV)
#define MI_VERSION MI_MAKE_VERSION(MI_MAJOR, MI_MINOR, MI_REVISON)

#define MI_UNREFERENCED_PARAMETER(P) (P)

#define MI_EXPORT __declspec(dllexport)

#define MI_MAIN_CALL __cdecl

#define MI_CALL __stdcall

#ifdef _MANAGED_PURE
#define MI_INLINE_CALL
#else
#define MI_INLINE_CALL MI_CALL
#endif

#define MI_INLINE static __inline

#define MI_OFFSETOF(STRUCT,FIELD) (((ptrdiff_t)&(((STRUCT*)1)->FIELD))-1)

#ifdef __cplusplus
#define MI_EXTERN_C extern "C"
#else
#define MI_EXTERN_C extern
#endif

#define MI_COUNT(X) (sizeof(X)/sizeof(X[0]))

#if (MI_CHAR_TYPE == 1)
#define MI_T(STR) STR
#else
#define MI_T(STR) L##STR
#endif

#define MI_LL(X) X##i64
#define MI_ULL(X) X##ui64

typedef struct _MI_Server MI_Server;
typedef struct _MI_Context MI_Context;
typedef struct _MI_ClassDecl MI_ClassDecl;
typedef struct _MI_Instance MI_Instance;
typedef struct _MI_Filter MI_Filter;
typedef struct _MI_PropertySet MI_PropertySet;
typedef struct _MI_Qualifier MI_Qualifier;
typedef struct _MI_Session MI_Session;
typedef struct _MI_ServerFT MI_ServerFT;
typedef struct _MI_ProviderFT MI_ProviderFT;
typedef struct _MI_PropertySetFT MI_PropertySetFT;
typedef struct _MI_InstanceFT MI_InstanceFT;
typedef struct _MI_ContextFT MI_ContextFT;
typedef struct _MI_FilterFT MI_FilterFT;
typedef struct _MI_Class MI_Class;
typedef struct _MI_InstanceExFT MI_InstanceExFT;

typedef enum _MI_Result {
  MI_RESULT_OK = 0,
  MI_RESULT_FAILED = 1,
  MI_RESULT_ACCESS_DENIED = 2,
  MI_RESULT_INVALID_NAMESPACE = 3,
  MI_RESULT_INVALID_PARAMETER = 4,
  MI_RESULT_INVALID_CLASS = 5,
  MI_RESULT_NOT_FOUND = 6,
  MI_RESULT_NOT_SUPPORTED = 7,
  MI_RESULT_CLASS_HAS_CHILDREN = 8,
  MI_RESULT_CLASS_HAS_INSTANCES = 9,
  MI_RESULT_INVALID_SUPERCLASS = 10,
  MI_RESULT_ALREADY_EXISTS = 11,
  MI_RESULT_NO_SUCH_PROPERTY = 12,
  MI_RESULT_TYPE_MISMATCH = 13,
  MI_RESULT_QUERY_LANGUAGE_NOT_SUPPORTED = 14,
  MI_RESULT_INVALID_QUERY = 15,
  MI_RESULT_METHOD_NOT_AVAILABLE = 16,
  MI_RESULT_METHOD_NOT_FOUND = 17,
  MI_RESULT_NAMESPACE_NOT_EMPTY = 20,
  MI_RESULT_INVALID_ENUMERATION_CONTEXT = 21,
  MI_RESULT_INVALID_OPERATION_TIMEOUT = 22,
  MI_RESULT_PULL_HAS_BEEN_ABANDONED = 23,
  MI_RESULT_PULL_CANNOT_BE_ABANDONED = 24,
  MI_RESULT_FILTERED_ENUMERATION_NOT_SUPPORTED = 25,
  MI_RESULT_CONTINUATION_ON_ERROR_NOT_SUPPORTED = 26,
  MI_RESULT_SERVER_LIMITS_EXCEEDED = 27,
  MI_RESULT_SERVER_IS_SHUTTING_DOWN = 28
} MI_Result;

typedef enum _MI_ErrorCategory {
  MI_ERRORCATEGORY_NOT_SPECIFIED = 0,
  MI_ERRORCATEGORY_OPEN_ERROR = 1,
  MI_ERRORCATEGORY_CLOS_EERROR = 2,
  MI_ERRORCATEGORY_DEVICE_ERROR = 3,
  MI_ERRORCATEGORY_DEADLOCK_DETECTED = 4,
  MI_ERRORCATEGORY_INVALID_ARGUMENT = 5,
  MI_ERRORCATEGORY_INVALID_DATA = 6,
  MI_ERRORCATEGORY_INVALID_OPERATION = 7,
  MI_ERRORCATEGORY_INVALID_RESULT = 8,
  MI_ERRORCATEGORY_INVALID_TYPE = 9,
  MI_ERRORCATEGORY_METADATA_ERROR = 10,
  MI_ERRORCATEGORY_NOT_IMPLEMENTED = 11,
  MI_ERRORCATEGORY_NOT_INSTALLED = 12,
  MI_ERRORCATEGORY_OBJECT_NOT_FOUND = 13,
  MI_ERRORCATEGORY_OPERATION_STOPPED = 14,
  MI_ERRORCATEGORY_OPERATION_TIMEOUT = 15,
  MI_ERRORCATEGORY_SYNTAX_ERROR = 16,
  MI_ERRORCATEGORY_PARSER_ERROR = 17,
  MI_ERRORCATEGORY_ACCESS_DENIED = 18,
  MI_ERRORCATEGORY_RESOURCE_BUSY = 19,
  MI_ERRORCATEGORY_RESOURCE_EXISTS = 20,
  MI_ERRORCATEGORY_RESOURCE_UNAVAILABLE = 21,
  MI_ERRORCATEGORY_READ_ERROR = 22,
  MI_ERRORCATEGORY_WRITE_ERROR = 23,
  MI_ERRORCATEGORY_FROM_STDERR = 24,
  MI_ERRORCATEGORY_SECURITY_ERROR = 25,
  MI_ERRORCATEGORY_PROTOCOL_ERROR = 26,
  MI_ERRORCATEGORY_CONNECTION_ERROR = 27,
  MI_ERRORCATEGORY_AUTHENTICATION_ERROR = 28,
  MI_ERRORCATEGORY_LIMITS_EXCEEDED = 29,
  MI_ERRORCATEGORY_QUOTA_EXCEEDED = 30,
  MI_ERRORCATEGORY_NOT_ENABLED = 31
} MI_ErrorCategory;

typedef enum _MI_PromptType {
  MI_PROMPTTYPE_NORMAL,
  MI_PROMPTTYPE_CRITICAL
} MI_PromptType;

typedef enum _MI_CallbackMode {
  MI_CALLBACKMODE_REPORT,
  MI_CALLBACKMODE_INQUIRE,
  MI_CALLBACKMODE_IGNORE
} MI_CallbackMode;

typedef enum _MI_ProviderArchitecture {
  MI_PROVIDER_ARCHITECTURE_32BIT,
  MI_PROVIDER_ARCHITECTURE_64BIT
} MI_ProviderArchitecture;

#define MI_FLAG_CLASS (1 << 0)
#define MI_FLAG_METHOD (1 << 1)
#define MI_FLAG_PROPERTY (1 << 2)
#define MI_FLAG_PARAMETER (1 << 3)
#define MI_FLAG_ASSOCIATION (1 << 4)
#define MI_FLAG_INDICATION (1 << 5)
#define MI_FLAG_REFERENCE (1 << 6)
#define MI_FLAG_ANY (1|2|4|8|16|32|64)

#define MI_FLAG_ENABLEOVERRIDE (1 << 7)
#define MI_FLAG_DISABLEOVERRIDE (1 << 8)
#define MI_FLAG_RESTRICTED (1 << 9)
#define MI_FLAG_TOSUBCLASS (1 << 10)
#define MI_FLAG_TRANSLATABLE (1 << 11)

#define MI_FLAG_KEY (1 << 12)
#define MI_FLAG_IN (1 << 13)
#define MI_FLAG_OUT (1 << 14)
#define MI_FLAG_REQUIRED (1 << 15)
#define MI_FLAG_STATIC (1 << 16)
#define MI_FLAG_ABSTRACT (1 << 17)
#define MI_FLAG_TERMINAL (1 << 18)
#define MI_FLAG_EXPENSIVE (1 << 19)
#define MI_FLAG_STREAM (1 << 20)
#define MI_FLAG_READONLY (1 << 21)

#define MI_FLAG_EXTENDED (1 << 12)
#define MI_FLAG_NOT_MODIFIED (1 << 25)
#define MI_FLAG_VERSION (1<<26|1<<27|1<<28)
#define MI_FLAG_NULL (1 << 29)
#define MI_FLAG_BORROW (1 << 30)
#define MI_FLAG_ADOPT ((MI_Uint32)(1 << 31))

typedef enum _MI_Type {
  MI_BOOLEAN = 0,
  MI_UINT8 = 1,
  MI_SINT8 = 2,
  MI_UINT16 = 3,
  MI_SINT16 = 4,
  MI_UINT32 = 5,
  MI_SINT32 = 6,
  MI_UINT64 = 7,
  MI_SINT64 = 8,
  MI_REAL32 = 9,
  MI_REAL64 = 10,
  MI_CHAR16 = 11,
  MI_DATETIME = 12,
  MI_STRING = 13,
  MI_REFERENCE = 14,
  MI_INSTANCE = 15,
  MI_BOOLEANA = 16,
  MI_UINT8A = 17,
  MI_SINT8A = 18,
  MI_UINT16A = 19,
  MI_SINT16A = 20,
  MI_UINT32A = 21,
  MI_SINT32A = 22,
  MI_UINT64A = 23,
  MI_SINT64A = 24,
  MI_REAL32A = 25,
  MI_REAL64A = 26,
  MI_CHAR16A = 27,
  MI_DATETIMEA = 28,
  MI_STRINGA = 29,
  MI_REFERENCEA = 30,
  MI_INSTANCEA = 31,
  MI_ARRAY = 16
} MI_Type;

typedef unsigned char MI_Boolean;
typedef unsigned char MI_Uint8;
typedef signed char MI_Sint8;
typedef unsigned short MI_Uint16;
typedef signed short MI_Sint16;
typedef unsigned int MI_Uint32;
typedef signed int MI_Sint32;

typedef unsigned __int64 MI_Uint64;
typedef signed __int64 MI_Sint64;

typedef float MI_Real32;
typedef double MI_Real64;
typedef unsigned short MI_Char16;

#if (MI_CHAR_TYPE == 1)
typedef char MI_Char;
#else
typedef wchar_t MI_Char;
#endif

typedef MI_Char* MI_StringPtr;
typedef const MI_Char* MI_ConstStringPtr;

#define MI_TRUE ((MI_Boolean)1)
#define MI_FALSE ((MI_Boolean)0)

typedef struct _MI_Timestamp {
  MI_Uint32 year;
  MI_Uint32 month;
  MI_Uint32 day;
  MI_Uint32 hour;
  MI_Uint32 minute;
  MI_Uint32 second;
  MI_Uint32 microseconds;
  MI_Sint32 utc;
} MI_Timestamp;

typedef struct _MI_Interval {
  MI_Uint32 days;
  MI_Uint32 hours;
  MI_Uint32 minutes;
  MI_Uint32 seconds;
  MI_Uint32 microseconds;
  MI_Uint32 __padding1;
  MI_Uint32 __padding2;
  MI_Uint32 __padding3;
} MI_Interval;

typedef struct _MI_Datetime {
  MI_Uint32 isTimestamp;
  union {
    MI_Timestamp timestamp;
    MI_Interval interval;
  } u;
} MI_Datetime;

typedef struct _MI_BooleanA {
  MI_Boolean* data;
  MI_Uint32 size;
} MI_BooleanA;

typedef struct _MI_Uint8A {
  MI_Uint8* data;
  MI_Uint32 size;
} MI_Uint8A;

typedef struct _MI_Sint8A {
  MI_Sint8* data;
  MI_Uint32 size;
} MI_Sint8A;

typedef struct _MI_Uint16A {
  MI_Uint16* data;
  MI_Uint32 size;
} MI_Uint16A;

typedef struct _MI_Sint16A {
  MI_Sint16* data;
  MI_Uint32 size;
} MI_Sint16A;

typedef struct _MI_Uint32A {
  MI_Uint32* data;
  MI_Uint32 size;
} MI_Uint32A;

typedef struct _MI_Sint32A {
  MI_Sint32* data;
  MI_Uint32 size;
} MI_Sint32A;

typedef struct _MI_Uint64A {
  MI_Uint64* data;
  MI_Uint32 size;
} MI_Uint64A;

typedef struct _MI_Sint64A {
  MI_Sint64* data;
  MI_Uint32 size;
} MI_Sint64A;

typedef struct _MI_Real32A {
  MI_Real32* data;
  MI_Uint32 size;
} MI_Real32A;

typedef struct _MI_Real64A {
  MI_Real64* data;
  MI_Uint32 size;
} MI_Real64A;

typedef struct _MI_Char16A {
  MI_Char16* data;
  MI_Uint32 size;
} MI_Char16A;

typedef struct _MI_DatetimeA {
  MI_Datetime* data;
  MI_Uint32 size;
} MI_DatetimeA;

typedef struct _MI_StringA {
  MI_Char** data;
  MI_Uint32 size;
} MI_StringA;

typedef struct _MI_ReferenceA {
  struct _MI_Instance** data;
  MI_Uint32 size;
} MI_ReferenceA;

typedef struct _MI_InstanceA {
  MI_Instance** data;
  MI_Uint32 size;
} MI_InstanceA;

typedef struct _MI_Array {
  void* data;
  MI_Uint32 size;
} MI_Array;

typedef struct _MI_ConstBooleanA {
  MI_CONST MI_Boolean* data;
  MI_Uint32 size;
} MI_ConstBooleanA;

typedef struct _MI_ConstUint8A {
  MI_CONST MI_Uint8* data;
  MI_Uint32 size;
} MI_ConstUint8A;

typedef struct _MI_ConstSint8A {
  MI_CONST MI_Sint8* data;
  MI_Uint32 size;
} MI_ConstSint8A;

typedef struct _MI_ConstUint16A {
  MI_CONST MI_Uint16* data;
  MI_Uint32 size;
} MI_ConstUint16A;

typedef struct _MI_ConstSint16A {
  MI_CONST MI_Sint16* data;
  MI_Uint32 size;
} MI_ConstSint16A;

typedef struct _MI_ConstUint32A {
  MI_CONST MI_Uint32* data;
  MI_Uint32 size;
} MI_ConstUint32A;

typedef struct _MI_ConstSint32A {
  MI_CONST MI_Sint32* data;
  MI_Uint32 size;
} MI_ConstSint32A;

typedef struct _MI_ConstUint64A {
  MI_CONST MI_Uint64* data;
  MI_Uint32 size;
} MI_ConstUint64A;

typedef struct _MI_ConstSint64A {
  MI_CONST MI_Sint64* data;
  MI_Uint32 size;
} MI_ConstSint64A;

typedef struct _MI_ConstReal32A {
  MI_CONST MI_Real32* data;
  MI_Uint32 size;
} MI_ConstReal32A;

typedef struct _MI_ConstReal64A {
  MI_CONST MI_Real64* data;
  MI_Uint32 size;
} MI_ConstReal64A;

typedef struct _MI_ConstChar16A {
  MI_CONST MI_Char16* data;
  MI_Uint32 size;
} MI_ConstChar16A;

typedef struct _MI_ConstDatetimeA {
  MI_CONST MI_Datetime* data;
  MI_Uint32 size;
} MI_ConstDatetimeA;

typedef struct _MI_ConstStringA {
  MI_CONST MI_Char* MI_CONST* data;
  MI_Uint32 size;
} MI_ConstStringA;

typedef struct _MI_ConstReferenceA {
  MI_CONST MI_Instance* MI_CONST* data;
  MI_Uint32 size;
} MI_ConstReferenceA;

typedef struct _MI_ConstInstanceA {
  MI_CONST MI_Instance* MI_CONST* data;
  MI_Uint32 size;
} MI_ConstInstanceA;

typedef union _MI_Value {
  MI_Boolean boolean;
  MI_Uint8 uint8;
  MI_Sint8 sint8;
  MI_Uint16 uint16;
  MI_Sint16 sint16;
  MI_Uint32 uint32;
  MI_Sint32 sint32;
  MI_Uint64 uint64;
  MI_Sint64 sint64;
  MI_Real32 real32;
  MI_Real64 real64;
  MI_Char16 char16;
  MI_Datetime datetime;
  MI_Char* string;
  MI_Instance* instance;
  MI_Instance* reference;
  MI_BooleanA booleana;
  MI_Uint8A uint8a;
  MI_Sint8A sint8a;
  MI_Uint16A uint16a;
  MI_Sint16A sint16a;
  MI_Uint32A uint32a;
  MI_Sint32A sint32a;
  MI_Uint64A uint64a;
  MI_Sint64A sint64a;
  MI_Real32A real32a;
  MI_Real64A real64a;
  MI_Char16A char16a;
  MI_DatetimeA datetimea;
  MI_StringA stringa;
  MI_ReferenceA referencea;
  MI_InstanceA instancea;
  MI_Array array;
} MI_Value;

typedef struct _MI_BooleanField {
  MI_Boolean value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_BooleanField;

typedef struct _MI_Sint8Field {
  MI_Sint8 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint8Field;

typedef struct _MI_Uint8Field {
  MI_Uint8 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint8Field;

typedef struct _MI_Sint16Field {
  MI_Sint16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint16Field;

typedef struct _MI_Uint16Field {
  MI_Uint16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint16Field;

typedef struct _MI_Sint32Field {
  MI_Sint32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint32Field;

typedef struct _MI_Uint32Field {
  MI_Uint32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint32Field;

typedef struct _MI_Sint64Field {
  MI_Sint64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint64Field;

typedef struct _MI_Uint64Field {
  MI_Uint64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint64Field;

typedef struct _MI_Real32Field {
  MI_Real32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Real32Field;

typedef struct _MI_Real64Field {
  MI_Real64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Real64Field;

typedef struct _MI_Char16Field {
  MI_Char16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Char16Field;

typedef struct _MI_DatetimeField {
  MI_Datetime value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_DatetimeField;

typedef struct _MI_StringField {
  MI_Char* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_StringField;

typedef struct _MI_ReferenceField {
  MI_Instance* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ReferenceField;

typedef struct _MI_InstanceField {
  MI_Instance* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_InstanceField;

typedef struct _MI_BooleanAField {
  MI_BooleanA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_BooleanAField;

typedef struct _MI_Uint8AField {
  MI_Uint8A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint8AField;

typedef struct _MI_Sint8AField {
  MI_Sint8A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint8AField;

typedef struct _MI_Uint16AField {
  MI_Uint16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint16AField;

typedef struct _MI_Sint16AField {
  MI_Sint16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint16AField;

typedef struct _MI_Uint32AField {
  MI_Uint32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint32AField;

typedef struct _MI_Sint32AField {
  MI_Sint32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint32AField;

typedef struct _MI_Uint64AField {
  MI_Uint64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Uint64AField;

typedef struct _MI_Sint64AField {
  MI_Sint64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Sint64AField;

typedef struct _MI_Real32AField {
  MI_Real32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Real32AField;

typedef struct _MI_Real64AField {
  MI_Real64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Real64AField;

typedef struct _MI_Char16AField {
  MI_Char16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_Char16AField;

typedef struct _MI_DatetimeAField {
  MI_DatetimeA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_DatetimeAField;

typedef struct _MI_StringAField {
  MI_StringA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_StringAField;

typedef struct _MI_ReferenceAField {
  MI_ReferenceA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ReferenceAField;

typedef struct _MI_InstanceAField {
  MI_InstanceA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_InstanceAField;

typedef struct _MI_ArrayField {
  MI_Array value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ArrayField;

typedef struct _MI_ConstBooleanField {
  MI_Boolean value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstBooleanField;

typedef struct _MI_ConstSint8Field {
  MI_Sint8 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint8Field;

typedef struct _MI_ConstUint8Field {
  MI_Uint8 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint8Field;

typedef struct _MI_ConstSint16Field {
  MI_Sint16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint16Field;

typedef struct _MI_ConstUint16Field {
  MI_Uint16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint16Field;

typedef struct _MI_ConstSint32Field {
  MI_Sint32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint32Field;

typedef struct _MI_ConstUint32Field {
  MI_Uint32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint32Field;

typedef struct _MI_ConstSint64Field {
  MI_Sint64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint64Field;

typedef struct _MI_ConstUint64Field {
  MI_Uint64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint64Field;

typedef struct _MI_ConstReal32Field {
  MI_Real32 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReal32Field;

typedef struct _MI_ConstReal64Field {
  MI_Real64 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReal64Field;

typedef struct _MI_ConstChar16Field {
  MI_Char16 value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstChar16Field;

typedef struct _MI_ConstDatetimeField {
  MI_Datetime value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstDatetimeField;

typedef struct _MI_ConstStringField {
  MI_CONST MI_Char* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstStringField;

typedef struct _MI_ConstReferenceField {
  MI_CONST MI_Instance* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReferenceField;

typedef struct _MI_ConstInstanceField {
  MI_CONST MI_Instance* value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstInstanceField;

typedef struct _MI_ConstBooleanAField {
  MI_ConstBooleanA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstBooleanAField;

typedef struct _MI_ConstUint8AField {
  MI_ConstUint8A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint8AField;

typedef struct _MI_ConstSint8AField {
  MI_ConstSint8A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint8AField;

typedef struct _MI_ConstUint16AField {
  MI_ConstUint16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint16AField;

typedef struct _MI_ConstSint16AField {
  MI_ConstSint16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint16AField;

typedef struct _MI_ConstUint32AField {
  MI_ConstUint32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint32AField;

typedef struct _MI_ConstSint32AField {
  MI_ConstSint32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint32AField;

typedef struct _MI_ConstUint64AField {
  MI_ConstUint64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstUint64AField;

typedef struct _MI_ConstSint64AField {
  MI_ConstSint64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstSint64AField;

typedef struct _MI_ConstReal32AField {
  MI_ConstReal32A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReal32AField;

typedef struct _MI_ConstReal64AField {
  MI_ConstReal64A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReal64AField;

typedef struct _MI_ConstChar16AField {
  MI_ConstChar16A value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstChar16AField;

typedef struct _MI_ConstDatetimeAField {
  MI_ConstDatetimeA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstDatetimeAField;

typedef struct _MI_ConstStringAField {
  MI_ConstStringA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstStringAField;

typedef struct _MI_ConstReferenceAField {
  MI_ConstReferenceA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstReferenceAField;

typedef struct _MI_ConstInstanceAField {
  MI_ConstInstanceA value;
  MI_Boolean exists;
  MI_Uint8 flags;
} MI_ConstInstanceAField;

struct _MI_ServerFT {
  MI_Result (MI_CALL *GetVersion)(MI_Uint32* version);
  MI_Result (MI_CALL *GetSystemName)(const MI_Char** systemName);
};

struct _MI_Server {
  const MI_ServerFT* serverFT;
  const MI_ContextFT* contextFT;
  const MI_InstanceFT* instanceFT;
  const MI_PropertySetFT* propertySetFT;
  const MI_FilterFT* filterFT;
};

MI_Result MI_CALL MI_Server_GetVersion(MI_Uint32* version);
MI_Result MI_CALL MI_Server_GetSystemName(const MI_Char** systemName);

struct _MI_FilterFT {
  MI_Result (MI_CALL *Evaluate)(const MI_Filter* self, const MI_Instance* instance, MI_Boolean* result);
  MI_Result (MI_CALL *GetExpression)(const MI_Filter* self, const MI_Char** queryLang, const MI_Char** queryExpr);
};

struct _MI_Filter {
  const MI_FilterFT* ft;
  ptrdiff_t reserved[3];
};

MI_INLINE MI_Result MI_INLINE_CALL MI_Filter_Evaluate(const MI_Filter* self, const MI_Instance* instance, MI_Boolean* result) {
  if (self && self->ft) {
    return self->ft->Evaluate(self, instance, result);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Filter_GetExpression(const MI_Filter* self, const MI_Char** queryLang, const MI_Char** queryExpr) {
  if (self && self->ft) {
    return self->ft->GetExpression(self, queryLang, queryExpr);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

struct _MI_PropertySetFT {
  MI_Result (MI_CALL *GetElementCount)(const MI_PropertySet* self, MI_Uint32* count);
  MI_Result (MI_CALL *ContainsElement)(const MI_PropertySet* self, const MI_Char* name, MI_Boolean* flag);
  MI_Result (MI_CALL *AddElement)(MI_PropertySet* self, const MI_Char* name);
  MI_Result (MI_CALL *GetElementAt)(const MI_PropertySet* self, MI_Uint32 index, const MI_Char** name);
  MI_Result (MI_CALL *Clear)(MI_PropertySet* self);
  MI_Result (MI_CALL *Destruct)(MI_PropertySet* self);
  MI_Result (MI_CALL *Delete)(MI_PropertySet* self);
  MI_Result (MI_CALL *Clone)(const MI_PropertySet* self, MI_PropertySet** newPropertySet);
};

struct _MI_PropertySet {
  const MI_PropertySetFT* ft;
  ptrdiff_t reserved[3];
};

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_GetElementCount(const MI_PropertySet* self, MI_Uint32* count) {
  if (self && self->ft) {
    return self->ft->GetElementCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_ContainsElement(const MI_PropertySet* self, const MI_Char* name, MI_Boolean* flag) {
  if (self && self->ft) {
    return self->ft->ContainsElement(self, name, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_AddElement(MI_PropertySet* self, const MI_Char* name) {
  if (self && self->ft) {
    return self->ft->AddElement(self, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_GetElementAt(const MI_PropertySet* self, MI_Uint32 index, const MI_Char** name) {
  if (self && self->ft) {
    return self->ft->GetElementAt(self, index, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_Clear(MI_PropertySet* self) {
  if (self && self->ft) {
    return self->ft->Clear(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_Destruct(MI_PropertySet* self) {
  if (self && self->ft) {
    return self->ft->Destruct(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_Delete(MI_PropertySet* self) {
  if (self && self->ft) {
    return self->ft->Delete(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_PropertySet_Clone(const MI_PropertySet* self, MI_PropertySet** newPropertySet) {
  if (self && self->ft) {
    return self->ft->Clone(self, newPropertySet);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

typedef struct _MI_ObjectDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  MI_Qualifier MI_CONST* MI_CONST* qualifiers;
  MI_Uint32 numQualifiers;
  struct _MI_PropertyDecl MI_CONST* MI_CONST* properties;
  MI_Uint32 numProperties;
  MI_Uint32 size;
} MI_ObjectDecl;

struct _MI_ClassDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  struct _MI_Qualifier MI_CONST* MI_CONST* qualifiers;
  MI_Uint32 numQualifiers;
  struct _MI_PropertyDecl MI_CONST* MI_CONST* properties;
  MI_Uint32 numProperties;
  MI_Uint32 size;
  MI_CONST MI_Char* superClass;
  MI_ClassDecl MI_CONST* superClassDecl;
  struct _MI_MethodDecl MI_CONST* MI_CONST* methods;
  MI_Uint32 numMethods;
  struct _MI_SchemaDecl MI_CONST* schema;
  MI_CONST MI_ProviderFT* providerFT;
  MI_Class *owningClass;
};

typedef struct _MI_FeatureDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  MI_Qualifier MI_CONST* MI_CONST * qualifiers;
  MI_Uint32 numQualifiers;
} MI_FeatureDecl;

typedef struct _MI_ParameterDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  MI_Qualifier MI_CONST* MI_CONST* qualifiers;
  MI_Uint32 numQualifiers;
  MI_Uint32 type;
  MI_CONST MI_Char* className;
  MI_Uint32 subscript;
  MI_Uint32 offset;
} MI_ParameterDecl;

typedef struct _MI_PropertyDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  MI_Qualifier MI_CONST* MI_CONST* qualifiers;
  MI_Uint32 numQualifiers;
  MI_Uint32 type;
  MI_CONST MI_Char* className;
  MI_Uint32 subscript;
  MI_Uint32 offset;
  MI_CONST MI_Char* origin;
  MI_CONST MI_Char* propagator;
  MI_CONST void* value;
} MI_PropertyDecl;

typedef void (MI_CALL *MI_MethodDecl_Invoke)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Char* methodName, const MI_Instance* instanceName, const MI_Instance* parameters);

typedef struct _MI_MethodDecl {
  MI_Uint32 flags;
  MI_Uint32 code;
  MI_CONST MI_Char* name;
  struct _MI_Qualifier MI_CONST* MI_CONST* qualifiers;
  MI_Uint32 numQualifiers;
  struct _MI_ParameterDecl MI_CONST* MI_CONST* parameters;
  MI_Uint32 numParameters;
  MI_Uint32 size;
  MI_Uint32 returnType;
  MI_CONST MI_Char* origin;
  MI_CONST MI_Char* propagator;
  struct _MI_SchemaDecl MI_CONST* schema;
  MI_MethodDecl_Invoke function;
} MI_MethodDecl;

typedef struct _MI_QualifierDecl {
  MI_CONST MI_Char* name;
  MI_Uint32 type;
  MI_Uint32 scope;
  MI_Uint32 flavor;
  MI_Uint32 subscript;
  MI_CONST void* value;
} MI_QualifierDecl;

struct _MI_Qualifier {
  MI_CONST MI_Char* name;
  MI_Uint32 type;
  MI_Uint32 flavor;
  MI_CONST void* value;
};

typedef struct _MI_SchemaDecl {
  MI_QualifierDecl MI_CONST* MI_CONST* qualifierDecls;
  MI_Uint32 numQualifierDecls;
  MI_ClassDecl MI_CONST* MI_CONST* classDecls;
  MI_Uint32 numClassDecls;
} MI_SchemaDecl;

typedef struct _MI_Module_Self MI_Module_Self;

typedef void (MI_CALL *MI_ProviderFT_Load)(void** self, MI_Module_Self* selfModule, MI_Context* context);
typedef void (MI_CALL *MI_ProviderFT_Unload)(void* self, MI_Context* context);
typedef void (MI_CALL *MI_ProviderFT_GetInstance)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* instanceName, const MI_PropertySet* propertySet);
typedef void (MI_CALL *MI_ProviderFT_EnumerateInstances)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_PropertySet* propertySet, MI_Boolean keysOnly, const MI_Filter* filter);
typedef void (MI_CALL *MI_ProviderFT_CreateInstance)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* newInstance);
typedef void (MI_CALL *MI_ProviderFT_ModifyInstance)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* modifiedInstance, const MI_PropertySet* propertySet);
typedef void (MI_CALL *MI_ProviderFT_DeleteInstance)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* instanceName);
typedef void (MI_CALL *MI_ProviderFT_AssociatorInstances)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* instanceName, const MI_Char* resultClass, const MI_Char* role, const MI_Char* resultRole, const MI_PropertySet* propertySet, MI_Boolean keysOnly, const MI_Filter* filter);
typedef void (MI_CALL *MI_ProviderFT_ReferenceInstances)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Instance* instanceName, const MI_Char* role, const MI_PropertySet* propertySet, MI_Boolean keysOnly, const MI_Filter* filter);
typedef void (MI_CALL *MI_ProviderFT_EnableIndications)(void* self, MI_Context* indicationsContext, const MI_Char* nameSpace, const MI_Char* className);
typedef void (MI_CALL *MI_ProviderFT_DisableIndications)(void* self, MI_Context* indicationsContext, const MI_Char* nameSpace, const MI_Char* className);
typedef void (MI_CALL *MI_ProviderFT_Subscribe)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Filter* filter, const MI_Char* bookmark, MI_Uint64 subscriptionID, void** subscriptionSelf);
typedef void (MI_CALL *MI_ProviderFT_Unsubscribe)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, MI_Uint64 subscriptionID, void* subscriptionSelf);
typedef void (MI_CALL *MI_ProviderFT_Invoke)(void* self, MI_Context* context, const MI_Char* nameSpace, const MI_Char* className, const MI_Char* methodName, const MI_Instance* instanceName, const MI_Instance* inputParameters);

struct _MI_ProviderFT {
  MI_ProviderFT_Load Load;
  MI_ProviderFT_Unload Unload;
  MI_ProviderFT_GetInstance GetInstance;
  MI_ProviderFT_EnumerateInstances EnumerateInstances;
  MI_ProviderFT_CreateInstance CreateInstance;
  MI_ProviderFT_ModifyInstance ModifyInstance;
  MI_ProviderFT_DeleteInstance DeleteInstance;
  MI_ProviderFT_AssociatorInstances AssociatorInstances;
  MI_ProviderFT_ReferenceInstances ReferenceInstances;
  MI_ProviderFT_EnableIndications EnableIndications;
  MI_ProviderFT_DisableIndications DisableIndications;
  MI_ProviderFT_Subscribe Subscribe;
  MI_ProviderFT_Unsubscribe Unsubscribe;
  MI_ProviderFT_Invoke Invoke;
};

#define MI_MODULE_FLAG_STANDARD_QUALIFIERS (1 << 0)
#define MI_MODULE_FLAG_DESCRIPTIONS (1 << 1)
#define MI_MODULE_FLAG_VALUES (1 << 2)
#define MI_MODULE_FLAG_MAPPING_STRINGS (1 << 3)
#define MI_MODULE_FLAG_BOOLEANS (1 << 4)
#define MI_MODULE_FLAG_CPLUSPLUS (1 << 5)
#define MI_MODULE_FLAG_LOCALIZED (1 << 6)
#define MI_MODULE_FLAG_FILTER_SUPPORT (1 << 7)

typedef void (MI_CALL *MI_Module_Load)(MI_Module_Self** self, MI_Context* context);
typedef void (MI_CALL *MI_Module_Unload)(MI_Module_Self* self, MI_Context* context);

typedef struct _MI_Module {
  MI_Uint32 version;
  MI_Uint32 generatorVersion;
  MI_Uint32 flags;
  MI_Uint32 charSize;
  MI_SchemaDecl* schemaDecl;
  MI_Module_Load Load;
  MI_Module_Unload Unload;
  const MI_ProviderFT* dynamicProviderFT;
} MI_Module;

struct _MI_InstanceFT {
  MI_Result (MI_CALL *Clone)(const MI_Instance* self, MI_Instance** newInstance);
  MI_Result (MI_CALL *Destruct)(MI_Instance* self);
  MI_Result (MI_CALL *Delete)(MI_Instance* self);
  MI_Result (MI_CALL *IsA)(const MI_Instance* self, const MI_ClassDecl* classDecl, MI_Boolean* flag);
  MI_Result (MI_CALL *GetClassName)(const MI_Instance* self, const MI_Char** className);
  MI_Result (MI_CALL *SetNameSpace)(MI_Instance* self, const MI_Char* nameSpace);
  MI_Result (MI_CALL *GetNameSpace)(const MI_Instance* self, const MI_Char** nameSpace);
  MI_Result (MI_CALL *GetElementCount)(const MI_Instance* self, MI_Uint32* count);
  MI_Result (MI_CALL *AddElement)(MI_Instance* self, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags);
  MI_Result (MI_CALL *SetElement)(MI_Instance* self, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags);
  MI_Result (MI_CALL *SetElementAt)(MI_Instance* self, MI_Uint32 index, const MI_Value* value, MI_Type type, MI_Uint32 flags);
  MI_Result (MI_CALL *GetElement)(const MI_Instance* self, const MI_Char* name, MI_Value* value, MI_Type* type, MI_Uint32* flags, MI_Uint32* index);
  MI_Result (MI_CALL *GetElementAt)(const MI_Instance* self, MI_Uint32 index, const MI_Char** name, MI_Value* value, MI_Type* type, MI_Uint32* flags);
  MI_Result (MI_CALL *ClearElement)(MI_Instance* self, const MI_Char* name);
  MI_Result (MI_CALL *ClearElementAt)(MI_Instance* self, MI_Uint32 index);
  MI_Result (MI_CALL *GetServerName)(const MI_Instance* self, const MI_Char** name);
  MI_Result (MI_CALL *SetServerName)(MI_Instance* self, const MI_Char* name);
  MI_Result (MI_CALL *GetClass)(const MI_Instance* self, MI_Class** instanceClass);
};

struct _MI_InstanceExFT {
  MI_InstanceFT parent;
  MI_Result (MI_CALL *Normalize)(MI_Instance** self);
};

struct _MI_Instance {
  const MI_InstanceFT* ft;
  const MI_ClassDecl* classDecl;
  const MI_Char* serverName;
  const MI_Char* nameSpace;
  ptrdiff_t reserved[4];
};

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_Clone(const MI_Instance* self, MI_Instance** newInstance) {
  if (self && self->ft) {
    return self->ft->Clone(self, newInstance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_Destruct(MI_Instance* self) {
  if (self && self->ft) {
    return self->ft->Destruct(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_Delete(MI_Instance* self) {
  if (self && self->ft) {
    return self->ft->Delete(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_IsA(const MI_Instance* self, const MI_ClassDecl* classDecl, MI_Boolean* flag) {
  if (self && self->ft) {
    return self->ft->IsA(self, classDecl, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetClassName(const MI_Instance* self, const MI_Char** className) {
  if (self && self->ft) {
    return self->ft->GetClassName(self, className);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_SetNameSpace(MI_Instance* self, const MI_Char* nameSpace) {
  if (self && self->ft) {
    return self->ft->SetNameSpace(self, nameSpace);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetNameSpace(const MI_Instance* self, const MI_Char** nameSpace) {
  if (self && self->ft) {
    return self->ft->GetNameSpace(self, nameSpace);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetElementCount(const MI_Instance* self, MI_Uint32* count) {
  if (self && self->ft) {
    return self->ft->GetElementCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_AddElement(MI_Instance* self, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->AddElement(self, name, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_SetElementAt(MI_Instance* self, MI_Uint32 index, const MI_Value* value, MI_Type type, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetElementAt(self, index, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_SetElement(MI_Instance* self, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetElement(self, name, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetElement(const MI_Instance* self, const MI_Char* name, MI_Value* value, MI_Type* type, MI_Uint32* flags, MI_Uint32* index) {
  if (self && self->ft) {
    return self->ft->GetElement(self, name, value, type, flags, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetElementAt(const MI_Instance* self, MI_Uint32 index, const MI_Char** name, MI_Value* value, MI_Type* type, MI_Uint32* flags) {
  if (self && self->ft) {
    return self->ft->GetElementAt(self, index, name, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_ClearElement(MI_Instance* self, const MI_Char* name) {
  if (self && self->ft) {
    return self->ft->ClearElement(self, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_ClearElementAt(MI_Instance* self, MI_Uint32 index) {
  if (self && self->ft) {
    return self->ft->ClearElementAt(self, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetServerName(const MI_Instance* self, const MI_Char** name) {
  if (self && self->ft) {
    return self->ft->GetServerName(self, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_SetServerName(MI_Instance* self, const MI_Char* name) {
  if (self && self->ft) {
    return self->ft->SetServerName(self, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetClass(const MI_Instance* self, MI_Class** instanceClass) {
  if (self && self->ft) {
    return self->ft->GetClass(self, instanceClass);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_Normalize(MI_Instance** self) {
  MI_Instance* inst = *self;
  if (inst && inst->ft) {
    if (inst->classDecl->flags & MI_FLAG_EXTENDED) {
      MI_InstanceExFT* ft = (MI_InstanceExFT*)inst->ft;
      return ft->Normalize(self);
    } else {
      return MI_RESULT_OK;
    }
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_MAX_LOCALE_SIZE 128

typedef enum _MI_LocaleType {
  MI_LOCALE_TYPE_REQUESTED_UI,
  MI_LOCALE_TYPE_REQUESTED_DATA,
  MI_LOCALE_TYPE_CLOSEST_UI,
  MI_LOCALE_TYPE_CLOSEST_DATA
} MI_LocaleType;

typedef enum _MI_CancellationReason {
  MI_REASON_NONE,
  MI_REASON_TIMEOUT,
  MI_REASON_SHUTDOWN,
  MI_REASON_SERVICESTOP
} MI_CancellationReason;

typedef void (MI_CALL *MI_CancelCallback)(MI_CancellationReason reason, void* callbackData);

#define MI_WRITEMESSAGE_CHANNEL_WARNING 0
#define MI_WRITEMESSAGE_CHANNEL_VERBOSE 1
#define MI_WRITEMESSAGE_CHANNEL_DEBUG 2

#define MI_RESULT_TYPE_MI MI_T("MI")
#define MI_RESULT_TYPE_HRESULT MI_T("HRESULT")
#define MI_RESULT_TYPE_WIN32 MI_T("WIN32")
#define MI_RESULT_TYPE_ERRNO MI_T("ERRNO")

struct _MI_ContextFT {
  MI_Result (MI_CALL *PostResult)(MI_Context* context, MI_Result result);
  MI_Result (MI_CALL *PostInstance)(MI_Context* context, const MI_Instance* instance);
  MI_Result (MI_CALL *PostIndication)(MI_Context* context, const MI_Instance* indication, MI_Uint32 subscriptionIDCount, const MI_Char* bookmark);
  MI_Result (MI_CALL *ConstructInstance)(MI_Context* context, const MI_ClassDecl* classDecl, MI_Instance* instance);
  MI_Result (MI_CALL *ConstructParameters)(MI_Context* context, const MI_MethodDecl* methodDecl, MI_Instance* instance);
  MI_Result (MI_CALL *NewInstance)(MI_Context* context, const MI_ClassDecl* classDecl, MI_Instance** instance);
  MI_Result (MI_CALL *NewDynamicInstance)(MI_Context* context, const MI_Char* className, MI_Uint32 flags, MI_Instance** instance);
  MI_Result (MI_CALL *NewParameters)(MI_Context* context, const MI_MethodDecl* methodDecl, MI_Instance** instance);
  MI_Result (MI_CALL *Canceled)(const MI_Context* context, MI_Boolean* flag);
  MI_Result (MI_CALL *GetLocale)(const MI_Context* context, MI_LocaleType localeType, MI_Char locale[MI_MAX_LOCALE_SIZE]);
  MI_Result (MI_CALL *RegisterCancel)(MI_Context* context, MI_CancelCallback callback, void* callbackData);
  MI_Result (MI_CALL *RequestUnload)(MI_Context* context);
  MI_Result (MI_CALL *RefuseUnload)(MI_Context* context);
  MI_Result (MI_CALL *GetLocalSession)(const MI_Context* context, MI_Session* session);
  MI_Result (MI_CALL *SetStringOption)(MI_Context* context, const MI_Char* name, const MI_Char* value);
  MI_Result (MI_CALL *GetStringOption)(MI_Context* context, const MI_Char* name, const MI_Char** value);
  MI_Result (MI_CALL *GetNumberOption)(MI_Context* context, const MI_Char *name, MI_Uint32* value);
  MI_Result (MI_CALL *GetCustomOption)(MI_Context* context, const MI_Char* name, MI_Type* valueType, MI_Value* value);
  MI_Result (MI_CALL *GetCustomOptionCount)(MI_Context* context, MI_Uint32* count);
  MI_Result (MI_CALL *GetCustomOptionAt)(MI_Context* context, MI_Uint32 index, const MI_Char** name, MI_Type* valueType, MI_Value* value);
  MI_Result (MI_CALL *WriteMessage)(MI_Context* context, MI_Uint32 channel, const MI_Char* message);
  MI_Result (MI_CALL *WriteProgress)(MI_Context* context, const MI_Char* activity, const MI_Char* currentOperation, const MI_Char* statusDescription, MI_Uint32 percentComplete, MI_Uint32 secondsRemaining);
  MI_Result (MI_CALL *WriteStreamParameter)(MI_Context* context, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags);
  MI_Result (MI_CALL *WriteCimError)(MI_Context* context, const MI_Instance *error, MI_Boolean *flag);
  MI_Result (MI_CALL *PromptUser)(MI_Context* context, const MI_Char* message, MI_PromptType promptType, MI_Boolean* result );
  MI_Result (MI_CALL *ShouldProcess)(MI_Context* context, const MI_Char* target, const MI_Char* action, MI_Boolean* result);
  MI_Result (MI_CALL *ShouldContinue)(MI_Context* context, const MI_Char* message, MI_Boolean* result);
  MI_Result (MI_CALL *PostError)(MI_Context* context, MI_Uint32 resultCode, const MI_Char* resultType, const MI_Char* errorMessage);
  MI_Result (MI_CALL *PostCimError)(MI_Context* context, const MI_Instance *error);
  MI_Result (MI_CALL *WriteError)(MI_Context* context, MI_Uint32 resultCode, const MI_Char* resultType, const MI_Char* errorMessage, MI_Boolean *flag);
};

struct _MI_Context {
  const MI_ContextFT* ft;
  ptrdiff_t reserved[3];
};

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PostResult(MI_Context* context, MI_Result result) {
  if (context && context->ft) {
    return context->ft->PostResult(context, result);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PostCimError(MI_Context* context, const MI_Instance *error) {
  if (context && context->ft) {
    return context->ft->PostCimError(context, error);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PostError(MI_Context* context, MI_Uint32 resultCode, const MI_Char* resultType, const MI_Char* errorMessage) {
  if (context && context->ft) {
    return context->ft->PostError(context, resultCode, resultType, errorMessage);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PostInstance(MI_Context* context, const MI_Instance* instance) {
  if (context && context->ft) {
    return context->ft->PostInstance(context, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PostIndication(MI_Context* context, const MI_Instance* indication, MI_Uint32 subscriptionIDCount, const MI_Char* bookmark) {
  if (context && context->ft) {
    return context->ft->PostIndication(context, indication, subscriptionIDCount, bookmark);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_ConstructInstance(MI_Context* context, const MI_ClassDecl* classDecl, MI_Instance* instance) {
  if (context && context->ft) {
    return context->ft->ConstructInstance(context, classDecl, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_ConstructParameters(MI_Context* context, const MI_MethodDecl* methodDecl, MI_Instance* instance) {
  if (context && context->ft) {
    return context->ft->ConstructParameters(context, methodDecl, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_NewInstance(MI_Context* context, const MI_ClassDecl* classDecl, MI_Instance** instance) {
  if (context && context->ft) {
    return context->ft->NewInstance(context, classDecl, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_NewDynamicInstance(MI_Context* context, const MI_Char* className, MI_Uint32 flags, MI_Instance** instance) {
  if (context && context->ft) {
    return context->ft->NewDynamicInstance(context, className, flags, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_NewParameters(MI_Context* context, const MI_MethodDecl* methodDecl, MI_Instance** instance) {
  if (context && context->ft) {
    return context->ft->NewParameters(context, methodDecl, instance);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_Canceled(const MI_Context* context, MI_Boolean* flag) {
  if (context && context->ft) {
    return context->ft->Canceled(context, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetLocale(const MI_Context* context, MI_LocaleType localeType, MI_Char locale[MI_MAX_LOCALE_SIZE]) {
  if (locale) {
    locale[0] = L'\0';
  }
  if (context && context->ft) {
    return context->ft->GetLocale(context, localeType, locale);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_RegisterCancel(MI_Context* context, MI_CancelCallback callback, void* callbackData) {
  if (context && context->ft) {
    return context->ft->RegisterCancel(context, callback, callbackData);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_RequestUnload(MI_Context* context) {
  if (context && context->ft) {
    return context->ft->RequestUnload(context);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_RefuseUnload(MI_Context* context) {
  if (context && context->ft) {
    return context->ft->RefuseUnload(context);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
};

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetLocalSession(const MI_Context* context, MI_Session* session) {
  if (context && context->ft) {
    return context->ft->GetLocalSession(context, session);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_SetStringOption(MI_Context* context, const MI_Char* name, const MI_Char* value) {
  if (context && context->ft) {
    return context->ft->SetStringOption(context, name, value);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetStringOption(MI_Context* context, const MI_Char* name, const MI_Char** value) {
  if (context && context->ft) {
    return context->ft->GetStringOption(context, name, value);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetNumberOption(MI_Context* context, const MI_Char* name, MI_Uint32* value) {
  if (context && context->ft) {
    return context->ft->GetNumberOption(context, name, value);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetCustomOption(MI_Context* context, const MI_Char* name, MI_Type* valueType, MI_Value* value) {
  if (context && context->ft) {
    return context->ft->GetCustomOption(context, name, valueType,value);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetCustomOptionCount(MI_Context* context, MI_Uint32* count) {
  if (context && context->ft) {
    return context->ft->GetCustomOptionCount(context, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_GetCustomOptionAt(MI_Context* context, MI_Uint32 index, const MI_Char** name, MI_Type* valueType, MI_Value* value) {
  if (context && context->ft) {
    return context->ft->GetCustomOptionAt(context, index, name, valueType,value);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_ShouldProcess(MI_Context* context, const MI_Char *target, const MI_Char* action, MI_Boolean* flag) {
  if (context && context->ft) {
    return context->ft->ShouldProcess(context, target, action , flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_ShouldContinue(MI_Context* context, const MI_Char* message, MI_Boolean* flag) {
  if (context && context->ft) {
    return context->ft->ShouldContinue(context, message, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_PromptUser(MI_Context* context, const MI_Char* message, MI_PromptType promptType, MI_Boolean*flag ) {
  if (context && context->ft) {
    return context->ft->PromptUser(context, message, promptType, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteError(MI_Context* context, MI_Uint32 resultCode, const MI_Char* resultType, const MI_Char* errorMessage, MI_Boolean *flag) {
  if (context && context->ft) {
    return context->ft->WriteError(context, resultCode, resultType, errorMessage, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteCimError(MI_Context* context, const MI_Instance *error, MI_Boolean *flag) {
  if (context && context->ft) {
    return context->ft->WriteCimError(context, error, flag);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteMessage(MI_Context* context, MI_Uint32 channel, const MI_Char* message) {
  if (context && context->ft) {
    return context->ft->WriteMessage(context, channel, message);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteProgress(MI_Context* context, const MI_Char* activity, const MI_Char* currentOperation, const MI_Char* statusDescription, MI_Uint32 percentComplete, MI_Uint32 secondsRemaining) {
  if (context && context->ft) {
    return context->ft->WriteProgress(context, activity, currentOperation, statusDescription, percentComplete, secondsRemaining);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteStreamParameter(MI_Context* self, const MI_Char* name, const MI_Value* value, MI_Type type, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->WriteStreamParameter(self, name, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteWarning(MI_Context* context, const MI_Char* message) {
  if (context && context->ft) {
    return context->ft->WriteMessage(context, MI_WRITEMESSAGE_CHANNEL_WARNING, message);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteVerbose(MI_Context* context, const MI_Char* message) {
  if (context && context->ft) {
    return context->ft->WriteMessage(context, MI_WRITEMESSAGE_CHANNEL_VERBOSE, message);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Context_WriteDebug(MI_Context* context, const MI_Char* message) {
  if (context && context->ft) {
    return context->ft->WriteMessage(context, MI_WRITEMESSAGE_CHANNEL_DEBUG, message);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_InstanceOf(inst) (&(inst)->__instance)

# pragma pack(pop)

#endif /* _MI_h */

#ifndef __MI_C_API_H
#define __MI_C_API_H

#ifndef MI_CALL_VERSION
#define MI_CALL_VERSION 1
#endif

#if (MI_CALL_VERSION > 1)
#error "Unsupported version of MI_CALL_VERSION. This SDK only supports version 1."
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef MI_Module* (MI_MAIN_CALL *MI_MainFunction)(MI_Server* server);

typedef struct _MI_QualifierSet MI_QualifierSet;

typedef struct _MI_QualifierSetFT {
  MI_Result (MI_CALL *GetQualifierCount)(const MI_QualifierSet *self, MI_Uint32 *count);
  MI_Result (MI_CALL *GetQualifierAt)(const MI_QualifierSet *self, MI_Uint32 index, const MI_Char **name, MI_Type *qualifierType, MI_Uint32 *qualifierFlags, MI_Value *qualifierValue);
  MI_Result (MI_CALL *GetQualifier)(const MI_QualifierSet *self, const MI_Char *name, MI_Type *qualifierType, MI_Uint32 *qualifierFlags, MI_Value *qualifierValue, MI_Uint32 *index);
} MI_QualifierSetFT;

struct _MI_QualifierSet {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_QualifierSetFT *ft;
};

typedef struct _MI_ParameterSet MI_ParameterSet;

typedef struct _MI_ParameterSetFT {
  MI_Result (MI_CALL *GetMethodReturnType)(const MI_ParameterSet *self, MI_Type *returnType, MI_QualifierSet *qualifierSet);
  MI_Result (MI_CALL *GetParameterCount)(const MI_ParameterSet *self, MI_Uint32 *count);
  MI_Result (MI_CALL *GetParameterAt)(const MI_ParameterSet *self, MI_Uint32 index, const MI_Char **name, MI_Type *parameterType, MI_Char **referenceClass, MI_QualifierSet *qualifierSet);
  MI_Result (MI_CALL *GetParameter)(const MI_ParameterSet *self, const MI_Char *name, MI_Type *parameterType, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32 *index);
} MI_ParameterSetFT;

struct _MI_ParameterSet {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_ParameterSetFT * ft;
};

typedef struct _MI_ClassFT {
  MI_Result (MI_CALL *GetClassName)(const MI_Class* self, const MI_Char** className);
  MI_Result (MI_CALL *GetNameSpace)(const MI_Class* self, const MI_Char** nameSpace);
  MI_Result (MI_CALL *GetServerName)(const MI_Class* self, const MI_Char** serverName);
  MI_Result (MI_CALL *GetElementCount)(const MI_Class* self, MI_Uint32* count);
  MI_Result (MI_CALL *GetElement)(const MI_Class* self, const MI_Char* name, MI_Value* value, MI_Boolean* valueExists, MI_Type* type, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32* flags, MI_Uint32* index);
  MI_Result (MI_CALL *GetElementAt)(const MI_Class* self, MI_Uint32 index, const MI_Char** name, MI_Value* value, MI_Boolean* valueExists, MI_Type* type, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32* flags);
  MI_Result (MI_CALL *GetClassQualifierSet)(const MI_Class* self, MI_QualifierSet *qualifierSet);
  MI_Result (MI_CALL *GetMethodCount)(const MI_Class* self, MI_Uint32* count);
  MI_Result (MI_CALL *GetMethodAt)(const MI_Class *self, MI_Uint32 index, const MI_Char **name, MI_QualifierSet *qualifierSet, MI_ParameterSet *parameterSet);
  MI_Result (MI_CALL *GetMethod)(const MI_Class *self, const MI_Char *name, MI_QualifierSet *qualifierSet, MI_ParameterSet *parameterSet, MI_Uint32 *index);
  MI_Result (MI_CALL *GetParentClassName)(const MI_Class *self, const MI_Char **name);
  MI_Result (MI_CALL *GetParentClass)(const MI_Class *self, MI_Class **parentClass);
  MI_Result (MI_CALL *Delete)(MI_Class* self);
  MI_Result (MI_CALL *Clone)(const MI_Class* self, MI_Class** newClass);
} MI_ClassFT;

struct _MI_Class {
  const MI_ClassFT *ft;
  MI_CONST MI_ClassDecl *classDecl;
  MI_CONST MI_Char *namespaceName;
  MI_CONST MI_Char *serverName;
  ptrdiff_t reserved[4];
};

typedef struct _MI_Application MI_Application;
typedef struct _MI_Session MI_Session;
typedef struct _MI_Operation MI_Operation;
typedef struct _MI_HostedProvider MI_HostedProvider;
typedef struct _MI_DestinationOptions MI_DestinationOptions;
typedef struct _MI_OperationOptions MI_OperationOptions;

typedef enum _MI_OperationCallback_ResponseType {
  MI_OperationCallback_ResponseType_No,
  MI_OperationCallback_ResponseType_Yes,
  MI_OperationCallback_ResponseType_NoToAll,
  MI_OperationCallback_ResponseType_YesToAll
} MI_OperationCallback_ResponseType;

typedef void (MI_CALL *MI_OperationCallback_PromptUser)(MI_Operation *operation, void *callbackContext, const MI_Char *message, MI_PromptType promptType, MI_Result (MI_CALL * promptUserResult)(MI_Operation *operation, MI_OperationCallback_ResponseType response));
typedef void (MI_CALL *MI_OperationCallback_WriteError)(MI_Operation *operation, void *callbackContext, MI_Instance*instance, MI_Result (MI_CALL * writeErrorResult)(MI_Operation *operation, MI_OperationCallback_ResponseType response));

#define MI_WRITEMESSAGE_CHANNEL_WARNING 0
#define MI_WRITEMESSAGE_CHANNEL_VERBOSE 1
#define MI_WRITEMESSAGE_CHANNEL_DEBUG 2

typedef void (MI_CALL *MI_OperationCallback_WriteMessage)(MI_Operation *operation, void *callbackContext, MI_Uint32 channel, const MI_Char *message);
typedef void (MI_CALL *MI_OperationCallback_WriteProgress)(MI_Operation *operation, void *callbackContext, const MI_Char *activity, const MI_Char *currentOperation, const MI_Char *statusDescription, MI_Uint32 percentageComplete, MI_Uint32 secondsRemaining);
typedef void (MI_CALL *MI_OperationCallback_Instance)(MI_Operation *operation, void *callbackContext, const MI_Instance *instance, MI_Boolean moreResults, MI_Result resultCode, const MI_Char *errorString, const MI_Instance *errorDetails, MI_Result (MI_CALL * resultAcknowledgement)(MI_Operation *operation));
typedef void (MI_CALL *MI_OperationCallback_StreamedParameter)(MI_Operation *operation, void *callbackContext, const MI_Char *parameterName, MI_Type resultType, const MI_Value *result, MI_Result (MI_CALL * resultAcknowledgement)(MI_Operation *operation));
typedef void (MI_CALL *MI_OperationCallback_Indication)(MI_Operation *operation, void *callbackContext, const MI_Instance *instance, const MI_Char *bookmark, const MI_Char *machineID, MI_Boolean moreResults, MI_Result resultCode, const MI_Char *errorString, const MI_Instance *errorDetails, MI_Result (MI_CALL * resultAcknowledgement)(MI_Operation *operation));
typedef void (MI_CALL *MI_OperationCallback_Class)(MI_Operation *operation, void *callbackContext, const MI_Class *classResult, MI_Boolean moreResults, MI_Result resultCode, const MI_Char *errorString, const MI_Instance *errorDetails, MI_Result (MI_CALL * resultAcknowledgement)(MI_Operation *operation));

typedef struct _MI_OperationCallbacks {
  void *callbackContext;
  MI_OperationCallback_PromptUser promptUser;
  MI_OperationCallback_WriteError writeError;
  MI_OperationCallback_WriteMessage writeMessage;
  MI_OperationCallback_WriteProgress writeProgress;
  MI_OperationCallback_Instance instanceResult;
  MI_OperationCallback_Indication indicationResult;
  MI_OperationCallback_Class classResult;
  MI_OperationCallback_StreamedParameter streamedParameterResult;
} MI_OperationCallbacks;

#define MI_OPERATIONCALLBACKS_NULL {NULL}

typedef struct _MI_SessionCallbacks {
  void *callbackContext;
  void (MI_CALL *writeMessage)(MI_Application *application, void *callbackContext, MI_Uint32 channel, const MI_Char * message);
  void (MI_CALL *writeError)(MI_Application *application, void *callbackContext, MI_Instance *instance);
} MI_SessionCallbacks;

#define MI_SESSIONCALLBACKS_NULL {NULL}

#define MI_OPERATIONFLAGS_AUTOMATIC_ACK_RESULTS 0x0000
#define MI_OPERATIONFLAGS_MANUAL_ACK_RESULTS 0x0001
#define MI_OPERATIONFLAGS_NO_RTTI 0x0400
#define MI_OPERATIONFLAGS_BASIC_RTTI 0x0002
#define MI_OPERATIONFLAGS_STANDARD_RTTI 0x0800
#define MI_OPERATIONFLAGS_FULL_RTTI 0x0004
#define MI_OPERATIONFLAGS_DEFAULT_RTTI 0
#define MI_OPERATIONFLAGS_NON_LOCALIZED_QUALIFIERS 0x0000
#define MI_OPERATIONFLAGS_LOCALIZED_QUALIFIERS 0x0008
#define MI_OPERATIONFLAGS_NON_EXPENSIVE_PROPERTIES_ONLY 0x0040
#define MI_OPERATIONFLAGS_EXPENSIVE_PROPERTIES 0x0040
#define MI_OPERATIONFLAGS_POLYMORPHISM_DEEP 0x0000
#define MI_OPERATIONFLAGS_POLYMORPHISM_SHALLOW 0x0080
#define MI_OPERATIONFLAGS_POLYMORPHISM_DEEP_BASE_PROPS_ONLY 0x0180
#define MI_OPERATIONFLAGS_REPORT_OPERATION_STARTED 0x0200
#define MI_AUTH_TYPE_DEFAULT MI_T("Default")
#define MI_AUTH_TYPE_NONE MI_T("None")
#define MI_AUTH_TYPE_DIGEST MI_T("Digest")
#define MI_AUTH_TYPE_NEGO_WITH_CREDS MI_T("NegoWithCreds")
#define MI_AUTH_TYPE_NEGO_NO_CREDS MI_T("NegoNoCreds")
#define MI_AUTH_TYPE_BASIC MI_T("Basic")
#define MI_AUTH_TYPE_KERBEROS MI_T("Kerberos")
#define MI_AUTH_TYPE_CLIENT_CERTS MI_T("ClientCerts")
#define MI_AUTH_TYPE_NTLM MI_T("Ntlmdomain")
#if (WINVER >= 0x600)
#define MI_AUTH_TYPE_CREDSSP MI_T("CredSSP")
#endif
#define MI_AUTH_TYPE_ISSUER_CERT MI_T("IssuerCert")

typedef struct _MI_UsernamePasswordCreds {
  const MI_Char *domain;
  const MI_Char *username;
  const MI_Char *password;
} MI_UsernamePasswordCreds;

typedef struct _MI_UserCredentials {
  const MI_Char *authenticationType;
  union {
    MI_UsernamePasswordCreds usernamePassword;
    const MI_Char *certificateThumbprint;
  } credentials;
} MI_UserCredentials;

typedef enum _MI_SubscriptionDeliveryType {
  MI_SubscriptionDeliveryType_Pull = 1,
  MI_SubscriptionDeliveryType_Push = 2
} MI_SubscriptionDeliveryType;

typedef struct _MI_SubscriptionDeliveryOptions MI_SubscriptionDeliveryOptions;

typedef struct _MI_SubscriptionDeliveryOptionsFT {
  MI_Result (MI_CALL *SetString)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, const MI_Char *value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetNumber)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, MI_Uint32 value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetDateTime)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, const MI_Datetime *value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetInterval)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, const MI_Interval *value, MI_Uint32 flags);
  MI_Result (MI_CALL *AddCredentials)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, const MI_UserCredentials *credentials, MI_Uint32 flags);
  MI_Result (MI_CALL *Delete)(MI_SubscriptionDeliveryOptions* self);
  MI_Result (MI_CALL *GetString)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, const MI_Char **value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetNumber)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, MI_Uint32 *value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetDateTime)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, MI_Datetime *value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetInterval)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, MI_Interval *value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOptionCount)(MI_SubscriptionDeliveryOptions *options, MI_Uint32 *count);
  MI_Result (MI_CALL *GetOptionAt)(MI_SubscriptionDeliveryOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOption)(MI_SubscriptionDeliveryOptions *options, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetCredentialsCount)(MI_SubscriptionDeliveryOptions *options, MI_Uint32 *count);
  MI_Result (MI_CALL *GetCredentialsAt)(MI_SubscriptionDeliveryOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_UserCredentials *credentials, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetCredentialsPasswordAt)(MI_SubscriptionDeliveryOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Char *password, MI_Uint32 bufferLength, MI_Uint32 *passwordLength, MI_Uint32 *flags);
  MI_Result (MI_CALL *Clone)(const MI_SubscriptionDeliveryOptions* self, MI_SubscriptionDeliveryOptions* newSubscriptionDeliveryOptions);
} MI_SubscriptionDeliveryOptionsFT;

typedef struct _MI_SubscriptionDeliveryOptions {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_SubscriptionDeliveryOptionsFT * ft;
} MI_SubscriptionDeliveryOptions;

#define MI_SUBSCRIPTIONDELIVERYOPTIONS_NULL { 0, 0, NULL }

typedef struct _MI_Serializer MI_Serializer;
typedef struct _MI_SerializerFT MI_SerializerFT;
typedef struct _MI_Deserializer MI_Deserializer;
typedef struct _MI_DeserializerFT MI_DeserializerFT;

struct _MI_Serializer {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
};

struct _MI_Deserializer {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
};

struct _MI_SerializerFT {
  MI_Result (MI_CALL *Close)(MI_Serializer *serializer);
  MI_Result (MI_CALL *SerializeClass)(MI_Serializer *serializer, MI_Uint32 flags, const MI_Class *classObject, MI_Uint8 *clientBuffer, MI_Uint32 clientBufferLength, MI_Uint32 *clientBufferNeeded);
  MI_Result (MI_CALL *SerializeInstance)(MI_Serializer *serializer, MI_Uint32 flags, const MI_Instance *instanceObject, MI_Uint8 *clientBuffer, MI_Uint32 clientBufferLength, MI_Uint32 *clientBufferNeeded);
};

typedef MI_Result (MI_CALL *MI_Deserializer_ClassObjectNeeded)(void *context, const MI_Char *serverName, const MI_Char *namespaceName, const MI_Char *className, MI_Class **requestedClassObject);

struct _MI_DeserializerFT {
  MI_Result (MI_CALL *Close)(MI_Deserializer *deserializer);
  MI_Result (MI_CALL *DeserializeClass)(MI_Deserializer *deserializer, MI_Uint32 flags, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Class *parentClass, const MI_Char *serverName, const MI_Char *namespaceName, MI_Deserializer_ClassObjectNeeded classObjectNeeded, void *classObjectNeededContext, MI_Uint32 *serializedBufferRead, MI_Class **classObject, MI_Instance **cimErrorDetails);
  MI_Result (MI_CALL *Class_GetClassName)(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *className, MI_Uint32 *classNameLength, MI_Instance **cimErrorDetails);
  MI_Result (MI_CALL *Class_GetParentClassName)(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *parentClassName, MI_Uint32 *parentClassNameLength, MI_Instance **cimErrorDetails);
  MI_Result (MI_CALL *DeserializeInstance)(MI_Deserializer *deserializer, MI_Uint32 flags, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Class **classObjects, MI_Uint32 numberClassObjects, MI_Deserializer_ClassObjectNeeded classObjectNeeded, void *classObjectNeededContext, MI_Uint32 *serializedBufferRead, MI_Instance **instanceObject, MI_Instance **cimErrorDetails);
  MI_Result (MI_CALL *Instance_GetClassName)(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *className, MI_Uint32 *classNameLength, MI_Instance **cimErrorDetails);
};

typedef struct _MI_ApplicationFT {
  MI_Result (MI_CALL *Close)(MI_Application *application);
  MI_Result (MI_CALL *NewSession)(MI_Application *application, const MI_Char *protocol, const MI_Char *destination, MI_DestinationOptions *options, MI_SessionCallbacks *callbacks, MI_Instance **extendedError, MI_Session *session);
  MI_Result (MI_CALL *NewHostedProvider)(MI_Application *application, const MI_Char *namespaceName, const MI_Char *providerName, MI_MainFunction mi_Main, MI_Instance **extendedError, MI_HostedProvider *provider);
  MI_Result (MI_CALL *NewInstance)(MI_Application *application, const MI_Char *className, const MI_ClassDecl *classRTTI, MI_Instance **instance);
  MI_Result (MI_CALL *NewDestinationOptions)(MI_Application *application, MI_DestinationOptions *options);
  MI_Result (MI_CALL *NewOperationOptions)(MI_Application *application, MI_Boolean customOptionsMustUnderstand, MI_OperationOptions *options);
  MI_Result (MI_CALL *NewSubscriptionDeliveryOptions)(MI_Application *application, MI_SubscriptionDeliveryType deliveryType, MI_SubscriptionDeliveryOptions *deliveryOptions);
  MI_Result (MI_CALL *NewSerializer)(MI_Application *application, MI_Uint32 flags, MI_Char *format, MI_Serializer *serializer);
  MI_Result (MI_CALL *NewDeserializer)(MI_Application *application, MI_Uint32 flags, MI_Char *format, MI_Deserializer *deserializer);
  MI_Result (MI_CALL *NewInstanceFromClass)(MI_Application *application, const MI_Char *className, const MI_Class *classObject, MI_Instance **instance);
  MI_Result (MI_CALL *NewClass)(MI_Application *application, const MI_ClassDecl* classDecl, const MI_Char *namespaceName, const MI_Char *serverName, MI_Class** classObject);
} MI_ApplicationFT;

typedef struct _MI_HostedProviderFT {
  MI_Result (MI_CALL *Close)(MI_HostedProvider *hostedProvider);
  MI_Result (MI_CALL *GetApplication)(MI_HostedProvider *hostedProvider, MI_Application *application);
} MI_HostedProviderFT;

typedef struct _MI_SessionFT {
  MI_Result (MI_CALL *Close)(MI_Session *session, void *completionContext, void (MI_CALL *completionCallback)(void *completionContext));
  MI_Result (MI_CALL *GetApplication)(MI_Session *session, MI_Application *application);
  void (MI_CALL *GetInstance)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *ModifyInstance)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *CreateInstance)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *DeleteInstance)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *Invoke)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, const MI_Char *methodName, const MI_Instance *inboundInstance, const MI_Instance *inboundProperties, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *EnumerateInstances)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *QueryInstances)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *queryDialect, const MI_Char *queryExpression, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *AssociatorInstances)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *instanceKeys, const MI_Char *assocClass, const MI_Char *resultClass, const MI_Char *role, const MI_Char *resultRole, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *ReferenceInstances)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *instanceKeys, const MI_Char *resultClass, const MI_Char *role, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *Subscribe)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *queryDialect, const MI_Char *queryExpression, const MI_SubscriptionDeliveryOptions *deliverOptions, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *GetClass)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *EnumerateClasses)(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_Boolean classNamesOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation);
  void (MI_CALL *TestConnection)(MI_Session *session, MI_Uint32 flags, MI_OperationCallbacks *callbacks, MI_Operation *operation);
} MI_SessionFT;

typedef struct _MI_OperationFT {
  MI_Result (MI_CALL *Close)(MI_Operation *operation);
  MI_Result (MI_CALL *Cancel)(MI_Operation *operation, MI_CancellationReason reason);
  MI_Result (MI_CALL *GetSession)(MI_Operation *operation, MI_Session *session);
  MI_Result (MI_CALL *GetInstance)(MI_Operation *operation, const MI_Instance **instance, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails);
  MI_Result (MI_CALL *GetIndication)(MI_Operation *operation, const MI_Instance **instance, const MI_Char **bookmark, const MI_Char **machineID, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails);
  MI_Result (MI_CALL *GetClass)(MI_Operation *operation, const MI_Class **classResult, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails);
} MI_OperationFT;

typedef struct _MI_DestinationOptionsFT {
  void (MI_CALL *Delete)(MI_DestinationOptions *options);
  MI_Result (MI_CALL *SetString)(MI_DestinationOptions *options, const MI_Char *optionName, const MI_Char *value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetNumber)(MI_DestinationOptions *options, const MI_Char *optionName, MI_Uint32 value, MI_Uint32 flags);
  MI_Result (MI_CALL *AddCredentials)(MI_DestinationOptions *options, const MI_Char *optionName, const MI_UserCredentials *credentials, MI_Uint32 flags);
  MI_Result (MI_CALL *GetString)(MI_DestinationOptions *options, const MI_Char *optionName, const MI_Char **value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetNumber)(MI_DestinationOptions *options, const MI_Char *optionName, MI_Uint32 *value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOptionCount)(MI_DestinationOptions *options, MI_Uint32 *count);
  MI_Result (MI_CALL *GetOptionAt)(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOption)(MI_DestinationOptions *options, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetCredentialsCount)(MI_DestinationOptions *options, MI_Uint32 *count);
  MI_Result (MI_CALL *GetCredentialsAt)(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_UserCredentials *credentials, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetCredentialsPasswordAt)(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Char *password, MI_Uint32 bufferLength, MI_Uint32 *passwordLength, MI_Uint32 *flags);
  MI_Result (MI_CALL *Clone)(const MI_DestinationOptions* self, MI_DestinationOptions* newDestinationOptions);
  MI_Result (MI_CALL *SetInterval)(MI_DestinationOptions *options, const MI_Char *optionName, const MI_Interval *value, MI_Uint32 flags);
  MI_Result (MI_CALL *GetInterval)(MI_DestinationOptions *options, const MI_Char *optionName, MI_Interval *value, MI_Uint32 *index, MI_Uint32 *flags);
} MI_DestinationOptionsFT;

typedef struct _MI_OperationOptionsFT {
  void (MI_CALL *Delete)(MI_OperationOptions *options);
  MI_Result (MI_CALL *SetString)(MI_OperationOptions *options, const MI_Char *optionName, const MI_Char *value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetNumber)(MI_OperationOptions *options, const MI_Char *optionName, MI_Uint32 value, MI_Uint32 flags);
  MI_Result (MI_CALL *SetCustomOption)(MI_OperationOptions *options, const MI_Char *optionName, MI_Type valueType, const MI_Value *value, MI_Boolean mustComply, MI_Uint32 flags);
  MI_Result (MI_CALL *GetString)(MI_OperationOptions *options, const MI_Char *optionName, const MI_Char **value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetNumber)(MI_OperationOptions *options, const MI_Char *optionName, MI_Uint32 *value, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOptionCount)(MI_OperationOptions *options, MI_Uint32 *count);
  MI_Result (MI_CALL *GetOptionAt)(MI_OperationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetOption)(MI_OperationOptions *options, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags);
  MI_Result (MI_CALL *GetEnabledChannels)(MI_OperationOptions *options, const MI_Char *optionName, MI_Uint32 *channels, MI_Uint32 bufferLength, MI_Uint32 *channelCount, MI_Uint32 *flags);
  MI_Result (MI_CALL *Clone)(const MI_OperationOptions* self, MI_OperationOptions* newOperationOptions);
  MI_Result (MI_CALL *SetInterval)(MI_OperationOptions *options, const MI_Char *optionName, const MI_Interval *value, MI_Uint32 flags);
  MI_Result (MI_CALL *GetInterval)(MI_OperationOptions *options, const MI_Char *optionName, MI_Interval *value, MI_Uint32 *index, MI_Uint32 *flags);
} MI_OperationOptionsFT;

struct _MI_Application {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_ApplicationFT *ft;
};

#define MI_APPLICATION_NULL { 0, 0, NULL }

struct _MI_Session {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_SessionFT *ft;
};

#define MI_SESSION_NULL { 0, 0, NULL }

struct _MI_Operation {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_OperationFT *ft;
};

#define MI_OPERATION_NULL { 0, 0, NULL }

struct _MI_HostedProvider {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_HostedProviderFT *ft;
};

#define MI_HOSTEDPROVIDER_NULL { 0, 0, NULL }

struct _MI_DestinationOptions {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_DestinationOptionsFT *ft;
};

#define MI_DESTINATIONOPTIONS_NULL { 0, 0, NULL }

struct _MI_OperationOptions {
  MI_Uint64 reserved1;
  ptrdiff_t reserved2;
  const MI_OperationOptionsFT *ft;
};

#define MI_OPERATIONOPTIONS_NULL { 0, 0, NULL }

typedef struct _MI_UtilitiesFT {
  MI_ErrorCategory (MI_CALL *MapErrorToMiErrorCategory)(MI_Char *errorType, MI_Uint32 error);
  MI_Result (MI_CALL *CimErrorFromErrorCode)(MI_Uint32 error, const MI_Char *errorType, const MI_Char* errorMessage, MI_Instance **cimError);
} MI_UtilitiesFT;

typedef struct _MI_ClientFT_V1 {
  const MI_ApplicationFT *applicationFT;
  const MI_SessionFT *sessionFT;
  const MI_OperationFT *operationFT;
  const MI_HostedProviderFT *hostedProviderFT;
  const MI_SerializerFT *serializerFT;
  const MI_DeserializerFT *deserializerFT;
  const MI_SubscriptionDeliveryOptionsFT *subscribeDeliveryOptionsFT;
  const MI_DestinationOptionsFT *destinationOptionsFT;
  const MI_OperationOptionsFT *operationOptionsFT;
  const MI_UtilitiesFT *utilitiesFT;
} MI_ClientFT_V1;

#ifndef _MANAGED_PURE
__declspec(dllimport) const MI_ClientFT_V1 *mi_clientFT_V1;
#endif

#if (MI_CALL_VERSION == 1)
#define mi_clientFT mi_clientFT_V1
#endif

MI_Result MI_MAIN_CALL MI_Application_InitializeV1(MI_Uint32 flags, const MI_Char *applicationID, MI_Instance **extendedError, MI_Application *application);

#if MI_CALL_VERSION == 1
#define MI_Application_Initialize MI_Application_InitializeV1
#endif

MI_INLINE MI_Result MI_Application_Close(MI_Application *application) {
  if (application && application->ft) {
    return application->ft->Close(application);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewInstance(MI_Application *application, const MI_Char *className, const MI_ClassDecl *classRTTI, MI_Instance **instance) {
  if (application && application->ft) {
    return application->ft->NewInstance(application, className, classRTTI, instance);
  } else {
    if (instance) {
      *instance = NULL;
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewInstanceFromClass(MI_Application *application, const MI_Char *className, const MI_Class *classObject, MI_Instance **instance) {
  if (application && application->ft) {
    return application->ft->NewInstanceFromClass(application, className, classObject, instance);
  } else {
    if (instance) {
      *instance = NULL;
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewClass(MI_Application *application, const MI_ClassDecl* classDecl, const MI_Char *namespaceName, const MI_Char *serverName, MI_Class** classObject) {
  if (application && application->ft) {
    return application->ft->NewClass(application, classDecl, namespaceName, serverName, classObject);
  } else {
    if (classObject) {
      *classObject = NULL;
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewParameterSet(MI_Application *application, const MI_ClassDecl *classRTTI, MI_Instance **instance) {
  if (application && application->ft) {
    return application->ft->NewInstance(application, MI_T("Parameters"), classRTTI, instance);
  } else {
    if (instance) {
      *instance = NULL;
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewDestinationOptions(MI_Application *application, MI_DestinationOptions *options) {
  if (application && application->ft) {
    return application->ft->NewDestinationOptions(application, options);
  } else {
    if (options) {
      memset(options, 0, sizeof(MI_DestinationOptions));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewOperationOptions(MI_Application *application, MI_Boolean mustUnderstand, MI_OperationOptions *options) {
  if (application && application->ft) {
    return application->ft->NewOperationOptions(application, mustUnderstand, options);
  } else {
    if (options) {
      memset(options, 0, sizeof(MI_OperationOptions));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewSubscriptionDeliveryOptions(MI_Application *application, MI_SubscriptionDeliveryType deliveryType, MI_SubscriptionDeliveryOptions *deliveryOptions) {
  if (application && application->ft) {
    return application->ft->NewSubscriptionDeliveryOptions(application, deliveryType, deliveryOptions);
  } else {
    if (deliveryOptions) {
      memset(deliveryOptions, 0, sizeof(MI_SubscriptionDeliveryOptions));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewSession(MI_Application *application, const MI_Char *protocol, const MI_Char *destination, MI_DestinationOptions *options, MI_SessionCallbacks *callbacks, MI_Instance **extendedError, MI_Session *session) {
  if (application && application->ft) {
    return application->ft->NewSession(application, protocol, destination, options, callbacks, extendedError, session);
  } else {
    if (session) {
      memset(session, 0, sizeof(MI_Session));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewHostedProvider(MI_Application *application, const MI_Char *namespaceName, const MI_Char *providerName, MI_MainFunction mi_Main, MI_Instance **extendedError, MI_HostedProvider *hostedProvider) {
  if (application && application->ft) {
    return application->ft->NewHostedProvider(application, namespaceName, providerName, mi_Main, extendedError, hostedProvider);
  } else {
    if (hostedProvider) {
      memset(hostedProvider, 0, sizeof(MI_HostedProvider));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewSerializer(MI_Application *application, MI_Uint32 flags, MI_Char *format, MI_Serializer *serializer) {
  if (application && application->ft) {
    return application->ft->NewSerializer(application, flags, format, serializer);
  } else {
    if (serializer) {
      memset(serializer, 0, sizeof(MI_Serializer));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Application_NewDeserializer(MI_Application *application, MI_Uint32 flags, MI_Char *format, MI_Deserializer *deserializer) {
  if (application && application->ft) {
    return application->ft->NewDeserializer(application, flags, format, deserializer);
  } else {
    if (deserializer) {
      memset(deserializer, 0, sizeof(MI_Deserializer));
    }
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_HostedProvider_Close(MI_HostedProvider *hostedProvider) {
  if (hostedProvider && hostedProvider->ft) {
    return hostedProvider->ft->Close(hostedProvider);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_HostedProvider_GetApplication(MI_HostedProvider *hostedProvider, MI_Application *application) {
  if (hostedProvider && hostedProvider->ft) {
    return hostedProvider->ft->GetApplication(hostedProvider, application);
  } else if (application) {
    memset(application, 0, sizeof(MI_Application));
  }
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Session_Close(MI_Session *session, void *completionContext, void (MI_CALL *completionCallback)(void *completionContext)) {
  if (session && session->ft) {
    return session->ft->Close(session, completionContext, completionCallback);
  } else if (completionCallback) {
    completionCallback(completionContext);
    return MI_RESULT_OK;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Session_GetApplication(MI_Session *session, MI_Application *application) {
  if (session && session->ft) {
    return session->ft->GetApplication(session, application);
  }
  if (application) {
    memset(application, 0, sizeof(MI_Application));
  }
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE void MI_Session_GetInstance(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->GetInstance(session, flags, options, namespaceName, inboundInstance, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_ModifyInstance(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->ModifyInstance(session, flags, options, namespaceName, inboundInstance, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_CreateInstance(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->CreateInstance(session, flags, options, namespaceName, inboundInstance, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_DeleteInstance(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *inboundInstance, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->DeleteInstance(session, flags, options, namespaceName, inboundInstance, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_Invoke(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, const MI_Char *methodName, const MI_Instance *inboundInstance, const MI_Instance *inboundProperties, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->Invoke(session, flags, options, namespaceName, className, methodName, inboundInstance, inboundProperties, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_EnumerateInstances(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->EnumerateInstances(session, flags, options, namespaceName, className, keysOnly, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_QueryInstances(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *queryDialect, const MI_Char *queryExpression, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->QueryInstances(session, flags, options, namespaceName, queryDialect, queryExpression, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_AssociatorInstances(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *instanceKey, const MI_Char *assocClass, const MI_Char *resultClass, const MI_Char *role, const MI_Char *resultRole, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->AssociatorInstances(session, flags, options, namespaceName, instanceKey, assocClass, resultClass, role, resultRole, keysOnly, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_ReferenceInstances(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Instance *instanceKey, const MI_Char *resultClass, const MI_Char *role, MI_Boolean keysOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->ReferenceInstances(session, flags, options, namespaceName, instanceKey, resultClass, role, keysOnly, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_Subscribe(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *queryDialect, const MI_Char *queryExpression, const MI_SubscriptionDeliveryOptions *deliverOptions, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->Subscribe(session, flags, options, namespaceName, queryDialect, queryExpression, deliverOptions, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->indicationResult) {
      callbacks->indicationResult(NULL, callbacks->callbackContext, NULL, NULL, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_GetClass(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->GetClass(session, flags, options, namespaceName, className, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->classResult) {
      callbacks->classResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_EnumerateClasses(MI_Session *session, MI_Uint32 flags, MI_OperationOptions *options, const MI_Char *namespaceName, const MI_Char *className, MI_Boolean classNamesOnly, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->EnumerateClasses(session, flags, options, namespaceName, className, classNamesOnly, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->classResult) {
      callbacks->classResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE void MI_Session_TestConnection(MI_Session *session, MI_Uint32 flags, MI_OperationCallbacks *callbacks, MI_Operation *operation) {
  if (session && session->ft) {
    session->ft->TestConnection(session, flags, callbacks, operation);
  } else {
    if (operation) {
      memset(operation, 0, sizeof(*operation));
    }
    if (callbacks && callbacks->instanceResult) {
      callbacks->instanceResult(NULL, callbacks->callbackContext, NULL, MI_FALSE, MI_RESULT_INVALID_PARAMETER, NULL, NULL, NULL);
    }
  }
}

MI_INLINE MI_Result MI_Operation_GetInstance(MI_Operation *operation, const MI_Instance **instance, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails) {
  if (operation && operation->ft) {
    return operation->ft->GetInstance(operation, instance, moreResults, result, errorMessage, completionDetails);
  }
  if (result)
    *result = MI_RESULT_INVALID_PARAMETER;
  if (moreResults)
    *moreResults = MI_FALSE;
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Operation_GetIndication(MI_Operation *operation, const MI_Instance **instance, const MI_Char **bookmark, const MI_Char **machineID, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails) {
  if (operation && operation->ft) {
    return operation->ft->GetIndication(operation, instance, bookmark, machineID, moreResults, result, errorMessage, completionDetails);
  }
  if (result)
    *result = MI_RESULT_INVALID_PARAMETER;
  if (moreResults)
    *moreResults = MI_FALSE;
  return  MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Operation_GetClass(MI_Operation *operation, const MI_Class **classResult, MI_Boolean *moreResults, MI_Result *result, const MI_Char **errorMessage, const MI_Instance **completionDetails) {
  if (operation && operation->ft) {
    return operation->ft->GetClass(operation, classResult, moreResults, result, errorMessage, completionDetails);
  }
  if (result)
    *result = MI_RESULT_INVALID_PARAMETER;
  if (moreResults)
    *moreResults = MI_FALSE;
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Operation_Close(MI_Operation *operation) {
  if (operation && operation->ft) {
    return operation->ft->Close(operation);
  }
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Operation_Cancel(MI_Operation *operation, MI_CancellationReason reason) {
  if (operation && operation->ft) {
    return operation->ft->Cancel(operation, reason);
  }
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE MI_Result MI_Operation_GetSession(MI_Operation *operation, MI_Session *session) {
  if (session) {
    memset(session, 0, sizeof(MI_Session));
  }
  if (operation && operation->ft) {
    return operation->ft->GetSession(operation, session);
  }
  return MI_RESULT_INVALID_PARAMETER;
}

MI_INLINE void MI_DestinationOptions_Delete(MI_DestinationOptions *options) {
  if (options && options->ft) {
    options->ft->Delete(options);
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetTimeout(MI_DestinationOptions *options, const MI_Interval *timeout) {
  if (options && options->ft) {
    return options->ft->SetInterval(options, MI_T("__MI_DESTINATIONOPTIONS_TIMEOUT"), timeout, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetTimeout(MI_DestinationOptions *options, MI_Interval *timeout) {
  if (options && options->ft) {
    return options->ft->GetInterval(options, MI_T("__MI_DESTINATIONOPTIONS_TIMEOUT"), timeout, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetCertCACheck(MI_DestinationOptions *options, MI_Boolean check) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_CA_CHECK"), check, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCertCACheck(MI_DestinationOptions *options, MI_Boolean *check) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_CA_CHECK"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *check = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetCertCNCheck(MI_DestinationOptions *options, MI_Boolean check) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_CN_CHECK"), check, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCertCNCheck(MI_DestinationOptions *options, MI_Boolean *check) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_CN_CHECK"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *check = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetCertRevocationCheck(MI_DestinationOptions *options, MI_Boolean check) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_REVOCATION_CHECK"), check, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCertRevocationCheck(MI_DestinationOptions *options, MI_Boolean *check) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_CERT_REVOCATION_CHECK"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *check = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetPacketPrivacy(MI_DestinationOptions *options, MI_Boolean privacy) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_PRIVACY"), privacy, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetPacketPrivacy(MI_DestinationOptions *options, MI_Boolean *privacy) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_PRIVACY"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *privacy = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetPacketIntegrity(MI_DestinationOptions *options, MI_Boolean integrity) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_INTEGRITY"), integrity, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetPacketIntegrity(MI_DestinationOptions *options, MI_Boolean *integrity) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_INTEGRITY"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *integrity = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_DESTINATIONOPTIONS_PACKET_ENCODING_DEFAULT MI_T("default")
#define MI_DESTINATIONOPTIONS_PACKET_ENCODING_UTF8 MI_T("UTF8")
#define MI_DESTINATIONOPTIONS_PACKET_ENCODING_UTF16 MI_T("UTF16")

MI_INLINE MI_Result MI_DestinationOptions_SetPacketEncoding(MI_DestinationOptions *options, const MI_Char *encoding) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_ENCODING"), encoding, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetPacketEncoding(MI_DestinationOptions *options, const MI_Char **encoding) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_PACKET_ENCODING"), encoding, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetDataLocale(MI_DestinationOptions *options, const MI_Char *locale) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_DATA_LOCALE"), locale, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetDataLocale(MI_DestinationOptions *options, const MI_Char **locale) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_DATA_LOCALE"), locale, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetUILocale(MI_DestinationOptions *options, const MI_Char *locale) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_UI_LOCALE"), locale, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetUILocale(MI_DestinationOptions *options, const MI_Char **locale) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_UI_LOCALE"), locale, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetMaxEnvelopeSize(MI_DestinationOptions *options, MI_Uint32 sizeInKB) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_MAX_ENVELOPE_SIZE"), sizeInKB, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetMaxEnvelopeSize(MI_DestinationOptions *options, MI_Uint32 *sizeInKB) {
  if (options && options->ft) {
    return options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_MAX_ENVELOPE_SIZE"), sizeInKB, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetEncodePortInSPN(MI_DestinationOptions *options, MI_Boolean encodePort) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_ENCODE_PORT_IN_SPN"), encodePort, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetEncodePortInSPN(MI_DestinationOptions *options, MI_Boolean *encodePort) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_ENCODE_PORT_IN_SPN"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *encodePort = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetHttpUrlPrefix(MI_DestinationOptions *options, const MI_Char *prefix) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_HTTP_URL_PREFIX"), prefix, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetHttpUrlPrefix(MI_DestinationOptions *options, const MI_Char **prefix) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_HTTP_URL_PREFIX"), prefix, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetDestinationPort(MI_DestinationOptions *options, MI_Uint32 port) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_DESTINATION_PORT"), port, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetDestinationPort(MI_DestinationOptions *options, MI_Uint32 *port) {
  if (options && options->ft) {
    return options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_DESTINATION_PORT"), port, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_DESTINATIONOPTIONS_TRANSPORT_HTTP MI_T("HTTP")
#define MI_DESTINATIONOPTIONS_TRANPSORT_HTTPS MI_T("HTTPS")

MI_INLINE MI_Result MI_DestinationOptions_SetTransport(MI_DestinationOptions *options, const MI_Char *transport) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_TRANSPORT"), transport, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetTransport(MI_DestinationOptions *options, const MI_Char **transport) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_TRANSPORT"), transport, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_DESTINATIONOPTIONS_PROXY_TYPE_IE MI_T("IE")
#define MI_DESTINATIONOPTIONS_PROXY_TYPE_WINHTTP MI_T("WinHTTP")
#define MI_DESTINATIONOPTIONS_PROXY_TYPE_AUTO MI_T("Auto")
#define MI_DESTINATIONOPTIONS_PROXY_TYPE_NONE MI_T("None")

MI_INLINE MI_Result MI_DestinationOptions_SetProxyType(MI_DestinationOptions *options, const MI_Char *proxyType) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_DESTINATIONOPTIONS_PROXY_TYPE"), proxyType, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetProxyType(MI_DestinationOptions *options, const MI_Char **proxyType) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_DESTINATIONOPTIONS_PROXY_TYPE"), proxyType, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_AddProxyCredentials(MI_DestinationOptions *options, const MI_UserCredentials *credentials) {
  if (options && options->ft) {
    return options->ft->AddCredentials(options, MI_T("__MI_DESTINATIONOPTIONS_PROXY_CREDENTIALS"), credentials, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_AddDestinationCredentials(MI_DestinationOptions *options, const MI_UserCredentials *credentials) {
  if (options && options->ft) {
    return options->ft->AddCredentials(options, MI_T("__MI_DESTINATIONOPTIONS_DESTINATION_CREDENTIALS"), credentials, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

typedef enum _MI_DestinationOptions_ImpersonationType {
  MI_DestinationOptions_ImpersonationType_Default = 0,
  MI_DestinationOptions_ImpersonationType_None = 1,
  MI_DestinationOptions_ImpersonationType_Identify = 2,
  MI_DestinationOptions_ImpersonationType_Impersonate = 3,
  MI_DestinationOptions_ImpersonationType_Delegate = 4
} MI_DestinationOptions_ImpersonationType;

MI_INLINE MI_Result MI_DestinationOptions_SetImpersonationType(MI_DestinationOptions *options, MI_DestinationOptions_ImpersonationType impersonationType) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_IMPERSONATION_TYPE"), impersonationType, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetImpersonationType(MI_DestinationOptions *options, MI_DestinationOptions_ImpersonationType * impersonationType) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_DESTINATIONOPTIONS_IMPERSONATION_TYPE"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *impersonationType = (MI_DestinationOptions_ImpersonationType) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetString(MI_DestinationOptions *options, const MI_Char *optionName, const MI_Char *optionValue) {
  if (options && options->ft) {
    return options->ft->SetString(options, optionName, optionValue, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetString(MI_DestinationOptions *options, const MI_Char *optionName, const MI_Char **optionValue, MI_Uint32 *index) {
  if (options && options->ft) {
    return options->ft->GetString(options, optionName, optionValue, index, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_SetNumber(MI_DestinationOptions *options, const MI_Char *optionName, MI_Uint32 optionValue) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, optionName, optionValue, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetNumber(MI_DestinationOptions *options, const MI_Char *optionName, MI_Uint32 *optionValue, MI_Uint32 *index) {
  if (options && options->ft) {
    return options->ft->GetNumber(options, optionName, optionValue, index, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetOptionCount(MI_DestinationOptions *options, MI_Uint32 *count) {
  if (options && options->ft) {
    return options->ft->GetOptionCount(options, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetOptionAt(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetOptionAt(options, index, optionName, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetOption(MI_DestinationOptions *options, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetOption(options, optionName, value, type, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCredentialsCount(MI_DestinationOptions *options, MI_Uint32 *count) {
  if (options && options->ft) {
    return options->ft->GetCredentialsCount(options, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCredentialsAt(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_UserCredentials *credentials, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetCredentialsAt(options, index, optionName, credentials, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_DestinationOptions_GetCredentialsPasswordAt(MI_DestinationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Char *password, MI_Uint32 bufferLength, MI_Uint32 *passwordLength, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetCredentialsPasswordAt(options, index, optionName, password, bufferLength, passwordLength, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_DestinationOptions_Clone(const MI_DestinationOptions* self, MI_DestinationOptions* newDestinationOptions) {
  if (self && self->ft) {
    return self->ft->Clone(self, newDestinationOptions);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE void MI_OperationOptions_Delete(MI_OperationOptions *options) {
  if (options && options->ft) {
    options->ft->Delete(options);
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetWriteErrorMode(MI_OperationOptions *options, MI_CallbackMode mode) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_WRITEERRORMODE"), mode, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetWriteErrorMode(MI_OperationOptions *options, MI_CallbackMode *mode) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_WRITEERRORMODE"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *mode = (MI_CallbackMode) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetPromptUserMode(MI_OperationOptions *options, MI_CallbackMode mode) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODE"), mode, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetPromptUserMode(MI_OperationOptions *options, MI_CallbackMode *mode) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODE"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *mode = (MI_CallbackMode) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetPromptUserRegularMode(MI_OperationOptions *options, MI_CallbackMode mode, MI_Boolean ackValue) {
  if (options && options->ft) {
    MI_Result result = options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODE"), mode, 0);
    if( result == MI_RESULT_OK)
      return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODEREGULAR_ACKVALUE"), ackValue, 0);
    else
      return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetPromptUserRegularMode(MI_OperationOptions *options, MI_CallbackMode *mode, MI_Boolean *ackValue) {
  if (options && options->ft) {
    MI_Uint32 _mode;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODE"), &_mode, 0, 0);
    if( result == MI_RESULT_OK) {
      MI_Uint32 _ackValue;
      result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROMPTUSERMODEREGULAR_ACKVALUE"), &_ackValue, 0, 0);
      if( result == MI_RESULT_OK) {
        *mode = (MI_CallbackMode)_mode;
        *ackValue = (MI_Boolean) _ackValue;
      }
    }
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetProviderArchitecture(MI_OperationOptions *options, MI_ProviderArchitecture architecture, MI_Boolean mustComply) {
  if (options && options->ft) {
    MI_Result result = options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROVIDER_ARCHITECTURE"), architecture, 0);
    if(result == MI_RESULT_OK)
      return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_REQUIRED_ARCHITECTURE"), mustComply, 0);
    else
      return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetProviderArchitecture(MI_OperationOptions *options, MI_ProviderArchitecture *architecture, MI_Boolean *mustComply) {
  if (options && options->ft) {
    MI_Uint32 _architecture;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_PROVIDER_ARCHITECTURE"), &_architecture, 0, 0);
    if(result == MI_RESULT_OK) {
      MI_Uint32 _mustComply;
      result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_REQUIRED_ARCHITECTURE"), &_mustComply, 0, 0);
      if(result == MI_RESULT_OK) {
        *architecture = (MI_ProviderArchitecture)_architecture;
        *mustComply = (MI_Boolean)_mustComply;
      }
    }
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_EnableChannel(MI_OperationOptions *options, MI_Uint32 channel) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_CHANNEL"), channel, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_DisableChannel(MI_OperationOptions *options, MI_Uint32 channel) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_CHANNEL"), channel, 1);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetEnabledChannels(MI_OperationOptions *options, MI_Uint32 *channels, MI_Uint32 bufferLength, MI_Uint32 *channelCount, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetEnabledChannels(options, MI_T("__MI_OPERATIONOPTIONS_CHANNEL"), channels, bufferLength, channelCount, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetTimeout(MI_OperationOptions *options, const MI_Interval *timeout) {
  if (options && options->ft) {
    return options->ft->SetInterval(options, MI_T("__MI_OPERATIONOPTIONS_TIMEOUT"), timeout, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetTimeout(MI_OperationOptions *options, MI_Interval *timeout) {
  if (options && options->ft) {
    return options->ft->GetInterval(options, MI_T("__MI_OPERATIONOPTIONS_TIMEOUT"), timeout, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetResourceUriPrefix(MI_OperationOptions *options, const MI_Char *ruriPrefix) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_OPERATIONOPTIONS_RESOURCE_URI_PREFIX"), ruriPrefix, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetResourceUriPrefix(MI_OperationOptions *options, const MI_Char **ruriPrefix) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_OPERATIONOPTIONS_RESOURCE_URI_PREFIX"), ruriPrefix, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetResourceUri(MI_OperationOptions *options, const MI_Char *rUri) {
  if (options && options->ft) {
    return options->ft->SetString(options, MI_T("__MI_OPERATIONOPTIONS_RESOURCE_URI"), rUri, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetResourceUri(MI_OperationOptions *options, const MI_Char **rUri) {
  if (options && options->ft) {
    return options->ft->GetString(options, MI_T("__MI_OPERATIONOPTIONS_RESOURCE_URI"), rUri, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetUseMachineID(MI_OperationOptions *options, MI_Boolean machineID) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, MI_T("__MI_OPERATIONOPTIONS_USE_MACHINE_ID"), machineID, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetUseMachineID(MI_OperationOptions *options, MI_Boolean *machineID) {
  if (options && options->ft) {
    MI_Uint32 value;
    MI_Result result = options->ft->GetNumber(options, MI_T("__MI_OPERATIONOPTIONS_USE_MACHINE_ID"), &value, 0, 0);
    if (result == MI_RESULT_OK)
      *machineID = (MI_Boolean) value;
    return result;
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetCustomOption(MI_OperationOptions *options, const MI_Char *optionName, MI_Type optionValueType, const MI_Value *optionValue, MI_Boolean mustComply) {
  if (options && options->ft) {
    return options->ft->SetCustomOption(options, optionName, optionValueType, optionValue, mustComply, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetOptionCount(MI_OperationOptions *options, MI_Uint32 *count) {
  if (options && options->ft) {
    return options->ft->GetOptionCount(options, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetOptionAt(MI_OperationOptions *options, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetOptionAt(options, index, optionName, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetString(MI_OperationOptions *options, const MI_Char *optionName, const MI_Char *value, MI_Uint32 flags) {
  if (options && options->ft) {
    return options->ft->SetString(options, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetString(MI_OperationOptions *options, const MI_Char *optionName, const MI_Char **value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetString(options, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_SetNumber(MI_OperationOptions *options, const MI_Char *optionName, MI_Uint32 value, MI_Uint32 flags) {
  if (options && options->ft) {
    return options->ft->SetNumber(options, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetNumber(MI_OperationOptions *options, const MI_Char *optionName, MI_Uint32 *value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetNumber(options, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_OperationOptions_GetOption(MI_OperationOptions *options, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags) {
  if (options && options->ft) {
    return options->ft->GetOption(options, optionName, value, type, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_OperationOptions_Clone(const MI_OperationOptions* self, MI_OperationOptions* newOperationOptions) {
  if (self && self->ft) {
    return self->ft->Clone(self, newOperationOptions);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetClassName(const MI_Class* self, const MI_Char** className) {
  if (self && self->ft) {
    return self->ft->GetClassName(self, className);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetNameSpace(const MI_Class* self, const MI_Char** nameSpace) {
  if (self && self->ft) {
    return self->ft->GetNameSpace(self, nameSpace);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetServerName(const MI_Class* self, const MI_Char** serverName) {
  if (self && self->ft) {
    return self->ft->GetServerName(self, serverName);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetElementCount(const MI_Class* self, MI_Uint32* count) {
  if (self && self->ft) {
    return self->ft->GetElementCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetElement(const MI_Class* self, const MI_Char* name, MI_Value* value, MI_Boolean* valueExists, MI_Type* type, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32* flags, MI_Uint32* index) {
  if (self && self->ft) {
    return self->ft->GetElement(self, name, value, valueExists, type, referenceClass, qualifierSet, flags, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetElementAt(const MI_Class* self, MI_Uint32 index, const MI_Char** name, MI_Value* value, MI_Boolean* valueExists, MI_Type* type, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32* flags) {
  if (self && self->ft) {
    return self->ft->GetElementAt(self, index, name, value, valueExists, type, referenceClass, qualifierSet, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetClassQualifierSet(const MI_Class* self, MI_QualifierSet *qualifierSet) {
  if (self && self->ft) {
    return self->ft->GetClassQualifierSet(self, qualifierSet);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetMethodCount(const MI_Class* self, MI_Uint32* count) {
  if (self && self->ft) {
    return self->ft->GetMethodCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetMethodAt(const MI_Class *self, MI_Uint32 index, const MI_Char **name, MI_QualifierSet *qualifierSet, MI_ParameterSet *parameterSet) {
  if (self && self->ft) {
    return self->ft->GetMethodAt(self, index, name, qualifierSet, parameterSet);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetMethod(const MI_Class *self, const MI_Char *name, MI_QualifierSet *qualifierSet, MI_ParameterSet *parameterSet, MI_Uint32 *index) {
  if (self && self->ft) {
    return self->ft->GetMethod(self, name, qualifierSet, parameterSet, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetParentClassName(const MI_Class *self, const MI_Char **name) {
  if (self && self->ft) {
    return self->ft->GetParentClassName(self, name);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_GetParentClass(const MI_Class *self, MI_Class **parentClass) {
  if (self && self->ft) {
    return self->ft->GetParentClass(self, parentClass);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_Class_Delete(MI_Class* self) {
  if (self && self->ft) {
    return self->ft->Delete(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_Class_Clone(const MI_Class* self, MI_Class** newClass) {
  if (self && self->ft) {
    return self->ft->Clone(self, newClass);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_ParameterSet_GetMethodReturnType(const MI_ParameterSet *self, MI_Type *returnType, MI_QualifierSet *qualifierSet) {
  if (self && self->ft) {
    return self->ft->GetMethodReturnType(self, returnType, qualifierSet);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_ParameterSet_GetParameterCount(const MI_ParameterSet *self, MI_Uint32 *count) {
  if (self && self->ft) {
    return self->ft->GetParameterCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_ParameterSet_GetParameterAt(const MI_ParameterSet *self, MI_Uint32 index, const MI_Char **name, MI_Type *parameterType, MI_Char **referenceClass, MI_QualifierSet *qualifierSet) {
  if (self && self->ft) {
    return self->ft->GetParameterAt(self, index, name, parameterType, referenceClass, qualifierSet);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_ParameterSet_GetParameter(const MI_ParameterSet *self, const MI_Char *name, MI_Type *parameterType, MI_Char **referenceClass, MI_QualifierSet *qualifierSet, MI_Uint32 *index) {
  if (self && self->ft) {
    return self->ft->GetParameter(self, name, parameterType, referenceClass, qualifierSet, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_QualifierSet_GetQualifierCount(const MI_QualifierSet *self, MI_Uint32 *count) {
  if (self && self->ft) {
    return self->ft->GetQualifierCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_QualifierSet_GetQualifierAt(const MI_QualifierSet *self, MI_Uint32 index, const MI_Char **name, MI_Type *qualifierType, MI_Uint32 *qualifierFlags, MI_Value *qualifierValue) {
  if (self && self->ft) {
    return self->ft->GetQualifierAt(self, index, name, qualifierType, qualifierFlags, qualifierValue);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_QualifierSet_GetQualifier(const MI_QualifierSet *self, const MI_Char *name, MI_Type *qualifierType, MI_Uint32 *qualifierFlags, MI_Value *qualifierValue, MI_Uint32 *index) {
  if (self && self->ft) {
    return self->ft->GetQualifier(self, name, qualifierType, qualifierFlags, qualifierValue, index);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetMaximumLatency(MI_SubscriptionDeliveryOptions *self, MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->SetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_MAXIMUM_LATENCY"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetMaximumLatency(MI_SubscriptionDeliveryOptions *self, MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->GetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_MAXIMUM_LATENCY"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetHeartbeatInterval(MI_SubscriptionDeliveryOptions *self, MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->SetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_HEARTBEAT_INTERVAL"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetHeartbeatInterval(MI_SubscriptionDeliveryOptions *self, MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->GetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_HEARTBEAT_INTERVAL"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetExpirationTime(MI_SubscriptionDeliveryOptions *self, MI_Datetime *value) {
  if (self && self->ft) {
    return self->ft->SetDateTime(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_EXPIRATION_TIME"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetExpirationTime(MI_SubscriptionDeliveryOptions *self, MI_Datetime *value) {
  if (self && self->ft) {
    return self->ft->GetDateTime(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_EXPIRATION_TIME"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_SUBSCRIBE_BOOKMARK_OLDEST L"MI_SUBSCRIBE_BOOKMARK_OLDEST"
#define MI_SUBSCRIBE_BOOKMARK_NEWEST L"MI_SUBSCRIBE_BOOKMARK_NEWEST"

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetBookmark(MI_SubscriptionDeliveryOptions *self, const MI_Char *value) {
  if (self && self->ft) {
    return self->ft->SetString(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_BOOKMARK"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetBookmark(MI_SubscriptionDeliveryOptions *self, const MI_Char **value) {
  if (self && self->ft) {
    return self->ft->GetString(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_BOOKMARK"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetDeliveryDestination(MI_SubscriptionDeliveryOptions *self, const MI_Char *value) {
  if (self && self->ft) {
    return self->ft->SetString(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_DESTINATION"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetDeliveryDestination(MI_SubscriptionDeliveryOptions *self, const MI_Char **value) {
  if (self && self->ft) {
    return self->ft->GetString(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_DESTINATION"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetDeliveryPortNumber(MI_SubscriptionDeliveryOptions *self, MI_Uint32 value) {
  if (self && self->ft) {
    return self->ft->SetNumber(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_PORT_NUMBER"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetDeliveryPortNumber(MI_SubscriptionDeliveryOptions *self, MI_Uint32 *value) {
  if (self && self->ft) {
    return self->ft->GetNumber(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_PORT_NUMBER"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_AddDeliveryCredentials(MI_SubscriptionDeliveryOptions *self, const MI_UserCredentials *value) {
  if (self && self->ft) {
    return self->ft->AddCredentials(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_ADD_DELIVERY_CREDENTIALS"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetDeliveryRetryInterval(MI_SubscriptionDeliveryOptions *self, const MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->SetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_RETRY_INTERVAL"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetDeliveryRetryInterval(MI_SubscriptionDeliveryOptions *self, MI_Interval *value) {
  if (self && self->ft) {
    return self->ft->GetInterval(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_RETRY_INTERVAL"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetDeliveryRetryAttempts(MI_SubscriptionDeliveryOptions *self, MI_Uint32 value) {
  if (self && self->ft) {
    return self->ft->SetNumber(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_RETRY_ATTEMPTS"), value, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetDeliveryRetryAttempts(MI_SubscriptionDeliveryOptions *self, MI_Uint32 *value) {
  if (self && self->ft) {
    return self->ft->GetNumber(self, MI_T("__MI_SUBSCRIPTIONDELIVERYOPTIONS_SET_DELIVERY_RETRY_ATTEMPTS"), value, 0, 0);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_Delete(MI_SubscriptionDeliveryOptions* self) {
  if (self && self->ft) {
    return self->ft->Delete(self);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetString(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, const MI_Char *value, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetString(self, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetNumber(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, MI_Uint32 value, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetNumber(self, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetDateTime(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, const MI_Datetime *value, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetDateTime(self, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_SetInterval(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, const MI_Interval *value, MI_Uint32 flags) {
  if (self && self->ft) {
    return self->ft->SetInterval(self, optionName, value, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetString(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, const MI_Char **value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetString(self, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetNumber(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, MI_Uint32 *value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetNumber(self, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetDateTime(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, MI_Datetime *value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetDateTime(self, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetInterval(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, MI_Interval *value, MI_Uint32 *index, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetInterval(self, optionName, value, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetOptionCount( MI_SubscriptionDeliveryOptions *self, MI_Uint32 *count) {
  if (self && self->ft) {
    return self->ft->GetOptionCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetOptionAt(MI_SubscriptionDeliveryOptions *self, MI_Uint32 index, const MI_Char **optionName, MI_Value *value, MI_Type *type, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetOptionAt(self, index, optionName, value, type, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetOption(MI_SubscriptionDeliveryOptions *self, const MI_Char *optionName, MI_Value *value, MI_Type *type, MI_Uint32 *index, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetOption(self, optionName, value, type, index, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetCredentialsCount(MI_SubscriptionDeliveryOptions *self, MI_Uint32 *count) {
  if (self && self->ft) {
    return self->ft->GetCredentialsCount(self, count);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetCredentialsAt(MI_SubscriptionDeliveryOptions *self, MI_Uint32 index, const MI_Char **optionName, MI_UserCredentials *credentials, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetCredentialsAt(self, index, optionName, credentials, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_SubscriptionDeliveryOptions_GetCredentialsPasswordAt(MI_SubscriptionDeliveryOptions *self, MI_Uint32 index, const MI_Char **optionName, MI_Char *password, MI_Uint32 bufferLength, MI_Uint32 *passwordLength, MI_Uint32 *flags) {
  if (self && self->ft) {
    return self->ft->GetCredentialsPasswordAt(self, index, optionName, password, bufferLength, passwordLength, flags);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

MI_INLINE MI_Result MI_INLINE_CALL MI_SubscriptionDeliveryOptions_Clone(const MI_SubscriptionDeliveryOptions* self, MI_SubscriptionDeliveryOptions* newSubscriptionDeliveryOptions) {
  if (self && self->ft) {
    return self->ft->Clone(self, newSubscriptionDeliveryOptions);
  } else {
    return MI_RESULT_INVALID_PARAMETER;
  }
}

#define MI_SERIALIZER_FLAGS_CLASS_DEEP 1
#define MI_SERIALIZER_FLAGS_INSTANCE_WITH_CLASS 1

MI_INLINE MI_Result MI_Serializer_Close(MI_Serializer *serializer) {
  return mi_clientFT->serializerFT->Close(serializer);
}

MI_INLINE MI_Result MI_Serializer_SerializeClass(MI_Serializer *serializer, MI_Uint32 flags, const MI_Class *classObject,  MI_Uint8 *clientBuffer, MI_Uint32 clientBufferLength,  MI_Uint32 *clientBufferNeeded) {
  return mi_clientFT->serializerFT->SerializeClass(serializer, flags, classObject, clientBuffer, clientBufferLength, clientBufferNeeded);
}

MI_INLINE MI_Result MI_Serializer_SerializeInstance(MI_Serializer *serializer, MI_Uint32 flags, const MI_Instance *instanceObject, MI_Uint8 *clientBuffer, MI_Uint32 clientBufferLength, MI_Uint32 *clientBufferNeeded) {
  return mi_clientFT->serializerFT->SerializeInstance(serializer, flags, instanceObject, clientBuffer, clientBufferLength, clientBufferNeeded);
}

MI_INLINE MI_Result MI_Deserializer_Close(MI_Deserializer *deserializer) {
  const MI_ClientFT_V1 *clientFT = mi_clientFT;
  const MI_DeserializerFT *deserializerFT = clientFT->deserializerFT;
  return deserializerFT->Close(deserializer);
}

MI_INLINE MI_Result MI_Deserializer_DeserializeClass(MI_Deserializer *deserializer, MI_Uint32 flags, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Class *parentClass, const MI_Char *serverName, const MI_Char *namespaceName, MI_Deserializer_ClassObjectNeeded classObjectNeeded, void *classObjectNeededContext, MI_Uint32 *serializedBufferRead, MI_Class **classObject, MI_Instance **cimErrorDetails) {
  return mi_clientFT->deserializerFT->DeserializeClass(deserializer, flags, serializedBuffer, serializedBufferLength, parentClass, serverName, namespaceName, classObjectNeeded, classObjectNeededContext, serializedBufferRead, classObject, cimErrorDetails);
}

MI_INLINE MI_Result MI_Deserializer_Class_GetClassName(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *className, MI_Uint32 *classNameLength, MI_Instance **cimErrorDetails) {
  return mi_clientFT->deserializerFT->Class_GetClassName(deserializer, serializedBuffer, serializedBufferLength, className, classNameLength, cimErrorDetails);
}

MI_INLINE MI_Result MI_Deserializer_Class_GetParentClassName(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *parentClassName, MI_Uint32 *parentClassNameLength, MI_Instance **cimErrorDetails) {
  return mi_clientFT->deserializerFT->Class_GetParentClassName(deserializer, serializedBuffer, serializedBufferLength, parentClassName, parentClassNameLength, cimErrorDetails);
}

MI_INLINE MI_Result MI_Deserializer_DeserializeInstance(MI_Deserializer *deserializer, MI_Uint32 flags, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Class **classObjects, MI_Uint32 numberClassObjects, MI_Deserializer_ClassObjectNeeded classObjectNeeded, void *classObjectNeededContext, MI_Uint32 *serializedBufferRead, MI_Instance **instanceObject, MI_Instance **cimErrorDetails) {
  return mi_clientFT->deserializerFT->DeserializeInstance(deserializer, flags, serializedBuffer, serializedBufferLength, classObjects, numberClassObjects, classObjectNeeded, classObjectNeededContext, serializedBufferRead, instanceObject, cimErrorDetails);
}

MI_INLINE MI_Result MI_Deserializer_Instance_GetClassName(MI_Deserializer *deserializer, MI_Uint8 *serializedBuffer, MI_Uint32 serializedBufferLength, MI_Char *className, MI_Uint32 *classNameLength, MI_Instance **cimErrorDetails) {
  return mi_clientFT->deserializerFT->Instance_GetClassName(deserializer, serializedBuffer, serializedBufferLength, className, classNameLength, cimErrorDetails);
}

MI_INLINE MI_ErrorCategory MI_Utilities_MapErrorToMiErrorCategory(MI_Char *errorType, MI_Uint32 error) {
  return mi_clientFT->utilitiesFT->MapErrorToMiErrorCategory(errorType, error);
}

MI_INLINE MI_Result MI_Utilities_CimErrorFromErrorCode(MI_Uint32 error, const MI_Char *errorType, const MI_Char* errorMessage, MI_Instance **cimError) {
  return mi_clientFT->utilitiesFT->CimErrorFromErrorCode(error, errorType, errorMessage, cimError);
}

#define MI_CancelationReason MI_CancellationReason
#define _MI_CancelationReason _MI_CancellationReason
#define MI_PostResult MI_Context_PostResult
#define MI_PostCimError MI_Context_PostCimError
#define MI_PostError MI_Context_PostError
#define MI_PostInstance MI_Context_PostInstance
#define MI_PostIndication MI_Context_PostIndication
#define MI_ConstructInstance MI_Context_ConstructInstance
#define MI_ConstructParameters MI_Context_ConstructParameters
#define MI_NewInstance MI_Context_NewInstance
#define MI_NewDynamicInstance MI_Context_NewDynamicInstance
#define MI_NewParameters MI_Context_NewParameters
#define MI_Canceled MI_Context_Canceled
#define MI_GetLocale MI_Context_GetLocale
#define MI_RegisterCancel MI_Context_RegisterCancel
#define MI_RequestUnload MI_Context_RequestUnload
#define MI_RefuseUnload MI_Context_RefuseUnload
#define MI_GetLocalSession MI_Context_GetLocalSession
#define MI_SetStringOption MI_Context_SetStringOption
#define MI_GetStringOption MI_Context_GetStringOption
#define MI_GetNumberOption MI_Context_GetNumberOption
#define MI_GetCustomOption MI_Context_GetCustomOption
#define MI_GetCustomOptionCount MI_Context_GetCustomOptionCount
#define MI_GetCustomOptionAt MI_Context_GetCustomOptionAt
#define MI_ShouldProcess MI_Context_ShouldProcess
#define MI_ShouldContinue MI_Context_ShouldContinue
#define MI_PromptUser MI_Context_PromptUser
#define MI_WriteError MI_Context_WriteError
#define MI_WriteCimError MI_Context_WriteCimError
#define MI_WriteMessage MI_Context_WriteMessage
#define MI_WriteProgress MI_Context_WriteProgress
#define MI_WriteStreamParameter MI_Context_WriteStreamParameter
#define MI_WriteWarning MI_Context_WriteWarning
#define MI_WriteVerbose MI_Context_WriteVerbose
#define MI_WriteDebug MI_Context_WriteDebug
#define MI_SubscriptionDeliveryOptions__SetExpirationTime MI_SubscriptionDeliveryOptions_SetExpirationTime
#define MI_SubscriptionDeliveryOptions__GetExpirationTime MI_SubscriptionDeliveryOptions_GetExpirationTime

#ifdef __cplusplus
}
#endif

#endif /* __MI_C_API_H */

#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */