summaryrefslogtreecommitdiffstats
path: root/vendor/winapi/src/um/winnt.rs
blob: f687489bd565a00793f2df2c775417042ab8c3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
//! This module defines the 32-Bit Windows types and constants that are defined by NT, but exposed
//! through the Win32 API.
use ctypes::{__int64, __uint64, c_char, c_int, c_long, c_short, c_uint, c_ulong, c_void, wchar_t};
use shared::basetsd::{
    DWORD64, KAFFINITY, LONG64, LONG_PTR, PDWORD64, PLONG64, SIZE_T, ULONG64, ULONG_PTR,
};
use shared::guiddef::{CLSID, GUID};
use shared::ktmtypes::UOW;
use shared::minwindef::{BYTE, DWORD, FALSE, PDWORD, TRUE, ULONG, USHORT, WORD};
#[cfg(target_arch = "aarch64")]
use shared::minwindef::PBYTE;
use vc::excpt::EXCEPTION_DISPOSITION;
use vc::vcruntime::size_t;
pub const ANYSIZE_ARRAY: usize = 1;
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub const MAX_NATURAL_ALIGNMENT: usize = 4;
pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 8;
}
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub const MAX_NATURAL_ALIGNMENT: usize = 8;
pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 16;
}
pub const SYSTEM_CACHE_ALIGNMENT_SIZE: usize = 64;
pub type PVOID = *mut c_void;
pub type PVOID64 = u64; // This is a 64-bit pointer, even when in 32-bit
pub type VOID = c_void;
pub type CHAR = c_char;
pub type SHORT = c_short;
pub type LONG = c_long;
pub type INT = c_int;
pub type WCHAR = wchar_t;
pub type PWCHAR = *mut WCHAR;
pub type LPWCH = *mut WCHAR;
pub type PWCH = *mut WCHAR;
pub type LPCWCH = *const WCHAR;
pub type PCWCH = *const WCHAR;
pub type NWPSTR = *mut WCHAR;
pub type LPWSTR = *mut WCHAR;
pub type PWSTR = *mut WCHAR;
pub type PZPWSTR = *mut PWSTR;
pub type PCZPWSTR = *const PWSTR;
pub type LPUWSTR = *mut WCHAR; // Unaligned pointer
pub type PUWSTR = *mut WCHAR; // Unaligned pointer
pub type LPCWSTR = *const WCHAR;
pub type PCWSTR = *const WCHAR;
pub type PZPCWSTR = *mut PCWSTR;
pub type PCZPCWSTR = *const PCWSTR;
pub type LPCUWSTR = *const WCHAR; // Unaligned pointer
pub type PCUWSTR = *const WCHAR; // Unaligned pointer
pub type PZZWSTR = *mut WCHAR;
pub type PCZZWSTR = *const WCHAR;
pub type PUZZWSTR = *mut WCHAR; // Unaligned pointer
pub type PCUZZWSTR = *const WCHAR; // Unaligned pointer
pub type PNZWCH = *mut WCHAR;
pub type PCNZWCH = *const WCHAR;
pub type PUNZWCH = *mut WCHAR; // Unaligned pointer
pub type PCUNZWCH = *const WCHAR; // Unaligned pointer
pub type LPCWCHAR = *const WCHAR;
pub type PCWCHAR = *const WCHAR;
pub type LPCUWCHAR = *const WCHAR; // Unaligned pointer
pub type PCUWCHAR = *const WCHAR; // Unaligned pointer
pub type UCSCHAR = c_ulong;
pub const UCSCHAR_INVALID_CHARACTER: UCSCHAR = 0xffffffff;
pub const MIN_UCSCHAR: UCSCHAR = 0;
pub const MAX_UCSCHAR: UCSCHAR = 0x0010FFFF;
pub type PUCSCHAR = *mut UCSCHAR;
pub type PCUCSCHAR = *const UCSCHAR;
pub type PUCSSTR = *mut UCSCHAR;
pub type PUUCSSTR = *mut UCSCHAR; // Unaligned pointer
pub type PCUCSSTR = *const UCSCHAR;
pub type PCUUCSSTR = *const UCSCHAR; // Unaligned pointer
pub type PUUCSCHAR = *mut UCSCHAR; // Unaligned pointer
pub type PCUUCSCHAR = *const UCSCHAR; // Unaligned pointer
pub type PCHAR = *mut CHAR;
pub type LPCH = *mut CHAR;
pub type PCH = *mut CHAR;
pub type LPCCH = *const CHAR;
pub type PCCH = *const CHAR;
pub type NPSTR = *mut CHAR;
pub type LPSTR = *mut CHAR;
pub type PSTR = *mut CHAR;
pub type PZPSTR = *mut PSTR;
pub type PCZPSTR = *const PSTR;
pub type LPCSTR = *const CHAR;
pub type PCSTR = *const CHAR;
pub type PZPCSTR = *mut PCSTR;
pub type PCZPCSTR = *const PCSTR;
pub type PZZSTR = *mut CHAR;
pub type PCZZSTR = *const CHAR;
pub type PNZCH = *mut CHAR;
pub type PCNZCH = *const CHAR;
// Skipping TCHAR things
pub type PSHORT = *mut SHORT;
pub type PLONG = *mut LONG;
pub const ALL_PROCESSOR_GROUPS: WORD = 0xffff;
STRUCT!{struct PROCESSOR_NUMBER {
    Group: WORD,
    Number: BYTE,
    Reserved: BYTE,
}}
pub type PPROCESSOR_NUMBER = *mut PROCESSOR_NUMBER;
STRUCT!{struct GROUP_AFFINITY {
    Mask: KAFFINITY,
    Group: WORD,
    Reserved: [WORD; 3],
}}
pub type PGROUP_AFFINITY = *mut GROUP_AFFINITY;
#[cfg(target_pointer_width = "32")]
pub const MAXIMUM_PROC_PER_GROUP: BYTE = 32;
#[cfg(target_pointer_width = "64")]
pub const MAXIMUM_PROC_PER_GROUP: BYTE = 64;
pub const MAXIMUM_PROCESSORS: BYTE = MAXIMUM_PROC_PER_GROUP;
pub type HANDLE = *mut c_void;
pub type PHANDLE = *mut HANDLE;
pub type FCHAR = BYTE;
pub type FSHORT = WORD;
pub type FLONG = DWORD;
pub type HRESULT = c_long;
pub type CCHAR = c_char;
pub type LCID = DWORD;
pub type PLCID = PDWORD;
pub type LANGID = WORD;
ENUM!{enum COMPARTMENT_ID {
    UNSPECIFIED_COMPARTMENT_ID = 0,
    DEFAULT_COMPARTMENT_ID,
}}
pub type PCOMPARTMENT_ID = *mut COMPARTMENT_ID;
pub const APPLICATION_ERROR_MASK: DWORD = 0x20000000;
pub const ERROR_SEVERITY_SUCCESS: DWORD = 0x00000000;
pub const ERROR_SEVERITY_INFORMATIONAL: DWORD = 0x40000000;
pub const ERROR_SEVERITY_WARNING: DWORD = 0x80000000;
pub const ERROR_SEVERITY_ERROR: DWORD = 0xC0000000;
STRUCT!{struct FLOAT128 {
    LowPart: __int64,
    HighPart: __int64,
}}
pub type PFLOAT128 = *mut FLOAT128;
pub type LONGLONG = __int64;
pub type ULONGLONG = __uint64;
pub const MAXLONGLONG: LONGLONG = 0x7fffffffffffffff;
pub type PLONGLONG = *mut LONGLONG;
pub type PULONGLONG = *mut ULONGLONG;
pub type USN = LONGLONG;
pub use shared::ntdef::LARGE_INTEGER;
pub type PLARGE_INTEGER = *mut LARGE_INTEGER;
pub use shared::ntdef::ULARGE_INTEGER;
pub type PULARGE_INTEGER = *mut ULARGE_INTEGER;
pub type RTL_REFERENCE_COUNT = LONG_PTR;
pub type PRTL_REFERENCE_COUNT = *mut LONG_PTR;
pub type RTL_REFERENCE_COUNT32 = LONG;
pub type PRTL_REFERENCE_COUNT32 = *mut LONG;
pub use shared::ntdef::LUID;
pub type PLUID = *mut LUID;
pub type DWORDLONG = ULONGLONG;
pub type PDWORDLONG = *mut DWORDLONG;
pub const ANSI_NULL: CHAR = 0;
pub const UNICODE_NULL: WCHAR = 0;
pub const UNICODE_STRING_MAX_BYTES: WORD = 65534;
pub const UNICODE_STRING_MAX_CHARS: WORD = 32767;
pub type BOOLEAN = BYTE;
pub type PBOOLEAN = *mut BOOLEAN;
STRUCT!{struct LIST_ENTRY {
    Flink: *mut LIST_ENTRY,
    Blink: *mut LIST_ENTRY,
}}
pub type PLIST_ENTRY = *mut LIST_ENTRY;
pub type PRLIST_ENTRY = *mut LIST_ENTRY; // Restricted pointer
STRUCT!{struct SINGLE_LIST_ENTRY {
    Next: *mut SINGLE_LIST_ENTRY,
}}
pub type PSINGLE_LIST_ENTRY = *mut SINGLE_LIST_ENTRY;
STRUCT!{struct LIST_ENTRY32 {
    Flink: DWORD,
    Blink: DWORD,
}}
pub type PLIST_ENTRY32 = *mut LIST_ENTRY32;
STRUCT!{struct LIST_ENTRY64 {
    Flink: ULONGLONG,
    Blink: ULONGLONG,
}}
pub type PLIST_ENTRY64 = *mut LIST_ENTRY64;
STRUCT!{struct OBJECTID {
    Lineage: GUID,
    Uniquifier: DWORD,
}}
pub const MINCHAR: CHAR = 0x80;
pub const MAXCHAR: CHAR = 0x7f;
pub const MINSHORT: SHORT = 0x8000;
pub const MAXSHORT: SHORT = 0x7fff;
pub const MINLONG: LONG = 0x80000000;
pub const MAXLONG: LONG = 0x7fffffff;
pub const MAXBYTE: BYTE = 0xff;
pub const MAXWORD: WORD = 0xffff;
pub const MAXDWORD: DWORD = 0xffffffff;
FN!{stdcall PEXCEPTION_ROUTINE(
    ExceptionRecord: *mut EXCEPTION_RECORD,
    EstablisherFrame: PVOID,
    ContextRecord: *mut CONTEXT,
    DispatcherContext: PVOID,
) -> EXCEPTION_DISPOSITION}
pub const VER_SERVER_NT: DWORD = 0x80000000;
pub const VER_WORKSTATION_NT: DWORD = 0x40000000;
pub const VER_SUITE_SMALLBUSINESS: DWORD = 0x00000001;
pub const VER_SUITE_ENTERPRISE: DWORD = 0x00000002;
pub const VER_SUITE_BACKOFFICE: DWORD = 0x00000004;
pub const VER_SUITE_COMMUNICATIONS: DWORD = 0x00000008;
pub const VER_SUITE_TERMINAL: DWORD = 0x00000010;
pub const VER_SUITE_SMALLBUSINESS_RESTRICTED: DWORD = 0x00000020;
pub const VER_SUITE_EMBEDDEDNT: DWORD = 0x00000040;
pub const VER_SUITE_DATACENTER: DWORD = 0x00000080;
pub const VER_SUITE_SINGLEUSERTS: DWORD = 0x00000100;
pub const VER_SUITE_PERSONAL: DWORD = 0x00000200;
pub const VER_SUITE_BLADE: DWORD = 0x00000400;
pub const VER_SUITE_EMBEDDED_RESTRICTED: DWORD = 0x00000800;
pub const VER_SUITE_SECURITY_APPLIANCE: DWORD = 0x00001000;
pub const VER_SUITE_STORAGE_SERVER: DWORD = 0x00002000;
pub const VER_SUITE_COMPUTE_SERVER: DWORD = 0x00004000;
pub const VER_SUITE_WH_SERVER: DWORD = 0x00008000;
pub const PRODUCT_UNDEFINED: DWORD = 0x00000000;
pub const PRODUCT_ULTIMATE: DWORD = 0x00000001;
pub const PRODUCT_HOME_BASIC: DWORD = 0x00000002;
pub const PRODUCT_HOME_PREMIUM: DWORD = 0x00000003;
pub const PRODUCT_ENTERPRISE: DWORD = 0x00000004;
pub const PRODUCT_HOME_BASIC_N: DWORD = 0x00000005;
pub const PRODUCT_BUSINESS: DWORD = 0x00000006;
pub const PRODUCT_STANDARD_SERVER: DWORD = 0x00000007;
pub const PRODUCT_DATACENTER_SERVER: DWORD = 0x00000008;
pub const PRODUCT_SMALLBUSINESS_SERVER: DWORD = 0x00000009;
pub const PRODUCT_ENTERPRISE_SERVER: DWORD = 0x0000000A;
pub const PRODUCT_STARTER: DWORD = 0x0000000B;
pub const PRODUCT_DATACENTER_SERVER_CORE: DWORD = 0x0000000C;
pub const PRODUCT_STANDARD_SERVER_CORE: DWORD = 0x0000000D;
pub const PRODUCT_ENTERPRISE_SERVER_CORE: DWORD = 0x0000000E;
pub const PRODUCT_ENTERPRISE_SERVER_IA64: DWORD = 0x0000000F;
pub const PRODUCT_BUSINESS_N: DWORD = 0x00000010;
pub const PRODUCT_WEB_SERVER: DWORD = 0x00000011;
pub const PRODUCT_CLUSTER_SERVER: DWORD = 0x00000012;
pub const PRODUCT_HOME_SERVER: DWORD = 0x00000013;
pub const PRODUCT_STORAGE_EXPRESS_SERVER: DWORD = 0x00000014;
pub const PRODUCT_STORAGE_STANDARD_SERVER: DWORD = 0x00000015;
pub const PRODUCT_STORAGE_WORKGROUP_SERVER: DWORD = 0x00000016;
pub const PRODUCT_STORAGE_ENTERPRISE_SERVER: DWORD = 0x00000017;
pub const PRODUCT_SERVER_FOR_SMALLBUSINESS: DWORD = 0x00000018;
pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: DWORD = 0x00000019;
pub const PRODUCT_HOME_PREMIUM_N: DWORD = 0x0000001A;
pub const PRODUCT_ENTERPRISE_N: DWORD = 0x0000001B;
pub const PRODUCT_ULTIMATE_N: DWORD = 0x0000001C;
pub const PRODUCT_WEB_SERVER_CORE: DWORD = 0x0000001D;
pub const PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: DWORD = 0x0000001E;
pub const PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: DWORD = 0x0000001F;
pub const PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: DWORD = 0x00000020;
pub const PRODUCT_SERVER_FOUNDATION: DWORD = 0x00000021;
pub const PRODUCT_HOME_PREMIUM_SERVER: DWORD = 0x00000022;
pub const PRODUCT_SERVER_FOR_SMALLBUSINESS_V: DWORD = 0x00000023;
pub const PRODUCT_STANDARD_SERVER_V: DWORD = 0x00000024;
pub const PRODUCT_DATACENTER_SERVER_V: DWORD = 0x00000025;
pub const PRODUCT_ENTERPRISE_SERVER_V: DWORD = 0x00000026;
pub const PRODUCT_DATACENTER_SERVER_CORE_V: DWORD = 0x00000027;
pub const PRODUCT_STANDARD_SERVER_CORE_V: DWORD = 0x00000028;
pub const PRODUCT_ENTERPRISE_SERVER_CORE_V: DWORD = 0x00000029;
pub const PRODUCT_HYPERV: DWORD = 0x0000002A;
pub const PRODUCT_STORAGE_EXPRESS_SERVER_CORE: DWORD = 0x0000002B;
pub const PRODUCT_STORAGE_STANDARD_SERVER_CORE: DWORD = 0x0000002C;
pub const PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: DWORD = 0x0000002D;
pub const PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: DWORD = 0x0000002E;
pub const PRODUCT_STARTER_N: DWORD = 0x0000002F;
pub const PRODUCT_PROFESSIONAL: DWORD = 0x00000030;
pub const PRODUCT_PROFESSIONAL_N: DWORD = 0x00000031;
pub const PRODUCT_SB_SOLUTION_SERVER: DWORD = 0x00000032;
pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS: DWORD = 0x00000033;
pub const PRODUCT_STANDARD_SERVER_SOLUTIONS: DWORD = 0x00000034;
pub const PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: DWORD = 0x00000035;
pub const PRODUCT_SB_SOLUTION_SERVER_EM: DWORD = 0x00000036;
pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: DWORD = 0x00000037;
pub const PRODUCT_SOLUTION_EMBEDDEDSERVER: DWORD = 0x00000038;
pub const PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: DWORD = 0x00000039;
pub const PRODUCT_PROFESSIONAL_EMBEDDED: DWORD = 0x0000003A;
pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: DWORD = 0x0000003B;
pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: DWORD = 0x0000003C;
pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: DWORD = 0x0000003D;
pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: DWORD = 0x0000003E;
pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: DWORD = 0x0000003F;
pub const PRODUCT_CLUSTER_SERVER_V: DWORD = 0x00000040;
pub const PRODUCT_EMBEDDED: DWORD = 0x00000041;
pub const PRODUCT_STARTER_E: DWORD = 0x00000042;
pub const PRODUCT_HOME_BASIC_E: DWORD = 0x00000043;
pub const PRODUCT_HOME_PREMIUM_E: DWORD = 0x00000044;
pub const PRODUCT_PROFESSIONAL_E: DWORD = 0x00000045;
pub const PRODUCT_ENTERPRISE_E: DWORD = 0x00000046;
pub const PRODUCT_ULTIMATE_E: DWORD = 0x00000047;
pub const PRODUCT_ENTERPRISE_EVALUATION: DWORD = 0x00000048;
pub const PRODUCT_MULTIPOINT_STANDARD_SERVER: DWORD = 0x0000004C;
pub const PRODUCT_MULTIPOINT_PREMIUM_SERVER: DWORD = 0x0000004D;
pub const PRODUCT_STANDARD_EVALUATION_SERVER: DWORD = 0x0000004F;
pub const PRODUCT_DATACENTER_EVALUATION_SERVER: DWORD = 0x00000050;
pub const PRODUCT_ENTERPRISE_N_EVALUATION: DWORD = 0x00000054;
pub const PRODUCT_EMBEDDED_AUTOMOTIVE: DWORD = 0x00000055;
pub const PRODUCT_EMBEDDED_INDUSTRY_A: DWORD = 0x00000056;
pub const PRODUCT_THINPC: DWORD = 0x00000057;
pub const PRODUCT_EMBEDDED_A: DWORD = 0x00000058;
pub const PRODUCT_EMBEDDED_INDUSTRY: DWORD = 0x00000059;
pub const PRODUCT_EMBEDDED_E: DWORD = 0x0000005A;
pub const PRODUCT_EMBEDDED_INDUSTRY_E: DWORD = 0x0000005B;
pub const PRODUCT_EMBEDDED_INDUSTRY_A_E: DWORD = 0x0000005C;
pub const PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: DWORD = 0x0000005F;
pub const PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: DWORD = 0x00000060;
pub const PRODUCT_CORE_ARM: DWORD = 0x00000061;
pub const PRODUCT_CORE_N: DWORD = 0x00000062;
pub const PRODUCT_CORE_COUNTRYSPECIFIC: DWORD = 0x00000063;
pub const PRODUCT_CORE_SINGLELANGUAGE: DWORD = 0x00000064;
pub const PRODUCT_CORE: DWORD = 0x00000065;
pub const PRODUCT_PROFESSIONAL_WMC: DWORD = 0x00000067;
pub const PRODUCT_MOBILE_CORE: DWORD = 0x00000068;
pub const PRODUCT_EMBEDDED_INDUSTRY_EVAL: DWORD = 0x00000069;
pub const PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: DWORD = 0x0000006A;
pub const PRODUCT_EMBEDDED_EVAL: DWORD = 0x0000006B;
pub const PRODUCT_EMBEDDED_E_EVAL: DWORD = 0x0000006C;
pub const PRODUCT_NANO_SERVER: DWORD = 0x0000006D;
pub const PRODUCT_CLOUD_STORAGE_SERVER: DWORD = 0x0000006E;
pub const PRODUCT_CORE_CONNECTED: DWORD = 0x0000006F;
pub const PRODUCT_PROFESSIONAL_STUDENT: DWORD = 0x00000070;
pub const PRODUCT_CORE_CONNECTED_N: DWORD = 0x00000071;
pub const PRODUCT_PROFESSIONAL_STUDENT_N: DWORD = 0x00000072;
pub const PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: DWORD = 0x00000073;
pub const PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: DWORD = 0x00000074;
pub const PRODUCT_CONNECTED_CAR: DWORD = 0x00000075;
pub const PRODUCT_INDUSTRY_HANDHELD: DWORD = 0x00000076;
pub const PRODUCT_PPI_PRO: DWORD = 0x00000077;
pub const PRODUCT_ARM64_SERVER: DWORD = 0x00000078;
pub const PRODUCT_EDUCATION: DWORD = 0x00000079;
pub const PRODUCT_EDUCATION_N: DWORD = 0x0000007A;
pub const PRODUCT_IOTUAP: DWORD = 0x0000007B;
pub const PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER: DWORD = 0x0000007C;
pub const PRODUCT_ENTERPRISE_S: DWORD = 0x0000007D;
pub const PRODUCT_ENTERPRISE_S_N: DWORD = 0x0000007E;
pub const PRODUCT_PROFESSIONAL_S: DWORD = 0x0000007F;
pub const PRODUCT_PROFESSIONAL_S_N: DWORD = 0x00000080;
pub const PRODUCT_ENTERPRISE_S_EVALUATION: DWORD = 0x00000081;
pub const PRODUCT_ENTERPRISE_S_N_EVALUATION: DWORD = 0x00000082;
pub const PRODUCT_HOLOGRAPHIC: DWORD = 0x00000087;
pub const PRODUCT_PRO_SINGLE_LANGUAGE: DWORD = 0x0000008A;
pub const PRODUCT_PRO_CHINA: DWORD = 0x0000008B;
pub const PRODUCT_ENTERPRISE_SUBSCRIPTION: DWORD = 0x0000008C;
pub const PRODUCT_ENTERPRISE_SUBSCRIPTION_N: DWORD = 0x0000008D;
pub const PRODUCT_DATACENTER_NANO_SERVER: DWORD = 0x0000008F;
pub const PRODUCT_STANDARD_NANO_SERVER: DWORD = 0x00000090;
pub const PRODUCT_DATACENTER_A_SERVER_CORE: DWORD = 0x00000091;
pub const PRODUCT_STANDARD_A_SERVER_CORE: DWORD = 0x00000092;
pub const PRODUCT_DATACENTER_WS_SERVER_CORE: DWORD = 0x00000093;
pub const PRODUCT_STANDARD_WS_SERVER_CORE: DWORD = 0x00000094;
pub const PRODUCT_UTILITY_VM: DWORD = 0x00000095;
pub const PRODUCT_DATACENTER_EVALUATION_SERVER_CORE: DWORD = 0x0000009F;
pub const PRODUCT_STANDARD_EVALUATION_SERVER_CORE: DWORD = 0x000000A0;
pub const PRODUCT_PRO_WORKSTATION: DWORD = 0x000000A1;
pub const PRODUCT_PRO_WORKSTATION_N: DWORD = 0x000000A2;
pub const PRODUCT_PRO_FOR_EDUCATION: DWORD = 0x000000A4;
pub const PRODUCT_PRO_FOR_EDUCATION_N: DWORD = 0x000000A5;
pub const PRODUCT_AZURE_SERVER_CORE: DWORD = 0x000000A8;
pub const PRODUCT_AZURE_NANO_SERVER: DWORD = 0x000000A9;
pub const PRODUCT_ENTERPRISEG: DWORD = 0x000000AB;
pub const PRODUCT_ENTERPRISEGN: DWORD = 0x000000AC;
pub const PRODUCT_CLOUD: DWORD = 0x000000B2;
pub const PRODUCT_CLOUDN: DWORD = 0x000000B3;
pub const PRODUCT_UNLICENSED: DWORD = 0xABCDABCD;
pub const LANG_NEUTRAL: WORD = 0x00;
pub const LANG_INVARIANT: WORD = 0x7f;
pub const LANG_AFRIKAANS: WORD = 0x36;
pub const LANG_ALBANIAN: WORD = 0x1c;
pub const LANG_ALSATIAN: WORD = 0x84;
pub const LANG_AMHARIC: WORD = 0x5e;
pub const LANG_ARABIC: WORD = 0x01;
pub const LANG_ARMENIAN: WORD = 0x2b;
pub const LANG_ASSAMESE: WORD = 0x4d;
pub const LANG_AZERI: WORD = 0x2c;
pub const LANG_AZERBAIJANI: WORD = 0x2c;
pub const LANG_BANGLA: WORD = 0x45;
pub const LANG_BASHKIR: WORD = 0x6d;
pub const LANG_BASQUE: WORD = 0x2d;
pub const LANG_BELARUSIAN: WORD = 0x23;
pub const LANG_BENGALI: WORD = 0x45;
pub const LANG_BRETON: WORD = 0x7e;
pub const LANG_BOSNIAN: WORD = 0x1a;
pub const LANG_BOSNIAN_NEUTRAL: WORD = 0x781a;
pub const LANG_BULGARIAN: WORD = 0x02;
pub const LANG_CATALAN: WORD = 0x03;
pub const LANG_CENTRAL_KURDISH: WORD = 0x92;
pub const LANG_CHEROKEE: WORD = 0x5c;
pub const LANG_CHINESE: WORD = 0x04;
pub const LANG_CHINESE_SIMPLIFIED: WORD = 0x04;
pub const LANG_CHINESE_TRADITIONAL: WORD = 0x7c04;
pub const LANG_CORSICAN: WORD = 0x83;
pub const LANG_CROATIAN: WORD = 0x1a;
pub const LANG_CZECH: WORD = 0x05;
pub const LANG_DANISH: WORD = 0x06;
pub const LANG_DARI: WORD = 0x8c;
pub const LANG_DIVEHI: WORD = 0x65;
pub const LANG_DUTCH: WORD = 0x13;
pub const LANG_ENGLISH: WORD = 0x09;
pub const LANG_ESTONIAN: WORD = 0x25;
pub const LANG_FAEROESE: WORD = 0x38;
pub const LANG_FARSI: WORD = 0x29;
pub const LANG_FILIPINO: WORD = 0x64;
pub const LANG_FINNISH: WORD = 0x0b;
pub const LANG_FRENCH: WORD = 0x0c;
pub const LANG_FRISIAN: WORD = 0x62;
pub const LANG_FULAH: WORD = 0x67;
pub const LANG_GALICIAN: WORD = 0x56;
pub const LANG_GEORGIAN: WORD = 0x37;
pub const LANG_GERMAN: WORD = 0x07;
pub const LANG_GREEK: WORD = 0x08;
pub const LANG_GREENLANDIC: WORD = 0x6f;
pub const LANG_GUJARATI: WORD = 0x47;
pub const LANG_HAUSA: WORD = 0x68;
pub const LANG_HAWAIIAN: WORD = 0x75;
pub const LANG_HEBREW: WORD = 0x0d;
pub const LANG_HINDI: WORD = 0x39;
pub const LANG_HUNGARIAN: WORD = 0x0e;
pub const LANG_ICELANDIC: WORD = 0x0f;
pub const LANG_IGBO: WORD = 0x70;
pub const LANG_INDONESIAN: WORD = 0x21;
pub const LANG_INUKTITUT: WORD = 0x5d;
pub const LANG_IRISH: WORD = 0x3c;
pub const LANG_ITALIAN: WORD = 0x10;
pub const LANG_JAPANESE: WORD = 0x11;
pub const LANG_KANNADA: WORD = 0x4b;
pub const LANG_KASHMIRI: WORD = 0x60;
pub const LANG_KAZAK: WORD = 0x3f;
pub const LANG_KHMER: WORD = 0x53;
pub const LANG_KICHE: WORD = 0x86;
pub const LANG_KINYARWANDA: WORD = 0x87;
pub const LANG_KONKANI: WORD = 0x57;
pub const LANG_KOREAN: WORD = 0x12;
pub const LANG_KYRGYZ: WORD = 0x40;
pub const LANG_LAO: WORD = 0x54;
pub const LANG_LATVIAN: WORD = 0x26;
pub const LANG_LITHUANIAN: WORD = 0x27;
pub const LANG_LOWER_SORBIAN: WORD = 0x2e;
pub const LANG_LUXEMBOURGISH: WORD = 0x6e;
pub const LANG_MACEDONIAN: WORD = 0x2f;
pub const LANG_MALAY: WORD = 0x3e;
pub const LANG_MALAYALAM: WORD = 0x4c;
pub const LANG_MALTESE: WORD = 0x3a;
pub const LANG_MANIPURI: WORD = 0x58;
pub const LANG_MAORI: WORD = 0x81;
pub const LANG_MAPUDUNGUN: WORD = 0x7a;
pub const LANG_MARATHI: WORD = 0x4e;
pub const LANG_MOHAWK: WORD = 0x7c;
pub const LANG_MONGOLIAN: WORD = 0x50;
pub const LANG_NEPALI: WORD = 0x61;
pub const LANG_NORWEGIAN: WORD = 0x14;
pub const LANG_OCCITAN: WORD = 0x82;
pub const LANG_ODIA: WORD = 0x48;
pub const LANG_ORIYA: WORD = 0x48;
pub const LANG_PASHTO: WORD = 0x63;
pub const LANG_PERSIAN: WORD = 0x29;
pub const LANG_POLISH: WORD = 0x15;
pub const LANG_PORTUGUESE: WORD = 0x16;
pub const LANG_PULAR: WORD = 0x67;
pub const LANG_PUNJABI: WORD = 0x46;
pub const LANG_QUECHUA: WORD = 0x6b;
pub const LANG_ROMANIAN: WORD = 0x18;
pub const LANG_ROMANSH: WORD = 0x17;
pub const LANG_RUSSIAN: WORD = 0x19;
pub const LANG_SAKHA: WORD = 0x85;
pub const LANG_SAMI: WORD = 0x3b;
pub const LANG_SANSKRIT: WORD = 0x4f;
pub const LANG_SCOTTISH_GAELIC: WORD = 0x91;
pub const LANG_SERBIAN: WORD = 0x1a;
pub const LANG_SERBIAN_NEUTRAL: WORD = 0x7c1a;
pub const LANG_SINDHI: WORD = 0x59;
pub const LANG_SINHALESE: WORD = 0x5b;
pub const LANG_SLOVAK: WORD = 0x1b;
pub const LANG_SLOVENIAN: WORD = 0x24;
pub const LANG_SOTHO: WORD = 0x6c;
pub const LANG_SPANISH: WORD = 0x0a;
pub const LANG_SWAHILI: WORD = 0x41;
pub const LANG_SWEDISH: WORD = 0x1d;
pub const LANG_SYRIAC: WORD = 0x5a;
pub const LANG_TAJIK: WORD = 0x28;
pub const LANG_TAMAZIGHT: WORD = 0x5f;
pub const LANG_TAMIL: WORD = 0x49;
pub const LANG_TATAR: WORD = 0x44;
pub const LANG_TELUGU: WORD = 0x4a;
pub const LANG_THAI: WORD = 0x1e;
pub const LANG_TIBETAN: WORD = 0x51;
pub const LANG_TIGRIGNA: WORD = 0x73;
pub const LANG_TIGRINYA: WORD = 0x73;
pub const LANG_TSWANA: WORD = 0x32;
pub const LANG_TURKISH: WORD = 0x1f;
pub const LANG_TURKMEN: WORD = 0x42;
pub const LANG_UIGHUR: WORD = 0x80;
pub const LANG_UKRAINIAN: WORD = 0x22;
pub const LANG_UPPER_SORBIAN: WORD = 0x2e;
pub const LANG_URDU: WORD = 0x20;
pub const LANG_UZBEK: WORD = 0x43;
pub const LANG_VALENCIAN: WORD = 0x03;
pub const LANG_VIETNAMESE: WORD = 0x2a;
pub const LANG_WELSH: WORD = 0x52;
pub const LANG_WOLOF: WORD = 0x88;
pub const LANG_XHOSA: WORD = 0x34;
pub const LANG_YAKUT: WORD = 0x85;
pub const LANG_YI: WORD = 0x78;
pub const LANG_YORUBA: WORD = 0x6a;
pub const LANG_ZULU: WORD = 0x35;
pub const SUBLANG_NEUTRAL: WORD = 0x00;
pub const SUBLANG_DEFAULT: WORD = 0x01;
pub const SUBLANG_SYS_DEFAULT: WORD = 0x02;
pub const SUBLANG_CUSTOM_DEFAULT: WORD = 0x03;
pub const SUBLANG_CUSTOM_UNSPECIFIED: WORD = 0x04;
pub const SUBLANG_UI_CUSTOM_DEFAULT: WORD = 0x05;
pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA: WORD = 0x01;
pub const SUBLANG_ALBANIAN_ALBANIA: WORD = 0x01;
pub const SUBLANG_ALSATIAN_FRANCE: WORD = 0x01;
pub const SUBLANG_AMHARIC_ETHIOPIA: WORD = 0x01;
pub const SUBLANG_ARABIC_SAUDI_ARABIA: WORD = 0x01;
pub const SUBLANG_ARABIC_IRAQ: WORD = 0x02;
pub const SUBLANG_ARABIC_EGYPT: WORD = 0x03;
pub const SUBLANG_ARABIC_LIBYA: WORD = 0x04;
pub const SUBLANG_ARABIC_ALGERIA: WORD = 0x05;
pub const SUBLANG_ARABIC_MOROCCO: WORD = 0x06;
pub const SUBLANG_ARABIC_TUNISIA: WORD = 0x07;
pub const SUBLANG_ARABIC_OMAN: WORD = 0x08;
pub const SUBLANG_ARABIC_YEMEN: WORD = 0x09;
pub const SUBLANG_ARABIC_SYRIA: WORD = 0x0a;
pub const SUBLANG_ARABIC_JORDAN: WORD = 0x0b;
pub const SUBLANG_ARABIC_LEBANON: WORD = 0x0c;
pub const SUBLANG_ARABIC_KUWAIT: WORD = 0x0d;
pub const SUBLANG_ARABIC_UAE: WORD = 0x0e;
pub const SUBLANG_ARABIC_BAHRAIN: WORD = 0x0f;
pub const SUBLANG_ARABIC_QATAR: WORD = 0x10;
pub const SUBLANG_ARMENIAN_ARMENIA: WORD = 0x01;
pub const SUBLANG_ASSAMESE_INDIA: WORD = 0x01;
pub const SUBLANG_AZERI_LATIN: WORD = 0x01;
pub const SUBLANG_AZERI_CYRILLIC: WORD = 0x02;
pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN: WORD = 0x01;
pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC: WORD = 0x02;
pub const SUBLANG_BANGLA_INDIA: WORD = 0x01;
pub const SUBLANG_BANGLA_BANGLADESH: WORD = 0x02;
pub const SUBLANG_BASHKIR_RUSSIA: WORD = 0x01;
pub const SUBLANG_BASQUE_BASQUE: WORD = 0x01;
pub const SUBLANG_BELARUSIAN_BELARUS: WORD = 0x01;
pub const SUBLANG_BENGALI_INDIA: WORD = 0x01;
pub const SUBLANG_BENGALI_BANGLADESH: WORD = 0x02;
pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x05;
pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: WORD = 0x08;
pub const SUBLANG_BRETON_FRANCE: WORD = 0x01;
pub const SUBLANG_BULGARIAN_BULGARIA: WORD = 0x01;
pub const SUBLANG_CATALAN_CATALAN: WORD = 0x01;
pub const SUBLANG_CENTRAL_KURDISH_IRAQ: WORD = 0x01;
pub const SUBLANG_CHEROKEE_CHEROKEE: WORD = 0x01;
pub const SUBLANG_CHINESE_TRADITIONAL: WORD = 0x01;
pub const SUBLANG_CHINESE_SIMPLIFIED: WORD = 0x02;
pub const SUBLANG_CHINESE_HONGKONG: WORD = 0x03;
pub const SUBLANG_CHINESE_SINGAPORE: WORD = 0x04;
pub const SUBLANG_CHINESE_MACAU: WORD = 0x05;
pub const SUBLANG_CORSICAN_FRANCE: WORD = 0x01;
pub const SUBLANG_CZECH_CZECH_REPUBLIC: WORD = 0x01;
pub const SUBLANG_CROATIAN_CROATIA: WORD = 0x01;
pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x04;
pub const SUBLANG_DANISH_DENMARK: WORD = 0x01;
pub const SUBLANG_DARI_AFGHANISTAN: WORD = 0x01;
pub const SUBLANG_DIVEHI_MALDIVES: WORD = 0x01;
pub const SUBLANG_DUTCH: WORD = 0x01;
pub const SUBLANG_DUTCH_BELGIAN: WORD = 0x02;
pub const SUBLANG_ENGLISH_US: WORD = 0x01;
pub const SUBLANG_ENGLISH_UK: WORD = 0x02;
pub const SUBLANG_ENGLISH_AUS: WORD = 0x03;
pub const SUBLANG_ENGLISH_CAN: WORD = 0x04;
pub const SUBLANG_ENGLISH_NZ: WORD = 0x05;
pub const SUBLANG_ENGLISH_EIRE: WORD = 0x06;
pub const SUBLANG_ENGLISH_SOUTH_AFRICA: WORD = 0x07;
pub const SUBLANG_ENGLISH_JAMAICA: WORD = 0x08;
pub const SUBLANG_ENGLISH_CARIBBEAN: WORD = 0x09;
pub const SUBLANG_ENGLISH_BELIZE: WORD = 0x0a;
pub const SUBLANG_ENGLISH_TRINIDAD: WORD = 0x0b;
pub const SUBLANG_ENGLISH_ZIMBABWE: WORD = 0x0c;
pub const SUBLANG_ENGLISH_PHILIPPINES: WORD = 0x0d;
pub const SUBLANG_ENGLISH_INDIA: WORD = 0x10;
pub const SUBLANG_ENGLISH_MALAYSIA: WORD = 0x11;
pub const SUBLANG_ENGLISH_SINGAPORE: WORD = 0x12;
pub const SUBLANG_ESTONIAN_ESTONIA: WORD = 0x01;
pub const SUBLANG_FAEROESE_FAROE_ISLANDS: WORD = 0x01;
pub const SUBLANG_FILIPINO_PHILIPPINES: WORD = 0x01;
pub const SUBLANG_FINNISH_FINLAND: WORD = 0x01;
pub const SUBLANG_FRENCH: WORD = 0x01;
pub const SUBLANG_FRENCH_BELGIAN: WORD = 0x02;
pub const SUBLANG_FRENCH_CANADIAN: WORD = 0x03;
pub const SUBLANG_FRENCH_SWISS: WORD = 0x04;
pub const SUBLANG_FRENCH_LUXEMBOURG: WORD = 0x05;
pub const SUBLANG_FRENCH_MONACO: WORD = 0x06;
pub const SUBLANG_FRISIAN_NETHERLANDS: WORD = 0x01;
pub const SUBLANG_FULAH_SENEGAL: WORD = 0x02;
pub const SUBLANG_GALICIAN_GALICIAN: WORD = 0x01;
pub const SUBLANG_GEORGIAN_GEORGIA: WORD = 0x01;
pub const SUBLANG_GERMAN: WORD = 0x01;
pub const SUBLANG_GERMAN_SWISS: WORD = 0x02;
pub const SUBLANG_GERMAN_AUSTRIAN: WORD = 0x03;
pub const SUBLANG_GERMAN_LUXEMBOURG: WORD = 0x04;
pub const SUBLANG_GERMAN_LIECHTENSTEIN: WORD = 0x05;
pub const SUBLANG_GREEK_GREECE: WORD = 0x01;
pub const SUBLANG_GREENLANDIC_GREENLAND: WORD = 0x01;
pub const SUBLANG_GUJARATI_INDIA: WORD = 0x01;
pub const SUBLANG_HAUSA_NIGERIA_LATIN: WORD = 0x01;
pub const SUBLANG_HAWAIIAN_US: WORD = 0x01;
pub const SUBLANG_HEBREW_ISRAEL: WORD = 0x01;
pub const SUBLANG_HINDI_INDIA: WORD = 0x01;
pub const SUBLANG_HUNGARIAN_HUNGARY: WORD = 0x01;
pub const SUBLANG_ICELANDIC_ICELAND: WORD = 0x01;
pub const SUBLANG_IGBO_NIGERIA: WORD = 0x01;
pub const SUBLANG_INDONESIAN_INDONESIA: WORD = 0x01;
pub const SUBLANG_INUKTITUT_CANADA: WORD = 0x01;
pub const SUBLANG_INUKTITUT_CANADA_LATIN: WORD = 0x02;
pub const SUBLANG_IRISH_IRELAND: WORD = 0x02;
pub const SUBLANG_ITALIAN: WORD = 0x01;
pub const SUBLANG_ITALIAN_SWISS: WORD = 0x02;
pub const SUBLANG_JAPANESE_JAPAN: WORD = 0x01;
pub const SUBLANG_KANNADA_INDIA: WORD = 0x01;
pub const SUBLANG_KASHMIRI_SASIA: WORD = 0x02;
pub const SUBLANG_KASHMIRI_INDIA: WORD = 0x02;
pub const SUBLANG_KAZAK_KAZAKHSTAN: WORD = 0x01;
pub const SUBLANG_KHMER_CAMBODIA: WORD = 0x01;
pub const SUBLANG_KICHE_GUATEMALA: WORD = 0x01;
pub const SUBLANG_KINYARWANDA_RWANDA: WORD = 0x01;
pub const SUBLANG_KONKANI_INDIA: WORD = 0x01;
pub const SUBLANG_KOREAN: WORD = 0x01;
pub const SUBLANG_KYRGYZ_KYRGYZSTAN: WORD = 0x01;
pub const SUBLANG_LAO_LAO: WORD = 0x01;
pub const SUBLANG_LATVIAN_LATVIA: WORD = 0x01;
pub const SUBLANG_LITHUANIAN: WORD = 0x01;
pub const SUBLANG_LOWER_SORBIAN_GERMANY: WORD = 0x02;
pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG: WORD = 0x01;
pub const SUBLANG_MACEDONIAN_MACEDONIA: WORD = 0x01;
pub const SUBLANG_MALAY_MALAYSIA: WORD = 0x01;
pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM: WORD = 0x02;
pub const SUBLANG_MALAYALAM_INDIA: WORD = 0x01;
pub const SUBLANG_MALTESE_MALTA: WORD = 0x01;
pub const SUBLANG_MAORI_NEW_ZEALAND: WORD = 0x01;
pub const SUBLANG_MAPUDUNGUN_CHILE: WORD = 0x01;
pub const SUBLANG_MARATHI_INDIA: WORD = 0x01;
pub const SUBLANG_MOHAWK_MOHAWK: WORD = 0x01;
pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: WORD = 0x01;
pub const SUBLANG_MONGOLIAN_PRC: WORD = 0x02;
pub const SUBLANG_NEPALI_INDIA: WORD = 0x02;
pub const SUBLANG_NEPALI_NEPAL: WORD = 0x01;
pub const SUBLANG_NORWEGIAN_BOKMAL: WORD = 0x01;
pub const SUBLANG_NORWEGIAN_NYNORSK: WORD = 0x02;
pub const SUBLANG_OCCITAN_FRANCE: WORD = 0x01;
pub const SUBLANG_ODIA_INDIA: WORD = 0x01;
pub const SUBLANG_ORIYA_INDIA: WORD = 0x01;
pub const SUBLANG_PASHTO_AFGHANISTAN: WORD = 0x01;
pub const SUBLANG_PERSIAN_IRAN: WORD = 0x01;
pub const SUBLANG_POLISH_POLAND: WORD = 0x01;
pub const SUBLANG_PORTUGUESE: WORD = 0x02;
pub const SUBLANG_PORTUGUESE_BRAZILIAN: WORD = 0x01;
pub const SUBLANG_PULAR_SENEGAL: WORD = 0x02;
pub const SUBLANG_PUNJABI_INDIA: WORD = 0x01;
pub const SUBLANG_PUNJABI_PAKISTAN: WORD = 0x02;
pub const SUBLANG_QUECHUA_BOLIVIA: WORD = 0x01;
pub const SUBLANG_QUECHUA_ECUADOR: WORD = 0x02;
pub const SUBLANG_QUECHUA_PERU: WORD = 0x03;
pub const SUBLANG_ROMANIAN_ROMANIA: WORD = 0x01;
pub const SUBLANG_ROMANSH_SWITZERLAND: WORD = 0x01;
pub const SUBLANG_RUSSIAN_RUSSIA: WORD = 0x01;
pub const SUBLANG_SAKHA_RUSSIA: WORD = 0x01;
pub const SUBLANG_SAMI_NORTHERN_NORWAY: WORD = 0x01;
pub const SUBLANG_SAMI_NORTHERN_SWEDEN: WORD = 0x02;
pub const SUBLANG_SAMI_NORTHERN_FINLAND: WORD = 0x03;
pub const SUBLANG_SAMI_LULE_NORWAY: WORD = 0x04;
pub const SUBLANG_SAMI_LULE_SWEDEN: WORD = 0x05;
pub const SUBLANG_SAMI_SOUTHERN_NORWAY: WORD = 0x06;
pub const SUBLANG_SAMI_SOUTHERN_SWEDEN: WORD = 0x07;
pub const SUBLANG_SAMI_SKOLT_FINLAND: WORD = 0x08;
pub const SUBLANG_SAMI_INARI_FINLAND: WORD = 0x09;
pub const SUBLANG_SANSKRIT_INDIA: WORD = 0x01;
pub const SUBLANG_SCOTTISH_GAELIC: WORD = 0x01;
pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x06;
pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC: WORD = 0x07;
pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN: WORD = 0x0b;
pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC: WORD = 0x0c;
pub const SUBLANG_SERBIAN_SERBIA_LATIN: WORD = 0x09;
pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC: WORD = 0x0a;
pub const SUBLANG_SERBIAN_CROATIA: WORD = 0x01;
pub const SUBLANG_SERBIAN_LATIN: WORD = 0x02;
pub const SUBLANG_SERBIAN_CYRILLIC: WORD = 0x03;
pub const SUBLANG_SINDHI_INDIA: WORD = 0x01;
pub const SUBLANG_SINDHI_PAKISTAN: WORD = 0x02;
pub const SUBLANG_SINDHI_AFGHANISTAN: WORD = 0x02;
pub const SUBLANG_SINHALESE_SRI_LANKA: WORD = 0x01;
pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA: WORD = 0x01;
pub const SUBLANG_SLOVAK_SLOVAKIA: WORD = 0x01;
pub const SUBLANG_SLOVENIAN_SLOVENIA: WORD = 0x01;
pub const SUBLANG_SPANISH: WORD = 0x01;
pub const SUBLANG_SPANISH_MEXICAN: WORD = 0x02;
pub const SUBLANG_SPANISH_MODERN: WORD = 0x03;
pub const SUBLANG_SPANISH_GUATEMALA: WORD = 0x04;
pub const SUBLANG_SPANISH_COSTA_RICA: WORD = 0x05;
pub const SUBLANG_SPANISH_PANAMA: WORD = 0x06;
pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC: WORD = 0x07;
pub const SUBLANG_SPANISH_VENEZUELA: WORD = 0x08;
pub const SUBLANG_SPANISH_COLOMBIA: WORD = 0x09;
pub const SUBLANG_SPANISH_PERU: WORD = 0x0a;
pub const SUBLANG_SPANISH_ARGENTINA: WORD = 0x0b;
pub const SUBLANG_SPANISH_ECUADOR: WORD = 0x0c;
pub const SUBLANG_SPANISH_CHILE: WORD = 0x0d;
pub const SUBLANG_SPANISH_URUGUAY: WORD = 0x0e;
pub const SUBLANG_SPANISH_PARAGUAY: WORD = 0x0f;
pub const SUBLANG_SPANISH_BOLIVIA: WORD = 0x10;
pub const SUBLANG_SPANISH_EL_SALVADOR: WORD = 0x11;
pub const SUBLANG_SPANISH_HONDURAS: WORD = 0x12;
pub const SUBLANG_SPANISH_NICARAGUA: WORD = 0x13;
pub const SUBLANG_SPANISH_PUERTO_RICO: WORD = 0x14;
pub const SUBLANG_SPANISH_US: WORD = 0x15;
pub const SUBLANG_SWAHILI_KENYA: WORD = 0x01;
pub const SUBLANG_SWEDISH: WORD = 0x01;
pub const SUBLANG_SWEDISH_FINLAND: WORD = 0x02;
pub const SUBLANG_SYRIAC_SYRIA: WORD = 0x01;
pub const SUBLANG_TAJIK_TAJIKISTAN: WORD = 0x01;
pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN: WORD = 0x02;
pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH: WORD = 0x04;
pub const SUBLANG_TAMIL_INDIA: WORD = 0x01;
pub const SUBLANG_TAMIL_SRI_LANKA: WORD = 0x02;
pub const SUBLANG_TATAR_RUSSIA: WORD = 0x01;
pub const SUBLANG_TELUGU_INDIA: WORD = 0x01;
pub const SUBLANG_THAI_THAILAND: WORD = 0x01;
pub const SUBLANG_TIBETAN_PRC: WORD = 0x01;
pub const SUBLANG_TIGRIGNA_ERITREA: WORD = 0x02;
pub const SUBLANG_TIGRINYA_ERITREA: WORD = 0x02;
pub const SUBLANG_TIGRINYA_ETHIOPIA: WORD = 0x01;
pub const SUBLANG_TSWANA_BOTSWANA: WORD = 0x02;
pub const SUBLANG_TSWANA_SOUTH_AFRICA: WORD = 0x01;
pub const SUBLANG_TURKISH_TURKEY: WORD = 0x01;
pub const SUBLANG_TURKMEN_TURKMENISTAN: WORD = 0x01;
pub const SUBLANG_UIGHUR_PRC: WORD = 0x01;
pub const SUBLANG_UKRAINIAN_UKRAINE: WORD = 0x01;
pub const SUBLANG_UPPER_SORBIAN_GERMANY: WORD = 0x01;
pub const SUBLANG_URDU_PAKISTAN: WORD = 0x01;
pub const SUBLANG_URDU_INDIA: WORD = 0x02;
pub const SUBLANG_UZBEK_LATIN: WORD = 0x01;
pub const SUBLANG_UZBEK_CYRILLIC: WORD = 0x02;
pub const SUBLANG_VALENCIAN_VALENCIA: WORD = 0x02;
pub const SUBLANG_VIETNAMESE_VIETNAM: WORD = 0x01;
pub const SUBLANG_WELSH_UNITED_KINGDOM: WORD = 0x01;
pub const SUBLANG_WOLOF_SENEGAL: WORD = 0x01;
pub const SUBLANG_XHOSA_SOUTH_AFRICA: WORD = 0x01;
pub const SUBLANG_YAKUT_RUSSIA: WORD = 0x01;
pub const SUBLANG_YI_PRC: WORD = 0x01;
pub const SUBLANG_YORUBA_NIGERIA: WORD = 0x01;
pub const SUBLANG_ZULU_SOUTH_AFRICA: WORD = 0x01;
pub const SORT_DEFAULT: WORD = 0x0;
pub const SORT_INVARIANT_MATH: WORD = 0x1;
pub const SORT_JAPANESE_XJIS: WORD = 0x0;
pub const SORT_JAPANESE_UNICODE: WORD = 0x1;
pub const SORT_JAPANESE_RADICALSTROKE: WORD = 0x4;
pub const SORT_CHINESE_BIG5: WORD = 0x0;
pub const SORT_CHINESE_PRCP: WORD = 0x0;
pub const SORT_CHINESE_UNICODE: WORD = 0x1;
pub const SORT_CHINESE_PRC: WORD = 0x2;
pub const SORT_CHINESE_BOPOMOFO: WORD = 0x3;
pub const SORT_CHINESE_RADICALSTROKE: WORD = 0x4;
pub const SORT_KOREAN_KSC: WORD = 0x0;
pub const SORT_KOREAN_UNICODE: WORD = 0x1;
pub const SORT_GERMAN_PHONE_BOOK: WORD = 0x1;
pub const SORT_HUNGARIAN_DEFAULT: WORD = 0x0;
pub const SORT_HUNGARIAN_TECHNICAL: WORD = 0x1;
pub const SORT_GEORGIAN_TRADITIONAL: WORD = 0x0;
pub const SORT_GEORGIAN_MODERN: WORD = 0x1;
macro_rules! MAKELANGID { ($p:expr, $s:expr) => (($s << 10) | $p) }
#[inline]
pub fn MAKELANGID(p: WORD, s: WORD) -> LANGID {
    (s << 10) | p
}
#[inline]
pub fn PRIMARYLANGID(lgid: LANGID) -> WORD {
    lgid & 0x3ff
}
#[inline]
pub fn SUBLANGID(lgid: LANGID) -> WORD {
    lgid >> 10
}
pub const NLS_VALID_LOCALE_MASK: DWORD = 0x000fffff;
macro_rules! MAKELCID {
    ($lgid:expr, $srtid:expr) => ((($srtid as DWORD) << 16) | ($lgid as DWORD))
}
#[inline]
pub fn MAKELCID(lgid: LANGID, srtid: WORD) -> LCID {
    ((srtid as DWORD) << 16) | (lgid as DWORD)
}
#[inline]
pub fn MAKESORTLCID(lgid: LANGID, srtid: WORD, ver: WORD) -> LCID {
    MAKELCID(lgid, srtid) | ((ver as DWORD) << 20)
}
#[inline]
pub fn LANGIDFROMLCID(lcid: LCID) -> LANGID {
    lcid as LANGID
}
#[inline]
pub fn SORTIDFROMLCID(lcid: LCID) -> WORD {
    ((lcid >> 16) & 0xf) as WORD
}
#[inline]
pub fn SORTVERSIONFROMLCID(lcid: LCID) -> WORD {
    ((lcid >> 16) & 0xf) as WORD
}
pub const LOCALE_NAME_MAX_LENGTH: usize = 85;
pub const LANG_SYSTEM_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT);
pub const LANG_USER_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_DEFAULT);
pub const LOCALE_SYSTEM_DEFAULT: LCID = MAKELCID!(LANG_SYSTEM_DEFAULT, SORT_DEFAULT);
pub const LOCALE_USER_DEFAULT: LCID = MAKELCID!(LANG_USER_DEFAULT, SORT_DEFAULT);
pub const LOCALE_CUSTOM_DEFAULT: LCID
    = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT);
pub const LOCALE_CUSTOM_UNSPECIFIED: LCID
    = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT);
pub const LOCALE_CUSTOM_UI_DEFAULT: LCID
    = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT);
pub const LOCALE_NEUTRAL: LCID
    = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT);
pub const LOCALE_INVARIANT: LCID
    = MAKELCID!(MAKELANGID!(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT);
pub const LOCALE_TRANSIENT_KEYBOARD1: LCID = 0x2000;
pub const LOCALE_TRANSIENT_KEYBOARD2: LCID = 0x2400;
pub const LOCALE_TRANSIENT_KEYBOARD3: LCID = 0x2800;
pub const LOCALE_TRANSIENT_KEYBOARD4: LCID = 0x2c00;
pub const LOCALE_UNASSIGNED_LCID: LCID = LOCALE_CUSTOM_UNSPECIFIED;
pub const STATUS_WAIT_0: DWORD = 0x00000000;
pub const STATUS_ABANDONED_WAIT_0: DWORD = 0x00000080;
pub const STATUS_USER_APC: DWORD = 0x000000C0;
pub const STATUS_TIMEOUT: DWORD = 0x00000102;
pub const STATUS_PENDING: DWORD = 0x00000103;
pub const DBG_EXCEPTION_HANDLED: DWORD = 0x00010001;
pub const DBG_CONTINUE: DWORD = 0x00010002;
pub const STATUS_SEGMENT_NOTIFICATION: DWORD = 0x40000005;
pub const STATUS_FATAL_APP_EXIT: DWORD = 0x40000015;
pub const DBG_REPLY_LATER: DWORD = 0x40010001;
pub const DBG_TERMINATE_THREAD: DWORD = 0x40010003;
pub const DBG_TERMINATE_PROCESS: DWORD = 0x40010004;
pub const DBG_CONTROL_C: DWORD = 0x40010005;
pub const DBG_PRINTEXCEPTION_C: DWORD = 0x40010006;
pub const DBG_RIPEXCEPTION: DWORD = 0x40010007;
pub const DBG_CONTROL_BREAK: DWORD = 0x40010008;
pub const DBG_COMMAND_EXCEPTION: DWORD = 0x40010009;
pub const DBG_PRINTEXCEPTION_WIDE_C: DWORD = 0x4001000A;
pub const STATUS_GUARD_PAGE_VIOLATION: DWORD = 0x80000001;
pub const STATUS_DATATYPE_MISALIGNMENT: DWORD = 0x80000002;
pub const STATUS_BREAKPOINT: DWORD = 0x80000003;
pub const STATUS_SINGLE_STEP: DWORD = 0x80000004;
pub const STATUS_LONGJUMP: DWORD = 0x80000026;
pub const STATUS_UNWIND_CONSOLIDATE: DWORD = 0x80000029;
pub const DBG_EXCEPTION_NOT_HANDLED: DWORD = 0x80010001;
pub const STATUS_ACCESS_VIOLATION: DWORD = 0xC0000005;
pub const STATUS_IN_PAGE_ERROR: DWORD = 0xC0000006;
pub const STATUS_INVALID_HANDLE: DWORD = 0xC0000008;
pub const STATUS_INVALID_PARAMETER: DWORD = 0xC000000D;
pub const STATUS_NO_MEMORY: DWORD = 0xC0000017;
pub const STATUS_ILLEGAL_INSTRUCTION: DWORD = 0xC000001D;
pub const STATUS_NONCONTINUABLE_EXCEPTION: DWORD = 0xC0000025;
pub const STATUS_INVALID_DISPOSITION: DWORD = 0xC0000026;
pub const STATUS_ARRAY_BOUNDS_EXCEEDED: DWORD = 0xC000008C;
pub const STATUS_FLOAT_DENORMAL_OPERAND: DWORD = 0xC000008D;
pub const STATUS_FLOAT_DIVIDE_BY_ZERO: DWORD = 0xC000008E;
pub const STATUS_FLOAT_INEXACT_RESULT: DWORD = 0xC000008F;
pub const STATUS_FLOAT_INVALID_OPERATION: DWORD = 0xC0000090;
pub const STATUS_FLOAT_OVERFLOW: DWORD = 0xC0000091;
pub const STATUS_FLOAT_STACK_CHECK: DWORD = 0xC0000092;
pub const STATUS_FLOAT_UNDERFLOW: DWORD = 0xC0000093;
pub const STATUS_INTEGER_DIVIDE_BY_ZERO: DWORD = 0xC0000094;
pub const STATUS_INTEGER_OVERFLOW: DWORD = 0xC0000095;
pub const STATUS_PRIVILEGED_INSTRUCTION: DWORD = 0xC0000096;
pub const STATUS_STACK_OVERFLOW: DWORD = 0xC00000FD;
pub const STATUS_DLL_NOT_FOUND: DWORD = 0xC0000135;
pub const STATUS_ORDINAL_NOT_FOUND: DWORD = 0xC0000138;
pub const STATUS_ENTRYPOINT_NOT_FOUND: DWORD = 0xC0000139;
pub const STATUS_CONTROL_C_EXIT: DWORD = 0xC000013A;
pub const STATUS_DLL_INIT_FAILED: DWORD = 0xC0000142;
pub const STATUS_FLOAT_MULTIPLE_FAULTS: DWORD = 0xC00002B4;
pub const STATUS_FLOAT_MULTIPLE_TRAPS: DWORD = 0xC00002B5;
pub const STATUS_REG_NAT_CONSUMPTION: DWORD = 0xC00002C9;
pub const STATUS_HEAP_CORRUPTION: DWORD = 0xC0000374;
pub const STATUS_STACK_BUFFER_OVERRUN: DWORD = 0xC0000409;
pub const STATUS_INVALID_CRUNTIME_PARAMETER: DWORD = 0xC0000417;
pub const STATUS_ASSERTION_FAILURE: DWORD = 0xC0000420;
pub const STATUS_SXS_EARLY_DEACTIVATION: DWORD = 0xC015000F;
pub const STATUS_SXS_INVALID_DEACTIVATION: DWORD = 0xC0150010;
pub const MAXIMUM_WAIT_OBJECTS: DWORD = 64;
pub const MAXIMUM_SUSPEND_COUNT: CHAR = MAXCHAR;
pub type KSPIN_LOCK = ULONG_PTR;
pub type PKSPIN_LOCK = *mut KSPIN_LOCK;
STRUCT!{struct M128A { // FIXME align 16
    Low: ULONGLONG,
    High: LONGLONG,
}}
pub type PM128A = *mut M128A;
#[cfg(target_pointer_width = "32")]
STRUCT!{struct XSAVE_FORMAT { // FIXME align 16
    ControlWord: WORD,
    StatusWord: WORD,
    TagWord: BYTE,
    Reserved1: BYTE,
    ErrorOpcode: WORD,
    ErrorOffset: DWORD,
    ErrorSelector: WORD,
    Reserved2: WORD,
    DataOffset: DWORD,
    DataSelector: WORD,
    Reserved3: WORD,
    MxCsr: DWORD,
    MxCsr_Mask: DWORD,
    FloatRegisters: [M128A; 8],
    XmmRegisters: [M128A; 8],
    Reserved4: [BYTE; 224],
}}
#[cfg(target_pointer_width = "64")]
STRUCT!{struct XSAVE_FORMAT { // FIXME align 16
    ControlWord: WORD,
    StatusWord: WORD,
    TagWord: BYTE,
    Reserved1: BYTE,
    ErrorOpcode: WORD,
    ErrorOffset: DWORD,
    ErrorSelector: WORD,
    Reserved2: WORD,
    DataOffset: DWORD,
    DataSelector: WORD,
    Reserved3: WORD,
    MxCsr: DWORD,
    MxCsr_Mask: DWORD,
    FloatRegisters: [M128A; 8],
    XmmRegisters: [M128A; 16],
    Reserved4: [BYTE; 96],
}}
#[cfg(target_arch = "x86")]
STRUCT!{struct XSTATE_CONTEXT {
    Mask: DWORD64,
    Length: DWORD,
    Reserved1: DWORD,
    Area: PXSAVE_AREA,
    Reserved2: DWORD,
    Buffer: PVOID,
    Reserved3: DWORD,
}}
#[cfg(not(target_arch = "x86"))]
STRUCT!{struct XSTATE_CONTEXT {
    Mask: DWORD64,
    Length: DWORD,
    Reserved1: DWORD,
    Area: PXSAVE_AREA,
    Buffer: PVOID,
}}
pub type PXSAVE_FORMAT = *mut XSAVE_FORMAT;
STRUCT!{struct XSAVE_AREA_HEADER { // FIXME align 8
    Mask: DWORD64,
    CompactionMask: DWORD64,
    Reserved2: [DWORD64; 6],
}}
pub type PXSAVE_AREA_HEADER = *mut XSAVE_AREA_HEADER;
STRUCT!{struct XSAVE_AREA { // FIXME align 16
    LegacyState: XSAVE_FORMAT,
    Header: XSAVE_AREA_HEADER,
}}
pub type PXSAVE_AREA = *mut XSAVE_AREA;
pub type PXSTATE_CONTEXT = *mut XSTATE_CONTEXT;
STRUCT!{struct SCOPE_TABLE_AMD64 {
    Count: DWORD,
    ScopeRecord: [SCOPE_TABLE_AMD64_ScopeRecord; 1],
}}
STRUCT!{struct SCOPE_TABLE_AMD64_ScopeRecord {
    BeginAddress: DWORD,
    EndAddress: DWORD,
    HandlerAddress: DWORD,
    JumpTarget: DWORD,
}}
pub type PSCOPE_TABLE_AMD64 = *mut SCOPE_TABLE_AMD64;
STRUCT!{struct SCOPE_TABLE_ARM64 {
    Count: DWORD,
    ScopeRecord: [SCOPE_TABLE_ARM64_ScopeRecord; 1],
}}
STRUCT!{struct SCOPE_TABLE_ARM64_ScopeRecord {
    BeginAddress: DWORD,
    EndAddress: DWORD,
    HandlerAddress: DWORD,
    JumpTarget: DWORD,
}}
pub type PSCOPE_TABLE_ARM64 = *mut SCOPE_TABLE_ARM64;
// Skip interlocked and bit manipulation stuff because it is all intrinsics
// Use the native Rust equivalents instead
#[cfg(target_arch = "x86_64")]
IFDEF!{
pub const EXCEPTION_READ_FAULT: DWORD = 0;
pub const EXCEPTION_WRITE_FAULT: DWORD = 1;
pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8;
pub const CONTEXT_AMD64: DWORD = 0x00100000;
pub const CONTEXT_CONTROL: DWORD = CONTEXT_AMD64 | 0x00000001;
pub const CONTEXT_INTEGER: DWORD = CONTEXT_AMD64 | 0x00000002;
pub const CONTEXT_SEGMENTS: DWORD = CONTEXT_AMD64 | 0x00000004;
pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_AMD64 | 0x00000008;
pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_AMD64 | 0x00000010;
pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT;
pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS
    | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS;
pub const CONTEXT_XSTATE: DWORD = CONTEXT_AMD64 | 0x00000040;
pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000;
pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000;
pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000;
pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000;
pub const INITIAL_MXCSR: DWORD = 0x1f80;
pub const INITIAL_FPCSR: DWORD = 0x027f;
pub type XMM_SAVE_AREA32 = XSAVE_FORMAT;
pub type PXMM_SAVE_AREA32 = *mut XSAVE_FORMAT;
STRUCT!{struct CONTEXT_u_s {
    Header: [M128A; 2],
    Legacy: [M128A; 8],
    Xmm0: M128A,
    Xmm1: M128A,
    Xmm2: M128A,
    Xmm3: M128A,
    Xmm4: M128A,
    Xmm5: M128A,
    Xmm6: M128A,
    Xmm7: M128A,
    Xmm8: M128A,
    Xmm9: M128A,
    Xmm10: M128A,
    Xmm11: M128A,
    Xmm12: M128A,
    Xmm13: M128A,
    Xmm14: M128A,
    Xmm15: M128A,
}}
UNION!{union CONTEXT_u {
    [u64; 64],
    FltSave FltSave_mut: XMM_SAVE_AREA32,
    s s_mut: CONTEXT_u_s,
}}
STRUCT!{struct CONTEXT { // FIXME align 16
    P1Home: DWORD64,
    P2Home: DWORD64,
    P3Home: DWORD64,
    P4Home: DWORD64,
    P5Home: DWORD64,
    P6Home: DWORD64,
    ContextFlags: DWORD,
    MxCsr: DWORD,
    SegCs: WORD,
    SegDs: WORD,
    SegEs: WORD,
    SegFs: WORD,
    SegGs: WORD,
    SegSs: WORD,
    EFlags: DWORD,
    Dr0: DWORD64,
    Dr1: DWORD64,
    Dr2: DWORD64,
    Dr3: DWORD64,
    Dr6: DWORD64,
    Dr7: DWORD64,
    Rax: DWORD64,
    Rcx: DWORD64,
    Rdx: DWORD64,
    Rbx: DWORD64,
    Rsp: DWORD64,
    Rbp: DWORD64,
    Rsi: DWORD64,
    Rdi: DWORD64,
    R8: DWORD64,
    R9: DWORD64,
    R10: DWORD64,
    R11: DWORD64,
    R12: DWORD64,
    R13: DWORD64,
    R14: DWORD64,
    R15: DWORD64,
    Rip: DWORD64,
    u: CONTEXT_u,
    VectorRegister: [M128A; 26],
    VectorControl: DWORD64,
    DebugControl: DWORD64,
    LastBranchToRip: DWORD64,
    LastBranchFromRip: DWORD64,
    LastExceptionToRip: DWORD64,
    LastExceptionFromRip: DWORD64,
}}
pub type PCONTEXT = *mut CONTEXT;
pub type RUNTIME_FUNCTION = IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type PRUNTIME_FUNCTION = *mut IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type SCOPE_TABLE = SCOPE_TABLE_AMD64;
pub type PSCOPE_TABLE = *mut SCOPE_TABLE_AMD64;
pub const RUNTIME_FUNCTION_INDIRECT: DWORD = 0x1;
pub const UNW_FLAG_NHANDLER: DWORD = 0x0;
pub const UNW_FLAG_EHANDLER: DWORD = 0x1;
pub const UNW_FLAG_UHANDLER: DWORD = 0x2;
pub const UNW_FLAG_CHAININFO: DWORD = 0x4;
pub const UNW_FLAG_NO_EPILOGUE: DWORD = 0x80000000;
pub const UNWIND_HISTORY_TABLE_SIZE: usize = 12;
STRUCT!{struct UNWIND_HISTORY_TABLE_ENTRY {
    ImageBase: DWORD64,
    FunctionEntry: PRUNTIME_FUNCTION,
}}
pub type PUNWIND_HISTORY_TABLE_ENTRY = *mut UNWIND_HISTORY_TABLE_ENTRY;
STRUCT!{struct UNWIND_HISTORY_TABLE {
    Count: DWORD,
    LocalHint: BYTE,
    GlobalHint: BYTE,
    Search: BYTE,
    Once: BYTE,
    LowAddress: DWORD64,
    HighAddress: DWORD64,
    Entry: [UNWIND_HISTORY_TABLE_ENTRY; UNWIND_HISTORY_TABLE_SIZE],
}}
pub type PUNWIND_HISTORY_TABLE = *mut UNWIND_HISTORY_TABLE;
FN!{cdecl PGET_RUNTIME_FUNCTION_CALLBACK(
    ControlPc: DWORD64,
    Context: PVOID,
) -> PRUNTIME_FUNCTION}
FN!{cdecl POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK(
    Process: HANDLE,
    TableAddress: PVOID,
    Entries: PDWORD,
    Functions: *mut PRUNTIME_FUNCTION,
) -> DWORD}
pub const OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME: &'static str
    = "OutOfProcessFunctionTableCallback";
STRUCT!{struct DISPATCHER_CONTEXT {
    ControlPc: DWORD64,
    ImageBase: DWORD64,
    FunctionEntry: PRUNTIME_FUNCTION,
    EstablisherFrame: DWORD64,
    TargetIp: DWORD64,
    ContextRecord: PCONTEXT,
    LanguageHandler: PEXCEPTION_ROUTINE,
    HandlerData: PVOID,
    HistoryTable: PUNWIND_HISTORY_TABLE,
    ScopeIndex: DWORD,
    Fill0: DWORD,
}}
pub type PDISPATCHER_CONTEXT = *mut DISPATCHER_CONTEXT;
FN!{cdecl PEXCEPTION_FILTER(
    ExceptionPointers: *mut EXCEPTION_POINTERS,
    EstablisherFrame: PVOID,
) -> LONG}
FN!{cdecl PTERMINATION_HANDLER(
    AbnormalTermination: BOOLEAN,
    EstablisherFrame: PVOID,
) -> ()}
STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS_u1_s {
    Xmm0: PM128A,
    Xmm1: PM128A,
    Xmm2: PM128A,
    Xmm3: PM128A,
    Xmm4: PM128A,
    Xmm5: PM128A,
    Xmm6: PM128A,
    Xmm7: PM128A,
    Xmm8: PM128A,
    Xmm9: PM128A,
    Xmm10: PM128A,
    Xmm11: PM128A,
    Xmm12: PM128A,
    Xmm13: PM128A,
    Xmm14: PM128A,
    Xmm15: PM128A,
}}
UNION!{union KNONVOLATILE_CONTEXT_POINTERS_u1 {
    [u64; 16],
    FloatingContext FloatingContext_mut: [PM128A; 16],
    s s_mut: KNONVOLATILE_CONTEXT_POINTERS_u1_s,
}}
STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS_u2_s {
    Rax: PDWORD64,
    Rcx: PDWORD64,
    Rdx: PDWORD64,
    Rbx: PDWORD64,
    Rsp: PDWORD64,
    Rbp: PDWORD64,
    Rsi: PDWORD64,
    Rdi: PDWORD64,
    R8: PDWORD64,
    R9: PDWORD64,
    R10: PDWORD64,
    R11: PDWORD64,
    R12: PDWORD64,
    R13: PDWORD64,
    R14: PDWORD64,
    R15: PDWORD64,
}}
UNION!{union KNONVOLATILE_CONTEXT_POINTERS_u2 {
    [u64; 16],
    IntegerContext IntegerContext_mut: [PDWORD64; 16],
    s s_mut: KNONVOLATILE_CONTEXT_POINTERS_u2_s,
}}
STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS {
    u1: KNONVOLATILE_CONTEXT_POINTERS_u1,
    u2: KNONVOLATILE_CONTEXT_POINTERS_u2,
}}
pub type PKNONVOLATILE_CONTEXT_POINTERS = *mut KNONVOLATILE_CONTEXT_POINTERS;
} // IFDEF(x86_64)
#[cfg(target_arch = "x86")]
IFDEF!{
pub const EXCEPTION_READ_FAULT: DWORD = 0;
pub const EXCEPTION_WRITE_FAULT: DWORD = 1;
pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8;
pub const SIZE_OF_80387_REGISTERS: usize = 80;
pub const CONTEXT_i386: DWORD = 0x00010000;
pub const CONTEXT_i486: DWORD = 0x00010000;
pub const CONTEXT_CONTROL: DWORD = CONTEXT_i386 | 0x00000001;
pub const CONTEXT_INTEGER: DWORD = CONTEXT_i386 | 0x00000002;
pub const CONTEXT_SEGMENTS: DWORD = CONTEXT_i386 | 0x00000004;
pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_i386 | 0x00000008;
pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_i386 | 0x00000010;
pub const CONTEXT_EXTENDED_REGISTERS: DWORD = CONTEXT_i386 | 0x00000020;
pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS;
pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS
    | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS;
pub const CONTEXT_XSTATE: DWORD = CONTEXT_i386 | 0x00000040;
pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000;
pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000;
pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000;
pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000;
STRUCT!{struct FLOATING_SAVE_AREA {
    ControlWord: DWORD,
    StatusWord: DWORD,
    TagWord: DWORD,
    ErrorOffset: DWORD,
    ErrorSelector: DWORD,
    DataOffset: DWORD,
    DataSelector: DWORD,
    RegisterArea: [BYTE; SIZE_OF_80387_REGISTERS],
    Spare0: DWORD,
}}
pub type PFLOATING_SAVE_AREA = *mut FLOATING_SAVE_AREA;
pub const MAXIMUM_SUPPORTED_EXTENSION: usize = 512;
STRUCT!{struct CONTEXT {
    ContextFlags: DWORD,
    Dr0: DWORD,
    Dr1: DWORD,
    Dr2: DWORD,
    Dr3: DWORD,
    Dr6: DWORD,
    Dr7: DWORD,
    FloatSave: FLOATING_SAVE_AREA,
    SegGs: DWORD,
    SegFs: DWORD,
    SegEs: DWORD,
    SegDs: DWORD,
    Edi: DWORD,
    Esi: DWORD,
    Ebx: DWORD,
    Edx: DWORD,
    Ecx: DWORD,
    Eax: DWORD,
    Ebp: DWORD,
    Eip: DWORD,
    SegCs: DWORD,
    EFlags: DWORD,
    Esp: DWORD,
    SegSs: DWORD,
    ExtendedRegisters: [BYTE; MAXIMUM_SUPPORTED_EXTENSION],
}}
pub type PCONTEXT = *mut CONTEXT;
} // IFDEF(x86)
STRUCT!{struct LDT_ENTRY_Bytes {
    BaseMid: BYTE,
    Flags1: BYTE,
    Flags2: BYTE,
    BaseHi: BYTE,
}}
STRUCT!{struct LDT_ENTRY_Bits {
    Bitfield: DWORD,
}}
BITFIELD!{LDT_ENTRY_Bits Bitfield: DWORD [
    BaseMid set_BaseMid[0..8],
    Type set_Type[8..13],
    Dpl set_Dpl[13..15],
    Pres set_Pres[15..16],
    LimitHi set_LimitHi[16..20],
    Sys set_Sys[20..21],
    Reserved_0 set_Reserved_0[21..22],
    Default_Big set_Default_Big[22..23],
    Granularity set_Granularity[23..24],
    BaseHi set_BaseHi[24..32],
]}
UNION!{union LDT_ENTRY_HighWord {
    [u32; 1],
    Bytes Bytes_mut: LDT_ENTRY_Bytes,
    Bits Bits_mut: LDT_ENTRY_Bits,
}}
STRUCT!{struct LDT_ENTRY {
    LimitLow: WORD,
    BaseLow: WORD,
    HighWord: LDT_ENTRY_HighWord,
}}
pub type PLDT_ENTRY = *mut LDT_ENTRY;
#[cfg(target_arch = "aarch64")]
IFDEF!{
pub const ARM64_MAX_BREAKPOINTS: usize = 8;
pub const ARM64_MAX_WATCHPOINTS: usize = 2;
pub const EXCEPTION_READ_FAULT: DWORD = 0;
pub const EXCEPTION_WRITE_FAULT: DWORD = 1;
pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8;
pub const CONTEXT_ARM64: DWORD = 0x00400000;
pub const CONTEXT_CONTROL: DWORD = CONTEXT_ARM64 | 0x00000001;
pub const CONTEXT_INTEGER: DWORD = CONTEXT_ARM64 | 0x00000002;
pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_ARM64 | 0x00000004;
pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_ARM64 | 0x00000008;
pub const CONTEXT_X18: DWORD = CONTEXT_ARM64 | 0x00000010;
pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT;
pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT
        | CONTEXT_DEBUG_REGISTERS | CONTEXT_X18;
pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000;
pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000;
pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000;
pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000;
STRUCT!{struct CONTEXT_u_s {
    X0: DWORD64,
    X1: DWORD64,
    X2: DWORD64,
    X3: DWORD64,
    X4: DWORD64,
    X5: DWORD64,
    X6: DWORD64,
    X7: DWORD64,
    X8: DWORD64,
    X9: DWORD64,
    X10: DWORD64,
    X11: DWORD64,
    X12: DWORD64,
    X13: DWORD64,
    X14: DWORD64,
    X15: DWORD64,
    X16: DWORD64,
    X17: DWORD64,
    X18: DWORD64,
    X19: DWORD64,
    X20: DWORD64,
    X21: DWORD64,
    X22: DWORD64,
    X23: DWORD64,
    X24: DWORD64,
    X25: DWORD64,
    X26: DWORD64,
    X27: DWORD64,
    X28: DWORD64,
    Fp: DWORD64,
    Lr: DWORD64,
}}
UNION!{union CONTEXT_u {
    [u64; 31],
    s s_mut: CONTEXT_u_s,
}}
STRUCT!{struct ARM64_NT_NEON128_s {
    Low: ULONGLONG,
    High: LONGLONG,
}}
UNION!{union ARM64_NT_NEON128 {
    [u64; 2],
    s s_mut: ARM64_NT_NEON128_s,
    D D_mut: [f64; 2],
    S S_mut: [f32; 4],
    H H_mut: [WORD; 8],
    B B_mut: [BYTE; 16],
}}
STRUCT!{struct CONTEXT { // FIXME align 16
    ContextFlags: DWORD,
    Cpsr: DWORD,
    u: CONTEXT_u,
    Sp: DWORD64,
    Pc: DWORD64,
    V: [ARM64_NT_NEON128; 32],
    Fpcr: DWORD,
    Fpsr: DWORD,
    Bcr: [DWORD; ARM64_MAX_BREAKPOINTS],
    Bvr: [DWORD64; ARM64_MAX_BREAKPOINTS],
    Wcr: [DWORD; ARM64_MAX_WATCHPOINTS],
    Wvr: [DWORD64; ARM64_MAX_WATCHPOINTS],
}}
pub type PCONTEXT = *mut CONTEXT;
pub type RUNTIME_FUNCTION = IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type PRUNTIME_FUNCTION = *mut IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type SCOPE_TABLE = SCOPE_TABLE_ARM64;
pub type PSCOPE_TABLE = *mut SCOPE_TABLE_ARM64;
pub const RUNTIME_FUNCTION_INDIRECT: DWORD = 0x1;
pub const UNW_FLAG_NHANDLER: DWORD = 0x0;
pub const UNW_FLAG_EHANDLER: DWORD = 0x1;
pub const UNW_FLAG_UHANDLER: DWORD = 0x2;
pub const UNWIND_HISTORY_TABLE_SIZE: usize = 12;
STRUCT!{struct UNWIND_HISTORY_TABLE_ENTRY {
    ImageBase: DWORD64,
    FunctionEntry: PRUNTIME_FUNCTION,
}}
pub type PUNWIND_HISTORY_TABLE_ENTRY = *mut UNWIND_HISTORY_TABLE_ENTRY;
STRUCT!{struct UNWIND_HISTORY_TABLE {
    Count: DWORD,
    LocalHint: BYTE,
    GlobalHint: BYTE,
    Search: BYTE,
    Once: BYTE,
    LowAddress: DWORD64,
    HighAddress: DWORD64,
    Entry: [UNWIND_HISTORY_TABLE_ENTRY; UNWIND_HISTORY_TABLE_SIZE],
}}
pub type PUNWIND_HISTORY_TABLE = *mut UNWIND_HISTORY_TABLE;
FN!{cdecl PGET_RUNTIME_FUNCTION_CALLBACK(
    ControlPc: DWORD64,
    Context: PVOID,
) -> PRUNTIME_FUNCTION}
FN!{cdecl POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK(
    Process: HANDLE,
    TableAddress: PVOID,
    Entries: PDWORD,
    Functions: *mut PRUNTIME_FUNCTION,
) -> DWORD}
pub const OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME: &'static str
    = "OutOfProcessFunctionTableCallback";
STRUCT!{struct DISPATCHER_CONTEXT {
    ControlPc: ULONG_PTR,
    ImageBase: ULONG_PTR,
    FunctionEntry: PRUNTIME_FUNCTION,
    EstablisherFrame: ULONG_PTR,
    TargetPc: ULONG_PTR,
    ContextRecord: PCONTEXT,
    LanguageHandler: PEXCEPTION_ROUTINE,
    HandlerData: PVOID,
    HistoryTable: PUNWIND_HISTORY_TABLE,
    ScopeIndex: DWORD,
    ControlPcIsUnwound: BOOLEAN,
    NonVolatileRegisters: PBYTE,
}}
pub type PDISPATCHER_CONTEXT = *mut DISPATCHER_CONTEXT;
FN!{cdecl PEXCEPTION_FILTER(
    ExceptionPointers: *mut EXCEPTION_POINTERS,
    EstablisherFrame: DWORD64,
) -> LONG}
FN!{cdecl PTERMINATION_HANDLER(
    AbnormalTermination: BOOLEAN,
    EstablisherFrame: DWORD64,
) -> ()}
STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS {
    X19: PDWORD64,
    X20: PDWORD64,
    X21: PDWORD64,
    X22: PDWORD64,
    X23: PDWORD64,
    X24: PDWORD64,
    X25: PDWORD64,
    X26: PDWORD64,
    X27: PDWORD64,
    X28: PDWORD64,
    Fp: PDWORD64,
    Lr: PDWORD64,
    D8: PDWORD64,
    D9: PDWORD64,
    D10: PDWORD64,
    D11: PDWORD64,
    D12: PDWORD64,
    D13: PDWORD64,
    D14: PDWORD64,
    D15: PDWORD64,
}}
pub type PKNONVOLATILE_CONTEXT_POINTERS = *mut KNONVOLATILE_CONTEXT_POINTERS;
} // IFDEF(aarch64)
#[cfg(target_arch = "arm")]
IFDEF!{
pub const ARM_MAX_BREAKPOINTS: usize = 8;
pub const ARM_MAX_WATCHPOINTS: usize = 1;
STRUCT!{struct NEON128 {
    Low: ULONGLONG,
    High: LONGLONG,
}}
pub type PNEON128 = *mut NEON128;
UNION!{union CONTEXT_u {
    [u64; 32],
    Q Q_mut: [NEON128; 16],
    D D_mut: [ULONGLONG; 32],
    S S_mut: [DWORD; 32],
}}
STRUCT!{struct CONTEXT {
    ContextFlags: DWORD,
    R0: DWORD,
    R1: DWORD,
    R2: DWORD,
    R3: DWORD,
    R4: DWORD,
    R5: DWORD,
    R6: DWORD,
    R7: DWORD,
    R8: DWORD,
    R9: DWORD,
    R10: DWORD,
    R11: DWORD,
    R12: DWORD,
    Sp: DWORD,
    Lr: DWORD,
    Pc: DWORD,
    Cpsr: DWORD,
    Fpsrc: DWORD,
    Padding: DWORD,
    u: CONTEXT_u,
    Bvr: [DWORD; ARM_MAX_BREAKPOINTS],
    Bcr: [DWORD; ARM_MAX_BREAKPOINTS],
    Wvr: [DWORD; ARM_MAX_WATCHPOINTS],
    Wcr: [DWORD; ARM_MAX_WATCHPOINTS],
    Padding2: [DWORD; 2],
}}
pub type PCONTEXT = *mut CONTEXT;
} // IFDEF(arm)
pub const WOW64_CONTEXT_i386: DWORD = 0x00010000;
pub const WOW64_CONTEXT_i486: DWORD = 0x00010000;
pub const WOW64_CONTEXT_CONTROL: DWORD = WOW64_CONTEXT_i386 | 0x00000001;
pub const WOW64_CONTEXT_INTEGER: DWORD = WOW64_CONTEXT_i386 | 0x00000002;
pub const WOW64_CONTEXT_SEGMENTS: DWORD = WOW64_CONTEXT_i386 | 0x00000004;
pub const WOW64_CONTEXT_FLOATING_POINT: DWORD = WOW64_CONTEXT_i386 | 0x00000008;
pub const WOW64_CONTEXT_DEBUG_REGISTERS: DWORD = WOW64_CONTEXT_i386 | 0x00000010;
pub const WOW64_CONTEXT_EXTENDED_REGISTERS: DWORD = WOW64_CONTEXT_i386 | 0x00000020;
pub const WOW64_CONTEXT_FULL: DWORD = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER
    | WOW64_CONTEXT_SEGMENTS;
pub const WOW64_CONTEXT_ALL: DWORD = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER
    | WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | WOW64_CONTEXT_DEBUG_REGISTERS
    | WOW64_CONTEXT_EXTENDED_REGISTERS;
pub const WOW64_CONTEXT_XSTATE: DWORD = WOW64_CONTEXT_i386 | 0x00000040;
pub const WOW64_CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000;
pub const WOW64_CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000;
pub const WOW64_CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000;
pub const WOW64_CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000;
pub const WOW64_SIZE_OF_80387_REGISTERS: usize = 80;
pub const WOW64_MAXIMUM_SUPPORTED_EXTENSION: usize = 512;
STRUCT!{struct WOW64_FLOATING_SAVE_AREA {
    ControlWord: DWORD,
    StatusWord: DWORD,
    TagWord: DWORD,
    ErrorOffset: DWORD,
    ErrorSelector: DWORD,
    DataOffset: DWORD,
    DataSelector: DWORD,
    RegisterArea: [BYTE; WOW64_SIZE_OF_80387_REGISTERS],
    Cr0NpxState: DWORD,
}}
pub type PWOW64_FLOATING_SAVE_AREA = *mut WOW64_FLOATING_SAVE_AREA;
STRUCT!{struct WOW64_CONTEXT {
    ContextFlags: DWORD,
    Dr0: DWORD,
    Dr1: DWORD,
    Dr2: DWORD,
    Dr3: DWORD,
    Dr6: DWORD,
    Dr7: DWORD,
    FloatSave: WOW64_FLOATING_SAVE_AREA,
    SegGs: DWORD,
    SegFs: DWORD,
    SegEs: DWORD,
    SegDs: DWORD,
    Edi: DWORD,
    Esi: DWORD,
    Ebx: DWORD,
    Edx: DWORD,
    Ecx: DWORD,
    Eax: DWORD,
    Ebp: DWORD,
    Eip: DWORD,
    SegCs: DWORD,
    EFlags: DWORD,
    Esp: DWORD,
    SegSs: DWORD,
    ExtendedRegisters: [BYTE; WOW64_MAXIMUM_SUPPORTED_EXTENSION],
}}
pub type PWOW64_CONTEXT = *mut WOW64_CONTEXT;
STRUCT!{struct WOW64_LDT_ENTRY_Bytes {
    BaseMid: BYTE,
    Flags1: BYTE,
    Flags2: BYTE,
    BaseHi: BYTE,
}}
STRUCT!{struct WOW64_LDT_ENTRY_Bits {
    BitFields: DWORD,
}}
BITFIELD!{WOW64_LDT_ENTRY_Bits BitFields: DWORD [
    BaseMid set_BaseMid[0..8],
    Type set_Type[8..13],
    Dpl set_Dpl[13..15],
    Pres set_Pres[15..16],
    LimitHi set_LimitHi[16..20],
    Sys set_Sys[20..21],
    Reserved_0 set_Reserved_0[21..22],
    Default_Big set_Default_Big[22..23],
    Granularity set_Granularity[23..24],
    BaseHi set_BaseHi[24..32],
]}
UNION!{union WOW64_LDT_ENTRY_HighWord {
    [u32; 1],
    Bytes Bytes_mut: WOW64_LDT_ENTRY_Bytes,
    Bits Bits_mut: WOW64_LDT_ENTRY_Bits,
}}
STRUCT!{struct WOW64_LDT_ENTRY {
    LimitLow: WORD,
    BaseLow: WORD,
    HighWord: WOW64_LDT_ENTRY_HighWord,
}}
pub type PWOW64_LDT_ENTRY = *mut WOW64_LDT_ENTRY;
STRUCT!{struct WOW64_DESCRIPTOR_TABLE_ENTRY {
    Selector: DWORD,
    Descriptor: WOW64_LDT_ENTRY,
}}
pub type PWOW64_DESCRIPTOR_TABLE_ENTRY = *mut WOW64_DESCRIPTOR_TABLE_ENTRY;
pub const EXCEPTION_NONCONTINUABLE: DWORD = 0x1;
pub const EXCEPTION_UNWINDING: DWORD = 0x2;
pub const EXCEPTION_EXIT_UNWIND: DWORD = 0x4;
pub const EXCEPTION_STACK_INVALID: DWORD = 0x8;
pub const EXCEPTION_NESTED_CALL: DWORD = 0x10;
pub const EXCEPTION_TARGET_UNWIND: DWORD = 0x20;
pub const EXCEPTION_COLLIDED_UNWIND: DWORD = 0x40;
pub const EXCEPTION_UNWIND: DWORD = EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND
    | EXCEPTION_TARGET_UNWIND | EXCEPTION_COLLIDED_UNWIND;
#[inline]
pub fn IS_UNWINDING(Flag: DWORD) -> bool {
    (Flag & EXCEPTION_UNWIND) != 0
}
#[inline]
pub fn IS_DISPATCHING(Flag: DWORD) -> bool {
    (Flag & EXCEPTION_UNWIND) == 0
}
#[inline]
pub fn IS_TARGET_UNWIND(Flag: DWORD) -> bool {
    (Flag & EXCEPTION_TARGET_UNWIND) != 0
}
pub const EXCEPTION_MAXIMUM_PARAMETERS: usize = 15;
STRUCT!{struct EXCEPTION_RECORD {
    ExceptionCode: DWORD,
    ExceptionFlags: DWORD,
    ExceptionRecord: *mut EXCEPTION_RECORD,
    ExceptionAddress: PVOID,
    NumberParameters: DWORD,
    ExceptionInformation: [ULONG_PTR; EXCEPTION_MAXIMUM_PARAMETERS],
}}
pub type PEXCEPTION_RECORD = *mut EXCEPTION_RECORD;
STRUCT!{struct EXCEPTION_RECORD32 {
    ExceptionCode: DWORD,
    ExceptionFlags: DWORD,
    ExceptionRecord: DWORD,
    ExceptionAddress: DWORD,
    NumberParameters: DWORD,
    ExceptionInformation: [DWORD; EXCEPTION_MAXIMUM_PARAMETERS],
}}
pub type PEXCEPTION_RECORD32 = *mut EXCEPTION_RECORD32;
STRUCT!{struct EXCEPTION_RECORD64 {
    ExceptionCode: DWORD,
    ExceptionFlags: DWORD,
    ExceptionRecord: DWORD64,
    ExceptionAddress: DWORD64,
    NumberParameters: DWORD,
    __unusedAlignment: DWORD,
    ExceptionInformation: [DWORD64; EXCEPTION_MAXIMUM_PARAMETERS],
}}
pub type PEXCEPTION_RECORD64 = *mut EXCEPTION_RECORD64;
STRUCT!{struct EXCEPTION_POINTERS {
    ExceptionRecord: PEXCEPTION_RECORD,
    ContextRecord: PCONTEXT,
}}
pub type PEXCEPTION_POINTERS = *mut EXCEPTION_POINTERS;
pub type PACCESS_TOKEN = PVOID;
pub type PSECURITY_DESCRIPTOR = PVOID;
pub type PSID = PVOID;
pub type PCLAIMS_BLOB = PVOID;
pub type ACCESS_MASK = DWORD;
pub type PACCESS_MASK = *mut ACCESS_MASK;
pub const DELETE: DWORD = 0x00010000;
pub const READ_CONTROL: DWORD = 0x00020000;
pub const WRITE_DAC: DWORD = 0x00040000;
pub const WRITE_OWNER: DWORD = 0x00080000;
pub const SYNCHRONIZE: DWORD = 0x00100000;
pub const STANDARD_RIGHTS_REQUIRED: DWORD = 0x000F0000;
pub const STANDARD_RIGHTS_READ: DWORD = READ_CONTROL;
pub const STANDARD_RIGHTS_WRITE: DWORD = READ_CONTROL;
pub const STANDARD_RIGHTS_EXECUTE: DWORD = READ_CONTROL;
pub const STANDARD_RIGHTS_ALL: DWORD = 0x001F0000;
pub const SPECIFIC_RIGHTS_ALL: DWORD = 0x0000FFFF;
pub const ACCESS_SYSTEM_SECURITY: DWORD = 0x01000000;
pub const MAXIMUM_ALLOWED: DWORD = 0x02000000;
pub const GENERIC_READ: DWORD = 0x80000000;
pub const GENERIC_WRITE: DWORD = 0x40000000;
pub const GENERIC_EXECUTE: DWORD = 0x20000000;
pub const GENERIC_ALL: DWORD = 0x10000000;
STRUCT!{struct GENERIC_MAPPING {
    GenericRead: ACCESS_MASK,
    GenericWrite: ACCESS_MASK,
    GenericExecute: ACCESS_MASK,
    GenericAll: ACCESS_MASK,
}}
pub type PGENERIC_MAPPING = *mut GENERIC_MAPPING;
STRUCT!{struct LUID_AND_ATTRIBUTES {
    Luid: LUID,
    Attributes: DWORD,
}}
pub type PLUID_AND_ATTRIBUTES = *mut LUID_AND_ATTRIBUTES;
pub type LUID_AND_ATTRIBUTES_ARRAY = LUID_AND_ATTRIBUTES;
pub type PLUID_AND_ATTRIBUTES_ARRAY = *mut LUID_AND_ATTRIBUTES;
STRUCT!{struct SID_IDENTIFIER_AUTHORITY {
    Value: [BYTE; 6],
}}
pub type PSID_IDENTIFIER_AUTHORITY = *mut SID_IDENTIFIER_AUTHORITY;
STRUCT!{struct SID {
    Revision: BYTE,
    SubAuthorityCount: BYTE,
    IdentifierAuthority: SID_IDENTIFIER_AUTHORITY,
    SubAuthority: [DWORD; 1],
}}
pub type PISID = *mut SID;
pub const SID_REVISION: BYTE = 1;
pub const SID_MAX_SUB_AUTHORITIES: BYTE = 15;
pub const SID_RECOMMENDED_SUB_AUTHORITIES: BYTE = 1;
pub const SECURITY_MAX_SID_SIZE: usize = 12 - 4 + (SID_MAX_SUB_AUTHORITIES as usize * 4);
pub const SECURITY_MAX_SID_STRING_CHARACTERS: BYTE = 2 + 4 + 15 + (11 * SID_MAX_SUB_AUTHORITIES)
    + 1;
UNION!{union SE_SID {
    [u32; 17],
    Sid Sid_mut: SID,
    Buffer Buffer_mut: [BYTE; SECURITY_MAX_SID_SIZE],
}}
pub type PSE_SID = *mut SE_SID;
ENUM!{enum SID_NAME_USE {
    SidTypeUser = 1,
    SidTypeGroup,
    SidTypeDomain,
    SidTypeAlias,
    SidTypeWellKnownGroup,
    SidTypeDeletedAccount,
    SidTypeInvalid,
    SidTypeUnknown,
    SidTypeComputer,
    SidTypeLabel,
    SidTypeLogonSession,
}}
pub type PSID_NAME_USE = *mut SID_NAME_USE;
STRUCT!{struct SID_AND_ATTRIBUTES {
    Sid: PSID,
    Attributes: DWORD,
}}
pub type PSID_AND_ATTRIBUTES = *mut SID_AND_ATTRIBUTES;
pub type SID_AND_ATTRIBUTES_ARRAY = SID_AND_ATTRIBUTES;
pub type PSID_AND_ATTRIBUTES_ARRAY = *mut SID_AND_ATTRIBUTES;
pub const SID_HASH_SIZE: usize = 32;
pub type SID_HASH_ENTRY = ULONG_PTR;
pub type PSID_HASH_ENTRY = *mut ULONG_PTR;
STRUCT!{struct SID_AND_ATTRIBUTES_HASH {
    SidCount: DWORD,
    SidAttr: PSID_AND_ATTRIBUTES,
    Hash: [SID_HASH_ENTRY; SID_HASH_SIZE],
}}
pub type PSID_AND_ATTRIBUTES_HASH = *mut SID_AND_ATTRIBUTES_HASH;
pub const SECURITY_NULL_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 0];
pub const SECURITY_WORLD_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 1];
pub const SECURITY_LOCAL_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 2];
pub const SECURITY_CREATOR_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 3];
pub const SECURITY_NON_UNIQUE_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 4];
pub const SECURITY_RESOURCE_MANAGER_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 9];
pub const SECURITY_NULL_RID: DWORD = 0x00000000;
pub const SECURITY_WORLD_RID: DWORD = 0x00000000;
pub const SECURITY_LOCAL_RID: DWORD = 0x00000000;
pub const SECURITY_LOCAL_LOGON_RID: DWORD = 0x00000001;
pub const SECURITY_CREATOR_OWNER_RID: DWORD = 0x00000000;
pub const SECURITY_CREATOR_GROUP_RID: DWORD = 0x00000001;
pub const SECURITY_CREATOR_OWNER_SERVER_RID: DWORD = 0x00000002;
pub const SECURITY_CREATOR_GROUP_SERVER_RID: DWORD = 0x00000003;
pub const SECURITY_CREATOR_OWNER_RIGHTS_RID: DWORD = 0x00000004;
pub const SECURITY_NT_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 5];
pub const SECURITY_DIALUP_RID: DWORD = 0x00000001;
pub const SECURITY_NETWORK_RID: DWORD = 0x00000002;
pub const SECURITY_BATCH_RID: DWORD = 0x00000003;
pub const SECURITY_INTERACTIVE_RID: DWORD = 0x00000004;
pub const SECURITY_LOGON_IDS_RID: DWORD = 0x00000005;
pub const SECURITY_LOGON_IDS_RID_COUNT: DWORD = 3;
pub const SECURITY_SERVICE_RID: DWORD = 0x00000006;
pub const SECURITY_ANONYMOUS_LOGON_RID: DWORD = 0x00000007;
pub const SECURITY_PROXY_RID: DWORD = 0x00000008;
pub const SECURITY_ENTERPRISE_CONTROLLERS_RID: DWORD = 0x00000009;
pub const SECURITY_SERVER_LOGON_RID: DWORD = SECURITY_ENTERPRISE_CONTROLLERS_RID;
pub const SECURITY_PRINCIPAL_SELF_RID: DWORD = 0x0000000A;
pub const SECURITY_AUTHENTICATED_USER_RID: DWORD = 0x0000000B;
pub const SECURITY_RESTRICTED_CODE_RID: DWORD = 0x0000000C;
pub const SECURITY_TERMINAL_SERVER_RID: DWORD = 0x0000000D;
pub const SECURITY_REMOTE_LOGON_RID: DWORD = 0x0000000E;
pub const SECURITY_THIS_ORGANIZATION_RID: DWORD = 0x0000000F;
pub const SECURITY_IUSER_RID: DWORD = 0x00000011;
pub const SECURITY_LOCAL_SYSTEM_RID: DWORD = 0x00000012;
pub const SECURITY_LOCAL_SERVICE_RID: DWORD = 0x00000013;
pub const SECURITY_NETWORK_SERVICE_RID: DWORD = 0x00000014;
pub const SECURITY_NT_NON_UNIQUE: DWORD = 0x00000015;
pub const SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT: DWORD = 3;
pub const SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID: DWORD = 0x00000016;
pub const SECURITY_BUILTIN_DOMAIN_RID: DWORD = 0x00000020;
pub const SECURITY_WRITE_RESTRICTED_CODE_RID: DWORD = 0x00000021;
pub const SECURITY_PACKAGE_BASE_RID: DWORD = 0x00000040;
pub const SECURITY_PACKAGE_RID_COUNT: DWORD = 2;
pub const SECURITY_PACKAGE_NTLM_RID: DWORD = 0x0000000A;
pub const SECURITY_PACKAGE_SCHANNEL_RID: DWORD = 0x0000000E;
pub const SECURITY_PACKAGE_DIGEST_RID: DWORD = 0x00000015;
pub const SECURITY_CRED_TYPE_BASE_RID: DWORD = 0x00000041;
pub const SECURITY_CRED_TYPE_RID_COUNT: DWORD = 2;
pub const SECURITY_CRED_TYPE_THIS_ORG_CERT_RID: DWORD = 0x00000001;
pub const SECURITY_MIN_BASE_RID: DWORD = 0x00000050;
pub const SECURITY_SERVICE_ID_BASE_RID: DWORD = 0x00000050;
pub const SECURITY_SERVICE_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_RESERVED_ID_BASE_RID: DWORD = 0x00000051;
pub const SECURITY_APPPOOL_ID_BASE_RID: DWORD = 0x00000052;
pub const SECURITY_APPPOOL_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_VIRTUALSERVER_ID_BASE_RID: DWORD = 0x00000053;
pub const SECURITY_VIRTUALSERVER_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_USERMODEDRIVERHOST_ID_BASE_RID: DWORD = 0x00000054;
pub const SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID: DWORD = 0x00000055;
pub const SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_WMIHOST_ID_BASE_RID: DWORD = 0x00000056;
pub const SECURITY_WMIHOST_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_TASK_ID_BASE_RID: DWORD = 0x00000057;
pub const SECURITY_NFS_ID_BASE_RID: DWORD = 0x00000058;
pub const SECURITY_COM_ID_BASE_RID: DWORD = 0x00000059;
pub const SECURITY_WINDOW_MANAGER_BASE_RID: DWORD = 0x0000005A;
pub const SECURITY_RDV_GFX_BASE_RID: DWORD = 0x0000005B;
pub const SECURITY_DASHOST_ID_BASE_RID: DWORD = 0x0000005C;
pub const SECURITY_DASHOST_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_USERMANAGER_ID_BASE_RID: DWORD = 0x0000005D;
pub const SECURITY_USERMANAGER_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_WINRM_ID_BASE_RID: DWORD = 0x0000005E;
pub const SECURITY_WINRM_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_CCG_ID_BASE_RID: DWORD = 0x0000005F;
pub const SECURITY_UMFD_BASE_RID: DWORD = 0x00000060;
pub const SECURITY_VIRTUALACCOUNT_ID_RID_COUNT: DWORD = 6;
pub const SECURITY_MAX_BASE_RID: DWORD = 0x0000006F;
pub const SECURITY_MAX_ALWAYS_FILTERED: DWORD = 0x000003E7;
pub const SECURITY_MIN_NEVER_FILTERED: DWORD = 0x000003E8;
pub const SECURITY_OTHER_ORGANIZATION_RID: DWORD = 0x000003E8;
pub const SECURITY_WINDOWSMOBILE_ID_BASE_RID: DWORD = 0x00000070;
pub const SECURITY_INSTALLER_GROUP_CAPABILITY_BASE: DWORD = 0x20;
pub const SECURITY_INSTALLER_GROUP_CAPABILITY_RID_COUNT: DWORD = 9;
pub const SECURITY_INSTALLER_CAPABILITY_RID_COUNT: DWORD = 10;
pub const SECURITY_LOCAL_ACCOUNT_RID: DWORD = 0x00000071;
pub const SECURITY_LOCAL_ACCOUNT_AND_ADMIN_RID: DWORD = 0x00000072;
pub const DOMAIN_GROUP_RID_AUTHORIZATION_DATA_IS_COMPOUNDED: DWORD = 0x000001F0;
pub const DOMAIN_GROUP_RID_AUTHORIZATION_DATA_CONTAINS_CLAIMS: DWORD = 0x000001F1;
pub const DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS: DWORD = 0x000001F2;
pub const FOREST_USER_RID_MAX: DWORD = 0x000001F3;
pub const DOMAIN_USER_RID_ADMIN: DWORD = 0x000001F4;
pub const DOMAIN_USER_RID_GUEST: DWORD = 0x000001F5;
pub const DOMAIN_USER_RID_KRBTGT: DWORD = 0x000001F6;
pub const DOMAIN_USER_RID_DEFAULT_ACCOUNT: DWORD = 0x000001F7;
pub const DOMAIN_USER_RID_MAX: DWORD = 0x000003E7;
pub const DOMAIN_GROUP_RID_ADMINS: DWORD = 0x00000200;
pub const DOMAIN_GROUP_RID_USERS: DWORD = 0x00000201;
pub const DOMAIN_GROUP_RID_GUESTS: DWORD = 0x00000202;
pub const DOMAIN_GROUP_RID_COMPUTERS: DWORD = 0x00000203;
pub const DOMAIN_GROUP_RID_CONTROLLERS: DWORD = 0x00000204;
pub const DOMAIN_GROUP_RID_CERT_ADMINS: DWORD = 0x00000205;
pub const DOMAIN_GROUP_RID_SCHEMA_ADMINS: DWORD = 0x00000206;
pub const DOMAIN_GROUP_RID_ENTERPRISE_ADMINS: DWORD = 0x00000207;
pub const DOMAIN_GROUP_RID_POLICY_ADMINS: DWORD = 0x00000208;
pub const DOMAIN_GROUP_RID_READONLY_CONTROLLERS: DWORD = 0x00000209;
pub const DOMAIN_GROUP_RID_CLONEABLE_CONTROLLERS: DWORD = 0x0000020A;
pub const DOMAIN_GROUP_RID_CDC_RESERVED: DWORD = 0x0000020C;
pub const DOMAIN_GROUP_RID_PROTECTED_USERS: DWORD = 0x0000020D;
pub const DOMAIN_GROUP_RID_KEY_ADMINS: DWORD = 0x0000020E;
pub const DOMAIN_GROUP_RID_ENTERPRISE_KEY_ADMINS: DWORD = 0x0000020F;
pub const DOMAIN_ALIAS_RID_ADMINS: DWORD = 0x00000220;
pub const DOMAIN_ALIAS_RID_USERS: DWORD = 0x00000221;
pub const DOMAIN_ALIAS_RID_GUESTS: DWORD = 0x00000222;
pub const DOMAIN_ALIAS_RID_POWER_USERS: DWORD = 0x00000223;
pub const DOMAIN_ALIAS_RID_ACCOUNT_OPS: DWORD = 0x00000224;
pub const DOMAIN_ALIAS_RID_SYSTEM_OPS: DWORD = 0x00000225;
pub const DOMAIN_ALIAS_RID_PRINT_OPS: DWORD = 0x00000226;
pub const DOMAIN_ALIAS_RID_BACKUP_OPS: DWORD = 0x00000227;
pub const DOMAIN_ALIAS_RID_REPLICATOR: DWORD = 0x00000228;
pub const DOMAIN_ALIAS_RID_RAS_SERVERS: DWORD = 0x00000229;
pub const DOMAIN_ALIAS_RID_PREW2KCOMPACCESS: DWORD = 0x0000022A;
pub const DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS: DWORD = 0x0000022B;
pub const DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS: DWORD = 0x0000022C;
pub const DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS: DWORD = 0x0000022D;
pub const DOMAIN_ALIAS_RID_MONITORING_USERS: DWORD = 0x0000022E;
pub const DOMAIN_ALIAS_RID_LOGGING_USERS: DWORD = 0x0000022F;
pub const DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS: DWORD = 0x00000230;
pub const DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS: DWORD = 0x00000231;
pub const DOMAIN_ALIAS_RID_DCOM_USERS: DWORD = 0x00000232;
pub const DOMAIN_ALIAS_RID_IUSERS: DWORD = 0x00000238;
pub const DOMAIN_ALIAS_RID_CRYPTO_OPERATORS: DWORD = 0x00000239;
pub const DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP: DWORD = 0x0000023B;
pub const DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP: DWORD = 0x0000023C;
pub const DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP: DWORD = 0x0000023D;
pub const DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP: DWORD = 0x0000023E;
pub const DOMAIN_ALIAS_RID_RDS_REMOTE_ACCESS_SERVERS: DWORD = 0x0000023F;
pub const DOMAIN_ALIAS_RID_RDS_ENDPOINT_SERVERS: DWORD = 0x00000240;
pub const DOMAIN_ALIAS_RID_RDS_MANAGEMENT_SERVERS: DWORD = 0x00000241;
pub const DOMAIN_ALIAS_RID_HYPER_V_ADMINS: DWORD = 0x00000242;
pub const DOMAIN_ALIAS_RID_ACCESS_CONTROL_ASSISTANCE_OPS: DWORD = 0x00000243;
pub const DOMAIN_ALIAS_RID_REMOTE_MANAGEMENT_USERS: DWORD = 0x00000244;
pub const DOMAIN_ALIAS_RID_DEFAULT_ACCOUNT: DWORD = 0x00000245;
pub const DOMAIN_ALIAS_RID_STORAGE_REPLICA_ADMINS: DWORD = 0x00000246;
pub const SECURITY_APP_PACKAGE_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 15];
pub const SECURITY_APP_PACKAGE_BASE_RID: DWORD = 0x00000002;
pub const SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT: DWORD = 2;
pub const SECURITY_APP_PACKAGE_RID_COUNT: DWORD = 8;
pub const SECURITY_CAPABILITY_BASE_RID: DWORD = 0x00000003;
pub const SECURITY_CAPABILITY_APP_RID: DWORD = 0x00000040;
pub const SECURITY_BUILTIN_CAPABILITY_RID_COUNT: DWORD = 2;
pub const SECURITY_CAPABILITY_RID_COUNT: DWORD = 5;
pub const SECURITY_PARENT_PACKAGE_RID_COUNT: DWORD = SECURITY_APP_PACKAGE_RID_COUNT;
pub const SECURITY_CHILD_PACKAGE_RID_COUNT: DWORD = 12;
pub const SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE: DWORD = 0x00000001;
pub const SECURITY_BUILTIN_PACKAGE_ANY_RESTRICTED_PACKAGE: DWORD = 0x00000002;
pub const SECURITY_CAPABILITY_INTERNET_CLIENT: DWORD = 0x00000001;
pub const SECURITY_CAPABILITY_INTERNET_CLIENT_SERVER: DWORD = 0x00000002;
pub const SECURITY_CAPABILITY_PRIVATE_NETWORK_CLIENT_SERVER: DWORD = 0x00000003;
pub const SECURITY_CAPABILITY_PICTURES_LIBRARY: DWORD = 0x00000004;
pub const SECURITY_CAPABILITY_VIDEOS_LIBRARY: DWORD = 0x00000005;
pub const SECURITY_CAPABILITY_MUSIC_LIBRARY: DWORD = 0x00000006;
pub const SECURITY_CAPABILITY_DOCUMENTS_LIBRARY: DWORD = 0x00000007;
pub const SECURITY_CAPABILITY_ENTERPRISE_AUTHENTICATION: DWORD = 0x00000008;
pub const SECURITY_CAPABILITY_SHARED_USER_CERTIFICATES: DWORD = 0x00000009;
pub const SECURITY_CAPABILITY_REMOVABLE_STORAGE: DWORD = 0x0000000A;
pub const SECURITY_CAPABILITY_APPOINTMENTS: DWORD = 0x0000000B;
pub const SECURITY_CAPABILITY_CONTACTS: DWORD = 0x0000000C;
pub const SECURITY_CAPABILITY_INTERNET_EXPLORER: DWORD = 0x00001000;
pub const SECURITY_MANDATORY_LABEL_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 16];
pub const SECURITY_MANDATORY_UNTRUSTED_RID: DWORD = 0x00000000;
pub const SECURITY_MANDATORY_LOW_RID: DWORD = 0x00001000;
pub const SECURITY_MANDATORY_MEDIUM_RID: DWORD = 0x00002000;
pub const SECURITY_MANDATORY_MEDIUM_PLUS_RID: DWORD = SECURITY_MANDATORY_MEDIUM_RID + 0x10;
pub const SECURITY_MANDATORY_HIGH_RID: DWORD = 0x00003000;
pub const SECURITY_MANDATORY_SYSTEM_RID: DWORD = 0x00004000;
pub const SECURITY_MANDATORY_MAXIMUM_USER_RID: DWORD = SECURITY_MANDATORY_SYSTEM_RID;
#[inline]
pub fn MANDATORY_LEVEL_TO_MANDATORY_RID(IL: DWORD) -> DWORD {
    IL * 0x1000
}
pub const SECURITY_SCOPED_POLICY_ID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 17];
pub const SECURITY_AUTHENTICATION_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 18];
pub const SECURITY_AUTHENTICATION_AUTHORITY_RID_COUNT: DWORD = 1;
pub const SECURITY_AUTHENTICATION_AUTHORITY_ASSERTED_RID: DWORD = 0x00000001;
pub const SECURITY_AUTHENTICATION_SERVICE_ASSERTED_RID: DWORD = 0x00000002;
pub const SECURITY_AUTHENTICATION_FRESH_KEY_AUTH_RID: DWORD = 0x00000003;
pub const SECURITY_AUTHENTICATION_KEY_TRUST_RID: DWORD = 0x00000004;
pub const SECURITY_AUTHENTICATION_KEY_PROPERTY_MFA_RID: DWORD = 0x00000005;
pub const SECURITY_AUTHENTICATION_KEY_PROPERTY_ATTESTATION_RID: DWORD = 0x00000006;
pub const SECURITY_PROCESS_TRUST_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 19];
pub const SECURITY_PROCESS_TRUST_AUTHORITY_RID_COUNT: DWORD = 2;
pub const SECURITY_PROCESS_PROTECTION_TYPE_FULL_RID: DWORD = 0x00000400;
pub const SECURITY_PROCESS_PROTECTION_TYPE_LITE_RID: DWORD = 0x00000200;
pub const SECURITY_PROCESS_PROTECTION_TYPE_NONE_RID: DWORD = 0x00000000;
pub const SECURITY_PROCESS_PROTECTION_LEVEL_WINTCB_RID: DWORD = 0x00002000;
pub const SECURITY_PROCESS_PROTECTION_LEVEL_WINDOWS_RID: DWORD = 0x00001000;
pub const SECURITY_PROCESS_PROTECTION_LEVEL_APP_RID: DWORD = 0x00000800;
pub const SECURITY_PROCESS_PROTECTION_LEVEL_NONE_RID: DWORD = 0x00000000;
pub const SECURITY_TRUSTED_INSTALLER_RID1: DWORD = 95600888;
pub const SECURITY_TRUSTED_INSTALLER_RID2: DWORD = 341852264;
pub const SECURITY_TRUSTED_INSTALLER_RID3: DWORD = 183103804;
pub const SECURITY_TRUSTED_INSTALLER_RID4: DWORD = 185329263;
pub const SECURITY_TRUSTED_INSTALLER_RID5: DWORD = 227147846;
ENUM!{enum WELL_KNOWN_SID_TYPE {
    WinNullSid = 0,
    WinWorldSid = 1,
    WinLocalSid = 2,
    WinCreatorOwnerSid = 3,
    WinCreatorGroupSid = 4,
    WinCreatorOwnerServerSid = 5,
    WinCreatorGroupServerSid = 6,
    WinNtAuthoritySid = 7,
    WinDialupSid = 8,
    WinNetworkSid = 9,
    WinBatchSid = 10,
    WinInteractiveSid = 11,
    WinServiceSid = 12,
    WinAnonymousSid = 13,
    WinProxySid = 14,
    WinEnterpriseControllersSid = 15,
    WinSelfSid = 16,
    WinAuthenticatedUserSid = 17,
    WinRestrictedCodeSid = 18,
    WinTerminalServerSid = 19,
    WinRemoteLogonIdSid = 20,
    WinLogonIdsSid = 21,
    WinLocalSystemSid = 22,
    WinLocalServiceSid = 23,
    WinNetworkServiceSid = 24,
    WinBuiltinDomainSid = 25,
    WinBuiltinAdministratorsSid = 26,
    WinBuiltinUsersSid = 27,
    WinBuiltinGuestsSid = 28,
    WinBuiltinPowerUsersSid = 29,
    WinBuiltinAccountOperatorsSid = 30,
    WinBuiltinSystemOperatorsSid = 31,
    WinBuiltinPrintOperatorsSid = 32,
    WinBuiltinBackupOperatorsSid = 33,
    WinBuiltinReplicatorSid = 34,
    WinBuiltinPreWindows2000CompatibleAccessSid = 35,
    WinBuiltinRemoteDesktopUsersSid = 36,
    WinBuiltinNetworkConfigurationOperatorsSid = 37,
    WinAccountAdministratorSid = 38,
    WinAccountGuestSid = 39,
    WinAccountKrbtgtSid = 40,
    WinAccountDomainAdminsSid = 41,
    WinAccountDomainUsersSid = 42,
    WinAccountDomainGuestsSid = 43,
    WinAccountComputersSid = 44,
    WinAccountControllersSid = 45,
    WinAccountCertAdminsSid = 46,
    WinAccountSchemaAdminsSid = 47,
    WinAccountEnterpriseAdminsSid = 48,
    WinAccountPolicyAdminsSid = 49,
    WinAccountRasAndIasServersSid = 50,
    WinNTLMAuthenticationSid = 51,
    WinDigestAuthenticationSid = 52,
    WinSChannelAuthenticationSid = 53,
    WinThisOrganizationSid = 54,
    WinOtherOrganizationSid = 55,
    WinBuiltinIncomingForestTrustBuildersSid = 56,
    WinBuiltinPerfMonitoringUsersSid = 57,
    WinBuiltinPerfLoggingUsersSid = 58,
    WinBuiltinAuthorizationAccessSid = 59,
    WinBuiltinTerminalServerLicenseServersSid = 60,
    WinBuiltinDCOMUsersSid = 61,
    WinBuiltinIUsersSid = 62,
    WinIUserSid = 63,
    WinBuiltinCryptoOperatorsSid = 64,
    WinUntrustedLabelSid = 65,
    WinLowLabelSid = 66,
    WinMediumLabelSid = 67,
    WinHighLabelSid = 68,
    WinSystemLabelSid = 69,
    WinWriteRestrictedCodeSid = 70,
    WinCreatorOwnerRightsSid = 71,
    WinCacheablePrincipalsGroupSid = 72,
    WinNonCacheablePrincipalsGroupSid = 73,
    WinEnterpriseReadonlyControllersSid = 74,
    WinAccountReadonlyControllersSid = 75,
    WinBuiltinEventLogReadersGroup = 76,
    WinNewEnterpriseReadonlyControllersSid = 77,
    WinBuiltinCertSvcDComAccessGroup = 78,
    WinMediumPlusLabelSid = 79,
    WinLocalLogonSid = 80,
    WinConsoleLogonSid = 81,
    WinThisOrganizationCertificateSid = 82,
    WinApplicationPackageAuthoritySid = 83,
    WinBuiltinAnyPackageSid = 84,
    WinCapabilityInternetClientSid = 85,
    WinCapabilityInternetClientServerSid = 86,
    WinCapabilityPrivateNetworkClientServerSid = 87,
    WinCapabilityPicturesLibrarySid = 88,
    WinCapabilityVideosLibrarySid = 89,
    WinCapabilityMusicLibrarySid = 90,
    WinCapabilityDocumentsLibrarySid = 91,
    WinCapabilitySharedUserCertificatesSid = 92,
    WinCapabilityEnterpriseAuthenticationSid = 93,
    WinCapabilityRemovableStorageSid = 94,
    WinBuiltinRDSRemoteAccessServersSid = 95,
    WinBuiltinRDSEndpointServersSid = 96,
    WinBuiltinRDSManagementServersSid = 97,
    WinUserModeDriversSid = 98,
    WinBuiltinHyperVAdminsSid = 99,
    WinAccountCloneableControllersSid = 100,
    WinBuiltinAccessControlAssistanceOperatorsSid = 101,
    WinBuiltinRemoteManagementUsersSid = 102,
    WinAuthenticationAuthorityAssertedSid = 103,
    WinAuthenticationServiceAssertedSid = 104,
    WinLocalAccountSid = 105,
    WinLocalAccountAndAdministratorSid = 106,
    WinAccountProtectedUsersSid = 107,
    WinCapabilityAppointmentsSid = 108,
    WinCapabilityContactsSid = 109,
    WinAccountDefaultSystemManagedSid = 110,
    WinBuiltinDefaultSystemManagedGroupSid = 111,
    WinBuiltinStorageReplicaAdminsSid = 112,
    WinAccountKeyAdminsSid = 113,
    WinAccountEnterpriseKeyAdminsSid = 114,
    WinAuthenticationKeyTrustSid = 115,
    WinAuthenticationKeyPropertyMFASid = 116,
    WinAuthenticationKeyPropertyAttestationSid = 117,
    WinAuthenticationFreshKeyAuthSid = 118,
}}
pub const SYSTEM_LUID: LUID = LUID { LowPart: 0x3e7, HighPart: 0x0 };
pub const ANONYMOUS_LOGON_LUID: LUID = LUID { LowPart: 0x3e6, HighPart: 0x0 };
pub const LOCALSERVICE_LUID: LUID = LUID { LowPart: 0x3e5, HighPart: 0x0 };
pub const NETWORKSERVICE_LUID: LUID = LUID { LowPart: 0x3e4, HighPart: 0x0 };
pub const IUSER_LUID: LUID = LUID { LowPart: 0x3e3, HighPart: 0x0 };
pub const SE_GROUP_MANDATORY: DWORD = 0x00000001;
pub const SE_GROUP_ENABLED_BY_DEFAULT: DWORD = 0x00000002;
pub const SE_GROUP_ENABLED: DWORD = 0x00000004;
pub const SE_GROUP_OWNER: DWORD = 0x00000008;
pub const SE_GROUP_USE_FOR_DENY_ONLY: DWORD = 0x00000010;
pub const SE_GROUP_INTEGRITY: DWORD = 0x00000020;
pub const SE_GROUP_INTEGRITY_ENABLED: DWORD = 0x00000040;
pub const SE_GROUP_LOGON_ID: DWORD = 0xC0000000;
pub const SE_GROUP_RESOURCE: DWORD = 0x20000000;
pub const SE_GROUP_VALID_ATTRIBUTES: DWORD = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT
    | SE_GROUP_ENABLED | SE_GROUP_OWNER | SE_GROUP_USE_FOR_DENY_ONLY | SE_GROUP_LOGON_ID
    | SE_GROUP_RESOURCE | SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED;
pub const ACL_REVISION: BYTE = 2;
pub const ACL_REVISION_DS: BYTE = 4;
pub const ACL_REVISION1: BYTE = 1;
pub const MIN_ACL_REVISION: BYTE = ACL_REVISION2;
pub const ACL_REVISION2: BYTE = 2;
pub const ACL_REVISION3: BYTE = 3;
pub const ACL_REVISION4: BYTE = 4;
pub const MAX_ACL_REVISION: BYTE = ACL_REVISION4;
STRUCT!{struct ACL {
    AclRevision: BYTE,
    Sbz1: BYTE,
    AclSize: WORD,
    AceCount: WORD,
    Sbz2: WORD,
}}
pub type PACL = *mut ACL;
STRUCT!{struct ACE_HEADER {
    AceType: BYTE,
    AceFlags: BYTE,
    AceSize: WORD,
}}
pub type PACE_HEADER = *mut ACE_HEADER;
pub const ACCESS_MIN_MS_ACE_TYPE: BYTE = 0x0;
pub const ACCESS_ALLOWED_ACE_TYPE: BYTE = 0x0;
pub const ACCESS_DENIED_ACE_TYPE: BYTE = 0x1;
pub const SYSTEM_AUDIT_ACE_TYPE: BYTE = 0x2;
pub const SYSTEM_ALARM_ACE_TYPE: BYTE = 0x3;
pub const ACCESS_MAX_MS_V2_ACE_TYPE: BYTE = 0x3;
pub const ACCESS_ALLOWED_COMPOUND_ACE_TYPE: BYTE = 0x4;
pub const ACCESS_MAX_MS_V3_ACE_TYPE: BYTE = 0x4;
pub const ACCESS_MIN_MS_OBJECT_ACE_TYPE: BYTE = 0x5;
pub const ACCESS_ALLOWED_OBJECT_ACE_TYPE: BYTE = 0x5;
pub const ACCESS_DENIED_OBJECT_ACE_TYPE: BYTE = 0x6;
pub const SYSTEM_AUDIT_OBJECT_ACE_TYPE: BYTE = 0x7;
pub const SYSTEM_ALARM_OBJECT_ACE_TYPE: BYTE = 0x8;
pub const ACCESS_MAX_MS_OBJECT_ACE_TYPE: BYTE = 0x8;
pub const ACCESS_MAX_MS_V4_ACE_TYPE: BYTE = 0x8;
pub const ACCESS_MAX_MS_ACE_TYPE: BYTE = 0x8;
pub const ACCESS_ALLOWED_CALLBACK_ACE_TYPE: BYTE = 0x9;
pub const ACCESS_DENIED_CALLBACK_ACE_TYPE: BYTE = 0xA;
pub const ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xB;
pub const ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xC;
pub const SYSTEM_AUDIT_CALLBACK_ACE_TYPE: BYTE = 0xD;
pub const SYSTEM_ALARM_CALLBACK_ACE_TYPE: BYTE = 0xE;
pub const SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xF;
pub const SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0x10;
pub const SYSTEM_MANDATORY_LABEL_ACE_TYPE: BYTE = 0x11;
pub const SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE: BYTE = 0x12;
pub const SYSTEM_SCOPED_POLICY_ID_ACE_TYPE: BYTE = 0x13;
pub const SYSTEM_PROCESS_TRUST_LABEL_ACE_TYPE: BYTE = 0x14;
pub const SYSTEM_ACCESS_FILTER_ACE_TYPE: BYTE = 0x15;
pub const ACCESS_MAX_MS_V5_ACE_TYPE: BYTE = 0x15;
pub const OBJECT_INHERIT_ACE: BYTE = 0x1;
pub const CONTAINER_INHERIT_ACE: BYTE = 0x2;
pub const NO_PROPAGATE_INHERIT_ACE: BYTE = 0x4;
pub const INHERIT_ONLY_ACE: BYTE = 0x8;
pub const INHERITED_ACE: BYTE = 0x10;
pub const VALID_INHERIT_FLAGS: BYTE = 0x1F;
pub const SUCCESSFUL_ACCESS_ACE_FLAG: BYTE = 0x40;
pub const FAILED_ACCESS_ACE_FLAG: BYTE = 0x80;
pub const TRUST_PROTECTED_FILTER_ACE_FLAG: BYTE = 0x40;
STRUCT!{struct ACCESS_ALLOWED_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PACCESS_ALLOWED_ACE = *mut ACCESS_ALLOWED_ACE;
STRUCT!{struct ACCESS_DENIED_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PACCESS_DENIED_ACE = *mut ACCESS_DENIED_ACE;
STRUCT!{struct SYSTEM_AUDIT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_AUDIT_ACE = *mut SYSTEM_AUDIT_ACE;
STRUCT!{struct SYSTEM_ALARM_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_ALARM_ACE = *mut SYSTEM_ALARM_ACE;
STRUCT!{struct SYSTEM_RESOURCE_ATTRIBUTE_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_RESOURCE_ATTRIBUTE_ACE = *mut SYSTEM_RESOURCE_ATTRIBUTE_ACE;
STRUCT!{struct SYSTEM_SCOPED_POLICY_ID_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_SCOPED_POLICY_ID_ACE = *mut SYSTEM_SCOPED_POLICY_ID_ACE;
STRUCT!{struct SYSTEM_MANDATORY_LABEL_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_MANDATORY_LABEL_ACE = *mut SYSTEM_MANDATORY_LABEL_ACE;
STRUCT!{struct SYSTEM_PROCESS_TRUST_LABEL_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_PROCESS_TRUST_LABEL_ACE = *mut SYSTEM_PROCESS_TRUST_LABEL_ACE;
STRUCT!{struct SYSTEM_ACCESS_FILTER_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_ACCESS_FILTER_ACE = *mut SYSTEM_ACCESS_FILTER_ACE;
pub const SYSTEM_MANDATORY_LABEL_NO_WRITE_UP: ACCESS_MASK = 0x1;
pub const SYSTEM_MANDATORY_LABEL_NO_READ_UP: ACCESS_MASK = 0x2;
pub const SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP: ACCESS_MASK = 0x4;
pub const SYSTEM_MANDATORY_LABEL_VALID_MASK: ACCESS_MASK = SYSTEM_MANDATORY_LABEL_NO_WRITE_UP
    | SYSTEM_MANDATORY_LABEL_NO_READ_UP | SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP;
pub const SYSTEM_PROCESS_TRUST_LABEL_VALID_MASK: ACCESS_MASK = 0x00ffffff;
pub const SYSTEM_PROCESS_TRUST_NOCONSTRAINT_MASK: ACCESS_MASK = 0xffffffff;
pub const SYSTEM_ACCESS_FILTER_VALID_MASK: ACCESS_MASK = 0x00ffffff;
pub const SYSTEM_ACCESS_FILTER_NOCONSTRAINT_MASK: ACCESS_MASK = 0xffffffff;
STRUCT!{struct ACCESS_ALLOWED_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PACCESS_ALLOWED_OBJECT_ACE = *mut ACCESS_ALLOWED_OBJECT_ACE;
STRUCT!{struct ACCESS_DENIED_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PACCESS_DENIED_OBJECT_ACE = *mut ACCESS_DENIED_OBJECT_ACE;
STRUCT!{struct SYSTEM_AUDIT_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PSYSTEM_AUDIT_OBJECT_ACE = *mut SYSTEM_AUDIT_OBJECT_ACE;
STRUCT!{struct SYSTEM_ALARM_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PSYSTEM_ALARM_OBJECT_ACE = *mut SYSTEM_ALARM_OBJECT_ACE;
STRUCT!{struct ACCESS_ALLOWED_CALLBACK_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PACCESS_ALLOWED_CALLBACK_ACE = *mut ACCESS_ALLOWED_CALLBACK_ACE;
STRUCT!{struct ACCESS_DENIED_CALLBACK_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PACCESS_DENIED_CALLBACK_ACE = *mut ACCESS_DENIED_CALLBACK_ACE;
STRUCT!{struct SYSTEM_AUDIT_CALLBACK_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_AUDIT_CALLBACK_ACE = *mut SYSTEM_AUDIT_CALLBACK_ACE;
STRUCT!{struct SYSTEM_ALARM_CALLBACK_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    SidStart: DWORD,
}}
pub type PSYSTEM_ALARM_CALLBACK_ACE = *mut SYSTEM_ALARM_CALLBACK_ACE;
STRUCT!{struct ACCESS_ALLOWED_CALLBACK_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PACCESS_ALLOWED_CALLBACK_OBJECT_ACE = *mut ACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
STRUCT!{struct ACCESS_DENIED_CALLBACK_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PACCESS_DENIED_CALLBACK_OBJECT_ACE = *mut ACCESS_DENIED_CALLBACK_OBJECT_ACE;
STRUCT!{struct SYSTEM_AUDIT_CALLBACK_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE = *mut SYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
STRUCT!{struct SYSTEM_ALARM_CALLBACK_OBJECT_ACE {
    Header: ACE_HEADER,
    Mask: ACCESS_MASK,
    Flags: DWORD,
    ObjectType: GUID,
    InheritedObjectType: GUID,
    SidStart: DWORD,
}}
pub type PSYSTEM_ALARM_CALLBACK_OBJECT_ACE = *mut SYSTEM_ALARM_CALLBACK_OBJECT_ACE;
pub const ACE_OBJECT_TYPE_PRESENT: DWORD = 0x1;
pub const ACE_INHERITED_OBJECT_TYPE_PRESENT: DWORD = 0x2;
ENUM!{enum ACL_INFORMATION_CLASS {
    AclRevisionInformation = 1,
    AclSizeInformation,
}}
STRUCT!{struct ACL_REVISION_INFORMATION {
    AclRevision: DWORD,
}}
pub type PACL_REVISION_INFORMATION = *mut ACL_REVISION_INFORMATION;
STRUCT!{struct ACL_SIZE_INFORMATION {
    AceCount: DWORD,
    AclBytesInUse: DWORD,
    AclBytesFree: DWORD,
}}
pub type PACL_SIZE_INFORMATION = *mut ACL_SIZE_INFORMATION;
pub const SECURITY_DESCRIPTOR_REVISION: DWORD = 1;
pub const SECURITY_DESCRIPTOR_REVISION1: DWORD = 1;
#[cfg(target_pointer_width = "64")]
pub const SECURITY_DESCRIPTOR_MIN_LENGTH: usize = 40;
#[cfg(target_pointer_width = "32")]
pub const SECURITY_DESCRIPTOR_MIN_LENGTH: usize = 20;
pub type SECURITY_DESCRIPTOR_CONTROL = WORD;
pub type PSECURITY_DESCRIPTOR_CONTROL = *mut WORD;
pub const SE_OWNER_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0001;
pub const SE_GROUP_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0002;
pub const SE_DACL_PRESENT: SECURITY_DESCRIPTOR_CONTROL = 0x0004;
pub const SE_DACL_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0008;
pub const SE_SACL_PRESENT: SECURITY_DESCRIPTOR_CONTROL = 0x0010;
pub const SE_SACL_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0020;
pub const SE_DACL_AUTO_INHERIT_REQ: SECURITY_DESCRIPTOR_CONTROL = 0x0100;
pub const SE_SACL_AUTO_INHERIT_REQ: SECURITY_DESCRIPTOR_CONTROL = 0x0200;
pub const SE_DACL_AUTO_INHERITED: SECURITY_DESCRIPTOR_CONTROL = 0x0400;
pub const SE_SACL_AUTO_INHERITED: SECURITY_DESCRIPTOR_CONTROL = 0x0800;
pub const SE_DACL_PROTECTED: SECURITY_DESCRIPTOR_CONTROL = 0x1000;
pub const SE_SACL_PROTECTED: SECURITY_DESCRIPTOR_CONTROL = 0x2000;
pub const SE_RM_CONTROL_VALID: SECURITY_DESCRIPTOR_CONTROL = 0x4000;
pub const SE_SELF_RELATIVE: SECURITY_DESCRIPTOR_CONTROL = 0x8000;
STRUCT!{struct SECURITY_DESCRIPTOR_RELATIVE {
    Revision: BYTE,
    Sbz1: BYTE,
    Control: SECURITY_DESCRIPTOR_CONTROL,
    Owner: DWORD,
    Group: DWORD,
    Sacl: DWORD,
    Dacl: DWORD,
}}
pub type PISECURITY_DESCRIPTOR_RELATIVE = *mut SECURITY_DESCRIPTOR_RELATIVE;
STRUCT!{struct SECURITY_DESCRIPTOR {
    Revision: BYTE,
    Sbz1: BYTE,
    Control: SECURITY_DESCRIPTOR_CONTROL,
    Owner: PSID,
    Group: PSID,
    Sacl: PACL,
    Dacl: PACL,
}}
pub type PISECURITY_DESCRIPTOR = *mut SECURITY_DESCRIPTOR;
STRUCT!{struct SECURITY_OBJECT_AI_PARAMS {
    Size: DWORD,
    ConstraintMask: DWORD,
}}
pub type PSECURITY_OBJECT_AI_PARAMS = *mut SECURITY_OBJECT_AI_PARAMS;
STRUCT!{struct OBJECT_TYPE_LIST {
    Level: WORD,
    Sbz: WORD,
    ObjectType: *mut GUID,
}}
pub type POBJECT_TYPE_LIST = *mut OBJECT_TYPE_LIST;
pub const ACCESS_OBJECT_GUID: WORD = 0;
pub const ACCESS_PROPERTY_SET_GUID: WORD = 1;
pub const ACCESS_PROPERTY_GUID: WORD = 2;
pub const ACCESS_MAX_LEVEL: WORD = 4;
ENUM!{enum AUDIT_EVENT_TYPE {
    AuditEventObjectAccess,
    AuditEventDirectoryServiceAccess,
}}
pub const AUDIT_ALLOW_NO_PRIVILEGE: DWORD = 0x1;
pub const ACCESS_DS_SOURCE: &'static str = "DS";
pub const ACCESS_DS_OBJECT_TYPE_NAME: &'static str = "Directory Service Object";
pub const SE_PRIVILEGE_ENABLED_BY_DEFAULT: DWORD = 0x00000001;
pub const SE_PRIVILEGE_ENABLED: DWORD = 0x00000002;
pub const SE_PRIVILEGE_REMOVED: DWORD = 0x00000004;
pub const SE_PRIVILEGE_USED_FOR_ACCESS: DWORD = 0x80000000;
pub const SE_PRIVILEGE_VALID_ATTRIBUTES: DWORD = SE_PRIVILEGE_ENABLED_BY_DEFAULT
    | SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS;
pub const PRIVILEGE_SET_ALL_NECESSARY: DWORD = 1;
STRUCT!{struct PRIVILEGE_SET {
    PrivilegeCount: DWORD,
    Control: DWORD,
    Privilege: [LUID_AND_ATTRIBUTES; ANYSIZE_ARRAY],
}}
pub type PPRIVILEGE_SET = *mut PRIVILEGE_SET;
pub const ACCESS_REASON_TYPE_MASK: ACCESS_REASON = 0x00ff0000;
pub const ACCESS_REASON_DATA_MASK: ACCESS_REASON = 0x0000ffff;
pub const ACCESS_REASON_STAGING_MASK: ACCESS_REASON = 0x80000000;
pub const ACCESS_REASON_EXDATA_MASK: ACCESS_REASON = 0x7f000000;
ENUM!{enum ACCESS_REASON_TYPE {
    AccessReasonNone = 0x00000000,
    AccessReasonAllowedAce = 0x00010000,
    AccessReasonDeniedAce = 0x00020000,
    AccessReasonAllowedParentAce = 0x00030000,
    AccessReasonDeniedParentAce = 0x00040000,
    AccessReasonNotGrantedByCape = 0x00050000,
    AccessReasonNotGrantedByParentCape = 0x00060000,
    AccessReasonNotGrantedToAppContainer = 0x00070000,
    AccessReasonMissingPrivilege = 0x00100000,
    AccessReasonFromPrivilege = 0x00200000,
    AccessReasonIntegrityLevel = 0x00300000,
    AccessReasonOwnership = 0x00400000,
    AccessReasonNullDacl = 0x00500000,
    AccessReasonEmptyDacl = 0x00600000,
    AccessReasonNoSD = 0x00700000,
    AccessReasonNoGrant = 0x00800000,
    AccessReasonTrustLabel = 0x00900000,
    AccessReasonFilterAce = 0x00a00000,
}}
pub type ACCESS_REASON = DWORD;
STRUCT!{struct ACCESS_REASONS {
    Data: [ACCESS_REASON; 32],
}}
pub type PACCESS_REASONS = *mut ACCESS_REASONS;
pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE: DWORD = 0x00000001;
pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE: DWORD = 0x00000002;
pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_ACCESS_FILTER_ACE: DWORD = 0x00000004;
pub const SE_SECURITY_DESCRIPTOR_VALID_FLAGS: DWORD = 0x00000007;
STRUCT!{struct SE_SECURITY_DESCRIPTOR {
    Size: DWORD,
    Flags: DWORD,
    SecurityDescriptor: PSECURITY_DESCRIPTOR,
}}
pub type PSE_SECURITY_DESCRIPTOR = *mut SE_SECURITY_DESCRIPTOR;
STRUCT!{struct SE_ACCESS_REQUEST {
    Size: DWORD,
    SeSecurityDescriptor: PSE_SECURITY_DESCRIPTOR,
    DesiredAccess: ACCESS_MASK,
    PreviouslyGrantedAccess: ACCESS_MASK,
    PrincipalSelfSid: PSID,
    GenericMapping: PGENERIC_MAPPING,
    ObjectTypeListCount: DWORD,
    ObjectTypeList: POBJECT_TYPE_LIST,
}}
pub type PSE_ACCESS_REQUEST = *mut SE_ACCESS_REQUEST;
STRUCT!{struct SE_ACCESS_REPLY {
    Size: DWORD,
    ResultListCount: DWORD,
    GrantedAccess: PACCESS_MASK,
    AccessStatus: PDWORD,
    AccessReason: PACCESS_REASONS,
    Privileges: *mut PPRIVILEGE_SET,
}}
pub type PSE_ACCESS_REPLY = *mut SE_ACCESS_REPLY;
pub const SE_CREATE_TOKEN_NAME: &'static str = "SeCreateTokenPrivilege";
pub const SE_ASSIGNPRIMARYTOKEN_NAME: &'static str = "SeAssignPrimaryTokenPrivilege";
pub const SE_LOCK_MEMORY_NAME: &'static str = "SeLockMemoryPrivilege";
pub const SE_INCREASE_QUOTA_NAME: &'static str = "SeIncreaseQuotaPrivilege";
pub const SE_UNSOLICITED_INPUT_NAME: &'static str = "SeUnsolicitedInputPrivilege";
pub const SE_MACHINE_ACCOUNT_NAME: &'static str = "SeMachineAccountPrivilege";
pub const SE_TCB_NAME: &'static str = "SeTcbPrivilege";
pub const SE_SECURITY_NAME: &'static str = "SeSecurityPrivilege";
pub const SE_TAKE_OWNERSHIP_NAME: &'static str = "SeTakeOwnershipPrivilege";
pub const SE_LOAD_DRIVER_NAME: &'static str = "SeLoadDriverPrivilege";
pub const SE_SYSTEM_PROFILE_NAME: &'static str = "SeSystemProfilePrivilege";
pub const SE_SYSTEMTIME_NAME: &'static str = "SeSystemtimePrivilege";
pub const SE_PROF_SINGLE_PROCESS_NAME: &'static str = "SeProfileSingleProcessPrivilege";
pub const SE_INC_BASE_PRIORITY_NAME: &'static str = "SeIncreaseBasePriorityPrivilege";
pub const SE_CREATE_PAGEFILE_NAME: &'static str = "SeCreatePagefilePrivilege";
pub const SE_CREATE_PERMANENT_NAME: &'static str = "SeCreatePermanentPrivilege";
pub const SE_BACKUP_NAME: &'static str = "SeBackupPrivilege";
pub const SE_RESTORE_NAME: &'static str = "SeRestorePrivilege";
pub const SE_SHUTDOWN_NAME: &'static str = "SeShutdownPrivilege";
pub const SE_DEBUG_NAME: &'static str = "SeDebugPrivilege";
pub const SE_AUDIT_NAME: &'static str = "SeAuditPrivilege";
pub const SE_SYSTEM_ENVIRONMENT_NAME: &'static str = "SeSystemEnvironmentPrivilege";
pub const SE_CHANGE_NOTIFY_NAME: &'static str = "SeChangeNotifyPrivilege";
pub const SE_REMOTE_SHUTDOWN_NAME: &'static str = "SeRemoteShutdownPrivilege";
pub const SE_UNDOCK_NAME: &'static str = "SeUndockPrivilege";
pub const SE_SYNC_AGENT_NAME: &'static str = "SeSyncAgentPrivilege";
pub const SE_ENABLE_DELEGATION_NAME: &'static str = "SeEnableDelegationPrivilege";
pub const SE_MANAGE_VOLUME_NAME: &'static str = "SeManageVolumePrivilege";
pub const SE_IMPERSONATE_NAME: &'static str = "SeImpersonatePrivilege";
pub const SE_CREATE_GLOBAL_NAME: &'static str = "SeCreateGlobalPrivilege";
pub const SE_TRUSTED_CREDMAN_ACCESS_NAME: &'static str = "SeTrustedCredManAccessPrivilege";
pub const SE_RELABEL_NAME: &'static str = "SeRelabelPrivilege";
pub const SE_INC_WORKING_SET_NAME: &'static str = "SeIncreaseWorkingSetPrivilege";
pub const SE_TIME_ZONE_NAME: &'static str = "SeTimeZonePrivilege";
pub const SE_CREATE_SYMBOLIC_LINK_NAME: &'static str = "SeCreateSymbolicLinkPrivilege";
pub const SE_DELEGATE_SESSION_USER_IMPERSONATE_NAME: &'static str
    = "SeDelegateSessionUserImpersonatePrivilege";
pub const SE_ACTIVATE_AS_USER_CAPABILITY: &'static str = "activateAsUser";
pub const SE_CONSTRAINED_IMPERSONATION_CAPABILITY: &'static str = "constrainedImpersonation";
pub const SE_SESSION_IMPERSONATION_CAPABILITY: &'static str = "sessionImpersonation";
pub const SE_MUMA_CAPABILITY: &'static str = "muma";
pub const SE_DEVELOPMENT_MODE_NETWORK_CAPABILITY: &'static str = "developmentModeNetwork";
ENUM!{enum SECURITY_IMPERSONATION_LEVEL {
    SecurityAnonymous,
    SecurityIdentification,
    SecurityImpersonation,
    SecurityDelegation,
}}
pub type PSECURITY_IMPERSONATION_LEVEL = *mut SECURITY_IMPERSONATION_LEVEL;
pub const SECURITY_MAX_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityDelegation;
pub const SECURITY_MIN_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityAnonymous;
pub const DEFAULT_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityImpersonation;
#[inline]
pub fn VALID_IMPERSONATION_LEVEL(L: SECURITY_IMPERSONATION_LEVEL) -> bool {
    (L >= SECURITY_MIN_IMPERSONATION_LEVEL) && (L <= SECURITY_MAX_IMPERSONATION_LEVEL)
}
pub const TOKEN_ASSIGN_PRIMARY: DWORD = 0x0001;
pub const TOKEN_DUPLICATE: DWORD = 0x0002;
pub const TOKEN_IMPERSONATE: DWORD = 0x0004;
pub const TOKEN_QUERY: DWORD = 0x0008;
pub const TOKEN_QUERY_SOURCE: DWORD = 0x0010;
pub const TOKEN_ADJUST_PRIVILEGES: DWORD = 0x0020;
pub const TOKEN_ADJUST_GROUPS: DWORD = 0x0040;
pub const TOKEN_ADJUST_DEFAULT: DWORD = 0x0080;
pub const TOKEN_ADJUST_SESSIONID: DWORD = 0x0100;
pub const TOKEN_ALL_ACCESS_P: DWORD = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY
    | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE
    | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT;
pub const TOKEN_ALL_ACCESS: DWORD = TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID;
pub const TOKEN_READ: DWORD = STANDARD_RIGHTS_READ | TOKEN_QUERY;
pub const TOKEN_WRITE: DWORD = STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES
    | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT;
pub const TOKEN_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE;
pub const TOKEN_TRUST_CONSTRAINT_MASK: DWORD = STANDARD_RIGHTS_READ | TOKEN_QUERY
    | TOKEN_QUERY_SOURCE;
pub const TOKEN_ACCESS_PSEUDO_HANDLE_WIN8: DWORD = TOKEN_QUERY | TOKEN_QUERY_SOURCE;
pub const TOKEN_ACCESS_PSEUDO_HANDLE: DWORD = TOKEN_ACCESS_PSEUDO_HANDLE_WIN8;
ENUM!{enum TOKEN_TYPE {
    TokenPrimary = 1,
    TokenImpersonation,
}}
pub type PTOKEN_TYPE = *mut TOKEN_TYPE;
ENUM!{enum TOKEN_ELEVATION_TYPE {
    TokenElevationTypeDefault = 1,
    TokenElevationTypeFull,
    TokenElevationTypeLimited,
}}
pub type PTOKEN_ELEVATION_TYPE = *mut TOKEN_ELEVATION_TYPE;
ENUM!{enum TOKEN_INFORMATION_CLASS {
    TokenUser = 1,
    TokenGroups,
    TokenPrivileges,
    TokenOwner,
    TokenPrimaryGroup,
    TokenDefaultDacl,
    TokenSource,
    TokenType,
    TokenImpersonationLevel,
    TokenStatistics,
    TokenRestrictedSids,
    TokenSessionId,
    TokenGroupsAndPrivileges,
    TokenSessionReference,
    TokenSandBoxInert,
    TokenAuditPolicy,
    TokenOrigin,
    TokenElevationType,
    TokenLinkedToken,
    TokenElevation,
    TokenHasRestrictions,
    TokenAccessInformation,
    TokenVirtualizationAllowed,
    TokenVirtualizationEnabled,
    TokenIntegrityLevel,
    TokenUIAccess,
    TokenMandatoryPolicy,
    TokenLogonSid,
    TokenIsAppContainer,
    TokenCapabilities,
    TokenAppContainerSid,
    TokenAppContainerNumber,
    TokenUserClaimAttributes,
    TokenDeviceClaimAttributes,
    TokenRestrictedUserClaimAttributes,
    TokenRestrictedDeviceClaimAttributes,
    TokenDeviceGroups,
    TokenRestrictedDeviceGroups,
    TokenSecurityAttributes,
    TokenIsRestricted,
    TokenProcessTrustLevel,
    TokenPrivateNameSpace,
    TokenSingletonAttributes,
    TokenBnoIsolation,
    MaxTokenInfoClass,
}}
pub type PTOKEN_INFORMATION_CLASS = *mut TOKEN_INFORMATION_CLASS;
STRUCT!{struct TOKEN_USER {
    User: SID_AND_ATTRIBUTES,
}}
pub type PTOKEN_USER = *mut TOKEN_USER;
UNION!{union SE_TOKEN_USER_u1 {
    [usize; 2],
    TokenUser TokenUser_mut: TOKEN_USER,
    User User_mut: SID_AND_ATTRIBUTES,
}}
UNION!{union SE_TOKEN_USER_u2 {
    [u32; 17],
    Sid Sid_mut: SID,
    Buffer Buffer_mut: [BYTE; SECURITY_MAX_SID_SIZE],
}}
STRUCT!{struct SE_TOKEN_USER {
    u1: SE_TOKEN_USER_u1,
    u2: SE_TOKEN_USER_u2,
}}
pub type PSE_TOKEN_USER = *mut SE_TOKEN_USER;
STRUCT!{struct TOKEN_GROUPS {
    GroupCount: DWORD,
    Groups: [SID_AND_ATTRIBUTES; ANYSIZE_ARRAY],
}}
pub type PTOKEN_GROUPS = *mut TOKEN_GROUPS;
STRUCT!{struct TOKEN_PRIVILEGES {
    PrivilegeCount: DWORD,
    Privileges: [LUID_AND_ATTRIBUTES; ANYSIZE_ARRAY],
}}
pub type PTOKEN_PRIVILEGES = *mut TOKEN_PRIVILEGES;
STRUCT!{struct TOKEN_OWNER {
    Owner: PSID,
}}
pub type PTOKEN_OWNER = *mut TOKEN_OWNER;
STRUCT!{struct TOKEN_PRIMARY_GROUP {
    PrimaryGroup: PSID,
}}
pub type PTOKEN_PRIMARY_GROUP = *mut TOKEN_PRIMARY_GROUP;
STRUCT!{struct TOKEN_DEFAULT_DACL {
    DefaultDacl: PACL,
}}
pub type PTOKEN_DEFAULT_DACL = *mut TOKEN_DEFAULT_DACL;
STRUCT!{struct TOKEN_USER_CLAIMS {
    UserClaims: PCLAIMS_BLOB,
}}
pub type PTOKEN_USER_CLAIMS = *mut TOKEN_USER_CLAIMS;
STRUCT!{struct TOKEN_DEVICE_CLAIMS {
    DeviceClaims: PCLAIMS_BLOB,
}}
pub type PTOKEN_DEVICE_CLAIMS = *mut TOKEN_DEVICE_CLAIMS;
STRUCT!{struct TOKEN_GROUPS_AND_PRIVILEGES {
    SidCount: DWORD,
    SidLength: DWORD,
    Sids: PSID_AND_ATTRIBUTES,
    RestrictedSidCount: DWORD,
    RestrictedSidLength: DWORD,
    RestrictedSids: PSID_AND_ATTRIBUTES,
    PrivilegeCount: DWORD,
    PrivilegeLength: DWORD,
    Privileges: PLUID_AND_ATTRIBUTES,
    AuthenticationId: LUID,
}}
pub type PTOKEN_GROUPS_AND_PRIVILEGES = *mut TOKEN_GROUPS_AND_PRIVILEGES;
STRUCT!{struct TOKEN_LINKED_TOKEN {
    LinkedToken: HANDLE,
}}
pub type PTOKEN_LINKED_TOKEN = *mut TOKEN_LINKED_TOKEN;
STRUCT!{struct TOKEN_ELEVATION {
    TokenIsElevated: DWORD,
}}
pub type PTOKEN_ELEVATION = *mut TOKEN_ELEVATION;
STRUCT!{struct TOKEN_MANDATORY_LABEL {
    Label: SID_AND_ATTRIBUTES,
}}
pub type PTOKEN_MANDATORY_LABEL = *mut TOKEN_MANDATORY_LABEL;
pub const TOKEN_MANDATORY_POLICY_OFF: DWORD = 0x0;
pub const TOKEN_MANDATORY_POLICY_NO_WRITE_UP: DWORD = 0x1;
pub const TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN: DWORD = 0x2;
pub const TOKEN_MANDATORY_POLICY_VALID_MASK: DWORD = TOKEN_MANDATORY_POLICY_NO_WRITE_UP
    | TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN;
STRUCT!{struct TOKEN_MANDATORY_POLICY {
    Policy: DWORD,
}}
pub type PTOKEN_MANDATORY_POLICY = *mut TOKEN_MANDATORY_POLICY;
pub type PSECURITY_ATTRIBUTES_OPAQUE = PVOID;
STRUCT!{struct TOKEN_ACCESS_INFORMATION {
    SidHash: PSID_AND_ATTRIBUTES_HASH,
    RestrictedSidHash: PSID_AND_ATTRIBUTES_HASH,
    Privileges: PTOKEN_PRIVILEGES,
    AuthenticationId: LUID,
    TokenType: TOKEN_TYPE,
    ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL,
    MandatoryPolicy: TOKEN_MANDATORY_POLICY,
    Flags: DWORD,
    AppContainerNumber: DWORD,
    PackageSid: PSID,
    CapabilitiesHash: PSID_AND_ATTRIBUTES_HASH,
    TrustLevelSid: PSID,
    SecurityAttributes: PSECURITY_ATTRIBUTES_OPAQUE,
}}
pub type PTOKEN_ACCESS_INFORMATION = *mut TOKEN_ACCESS_INFORMATION;
pub const POLICY_AUDIT_SUBCATEGORY_COUNT: usize = 59;
STRUCT!{struct TOKEN_AUDIT_POLICY {
    PerUserPolicy: [BYTE; (POLICY_AUDIT_SUBCATEGORY_COUNT >> 1) + 1],
}}
pub type PTOKEN_AUDIT_POLICY = *mut TOKEN_AUDIT_POLICY;
pub const TOKEN_SOURCE_LENGTH: usize = 8;
STRUCT!{struct TOKEN_SOURCE {
    SourceName: [CHAR; TOKEN_SOURCE_LENGTH],
    SourceIdentifier: LUID,
}}
pub type PTOKEN_SOURCE = *mut TOKEN_SOURCE;
STRUCT!{struct TOKEN_STATISTICS {
    TokenId: LUID,
    AuthenticationId: LUID,
    ExpirationTime: LARGE_INTEGER,
    TokenType: TOKEN_TYPE,
    ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL,
    DynamicCharged: DWORD,
    DynamicAvailable: DWORD,
    GroupCount: DWORD,
    PrivilegeCount: DWORD,
    ModifiedId: LUID,
}}
pub type PTOKEN_STATISTICS = *mut TOKEN_STATISTICS;
STRUCT!{struct TOKEN_CONTROL {
    TokenId: LUID,
    AuthenticationId: LUID,
    ModifiedId: LUID,
    TokenSource: TOKEN_SOURCE,
}}
pub type PTOKEN_CONTROL = *mut TOKEN_CONTROL;
STRUCT!{struct TOKEN_ORIGIN {
    OriginatingLogonSession: LUID,
}}
pub type PTOKEN_ORIGIN = *mut TOKEN_ORIGIN;
ENUM!{enum MANDATORY_LEVEL {
    MandatoryLevelUntrusted = 0,
    MandatoryLevelLow,
    MandatoryLevelMedium,
    MandatoryLevelHigh,
    MandatoryLevelSystem,
    MandatoryLevelSecureProcess,
    MandatoryLevelCount,
}}
pub type PMANDATORY_LEVEL = *mut MANDATORY_LEVEL;
STRUCT!{struct TOKEN_APPCONTAINER_INFORMATION {
    TokenAppContainer: PSID,
}}
pub type PTOKEN_APPCONTAINER_INFORMATION = *mut TOKEN_APPCONTAINER_INFORMATION;
STRUCT!{struct TOKEN_SID_INFORMATION {
    Sid: PSID,
}}
pub type PTOKEN_SID_INFORMATION = *mut TOKEN_SID_INFORMATION;
STRUCT!{struct TOKEN_BNO_ISOLATION_INFORMATION {
    IsolationPrefix: PWSTR,
    IsolationEnabled: BOOLEAN,
}}
pub type PTOKEN_BNO_ISOLATION_INFORMATION = *mut TOKEN_BNO_ISOLATION_INFORMATION;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INVALID: WORD = 0x00;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64: WORD = 0x01;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64: WORD = 0x02;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING: WORD = 0x03;
STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE {
    Version: DWORD64,
    Name: PWSTR,
}}
pub type PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = *mut CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_FQBN: WORD = 0x04;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_SID: WORD = 0x05;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN: WORD = 0x06;
STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE {
    pValue: PVOID,
    ValueLength: DWORD,
}}
pub type PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE =
    *mut CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE;
pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING: WORD = 0x10;
pub const CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE: DWORD = 0x0001;
pub const CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE: DWORD = 0x0002;
pub const CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY: DWORD = 0x0004;
pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT: DWORD = 0x0008;
pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED: DWORD = 0x0010;
pub const CLAIM_SECURITY_ATTRIBUTE_MANDATORY: DWORD = 0x0020;
pub const CLAIM_SECURITY_ATTRIBUTE_VALID_FLAGS: DWORD = CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE
    | CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE | CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY
    | CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT | CLAIM_SECURITY_ATTRIBUTE_DISABLED
    | CLAIM_SECURITY_ATTRIBUTE_MANDATORY;
pub const CLAIM_SECURITY_ATTRIBUTE_CUSTOM_FLAGS: DWORD = 0xFFFF0000;
UNION!{union CLAIM_SECURITY_ATTRIBUTE_V1_Values {
    [usize; 1],
    pInt64 pInt64_mut: PLONG64,
    pUint64 pUint64_mut: PDWORD64,
    ppString ppString_mut: PWSTR,
    pFqbn pFqbn_mut: PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE,
    pOctetString pOctetString_mut: PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE,
}}
STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_V1 {
    Name: PWSTR,
    ValueType: WORD,
    Reserved: WORD,
    Flags: DWORD,
    ValueCount: DWORD,
    Values: CLAIM_SECURITY_ATTRIBUTE_V1_Values,
}}
pub type PCLAIM_SECURITY_ATTRIBUTE_V1 = *mut CLAIM_SECURITY_ATTRIBUTE_V1;
UNION!{union CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Values {
    [u32; 1],
    pInt64 pInt64_mut: [DWORD; ANYSIZE_ARRAY],
    pUint64 pUint64_mut: [DWORD; ANYSIZE_ARRAY],
    ppString ppString_mut: [DWORD; ANYSIZE_ARRAY],
    pFqbn pFqbn_mut: [DWORD; ANYSIZE_ARRAY],
    pOctetString pOctetString_mut: [DWORD; ANYSIZE_ARRAY],
}}
STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 {
    Name: DWORD,
    ValueType: WORD,
    Reserved: WORD,
    Flags: DWORD,
    ValueCount: DWORD,
    Values: CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Values,
}}
pub type PCLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = *mut CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1;
pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1: WORD = 1;
pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION: WORD =
    CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1;
UNION!{union CLAIM_SECURITY_ATTRIBUTES_INFORMATION_Attribute {
    [usize; 1],
    pAttributeV1 pAttributeV1_mut: PCLAIM_SECURITY_ATTRIBUTE_V1,
}}
STRUCT!{struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION {
    Version: WORD,
    Reserved: WORD,
    AttributeCount: DWORD,
    Attribute: CLAIM_SECURITY_ATTRIBUTES_INFORMATION_Attribute,
}}
pub type PCLAIM_SECURITY_ATTRIBUTES_INFORMATION = *mut CLAIM_SECURITY_ATTRIBUTES_INFORMATION;
pub const SECURITY_DYNAMIC_TRACKING: BOOLEAN = TRUE as u8;
pub const SECURITY_STATIC_TRACKING: BOOLEAN = FALSE as u8;
pub type SECURITY_CONTEXT_TRACKING_MODE = BOOLEAN;
pub type PSECURITY_CONTEXT_TRACKING_MODE = *mut BOOLEAN;
STRUCT!{struct SECURITY_QUALITY_OF_SERVICE {
    Length: DWORD,
    ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL,
    ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE,
    EffectiveOnly: BOOLEAN,
}}
pub type PSECURITY_QUALITY_OF_SERVICE = *mut SECURITY_QUALITY_OF_SERVICE;
STRUCT!{struct SE_IMPERSONATION_STATE {
    Token: PACCESS_TOKEN,
    CopyOnOpen: BOOLEAN,
    EffectiveOnly: BOOLEAN,
    Level: SECURITY_IMPERSONATION_LEVEL,
}}
pub type PSE_IMPERSONATION_STATE = *mut SE_IMPERSONATION_STATE;
pub const DISABLE_MAX_PRIVILEGE: DWORD = 0x1;
pub const SANDBOX_INERT: DWORD = 0x2;
pub const LUA_TOKEN: DWORD = 0x4;
pub const WRITE_RESTRICTED: DWORD = 0x8;
pub type SECURITY_INFORMATION = DWORD;
pub type PSECURITY_INFORMATION = *mut DWORD;
pub const OWNER_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000001;
pub const GROUP_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000002;
pub const DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000004;
pub const SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000008;
pub const LABEL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000010;
pub const ATTRIBUTE_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000020;
pub const SCOPE_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000040;
pub const PROCESS_TRUST_LABEL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000080;
pub const ACCESS_FILTER_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000100;
pub const BACKUP_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00010000;
pub const PROTECTED_DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x80000000;
pub const PROTECTED_SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x40000000;
pub const UNPROTECTED_DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x20000000;
pub const UNPROTECTED_SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x10000000;
pub type SE_SIGNING_LEVEL = BYTE;
pub type PSE_SIGNING_LEVEL = *mut BYTE;
pub const SE_SIGNING_LEVEL_UNCHECKED: BYTE = 0x00000000;
pub const SE_SIGNING_LEVEL_UNSIGNED: BYTE = 0x00000001;
pub const SE_SIGNING_LEVEL_ENTERPRISE: BYTE = 0x00000002;
pub const SE_SIGNING_LEVEL_CUSTOM_1: BYTE = 0x00000003;
pub const SE_SIGNING_LEVEL_AUTHENTICODE: BYTE = 0x00000004;
pub const SE_SIGNING_LEVEL_CUSTOM_2: BYTE = 0x00000005;
pub const SE_SIGNING_LEVEL_STORE: BYTE = 0x00000006;
pub const SE_SIGNING_LEVEL_CUSTOM_3: BYTE = 0x00000007;
pub const SE_SIGNING_LEVEL_ANTIMALWARE: BYTE = SE_SIGNING_LEVEL_CUSTOM_3;
pub const SE_SIGNING_LEVEL_MICROSOFT: BYTE = 0x00000008;
pub const SE_SIGNING_LEVEL_CUSTOM_4: BYTE = 0x00000009;
pub const SE_SIGNING_LEVEL_CUSTOM_5: BYTE = 0x0000000A;
pub const SE_SIGNING_LEVEL_DYNAMIC_CODEGEN: BYTE = 0x0000000B;
pub const SE_SIGNING_LEVEL_WINDOWS: BYTE = 0x0000000C;
pub const SE_SIGNING_LEVEL_CUSTOM_7: BYTE = 0x0000000D;
pub const SE_SIGNING_LEVEL_WINDOWS_TCB: BYTE = 0x0000000E;
pub const SE_SIGNING_LEVEL_CUSTOM_6: BYTE = 0x0000000F;
ENUM!{enum SE_IMAGE_SIGNATURE_TYPE {
    SeImageSignatureNone = 0,
    SeImageSignatureEmbedded,
    SeImageSignatureCache,
    SeImageSignatureCatalogCached,
    SeImageSignatureCatalogNotCached,
    SeImageSignatureCatalogHint,
    SeImageSignaturePackageCatalog,
}}
pub type PSE_IMAGE_SIGNATURE_TYPE = *mut SE_IMAGE_SIGNATURE_TYPE;
ENUM!{enum SE_LEARNING_MODE_DATA_TYPE {
    SeLearningModeInvalidType = 0,
    SeLearningModeSettings,
    SeLearningModeMax,
}}
STRUCT!{struct SECURITY_CAPABILITIES {
    AppContainerSid: PSID,
    Capabilities: PSID_AND_ATTRIBUTES,
    CapabilityCount: DWORD,
    Reserved: DWORD,
}}
pub type PSECURITY_CAPABILITIES = *mut SECURITY_CAPABILITIES;
pub type LPSECURITY_CAPABILITIES = *mut SECURITY_CAPABILITIES;
pub const PROCESS_TERMINATE: DWORD = 0x0001;
pub const PROCESS_CREATE_THREAD: DWORD = 0x0002;
pub const PROCESS_SET_SESSIONID: DWORD = 0x0004;
pub const PROCESS_VM_OPERATION: DWORD = 0x0008;
pub const PROCESS_VM_READ: DWORD = 0x0010;
pub const PROCESS_VM_WRITE: DWORD = 0x0020;
pub const PROCESS_DUP_HANDLE: DWORD = 0x0040;
pub const PROCESS_CREATE_PROCESS: DWORD = 0x0080;
pub const PROCESS_SET_QUOTA: DWORD = 0x0100;
pub const PROCESS_SET_INFORMATION: DWORD = 0x0200;
pub const PROCESS_QUERY_INFORMATION: DWORD = 0x0400;
pub const PROCESS_SUSPEND_RESUME: DWORD = 0x0800;
pub const PROCESS_QUERY_LIMITED_INFORMATION: DWORD = 0x1000;
pub const PROCESS_SET_LIMITED_INFORMATION: DWORD = 0x2000;
pub const PROCESS_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF;
pub const THREAD_TERMINATE: DWORD = 0x0001;
pub const THREAD_SUSPEND_RESUME: DWORD = 0x0002;
pub const THREAD_GET_CONTEXT: DWORD = 0x0008;
pub const THREAD_SET_CONTEXT: DWORD = 0x0010;
pub const THREAD_QUERY_INFORMATION: DWORD = 0x0040;
pub const THREAD_SET_INFORMATION: DWORD = 0x0020;
pub const THREAD_SET_THREAD_TOKEN: DWORD = 0x0080;
pub const THREAD_IMPERSONATE: DWORD = 0x0100;
pub const THREAD_DIRECT_IMPERSONATION: DWORD = 0x0200;
pub const THREAD_SET_LIMITED_INFORMATION: DWORD = 0x0400;
pub const THREAD_QUERY_LIMITED_INFORMATION: DWORD = 0x0800;
pub const THREAD_RESUME: DWORD = 0x1000;
pub const THREAD_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF;
pub const JOB_OBJECT_ASSIGN_PROCESS: DWORD = 0x0001;
pub const JOB_OBJECT_SET_ATTRIBUTES: DWORD = 0x0002;
pub const JOB_OBJECT_QUERY: DWORD = 0x0004;
pub const JOB_OBJECT_TERMINATE: DWORD = 0x0008;
pub const JOB_OBJECT_SET_SECURITY_ATTRIBUTES: DWORD = 0x0010;
pub const JOB_OBJECT_IMPERSONATE: DWORD = 0x0020;
pub const JOB_OBJECT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3F;
STRUCT!{struct JOB_SET_ARRAY {
    JobHandle: HANDLE,
    MemberLevel: DWORD,
    Flags: DWORD,
}}
pub type PJOB_SET_ARRAY = *mut JOB_SET_ARRAY;
pub const FLS_MAXIMUM_AVAILABLE: DWORD = 128;
pub const TLS_MINIMUM_AVAILABLE: DWORD = 64;
STRUCT!{struct EXCEPTION_REGISTRATION_RECORD {
    Next: *mut EXCEPTION_REGISTRATION_RECORD,
    Handler: PEXCEPTION_ROUTINE,
}}
pub type PEXCEPTION_REGISTRATION_RECORD = *mut EXCEPTION_REGISTRATION_RECORD;
UNION!{union NT_TIB_u {
    [usize; 1],
    FiberData FiberData_mut: PVOID,
    Version Version_mut: DWORD,
}}
STRUCT!{struct NT_TIB {
    ExceptionList: *mut EXCEPTION_REGISTRATION_RECORD,
    StackBase: PVOID,
    StackLimit: PVOID,
    SubSystemTib: PVOID,
    u: NT_TIB_u,
    ArbitraryUserPointer: PVOID,
    _Self: *mut NT_TIB,
}}
pub type PNT_TIB = *mut NT_TIB;
UNION!{union NT_TIB32_u {
    [u32; 1],
    FiberData FiberData_mut: DWORD,
    Version Version_mut: DWORD,
}}
STRUCT!{struct NT_TIB32 {
    ExceptionList: DWORD,
    StackBase: DWORD,
    StackLimit: DWORD,
    SubSystemTib: DWORD,
    u: NT_TIB32_u,
    ArbitraryUserPointer: DWORD,
    Self_: DWORD,
}}
pub type PNT_TIB32 = *mut NT_TIB32;
UNION!{union NT_TIB64_u {
    [u64; 1],
    FiberData FiberData_mut: DWORD64,
    Version Version_mut: DWORD,
}}
STRUCT!{struct NT_TIB64 {
    ExceptionList: DWORD64,
    StackBase: DWORD64,
    StackLimit: DWORD64,
    SubSystemTib: DWORD64,
    u: NT_TIB64_u,
    ArbitraryUserPointer: DWORD64,
    _Self: DWORD64,
}}
pub type PNT_TIB64 = *mut NT_TIB64;
pub const THREAD_DYNAMIC_CODE_ALLOW: DWORD = 1;
pub const THREAD_BASE_PRIORITY_LOWRT: DWORD = 15;
pub const THREAD_BASE_PRIORITY_MAX: DWORD = 2;
pub const THREAD_BASE_PRIORITY_MIN: DWORD = -2i32 as u32;
pub const THREAD_BASE_PRIORITY_IDLE: DWORD = -15i32 as u32;
STRUCT!{struct UMS_CREATE_THREAD_ATTRIBUTES {
    UmsVersion: DWORD,
    UmsContext: PVOID,
    UmsCompletionList: PVOID,
}}
pub type PUMS_CREATE_THREAD_ATTRIBUTES = *mut UMS_CREATE_THREAD_ATTRIBUTES;
STRUCT!{struct WOW64_ARCHITECTURE_INFORMATION {
    BitFields: DWORD,
}}
pub type PWOW64_ARCHITECTURE_INFORMATION = *mut WOW64_ARCHITECTURE_INFORMATION;
BITFIELD!{WOW64_ARCHITECTURE_INFORMATION BitFields: DWORD [
    Machine set_Machine[0..16],
    KernelMode set_KernelMode[16..17],
    UserMode set_UserMode[17..18],
    Native set_Native[18..19],
    Process set_Process[19..20],
    ReservedZero0 set_ReservedZero0[20..32],
]}
pub const MEMORY_PRIORITY_LOWEST: ULONG = 0;
pub const MEMORY_PRIORITY_VERY_LOW: ULONG = 1;
pub const MEMORY_PRIORITY_LOW: ULONG = 2;
pub const MEMORY_PRIORITY_MEDIUM: ULONG = 3;
pub const MEMORY_PRIORITY_BELOW_NORMAL: ULONG = 4;
pub const MEMORY_PRIORITY_NORMAL: ULONG = 5;
STRUCT!{struct QUOTA_LIMITS {
    PagedPoolLimit: SIZE_T,
    NonPagedPoolLimit: SIZE_T,
    MinimumWorkingSetSize: SIZE_T,
    MaximumWorkingSetSize: SIZE_T,
    PagefileLimit: SIZE_T,
    TimeLimit: LARGE_INTEGER,
}}
pub type PQUOTA_LIMITS = *mut QUOTA_LIMITS;
pub const QUOTA_LIMITS_HARDWS_MIN_ENABLE: DWORD = 0x00000001;
pub const QUOTA_LIMITS_HARDWS_MIN_DISABLE: DWORD = 0x00000002;
pub const QUOTA_LIMITS_HARDWS_MAX_ENABLE: DWORD = 0x00000004;
pub const QUOTA_LIMITS_HARDWS_MAX_DISABLE: DWORD = 0x00000008;
pub const QUOTA_LIMITS_USE_DEFAULT_LIMITS: DWORD = 0x00000010;
STRUCT!{struct RATE_QUOTA_LIMIT {
    RateData: DWORD,
}}
BITFIELD!{RATE_QUOTA_LIMIT RateData: DWORD [
    RatePercent set_RatePercent[0..7],
    Reserved0 set_Reserved0[7..32],
]}
pub type PRATE_QUOTA_LIMIT = *mut RATE_QUOTA_LIMIT;
STRUCT!{struct QUOTA_LIMITS_EX {
    PagedPoolLimit: SIZE_T,
    NonPagedPoolLimit: SIZE_T,
    MinimumWorkingSetSize: SIZE_T,
    MaximumWorkingSetSize: SIZE_T,
    PagefileLimit: SIZE_T,
    TimeLimit: LARGE_INTEGER,
    WorkingSetLimit: SIZE_T,
    Reserved2: SIZE_T,
    Reserved3: SIZE_T,
    Reserved4: SIZE_T,
    Flags: DWORD,
    CpuRateLimit: RATE_QUOTA_LIMIT,
}}
pub type PQUOTA_LIMITS_EX = *mut QUOTA_LIMITS_EX;
STRUCT!{struct IO_COUNTERS {
    ReadOperationCount: ULONGLONG,
    WriteOperationCount: ULONGLONG,
    OtherOperationCount: ULONGLONG,
    ReadTransferCount: ULONGLONG,
    WriteTransferCount: ULONGLONG,
    OtherTransferCount: ULONGLONG,
}}
pub type PIO_COUNTERS = *mut IO_COUNTERS;
pub const MAX_HW_COUNTERS: usize = 16;
pub const THREAD_PROFILING_FLAG_DISPATCH: DWORD = 0x00000001;
ENUM!{enum HARDWARE_COUNTER_TYPE {
    PMCCounter,
    MaxHardwareCounterType,
}}
pub type PHARDWARE_COUNTER_TYPE = *mut HARDWARE_COUNTER_TYPE;
ENUM!{enum PROCESS_MITIGATION_POLICY {
    ProcessDEPPolicy,
    ProcessASLRPolicy,
    ProcessDynamicCodePolicy,
    ProcessStrictHandleCheckPolicy,
    ProcessSystemCallDisablePolicy,
    ProcessMitigationOptionsMask,
    ProcessExtensionPointDisablePolicy,
    ProcessControlFlowGuardPolicy,
    ProcessSignaturePolicy,
    ProcessFontDisablePolicy,
    ProcessImageLoadPolicy,
    MaxProcessMitigationPolicy,
}}
pub type PPROCESS_MITIGATION_POLICY = *mut PROCESS_MITIGATION_POLICY;
STRUCT!{struct PROCESS_MITIGATION_ASLR_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_ASLR_POLICY Flags: DWORD [
    EnableBottomUpRandomization set_EnableBottomUpRandomization[0..1],
    EnableForceRelocateImages set_EnableForceRelocateImages[1..2],
    EnableHighEntropy set_EnableHighEntropy[2..3],
    DisallowStrippedImages set_DisallowStrippedImages[3..4],
    ReservedFlags set_ReservedFlags[4..32],
]}
pub type PPROCESS_MITIGATION_ASLR_POLICY = *mut PROCESS_MITIGATION_ASLR_POLICY;
STRUCT!{struct PROCESS_MITIGATION_DEP_POLICY {
    Flags: DWORD,
    Permanent: BOOLEAN,
}}
BITFIELD!{PROCESS_MITIGATION_DEP_POLICY Flags: DWORD [
    Enable set_Enable[0..1],
    DisableAtlThunkEmulation set_DisableAtlThunkEmulation[1..2],
    ReservedFlags set_ReservedFlags[2..32],
]}
pub type PPROCESS_MITIGATION_DEP_POLICY = *mut PROCESS_MITIGATION_DEP_POLICY;
STRUCT!{struct PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY Flags: DWORD [
    RaiseExceptionOnInvalidHandleReference set_RaiseExceptionOnInvalidHandleReference[0..1],
    HandleExceptionsPermanentlyEnabled set_HandleExceptionsPermanentlyEnabled[1..2],
    ReservedFlags set_ReservedFlags[2..32],
]}
pub type PPROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY
    = *mut PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY;
STRUCT!{struct PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY Flags: DWORD [
    DisallowWin32kSystemCalls set_DisallowWin32kSystemCalls[0..1],
    ReservedFlags set_ReservedFlags[1..32],
]}
pub type PPROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY
    = *mut PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY;
STRUCT!{struct PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY Flags: DWORD [
    DisableExtensionPoints set_DisableExtensionPoints[0..1],
    ReservedFlags set_ReservedFlags[1..32],
]}
pub type PPROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY
    = *mut PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY;
STRUCT!{struct PROCESS_MITIGATION_DYNAMIC_CODE_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_DYNAMIC_CODE_POLICY Flags: DWORD [
    ProhibitDynamicCode set_ProhibitDynamicCode[0..1],
    AllowThreadOptOut set_AllowThreadOptOut[1..2],
    AllowRemoteDowngrade set_AllowRemoteDowngrade[2..3],
    ReservedFlags set_ReservedFlags[3..32],
]}
pub type PPROCESS_MITIGATION_DYNAMIC_CODE_POLICY = *mut PROCESS_MITIGATION_DYNAMIC_CODE_POLICY;
STRUCT!{struct PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY Flags: DWORD [
    EnableControlFlowGuard set_EnableControlFlowGuard[0..1],
    EnableExportSuppression set_EnableExportSuppression[1..2],
    StrictMode set_StrictMode[2..3],
    ReservedFlags set_ReservedFlags[3..32],
]}
pub type PPROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY
    = *mut PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY;
STRUCT!{struct PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY Flags: DWORD [
    MicrosoftSignedOnly set_MicrosoftSignedOnly[0..1],
    StoreSignedOnly set_StoreSignedOnly[1..2],
    MitigationOptIn set_MitigationOptIn[2..3],
    ReservedFlags set_ReservedFlags[3..32],
]}
pub type PPROCESS_MITIGATION_BINARY_SIGNATURE_POLICY
    = *mut PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY;
STRUCT!{struct PROCESS_MITIGATION_FONT_DISABLE_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_FONT_DISABLE_POLICY Flags: DWORD [
    DisableNonSystemFonts set_DisableNonSystemFonts[0..1],
    AuditNonSystemFontLoading set_AuditNonSystemFontLoading[1..2],
    ReservedFlags set_ReservedFlags[2..32],
]}
pub type PPROCESS_MITIGATION_FONT_DISABLE_POLICY = *mut PROCESS_MITIGATION_FONT_DISABLE_POLICY;
STRUCT!{struct PROCESS_MITIGATION_IMAGE_LOAD_POLICY {
    Flags: DWORD,
}}
BITFIELD!{PROCESS_MITIGATION_IMAGE_LOAD_POLICY Flags: DWORD [
    NoRemoteImages set_NoRemoteImages[0..1],
    NoLowMandatoryLabelImages set_NoLowMandatoryLabelImages[1..2],
    PreferSystem32Images set_PreferSystem32Images[2..3],
    ReservedFlags set_ReservedFlags[3..32],
]}
pub type PPROCESS_MITIGATION_IMAGE_LOAD_POLICY = *mut PROCESS_MITIGATION_IMAGE_LOAD_POLICY;
STRUCT!{struct PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY {
    Flags: DWORD,
}}
pub type PPPROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY =
    *mut PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY;
BITFIELD!{PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY Flags: DWORD [
    FilterId set_FilterId[0..4],
    ReservedFlags set_ReservedFlags[4..32],
]}
STRUCT!{struct PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY {
    Flags: DWORD,
}}
pub type PPROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY =
    *mut PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY;
BITFIELD!{PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY Flags: DWORD [
    EnableExportAddressFilter set_EnableExportAddressFilter[0..1],
    AuditExportAddressFilter set_AuditExportAddressFilter[1..2],
    EnableExportAddressFilterPlus set_EnableExportAddressFilterPlus[2..3],
    AuditExportAddressFilterPlus set_AuditExportAddressFilterPlus[3..4],
    EnableImportAddressFilter set_EnableImportAddressFilter[4..5],
    AuditImportAddressFilter set_AuditImportAddressFilter[5..6],
    EnableRopStackPivot set_EnableRopStackPivot[6..7],
    AuditRopStackPivot set_AuditRopStackPivot[7..8],
    EnableRopCallerCheck set_EnableRopCallerCheck[8..9],
    AuditRopCallerCheck set_AuditRopCallerCheck[9..10],
    EnableRopSimExec set_EnableRopSimExec[10..11],
    AuditRopSimExec set_AuditRopSimExec[11..12],
    ReservedFlags set_ReservedFlags[12..32],
]}
STRUCT!{struct PROCESS_MITIGATION_CHILD_PROCESS_POLICY {
    Flags: DWORD,
}}
pub type PPROCESS_MITIGATION_CHILD_PROCESS_POLICY = *mut PROCESS_MITIGATION_CHILD_PROCESS_POLICY;
BITFIELD!{PROCESS_MITIGATION_CHILD_PROCESS_POLICY Flags: DWORD [
    NoChildProcessCreation set_NoChildProcessCreation[0..1],
    AuditNoChildProcessCreation set_AuditNoChildProcessCreation[1..2],
    AllowSecureProcessCreation set_AllowSecureProcessCreation[2..3],
    ReservedFlags set_ReservedFlags[3..32],
]}
STRUCT!{struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
    TotalUserTime: LARGE_INTEGER,
    TotalKernelTime: LARGE_INTEGER,
    ThisPeriodTotalUserTime: LARGE_INTEGER,
    ThisPeriodTotalKernelTime: LARGE_INTEGER,
    TotalPageFaultCount: DWORD,
    TotalProcesses: DWORD,
    ActiveProcesses: DWORD,
    TotalTerminatedProcesses: DWORD,
}}
pub type PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION = *mut JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
STRUCT!{struct JOBOBJECT_BASIC_LIMIT_INFORMATION {
    PerProcessUserTimeLimit: LARGE_INTEGER,
    PerJobUserTimeLimit: LARGE_INTEGER,
    LimitFlags: DWORD,
    MinimumWorkingSetSize: SIZE_T,
    MaximumWorkingSetSize: SIZE_T,
    ActiveProcessLimit: DWORD,
    Affinity: ULONG_PTR,
    PriorityClass: DWORD,
    SchedulingClass: DWORD,
}}
pub type PJOBOBJECT_BASIC_LIMIT_INFORMATION = *mut JOBOBJECT_BASIC_LIMIT_INFORMATION;
STRUCT!{struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
    BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION,
    IoInfo: IO_COUNTERS,
    ProcessMemoryLimit: SIZE_T,
    JobMemoryLimit: SIZE_T,
    PeakProcessMemoryUsed: SIZE_T,
    PeakJobMemoryUsed: SIZE_T,
}}
pub type PJOBOBJECT_EXTENDED_LIMIT_INFORMATION = *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
STRUCT!{struct JOBOBJECT_BASIC_PROCESS_ID_LIST {
    NumberOfAssignedProcesses: DWORD,
    NumberOfProcessIdsInList: DWORD,
    ProcessIdList: [ULONG_PTR; 1],
}}
pub type PJOBOBJECT_BASIC_PROCESS_ID_LIST = *mut JOBOBJECT_BASIC_PROCESS_ID_LIST;
STRUCT!{struct JOBOBJECT_BASIC_UI_RESTRICTIONS {
    UIRestrictionsClass: DWORD,
}}
pub type PJOBOBJECT_BASIC_UI_RESTRICTIONS = *mut JOBOBJECT_BASIC_UI_RESTRICTIONS;
STRUCT!{struct JOBOBJECT_SECURITY_LIMIT_INFORMATION {
    SecurityLimitFlags: DWORD,
    JobToken: HANDLE,
    SidsToDisable: PTOKEN_GROUPS,
    PrivilegesToDelete: PTOKEN_PRIVILEGES,
    RestrictedSids: PTOKEN_GROUPS,
}}
pub type PJOBOBJECT_SECURITY_LIMIT_INFORMATION = *mut JOBOBJECT_SECURITY_LIMIT_INFORMATION;
STRUCT!{struct JOBOBJECT_END_OF_JOB_TIME_INFORMATION {
    EndOfJobTimeAction: DWORD,
}}
pub type PJOBOBJECT_END_OF_JOB_TIME_INFORMATION = *mut JOBOBJECT_END_OF_JOB_TIME_INFORMATION;
STRUCT!{struct JOBOBJECT_ASSOCIATE_COMPLETION_PORT {
    CompletionKey: PVOID,
    CompletionPort: HANDLE,
}}
pub type PJOBOBJECT_ASSOCIATE_COMPLETION_PORT = *mut JOBOBJECT_ASSOCIATE_COMPLETION_PORT;
STRUCT!{struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
    BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION,
    IoInfo: IO_COUNTERS,
}}
pub type PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
    = *mut JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
STRUCT!{struct JOBOBJECT_JOBSET_INFORMATION {
    MemberLevel: DWORD,
}}
pub type PJOBOBJECT_JOBSET_INFORMATION = *mut JOBOBJECT_JOBSET_INFORMATION;
ENUM!{enum JOBOBJECT_RATE_CONTROL_TOLERANCE {
    ToleranceLow = 1,
    ToleranceMedium,
    ToleranceHigh,
}}
pub type PJOBOBJECT_RATE_CONTROL_TOLERANCE = *mut JOBOBJECT_RATE_CONTROL_TOLERANCE;
ENUM!{enum JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL {
    ToleranceIntervalShort = 1,
    ToleranceIntervalMedium,
    ToleranceIntervalLong,
}}
pub type PJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL
    = *mut JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL;
STRUCT!{struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION {
    IoReadBytesLimit: DWORD64,
    IoWriteBytesLimit: DWORD64,
    PerJobUserTimeLimit: LARGE_INTEGER,
    JobMemoryLimit: DWORD64,
    RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    RateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL,
    LimitFlags: DWORD,
}}
pub type PJOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = *mut JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION;
UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u1 {
    [u64; 1],
    JobHighMemoryLimit JobHighMemoryLimit_mut: DWORD64,
    JobMemoryLimit JobMemoryLimit_mut: DWORD64,
}}
UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u2 {
    [u32; 1],
    RateControlTolerance RateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    CpuRateControlTolerance CpuRateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE,
}}
UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u3 {
    [u32; 1],
    RateControlToleranceInterval RateControlToleranceInterval_mut:
        JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL,
    CpuRateControlToleranceInterval CpuRateControlToleranceInterval_mut:
        JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL,
}}
STRUCT!{struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 {
    IoReadBytesLimit: DWORD64,
    IoWriteBytesLimit: DWORD64,
    PerJobUserTimeLimit: LARGE_INTEGER,
    u1: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u1,
    u2: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u2,
    u3: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u3,
    LimitFlags: DWORD,
    IoRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    JobLowMemoryLimit: DWORD64,
    IoRateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL,
    NetRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    NetRateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL,
}}
STRUCT!{struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION {
    LimitFlags: DWORD,
    ViolationLimitFlags: DWORD,
    IoReadBytes: DWORD64,
    IoReadBytesLimit: DWORD64,
    IoWriteBytes: DWORD64,
    IoWriteBytesLimit: DWORD64,
    PerJobUserTime: LARGE_INTEGER,
    PerJobUserTimeLimit: LARGE_INTEGER,
    JobMemory: DWORD64,
    JobMemoryLimit: DWORD64,
    RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    RateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE,
}}
pub type PJOBOBJECT_LIMIT_VIOLATION_INFORMATION = *mut JOBOBJECT_LIMIT_VIOLATION_INFORMATION;
UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u1 {
    [u64; 1],
    JobHighMemoryLimit JobHighMemoryLimit_mut: DWORD64,
    JobMemoryLimit JobMemoryLimit_mut: DWORD64,
}}
UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u2 {
    [u32; 1],
    RateControlTolerance RateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    CpuRateControlTolerance CpuRateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE,
}}
UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u3 {
    [u32; 1],
    RateControlToleranceLimit RateControlToleranceLimit_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    CpuRateControlToleranceLimit CpuRateControlToleranceLimit_mut:
        JOBOBJECT_RATE_CONTROL_TOLERANCE,
}}
STRUCT!{struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2 {
    LimitFlags: DWORD,
    ViolationLimitFlags: DWORD,
    IoReadBytes: DWORD64,
    IoReadBytesLimit: DWORD64,
    IoWriteBytes: DWORD64,
    IoWriteBytesLimit: DWORD64,
    PerJobUserTime: LARGE_INTEGER,
    PerJobUserTimeLimit: LARGE_INTEGER,
    JobMemory: DWORD64,
    u1: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u1,
    u2: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u2,
    u3: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u3,
    JobLowMemoryLimit: DWORD64,
    IoRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    IoRateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    NetRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE,
    NetRateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE,
}}
STRUCT!{struct JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u_s {
    MinRate: WORD,
    MaxRate: WORD,
}}
UNION!{union JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u {
    [u32; 1],
    CpuRate CpuRate_mut: DWORD,
    Weight Weight_mut: DWORD,
    s s_mut: JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u_s,
}}
STRUCT!{struct JOBOBJECT_CPU_RATE_CONTROL_INFORMATION {
    ControlFlags: DWORD,
    u: JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u,
}}
pub type PJOBOBJECT_CPU_RATE_CONTROL_INFORMATION = *mut JOBOBJECT_CPU_RATE_CONTROL_INFORMATION;
ENUM!{enum JOB_OBJECT_NET_RATE_CONTROL_FLAGS {
    JOB_OBJECT_NET_RATE_CONTROL_ENABLE = 0x1,
    JOB_OBJECT_NET_RATE_CONTROL_MAX_BANDWIDTH = 0x2,
    JOB_OBJECT_NET_RATE_CONTROL_DSCP_TAG = 0x4,
    JOB_OBJECT_NET_RATE_CONTROL_VALID_FLAGS = 0x7,
}}
pub const JOB_OBJECT_NET_RATE_CONTROL_MAX_DSCP_TAG: DWORD = 64;
STRUCT!{struct JOBOBJECT_NET_RATE_CONTROL_INFORMATION {
    MaxBandwidth: DWORD64,
    ControlFlags: JOB_OBJECT_NET_RATE_CONTROL_FLAGS,
    DscpTag: BYTE,
}}
ENUM!{enum JOB_OBJECT_IO_RATE_CONTROL_FLAGS {
    JOB_OBJECT_IO_RATE_CONTROL_ENABLE = 0x1,
    JOB_OBJECT_IO_RATE_CONTROL_STANDALONE_VOLUME = 0x2,
    JOB_OBJECT_IO_RATE_CONTROL_VALID_FLAGS = JOB_OBJECT_IO_RATE_CONTROL_ENABLE
        | JOB_OBJECT_IO_RATE_CONTROL_STANDALONE_VOLUME,
}}
STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE {
    MaxIops: LONG64,
    MaxBandwidth: LONG64,
    ReservationIops: LONG64,
    VolumeName: PWSTR,
    BaseIoSize: DWORD,
    ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS,
    VolumeNameLength: WORD,
}}
pub type JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V1
    = JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE;
STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 {
    MaxIops: LONG64,
    MaxBandwidth: LONG64,
    ReservationIops: LONG64,
    VolumeName: PWSTR,
    BaseIoSize: DWORD,
    ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS,
    VolumeNameLength: WORD,
    CriticalReservationIops: LONG64,
    ReservationBandwidth: LONG64,
    CriticalReservationBandwidth: LONG64,
    MaxTimePercent: LONG64,
    ReservationTimePercent: LONG64,
    CriticalReservationTimePercent: LONG64,
}}
STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V3 {
    MaxIops: LONG64,
    MaxBandwidth: LONG64,
    ReservationIops: LONG64,
    VolumeName: PWSTR,
    BaseIoSize: DWORD,
    ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS,
    VolumeNameLength: WORD,
    CriticalReservationIops: LONG64,
    ReservationBandwidth: LONG64,
    CriticalReservationBandwidth: LONG64,
    MaxTimePercent: LONG64,
    ReservationTimePercent: LONG64,
    CriticalReservationTimePercent: LONG64,
    SoftMaxIops: LONG64,
    SoftMaxBandwidth: LONG64,
    SoftMaxTimePercent: LONG64,
    LimitExcessNotifyIops: LONG64,
    LimitExcessNotifyBandwidth: LONG64,
    LimitExcessNotifyTimePercent: LONG64,
}}
ENUM!{enum JOBOBJECT_IO_ATTRIBUTION_CONTROL_FLAGS {
    JOBOBJECT_IO_ATTRIBUTION_CONTROL_ENABLE = 0x1,
    JOBOBJECT_IO_ATTRIBUTION_CONTROL_DISABLE = 0x2,
    JOBOBJECT_IO_ATTRIBUTION_CONTROL_VALID_FLAGS = 0x3,
}}
STRUCT!{struct JOBOBJECT_IO_ATTRIBUTION_STATS {
    IoCount: ULONG_PTR,
    TotalNonOverlappedQueueTime: ULONGLONG,
    TotalNonOverlappedServiceTime: ULONGLONG,
    TotalSize: ULONGLONG,
}}
pub type PJOBOBJECT_IO_ATTRIBUTION_STATS = *mut JOBOBJECT_IO_ATTRIBUTION_STATS;
STRUCT!{struct JOBOBJECT_IO_ATTRIBUTION_INFORMATION {
    ControlFlags: DWORD,
    ReadStats: JOBOBJECT_IO_ATTRIBUTION_STATS,
    WriteStats: JOBOBJECT_IO_ATTRIBUTION_STATS,
}}
pub type PJOBOBJECT_IO_ATTRIBUTION_INFORMATION = *mut JOBOBJECT_IO_ATTRIBUTION_INFORMATION;
pub const JOB_OBJECT_TERMINATE_AT_END_OF_JOB: DWORD = 0;
pub const JOB_OBJECT_POST_AT_END_OF_JOB: DWORD = 1;
pub const JOB_OBJECT_MSG_END_OF_JOB_TIME: DWORD = 1;
pub const JOB_OBJECT_MSG_END_OF_PROCESS_TIME: DWORD = 2;
pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: DWORD = 3;
pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: DWORD = 4;
pub const JOB_OBJECT_MSG_NEW_PROCESS: DWORD = 6;
pub const JOB_OBJECT_MSG_EXIT_PROCESS: DWORD = 7;
pub const JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: DWORD = 8;
pub const JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: DWORD = 9;
pub const JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: DWORD = 10;
pub const JOB_OBJECT_MSG_NOTIFICATION_LIMIT: DWORD = 11;
pub const JOB_OBJECT_MSG_JOB_CYCLE_TIME_LIMIT: DWORD = 12;
pub const JOB_OBJECT_MSG_SILO_TERMINATED: DWORD = 13;
pub const JOB_OBJECT_MSG_MINIMUM: DWORD = 1;
pub const JOB_OBJECT_MSG_MAXIMUM: DWORD = 13;
pub const JOB_OBJECT_VALID_COMPLETION_FILTER: DWORD = ((1 << (JOB_OBJECT_MSG_MAXIMUM + 1)) - 1)
    - ((1 << JOB_OBJECT_MSG_MINIMUM) - 1);
pub const JOB_OBJECT_LIMIT_WORKINGSET: DWORD = 0x00000001;
pub const JOB_OBJECT_LIMIT_PROCESS_TIME: DWORD = 0x00000002;
pub const JOB_OBJECT_LIMIT_JOB_TIME: DWORD = 0x00000004;
pub const JOB_OBJECT_LIMIT_ACTIVE_PROCESS: DWORD = 0x00000008;
pub const JOB_OBJECT_LIMIT_AFFINITY: DWORD = 0x00000010;
pub const JOB_OBJECT_LIMIT_PRIORITY_CLASS: DWORD = 0x00000020;
pub const JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: DWORD = 0x00000040;
pub const JOB_OBJECT_LIMIT_SCHEDULING_CLASS: DWORD = 0x00000080;
pub const JOB_OBJECT_LIMIT_PROCESS_MEMORY: DWORD = 0x00000100;
pub const JOB_OBJECT_LIMIT_JOB_MEMORY: DWORD = 0x00000200;
pub const JOB_OBJECT_LIMIT_JOB_MEMORY_HIGH: DWORD = JOB_OBJECT_LIMIT_JOB_MEMORY;
pub const JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: DWORD = 0x00000400;
pub const JOB_OBJECT_LIMIT_BREAKAWAY_OK: DWORD = 0x00000800;
pub const JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: DWORD = 0x00001000;
pub const JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: DWORD = 0x00002000;
pub const JOB_OBJECT_LIMIT_SUBSET_AFFINITY: DWORD = 0x00004000;
pub const JOB_OBJECT_LIMIT_JOB_MEMORY_LOW: DWORD = 0x00008000;
pub const JOB_OBJECT_LIMIT_JOB_READ_BYTES: DWORD = 0x00010000;
pub const JOB_OBJECT_LIMIT_JOB_WRITE_BYTES: DWORD = 0x00020000;
pub const JOB_OBJECT_LIMIT_RATE_CONTROL: DWORD = 0x00040000;
pub const JOB_OBJECT_LIMIT_CPU_RATE_CONTROL: DWORD = JOB_OBJECT_LIMIT_RATE_CONTROL;
pub const JOB_OBJECT_LIMIT_IO_RATE_CONTROL: DWORD = 0x00008000;
pub const JOB_OBJECT_LIMIT_NET_RATE_CONTROL: DWORD = 0x00010000;
pub const JOB_OBJECT_LIMIT_VALID_FLAGS: DWORD = 0x0007ffff;
pub const JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: DWORD = 0x000000ff;
pub const JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: DWORD = 0x00007fff;
pub const JOB_OBJECT_NOTIFICATION_LIMIT_VALID_FLAGS: DWORD = JOB_OBJECT_LIMIT_JOB_READ_BYTES
    | JOB_OBJECT_LIMIT_JOB_WRITE_BYTES | JOB_OBJECT_LIMIT_JOB_TIME
    | JOB_OBJECT_LIMIT_JOB_MEMORY_LOW | JOB_OBJECT_LIMIT_JOB_MEMORY_HIGH
    | JOB_OBJECT_LIMIT_CPU_RATE_CONTROL | JOB_OBJECT_LIMIT_IO_RATE_CONTROL
    | JOB_OBJECT_LIMIT_NET_RATE_CONTROL;
pub const JOB_OBJECT_UILIMIT_NONE: DWORD = 0x00000000;
pub const JOB_OBJECT_UILIMIT_HANDLES: DWORD = 0x00000001;
pub const JOB_OBJECT_UILIMIT_READCLIPBOARD: DWORD = 0x00000002;
pub const JOB_OBJECT_UILIMIT_WRITECLIPBOARD: DWORD = 0x00000004;
pub const JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: DWORD = 0x00000008;
pub const JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: DWORD = 0x00000010;
pub const JOB_OBJECT_UILIMIT_GLOBALATOMS: DWORD = 0x00000020;
pub const JOB_OBJECT_UILIMIT_DESKTOP: DWORD = 0x00000040;
pub const JOB_OBJECT_UILIMIT_EXITWINDOWS: DWORD = 0x00000080;
pub const JOB_OBJECT_UILIMIT_ALL: DWORD = 0x000000FF;
pub const JOB_OBJECT_UI_VALID_FLAGS: DWORD = 0x000000FF;
pub const JOB_OBJECT_SECURITY_NO_ADMIN: DWORD = 0x00000001;
pub const JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: DWORD = 0x00000002;
pub const JOB_OBJECT_SECURITY_ONLY_TOKEN: DWORD = 0x00000004;
pub const JOB_OBJECT_SECURITY_FILTER_TOKENS: DWORD = 0x00000008;
pub const JOB_OBJECT_SECURITY_VALID_FLAGS: DWORD = 0x0000000f;
pub const JOB_OBJECT_CPU_RATE_CONTROL_ENABLE: DWORD = 0x1;
pub const JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED: DWORD = 0x2;
pub const JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP: DWORD = 0x4;
pub const JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY: DWORD = 0x8;
pub const JOB_OBJECT_CPU_RATE_CONTROL_MIN_MAX_RATE: DWORD = 0x10;
pub const JOB_OBJECT_CPU_RATE_CONTROL_VALID_FLAGS: DWORD = 0x1f;
ENUM!{enum JOBOBJECTINFOCLASS {
    JobObjectBasicAccountingInformation = 1,
    JobObjectBasicLimitInformation,
    JobObjectBasicProcessIdList,
    JobObjectBasicUIRestrictions,
    JobObjectSecurityLimitInformation,
    JobObjectEndOfJobTimeInformation,
    JobObjectAssociateCompletionPortInformation,
    JobObjectBasicAndIoAccountingInformation,
    JobObjectExtendedLimitInformation,
    JobObjectJobSetInformation,
    JobObjectGroupInformation,
    JobObjectNotificationLimitInformation,
    JobObjectLimitViolationInformation,
    JobObjectGroupInformationEx,
    JobObjectCpuRateControlInformation,
    JobObjectCompletionFilter,
    JobObjectCompletionCounter,
    JobObjectReserved1Information = 18,
    JobObjectReserved2Information,
    JobObjectReserved3Information,
    JobObjectReserved4Information,
    JobObjectReserved5Information,
    JobObjectReserved6Information,
    JobObjectReserved7Information,
    JobObjectReserved8Information,
    JobObjectReserved9Information,
    JobObjectReserved10Information,
    JobObjectReserved11Information,
    JobObjectReserved12Information,
    JobObjectReserved13Information,
    JobObjectReserved14Information = 31,
    JobObjectNetRateControlInformation,
    JobObjectNotificationLimitInformation2,
    JobObjectLimitViolationInformation2,
    JobObjectCreateSilo,
    JobObjectSiloBasicInformation,
    JobObjectReserved15Information = 37,
    JobObjectReserved16Information = 38,
    JobObjectReserved17Information = 39,
    JobObjectReserved18Information = 40,
    JobObjectReserved19Information = 41,
    JobObjectReserved20Information = 42,
    JobObjectReserved21Information = 43,
    JobObjectReserved22Information = 44,
    JobObjectReserved23Information = 45,
    JobObjectReserved24Information = 46,
    JobObjectReserved25Information = 47,
    MaxJobObjectInfoClass,
}}
STRUCT!{struct SILOOBJECT_BASIC_INFORMATION {
    SiloId: DWORD,
    SiloParentId: DWORD,
    NumberOfProcesses: DWORD,
    IsInServerSilo: BOOLEAN,
    Reserved: [BYTE; 3],
}}
pub type PSILOOBJECT_BASIC_INFORMATION = *mut SILOOBJECT_BASIC_INFORMATION;
ENUM!{enum SERVERSILO_STATE {
    SERVERSILO_INITING = 0,
    SERVERSILO_STARTED,
    SERVERSILO_SHUTTING_DOWN,
    SERVERSILO_TERMINATING,
    SERVERSILO_TERMINATED,
}}
pub type PSERVERSILO_STATE = *mut SERVERSILO_STATE;
STRUCT!{struct SERVERSILO_BASIC_INFORMATION {
    ServiceSessionId: DWORD,
    State: SERVERSILO_STATE,
    ExitStatus: DWORD,
}}
pub type PSERVERSILO_BASIC_INFORMATION = *mut SERVERSILO_BASIC_INFORMATION;
ENUM!{enum FIRMWARE_TYPE {
    FirmwareTypeUnknown,
    FirmwareTypeBios,
    FirmwareTypeUefi,
    FirmwareTypeMax,
}}
pub type PFIRMWARE_TYPE = *mut FIRMWARE_TYPE;
pub const EVENT_MODIFY_STATE: DWORD = 0x0002;
pub const EVENT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3;
pub const MUTANT_QUERY_STATE: DWORD = 0x0001;
pub const MUTANT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE;
pub const SEMAPHORE_MODIFY_STATE: DWORD = 0x0002;
pub const SEMAPHORE_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3;
pub const TIMER_QUERY_STATE: DWORD = 0x0001;
pub const TIMER_MODIFY_STATE: DWORD = 0x0002;
pub const TIMER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | TIMER_QUERY_STATE
    | TIMER_MODIFY_STATE;
pub const TIME_ZONE_ID_UNKNOWN: DWORD = 0;
pub const TIME_ZONE_ID_STANDARD: DWORD = 1;
pub const TIME_ZONE_ID_DAYLIGHT: DWORD = 2;
ENUM!{enum LOGICAL_PROCESSOR_RELATIONSHIP {
    RelationProcessorCore,
    RelationNumaNode,
    RelationCache,
    RelationProcessorPackage,
    RelationGroup,
    RelationAll = 0xffff,
}}
pub const LTP_PC_SMT: BYTE = 0x1;
ENUM!{enum PROCESSOR_CACHE_TYPE {
    CacheUnified,
    CacheInstruction,
    CacheData,
    CacheTrace,
}}
pub const CACHE_FULLY_ASSOCIATIVE: BYTE = 0xFF;
STRUCT!{struct CACHE_DESCRIPTOR {
    Level: BYTE,
    Associativity: BYTE,
    LineSize: WORD,
    Size: DWORD,
    Type: PROCESSOR_CACHE_TYPE,
}}
pub type PCACHE_DESCRIPTOR = *mut CACHE_DESCRIPTOR;
STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_ProcessorCore {
    Flags: BYTE,
}}
STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_NumaNode {
    NodeNumber: DWORD,
}}
UNION!{union SYSTEM_LOGICAL_PROCESSOR_INFORMATION_u {
    [u64; 2],
    ProcessorCore ProcessorCore_mut: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_ProcessorCore,
    NumaNode NumaNode_mut: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_NumaNode,
    Cache Cache_mut: CACHE_DESCRIPTOR,
    Reserved Reserved_mut: [ULONGLONG; 2],
}}
STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION {
    ProcessorMask: ULONG_PTR,
    Relationship: LOGICAL_PROCESSOR_RELATIONSHIP,
    u: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_u,
}}
pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION = *mut SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
STRUCT!{struct PROCESSOR_RELATIONSHIP {
    Flags: BYTE,
    EfficiencyClass: BYTE,
    Reserved: [BYTE; 20],
    GroupCount: WORD,
    GroupMask: [GROUP_AFFINITY; ANYSIZE_ARRAY],
}}
pub type PPROCESSOR_RELATIONSHIP = *mut PROCESSOR_RELATIONSHIP;
STRUCT!{struct NUMA_NODE_RELATIONSHIP {
    NodeNumber: DWORD,
    Reserved: [BYTE; 20],
    GroupMask: GROUP_AFFINITY,
}}
pub type PNUMA_NODE_RELATIONSHIP = *mut NUMA_NODE_RELATIONSHIP;
STRUCT!{struct CACHE_RELATIONSHIP {
    Level: BYTE,
    Associativity: BYTE,
    LineSize: WORD,
    CacheSize: DWORD,
    Type: PROCESSOR_CACHE_TYPE,
    Reserved: [BYTE; 20],
    GroupMask: GROUP_AFFINITY,
}}
pub type PCACHE_RELATIONSHIP = *mut CACHE_RELATIONSHIP;
STRUCT!{struct PROCESSOR_GROUP_INFO {
    MaximumProcessorCount: BYTE,
    ActiveProcessorCount: BYTE,
    Reserved: [BYTE; 38],
    ActiveProcessorMask: KAFFINITY,
}}
pub type PPROCESSOR_GROUP_INFO = *mut PROCESSOR_GROUP_INFO;
STRUCT!{struct GROUP_RELATIONSHIP {
    MaximumGroupCount: WORD,
    ActiveGroupCount: WORD,
    Reserved: [BYTE; 20],
    GroupInfo: [PROCESSOR_GROUP_INFO; ANYSIZE_ARRAY],
}}
pub type PGROUP_RELATIONSHIP = *mut GROUP_RELATIONSHIP;
UNION!{union SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX_u {
    [u32; 17] [u64; 9],
    Processor Processor_mut: PROCESSOR_RELATIONSHIP,
    NumaNode NumaNode_mut: NUMA_NODE_RELATIONSHIP,
    Cache Cache_mut: CACHE_RELATIONSHIP,
    Group Group_mut: GROUP_RELATIONSHIP,
}}
STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX {
    Relationship: LOGICAL_PROCESSOR_RELATIONSHIP,
    Size: DWORD,
    u: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX_u,
}}
pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = *mut SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;
ENUM!{enum CPU_SET_INFORMATION_TYPE {
    CpuSetInformation,
}}
pub type PCPU_SET_INFORMATION_TYPE = *mut CPU_SET_INFORMATION_TYPE;
pub const SYSTEM_CPU_SET_INFORMATION_PARKED: BYTE = 0x1;
pub const SYSTEM_CPU_SET_INFORMATION_ALLOCATED: BYTE = 0x2;
pub const SYSTEM_CPU_SET_INFORMATION_ALLOCATED_TO_TARGET_PROCESS: BYTE = 0x4;
pub const SYSTEM_CPU_SET_INFORMATION_REALTIME: BYTE = 0x8;
STRUCT!{struct SYSTEM_CPU_SET_INFORMATION_CpuSet {
    Id: DWORD,
    Group: WORD,
    LogicalProcessorIndex: BYTE,
    CoreIndex: BYTE,
    LastLevelCacheIndex: BYTE,
    NumaNodeIndex: BYTE,
    EfficiencyClass: BYTE,
    AllFlags: BYTE,
    Reserved: DWORD,
    AllocationTag: DWORD64,
}}
BITFIELD!{SYSTEM_CPU_SET_INFORMATION_CpuSet AllFlags: BYTE [
    Parked set_Parked[0..1],
    Allocated set_Allocated[1..2],
    AllocatedToTargetProcess set_AllocatedToTargetProcess[2..3],
    RealTime set_RealTime[3..4],
    ReservedFlags set_ReservedFlags[4..8],
]}
STRUCT!{struct SYSTEM_CPU_SET_INFORMATION {
    Size: DWORD,
    Type: CPU_SET_INFORMATION_TYPE,
    CpuSet: SYSTEM_CPU_SET_INFORMATION_CpuSet,
}}
pub type PSYSTEM_CPU_SET_INFORMATION = *mut SYSTEM_CPU_SET_INFORMATION;
STRUCT!{struct SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION {
    CycleTime: DWORD64,
}}
pub type PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = *mut SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION;
pub const PROCESSOR_INTEL_386: DWORD = 386;
pub const PROCESSOR_INTEL_486: DWORD = 486;
pub const PROCESSOR_INTEL_PENTIUM: DWORD = 586;
pub const PROCESSOR_INTEL_IA64: DWORD = 2200;
pub const PROCESSOR_AMD_X8664: DWORD = 8664;
pub const PROCESSOR_MIPS_R4000: DWORD = 4000;
pub const PROCESSOR_ALPHA_21064: DWORD = 21064;
pub const PROCESSOR_PPC_601: DWORD = 601;
pub const PROCESSOR_PPC_603: DWORD = 603;
pub const PROCESSOR_PPC_604: DWORD = 604;
pub const PROCESSOR_PPC_620: DWORD = 620;
pub const PROCESSOR_HITACHI_SH3: DWORD = 10003;
pub const PROCESSOR_HITACHI_SH3E: DWORD = 10004;
pub const PROCESSOR_HITACHI_SH4: DWORD = 10005;
pub const PROCESSOR_MOTOROLA_821: DWORD = 821;
pub const PROCESSOR_SHx_SH3: DWORD = 103;
pub const PROCESSOR_SHx_SH4: DWORD = 104;
pub const PROCESSOR_STRONGARM: DWORD = 2577;
pub const PROCESSOR_ARM720: DWORD = 1824;
pub const PROCESSOR_ARM820: DWORD = 2080;
pub const PROCESSOR_ARM920: DWORD = 2336;
pub const PROCESSOR_ARM_7TDMI: DWORD = 70001;
pub const PROCESSOR_OPTIL: DWORD = 0x494f;
pub const PROCESSOR_ARCHITECTURE_INTEL: WORD = 0;
pub const PROCESSOR_ARCHITECTURE_MIPS: WORD = 1;
pub const PROCESSOR_ARCHITECTURE_ALPHA: WORD = 2;
pub const PROCESSOR_ARCHITECTURE_PPC: WORD = 3;
pub const PROCESSOR_ARCHITECTURE_SHX: WORD = 4;
pub const PROCESSOR_ARCHITECTURE_ARM: WORD = 5;
pub const PROCESSOR_ARCHITECTURE_IA64: WORD = 6;
pub const PROCESSOR_ARCHITECTURE_ALPHA64: WORD = 7;
pub const PROCESSOR_ARCHITECTURE_MSIL: WORD = 8;
pub const PROCESSOR_ARCHITECTURE_AMD64: WORD = 9;
pub const PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: WORD = 10;
pub const PROCESSOR_ARCHITECTURE_NEUTRAL: WORD = 11;
pub const PROCESSOR_ARCHITECTURE_ARM64: WORD = 12;
pub const PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64: WORD = 13;
pub const PROCESSOR_ARCHITECTURE_IA32_ON_ARM64: WORD = 14;
pub const PROCESSOR_ARCHITECTURE_UNKNOWN: WORD = 0xFFFF;
pub const PF_FLOATING_POINT_PRECISION_ERRATA: DWORD = 0;
pub const PF_FLOATING_POINT_EMULATED: DWORD = 1;
pub const PF_COMPARE_EXCHANGE_DOUBLE: DWORD = 2;
pub const PF_MMX_INSTRUCTIONS_AVAILABLE: DWORD = 3;
pub const PF_PPC_MOVEMEM_64BIT_OK: DWORD = 4;
pub const PF_ALPHA_BYTE_INSTRUCTIONS: DWORD = 5;
pub const PF_XMMI_INSTRUCTIONS_AVAILABLE: DWORD = 6;
pub const PF_3DNOW_INSTRUCTIONS_AVAILABLE: DWORD = 7;
pub const PF_RDTSC_INSTRUCTION_AVAILABLE: DWORD = 8;
pub const PF_PAE_ENABLED: DWORD = 9;
pub const PF_XMMI64_INSTRUCTIONS_AVAILABLE: DWORD = 10;
pub const PF_SSE_DAZ_MODE_AVAILABLE: DWORD = 11;
pub const PF_NX_ENABLED: DWORD = 12;
pub const PF_SSE3_INSTRUCTIONS_AVAILABLE: DWORD = 13;
pub const PF_COMPARE_EXCHANGE128: DWORD = 14;
pub const PF_COMPARE64_EXCHANGE128: DWORD = 15;
pub const PF_CHANNELS_ENABLED: DWORD = 16;
pub const PF_XSAVE_ENABLED: DWORD = 17;
pub const PF_ARM_VFP_32_REGISTERS_AVAILABLE: DWORD = 18;
pub const PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: DWORD = 19;
pub const PF_SECOND_LEVEL_ADDRESS_TRANSLATION: DWORD = 20;
pub const PF_VIRT_FIRMWARE_ENABLED: DWORD = 21;
pub const PF_RDWRFSGSBASE_AVAILABLE: DWORD = 22;
pub const PF_FASTFAIL_AVAILABLE: DWORD = 23;
pub const PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE: DWORD = 24;
pub const PF_ARM_64BIT_LOADSTORE_ATOMIC: DWORD = 25;
pub const PF_ARM_EXTERNAL_CACHE_AVAILABLE: DWORD = 26;
pub const PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE: DWORD = 27;
pub const PF_RDRAND_INSTRUCTION_AVAILABLE: DWORD = 28;
pub const PF_ARM_V8_INSTRUCTIONS_AVAILABLE: DWORD = 29;
pub const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: DWORD = 30;
pub const PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE: DWORD = 31;
pub const PF_RDTSCP_INSTRUCTION_AVAILABLE: DWORD = 32;
pub const XSTATE_LEGACY_FLOATING_POINT: ULONG64 = 0;
pub const XSTATE_LEGACY_SSE: ULONG64 = 1;
pub const XSTATE_GSSE: ULONG64 = 2;
pub const XSTATE_AVX: ULONG64 = XSTATE_GSSE;
pub const XSTATE_MPX_BNDREGS: ULONG64 = 3;
pub const XSTATE_MPX_BNDCSR: ULONG64 = 4;
pub const XSTATE_AVX512_KMASK: ULONG64 = 5;
pub const XSTATE_AVX512_ZMM_H: ULONG64 = 6;
pub const XSTATE_AVX512_ZMM: ULONG64 = 7;
pub const XSTATE_IPT: ULONG64 = 8;
pub const XSTATE_LWP: ULONG64 = 62;
pub const MAXIMUM_XSTATE_FEATURES: usize = 64;
pub const XSTATE_MASK_LEGACY_FLOATING_POINT: ULONG64 = 1 << XSTATE_LEGACY_FLOATING_POINT;
pub const XSTATE_MASK_LEGACY_SSE: ULONG64 = 1 << XSTATE_LEGACY_SSE;
pub const XSTATE_MASK_LEGACY: ULONG64 = XSTATE_MASK_LEGACY_FLOATING_POINT | XSTATE_MASK_LEGACY_SSE;
pub const XSTATE_MASK_GSSE: ULONG64 = 1 << XSTATE_GSSE;
pub const XSTATE_MASK_AVX: ULONG64 = XSTATE_MASK_GSSE;
pub const XSTATE_MASK_MPX: ULONG64 = (1 << XSTATE_MPX_BNDREGS) | (1 << XSTATE_MPX_BNDCSR);
pub const XSTATE_MASK_AVX512: ULONG64 = (1 << XSTATE_AVX512_KMASK) | (1 << XSTATE_AVX512_ZMM_H)
    | (1 << XSTATE_AVX512_ZMM);
pub const XSTATE_MASK_IPT: ULONG64 = 1 << XSTATE_IPT;
pub const XSTATE_MASK_LWP: ULONG64 = 1 << XSTATE_LWP;
pub const XSTATE_MASK_ALLOWED: ULONG64 = XSTATE_MASK_LEGACY | XSTATE_MASK_AVX | XSTATE_MASK_MPX
    | XSTATE_MASK_AVX512 | XSTATE_MASK_IPT | XSTATE_MASK_LWP;
pub const XSTATE_MASK_PERSISTENT: ULONG64 = (1 << XSTATE_MPX_BNDCSR) | XSTATE_MASK_LWP;
pub const XSTATE_COMPACTION_ENABLE: ULONG64 = 63;
pub const XSTATE_COMPACTION_ENABLE_MASK: ULONG64 = 1 << XSTATE_COMPACTION_ENABLE;
pub const XSTATE_ALIGN_BIT: ULONG64 = 1;
pub const XSTATE_ALIGN_MASK: ULONG64 = 1 << XSTATE_ALIGN_BIT;
pub const XSTATE_CONTROLFLAG_XSAVEOPT_MASK: ULONG64 = 1;
pub const XSTATE_CONTROLFLAG_XSAVEC_MASK: ULONG64 = 2;
pub const XSTATE_CONTROLFLAG_VALID_MASK: ULONG64 = XSTATE_CONTROLFLAG_XSAVEOPT_MASK
    | XSTATE_CONTROLFLAG_XSAVEC_MASK;
STRUCT!{struct XSTATE_FEATURE {
    Offset: DWORD,
    Size: DWORD,
}}
pub type PXSTATE_FEATURE = *mut XSTATE_FEATURE;
STRUCT!{struct XSTATE_CONFIGURATION {
    EnabledFeatures: DWORD64,
    EnabledVolatileFeatures: DWORD64,
    Size: DWORD,
    ControlFlags: DWORD,
    Features: [XSTATE_FEATURE; MAXIMUM_XSTATE_FEATURES],
    EnabledSupervisorFeatures: DWORD64,
    AlignedFeatures: DWORD64,
    AllFeatureSize: DWORD,
    AllFeatures: [DWORD; MAXIMUM_XSTATE_FEATURES],
}}
BITFIELD!{XSTATE_CONFIGURATION ControlFlags: DWORD [
    OptimizedSave set_OptimizedSave[0..1],
    CompactionEnabled set_CompactionEnabled[1..2],
]}
pub type PXSTATE_CONFIGURATION = *mut XSTATE_CONFIGURATION;
STRUCT!{struct MEMORY_BASIC_INFORMATION {
    BaseAddress: PVOID,
    AllocationBase: PVOID,
    AllocationProtect: DWORD,
    RegionSize: SIZE_T,
    State: DWORD,
    Protect: DWORD,
    Type: DWORD,
}}
pub type PMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
STRUCT!{struct MEMORY_BASIC_INFORMATION32 {
    BaseAddress: DWORD,
    AllocationBase: DWORD,
    AllocationProtect: DWORD,
    RegionSize: DWORD,
    State: DWORD,
    Protect: DWORD,
    Type: DWORD,
}}
pub type PMEMORY_BASIC_INFORMATION32 = *mut MEMORY_BASIC_INFORMATION32;
STRUCT!{struct MEMORY_BASIC_INFORMATION64 { // FIXME: align 16
    BaseAddress: ULONGLONG,
    AllocationBase: ULONGLONG,
    AllocationProtect: DWORD,
    __alignment1: DWORD,
    RegionSize: ULONGLONG,
    State: DWORD,
    Protect: DWORD,
    Type: DWORD,
    __alignment2: DWORD,
}}
pub type PMEMORY_BASIC_INFORMATION64 = *mut MEMORY_BASIC_INFORMATION64;
pub const CFG_CALL_TARGET_VALID: ULONG_PTR = 0x00000001;
pub const CFG_CALL_TARGET_PROCESSED: ULONG_PTR = 0x00000002;
pub const CFG_CALL_TARGET_CONVERT_EXPORT_SUPPRESSED_TO_VALID: ULONG_PTR = 0x00000004;
STRUCT!{struct CFG_CALL_TARGET_INFO {
    Offset: ULONG_PTR,
    Flags: ULONG_PTR,
}}
pub type PCFG_CALL_TARGET_INFO = *mut CFG_CALL_TARGET_INFO;
pub const SECTION_QUERY: DWORD = 0x0001;
pub const SECTION_MAP_WRITE: DWORD = 0x0002;
pub const SECTION_MAP_READ: DWORD = 0x0004;
pub const SECTION_MAP_EXECUTE: DWORD = 0x0008;
pub const SECTION_EXTEND_SIZE: DWORD = 0x0010;
pub const SECTION_MAP_EXECUTE_EXPLICIT: DWORD = 0x0020;
pub const SECTION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY
    | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE;
pub const SESSION_QUERY_ACCESS: DWORD = 0x0001;
pub const SESSION_MODIFY_ACCESS: DWORD = 0x0002;
pub const SESSION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SESSION_QUERY_ACCESS
    | SESSION_MODIFY_ACCESS;
pub const MEMORY_PARTITION_QUERY_ACCESS: DWORD = 0x0001;
pub const MEMORY_PARTITION_MODIFY_ACCESS: DWORD = 0x0002;
pub const MEMORY_PARTITION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE
    | MEMORY_PARTITION_QUERY_ACCESS | MEMORY_PARTITION_MODIFY_ACCESS;
pub const PAGE_NOACCESS: DWORD = 0x01;
pub const PAGE_READONLY: DWORD = 0x02;
pub const PAGE_READWRITE: DWORD = 0x04;
pub const PAGE_WRITECOPY: DWORD = 0x08;
pub const PAGE_EXECUTE: DWORD = 0x10;
pub const PAGE_EXECUTE_READ: DWORD = 0x20;
pub const PAGE_EXECUTE_READWRITE: DWORD = 0x40;
pub const PAGE_EXECUTE_WRITECOPY: DWORD = 0x80;
pub const PAGE_GUARD: DWORD = 0x100;
pub const PAGE_NOCACHE: DWORD = 0x200;
pub const PAGE_WRITECOMBINE: DWORD = 0x400;
pub const PAGE_ENCLAVE_THREAD_CONTROL: DWORD = 0x80000000;
pub const PAGE_REVERT_TO_FILE_MAP: DWORD = 0x80000000;
pub const PAGE_TARGETS_NO_UPDATE: DWORD = 0x40000000;
pub const PAGE_TARGETS_INVALID: DWORD = 0x40000000;
pub const PAGE_ENCLAVE_UNVALIDATED: DWORD = 0x20000000;
pub const PAGE_ENCLAVE_DECOMMIT: DWORD = 0x10000000;
pub const MEM_COMMIT: DWORD = 0x1000;
pub const MEM_RESERVE: DWORD = 0x2000;
pub const MEM_DECOMMIT: DWORD = 0x4000;
pub const MEM_RELEASE: DWORD = 0x8000;
pub const MEM_FREE: DWORD = 0x10000;
pub const MEM_PRIVATE: DWORD = 0x20000;
pub const MEM_MAPPED: DWORD = 0x40000;
pub const MEM_RESET: DWORD = 0x80000;
pub const MEM_TOP_DOWN: DWORD = 0x100000;
pub const MEM_WRITE_WATCH: DWORD = 0x200000;
pub const MEM_PHYSICAL: DWORD = 0x400000;
pub const MEM_ROTATE: DWORD = 0x800000;
pub const MEM_DIFFERENT_IMAGE_BASE_OK: DWORD = 0x800000;
pub const MEM_RESET_UNDO: DWORD = 0x1000000;
pub const MEM_LARGE_PAGES: DWORD = 0x20000000;
pub const MEM_4MB_PAGES: DWORD = 0x80000000;
pub const MEM_64K_PAGES: DWORD = MEM_LARGE_PAGES | MEM_PHYSICAL;
pub const SEC_64K_PAGES: DWORD = 0x00080000;
pub const SEC_FILE: DWORD = 0x800000;
pub const SEC_IMAGE: DWORD = 0x1000000;
pub const SEC_PROTECTED_IMAGE: DWORD = 0x2000000;
pub const SEC_RESERVE: DWORD = 0x4000000;
pub const SEC_COMMIT: DWORD = 0x8000000;
pub const SEC_NOCACHE: DWORD = 0x10000000;
pub const SEC_WRITECOMBINE: DWORD = 0x40000000;
pub const SEC_LARGE_PAGES: DWORD = 0x80000000;
pub const SEC_IMAGE_NO_EXECUTE: DWORD = SEC_IMAGE | SEC_NOCACHE;
pub const MEM_IMAGE: DWORD = SEC_IMAGE;
pub const WRITE_WATCH_FLAG_RESET: DWORD = 0x01;
pub const MEM_UNMAP_WITH_TRANSIENT_BOOST: DWORD = 0x01;
pub const ENCLAVE_TYPE_SGX: DWORD = 0x00000001;
pub const ENCLAVE_TYPE_SGX2: DWORD = 0x00000002;
STRUCT!{struct ENCLAVE_CREATE_INFO_SGX {
    Secs: [BYTE; 4096],
}}
pub type PENCLAVE_CREATE_INFO_SGX = *mut ENCLAVE_CREATE_INFO_SGX;
STRUCT!{struct ENCLAVE_INIT_INFO_SGX {
    SigStruct: [BYTE; 1808],
    Reserved1: [BYTE; 240],
    EInitToken: [BYTE; 304],
    Reserved2: [BYTE; 1744],
}}
pub type PENCLAVE_INIT_INFO_SGX = *mut ENCLAVE_INIT_INFO_SGX;
pub const FILE_READ_DATA: DWORD = 0x0001;
pub const FILE_LIST_DIRECTORY: DWORD = 0x0001;
pub const FILE_WRITE_DATA: DWORD = 0x0002;
pub const FILE_ADD_FILE: DWORD = 0x0002;
pub const FILE_APPEND_DATA: DWORD = 0x0004;
pub const FILE_ADD_SUBDIRECTORY: DWORD = 0x0004;
pub const FILE_CREATE_PIPE_INSTANCE: DWORD = 0x0004;
pub const FILE_READ_EA: DWORD = 0x0008;
pub const FILE_WRITE_EA: DWORD = 0x0010;
pub const FILE_EXECUTE: DWORD = 0x0020;
pub const FILE_TRAVERSE: DWORD = 0x0020;
pub const FILE_DELETE_CHILD: DWORD = 0x0040;
pub const FILE_READ_ATTRIBUTES: DWORD = 0x0080;
pub const FILE_WRITE_ATTRIBUTES: DWORD = 0x0100;
pub const FILE_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF;
pub const FILE_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | FILE_READ_DATA
    | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE;
pub const FILE_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA
    | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE;
pub const FILE_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES
    | FILE_EXECUTE | SYNCHRONIZE;
pub const FILE_SHARE_READ: DWORD = 0x00000001;
pub const FILE_SHARE_WRITE: DWORD = 0x00000002;
pub const FILE_SHARE_DELETE: DWORD = 0x00000004;
pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x00000001;
pub const FILE_ATTRIBUTE_HIDDEN: DWORD = 0x00000002;
pub const FILE_ATTRIBUTE_SYSTEM: DWORD = 0x00000004;
pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x00000010;
pub const FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x00000020;
pub const FILE_ATTRIBUTE_DEVICE: DWORD = 0x00000040;
pub const FILE_ATTRIBUTE_NORMAL: DWORD = 0x00000080;
pub const FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x00000100;
pub const FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x00000200;
pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x00000400;
pub const FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x00000800;
pub const FILE_ATTRIBUTE_OFFLINE: DWORD = 0x00001000;
pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x00002000;
pub const FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x00004000;
pub const FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x00008000;
pub const FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x00010000;
pub const FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x00020000;
pub const FILE_ATTRIBUTE_EA: DWORD = 0x00040000;
pub const FILE_ATTRIBUTE_PINNED: DWORD = 0x00080000;
pub const FILE_ATTRIBUTE_UNPINNED: DWORD = 0x00100000;
pub const FILE_ATTRIBUTE_RECALL_ON_OPEN: DWORD = 0x00040000;
pub const FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS: DWORD = 0x00400000;
pub const FILE_NOTIFY_CHANGE_FILE_NAME: DWORD = 0x00000001;
pub const FILE_NOTIFY_CHANGE_DIR_NAME: DWORD = 0x00000002;
pub const FILE_NOTIFY_CHANGE_ATTRIBUTES: DWORD = 0x00000004;
pub const FILE_NOTIFY_CHANGE_SIZE: DWORD = 0x00000008;
pub const FILE_NOTIFY_CHANGE_LAST_WRITE: DWORD = 0x00000010;
pub const FILE_NOTIFY_CHANGE_LAST_ACCESS: DWORD = 0x00000020;
pub const FILE_NOTIFY_CHANGE_CREATION: DWORD = 0x00000040;
pub const FILE_NOTIFY_CHANGE_SECURITY: DWORD = 0x00000100;
pub const FILE_ACTION_ADDED: DWORD = 0x00000001;
pub const FILE_ACTION_REMOVED: DWORD = 0x00000002;
pub const FILE_ACTION_MODIFIED: DWORD = 0x00000003;
pub const FILE_ACTION_RENAMED_OLD_NAME: DWORD = 0x00000004;
pub const FILE_ACTION_RENAMED_NEW_NAME: DWORD = 0x00000005;
pub const MAILSLOT_NO_MESSAGE: DWORD = 0xFFFFFFFF;
pub const MAILSLOT_WAIT_FOREVER: DWORD = 0xFFFFFFFF;
pub const FILE_CASE_SENSITIVE_SEARCH: DWORD = 0x00000001;
pub const FILE_CASE_PRESERVED_NAMES: DWORD = 0x00000002;
pub const FILE_UNICODE_ON_DISK: DWORD = 0x00000004;
pub const FILE_PERSISTENT_ACLS: DWORD = 0x00000008;
pub const FILE_FILE_COMPRESSION: DWORD = 0x00000010;
pub const FILE_VOLUME_QUOTAS: DWORD = 0x00000020;
pub const FILE_SUPPORTS_SPARSE_FILES: DWORD = 0x00000040;
pub const FILE_SUPPORTS_REPARSE_POINTS: DWORD = 0x00000080;
pub const FILE_SUPPORTS_REMOTE_STORAGE: DWORD = 0x00000100;
pub const FILE_RETURNS_CLEANUP_RESULT_INFO: DWORD = 0x00000200;
pub const FILE_VOLUME_IS_COMPRESSED: DWORD = 0x00008000;
pub const FILE_SUPPORTS_OBJECT_IDS: DWORD = 0x00010000;
pub const FILE_SUPPORTS_ENCRYPTION: DWORD = 0x00020000;
pub const FILE_NAMED_STREAMS: DWORD = 0x00040000;
pub const FILE_READ_ONLY_VOLUME: DWORD = 0x00080000;
pub const FILE_SEQUENTIAL_WRITE_ONCE: DWORD = 0x00100000;
pub const FILE_SUPPORTS_TRANSACTIONS: DWORD = 0x00200000;
pub const FILE_SUPPORTS_HARD_LINKS: DWORD = 0x00400000;
pub const FILE_SUPPORTS_EXTENDED_ATTRIBUTES: DWORD = 0x00800000;
pub const FILE_SUPPORTS_OPEN_BY_FILE_ID: DWORD = 0x01000000;
pub const FILE_SUPPORTS_USN_JOURNAL: DWORD = 0x02000000;
pub const FILE_SUPPORTS_INTEGRITY_STREAMS: DWORD = 0x04000000;
pub const FILE_SUPPORTS_BLOCK_REFCOUNTING: DWORD = 0x08000000;
pub const FILE_SUPPORTS_SPARSE_VDL: DWORD = 0x10000000;
pub const FILE_DAX_VOLUME: DWORD = 0x20000000;
pub const FILE_SUPPORTS_GHOSTING: DWORD = 0x40000000;
pub const FILE_INVALID_FILE_ID: LONGLONG = -1;
STRUCT!{struct FILE_ID_128 {
    Identifier: [BYTE; 16],
}}
pub type PFILE_ID_128 = *mut FILE_ID_128;
STRUCT!{struct FILE_NOTIFY_INFORMATION {
    NextEntryOffset: DWORD,
    Action: DWORD,
    FileNameLength: DWORD,
    FileName: [WCHAR; 1],
}}
UNION!{union FILE_SEGMENT_ELEMENT {
    [u64; 1],
    Buffer Buffer_mut: PVOID64,
    Alignment Alignment_mut: ULONGLONG,
}}
pub type PFILE_SEGMENT_ELEMENT = *mut FILE_SEGMENT_ELEMENT;
pub const FLUSH_FLAGS_FILE_DATA_ONLY: ULONG = 0x00000001;
pub const FLUSH_FLAGS_NO_SYNC: ULONG = 0x00000002;
pub const FLUSH_FLAGS_FILE_DATA_SYNC_ONLY: ULONG = 0x00000004;
STRUCT!{struct REPARSE_GUID_DATA_BUFFER_GenericReparseBuffer {
    DataBuffer: [BYTE; 1],
}}
STRUCT!{struct REPARSE_GUID_DATA_BUFFER {
    ReparseTag: DWORD,
    ReparseDataLength: WORD,
    Reserved: WORD,
    ReparseGuid: GUID,
    GenericReparseBuffer: REPARSE_GUID_DATA_BUFFER_GenericReparseBuffer,
}}
pub type PREPARSE_GUID_DATA_BUFFER = *mut REPARSE_GUID_DATA_BUFFER;
pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: DWORD = 16 * 1024;
pub const IO_REPARSE_TAG_RESERVED_ZERO: DWORD = 0;
pub const IO_REPARSE_TAG_RESERVED_ONE: DWORD = 1;
pub const IO_REPARSE_TAG_RESERVED_TWO: DWORD = 2;
pub const IO_REPARSE_TAG_RESERVED_RANGE: DWORD = IO_REPARSE_TAG_RESERVED_TWO;
#[inline]
pub fn IsReparseTagMicrosoft(_tag: DWORD) -> bool {
    (_tag & 0x80000000) != 0
}
#[inline]
pub fn IsReparseTagNameSurrogate(_tag: DWORD) -> bool {
    (_tag & 0x20000000) != 0
}
#[inline]
pub fn IsReparseTagDirectory(_tag: DWORD) -> bool {
    (_tag & 0x10000000) != 0
}
pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xA0000003;
pub const IO_REPARSE_TAG_HSM: DWORD = 0xC0000004;
pub const IO_REPARSE_TAG_HSM2: DWORD = 0x80000006;
pub const IO_REPARSE_TAG_SIS: DWORD = 0x80000007;
pub const IO_REPARSE_TAG_WIM: DWORD = 0x80000008;
pub const IO_REPARSE_TAG_CSV: DWORD = 0x80000009;
pub const IO_REPARSE_TAG_DFS: DWORD = 0x8000000A;
pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xA000000C;
pub const IO_REPARSE_TAG_DFSR: DWORD = 0x80000012;
pub const IO_REPARSE_TAG_DEDUP: DWORD = 0x80000013;
pub const IO_REPARSE_TAG_NFS: DWORD = 0x80000014;
pub const IO_REPARSE_TAG_FILE_PLACEHOLDER: DWORD = 0x80000015;
pub const IO_REPARSE_TAG_WOF: DWORD = 0x80000017;
pub const IO_REPARSE_TAG_WCI: DWORD = 0x80000018;
pub const IO_REPARSE_TAG_GLOBAL_REPARSE: DWORD = 0xA0000019;
pub const IO_REPARSE_TAG_CLOUD: DWORD = 0x9000001A;
pub const IO_REPARSE_TAG_CLOUD_ROOT: DWORD = 0x9000101A;
pub const IO_REPARSE_TAG_CLOUD_ON_DEMAND: DWORD = 0x9000201A;
pub const IO_REPARSE_TAG_CLOUD_ROOT_ON_DEMAND: DWORD = 0x9000301A;
pub const IO_REPARSE_TAG_APPEXECLINK: DWORD = 0x8000001B;
pub const IO_REPARSE_TAG_GVFS: DWORD = 0x9000001C;
pub const IO_REPARSE_TAG_WCI_TOMBSTONE: DWORD = 0xA000001F;
pub const IO_REPARSE_TAG_UNHANDLED: DWORD = 0x80000020;
pub const IO_REPARSE_TAG_ONEDRIVE: DWORD = 0x80000021;
pub const IO_REPARSE_TAG_GVFS_TOMBSTONE: DWORD = 0xA0000022;
pub const SCRUB_DATA_INPUT_FLAG_RESUME: DWORD = 0x00000001;
pub const SCRUB_DATA_INPUT_FLAG_SKIP_IN_SYNC: DWORD = 0x00000002;
pub const SCRUB_DATA_INPUT_FLAG_SKIP_NON_INTEGRITY_DATA: DWORD = 0x00000004;
pub const SCRUB_DATA_OUTPUT_FLAG_INCOMPLETE: DWORD = 0x00000001;
pub const SCRUB_DATA_OUTPUT_FLAG_NON_USER_DATA_RANGE: DWORD = 0x00010000;
pub const SCRUB_DATA_OUTPUT_FLAG_PARITY_EXTENT_DATA_RETURNED: DWORD = 0x00020000;
pub const SCRUB_DATA_OUTPUT_FLAG_RESUME_CONTEXT_LENGTH_SPECIFIED: DWORD = 0x00040000;
STRUCT!{struct SCRUB_DATA_INPUT {
    Size: DWORD,
    Flags: DWORD,
    MaximumIos: DWORD,
    Reserved: [DWORD; 17],
    ResumeContext: [BYTE; 816],
}}
pub type PSCRUB_DATA_INPUT = *mut SCRUB_DATA_INPUT;
STRUCT!{struct SCRUB_PARITY_EXTENT {
    Offset: LONGLONG,
    Length: ULONGLONG,
}}
pub type PSCRUB_PARITY_EXTENT = *mut SCRUB_PARITY_EXTENT;
STRUCT!{struct SCRUB_PARITY_EXTENT_DATA {
    Size: WORD,
    Flags: WORD,
    NumberOfParityExtents: WORD,
    MaximumNumberOfParityExtents: WORD,
    ParityExtents: [SCRUB_PARITY_EXTENT; ANYSIZE_ARRAY],
}}
pub type PSCRUB_PARITY_EXTENT_DATA = *mut SCRUB_PARITY_EXTENT_DATA;
STRUCT!{struct SCRUB_DATA_OUTPUT {
    Size: DWORD,
    Flags: DWORD,
    Status: DWORD,
    ErrorFileOffset: ULONGLONG,
    ErrorLength: ULONGLONG,
    NumberOfBytesRepaired: ULONGLONG,
    NumberOfBytesFailed: ULONGLONG,
    InternalFileReference: ULONGLONG,
    ResumeContextLength: WORD,
    ParityExtentDataOffset: WORD,
    Reserved: [DWORD; 5],
    ResumeContext: [BYTE; 816],
}}
pub type PSCRUB_DATA_OUTPUT = *mut SCRUB_DATA_OUTPUT;
ENUM!{enum SharedVirtualDiskSupportType {
    SharedVirtualDisksUnsupported = 0,
    SharedVirtualDisksSupported = 1,
    SharedVirtualDiskSnapshotsSupported = 3,
    SharedVirtualDiskCDPSnapshotsSupported = 7,
}}
ENUM!{enum SharedVirtualDiskHandleState {
    SharedVirtualDiskHandleStateNone = 0,
    SharedVirtualDiskHandleStateFileShared = 1,
    SharedVirtualDiskHandleStateHandleShared = 3,
}}
STRUCT!{struct SHARED_VIRTUAL_DISK_SUPPORT {
    SharedVirtualDiskSupport: SharedVirtualDiskSupportType,
    HandleState: SharedVirtualDiskHandleState,
}}
pub type PSHARED_VIRTUAL_DISK_SUPPORT = *mut SHARED_VIRTUAL_DISK_SUPPORT;
#[inline]
pub fn IsVirtualDiskFileShared(HandleState: SharedVirtualDiskHandleState) -> bool {
    (HandleState & SharedVirtualDiskHandleStateFileShared) != 0
}
pub const IO_COMPLETION_MODIFY_STATE: DWORD = 0x0002;
pub const IO_COMPLETION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3;
pub const IO_QOS_MAX_RESERVATION: DWORD64 = 1000000000;
pub const SMB_CCF_APP_INSTANCE_EA_NAME: &'static str = "ClusteredApplicationInstance";
pub const NETWORK_APP_INSTANCE_CSV_FLAGS_VALID_ONLY_IF_CSV_COORDINATOR: DWORD = 0x00000001;
STRUCT!{struct NETWORK_APP_INSTANCE_EA {
    AppInstanceID: GUID,
    CsvFlags: DWORD,
}}
pub type PNETWORK_APP_INSTANCE_EA = *mut NETWORK_APP_INSTANCE_EA;
pub const DUPLICATE_CLOSE_SOURCE: DWORD = 0x00000001;
pub const DUPLICATE_SAME_ACCESS: DWORD = 0x00000002;
DEFINE_GUID!{GUID_MAX_POWER_SAVINGS,
    0xa1841308, 0x3541, 0x4fab, 0xbc, 0x81, 0xf7, 0x15, 0x56, 0xf2, 0x0b, 0x4a}
DEFINE_GUID!{GUID_MIN_POWER_SAVINGS,
    0x8c5e7fda, 0xe8bf, 0x4a96, 0x9a, 0x85, 0xa6, 0xe2, 0x3a, 0x8c, 0x63, 0x5c}
DEFINE_GUID!{GUID_TYPICAL_POWER_SAVINGS,
    0x381b4222, 0xf694, 0x41f0, 0x96, 0x85, 0xff, 0x5b, 0xb2, 0x60, 0xdf, 0x2e}
DEFINE_GUID!{NO_SUBGROUP_GUID,
    0xfea3413e, 0x7e05, 0x4911, 0x9a, 0x71, 0x70, 0x03, 0x31, 0xf1, 0xc2, 0x94}
DEFINE_GUID!{ALL_POWERSCHEMES_GUID,
    0x68a1e95e, 0x13ea, 0x41e1, 0x80, 0x11, 0x0c, 0x49, 0x6c, 0xa4, 0x90, 0xb0}
DEFINE_GUID!{GUID_POWERSCHEME_PERSONALITY,
    0x245d8541, 0x3943, 0x4422, 0xb0, 0x25, 0x13, 0xa7, 0x84, 0xf6, 0x79, 0xb7}
DEFINE_GUID!{GUID_ACTIVE_POWERSCHEME,
    0x31f9f286, 0x5084, 0x42fe, 0xb7, 0x20, 0x2b, 0x02, 0x64, 0x99, 0x37, 0x63}
DEFINE_GUID!{GUID_IDLE_RESILIENCY_SUBGROUP,
    0x2e601130, 0x5351, 0x4d9d, 0x8e, 0x4, 0x25, 0x29, 0x66, 0xba, 0xd0, 0x54}
DEFINE_GUID!{GUID_IDLE_RESILIENCY_PERIOD,
    0xc42b79aa, 0xaa3a, 0x484b, 0xa9, 0x8f, 0x2c, 0xf3, 0x2a, 0xa9, 0xa, 0x28}
DEFINE_GUID!{GUID_DEEP_SLEEP_ENABLED,
    0xd502f7ee, 0x1dc7, 0x4efd, 0xa5, 0x5d, 0xf0, 0x4b, 0x6f, 0x5c, 0x5, 0x45}
DEFINE_GUID!{GUID_DEEP_SLEEP_PLATFORM_STATE,
    0xd23f2fb8, 0x9536, 0x4038, 0x9c, 0x94, 0x1c, 0xe0, 0x2e, 0x5c, 0x21, 0x52}
DEFINE_GUID!{GUID_DISK_COALESCING_POWERDOWN_TIMEOUT,
    0xc36f0eb4, 0x2988, 0x4a70, 0x8e, 0xee, 0x8, 0x84, 0xfc, 0x2c, 0x24, 0x33}
DEFINE_GUID!{GUID_EXECUTION_REQUIRED_REQUEST_TIMEOUT,
    0x3166bc41, 0x7e98, 0x4e03, 0xb3, 0x4e, 0xec, 0xf, 0x5f, 0x2b, 0x21, 0x8e}
DEFINE_GUID!{GUID_VIDEO_SUBGROUP,
    0x7516b95f, 0xf776, 0x4464, 0x8c, 0x53, 0x06, 0x16, 0x7f, 0x40, 0xcc, 0x99}
DEFINE_GUID!{GUID_VIDEO_POWERDOWN_TIMEOUT,
    0x3c0bc021, 0xc8a8, 0x4e07, 0xa9, 0x73, 0x6b, 0x14, 0xcb, 0xcb, 0x2b, 0x7e}
DEFINE_GUID!{GUID_VIDEO_ANNOYANCE_TIMEOUT,
    0x82dbcf2d, 0xcd67, 0x40c5, 0xbf, 0xdc, 0x9f, 0x1a, 0x5c, 0xcd, 0x46, 0x63}
DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE,
    0xeed904df, 0xb142, 0x4183, 0xb1, 0x0b, 0x5a, 0x11, 0x97, 0xa3, 0x78, 0x64}
DEFINE_GUID!{GUID_VIDEO_DIM_TIMEOUT,
    0x17aaa29b, 0x8b43, 0x4b94, 0xaa, 0xfe, 0x35, 0xf6, 0x4d, 0xaa, 0xf1, 0xee}
DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_POWERDOWN,
    0x90959d22, 0xd6a1, 0x49b9, 0xaf, 0x93, 0xbc, 0xe8, 0x85, 0xad, 0x33, 0x5b}
DEFINE_GUID!{GUID_MONITOR_POWER_ON,
    0x02731015, 0x4510, 0x4526, 0x99, 0xe6, 0xe5, 0xa1, 0x7e, 0xbd, 0x1a, 0xea}
DEFINE_GUID!{GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS,
    0xaded5e82, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb}
DEFINE_GUID!{GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS,
    0xf1fbfde2, 0xa960, 0x4165, 0x9f, 0x88, 0x50, 0x66, 0x79, 0x11, 0xce, 0x96}
DEFINE_GUID!{GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS,
    0x8ffee2c6, 0x2d01, 0x46be, 0xad, 0xb9, 0x39, 0x8a, 0xdd, 0xc5, 0xb4, 0xff}
DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS,
    0xfbd9aa66, 0x9553, 0x4097, 0xba, 0x44, 0xed, 0x6e, 0x9d, 0x65, 0xea, 0xb8}
DEFINE_GUID!{GUID_CONSOLE_DISPLAY_STATE,
    0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47}
DEFINE_GUID!{GUID_ALLOW_DISPLAY_REQUIRED,
    0xa9ceb8da, 0xcd46, 0x44fb, 0xa9, 0x8b, 0x02, 0xaf, 0x69, 0xde, 0x46, 0x23}
DEFINE_GUID!{GUID_VIDEO_CONSOLE_LOCK_TIMEOUT,
    0x8ec4b3a5, 0x6868, 0x48c2, 0xbe, 0x75, 0x4f, 0x30, 0x44, 0xbe, 0x88, 0xa7}
DEFINE_GUID!{GUID_ADAPTIVE_POWER_BEHAVIOR_SUBGROUP,
    0x8619b916, 0xe004, 0x4dd8, 0x9b, 0x66, 0xda, 0xe8, 0x6f, 0x80, 0x66, 0x98}
DEFINE_GUID!{GUID_NON_ADAPTIVE_INPUT_TIMEOUT,
    0x5adbbfbc, 0x74e, 0x4da1, 0xba, 0x38, 0xdb, 0x8b, 0x36, 0xb2, 0xc8, 0xf3}
DEFINE_GUID!{GUID_ADAPTIVE_INPUT_CONTROLLER_STATE,
    0xe98fae9, 0xf45a, 0x4de1, 0xa7, 0x57, 0x60, 0x31, 0xf1, 0x97, 0xf6, 0xea}
DEFINE_GUID!{GUID_DISK_SUBGROUP,
    0x0012ee47, 0x9041, 0x4b5d, 0x9b, 0x77, 0x53, 0x5f, 0xba, 0x8b, 0x14, 0x42}
DEFINE_GUID!{GUID_DISK_MAX_POWER,
    0x51dea550, 0xbb38, 0x4bc4, 0x99, 0x1b, 0xea, 0xcf, 0x37, 0xbe, 0x5e, 0xc8}
DEFINE_GUID!{GUID_DISK_POWERDOWN_TIMEOUT,
    0x6738e2c4, 0xe8a5, 0x4a42, 0xb1, 0x6a, 0xe0, 0x40, 0xe7, 0x69, 0x75, 0x6e}
DEFINE_GUID!{GUID_DISK_IDLE_TIMEOUT,
    0x58e39ba8, 0xb8e6, 0x4ef6, 0x90, 0xd0, 0x89, 0xae, 0x32, 0xb2, 0x58, 0xd6}
DEFINE_GUID!{GUID_DISK_BURST_IGNORE_THRESHOLD,
    0x80e3c60e, 0xbb94, 0x4ad8, 0xbb, 0xe0, 0x0d, 0x31, 0x95, 0xef, 0xc6, 0x63}
DEFINE_GUID!{GUID_DISK_ADAPTIVE_POWERDOWN,
    0x396a32e1, 0x499a, 0x40b2, 0x91, 0x24, 0xa9, 0x6a, 0xfe, 0x70, 0x76, 0x67}
DEFINE_GUID!{GUID_SLEEP_SUBGROUP,
    0x238c9fa8, 0x0aad, 0x41ed, 0x83, 0xf4, 0x97, 0xbe, 0x24, 0x2c, 0x8f, 0x20}
DEFINE_GUID!{GUID_SLEEP_IDLE_THRESHOLD,
    0x81cd32e0, 0x7833, 0x44f3, 0x87, 0x37, 0x70, 0x81, 0xf3, 0x8d, 0x1f, 0x70}
DEFINE_GUID!{GUID_STANDBY_TIMEOUT,
    0x29f6c1db, 0x86da, 0x48c5, 0x9f, 0xdb, 0xf2, 0xb6, 0x7b, 0x1f, 0x44, 0xda}
DEFINE_GUID!{GUID_UNATTEND_SLEEP_TIMEOUT,
    0x7bc4a2f9, 0xd8fc, 0x4469, 0xb0, 0x7b, 0x33, 0xeb, 0x78, 0x5a, 0xac, 0xa0}
DEFINE_GUID!{GUID_HIBERNATE_TIMEOUT,
    0x9d7815a6, 0x7ee4, 0x497e, 0x88, 0x88, 0x51, 0x5a, 0x05, 0xf0, 0x23, 0x64}
DEFINE_GUID!{GUID_HIBERNATE_FASTS4_POLICY,
    0x94ac6d29, 0x73ce, 0x41a6, 0x80, 0x9f, 0x63, 0x63, 0xba, 0x21, 0xb4, 0x7e}
DEFINE_GUID!{GUID_CRITICAL_POWER_TRANSITION,
    0xb7a27025, 0xe569, 0x46c2, 0xa5, 0x04, 0x2b, 0x96, 0xca, 0xd2, 0x25, 0xa1}
DEFINE_GUID!{GUID_SYSTEM_AWAYMODE,
    0x98a7f580, 0x01f7, 0x48aa, 0x9c, 0x0f, 0x44, 0x35, 0x2c, 0x29, 0xe5, 0xc0}
DEFINE_GUID!{GUID_ALLOW_AWAYMODE,
    0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87}
DEFINE_GUID!{GUID_USER_PRESENCE_PREDICTION,
    0x82011705, 0xfb95, 0x4d46, 0x8d, 0x35, 0x40, 0x42, 0xb1, 0xd2, 0xd, 0xef}
DEFINE_GUID!{GUID_STANDBY_BUDGET_GRACE_PERIOD,
    0x60c07fe1, 0x0556, 0x45cf, 0x99, 0x03, 0xd5, 0x6e, 0x32, 0x21, 0x2, 0x42}
DEFINE_GUID!{GUID_STANDBY_BUDGET_PERCENT,
    0x9fe527be, 0x1b70, 0x48da, 0x93, 0x0d, 0x7b, 0xcf, 0x17, 0xb4, 0x49, 0x90}
DEFINE_GUID!{GUID_STANDBY_RESERVE_GRACE_PERIOD,
    0xc763ee92, 0x71e8, 0x4127, 0x84, 0xeb, 0xf6, 0xed, 0x04, 0x3a, 0x3e, 0x3d}
DEFINE_GUID!{GUID_STANDBY_RESERVE_TIME,
    0x468fe7e5, 0x1158, 0x46ec, 0x88, 0xbc, 0x5b, 0x96, 0xc9, 0xe4, 0x4f, 0xd0}
DEFINE_GUID!{GUID_STANDBY_RESET_PERCENT,
    0x49cb11a5, 0x56e2, 0x4afb, 0x9d, 0x38, 0x3d, 0xf4, 0x78, 0x72, 0xe2, 0x1b}
DEFINE_GUID!{GUID_ALLOW_STANDBY_STATES,
    0xabfc2519, 0x3608, 0x4c2a, 0x94, 0xea, 0x17, 0x1b, 0x0e, 0xd5, 0x46, 0xab}
DEFINE_GUID!{GUID_ALLOW_RTC_WAKE,
    0xbd3b718a, 0x0680, 0x4d9d, 0x8a, 0xb2, 0xe1, 0xd2, 0xb4, 0xac, 0x80, 0x6d}
DEFINE_GUID!{GUID_ALLOW_SYSTEM_REQUIRED,
    0xa4b195f5, 0x8225, 0x47d8, 0x80, 0x12, 0x9d, 0x41, 0x36, 0x97, 0x86, 0xe2}
DEFINE_GUID!{GUID_POWER_SAVING_STATUS,
    0xe00958c0, 0xc213, 0x4ace, 0xac, 0x77, 0xfe, 0xcc, 0xed, 0x2e, 0xee, 0xa5}
DEFINE_GUID!{GUID_ENERGY_SAVER_SUBGROUP,
    0xde830923, 0xa562, 0x41af, 0xa0, 0x86, 0xe3, 0xa2, 0xc6, 0xba, 0xd2, 0xda}
DEFINE_GUID!{GUID_ENERGY_SAVER_BATTERY_THRESHOLD,
    0xe69653ca, 0xcf7f, 0x4f05, 0xaa, 0x73, 0xcb, 0x83, 0x3f, 0xa9, 0x0a, 0xd4}
DEFINE_GUID!{GUID_ENERGY_SAVER_BRIGHTNESS,
    0x13d09884, 0xf74e, 0x474a, 0xa8, 0x52, 0xb6, 0xbd, 0xe8, 0xad, 0x03, 0xa8}
DEFINE_GUID!{GUID_ENERGY_SAVER_POLICY,
    0x5c5bb349, 0xad29, 0x4ee2, 0x9d, 0xb, 0x2b, 0x25, 0x27, 0xf, 0x7a, 0x81}
DEFINE_GUID!{GUID_SYSTEM_BUTTON_SUBGROUP,
    0x4f971e89, 0xeebd, 0x4455, 0xa8, 0xde, 0x9e, 0x59, 0x04, 0x0e, 0x73, 0x47}
pub const POWERBUTTON_ACTION_INDEX_NOTHING: DWORD = 0;
pub const POWERBUTTON_ACTION_INDEX_SLEEP: DWORD = 1;
pub const POWERBUTTON_ACTION_INDEX_HIBERNATE: DWORD = 2;
pub const POWERBUTTON_ACTION_INDEX_SHUTDOWN: DWORD = 3;
pub const POWERBUTTON_ACTION_INDEX_TURN_OFF_THE_DISPLAY: DWORD = 4;
pub const POWERBUTTON_ACTION_VALUE_NOTHING: DWORD = 0;
pub const POWERBUTTON_ACTION_VALUE_SLEEP: DWORD = 2;
pub const POWERBUTTON_ACTION_VALUE_HIBERNATE: DWORD = 3;
pub const POWERBUTTON_ACTION_VALUE_SHUTDOWN: DWORD = 6;
pub const POWERBUTTON_ACTION_VALUE_TURN_OFF_THE_DISPLAY: DWORD = 8;
DEFINE_GUID!{GUID_POWERBUTTON_ACTION,
    0x7648efa3, 0xdd9c, 0x4e3e, 0xb5, 0x66, 0x50, 0xf9, 0x29, 0x38, 0x62, 0x80}
DEFINE_GUID!{GUID_SLEEPBUTTON_ACTION,
    0x96996bc0, 0xad50, 0x47ec, 0x92, 0x3b, 0x6f, 0x41, 0x87, 0x4d, 0xd9, 0xeb}
DEFINE_GUID!{GUID_USERINTERFACEBUTTON_ACTION,
    0xa7066653, 0x8d6c, 0x40a8, 0x91, 0x0e, 0xa1, 0xf5, 0x4b, 0x84, 0xc7, 0xe5}
DEFINE_GUID!{GUID_LIDCLOSE_ACTION,
    0x5ca83367, 0x6e45, 0x459f, 0xa2, 0x7b, 0x47, 0x6b, 0x1d, 0x01, 0xc9, 0x36}
DEFINE_GUID!{GUID_LIDOPEN_POWERSTATE,
    0x99ff10e7, 0x23b1, 0x4c07, 0xa9, 0xd1, 0x5c, 0x32, 0x06, 0xd7, 0x41, 0xb4}
DEFINE_GUID!{GUID_BATTERY_SUBGROUP,
    0xe73a048d, 0xbf27, 0x4f12, 0x97, 0x31, 0x8b, 0x20, 0x76, 0xe8, 0x89, 0x1f}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_0,
    0x637ea02f, 0xbbcb, 0x4015, 0x8e, 0x2c, 0xa1, 0xc7, 0xb9, 0xc0, 0xb5, 0x46}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_0,
    0x9a66d8d7, 0x4ff7, 0x4ef9, 0xb5, 0xa2, 0x5a, 0x32, 0x6c, 0xa2, 0xa4, 0x69}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_0,
    0x5dbb7c9f, 0x38e9, 0x40d2, 0x97, 0x49, 0x4f, 0x8a, 0x0e, 0x9f, 0x64, 0x0f}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_1,
    0xd8742dcb, 0x3e6a, 0x4b3c, 0xb3, 0xfe, 0x37, 0x46, 0x23, 0xcd, 0xcf, 0x06}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_1,
    0x8183ba9a, 0xe910, 0x48da, 0x87, 0x69, 0x14, 0xae, 0x6d, 0xc1, 0x17, 0x0a}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_1,
    0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_2,
    0x421cba38, 0x1a8e, 0x4881, 0xac, 0x89, 0xe3, 0x3a, 0x8b, 0x04, 0xec, 0xe4}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_2,
    0x07a07ca2, 0xadaf, 0x40d7, 0xb0, 0x77, 0x53, 0x3a, 0xad, 0xed, 0x1b, 0xfa}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_2,
    0x7fd2f0c4, 0xfeb7, 0x4da3, 0x81, 0x17, 0xe3, 0xfb, 0xed, 0xc4, 0x65, 0x82}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_3,
    0x80472613, 0x9780, 0x455e, 0xb3, 0x08, 0x72, 0xd3, 0x00, 0x3c, 0xf2, 0xf8}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_3,
    0x58afd5a6, 0xc2dd, 0x47d2, 0x9f, 0xbf, 0xef, 0x70, 0xcc, 0x5c, 0x59, 0x65}
DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_3,
    0x73613ccf, 0xdbfa, 0x4279, 0x83, 0x56, 0x49, 0x35, 0xf6, 0xbf, 0x62, 0xf3}
DEFINE_GUID!{GUID_PROCESSOR_SETTINGS_SUBGROUP,
    0x54533251, 0x82be, 0x4824, 0x96, 0xc1, 0x47, 0xb6, 0x0b, 0x74, 0x0d, 0x00}
DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_POLICY,
    0x57027304, 0x4af6, 0x4104, 0x92, 0x60, 0xe3, 0xd9, 0x52, 0x48, 0xfc, 0x36}
pub const PERFSTATE_POLICY_CHANGE_IDEAL: DWORD = 0;
pub const PERFSTATE_POLICY_CHANGE_SINGLE: DWORD = 1;
pub const PERFSTATE_POLICY_CHANGE_ROCKET: DWORD = 2;
pub const PERFSTATE_POLICY_CHANGE_IDEAL_AGGRESSIVE: DWORD = 3;
pub const PERFSTATE_POLICY_CHANGE_DECREASE_MAX: DWORD = PERFSTATE_POLICY_CHANGE_ROCKET;
pub const PERFSTATE_POLICY_CHANGE_INCREASE_MAX: DWORD = PERFSTATE_POLICY_CHANGE_IDEAL_AGGRESSIVE;
DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MAXIMUM,
    0xbc5038f7, 0x23e0, 0x4960, 0x96, 0xda, 0x33, 0xab, 0xaf, 0x59, 0x35, 0xec}
DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MAXIMUM_1,
    0xbc5038f7, 0x23e0, 0x4960, 0x96, 0xda, 0x33, 0xab, 0xaf, 0x59, 0x35, 0xed}
DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MINIMUM,
    0x893dee8e, 0x2bef, 0x41e0, 0x89, 0xc6, 0xb5, 0x5d, 0x09, 0x29, 0x96, 0x4c}
DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MINIMUM_1,
    0x893dee8e, 0x2bef, 0x41e0, 0x89, 0xc6, 0xb5, 0x5d, 0x09, 0x29, 0x96, 0x4d}
DEFINE_GUID!{GUID_PROCESSOR_FREQUENCY_LIMIT,
    0x75b0ae3f, 0xbce0, 0x45a7, 0x8c, 0x89, 0xc9, 0x61, 0x1c, 0x25, 0xe1, 0x00}
DEFINE_GUID!{GUID_PROCESSOR_FREQUENCY_LIMIT_1,
    0x75b0ae3f, 0xbce0, 0x45a7, 0x8c, 0x89, 0xc9, 0x61, 0x1c, 0x25, 0xe1, 0x01}
DEFINE_GUID!{GUID_PROCESSOR_ALLOW_THROTTLING,
    0x3b04d4fd, 0x1cc7, 0x4f23, 0xab, 0x1c, 0xd1, 0x33, 0x78, 0x19, 0xc4, 0xbb}
pub const PROCESSOR_THROTTLE_DISABLED: DWORD = 0;
pub const PROCESSOR_THROTTLE_ENABLED: DWORD = 1;
pub const PROCESSOR_THROTTLE_AUTOMATIC: DWORD = 2;
DEFINE_GUID!{GUID_PROCESSOR_IDLESTATE_POLICY,
    0x68f262a7, 0xf621, 0x4069, 0xb9, 0xa5, 0x48, 0x74, 0x16, 0x9b, 0xe2, 0x3c}
DEFINE_GUID!{GUID_PROCESSOR_PERFSTATE_POLICY,
    0xbbdc3814, 0x18e9, 0x4463, 0x8a, 0x55, 0xd1, 0x97, 0x32, 0x7c, 0x45, 0xc0}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_THRESHOLD,
    0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5d}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_THRESHOLD_1,
    0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5e}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_THRESHOLD,
    0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa6}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_THRESHOLD_1,
    0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa7}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_POLICY,
    0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x18}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_POLICY_1,
    0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x19}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_POLICY,
    0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc6}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_POLICY_1,
    0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc7}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_TIME,
    0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xaa}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_TIME_1,
    0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xab}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_TIME,
    0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc8}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_TIME_1,
    0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc9}
DEFINE_GUID!{GUID_PROCESSOR_PERF_TIME_CHECK,
    0x4d2b0152, 0x7d5c, 0x498b, 0x88, 0xe2, 0x34, 0x34, 0x53, 0x92, 0xa2, 0xc5}
DEFINE_GUID!{GUID_PROCESSOR_PERF_BOOST_POLICY,
    0x45bcc044, 0xd885, 0x43e2, 0x86, 0x5, 0xee, 0xe, 0xc6, 0xe9, 0x6b, 0x59}
pub const PROCESSOR_PERF_BOOST_POLICY_DISABLED: DWORD = 0;
pub const PROCESSOR_PERF_BOOST_POLICY_MAX: DWORD = 100;
DEFINE_GUID!{GUID_PROCESSOR_PERF_BOOST_MODE,
    0xbe337238, 0xd82, 0x4146, 0xa9, 0x60, 0x4f, 0x37, 0x49, 0xd4, 0x70, 0xc7}
pub const PROCESSOR_PERF_BOOST_MODE_DISABLED: DWORD = 0;
pub const PROCESSOR_PERF_BOOST_MODE_ENABLED: DWORD = 1;
pub const PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE: DWORD = 2;
pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_ENABLED: DWORD = 3;
pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE: DWORD = 4;
pub const PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE_AT_GUARANTEED: DWORD = 5;
pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE_AT_GUARANTEED: DWORD = 6;
pub const PROCESSOR_PERF_BOOST_MODE_MAX: DWORD
    = PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE_AT_GUARANTEED;
DEFINE_GUID!{GUID_PROCESSOR_PERF_AUTONOMOUS_MODE,
    0x8baa4a8a, 0x14c6, 0x4451, 0x8e, 0x8b, 0x14, 0xbd, 0xbd, 0x19, 0x75, 0x37}
pub const PROCESSOR_PERF_AUTONOMOUS_MODE_DISABLED: DWORD = 0;
pub const PROCESSOR_PERF_AUTONOMOUS_MODE_ENABLED: DWORD = 1;
DEFINE_GUID!{GUID_PROCESSOR_PERF_ENERGY_PERFORMANCE_PREFERENCE,
    0x36687f9e, 0xe3a5, 0x4dbf, 0xb1, 0xdc, 0x15, 0xeb, 0x38, 0x1c, 0x68, 0x63}
pub const PROCESSOR_PERF_PERFORMANCE_PREFERENCE: DWORD = 0xff;
pub const PROCESSOR_PERF_ENERGY_PREFERENCE: DWORD = 0;
DEFINE_GUID!{GUID_PROCESSOR_PERF_AUTONOMOUS_ACTIVITY_WINDOW,
    0xcfeda3d0, 0x7697, 0x4566, 0xa9, 0x22, 0xa9, 0x8, 0x6c, 0xd4, 0x9d, 0xfa}
pub const PROCESSOR_PERF_MINIMUM_ACTIVITY_WINDOW: DWORD = 0;
pub const PROCESSOR_PERF_MAXIMUM_ACTIVITY_WINDOW: DWORD = 1270000000;
DEFINE_GUID!{GUID_PROCESSOR_DUTY_CYCLING,
    0x4e4450b3, 0x6179, 0x4e91, 0xb8, 0xf1, 0x5b, 0xb9, 0x93, 0x8f, 0x81, 0xa1}
pub const PROCESSOR_DUTY_CYCLING_DISABLED: DWORD = 0;
pub const PROCESSOR_DUTY_CYCLING_ENABLED: DWORD = 1;
DEFINE_GUID!{GUID_PROCESSOR_IDLE_ALLOW_SCALING,
    0x6c2993b0, 0x8f48, 0x481f, 0xbc, 0xc6, 0x0, 0xdd, 0x27, 0x42, 0xaa, 0x6}
DEFINE_GUID!{GUID_PROCESSOR_IDLE_DISABLE,
    0x5d76a2ca, 0xe8c0, 0x402f, 0xa1, 0x33, 0x21, 0x58, 0x49, 0x2d, 0x58, 0xad}
DEFINE_GUID!{GUID_PROCESSOR_IDLE_STATE_MAXIMUM,
    0x9943e905, 0x9a30, 0x4ec1, 0x9b, 0x99, 0x44, 0xdd, 0x3b, 0x76, 0xf7, 0xa2}
DEFINE_GUID!{GUID_PROCESSOR_IDLE_TIME_CHECK,
    0xc4581c31, 0x89ab, 0x4597, 0x8e, 0x2b, 0x9c, 0x9c, 0xab, 0x44, 0xe, 0x6b}
DEFINE_GUID!{GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD,
    0x4b92d758, 0x5a24, 0x4851, 0xa4, 0x70, 0x81, 0x5d, 0x78, 0xae, 0xe1, 0x19}
DEFINE_GUID!{GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD,
    0x7b224883, 0xb3cc, 0x4d79, 0x81, 0x9f, 0x83, 0x74, 0x15, 0x2c, 0xbe, 0x7c}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD,
    0xdf142941, 0x20f3, 0x4edf, 0x9a, 0x4a, 0x9c, 0x83, 0xd3, 0xd7, 0x17, 0xd1}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD,
    0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY,
    0xc7be0679, 0x2817, 0x4d69, 0x9d, 0x02, 0x51, 0x9a, 0x53, 0x7e, 0xd0, 0xc6}
pub const CORE_PARKING_POLICY_CHANGE_IDEAL: DWORD = 0;
pub const CORE_PARKING_POLICY_CHANGE_SINGLE: DWORD = 1;
pub const CORE_PARKING_POLICY_CHANGE_ROCKET: DWORD = 2;
pub const CORE_PARKING_POLICY_CHANGE_MULTISTEP: DWORD = 3;
pub const CORE_PARKING_POLICY_CHANGE_MAX: DWORD = CORE_PARKING_POLICY_CHANGE_MULTISTEP;
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY,
    0x71021b41, 0xc749, 0x4d21, 0xbe, 0x74, 0xa0, 0x0f, 0x33, 0x5d, 0x58, 0x2b}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MAX_CORES,
    0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x28}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MAX_CORES_1,
    0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x29}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MIN_CORES,
    0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x83}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MIN_CORES_1,
    0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x84}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME,
    0x2ddd5a84, 0x5a71, 0x437e, 0x91, 0x2a, 0xdb, 0x0b, 0x8c, 0x78, 0x87, 0x32}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME,
    0xdfd10d17, 0xd5eb, 0x45dd, 0x87, 0x7a, 0x9a, 0x34, 0xdd, 0xd1, 0x5c, 0x82}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR,
    0x8f7b45e3, 0xc393, 0x480a, 0x87, 0x8c, 0xf6, 0x7a, 0xc3, 0xd0, 0x70, 0x82}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD,
    0x5b33697b, 0xe89d, 0x4d38, 0xaa, 0x46, 0x9e, 0x7d, 0xfb, 0x7c, 0xd2, 0xf9}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING,
    0xe70867f1, 0xfa2f, 0x4f4e, 0xae, 0xa1, 0x4d, 0x8a, 0x0b, 0xa2, 0x3b, 0x20}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR,
    0x1299023c, 0xbc28, 0x4f0a, 0x81, 0xec, 0xd3, 0x29, 0x5a, 0x8d, 0x81, 0x5d}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD,
    0x9ac18e92, 0xaa3c, 0x4e27, 0xb3, 0x07, 0x01, 0xae, 0x37, 0x30, 0x71, 0x29}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING,
    0x8809c2d8, 0xb155, 0x42d4, 0xbc, 0xda, 0x0d, 0x34, 0x56, 0x51, 0xb1, 0xdb}
DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD,
    0x943c8cb6, 0x6f93, 0x4227, 0xad, 0x87, 0xe9, 0xa3, 0xfe, 0xec, 0x08, 0xd1}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_CORE_OVERRIDE,
    0xa55612aa, 0xf624, 0x42c6, 0xa4, 0x43, 0x73, 0x97, 0xd0, 0x64, 0xc0, 0x4f}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_PERF_STATE,
    0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2b}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_PERF_STATE_1,
    0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2c}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_CONCURRENCY_THRESHOLD,
    0x2430ab6f, 0xa520, 0x44a2, 0x96, 0x01, 0xf7, 0xf2, 0x3b, 0x51, 0x34, 0xb1}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_HEADROOM_THRESHOLD,
    0xf735a673, 0x2066, 0x4f80, 0xa0, 0xc5, 0xdd, 0xee, 0x0c, 0xf1, 0xbf, 0x5d}
DEFINE_GUID!{GUID_PROCESSOR_PARKING_DISTRIBUTION_THRESHOLD,
    0x4bdaf4e9, 0xd103, 0x46d7, 0xa5, 0xf0, 0x62, 0x80, 0x12, 0x16, 0x16, 0xef}
DEFINE_GUID!{GUID_PROCESSOR_PERF_HISTORY,
    0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x5f}
DEFINE_GUID!{GUID_PROCESSOR_PERF_HISTORY_1,
    0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x60}
DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_HISTORY,
    0x99b3ef01, 0x752f, 0x46a1, 0x80, 0xfb, 0x77, 0x30, 0x1, 0x1f, 0x23, 0x54}
DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_HISTORY,
    0x300f6f8, 0xabd6, 0x45a9, 0xb7, 0x4f, 0x49, 0x8, 0x69, 0x1a, 0x40, 0xb5}
DEFINE_GUID!{GUID_PROCESSOR_PERF_CORE_PARKING_HISTORY,
    0x77d7f282, 0x8f1a, 0x42cd, 0x85, 0x37, 0x45, 0x45, 0xa, 0x83, 0x9b, 0xe8}
DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT,
    0x0822df31, 0x9c83, 0x441c, 0xa0, 0x79, 0x0d, 0xe4, 0xcf, 0x00, 0x9c, 0x7b}
DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT_PERF,
    0x619b7505, 0x3b, 0x4e82, 0xb7, 0xa6, 0x4d, 0xd2, 0x9c, 0x30, 0x9, 0x71}
DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT_PERF_1,
    0x619b7505, 0x3b, 0x4e82, 0xb7, 0xa6, 0x4d, 0xd2, 0x9c, 0x30, 0x9, 0x72}
DEFINE_GUID!{GUID_PROCESSOR_LATENCY_HINT_MIN_UNPARK,
    0x616cdaa5, 0x695e, 0x4545, 0x97, 0xad, 0x97, 0xdc, 0x2d, 0x1b, 0xdd, 0x88}
DEFINE_GUID!{GUID_PROCESSOR_LATENCY_HINT_MIN_UNPARK_1,
    0x616cdaa5, 0x695e, 0x4545, 0x97, 0xad, 0x97, 0xdc, 0x2d, 0x1b, 0xdd, 0x89}
DEFINE_GUID!{GUID_PROCESSOR_DISTRIBUTE_UTILITY,
    0xe0007330, 0xf589, 0x42ed, 0xa4, 0x01, 0x5d, 0xdb, 0x10, 0xe7, 0x85, 0xd3}
DEFINE_GUID!{GUID_PROCESSOR_HETEROGENEOUS_POLICY,
    0x7f2f5cfa, 0xf10c, 0x4823, 0xb5, 0xe1, 0xe9, 0x3a, 0xe8, 0x5f, 0x46, 0xb5}
DEFINE_GUID!{GUID_PROCESSOR_HETERO_DECREASE_TIME,
    0x7f2492b6, 0x60b1, 0x45e5, 0xae, 0x55, 0x77, 0x3f, 0x8c, 0xd5, 0xca, 0xec}
DEFINE_GUID!{GUID_PROCESSOR_HETERO_INCREASE_TIME,
    0x4009efa7, 0xe72d, 0x4cba, 0x9e, 0xdf, 0x91, 0x08, 0x4e, 0xa8, 0xcb, 0xc3}
DEFINE_GUID!{GUID_PROCESSOR_HETERO_DECREASE_THRESHOLD,
    0xf8861c27, 0x95e7, 0x475c, 0x86, 0x5b, 0x13, 0xc0, 0xcb, 0x3f, 0x9d, 0x6b}
DEFINE_GUID!{GUID_PROCESSOR_HETERO_INCREASE_THRESHOLD,
    0xb000397d, 0x9b0b, 0x483d, 0x98, 0xc9, 0x69, 0x2a, 0x60, 0x60, 0xcf, 0xbf}
DEFINE_GUID!{GUID_PROCESSOR_CLASS0_FLOOR_PERF,
    0xfddc842b, 0x8364, 0x4edc, 0x94, 0xcf, 0xc1, 0x7f, 0x60, 0xde, 0x1c, 0x80}
DEFINE_GUID!{GUID_PROCESSOR_CLASS1_INITIAL_PERF,
    0x1facfc65, 0xa930, 0x4bc5, 0x9f, 0x38, 0x50, 0x4e, 0xc0, 0x97, 0xbb, 0xc0}
DEFINE_GUID!{GUID_SYSTEM_COOLING_POLICY,
    0x94d3a615, 0xa899, 0x4ac5, 0xae, 0x2b, 0xe4, 0xd8, 0xf6, 0x34, 0x36, 0x7f}
DEFINE_GUID!{GUID_LOCK_CONSOLE_ON_WAKE,
    0x0e796bdb, 0x100d, 0x47d6, 0xa2, 0xd5, 0xf7, 0xd2, 0xda, 0xa5, 0x1f, 0x51}
DEFINE_GUID!{GUID_DEVICE_IDLE_POLICY,
    0x4faab71a, 0x92e5, 0x4726, 0xb5, 0x31, 0x22, 0x45, 0x59, 0x67, 0x2d, 0x19}
pub const POWER_DEVICE_IDLE_POLICY_PERFORMANCE: DWORD = 0;
pub const POWER_DEVICE_IDLE_POLICY_CONSERVATIVE: DWORD = 1;
DEFINE_GUID!{GUID_CONNECTIVITY_IN_STANDBY,
    0xf15576e8, 0x98b7, 0x4186, 0xb9, 0x44, 0xea, 0xfa, 0x66, 0x44, 0x02, 0xd9}
pub const POWER_CONNECTIVITY_IN_STANDBY_DISABLED: DWORD = 0;
pub const POWER_CONNECTIVITY_IN_STANDBY_ENABLED: DWORD = 1;
pub const POWER_CONNECTIVITY_IN_STANDBY_DISABLED_LID_CLOSE: DWORD = 2;
DEFINE_GUID!{GUID_DISCONNECTED_STANDBY_MODE,
    0x68afb2d9, 0xee95, 0x47a8, 0x8f, 0x50, 0x41, 0x15, 0x08, 0x80, 0x73, 0xb1}
pub const POWER_DISCONNECTED_STANDBY_MODE_NORMAL: DWORD = 0;
pub const POWER_DISCONNECTED_STANDBY_MODE_AGGRESSIVE: DWORD = 1;
DEFINE_GUID!{GUID_ACDC_POWER_SOURCE,
    0x5d3e9a59, 0xe9d5, 0x4b00, 0xa6, 0xbd, 0xff, 0x34, 0xff, 0x51, 0x65, 0x48}
DEFINE_GUID!{GUID_LIDSWITCH_STATE_CHANGE,
    0xba3e0f4d, 0xb817, 0x4094, 0xa2, 0xd1, 0xd5, 0x63, 0x79, 0xe6, 0xa0, 0xf3}
DEFINE_GUID!{GUID_BATTERY_PERCENTAGE_REMAINING,
    0xa7ad8041, 0xb45a, 0x4cae, 0x87, 0xa3, 0xee, 0xcb, 0xb4, 0x68, 0xa9, 0xe1}
DEFINE_GUID!{GUID_BATTERY_COUNT,
    0x7d263f15, 0xfca4, 0x49e5, 0x85, 0x4b, 0xa9, 0xf2, 0xbf, 0xbd, 0x5c, 0x24}
DEFINE_GUID!{GUID_GLOBAL_USER_PRESENCE,
    0x786e8a1d, 0xb427, 0x4344, 0x92, 0x7, 0x9, 0xe7, 0xb, 0xdc, 0xbe, 0xa9}
DEFINE_GUID!{GUID_SESSION_DISPLAY_STATUS,
    0x2b84c20e, 0xad23, 0x4ddf, 0x93, 0xdb, 0x5, 0xff, 0xbd, 0x7e, 0xfc, 0xa5}
DEFINE_GUID!{GUID_SESSION_USER_PRESENCE,
    0x3c0f4548, 0xc03f, 0x4c4d, 0xb9, 0xf2, 0x23, 0x7e, 0xde, 0x68, 0x63, 0x76}
DEFINE_GUID!{GUID_IDLE_BACKGROUND_TASK,
    0x515c31d8, 0xf734, 0x163d, 0xa0, 0xfd, 0x11, 0xa0, 0x8c, 0x91, 0xe8, 0xf1}
DEFINE_GUID!{GUID_BACKGROUND_TASK_NOTIFICATION,
    0xcf23f240, 0x2a54, 0x48d8, 0xb1, 0x14, 0xde, 0x15, 0x18, 0xff, 0x05, 0x2e}
DEFINE_GUID!{GUID_APPLAUNCH_BUTTON,
    0x1a689231, 0x7399, 0x4e9a, 0x8f, 0x99, 0xb7, 0x1f, 0x99, 0x9d, 0xb3, 0xfa}
DEFINE_GUID!{GUID_PCIEXPRESS_SETTINGS_SUBGROUP,
    0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20}
DEFINE_GUID!{GUID_PCIEXPRESS_ASPM_POLICY,
    0xee12f906, 0xd277, 0x404b, 0xb6, 0xda, 0xe5, 0xfa, 0x1a, 0x57, 0x6d, 0xf5}
DEFINE_GUID!{GUID_ENABLE_SWITCH_FORCED_SHUTDOWN,
    0x833a6b62, 0xdfa4, 0x46d1, 0x82, 0xf8, 0xe0, 0x9e, 0x34, 0xd0, 0x29, 0xd6}
DEFINE_GUID!{GUID_INTSTEER_SUBGROUP,
    0x48672f38, 0x7a9a, 0x4bb2, 0x8b, 0xf8, 0x3d, 0x85, 0xbe, 0x19, 0xde, 0x4e}
DEFINE_GUID!{GUID_INTSTEER_MODE,
    0x2bfc24f9, 0x5ea2, 0x4801, 0x82, 0x13, 0x3d, 0xba, 0xe0, 0x1a, 0xa3, 0x9d}
DEFINE_GUID!{GUID_INTSTEER_LOAD_PER_PROC_TRIGGER,
    0x73cde64d, 0xd720, 0x4bb2, 0xa8, 0x60, 0xc7, 0x55, 0xaf, 0xe7, 0x7e, 0xf2}
DEFINE_GUID!{GUID_INTSTEER_TIME_UNPARK_TRIGGER,
    0xd6ba4903, 0x386f, 0x4c2c, 0x8a, 0xdb, 0x5c, 0x21, 0xb3, 0x32, 0x8d, 0x25}
ENUM!{enum SYSTEM_POWER_STATE {
    PowerSystemUnspecified = 0,
    PowerSystemWorking = 1,
    PowerSystemSleeping1 = 2,
    PowerSystemSleeping2 = 3,
    PowerSystemSleeping3 = 4,
    PowerSystemHibernate = 5,
    PowerSystemShutdown = 6,
    PowerSystemMaximum = 7,
}}
pub type PSYSTEM_POWER_STATE = *mut SYSTEM_POWER_STATE;
pub const POWER_SYSTEM_MAXIMUM: usize = 7;
ENUM!{enum POWER_ACTION {
    PowerActionNone = 0,
    PowerActionReserved,
    PowerActionSleep,
    PowerActionHibernate,
    PowerActionShutdown,
    PowerActionShutdownReset,
    PowerActionShutdownOff,
    PowerActionWarmEject,
    PowerActionDisplayOff,
}}
pub type PPOWER_ACTION = *mut POWER_ACTION;
ENUM!{enum DEVICE_POWER_STATE {
    PowerDeviceUnspecified = 0,
    PowerDeviceD0,
    PowerDeviceD1,
    PowerDeviceD2,
    PowerDeviceD3,
    PowerDeviceMaximum,
}}
pub type PDEVICE_POWER_STATE = *mut DEVICE_POWER_STATE;
ENUM!{enum MONITOR_DISPLAY_STATE {
    PowerMonitorOff = 0,
    PowerMonitorOn,
    PowerMonitorDim,
}}
pub type PMONITOR_DISPLAY_STATE = *mut MONITOR_DISPLAY_STATE;
ENUM!{enum USER_ACTIVITY_PRESENCE {
    PowerUserPresent = 0,
    PowerUserNotPresent,
    PowerUserInactive,
    PowerUserMaximum,
    PowerUserInvalid = PowerUserMaximum,
}}
pub type PUSER_ACTIVITY_PRESENCE = *mut USER_ACTIVITY_PRESENCE;
pub const ES_SYSTEM_REQUIRED: DWORD = 0x00000001;
pub const ES_DISPLAY_REQUIRED: DWORD = 0x00000002;
pub const ES_USER_PRESENT: DWORD = 0x00000004;
pub const ES_AWAYMODE_REQUIRED: DWORD = 0x00000040;
pub const ES_CONTINUOUS: DWORD = 0x80000000;
pub type EXECUTION_STATE = DWORD;
pub type PEXECUTION_STATE = *mut DWORD;
ENUM!{enum LATENCY_TIME {
    LT_DONT_CARE,
    LT_LOWEST_LATENCY,
}}
pub const DIAGNOSTIC_REASON_VERSION: ULONG = 0;
pub const DIAGNOSTIC_REASON_SIMPLE_STRING: ULONG = 0x00000001;
pub const DIAGNOSTIC_REASON_DETAILED_STRING: ULONG = 0x00000002;
pub const DIAGNOSTIC_REASON_NOT_SPECIFIED: ULONG = 0x80000000;
pub const DIAGNOSTIC_REASON_INVALID_FLAGS: ULONG = !0x80000007;
pub const POWER_REQUEST_CONTEXT_VERSION: ULONG = DIAGNOSTIC_REASON_VERSION;
pub const POWER_REQUEST_CONTEXT_SIMPLE_STRING: ULONG = DIAGNOSTIC_REASON_SIMPLE_STRING;
pub const POWER_REQUEST_CONTEXT_DETAILED_STRING: ULONG = DIAGNOSTIC_REASON_DETAILED_STRING;
ENUM!{enum POWER_REQUEST_TYPE {
    PowerRequestDisplayRequired,
    PowerRequestSystemRequired,
    PowerRequestAwayModeRequired,
    PowerRequestExecutionRequired,
}}
pub type PPOWER_REQUEST_TYPE = *mut POWER_REQUEST_TYPE;
pub const PDCAP_D0_SUPPORTED: DWORD = 0x00000001;
pub const PDCAP_D1_SUPPORTED: DWORD = 0x00000002;
pub const PDCAP_D2_SUPPORTED: DWORD = 0x00000004;
pub const PDCAP_D3_SUPPORTED: DWORD = 0x00000008;
pub const PDCAP_WAKE_FROM_D0_SUPPORTED: DWORD = 0x00000010;
pub const PDCAP_WAKE_FROM_D1_SUPPORTED: DWORD = 0x00000020;
pub const PDCAP_WAKE_FROM_D2_SUPPORTED: DWORD = 0x00000040;
pub const PDCAP_WAKE_FROM_D3_SUPPORTED: DWORD = 0x00000080;
pub const PDCAP_WARM_EJECT_SUPPORTED: DWORD = 0x00000100;
STRUCT!{struct CM_POWER_DATA {
    PD_Size: DWORD,
    PD_MostRecentPowerState: DEVICE_POWER_STATE,
    PD_Capabilities: DWORD,
    PD_D1Latency: DWORD,
    PD_D2Latency: DWORD,
    PD_D3Latency: DWORD,
    PD_PowerStateMapping: [DEVICE_POWER_STATE; POWER_SYSTEM_MAXIMUM],
    PD_DeepestSystemWake: SYSTEM_POWER_STATE,
}}
pub type PCM_POWER_DATA = *mut CM_POWER_DATA;
ENUM!{enum POWER_INFORMATION_LEVEL {
    SystemPowerPolicyAc,
    SystemPowerPolicyDc,
    VerifySystemPolicyAc,
    VerifySystemPolicyDc,
    SystemPowerCapabilities,
    SystemBatteryState,
    SystemPowerStateHandler,
    ProcessorStateHandler,
    SystemPowerPolicyCurrent,
    AdministratorPowerPolicy,
    SystemReserveHiberFile,
    ProcessorInformation,
    SystemPowerInformation,
    ProcessorStateHandler2,
    LastWakeTime,
    LastSleepTime,
    SystemExecutionState,
    SystemPowerStateNotifyHandler,
    ProcessorPowerPolicyAc,
    ProcessorPowerPolicyDc,
    VerifyProcessorPowerPolicyAc,
    VerifyProcessorPowerPolicyDc,
    ProcessorPowerPolicyCurrent,
    SystemPowerStateLogging,
    SystemPowerLoggingEntry,
    SetPowerSettingValue,
    NotifyUserPowerSetting,
    PowerInformationLevelUnused0,
    SystemMonitorHiberBootPowerOff,
    SystemVideoState,
    TraceApplicationPowerMessage,
    TraceApplicationPowerMessageEnd,
    ProcessorPerfStates,
    ProcessorIdleStates,
    ProcessorCap,
    SystemWakeSource,
    SystemHiberFileInformation,
    TraceServicePowerMessage,
    ProcessorLoad,
    PowerShutdownNotification,
    MonitorCapabilities,
    SessionPowerInit,
    SessionDisplayState,
    PowerRequestCreate,
    PowerRequestAction,
    GetPowerRequestList,
    ProcessorInformationEx,
    NotifyUserModeLegacyPowerEvent,
    GroupPark,
    ProcessorIdleDomains,
    WakeTimerList,
    SystemHiberFileSize,
    ProcessorIdleStatesHv,
    ProcessorPerfStatesHv,
    ProcessorPerfCapHv,
    ProcessorSetIdle,
    LogicalProcessorIdling,
    UserPresence,
    PowerSettingNotificationName,
    GetPowerSettingValue,
    IdleResiliency,
    SessionRITState,
    SessionConnectNotification,
    SessionPowerCleanup,
    SessionLockState,
    SystemHiberbootState,
    PlatformInformation,
    PdcInvocation,
    MonitorInvocation,
    FirmwareTableInformationRegistered,
    SetShutdownSelectedTime,
    SuspendResumeInvocation,
    PlmPowerRequestCreate,
    ScreenOff,
    CsDeviceNotification,
    PlatformRole,
    LastResumePerformance,
    DisplayBurst,
    ExitLatencySamplingPercentage,
    RegisterSpmPowerSettings,
    PlatformIdleStates,
    ProcessorIdleVeto,
    PlatformIdleVeto,
    SystemBatteryStatePrecise,
    ThermalEvent,
    PowerRequestActionInternal,
    BatteryDeviceState,
    PowerInformationInternal,
    ThermalStandby,
    SystemHiberFileType,
    PhysicalPowerButtonPress,
    QueryPotentialDripsConstraint,
    EnergyTrackerCreate,
    EnergyTrackerQuery,
    UpdateBlackBoxRecorder,
    PowerInformationLevelMaximum,
}}
ENUM!{enum POWER_USER_PRESENCE_TYPE {
    UserNotPresent = 0,
    UserPresent = 1,
    UserUnknown = 0xff,
}}
pub type PPOWER_USER_PRESENCE_TYPE = *mut POWER_USER_PRESENCE_TYPE;
STRUCT!{struct POWER_USER_PRESENCE {
    UserPresence: POWER_USER_PRESENCE_TYPE,
}}
pub type PPOWER_USER_PRESENCE = *mut POWER_USER_PRESENCE;
STRUCT!{struct POWER_SESSION_CONNECT {
    Connected: BOOLEAN,
    Console: BOOLEAN,
}}
pub type PPOWER_SESSION_CONNECT = *mut POWER_SESSION_CONNECT;
STRUCT!{struct POWER_SESSION_TIMEOUTS {
    InputTimeout: DWORD,
    DisplayTimeout: DWORD,
}}
pub type PPOWER_SESSION_TIMEOUTS = *mut POWER_SESSION_TIMEOUTS;
STRUCT!{struct POWER_SESSION_RIT_STATE {
    Active: BOOLEAN,
    LastInputTime: DWORD,
}}
pub type PPOWER_SESSION_RIT_STATE = *mut POWER_SESSION_RIT_STATE;
STRUCT!{struct POWER_SESSION_WINLOGON {
    SessionId: DWORD,
    Console: BOOLEAN,
    Locked: BOOLEAN,
}}
pub type PPOWER_SESSION_WINLOGON = *mut POWER_SESSION_WINLOGON;
STRUCT!{struct POWER_IDLE_RESILIENCY {
    CoalescingTimeout: DWORD,
    IdleResiliencyPeriod: DWORD,
}}
pub type PPOWER_IDLE_RESILIENCY = *mut POWER_IDLE_RESILIENCY;
ENUM!{enum POWER_MONITOR_REQUEST_REASON {
    MonitorRequestReasonUnknown,
    MonitorRequestReasonPowerButton,
    MonitorRequestReasonRemoteConnection,
    MonitorRequestReasonScMonitorpower,
    MonitorRequestReasonUserInput,
    MonitorRequestReasonAcDcDisplayBurst,
    MonitorRequestReasonUserDisplayBurst,
    MonitorRequestReasonPoSetSystemState,
    MonitorRequestReasonSetThreadExecutionState,
    MonitorRequestReasonFullWake,
    MonitorRequestReasonSessionUnlock,
    MonitorRequestReasonScreenOffRequest,
    MonitorRequestReasonIdleTimeout,
    MonitorRequestReasonPolicyChange,
    MonitorRequestReasonSleepButton,
    MonitorRequestReasonLid,
    MonitorRequestReasonBatteryCountChange,
    MonitorRequestReasonGracePeriod,
    MonitorRequestReasonPnP,
    MonitorRequestReasonDP,
    MonitorRequestReasonSxTransition,
    MonitorRequestReasonSystemIdle,
    MonitorRequestReasonNearProximity,
    MonitorRequestReasonThermalStandby,
    MonitorRequestReasonResumePdc,
    MonitorRequestReasonResumeS4,
    MonitorRequestReasonTerminal,
    MonitorRequestReasonPdcSignal,
    MonitorRequestReasonAcDcDisplayBurstSuppressed,
    MonitorRequestReasonSystemStateEntered,
    MonitorRequestReasonWinrt,
    MonitorRequestReasonMax,
}}
ENUM!{enum POWER_MONITOR_REQUEST_TYPE {
    MonitorRequestTypeOff,
    MonitorRequestTypeOnAndPresent,
    MonitorRequestTypeToggleOn,
}}
STRUCT!{struct POWER_MONITOR_INVOCATION {
    Console: BOOLEAN,
    RequestReason: POWER_MONITOR_REQUEST_REASON,
}}
pub type PPOWER_MONITOR_INVOCATION = *mut POWER_MONITOR_INVOCATION;
STRUCT!{struct RESUME_PERFORMANCE {
    PostTimeMs: DWORD,
    TotalResumeTimeMs: ULONGLONG,
    ResumeCompleteTimestamp: ULONGLONG,
}}
pub type PRESUME_PERFORMANCE = *mut RESUME_PERFORMANCE;
ENUM!{enum SYSTEM_POWER_CONDITION {
    PoAc,
    PoDc,
    PoHot,
    PoConditionMaximum,
}}
STRUCT!{struct SET_POWER_SETTING_VALUE {
    Version: DWORD,
    Guid: GUID,
    PowerCondition: SYSTEM_POWER_CONDITION,
    DataLength: DWORD,
    Data: [BYTE; ANYSIZE_ARRAY],
}}
pub type PSET_POWER_SETTING_VALUE = *mut SET_POWER_SETTING_VALUE;
STRUCT!{struct NOTIFY_USER_POWER_SETTING {
    Guid: GUID,
}}
pub type PNOTIFY_USER_POWER_SETTING = *mut NOTIFY_USER_POWER_SETTING;
STRUCT!{struct APPLICATIONLAUNCH_SETTING_VALUE {
    ActivationTime: LARGE_INTEGER,
    Flags: DWORD,
    ButtonInstanceID: DWORD,
}}
pub type PAPPLICATIONLAUNCH_SETTING_VALUE = *mut APPLICATIONLAUNCH_SETTING_VALUE;
ENUM!{enum POWER_PLATFORM_ROLE {
    PlatformRoleUnspecified = 0,
    PlatformRoleDesktop,
    PlatformRoleMobile,
    PlatformRoleWorkstation,
    PlatformRoleEnterpriseServer,
    PlatformRoleSOHOServer,
    PlatformRoleAppliancePC,
    PlatformRolePerformanceServer,
    PlatformRoleSlate,
    PlatformRoleMaximum,
}}
pub type PPOWER_PLATFORM_ROLE = *mut POWER_PLATFORM_ROLE;
pub const POWER_PLATFORM_ROLE_V1: ULONG = 0x00000001;
pub const POWER_PLATFORM_ROLE_V1_MAX: POWER_PLATFORM_ROLE = PlatformRolePerformanceServer + 1;
pub const POWER_PLATFORM_ROLE_V2: ULONG = 0x00000002;
pub const POWER_PLATFORM_ROLE_V2_MAX: POWER_PLATFORM_ROLE = PlatformRoleSlate + 1;
pub const POWER_PLATFORM_ROLE_VERSION: ULONG = POWER_PLATFORM_ROLE_V2;
pub const POWER_PLATFORM_ROLE_VERSION_MAX: POWER_PLATFORM_ROLE = POWER_PLATFORM_ROLE_V2_MAX;
STRUCT!{struct POWER_PLATFORM_INFORMATION {
    AoAc: BOOLEAN,
}}
pub type PPOWER_PLATFORM_INFORMATION = *mut POWER_PLATFORM_INFORMATION;
STRUCT!{struct BATTERY_REPORTING_SCALE {
    Granularity: DWORD,
    Capacity: DWORD,
}}
pub type PBATTERY_REPORTING_SCALE = *mut BATTERY_REPORTING_SCALE;
STRUCT!{struct PPM_WMI_LEGACY_PERFSTATE {
    Frequency: DWORD,
    Flags: DWORD,
    PercentFrequency: DWORD,
}}
pub type PPPM_WMI_LEGACY_PERFSTATE = *mut PPM_WMI_LEGACY_PERFSTATE;
STRUCT!{struct PPM_WMI_IDLE_STATE {
    Latency: DWORD,
    Power: DWORD,
    TimeCheck: DWORD,
    PromotePercent: BYTE,
    DemotePercent: BYTE,
    StateType: BYTE,
    Reserved: BYTE,
    StateFlags: DWORD,
    Context: DWORD,
    IdleHandler: DWORD,
    Reserved1: DWORD,
}}
pub type PPPM_WMI_IDLE_STATE = *mut PPM_WMI_IDLE_STATE;
STRUCT!{struct PPM_WMI_IDLE_STATES {
    Type: DWORD,
    Count: DWORD,
    TargetState: DWORD,
    OldState: DWORD,
    TargetProcessors: DWORD64,
    State: [PPM_WMI_IDLE_STATE; ANYSIZE_ARRAY],
}}
pub type PPPM_WMI_IDLE_STATES = *mut PPM_WMI_IDLE_STATES;
STRUCT!{struct PPM_WMI_IDLE_STATES_EX {
    Type: DWORD,
    Count: DWORD,
    TargetState: DWORD,
    OldState: DWORD,
    TargetProcessors: PVOID,
    State: [PPM_WMI_IDLE_STATE; ANYSIZE_ARRAY],
}}
pub type PPPM_WMI_IDLE_STATES_EX = *mut PPM_WMI_IDLE_STATES_EX;
STRUCT!{struct PPM_WMI_PERF_STATE {
    Frequency: DWORD,
    Power: DWORD,
    PercentFrequency: BYTE,
    IncreaseLevel: BYTE,
    DecreaseLevel: BYTE,
    Type: BYTE,
    IncreaseTime: DWORD,
    DecreaseTime: DWORD,
    Control: DWORD64,
    Status: DWORD64,
    HitCount: DWORD,
    Reserved1: DWORD,
    Reserved2: DWORD64,
    Reserved3: DWORD64,
}}
pub type PPPM_WMI_PERF_STATE = *mut PPM_WMI_PERF_STATE;
STRUCT!{struct PPM_WMI_PERF_STATES {
    Count: DWORD,
    MaxFrequency: DWORD,
    CurrentState: DWORD,
    MaxPerfState: DWORD,
    MinPerfState: DWORD,
    LowestPerfState: DWORD,
    ThermalConstraint: DWORD,
    BusyAdjThreshold: BYTE,
    PolicyType: BYTE,
    Type: BYTE,
    Reserved: BYTE,
    TimerInterval: DWORD,
    TargetProcessors: DWORD64,
    PStateHandler: DWORD,
    PStateContext: DWORD,
    TStateHandler: DWORD,
    TStateContext: DWORD,
    FeedbackHandler: DWORD,
    Reserved1: DWORD,
    Reserved2: DWORD64,
    State: [PPM_WMI_PERF_STATE; ANYSIZE_ARRAY],
}}
pub type PPPM_WMI_PERF_STATES = *mut PPM_WMI_PERF_STATES;
STRUCT!{struct PPM_WMI_PERF_STATES_EX {
    Count: DWORD,
    MaxFrequency: DWORD,
    CurrentState: DWORD,
    MaxPerfState: DWORD,
    MinPerfState: DWORD,
    LowestPerfState: DWORD,
    ThermalConstraint: DWORD,
    BusyAdjThreshold: BYTE,
    PolicyType: BYTE,
    Type: BYTE,
    Reserved: BYTE,
    TimerInterval: DWORD,
    TargetProcessors: PVOID,
    PStateHandler: DWORD,
    PStateContext: DWORD,
    TStateHandler: DWORD,
    TStateContext: DWORD,
    FeedbackHandler: DWORD,
    Reserved1: DWORD,
    Reserved2: DWORD64,
    State: [PPM_WMI_PERF_STATE; ANYSIZE_ARRAY],
}}
pub type PPPM_WMI_PERF_STATES_EX = *mut PPM_WMI_PERF_STATES_EX;
pub const PROC_IDLE_BUCKET_COUNT: usize = 6;
STRUCT!{struct PPM_IDLE_STATE_ACCOUNTING {
    IdleTransitions: DWORD,
    FailedTransitions: DWORD,
    InvalidBucketIndex: DWORD,
    TotalTime: DWORD64,
    IdleTimeBuckets: [DWORD; PROC_IDLE_BUCKET_COUNT],
}}
pub type PPPM_IDLE_STATE_ACCOUNTING = *mut PPM_IDLE_STATE_ACCOUNTING;
STRUCT!{struct PPM_IDLE_ACCOUNTING {
    StateCount: DWORD,
    TotalTransitions: DWORD,
    ResetCount: DWORD,
    StartTime: DWORD64,
    State: [PPM_IDLE_STATE_ACCOUNTING; ANYSIZE_ARRAY],
}}
pub type PPPM_IDLE_ACCOUNTING = *mut PPM_IDLE_ACCOUNTING;
pub const PROC_IDLE_BUCKET_COUNT_EX: usize = 16;
STRUCT!{struct PPM_IDLE_STATE_BUCKET_EX {
    TotalTimeUs: DWORD64,
    MinTimeUs: DWORD,
    MaxTimeUs: DWORD,
    Count: DWORD,
}}
pub type PPPM_IDLE_STATE_BUCKET_EX = *mut PPM_IDLE_STATE_BUCKET_EX;
STRUCT!{struct PPM_IDLE_STATE_ACCOUNTING_EX {
    TotalTime: DWORD64,
    IdleTransitions: DWORD,
    FailedTransitions: DWORD,
    InvalidBucketIndex: DWORD,
    MinTimeUs: DWORD,
    MaxTimeUs: DWORD,
    CancelledTransitions: DWORD,
    IdleTimeBuckets: [PPM_IDLE_STATE_BUCKET_EX; PROC_IDLE_BUCKET_COUNT_EX],
}}
pub type PPPM_IDLE_STATE_ACCOUNTING_EX = *mut PPM_IDLE_STATE_ACCOUNTING_EX;
STRUCT!{struct PPM_IDLE_ACCOUNTING_EX {
    StateCount: DWORD,
    TotalTransitions: DWORD,
    ResetCount: DWORD,
    AbortCount: DWORD,
    StartTime: DWORD64,
    State: [PPM_IDLE_STATE_ACCOUNTING_EX; ANYSIZE_ARRAY],
}}
pub type PPPM_IDLE_ACCOUNTING_EX = *mut PPM_IDLE_ACCOUNTING_EX;
pub const ACPI_PPM_SOFTWARE_ALL: DWORD = 0xFC;
pub const ACPI_PPM_SOFTWARE_ANY: DWORD = 0xFD;
pub const ACPI_PPM_HARDWARE_ALL: DWORD = 0xFE;
pub const MS_PPM_SOFTWARE_ALL: DWORD = 0x1;
pub const PPM_FIRMWARE_ACPI1C2: DWORD = 0x00000001;
pub const PPM_FIRMWARE_ACPI1C3: DWORD = 0x00000002;
pub const PPM_FIRMWARE_ACPI1TSTATES: DWORD = 0x00000004;
pub const PPM_FIRMWARE_CST: DWORD = 0x00000008;
pub const PPM_FIRMWARE_CSD: DWORD = 0x00000010;
pub const PPM_FIRMWARE_PCT: DWORD = 0x00000020;
pub const PPM_FIRMWARE_PSS: DWORD = 0x00000040;
pub const PPM_FIRMWARE_XPSS: DWORD = 0x00000080;
pub const PPM_FIRMWARE_PPC: DWORD = 0x00000100;
pub const PPM_FIRMWARE_PSD: DWORD = 0x00000200;
pub const PPM_FIRMWARE_PTC: DWORD = 0x00000400;
pub const PPM_FIRMWARE_TSS: DWORD = 0x00000800;
pub const PPM_FIRMWARE_TPC: DWORD = 0x00001000;
pub const PPM_FIRMWARE_TSD: DWORD = 0x00002000;
pub const PPM_FIRMWARE_PCCH: DWORD = 0x00004000;
pub const PPM_FIRMWARE_PCCP: DWORD = 0x00008000;
pub const PPM_FIRMWARE_OSC: DWORD = 0x00010000;
pub const PPM_FIRMWARE_PDC: DWORD = 0x00020000;
pub const PPM_FIRMWARE_CPC: DWORD = 0x00040000;
pub const PPM_FIRMWARE_LPI: DWORD = 0x00080000;
pub const PPM_PERFORMANCE_IMPLEMENTATION_NONE: DWORD = 0x00000000;
pub const PPM_PERFORMANCE_IMPLEMENTATION_PSTATES: DWORD = 0x00000001;
pub const PPM_PERFORMANCE_IMPLEMENTATION_PCCV1: DWORD = 0x00000002;
pub const PPM_PERFORMANCE_IMPLEMENTATION_CPPC: DWORD = 0x00000003;
pub const PPM_PERFORMANCE_IMPLEMENTATION_PEP: DWORD = 0x00000004;
pub const PPM_IDLE_IMPLEMENTATION_NONE: DWORD = 0x00000000;
pub const PPM_IDLE_IMPLEMENTATION_CSTATES: DWORD = 0x00000001;
pub const PPM_IDLE_IMPLEMENTATION_PEP: DWORD = 0x00000002;
pub const PPM_IDLE_IMPLEMENTATION_MICROPEP: DWORD = 0x00000003;
pub const PPM_IDLE_IMPLEMENTATION_LPISTATES: DWORD = 0x00000004;
DEFINE_GUID!{PPM_PERFSTATE_CHANGE_GUID,
    0xa5b32ddd, 0x7f39, 0x4abc, 0xb8, 0x92, 0x90, 0xe, 0x43, 0xb5, 0x9e, 0xbb}
DEFINE_GUID!{PPM_PERFSTATE_DOMAIN_CHANGE_GUID,
    0x995e6b7f, 0xd653, 0x497a, 0xb9, 0x78, 0x36, 0xa3, 0xc, 0x29, 0xbf, 0x1}
DEFINE_GUID!{PPM_IDLESTATE_CHANGE_GUID,
    0x4838fe4f, 0xf71c, 0x4e51, 0x9e, 0xcc, 0x84, 0x30, 0xa7, 0xac, 0x4c, 0x6c}
DEFINE_GUID!{PPM_PERFSTATES_DATA_GUID,
    0x5708cc20, 0x7d40, 0x4bf4, 0xb4, 0xaa, 0x2b, 0x01, 0x33, 0x8d, 0x01, 0x26}
DEFINE_GUID!{PPM_IDLESTATES_DATA_GUID,
    0xba138e10, 0xe250, 0x4ad7, 0x86, 0x16, 0xcf, 0x1a, 0x7a, 0xd4, 0x10, 0xe7}
DEFINE_GUID!{PPM_IDLE_ACCOUNTING_GUID,
    0xe2a26f78, 0xae07, 0x4ee0, 0xa3, 0x0f, 0xce, 0x54, 0xf5, 0x5a, 0x94, 0xcd}
DEFINE_GUID!{PPM_IDLE_ACCOUNTING_EX_GUID,
    0xd67abd39, 0x81f8, 0x4a5e, 0x81, 0x52, 0x72, 0xe3, 0x1e, 0xc9, 0x12, 0xee}
DEFINE_GUID!{PPM_THERMALCONSTRAINT_GUID,
    0xa852c2c8, 0x1a4c, 0x423b, 0x8c, 0x2c, 0xf3, 0x0d, 0x82, 0x93, 0x1a, 0x88}
DEFINE_GUID!{PPM_PERFMON_PERFSTATE_GUID,
    0x7fd18652, 0xcfe, 0x40d2, 0xb0, 0xa1, 0xb, 0x6, 0x6a, 0x87, 0x75, 0x9e}
DEFINE_GUID!{PPM_THERMAL_POLICY_CHANGE_GUID,
    0x48f377b8, 0x6880, 0x4c7b, 0x8b, 0xdc, 0x38, 0x1, 0x76, 0xc6, 0x65, 0x4d}
STRUCT!{struct PPM_PERFSTATE_EVENT {
    State: DWORD,
    Status: DWORD,
    Latency: DWORD,
    Speed: DWORD,
    Processor: DWORD,
}}
pub type PPPM_PERFSTATE_EVENT = *mut PPM_PERFSTATE_EVENT;
STRUCT!{struct PPM_PERFSTATE_DOMAIN_EVENT {
    State: DWORD,
    Latency: DWORD,
    Speed: DWORD,
    Processors: DWORD64,
}}
pub type PPPM_PERFSTATE_DOMAIN_EVENT = *mut PPM_PERFSTATE_DOMAIN_EVENT;
STRUCT!{struct PPM_IDLESTATE_EVENT {
    NewState: DWORD,
    OldState: DWORD,
    Processors: DWORD64,
}}
pub type PPPM_IDLESTATE_EVENT = *mut PPM_IDLESTATE_EVENT;
STRUCT!{struct PPM_THERMALCHANGE_EVENT {
    ThermalConstraint: DWORD,
    Processors: DWORD64,
}}
pub type PPPM_THERMALCHANGE_EVENT = *mut PPM_THERMALCHANGE_EVENT;
STRUCT!{struct PPM_THERMAL_POLICY_EVENT {
    Mode: BYTE,
    Processors: DWORD64,
}}
pub type PPPM_THERMAL_POLICY_EVENT = *mut PPM_THERMAL_POLICY_EVENT;
STRUCT!{struct POWER_ACTION_POLICY {
    Action: POWER_ACTION,
    Flags: DWORD,
    EventCode: DWORD,
}}
pub type PPOWER_ACTION_POLICY = *mut POWER_ACTION_POLICY;
pub const POWER_ACTION_QUERY_ALLOWED: DWORD = 0x00000001;
pub const POWER_ACTION_UI_ALLOWED: DWORD = 0x00000002;
pub const POWER_ACTION_OVERRIDE_APPS: DWORD = 0x00000004;
pub const POWER_ACTION_HIBERBOOT: DWORD = 0x00000008;
pub const POWER_ACTION_USER_NOTIFY: DWORD = 0x00000010;
pub const POWER_ACTION_DOZE_TO_HIBERNATE: DWORD = 0x00000020;
pub const POWER_ACTION_PSEUDO_TRANSITION: DWORD = 0x08000000;
pub const POWER_ACTION_LIGHTEST_FIRST: DWORD = 0x10000000;
pub const POWER_ACTION_LOCK_CONSOLE: DWORD = 0x20000000;
pub const POWER_ACTION_DISABLE_WAKES: DWORD = 0x40000000;
pub const POWER_ACTION_CRITICAL: DWORD = 0x80000000;
pub const POWER_LEVEL_USER_NOTIFY_TEXT: DWORD = 0x00000001;
pub const POWER_LEVEL_USER_NOTIFY_SOUND: DWORD = 0x00000002;
pub const POWER_LEVEL_USER_NOTIFY_EXEC: DWORD = 0x00000004;
pub const POWER_USER_NOTIFY_BUTTON: DWORD = 0x00000008;
pub const POWER_USER_NOTIFY_SHUTDOWN: DWORD = 0x00000010;
pub const POWER_USER_NOTIFY_FORCED_SHUTDOWN: DWORD = 0x00000020;
pub const POWER_FORCE_TRIGGER_RESET: DWORD = 0x80000000;
pub const BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK: DWORD = 0x00000007;
pub const BATTERY_DISCHARGE_FLAGS_ENABLE: DWORD = 0x80000000;
STRUCT!{struct SYSTEM_POWER_LEVEL {
    Enable: BOOLEAN,
    Spare: [BYTE; 3],
    BatteryLevel: DWORD,
    PowerPolicy: POWER_ACTION_POLICY,
    MinSystemState: SYSTEM_POWER_STATE,
}}
pub type PSYSTEM_POWER_LEVEL = *mut SYSTEM_POWER_LEVEL;
pub const NUM_DISCHARGE_POLICIES: usize = 4;
pub const DISCHARGE_POLICY_CRITICAL: DWORD = 0;
pub const DISCHARGE_POLICY_LOW: DWORD = 1;
STRUCT!{struct SYSTEM_POWER_POLICY {
    Revision: DWORD,
    PowerButton: POWER_ACTION_POLICY,
    SleepButton: POWER_ACTION_POLICY,
    LidClose: POWER_ACTION_POLICY,
    LidOpenWake: SYSTEM_POWER_STATE,
    Reserved: DWORD,
    Idle: POWER_ACTION_POLICY,
    IdleTimeout: DWORD,
    IdleSensitivity: BYTE,
    DynamicThrottle: BYTE,
    Spare2: [BYTE; 2],
    MinSleep: SYSTEM_POWER_STATE,
    MaxSleep: SYSTEM_POWER_STATE,
    ReducedLatencySleep: SYSTEM_POWER_STATE,
    WinLogonFlags: DWORD,
    Spare3: DWORD,
    DozeS4Timeout: DWORD,
    BroadcastCapacityResolution: DWORD,
    DischargePolicy: [SYSTEM_POWER_LEVEL; NUM_DISCHARGE_POLICIES],
    VideoTimeout: DWORD,
    VideoDimDisplay: BOOLEAN,
    VideoReserved: [DWORD; 3],
    SpindownTimeout: DWORD,
    OptimizeForPower: BOOLEAN,
    FanThrottleTolerance: BYTE,
    ForcedThrottle: BYTE,
    MinThrottle: BYTE,
    OverThrottled: POWER_ACTION_POLICY,
}}
pub type PSYSTEM_POWER_POLICY = *mut SYSTEM_POWER_POLICY;
pub const PROCESSOR_IDLESTATE_POLICY_COUNT: usize = 0x3;
STRUCT!{struct PROCESSOR_IDLESTATE_INFO {
    TimeCheck: DWORD,
    DemotePercent: BYTE,
    PromotePercent: BYTE,
    Spare: [BYTE; 2],
}}
pub type PPROCESSOR_IDLESTATE_INFO = *mut PROCESSOR_IDLESTATE_INFO;
STRUCT!{struct PROCESSOR_IDLESTATE_POLICY_Flags {
    AsWORD: WORD,
}}
BITFIELD!{PROCESSOR_IDLESTATE_POLICY_Flags AsWORD: WORD [
    AllowScaling set_AllowScaling[0..1],
    Disabled set_Disabled[1..2],
    Reserved set_Reserved[2..16],
]}
STRUCT!{struct PROCESSOR_IDLESTATE_POLICY {
    Revision: WORD,
    Flags: PROCESSOR_IDLESTATE_POLICY_Flags,
    PolicyCount: DWORD,
    Policy: [PROCESSOR_IDLESTATE_INFO; PROCESSOR_IDLESTATE_POLICY_COUNT],
}}
pub type PPROCESSOR_IDLESTATE_POLICY = *mut PROCESSOR_IDLESTATE_POLICY;
pub const PO_THROTTLE_NONE: DWORD = 0;
pub const PO_THROTTLE_CONSTANT: DWORD = 1;
pub const PO_THROTTLE_DEGRADE: DWORD = 2;
pub const PO_THROTTLE_ADAPTIVE: DWORD = 3;
pub const PO_THROTTLE_MAXIMUM: DWORD = 4;
STRUCT!{struct PROCESSOR_POWER_POLICY_INFO {
    TimeCheck: DWORD,
    DemoteLimit: DWORD,
    PromoteLimit: DWORD,
    DemotePercent: BYTE,
    PromotePercent: BYTE,
    Spare: [BYTE; 2],
    Reserved: DWORD,
}}
BITFIELD!{PROCESSOR_POWER_POLICY_INFO Reserved: DWORD [
    AllowDemotion set_AllowDemotion[0..1],
    AllowPromotion set_AllowPromotion[1..2],
    Reserved set_Reserved[2..32],
]}
pub type PPROCESSOR_POWER_POLICY_INFO = *mut PROCESSOR_POWER_POLICY_INFO;
STRUCT!{struct PROCESSOR_POWER_POLICY {
    Revision: DWORD,
    DynamicThrottle: BYTE,
    Spare: [BYTE; 3],
    BitFields: DWORD,
    PolicyCount: DWORD,
    Policy: [PROCESSOR_POWER_POLICY_INFO; 3],
}}
BITFIELD!{PROCESSOR_POWER_POLICY BitFields: DWORD [
    DisableCStates set_DisableCStates[0..1],
    Reserved set_Reserved[1..32],
]}
pub type PPROCESSOR_POWER_POLICY = *mut PROCESSOR_POWER_POLICY;
STRUCT!{struct PROCESSOR_PERFSTATE_POLICY_u_Flags {
    AsBYTE: BYTE,
}}
BITFIELD!{PROCESSOR_PERFSTATE_POLICY_u_Flags AsBYTE: BYTE [
    NoDomainAccounting set_NoDomainAccounting[0..1],
    IncreasePolicy set_IncreasePolicy[1..3],
    DecreasePolicy set_DecreasePolicy[3..5],
    Reserved set_Reserved[5..8],
]}
UNION!{union PROCESSOR_PERFSTATE_POLICY_u {
    [u8; 1],
    Spare Spare_mut: BYTE,
    Flags Flags_mut: PROCESSOR_PERFSTATE_POLICY_u_Flags,
}}
STRUCT!{struct PROCESSOR_PERFSTATE_POLICY {
    Revision: DWORD,
    MaxThrottle: BYTE,
    MinThrottle: BYTE,
    BusyAdjThreshold: BYTE,
    u: PROCESSOR_PERFSTATE_POLICY_u,
    TimeCheck: DWORD,
    IncreaseTime: DWORD,
    DecreaseTime: DWORD,
    IncreasePercent: DWORD,
    DecreasePercent: DWORD,
}}
pub type PPROCESSOR_PERFSTATE_POLICY = *mut PROCESSOR_PERFSTATE_POLICY;
STRUCT!{struct ADMINISTRATOR_POWER_POLICY {
    MinSleep: SYSTEM_POWER_STATE,
    MaxSleep: SYSTEM_POWER_STATE,
    MinVideoTimeout: DWORD,
    MaxVideoTimeout: DWORD,
    MinSpindownTimeout: DWORD,
    MaxSpindownTimeout: DWORD,
}}
pub type PADMINISTRATOR_POWER_POLICY = *mut ADMINISTRATOR_POWER_POLICY;
ENUM!{enum HIBERFILE_BUCKET_SIZE {
    HiberFileBucket1GB = 0,
    HiberFileBucket2GB,
    HiberFileBucket4GB,
    HiberFileBucket8GB,
    HiberFileBucket16GB,
    HiberFileBucket32GB,
    HiberFileBucketUnlimited,
    HiberFileBucketMax,
}}
pub const HIBERFILE_TYPE_NONE: BYTE = 0x00;
pub const HIBERFILE_TYPE_REDUCED: BYTE = 0x01;
pub const HIBERFILE_TYPE_FULL: BYTE = 0x02;
pub const HIBERFILE_TYPE_MAX: usize = 0x03;
STRUCT!{struct HIBERFILE_BUCKET {
    MaxPhysicalMemory: DWORD64,
    PhysicalMemoryPercent: [DWORD; HIBERFILE_TYPE_MAX],
}}
pub type PHIBERFILE_BUCKET = *mut HIBERFILE_BUCKET;
STRUCT!{struct SYSTEM_POWER_CAPABILITIES {
    PowerButtonPresent: BOOLEAN,
    SleepButtonPresent: BOOLEAN,
    LidPresent: BOOLEAN,
    SystemS1: BOOLEAN,
    SystemS2: BOOLEAN,
    SystemS3: BOOLEAN,
    SystemS4: BOOLEAN,
    SystemS5: BOOLEAN,
    HiberFilePresent: BOOLEAN,
    FullWake: BOOLEAN,
    VideoDimPresent: BOOLEAN,
    ApmPresent: BOOLEAN,
    UpsPresent: BOOLEAN,
    ThermalControl: BOOLEAN,
    ProcessorThrottle: BOOLEAN,
    ProcessorMinThrottle: BYTE,
    ProcessorMaxThrottle: BYTE,
    FastSystemS4: BOOLEAN,
    Hiberboot: BOOLEAN,
    WakeAlarmPresent: BOOLEAN,
    AoAc: BOOLEAN,
    DiskSpinDown: BOOLEAN,
    HiberFileType: BYTE,
    AoAcConnectivitySupported: BOOLEAN,
    spare3: [BYTE; 6],
    SystemBatteriesPresent: BOOLEAN,
    BatteriesAreShortTerm: BOOLEAN,
    BatteryScale: [BATTERY_REPORTING_SCALE; 3],
    AcOnLineWake: SYSTEM_POWER_STATE,
    SoftLidWake: SYSTEM_POWER_STATE,
    RtcWake: SYSTEM_POWER_STATE,
    MinDeviceWakeState: SYSTEM_POWER_STATE,
    DefaultLowLatencyWake: SYSTEM_POWER_STATE,
}}
pub type PSYSTEM_POWER_CAPABILITIES = *mut SYSTEM_POWER_CAPABILITIES;
STRUCT!{struct SYSTEM_BATTERY_STATE {
    AcOnLine: BOOLEAN,
    BatteryPresent: BOOLEAN,
    Charging: BOOLEAN,
    Discharging: BOOLEAN,
    Spare1: [BOOLEAN; 3],
    Tag: BYTE,
    MaxCapacity: DWORD,
    RemainingCapacity: DWORD,
    Rate: DWORD,
    EstimatedTime: DWORD,
    DefaultAlert1: DWORD,
    DefaultAlert2: DWORD,
}}
pub type PSYSTEM_BATTERY_STATE = *mut SYSTEM_BATTERY_STATE;
pub const IMAGE_DOS_SIGNATURE: WORD = 0x5A4D;
pub const IMAGE_OS2_SIGNATURE: WORD = 0x454E;
pub const IMAGE_OS2_SIGNATURE_LE: WORD = 0x454C;
pub const IMAGE_VXD_SIGNATURE: WORD = 0x454C;
pub const IMAGE_NT_SIGNATURE: DWORD = 0x00004550;
STRUCT!{struct IMAGE_DOS_HEADER {
    e_magic: WORD,
    e_cblp: WORD,
    e_cp: WORD,
    e_crlc: WORD,
    e_cparhdr: WORD,
    e_minalloc: WORD,
    e_maxalloc: WORD,
    e_ss: WORD,
    e_sp: WORD,
    e_csum: WORD,
    e_ip: WORD,
    e_cs: WORD,
    e_lfarlc: WORD,
    e_ovno: WORD,
    e_res: [WORD; 4],
    e_oemid: WORD,
    e_oeminfo: WORD,
    e_res2: [WORD; 10],
    e_lfanew: LONG,
}}
pub type PIMAGE_DOS_HEADER = *mut IMAGE_DOS_HEADER;
STRUCT!{struct IMAGE_OS2_HEADER {
    ne_magic: WORD,
    ne_ver: CHAR,
    ne_rev: CHAR,
    ne_enttab: WORD,
    ne_cbenttab: WORD,
    ne_crc: LONG,
    ne_flags: WORD,
    ne_autodata: WORD,
    ne_heap: WORD,
    ne_stack: WORD,
    ne_csip: LONG,
    ne_sssp: LONG,
    ne_cseg: WORD,
    ne_cmod: WORD,
    ne_cbnrestab: WORD,
    ne_segtab: WORD,
    ne_rsrctab: WORD,
    ne_restab: WORD,
    ne_modtab: WORD,
    ne_imptab: WORD,
    ne_nrestab: LONG,
    ne_cmovent: WORD,
    ne_align: WORD,
    ne_cres: WORD,
    ne_exetyp: BYTE,
    ne_flagsothers: BYTE,
    ne_pretthunks: WORD,
    ne_psegrefbytes: WORD,
    ne_swaparea: WORD,
    ne_expver: WORD,
}}
pub type PIMAGE_OS2_HEADER = *mut IMAGE_OS2_HEADER;
STRUCT!{struct IMAGE_VXD_HEADER {
    e32_magic: WORD,
    e32_border: BYTE,
    e32_worder: BYTE,
    e32_level: DWORD,
    e32_cpu: WORD,
    e32_os: WORD,
    e32_ver: DWORD,
    e32_mflags: DWORD,
    e32_mpages: DWORD,
    e32_startobj: DWORD,
    e32_eip: DWORD,
    e32_stackobj: DWORD,
    e32_esp: DWORD,
    e32_pagesize: DWORD,
    e32_lastpagesize: DWORD,
    e32_fixupsize: DWORD,
    e32_fixupsum: DWORD,
    e32_ldrsize: DWORD,
    e32_ldrsum: DWORD,
    e32_objtab: DWORD,
    e32_objcnt: DWORD,
    e32_objmap: DWORD,
    e32_itermap: DWORD,
    e32_rsrctab: DWORD,
    e32_rsrccnt: DWORD,
    e32_restab: DWORD,
    e32_enttab: DWORD,
    e32_dirtab: DWORD,
    e32_dircnt: DWORD,
    e32_fpagetab: DWORD,
    e32_frectab: DWORD,
    e32_impmod: DWORD,
    e32_impmodcnt: DWORD,
    e32_impproc: DWORD,
    e32_pagesum: DWORD,
    e32_datapage: DWORD,
    e32_preload: DWORD,
    e32_nrestab: DWORD,
    e32_cbnrestab: DWORD,
    e32_nressum: DWORD,
    e32_autodata: DWORD,
    e32_debuginfo: DWORD,
    e32_debuglen: DWORD,
    e32_instpreload: DWORD,
    e32_instdemand: DWORD,
    e32_heapsize: DWORD,
    e32_res3: [BYTE; 12],
    e32_winresoff: DWORD,
    e32_winreslen: DWORD,
    e32_devid: WORD,
    e32_ddkver: WORD,
}}
pub type PIMAGE_VXD_HEADER = *mut IMAGE_VXD_HEADER;
STRUCT!{struct IMAGE_FILE_HEADER {
    Machine: WORD,
    NumberOfSections: WORD,
    TimeDateStamp: DWORD,
    PointerToSymbolTable: DWORD,
    NumberOfSymbols: DWORD,
    SizeOfOptionalHeader: WORD,
    Characteristics: WORD,
}}
pub type PIMAGE_FILE_HEADER = *mut IMAGE_FILE_HEADER;
pub const IMAGE_SIZEOF_FILE_HEADER: usize = 20;
pub const IMAGE_FILE_RELOCS_STRIPPED: WORD = 0x0001;
pub const IMAGE_FILE_EXECUTABLE_IMAGE: WORD = 0x0002;
pub const IMAGE_FILE_LINE_NUMS_STRIPPED: WORD = 0x0004;
pub const IMAGE_FILE_LOCAL_SYMS_STRIPPED: WORD = 0x0008;
pub const IMAGE_FILE_AGGRESIVE_WS_TRIM: WORD = 0x0010;
pub const IMAGE_FILE_LARGE_ADDRESS_AWARE: WORD = 0x0020;
pub const IMAGE_FILE_BYTES_REVERSED_LO: WORD = 0x0080;
pub const IMAGE_FILE_32BIT_MACHINE: WORD = 0x0100;
pub const IMAGE_FILE_DEBUG_STRIPPED: WORD = 0x0200;
pub const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP: WORD = 0x0400;
pub const IMAGE_FILE_NET_RUN_FROM_SWAP: WORD = 0x0800;
pub const IMAGE_FILE_SYSTEM: WORD = 0x1000;
pub const IMAGE_FILE_DLL: WORD = 0x2000;
pub const IMAGE_FILE_UP_SYSTEM_ONLY: WORD = 0x4000;
pub const IMAGE_FILE_BYTES_REVERSED_HI: WORD = 0x8000;
pub const IMAGE_FILE_MACHINE_UNKNOWN: WORD = 0;
pub const IMAGE_FILE_MACHINE_TARGET_HOST: WORD = 0x0001;
pub const IMAGE_FILE_MACHINE_I386: WORD = 0x014c;
pub const IMAGE_FILE_MACHINE_R3000: WORD = 0x0162;
pub const IMAGE_FILE_MACHINE_R4000: WORD = 0x0166;
pub const IMAGE_FILE_MACHINE_R10000: WORD = 0x0168;
pub const IMAGE_FILE_MACHINE_WCEMIPSV2: WORD = 0x0169;
pub const IMAGE_FILE_MACHINE_ALPHA: WORD = 0x0184;
pub const IMAGE_FILE_MACHINE_SH3: WORD = 0x01a2;
pub const IMAGE_FILE_MACHINE_SH3DSP: WORD = 0x01a3;
pub const IMAGE_FILE_MACHINE_SH3E: WORD = 0x01a4;
pub const IMAGE_FILE_MACHINE_SH4: WORD = 0x01a6;
pub const IMAGE_FILE_MACHINE_SH5: WORD = 0x01a8;
pub const IMAGE_FILE_MACHINE_ARM: WORD = 0x01c0;
pub const IMAGE_FILE_MACHINE_THUMB: WORD = 0x01c2;
pub const IMAGE_FILE_MACHINE_ARMNT: WORD = 0x01c4;
pub const IMAGE_FILE_MACHINE_AM33: WORD = 0x01d3;
pub const IMAGE_FILE_MACHINE_POWERPC: WORD = 0x01F0;
pub const IMAGE_FILE_MACHINE_POWERPCFP: WORD = 0x01f1;
pub const IMAGE_FILE_MACHINE_IA64: WORD = 0x0200;
pub const IMAGE_FILE_MACHINE_MIPS16: WORD = 0x0266;
pub const IMAGE_FILE_MACHINE_ALPHA64: WORD = 0x0284;
pub const IMAGE_FILE_MACHINE_MIPSFPU: WORD = 0x0366;
pub const IMAGE_FILE_MACHINE_MIPSFPU16: WORD = 0x0466;
pub const IMAGE_FILE_MACHINE_AXP64: WORD = IMAGE_FILE_MACHINE_ALPHA64;
pub const IMAGE_FILE_MACHINE_TRICORE: WORD = 0x0520;
pub const IMAGE_FILE_MACHINE_CEF: WORD = 0x0CEF;
pub const IMAGE_FILE_MACHINE_EBC: WORD = 0x0EBC;
pub const IMAGE_FILE_MACHINE_AMD64: WORD = 0x8664;
pub const IMAGE_FILE_MACHINE_M32R: WORD = 0x9041;
pub const IMAGE_FILE_MACHINE_ARM64: WORD = 0xAA64;
pub const IMAGE_FILE_MACHINE_CEE: WORD = 0xC0EE;
STRUCT!{struct IMAGE_DATA_DIRECTORY {
    VirtualAddress: DWORD,
    Size: DWORD,
}}
pub type PIMAGE_DATA_DIRECTORY = *mut IMAGE_DATA_DIRECTORY;
pub const IMAGE_NUMBEROF_DIRECTORY_ENTRIES: usize = 16;
STRUCT!{struct IMAGE_OPTIONAL_HEADER32 {
    Magic: WORD,
    MajorLinkerVersion: BYTE,
    MinorLinkerVersion: BYTE,
    SizeOfCode: DWORD,
    SizeOfInitializedData: DWORD,
    SizeOfUninitializedData: DWORD,
    AddressOfEntryPoint: DWORD,
    BaseOfCode: DWORD,
    BaseOfData: DWORD,
    ImageBase: DWORD,
    SectionAlignment: DWORD,
    FileAlignment: DWORD,
    MajorOperatingSystemVersion: WORD,
    MinorOperatingSystemVersion: WORD,
    MajorImageVersion: WORD,
    MinorImageVersion: WORD,
    MajorSubsystemVersion: WORD,
    MinorSubsystemVersion: WORD,
    Win32VersionValue: DWORD,
    SizeOfImage: DWORD,
    SizeOfHeaders: DWORD,
    CheckSum: DWORD,
    Subsystem: WORD,
    DllCharacteristics: WORD,
    SizeOfStackReserve: DWORD,
    SizeOfStackCommit: DWORD,
    SizeOfHeapReserve: DWORD,
    SizeOfHeapCommit: DWORD,
    LoaderFlags: DWORD,
    NumberOfRvaAndSizes: DWORD,
    DataDirectory: [IMAGE_DATA_DIRECTORY; IMAGE_NUMBEROF_DIRECTORY_ENTRIES],
}}
pub type PIMAGE_OPTIONAL_HEADER32 = *mut IMAGE_OPTIONAL_HEADER32;
STRUCT!{struct IMAGE_ROM_OPTIONAL_HEADER {
    Magic: WORD,
    MajorLinkerVersion: BYTE,
    MinorLinkerVersion: BYTE,
    SizeOfCode: DWORD,
    SizeOfInitializedData: DWORD,
    SizeOfUninitializedData: DWORD,
    AddressOfEntryPoint: DWORD,
    BaseOfCode: DWORD,
    BaseOfData: DWORD,
    BaseOfBss: DWORD,
    GprMask: DWORD,
    CprMask: [DWORD; 4],
    GpValue: DWORD,
}}
pub type PIMAGE_ROM_OPTIONAL_HEADER = *mut IMAGE_ROM_OPTIONAL_HEADER;
STRUCT!{struct IMAGE_OPTIONAL_HEADER64 {
    Magic: WORD,
    MajorLinkerVersion: BYTE,
    MinorLinkerVersion: BYTE,
    SizeOfCode: DWORD,
    SizeOfInitializedData: DWORD,
    SizeOfUninitializedData: DWORD,
    AddressOfEntryPoint: DWORD,
    BaseOfCode: DWORD,
    ImageBase: ULONGLONG,
    SectionAlignment: DWORD,
    FileAlignment: DWORD,
    MajorOperatingSystemVersion: WORD,
    MinorOperatingSystemVersion: WORD,
    MajorImageVersion: WORD,
    MinorImageVersion: WORD,
    MajorSubsystemVersion: WORD,
    MinorSubsystemVersion: WORD,
    Win32VersionValue: DWORD,
    SizeOfImage: DWORD,
    SizeOfHeaders: DWORD,
    CheckSum: DWORD,
    Subsystem: WORD,
    DllCharacteristics: WORD,
    SizeOfStackReserve: ULONGLONG,
    SizeOfStackCommit: ULONGLONG,
    SizeOfHeapReserve: ULONGLONG,
    SizeOfHeapCommit: ULONGLONG,
    LoaderFlags: DWORD,
    NumberOfRvaAndSizes: DWORD,
    DataDirectory: [IMAGE_DATA_DIRECTORY; IMAGE_NUMBEROF_DIRECTORY_ENTRIES],
}}
pub type PIMAGE_OPTIONAL_HEADER64 = *mut IMAGE_OPTIONAL_HEADER64;
pub const IMAGE_NT_OPTIONAL_HDR32_MAGIC: WORD = 0x10b;
pub const IMAGE_NT_OPTIONAL_HDR64_MAGIC: WORD = 0x20b;
pub const IMAGE_ROM_OPTIONAL_HDR_MAGIC: WORD = 0x107;
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER64;
pub type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER64;
pub const IMAGE_NT_OPTIONAL_HDR_MAGIC: WORD = IMAGE_NT_OPTIONAL_HDR64_MAGIC;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER32;
pub type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER32;
pub const IMAGE_NT_OPTIONAL_HDR_MAGIC: WORD = IMAGE_NT_OPTIONAL_HDR32_MAGIC;
}
STRUCT!{struct IMAGE_NT_HEADERS64 {
    Signature: DWORD,
    FileHeader: IMAGE_FILE_HEADER,
    OptionalHeader: IMAGE_OPTIONAL_HEADER64,
}}
pub type PIMAGE_NT_HEADERS64 = *mut IMAGE_NT_HEADERS64;
STRUCT!{struct IMAGE_NT_HEADERS32 {
    Signature: DWORD,
    FileHeader: IMAGE_FILE_HEADER,
    OptionalHeader: IMAGE_OPTIONAL_HEADER32,
}}
pub type PIMAGE_NT_HEADERS32 = *mut IMAGE_NT_HEADERS32;
STRUCT!{struct IMAGE_ROM_HEADERS {
    FileHeader: IMAGE_FILE_HEADER,
    OptionalHeader: IMAGE_ROM_OPTIONAL_HEADER,
}}
pub type PIMAGE_ROM_HEADERS = *mut IMAGE_ROM_HEADERS;
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS64;
pub type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS64;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS32;
pub type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS32;
}
pub const IMAGE_SUBSYSTEM_UNKNOWN: WORD = 0;
pub const IMAGE_SUBSYSTEM_NATIVE: WORD = 1;
pub const IMAGE_SUBSYSTEM_WINDOWS_GUI: WORD = 2;
pub const IMAGE_SUBSYSTEM_WINDOWS_CUI: WORD = 3;
pub const IMAGE_SUBSYSTEM_OS2_CUI: WORD = 5;
pub const IMAGE_SUBSYSTEM_POSIX_CUI: WORD = 7;
pub const IMAGE_SUBSYSTEM_NATIVE_WINDOWS: WORD = 8;
pub const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: WORD = 9;
pub const IMAGE_SUBSYSTEM_EFI_APPLICATION: WORD = 10;
pub const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: WORD = 11;
pub const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: WORD = 12;
pub const IMAGE_SUBSYSTEM_EFI_ROM: WORD = 13;
pub const IMAGE_SUBSYSTEM_XBOX: WORD = 14;
pub const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION: WORD = 16;
pub const IMAGE_SUBSYSTEM_XBOX_CODE_CATALOG: WORD = 17;
pub const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA: WORD = 0x0020;
pub const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE: WORD = 0x0040;
pub const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY: WORD = 0x0080;
pub const IMAGE_DLLCHARACTERISTICS_NX_COMPAT: WORD = 0x0100;
pub const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION: WORD = 0x0200;
pub const IMAGE_DLLCHARACTERISTICS_NO_SEH: WORD = 0x0400;
pub const IMAGE_DLLCHARACTERISTICS_NO_BIND: WORD = 0x0800;
pub const IMAGE_DLLCHARACTERISTICS_APPCONTAINER: WORD = 0x1000;
pub const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: WORD = 0x2000;
pub const IMAGE_DLLCHARACTERISTICS_GUARD_CF: WORD = 0x4000;
pub const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: WORD = 0x8000;
pub const IMAGE_DIRECTORY_ENTRY_EXPORT: WORD = 0;
pub const IMAGE_DIRECTORY_ENTRY_IMPORT: WORD = 1;
pub const IMAGE_DIRECTORY_ENTRY_RESOURCE: WORD = 2;
pub const IMAGE_DIRECTORY_ENTRY_EXCEPTION: WORD = 3;
pub const IMAGE_DIRECTORY_ENTRY_SECURITY: WORD = 4;
pub const IMAGE_DIRECTORY_ENTRY_BASERELOC: WORD = 5;
pub const IMAGE_DIRECTORY_ENTRY_DEBUG: WORD = 6;
pub const IMAGE_DIRECTORY_ENTRY_ARCHITECTURE: WORD = 7;
pub const IMAGE_DIRECTORY_ENTRY_GLOBALPTR: WORD = 8;
pub const IMAGE_DIRECTORY_ENTRY_TLS: WORD = 9;
pub const IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: WORD = 10;
pub const IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT: WORD = 11;
pub const IMAGE_DIRECTORY_ENTRY_IAT: WORD = 12;
pub const IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT: WORD = 13;
pub const IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR: WORD = 14;
STRUCT!{struct ANON_OBJECT_HEADER {
    Sig1: WORD,
    Sig2: WORD,
    Version: WORD,
    Machine: WORD,
    TimeDateStamp: DWORD,
    ClassID: CLSID,
    SizeOfData: DWORD,
}}
STRUCT!{struct ANON_OBJECT_HEADER_V2 {
    Sig1: WORD,
    Sig2: WORD,
    Version: WORD,
    Machine: WORD,
    TimeDateStamp: DWORD,
    ClassID: CLSID,
    SizeOfData: DWORD,
    Flags: DWORD,
    MetaDataSize: DWORD,
    MetaDataOffset: DWORD,
}}
STRUCT!{struct ANON_OBJECT_HEADER_BIGOBJ {
    Sig1: WORD,
    Sig2: WORD,
    Version: WORD,
    Machine: WORD,
    TimeDateStamp: DWORD,
    ClassID: CLSID,
    SizeOfData: DWORD,
    Flags: DWORD,
    MetaDataSize: DWORD,
    MetaDataOffset: DWORD,
    NumberOfSections: DWORD,
    PointerToSymbolTable: DWORD,
    NumberOfSymbols: DWORD,
}}
pub const IMAGE_SIZEOF_SHORT_NAME: usize = 8;
UNION!{union IMAGE_SECTION_HEADER_Misc {
    [u32; 1],
    PhysicalAddress PhysicalAddress_mut: DWORD,
    VirtualSize VirtualSize_mut: DWORD,
}}
STRUCT!{struct IMAGE_SECTION_HEADER {
    Name: [BYTE; IMAGE_SIZEOF_SHORT_NAME],
    Misc: IMAGE_SECTION_HEADER_Misc,
    VirtualAddress: DWORD,
    SizeOfRawData: DWORD,
    PointerToRawData: DWORD,
    PointerToRelocations: DWORD,
    PointerToLinenumbers: DWORD,
    NumberOfRelocations: WORD,
    NumberOfLinenumbers: WORD,
    Characteristics: DWORD,
}}
pub type PIMAGE_SECTION_HEADER = *mut IMAGE_SECTION_HEADER;
pub const IMAGE_SIZEOF_SECTION_HEADER: usize = 40;
pub const IMAGE_SCN_TYPE_NO_PAD: DWORD = 0x00000008;
pub const IMAGE_SCN_CNT_CODE: DWORD = 0x00000020;
pub const IMAGE_SCN_CNT_INITIALIZED_DATA: DWORD = 0x00000040;
pub const IMAGE_SCN_CNT_UNINITIALIZED_DATA: DWORD = 0x00000080;
pub const IMAGE_SCN_LNK_OTHER: DWORD = 0x00000100;
pub const IMAGE_SCN_LNK_INFO: DWORD = 0x00000200;
pub const IMAGE_SCN_LNK_REMOVE: DWORD = 0x00000800;
pub const IMAGE_SCN_LNK_COMDAT: DWORD = 0x00001000;
pub const IMAGE_SCN_NO_DEFER_SPEC_EXC: DWORD = 0x00004000;
pub const IMAGE_SCN_GPREL: DWORD = 0x00008000;
pub const IMAGE_SCN_MEM_FARDATA: DWORD = 0x00008000;
pub const IMAGE_SCN_MEM_PURGEABLE: DWORD = 0x00020000;
pub const IMAGE_SCN_MEM_16BIT: DWORD = 0x00020000;
pub const IMAGE_SCN_MEM_LOCKED: DWORD = 0x00040000;
pub const IMAGE_SCN_MEM_PRELOAD: DWORD = 0x00080000;
pub const IMAGE_SCN_ALIGN_1BYTES: DWORD = 0x00100000;
pub const IMAGE_SCN_ALIGN_2BYTES: DWORD = 0x00200000;
pub const IMAGE_SCN_ALIGN_4BYTES: DWORD = 0x00300000;
pub const IMAGE_SCN_ALIGN_8BYTES: DWORD = 0x00400000;
pub const IMAGE_SCN_ALIGN_16BYTES: DWORD = 0x00500000;
pub const IMAGE_SCN_ALIGN_32BYTES: DWORD = 0x00600000;
pub const IMAGE_SCN_ALIGN_64BYTES: DWORD = 0x00700000;
pub const IMAGE_SCN_ALIGN_128BYTES: DWORD = 0x00800000;
pub const IMAGE_SCN_ALIGN_256BYTES: DWORD = 0x00900000;
pub const IMAGE_SCN_ALIGN_512BYTES: DWORD = 0x00A00000;
pub const IMAGE_SCN_ALIGN_1024BYTES: DWORD = 0x00B00000;
pub const IMAGE_SCN_ALIGN_2048BYTES: DWORD = 0x00C00000;
pub const IMAGE_SCN_ALIGN_4096BYTES: DWORD = 0x00D00000;
pub const IMAGE_SCN_ALIGN_8192BYTES: DWORD = 0x00E00000;
pub const IMAGE_SCN_ALIGN_MASK: DWORD = 0x00F00000;
pub const IMAGE_SCN_LNK_NRELOC_OVFL: DWORD = 0x01000000;
pub const IMAGE_SCN_MEM_DISCARDABLE: DWORD = 0x02000000;
pub const IMAGE_SCN_MEM_NOT_CACHED: DWORD = 0x04000000;
pub const IMAGE_SCN_MEM_NOT_PAGED: DWORD = 0x08000000;
pub const IMAGE_SCN_MEM_SHARED: DWORD = 0x10000000;
pub const IMAGE_SCN_MEM_EXECUTE: DWORD = 0x20000000;
pub const IMAGE_SCN_MEM_READ: DWORD = 0x40000000;
pub const IMAGE_SCN_MEM_WRITE: DWORD = 0x80000000;
pub const IMAGE_SCN_SCALE_INDEX: DWORD = 0x00000001;
STRUCT!{struct IMAGE_SYMBOL_N_Name {
    Short: DWORD,
    Long: DWORD,
}}
UNION!{union IMAGE_SYMBOL_N {
    [u32; 2],
    ShortName ShortName_mut: [BYTE; 8],
    Name Name_mut: IMAGE_SYMBOL_N_Name,
    LongName LongName_mut: [DWORD; 2],
}}
STRUCT!{struct IMAGE_SYMBOL {
    N: IMAGE_SYMBOL_N,
    Value: DWORD,
    SectionNumber: SHORT,
    Type: WORD,
    StorageClass: BYTE,
    NumberOfAuxSymbols: BYTE,
}}
pub type PIMAGE_SYMBOL = *mut IMAGE_SYMBOL;
pub const IMAGE_SIZEOF_SYMBOL: usize = 18;
STRUCT!{struct IMAGE_SYMBOL_EX_N_Name {
    Short: DWORD,
    Long: DWORD,
}}
UNION!{union IMAGE_SYMBOL_EX_N {
    [u32; 2],
    ShortName ShortName_mut: [BYTE; 8],
    Name Name_mut: IMAGE_SYMBOL_EX_N_Name,
    LongName LongName_mut: [DWORD; 2],
}}
STRUCT!{struct IMAGE_SYMBOL_EX {
    N: IMAGE_SYMBOL_EX_N,
    Value: DWORD,
    SectionNumber: LONG,
    Type: WORD,
    StorageClass: BYTE,
    NumberOfAuxSymbols: BYTE,
}}
pub type PIMAGE_SYMBOL_EX = *mut IMAGE_SYMBOL_EX;
pub const IMAGE_SYM_UNDEFINED: SHORT = 0;
pub const IMAGE_SYM_ABSOLUTE: SHORT = -1;
pub const IMAGE_SYM_DEBUG: SHORT = -2;
pub const IMAGE_SYM_SECTION_MAX: USHORT = 0xFEFF;
pub const IMAGE_SYM_SECTION_MAX_EX: LONG = MAXLONG;
pub const IMAGE_SYM_TYPE_NULL: WORD = 0x0000;
pub const IMAGE_SYM_TYPE_VOID: WORD = 0x0001;
pub const IMAGE_SYM_TYPE_CHAR: WORD = 0x0002;
pub const IMAGE_SYM_TYPE_SHORT: WORD = 0x0003;
pub const IMAGE_SYM_TYPE_INT: WORD = 0x0004;
pub const IMAGE_SYM_TYPE_LONG: WORD = 0x0005;
pub const IMAGE_SYM_TYPE_FLOAT: WORD = 0x0006;
pub const IMAGE_SYM_TYPE_DOUBLE: WORD = 0x0007;
pub const IMAGE_SYM_TYPE_STRUCT: WORD = 0x0008;
pub const IMAGE_SYM_TYPE_UNION: WORD = 0x0009;
pub const IMAGE_SYM_TYPE_ENUM: WORD = 0x000A;
pub const IMAGE_SYM_TYPE_MOE: WORD = 0x000B;
pub const IMAGE_SYM_TYPE_BYTE: WORD = 0x000C;
pub const IMAGE_SYM_TYPE_WORD: WORD = 0x000D;
pub const IMAGE_SYM_TYPE_UINT: WORD = 0x000E;
pub const IMAGE_SYM_TYPE_DWORD: WORD = 0x000F;
pub const IMAGE_SYM_TYPE_PCODE: WORD = 0x8000;
pub const IMAGE_SYM_DTYPE_NULL: WORD = 0;
pub const IMAGE_SYM_DTYPE_POINTER: WORD = 1;
pub const IMAGE_SYM_DTYPE_FUNCTION: WORD = 2;
pub const IMAGE_SYM_DTYPE_ARRAY: WORD = 3;
pub const IMAGE_SYM_CLASS_END_OF_FUNCTION: BYTE = -1i8 as u8;
pub const IMAGE_SYM_CLASS_NULL: BYTE = 0x0000;
pub const IMAGE_SYM_CLASS_AUTOMATIC: BYTE = 0x0001;
pub const IMAGE_SYM_CLASS_EXTERNAL: BYTE = 0x0002;
pub const IMAGE_SYM_CLASS_STATIC: BYTE = 0x0003;
pub const IMAGE_SYM_CLASS_REGISTER: BYTE = 0x0004;
pub const IMAGE_SYM_CLASS_EXTERNAL_DEF: BYTE = 0x0005;
pub const IMAGE_SYM_CLASS_LABEL: BYTE = 0x0006;
pub const IMAGE_SYM_CLASS_UNDEFINED_LABEL: BYTE = 0x0007;
pub const IMAGE_SYM_CLASS_MEMBER_OF_STRUCT: BYTE = 0x0008;
pub const IMAGE_SYM_CLASS_ARGUMENT: BYTE = 0x0009;
pub const IMAGE_SYM_CLASS_STRUCT_TAG: BYTE = 0x000A;
pub const IMAGE_SYM_CLASS_MEMBER_OF_UNION: BYTE = 0x000B;
pub const IMAGE_SYM_CLASS_UNION_TAG: BYTE = 0x000C;
pub const IMAGE_SYM_CLASS_TYPE_DEFINITION: BYTE = 0x000D;
pub const IMAGE_SYM_CLASS_UNDEFINED_STATIC: BYTE = 0x000E;
pub const IMAGE_SYM_CLASS_ENUM_TAG: BYTE = 0x000F;
pub const IMAGE_SYM_CLASS_MEMBER_OF_ENUM: BYTE = 0x0010;
pub const IMAGE_SYM_CLASS_REGISTER_PARAM: BYTE = 0x0011;
pub const IMAGE_SYM_CLASS_BIT_FIELD: BYTE = 0x0012;
pub const IMAGE_SYM_CLASS_FAR_EXTERNAL: BYTE = 0x0044;
pub const IMAGE_SYM_CLASS_BLOCK: BYTE = 0x0064;
pub const IMAGE_SYM_CLASS_FUNCTION: BYTE = 0x0065;
pub const IMAGE_SYM_CLASS_END_OF_STRUCT: BYTE = 0x0066;
pub const IMAGE_SYM_CLASS_FILE: BYTE = 0x0067;
pub const IMAGE_SYM_CLASS_SECTION: BYTE = 0x0068;
pub const IMAGE_SYM_CLASS_WEAK_EXTERNAL: BYTE = 0x0069;
pub const IMAGE_SYM_CLASS_CLR_TOKEN: BYTE = 0x006B;
pub const N_BTMASK: WORD = 0x000F;
pub const N_TMASK: WORD = 0x0030;
pub const N_TMASK1: WORD = 0x00C0;
pub const N_TMASK2: WORD = 0x00F0;
pub const N_BTSHFT: usize = 4;
pub const N_TSHIFT: usize = 2;
#[inline]
pub fn BTYPE(x: WORD) -> bool {
    (x & N_BTMASK) != 0
}
#[inline]
pub fn ISPTR(x: WORD) -> bool {
    (x & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT)
}
#[inline]
pub fn ISFCN(x: WORD) -> bool {
    (x & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT)
}
#[inline]
pub fn ISARY(x: WORD) -> bool {
    (x & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT)
}
#[inline]
pub fn ISTAG(x: BYTE) -> bool {
    (x == IMAGE_SYM_CLASS_STRUCT_TAG) || (x == IMAGE_SYM_CLASS_UNION_TAG)
    || (x == IMAGE_SYM_CLASS_ENUM_TAG)
}
#[inline]
pub fn INCREF(x: WORD) -> WORD {
    ((x & !N_BTMASK) << N_TSHIFT) | (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) | (x & N_BTMASK)
}
#[inline]
pub fn DECREF(x: WORD) -> WORD {
    ((x >> N_TSHIFT) & !N_BTMASK) | (x & N_BTMASK)
}
STRUCT!{struct IMAGE_AUX_SYMBOL_TOKEN_DEF {
    bAuxType: BYTE,
    bReserved: BYTE,
    SymbolTableIndex: DWORD,
    rgbReserved: [BYTE; 12],
}}
pub type PIMAGE_AUX_SYMBOL_TOKEN_DEF = *mut IMAGE_AUX_SYMBOL_TOKEN_DEF;
STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_Misc_LnSz {
    Linenumber: WORD,
    Size: WORD,
}}
UNION!{union IMAGE_AUX_SYMBOL_Sym_Misc {
    [u32; 1],
    LnSz LnSz_mut: IMAGE_AUX_SYMBOL_Sym_Misc_LnSz,
    TotalSize TotalSize_mut: DWORD,
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_FcnAry_Function {
    PointerToLinenumber: DWORD,
    PointerToNextFunction: DWORD,
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_FcnAry_Array {
    Dimension: [WORD; 4],
}}
UNION!{union IMAGE_AUX_SYMBOL_Sym_FcnAry {
    [u32; 2],
    Function Function_mut: IMAGE_AUX_SYMBOL_Sym_FcnAry_Function,
    Array Array_mut: IMAGE_AUX_SYMBOL_Sym_FcnAry_Array,
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_Sym {
    TagIndex: DWORD,
    Misc: IMAGE_AUX_SYMBOL_Sym_Misc,
    FcnAry: IMAGE_AUX_SYMBOL_Sym_FcnAry,
    TvIndex: WORD,
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_File {
    Name: [BYTE; IMAGE_SIZEOF_SYMBOL],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_Section {
    Length: DWORD,
    NumberOfRelocations: WORD,
    NumberOfLinenumbers: WORD,
    CheckSum: DWORD,
    Number: SHORT,
    Selection: BYTE,
    bReserved: BYTE,
    HighNumber: SHORT,
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_CRC {
    crc: DWORD,
    rgbReserved: [BYTE; 14],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL {
    Sym: IMAGE_AUX_SYMBOL_Sym,
    File: IMAGE_AUX_SYMBOL_File,
    Section: IMAGE_AUX_SYMBOL_Section,
    TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF,
    CRC: IMAGE_AUX_SYMBOL_CRC,
}}
pub type PIMAGE_AUX_SYMBOL = *mut IMAGE_AUX_SYMBOL;
STRUCT!{struct IMAGE_AUX_SYMBOL_EX_Sym {
    WeakDefaultSymIndex: DWORD,
    WeakSearchType: DWORD,
    rgbReserved: [BYTE; 12],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_EX_File {
    Name: [BYTE; 20],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_EX_Section {
    Length: DWORD,
    NumberOfRelocations: WORD,
    NumberOfLinenumbers: WORD,
    CheckSum: DWORD,
    Number: SHORT,
    Selection: BYTE,
    bReserved: BYTE,
    HighNumber: SHORT,
    rgbReserved: [BYTE; 2],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_EX_s {
    TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF,
    rgbReserved: [BYTE; 2],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_EX_CRC {
    crc: DWORD,
    rgbReserved: [BYTE; 16],
}}
STRUCT!{struct IMAGE_AUX_SYMBOL_EX {
    Sym: IMAGE_AUX_SYMBOL_EX_Sym,
    File: IMAGE_AUX_SYMBOL_EX_File,
    Section: IMAGE_AUX_SYMBOL_EX_Section,
    s: IMAGE_AUX_SYMBOL_EX_s,
    CRC: IMAGE_AUX_SYMBOL_EX_CRC,
}}
pub type PIMAGE_AUX_SYMBOL_EX = *mut IMAGE_AUX_SYMBOL_EX;
ENUM!{enum IMAGE_AUX_SYMBOL_TYPE {
    IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1,
}}
pub const IMAGE_COMDAT_SELECT_NODUPLICATES: BYTE = 1;
pub const IMAGE_COMDAT_SELECT_ANY: BYTE = 2;
pub const IMAGE_COMDAT_SELECT_SAME_SIZE: BYTE = 3;
pub const IMAGE_COMDAT_SELECT_EXACT_MATCH: BYTE = 4;
pub const IMAGE_COMDAT_SELECT_ASSOCIATIVE: BYTE = 5;
pub const IMAGE_COMDAT_SELECT_LARGEST: BYTE = 6;
pub const IMAGE_COMDAT_SELECT_NEWEST: BYTE = 7;
pub const IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: BYTE = 1;
pub const IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: BYTE = 2;
pub const IMAGE_WEAK_EXTERN_SEARCH_ALIAS: BYTE = 3;
UNION!{union IMAGE_RELOCATION_u {
    [u32; 1],
    VirtualAddress VirtualAddress_mut: DWORD,
    RelocCount RelocCount_mut: DWORD,
}}
STRUCT!{struct IMAGE_RELOCATION {
    u: IMAGE_RELOCATION_u,
    SymbolTableIndex: DWORD,
    Type: WORD,
}}
pub type PIMAGE_RELOCATION = *mut IMAGE_RELOCATION;
pub const IMAGE_REL_I386_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_I386_DIR16: WORD = 0x0001;
pub const IMAGE_REL_I386_REL16: WORD = 0x0002;
pub const IMAGE_REL_I386_DIR32: WORD = 0x0006;
pub const IMAGE_REL_I386_DIR32NB: WORD = 0x0007;
pub const IMAGE_REL_I386_SEG12: WORD = 0x0009;
pub const IMAGE_REL_I386_SECTION: WORD = 0x000A;
pub const IMAGE_REL_I386_SECREL: WORD = 0x000B;
pub const IMAGE_REL_I386_TOKEN: WORD = 0x000C;
pub const IMAGE_REL_I386_SECREL7: WORD = 0x000D;
pub const IMAGE_REL_I386_REL32: WORD = 0x0014;
pub const IMAGE_REL_MIPS_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_MIPS_REFHALF: WORD = 0x0001;
pub const IMAGE_REL_MIPS_REFWORD: WORD = 0x0002;
pub const IMAGE_REL_MIPS_JMPADDR: WORD = 0x0003;
pub const IMAGE_REL_MIPS_REFHI: WORD = 0x0004;
pub const IMAGE_REL_MIPS_REFLO: WORD = 0x0005;
pub const IMAGE_REL_MIPS_GPREL: WORD = 0x0006;
pub const IMAGE_REL_MIPS_LITERAL: WORD = 0x0007;
pub const IMAGE_REL_MIPS_SECTION: WORD = 0x000A;
pub const IMAGE_REL_MIPS_SECREL: WORD = 0x000B;
pub const IMAGE_REL_MIPS_SECRELLO: WORD = 0x000C;
pub const IMAGE_REL_MIPS_SECRELHI: WORD = 0x000D;
pub const IMAGE_REL_MIPS_TOKEN: WORD = 0x000E;
pub const IMAGE_REL_MIPS_JMPADDR16: WORD = 0x0010;
pub const IMAGE_REL_MIPS_REFWORDNB: WORD = 0x0022;
pub const IMAGE_REL_MIPS_PAIR: WORD = 0x0025;
pub const IMAGE_REL_ALPHA_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_ALPHA_REFLONG: WORD = 0x0001;
pub const IMAGE_REL_ALPHA_REFQUAD: WORD = 0x0002;
pub const IMAGE_REL_ALPHA_GPREL32: WORD = 0x0003;
pub const IMAGE_REL_ALPHA_LITERAL: WORD = 0x0004;
pub const IMAGE_REL_ALPHA_LITUSE: WORD = 0x0005;
pub const IMAGE_REL_ALPHA_GPDISP: WORD = 0x0006;
pub const IMAGE_REL_ALPHA_BRADDR: WORD = 0x0007;
pub const IMAGE_REL_ALPHA_HINT: WORD = 0x0008;
pub const IMAGE_REL_ALPHA_INLINE_REFLONG: WORD = 0x0009;
pub const IMAGE_REL_ALPHA_REFHI: WORD = 0x000A;
pub const IMAGE_REL_ALPHA_REFLO: WORD = 0x000B;
pub const IMAGE_REL_ALPHA_PAIR: WORD = 0x000C;
pub const IMAGE_REL_ALPHA_MATCH: WORD = 0x000D;
pub const IMAGE_REL_ALPHA_SECTION: WORD = 0x000E;
pub const IMAGE_REL_ALPHA_SECREL: WORD = 0x000F;
pub const IMAGE_REL_ALPHA_REFLONGNB: WORD = 0x0010;
pub const IMAGE_REL_ALPHA_SECRELLO: WORD = 0x0011;
pub const IMAGE_REL_ALPHA_SECRELHI: WORD = 0x0012;
pub const IMAGE_REL_ALPHA_REFQ3: WORD = 0x0013;
pub const IMAGE_REL_ALPHA_REFQ2: WORD = 0x0014;
pub const IMAGE_REL_ALPHA_REFQ1: WORD = 0x0015;
pub const IMAGE_REL_ALPHA_GPRELLO: WORD = 0x0016;
pub const IMAGE_REL_ALPHA_GPRELHI: WORD = 0x0017;
pub const IMAGE_REL_PPC_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_PPC_ADDR64: WORD = 0x0001;
pub const IMAGE_REL_PPC_ADDR32: WORD = 0x0002;
pub const IMAGE_REL_PPC_ADDR24: WORD = 0x0003;
pub const IMAGE_REL_PPC_ADDR16: WORD = 0x0004;
pub const IMAGE_REL_PPC_ADDR14: WORD = 0x0005;
pub const IMAGE_REL_PPC_REL24: WORD = 0x0006;
pub const IMAGE_REL_PPC_REL14: WORD = 0x0007;
pub const IMAGE_REL_PPC_TOCREL16: WORD = 0x0008;
pub const IMAGE_REL_PPC_TOCREL14: WORD = 0x0009;
pub const IMAGE_REL_PPC_ADDR32NB: WORD = 0x000A;
pub const IMAGE_REL_PPC_SECREL: WORD = 0x000B;
pub const IMAGE_REL_PPC_SECTION: WORD = 0x000C;
pub const IMAGE_REL_PPC_IFGLUE: WORD = 0x000D;
pub const IMAGE_REL_PPC_IMGLUE: WORD = 0x000E;
pub const IMAGE_REL_PPC_SECREL16: WORD = 0x000F;
pub const IMAGE_REL_PPC_REFHI: WORD = 0x0010;
pub const IMAGE_REL_PPC_REFLO: WORD = 0x0011;
pub const IMAGE_REL_PPC_PAIR: WORD = 0x0012;
pub const IMAGE_REL_PPC_SECRELLO: WORD = 0x0013;
pub const IMAGE_REL_PPC_SECRELHI: WORD = 0x0014;
pub const IMAGE_REL_PPC_GPREL: WORD = 0x0015;
pub const IMAGE_REL_PPC_TOKEN: WORD = 0x0016;
pub const IMAGE_REL_PPC_TYPEMASK: WORD = 0x00FF;
pub const IMAGE_REL_PPC_NEG: WORD = 0x0100;
pub const IMAGE_REL_PPC_BRTAKEN: WORD = 0x0200;
pub const IMAGE_REL_PPC_BRNTAKEN: WORD = 0x0400;
pub const IMAGE_REL_PPC_TOCDEFN: WORD = 0x0800;
pub const IMAGE_REL_SH3_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_SH3_DIRECT16: WORD = 0x0001;
pub const IMAGE_REL_SH3_DIRECT32: WORD = 0x0002;
pub const IMAGE_REL_SH3_DIRECT8: WORD = 0x0003;
pub const IMAGE_REL_SH3_DIRECT8_WORD: WORD = 0x0004;
pub const IMAGE_REL_SH3_DIRECT8_LONG: WORD = 0x0005;
pub const IMAGE_REL_SH3_DIRECT4: WORD = 0x0006;
pub const IMAGE_REL_SH3_DIRECT4_WORD: WORD = 0x0007;
pub const IMAGE_REL_SH3_DIRECT4_LONG: WORD = 0x0008;
pub const IMAGE_REL_SH3_PCREL8_WORD: WORD = 0x0009;
pub const IMAGE_REL_SH3_PCREL8_LONG: WORD = 0x000A;
pub const IMAGE_REL_SH3_PCREL12_WORD: WORD = 0x000B;
pub const IMAGE_REL_SH3_STARTOF_SECTION: WORD = 0x000C;
pub const IMAGE_REL_SH3_SIZEOF_SECTION: WORD = 0x000D;
pub const IMAGE_REL_SH3_SECTION: WORD = 0x000E;
pub const IMAGE_REL_SH3_SECREL: WORD = 0x000F;
pub const IMAGE_REL_SH3_DIRECT32_NB: WORD = 0x0010;
pub const IMAGE_REL_SH3_GPREL4_LONG: WORD = 0x0011;
pub const IMAGE_REL_SH3_TOKEN: WORD = 0x0012;
pub const IMAGE_REL_SHM_PCRELPT: WORD = 0x0013;
pub const IMAGE_REL_SHM_REFLO: WORD = 0x0014;
pub const IMAGE_REL_SHM_REFHALF: WORD = 0x0015;
pub const IMAGE_REL_SHM_RELLO: WORD = 0x0016;
pub const IMAGE_REL_SHM_RELHALF: WORD = 0x0017;
pub const IMAGE_REL_SHM_PAIR: WORD = 0x0018;
pub const IMAGE_REL_SH_NOMODE: WORD = 0x8000;
pub const IMAGE_REL_ARM_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_ARM_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_ARM_ADDR32NB: WORD = 0x0002;
pub const IMAGE_REL_ARM_BRANCH24: WORD = 0x0003;
pub const IMAGE_REL_ARM_BRANCH11: WORD = 0x0004;
pub const IMAGE_REL_ARM_TOKEN: WORD = 0x0005;
pub const IMAGE_REL_ARM_GPREL12: WORD = 0x0006;
pub const IMAGE_REL_ARM_GPREL7: WORD = 0x0007;
pub const IMAGE_REL_ARM_BLX24: WORD = 0x0008;
pub const IMAGE_REL_ARM_BLX11: WORD = 0x0009;
pub const IMAGE_REL_ARM_SECTION: WORD = 0x000E;
pub const IMAGE_REL_ARM_SECREL: WORD = 0x000F;
pub const IMAGE_REL_ARM_MOV32A: WORD = 0x0010;
pub const IMAGE_REL_ARM_MOV32: WORD = 0x0010;
pub const IMAGE_REL_ARM_MOV32T: WORD = 0x0011;
pub const IMAGE_REL_THUMB_MOV32: WORD = 0x0011;
pub const IMAGE_REL_ARM_BRANCH20T: WORD = 0x0012;
pub const IMAGE_REL_THUMB_BRANCH20: WORD = 0x0012;
pub const IMAGE_REL_ARM_BRANCH24T: WORD = 0x0014;
pub const IMAGE_REL_THUMB_BRANCH24: WORD = 0x0014;
pub const IMAGE_REL_ARM_BLX23T: WORD = 0x0015;
pub const IMAGE_REL_THUMB_BLX23: WORD = 0x0015;
pub const IMAGE_REL_AM_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_AM_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_AM_ADDR32NB: WORD = 0x0002;
pub const IMAGE_REL_AM_CALL32: WORD = 0x0003;
pub const IMAGE_REL_AM_FUNCINFO: WORD = 0x0004;
pub const IMAGE_REL_AM_REL32_1: WORD = 0x0005;
pub const IMAGE_REL_AM_REL32_2: WORD = 0x0006;
pub const IMAGE_REL_AM_SECREL: WORD = 0x0007;
pub const IMAGE_REL_AM_SECTION: WORD = 0x0008;
pub const IMAGE_REL_AM_TOKEN: WORD = 0x0009;
pub const IMAGE_REL_ARM64_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_ARM64_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_ARM64_ADDR32NB: WORD = 0x0002;
pub const IMAGE_REL_ARM64_BRANCH26: WORD = 0x0003;
pub const IMAGE_REL_ARM64_PAGEBASE_REL21: WORD = 0x0004;
pub const IMAGE_REL_ARM64_REL21: WORD = 0x0005;
pub const IMAGE_REL_ARM64_PAGEOFFSET_12A: WORD = 0x0006;
pub const IMAGE_REL_ARM64_PAGEOFFSET_12L: WORD = 0x0007;
pub const IMAGE_REL_ARM64_SECREL: WORD = 0x0008;
pub const IMAGE_REL_ARM64_SECREL_LOW12A: WORD = 0x0009;
pub const IMAGE_REL_ARM64_SECREL_HIGH12A: WORD = 0x000A;
pub const IMAGE_REL_ARM64_SECREL_LOW12L: WORD = 0x000B;
pub const IMAGE_REL_ARM64_TOKEN: WORD = 0x000C;
pub const IMAGE_REL_ARM64_SECTION: WORD = 0x000D;
pub const IMAGE_REL_ARM64_ADDR64: WORD = 0x000E;
pub const IMAGE_REL_ARM64_BRANCH19: WORD = 0x000F;
pub const IMAGE_REL_AMD64_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_AMD64_ADDR64: WORD = 0x0001;
pub const IMAGE_REL_AMD64_ADDR32: WORD = 0x0002;
pub const IMAGE_REL_AMD64_ADDR32NB: WORD = 0x0003;
pub const IMAGE_REL_AMD64_REL32: WORD = 0x0004;
pub const IMAGE_REL_AMD64_REL32_1: WORD = 0x0005;
pub const IMAGE_REL_AMD64_REL32_2: WORD = 0x0006;
pub const IMAGE_REL_AMD64_REL32_3: WORD = 0x0007;
pub const IMAGE_REL_AMD64_REL32_4: WORD = 0x0008;
pub const IMAGE_REL_AMD64_REL32_5: WORD = 0x0009;
pub const IMAGE_REL_AMD64_SECTION: WORD = 0x000A;
pub const IMAGE_REL_AMD64_SECREL: WORD = 0x000B;
pub const IMAGE_REL_AMD64_SECREL7: WORD = 0x000C;
pub const IMAGE_REL_AMD64_TOKEN: WORD = 0x000D;
pub const IMAGE_REL_AMD64_SREL32: WORD = 0x000E;
pub const IMAGE_REL_AMD64_PAIR: WORD = 0x000F;
pub const IMAGE_REL_AMD64_SSPAN32: WORD = 0x0010;
pub const IMAGE_REL_IA64_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_IA64_IMM14: WORD = 0x0001;
pub const IMAGE_REL_IA64_IMM22: WORD = 0x0002;
pub const IMAGE_REL_IA64_IMM64: WORD = 0x0003;
pub const IMAGE_REL_IA64_DIR32: WORD = 0x0004;
pub const IMAGE_REL_IA64_DIR64: WORD = 0x0005;
pub const IMAGE_REL_IA64_PCREL21B: WORD = 0x0006;
pub const IMAGE_REL_IA64_PCREL21M: WORD = 0x0007;
pub const IMAGE_REL_IA64_PCREL21F: WORD = 0x0008;
pub const IMAGE_REL_IA64_GPREL22: WORD = 0x0009;
pub const IMAGE_REL_IA64_LTOFF22: WORD = 0x000A;
pub const IMAGE_REL_IA64_SECTION: WORD = 0x000B;
pub const IMAGE_REL_IA64_SECREL22: WORD = 0x000C;
pub const IMAGE_REL_IA64_SECREL64I: WORD = 0x000D;
pub const IMAGE_REL_IA64_SECREL32: WORD = 0x000E;
pub const IMAGE_REL_IA64_DIR32NB: WORD = 0x0010;
pub const IMAGE_REL_IA64_SREL14: WORD = 0x0011;
pub const IMAGE_REL_IA64_SREL22: WORD = 0x0012;
pub const IMAGE_REL_IA64_SREL32: WORD = 0x0013;
pub const IMAGE_REL_IA64_UREL32: WORD = 0x0014;
pub const IMAGE_REL_IA64_PCREL60X: WORD = 0x0015;
pub const IMAGE_REL_IA64_PCREL60B: WORD = 0x0016;
pub const IMAGE_REL_IA64_PCREL60F: WORD = 0x0017;
pub const IMAGE_REL_IA64_PCREL60I: WORD = 0x0018;
pub const IMAGE_REL_IA64_PCREL60M: WORD = 0x0019;
pub const IMAGE_REL_IA64_IMMGPREL64: WORD = 0x001A;
pub const IMAGE_REL_IA64_TOKEN: WORD = 0x001B;
pub const IMAGE_REL_IA64_GPREL32: WORD = 0x001C;
pub const IMAGE_REL_IA64_ADDEND: WORD = 0x001F;
pub const IMAGE_REL_CEF_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_CEF_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_CEF_ADDR64: WORD = 0x0002;
pub const IMAGE_REL_CEF_ADDR32NB: WORD = 0x0003;
pub const IMAGE_REL_CEF_SECTION: WORD = 0x0004;
pub const IMAGE_REL_CEF_SECREL: WORD = 0x0005;
pub const IMAGE_REL_CEF_TOKEN: WORD = 0x0006;
pub const IMAGE_REL_CEE_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_CEE_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_CEE_ADDR64: WORD = 0x0002;
pub const IMAGE_REL_CEE_ADDR32NB: WORD = 0x0003;
pub const IMAGE_REL_CEE_SECTION: WORD = 0x0004;
pub const IMAGE_REL_CEE_SECREL: WORD = 0x0005;
pub const IMAGE_REL_CEE_TOKEN: WORD = 0x0006;
pub const IMAGE_REL_M32R_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_M32R_ADDR32: WORD = 0x0001;
pub const IMAGE_REL_M32R_ADDR32NB: WORD = 0x0002;
pub const IMAGE_REL_M32R_ADDR24: WORD = 0x0003;
pub const IMAGE_REL_M32R_GPREL16: WORD = 0x0004;
pub const IMAGE_REL_M32R_PCREL24: WORD = 0x0005;
pub const IMAGE_REL_M32R_PCREL16: WORD = 0x0006;
pub const IMAGE_REL_M32R_PCREL8: WORD = 0x0007;
pub const IMAGE_REL_M32R_REFHALF: WORD = 0x0008;
pub const IMAGE_REL_M32R_REFHI: WORD = 0x0009;
pub const IMAGE_REL_M32R_REFLO: WORD = 0x000A;
pub const IMAGE_REL_M32R_PAIR: WORD = 0x000B;
pub const IMAGE_REL_M32R_SECTION: WORD = 0x000C;
pub const IMAGE_REL_M32R_SECREL32: WORD = 0x000D;
pub const IMAGE_REL_M32R_TOKEN: WORD = 0x000E;
pub const IMAGE_REL_EBC_ABSOLUTE: WORD = 0x0000;
pub const IMAGE_REL_EBC_ADDR32NB: WORD = 0x0001;
pub const IMAGE_REL_EBC_REL32: WORD = 0x0002;
pub const IMAGE_REL_EBC_SECTION: WORD = 0x0003;
pub const IMAGE_REL_EBC_SECREL: WORD = 0x0004;
UNION!{union IMAGE_LINENUMBER_Type {
    [u32; 1],
    SymbolTableIndex SymbolTableIndex_mut: DWORD,
    VirtualAddress VirtualAddress_mut: DWORD,
}}
STRUCT!{struct IMAGE_LINENUMBER {
    Type: IMAGE_LINENUMBER_Type,
    Linenumber: WORD,
}}
pub type PIMAGE_LINENUMBER = *mut IMAGE_LINENUMBER;
STRUCT!{struct IMAGE_BASE_RELOCATION {
    VirtualAddress: DWORD,
    SizeOfBlock: DWORD,
}}
pub type PIMAGE_BASE_RELOCATION = *mut IMAGE_BASE_RELOCATION;
pub const IMAGE_REL_BASED_ABSOLUTE: WORD = 0;
pub const IMAGE_REL_BASED_HIGH: WORD = 1;
pub const IMAGE_REL_BASED_LOW: WORD = 2;
pub const IMAGE_REL_BASED_HIGHLOW: WORD = 3;
pub const IMAGE_REL_BASED_HIGHADJ: WORD = 4;
pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_5: WORD = 5;
pub const IMAGE_REL_BASED_RESERVED: WORD = 6;
pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_7: WORD = 7;
pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_8: WORD = 8;
pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_9: WORD = 9;
pub const IMAGE_REL_BASED_DIR64: WORD = 10;
pub const IMAGE_REL_BASED_IA64_IMM64: WORD = 9;
pub const IMAGE_REL_BASED_MIPS_JMPADDR: WORD = 5;
pub const IMAGE_REL_BASED_MIPS_JMPADDR16: WORD = 9;
pub const IMAGE_REL_BASED_ARM_MOV32: WORD = 5;
pub const IMAGE_REL_BASED_THUMB_MOV32: WORD = 7;
pub const IMAGE_ARCHIVE_START_SIZE: usize = 8;
pub const IMAGE_ARCHIVE_START: &'static str = "!<arch>\n";
pub const IMAGE_ARCHIVE_END: &'static str = "`\n";
pub const IMAGE_ARCHIVE_PAD: &'static str = "\n";
pub const IMAGE_ARCHIVE_LINKER_MEMBER: &'static str = "/               ";
pub const IMAGE_ARCHIVE_LONGNAMES_MEMBER: &'static str = "//              ";
pub const IMAGE_ARCHIVE_HYBRIDMAP_MEMBER: &'static str = "/<HYBRIDMAP>/   ";
STRUCT!{struct IMAGE_ARCHIVE_MEMBER_HEADER {
    Name: [BYTE; 16],
    Date: [BYTE; 12],
    UserID: [BYTE; 6],
    GroupID: [BYTE; 6],
    Mode: [BYTE; 8],
    Size: [BYTE; 10],
    EndHeader: [BYTE; 2],
}}
pub type PIMAGE_ARCHIVE_MEMBER_HEADER = *mut IMAGE_ARCHIVE_MEMBER_HEADER;
pub const IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR: usize = 60;
STRUCT!{struct IMAGE_EXPORT_DIRECTORY {
    Characteristics: DWORD,
    TimeDateStamp: DWORD,
    MajorVersion: WORD,
    MinorVersion: WORD,
    Name: DWORD,
    Base: DWORD,
    NumberOfFunctions: DWORD,
    NumberOfNames: DWORD,
    AddressOfFunctions: DWORD,
    AddressOfNames: DWORD,
    AddressOfNameOrdinals: DWORD,
}}
pub type PIMAGE_EXPORT_DIRECTORY = *mut IMAGE_EXPORT_DIRECTORY;
STRUCT!{struct IMAGE_IMPORT_BY_NAME {
    Hint: WORD,
    Name: [CHAR; 1],
}}
pub type PIMAGE_IMPORT_BY_NAME = *mut IMAGE_IMPORT_BY_NAME;
UNION!{union IMAGE_THUNK_DATA64_u1 {
    [u64; 1],
    ForwarderString ForwarderString_mut: ULONGLONG,
    Function Function_mut: ULONGLONG,
    Ordinal Ordinal_mut: ULONGLONG,
    AddressOfData AddressOfData_mut: ULONGLONG,
}}
STRUCT!{struct IMAGE_THUNK_DATA64 {
    u1: IMAGE_THUNK_DATA64_u1,
}}
pub type PIMAGE_THUNK_DATA64 = *mut IMAGE_THUNK_DATA64;
UNION!{union IMAGE_THUNK_DATA32_u1 {
    [u32; 1],
    ForwarderString ForwarderString_mut: DWORD,
    Function Function_mut: DWORD,
    Ordinal Ordinal_mut: DWORD,
    AddressOfData AddressOfData_mut: DWORD,
}}
STRUCT!{struct IMAGE_THUNK_DATA32 {
    u1: IMAGE_THUNK_DATA32_u1,
}}
pub type PIMAGE_THUNK_DATA32 = *mut IMAGE_THUNK_DATA32;
pub const IMAGE_ORDINAL_FLAG64: ULONGLONG = 0x8000000000000000;
pub const IMAGE_ORDINAL_FLAG32: DWORD = 0x80000000;
#[inline]
pub fn IMAGE_ORDINAL64(Ordinal: ULONGLONG) -> ULONGLONG {
    Ordinal & 0xffff
}
#[inline]
pub fn IMAGE_ORDINAL32(Ordinal: DWORD) -> DWORD {
    Ordinal & 0xffff
}
#[inline]
pub fn IMAGE_SNAP_BY_ORDINAL64(Ordinal: ULONGLONG) -> bool {
    (Ordinal & IMAGE_ORDINAL_FLAG64) != 0
}
#[inline]
pub fn IMAGE_SNAP_BY_ORDINAL32(Ordinal: DWORD) -> bool {
    (Ordinal & IMAGE_ORDINAL_FLAG32) != 0
}
FN!{stdcall PIMAGE_TLS_CALLBACK(
    DllHandle: PVOID,
    Reason: DWORD,
    Reserved: PVOID,
) -> ()}
STRUCT!{struct IMAGE_TLS_DIRECTORY64 {
    StartAddressOfRawData: ULONGLONG,
    EndAddressOfRawData: ULONGLONG,
    AddressOfIndex: ULONGLONG,
    AddressOfCallBacks: ULONGLONG,
    SizeOfZeroFill: DWORD,
    Characteristics: DWORD,
}}
BITFIELD!{IMAGE_TLS_DIRECTORY64 Characteristics: DWORD [
    Reserved0 set_Reserved0[0..20],
    Alignment set_Alignment[20..24],
    Reserved1 set_Reserved1[24..32],
]}
pub type PIMAGE_TLS_DIRECTORY64 = *mut IMAGE_TLS_DIRECTORY64;
STRUCT!{struct IMAGE_TLS_DIRECTORY32 {
    StartAddressOfRawData: DWORD,
    EndAddressOfRawData: DWORD,
    AddressOfIndex: DWORD,
    AddressOfCallBacks: DWORD,
    SizeOfZeroFill: DWORD,
    Characteristics: DWORD,
}}
BITFIELD!{IMAGE_TLS_DIRECTORY32 Characteristics: DWORD [
    Reserved0 set_Reserved0[0..20],
    Alignment set_Alignment[20..24],
    Reserved1 set_Reserved1[24..32],
]}
pub type PIMAGE_TLS_DIRECTORY32 = *mut IMAGE_TLS_DIRECTORY32;
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub const IMAGE_ORDINAL_FLAG: ULONGLONG = IMAGE_ORDINAL_FLAG64;
#[inline]
pub fn IMAGE_ORDINAL(Ordinal: ULONGLONG) -> ULONGLONG {
    IMAGE_ORDINAL64(Ordinal)
}
pub type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA64;
pub type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA64;
#[inline]
pub fn IMAGE_SNAP_BY_ORDINAL(Ordinal: ULONGLONG) -> bool {
    IMAGE_SNAP_BY_ORDINAL64(Ordinal)
}
pub type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY64;
pub type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY64;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub const IMAGE_ORDINAL_FLAG: DWORD = IMAGE_ORDINAL_FLAG32;
#[inline]
pub fn IMAGE_ORDINAL(Ordinal: DWORD) -> DWORD {
    IMAGE_ORDINAL32(Ordinal)
}
pub type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA32;
pub type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA32;
#[inline]
pub fn IMAGE_SNAP_BY_ORDINAL(Ordinal: DWORD) -> bool {
    IMAGE_SNAP_BY_ORDINAL32(Ordinal)
}
pub type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY32;
pub type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY32;
}
UNION!{union IMAGE_IMPORT_DESCRIPTOR_u {
    [u32; 1],
    Characteristics Characteristics_mut: DWORD,
    OriginalFirstThunk OriginalFirstThunk_mut: DWORD,
}}
STRUCT!{struct IMAGE_IMPORT_DESCRIPTOR {
    u: IMAGE_IMPORT_DESCRIPTOR_u,
    TimeDateStamp: DWORD,
    ForwarderChain: DWORD,
    Name: DWORD,
    FirstThunk: DWORD,
}}
pub type PIMAGE_IMPORT_DESCRIPTOR = *mut IMAGE_IMPORT_DESCRIPTOR;
STRUCT!{struct IMAGE_BOUND_IMPORT_DESCRIPTOR {
    TimeDateStamp: DWORD,
    OffsetModuleName: WORD,
    NumberOfModuleForwarderRefs: WORD,
}}
pub type PIMAGE_BOUND_IMPORT_DESCRIPTOR = *mut IMAGE_BOUND_IMPORT_DESCRIPTOR;
STRUCT!{struct IMAGE_BOUND_FORWARDER_REF {
    TimeDateStamp: DWORD,
    OffsetModuleName: WORD,
    Reserved: WORD,
}}
pub type PIMAGE_BOUND_FORWARDER_REF = *mut IMAGE_BOUND_FORWARDER_REF;
STRUCT!{struct IMAGE_DELAYLOAD_DESCRIPTOR_Attributes {
    AllAttributes: DWORD,
}}
BITFIELD!{IMAGE_DELAYLOAD_DESCRIPTOR_Attributes AllAttributes: DWORD [
    RvaBased set_RvaBased[0..1],
    ReservedAttributes set_ReservedAttributes[1..32],
]}
STRUCT!{struct IMAGE_DELAYLOAD_DESCRIPTOR {
    Attributes: IMAGE_DELAYLOAD_DESCRIPTOR_Attributes,
    DllNameRVA: DWORD,
    ModuleHandleRVA: DWORD,
    ImportAddressTableRVA: DWORD,
    ImportNameTableRVA: DWORD,
    BoundImportAddressTableRVA: DWORD,
    UnloadInformationTableRVA: DWORD,
    TimeDateStamp: DWORD,
}}
pub type PIMAGE_DELAYLOAD_DESCRIPTOR = *mut IMAGE_DELAYLOAD_DESCRIPTOR;
pub type PCIMAGE_DELAYLOAD_DESCRIPTOR = *const IMAGE_DELAYLOAD_DESCRIPTOR;
STRUCT!{struct IMAGE_RESOURCE_DIRECTORY {
    Characteristics: DWORD,
    TimeDateStamp: DWORD,
    MajorVersion: WORD,
    MinorVersion: WORD,
    NumberOfNamedEntries: WORD,
    NumberOfIdEntries: WORD,
}}
pub type PIMAGE_RESOURCE_DIRECTORY = *mut IMAGE_RESOURCE_DIRECTORY;
pub const IMAGE_RESOURCE_NAME_IS_STRING: DWORD = 0x80000000;
pub const IMAGE_RESOURCE_DATA_IS_DIRECTORY: DWORD = 0x80000000;
STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s {
    BitFields: DWORD,
}}
BITFIELD!{IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s BitFields: DWORD [
    NameOffset set_NameOffset[0..31],
    NameIsString set_NameIsString[31..32],
]}
UNION!{union IMAGE_RESOURCE_DIRECTORY_ENTRY_u {
    [u32; 1],
    s s_mut: IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s,
    Name Name_mut: DWORD,
    Id Id_mut: WORD,
}}
STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_ENTRY {
    u: IMAGE_RESOURCE_DIRECTORY_ENTRY_u,
    OffsetToData: DWORD,
}}
BITFIELD!{IMAGE_RESOURCE_DIRECTORY_ENTRY OffsetToData: DWORD [
    OffsetToDirectory set_OffsetToDirectory[0..31],
    DataIsDirectory set_DataIsDirectory[31..32],
]}
pub type PIMAGE_RESOURCE_DIRECTORY_ENTRY = *mut IMAGE_RESOURCE_DIRECTORY_ENTRY;
STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_STRING {
    Length: WORD,
    NameString: [CHAR; 1],
}}
pub type PIMAGE_RESOURCE_DIRECTORY_STRING = *mut IMAGE_RESOURCE_DIRECTORY_STRING;
STRUCT!{struct IMAGE_RESOURCE_DIR_STRING_U {
    Length: WORD,
    NameString: [WCHAR; 1],
}}
pub type PIMAGE_RESOURCE_DIR_STRING_U = *mut IMAGE_RESOURCE_DIR_STRING_U;
STRUCT!{struct IMAGE_RESOURCE_DATA_ENTRY {
    OffsetToData: DWORD,
    Size: DWORD,
    CodePage: DWORD,
    Reserved: DWORD,
}}
pub type PIMAGE_RESOURCE_DATA_ENTRY = *mut IMAGE_RESOURCE_DATA_ENTRY;
STRUCT!{struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    Flags: WORD,
    Catalog: WORD,
    CatalogOffset: DWORD,
    Reserved: DWORD,
}}
pub type PIMAGE_LOAD_CONFIG_CODE_INTEGRITY = *mut IMAGE_LOAD_CONFIG_CODE_INTEGRITY;
STRUCT!{struct IMAGE_DYNAMIC_RELOCATION_TABLE {
    Version: DWORD,
    Size: DWORD,
}}
pub type PIMAGE_DYNAMIC_RELOCATION_TABLE = *mut IMAGE_DYNAMIC_RELOCATION_TABLE;
STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION32 {
    Symbol: DWORD,
    BaseRelocSize: DWORD,
}}
pub type PIMAGE_DYNAMIC_RELOCATION32 = *mut IMAGE_DYNAMIC_RELOCATION32;
STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION64 {
    Symbol: ULONGLONG,
    BaseRelocSize: DWORD,
}}
pub type PIMAGE_DYNAMIC_RELOCATION64 = *mut IMAGE_DYNAMIC_RELOCATION64;
STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION32_V2 {
    HeaderSize: DWORD,
    FixupInfoSize: DWORD,
    Symbol: DWORD,
    SymbolGroup: DWORD,
    Flags: DWORD,
}}
pub type PIMAGE_DYNAMIC_RELOCATION32_V2 = *mut IMAGE_DYNAMIC_RELOCATION32_V2;
STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION64_V2 {
    HeaderSize: DWORD,
    FixupInfoSize: DWORD,
    Symbol: ULONGLONG,
    SymbolGroup: DWORD,
    Flags: DWORD,
}}
pub type PIMAGE_DYNAMIC_RELOCATION64_V2 = *mut IMAGE_DYNAMIC_RELOCATION64_V2;
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub type IMAGE_DYNAMIC_RELOCATION = IMAGE_DYNAMIC_RELOCATION64;
pub type PIMAGE_DYNAMIC_RELOCATION = PIMAGE_DYNAMIC_RELOCATION64;
pub type IMAGE_DYNAMIC_RELOCATION_V2 = IMAGE_DYNAMIC_RELOCATION64_V2;
pub type PIMAGE_DYNAMIC_RELOCATION_V2 = PIMAGE_DYNAMIC_RELOCATION64_V2;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub type IMAGE_DYNAMIC_RELOCATION = IMAGE_DYNAMIC_RELOCATION32;
pub type PIMAGE_DYNAMIC_RELOCATION = PIMAGE_DYNAMIC_RELOCATION32;
pub type IMAGE_DYNAMIC_RELOCATION_V2 = IMAGE_DYNAMIC_RELOCATION32_V2;
pub type PIMAGE_DYNAMIC_RELOCATION_V2 = PIMAGE_DYNAMIC_RELOCATION32_V2;
}
pub const IMAGE_DYNAMIC_RELOCATION_GUARD_RF_PROLOGUE: DWORD = 0x00000001;
pub const IMAGE_DYNAMIC_RELOCATION_GUARD_RF_EPILOGUE: DWORD = 0x00000002;
STRUCT!{#[repr(packed)] struct IMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER {
    PrologueByteCount: BYTE,
}}
pub type PIMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER = *mut IMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER;
STRUCT!{#[repr(packed)] struct IMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER {
    EpilogueCount: DWORD,
    EpilogueByteCount: BYTE,
    BranchDescriptorElementSize: BYTE,
    BranchDescriptorCount: WORD,
}}
pub type PIMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER = *mut IMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER;
STRUCT!{struct IMAGE_LOAD_CONFIG_DIRECTORY32 {
    Size: DWORD,
    TimeDateStamp: DWORD,
    MajorVersion: WORD,
    MinorVersion: WORD,
    GlobalFlagsClear: DWORD,
    GlobalFlagsSet: DWORD,
    CriticalSectionDefaultTimeout: DWORD,
    DeCommitFreeBlockThreshold: DWORD,
    DeCommitTotalFreeThreshold: DWORD,
    LockPrefixTable: DWORD,
    MaximumAllocationSize: DWORD,
    VirtualMemoryThreshold: DWORD,
    ProcessHeapFlags: DWORD,
    ProcessAffinityMask: DWORD,
    CSDVersion: WORD,
    DependentLoadFlags: WORD,
    EditList: DWORD,
    SecurityCookie: DWORD,
    SEHandlerTable: DWORD,
    SEHandlerCount: DWORD,
    GuardCFCheckFunctionPointer: DWORD,
    GuardCFDispatchFunctionPointer: DWORD,
    GuardCFFunctionTable: DWORD,
    GuardCFFunctionCount: DWORD,
    GuardFlags: DWORD,
    CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY,
    GuardAddressTakenIatEntryTable: DWORD,
    GuardAddressTakenIatEntryCount: DWORD,
    GuardLongJumpTargetTable: DWORD,
    GuardLongJumpTargetCount: DWORD,
    DynamicValueRelocTable: DWORD,
    CHPEMetadataPointer: DWORD,
    GuardRFFailureRoutine: DWORD,
    GuardRFFailureRoutineFunctionPointer: DWORD,
    DynamicValueRelocTableOffset: DWORD,
    DynamicValueRelocTableSection: WORD,
    Reserved2: WORD,
    GuardRFVerifyStackPointerFunctionPointer: DWORD,
    HotPatchTableOffset: DWORD,
    Reserved3: DWORD,
    EnclaveConfigurationPointer: DWORD,
}}
pub type PIMAGE_LOAD_CONFIG_DIRECTORY32 = *mut IMAGE_LOAD_CONFIG_DIRECTORY32;
STRUCT!{struct IMAGE_LOAD_CONFIG_DIRECTORY64 {
    Size: DWORD,
    TimeDateStamp: DWORD,
    MajorVersion: WORD,
    MinorVersion: WORD,
    GlobalFlagsClear: DWORD,
    GlobalFlagsSet: DWORD,
    CriticalSectionDefaultTimeout: DWORD,
    DeCommitFreeBlockThreshold: ULONGLONG,
    DeCommitTotalFreeThreshold: ULONGLONG,
    LockPrefixTable: ULONGLONG,
    MaximumAllocationSize: ULONGLONG,
    VirtualMemoryThreshold: ULONGLONG,
    ProcessAffinityMask: ULONGLONG,
    ProcessHeapFlags: DWORD,
    CSDVersion: WORD,
    DependentLoadFlags: WORD,
    EditList: ULONGLONG,
    SecurityCookie: ULONGLONG,
    SEHandlerTable: ULONGLONG,
    SEHandlerCount: ULONGLONG,
    GuardCFCheckFunctionPointer: ULONGLONG,
    GuardCFDispatchFunctionPointer: ULONGLONG,
    GuardCFFunctionTable: ULONGLONG,
    GuardCFFunctionCount: ULONGLONG,
    GuardFlags: DWORD,
    CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY,
    GuardAddressTakenIatEntryTable: ULONGLONG,
    GuardAddressTakenIatEntryCount: ULONGLONG,
    GuardLongJumpTargetTable: ULONGLONG,
    GuardLongJumpTargetCount: ULONGLONG,
    DynamicValueRelocTable: ULONGLONG,
    CHPEMetadataPointer: ULONGLONG,
    GuardRFFailureRoutine: ULONGLONG,
    GuardRFFailureRoutineFunctionPointer: ULONGLONG,
    DynamicValueRelocTableOffset: DWORD,
    DynamicValueRelocTableSection: WORD,
    Reserved2: WORD,
    GuardRFVerifyStackPointerFunctionPointer: ULONGLONG,
    HotPatchTableOffset: DWORD,
    Reserved3: DWORD,
    EnclaveConfigurationPointer: ULONGLONG,
}}
pub type PIMAGE_LOAD_CONFIG_DIRECTORY64 = *mut IMAGE_LOAD_CONFIG_DIRECTORY64;
#[cfg(target_pointer_width = "64")]
IFDEF!{
pub type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY64;
pub type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY64;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
pub type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY32;
pub type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY32;
}
STRUCT!{struct IMAGE_HOT_PATCH_INFO {
    Version: DWORD,
    Size: DWORD,
    SequenceNumber: DWORD,
    BaseImageList: DWORD,
    BaseImageCount: DWORD,
    BufferOffset: DWORD,
}}
pub type PIMAGE_HOT_PATCH_INFO = *mut IMAGE_HOT_PATCH_INFO;
STRUCT!{struct IMAGE_HOT_PATCH_BASE {
    SequenceNumber: DWORD,
    Flags: DWORD,
    OriginalTimeDateStamp: DWORD,
    OriginalCheckSum: DWORD,
    CodeIntegrityInfo: DWORD,
    CodeIntegritySize: DWORD,
    PatchTable: DWORD,
    BufferOffset: DWORD,
}}
pub type PIMAGE_HOT_PATCH_BASE = *mut IMAGE_HOT_PATCH_BASE;
STRUCT!{struct IMAGE_HOT_PATCH_HASHES {
    SHA256: [BYTE; 32],
    SHA1: [BYTE; 20],
}}
pub type PIMAGE_HOT_PATCH_HASHES = *mut IMAGE_HOT_PATCH_HASHES;
pub const IMAGE_HOT_PATCH_BASE_OBLIGATORY: DWORD = 0x00000001;
pub const IMAGE_HOT_PATCH_CHUNK_INVERSE: DWORD = 0x80000000;
pub const IMAGE_HOT_PATCH_CHUNK_OBLIGATORY: DWORD = 0x40000000;
pub const IMAGE_HOT_PATCH_CHUNK_RESERVED: DWORD = 0x3FF03000;
pub const IMAGE_HOT_PATCH_CHUNK_TYPE: DWORD = 0x000FC000;
pub const IMAGE_HOT_PATCH_CHUNK_SOURCE_RVA: DWORD = 0x00008000;
pub const IMAGE_HOT_PATCH_CHUNK_TARGET_RVA: DWORD = 0x00004000;
pub const IMAGE_HOT_PATCH_CHUNK_SIZE: DWORD = 0x00000FFF;
pub const IMAGE_HOT_PATCH_NONE: DWORD = 0x00000000;
pub const IMAGE_HOT_PATCH_FUNCTION: DWORD = 0x0001C000;
pub const IMAGE_HOT_PATCH_ABSOLUTE: DWORD = 0x0002C000;
pub const IMAGE_HOT_PATCH_REL32: DWORD = 0x0003C000;
pub const IMAGE_HOT_PATCH_CALL_TARGET: DWORD = 0x00044000;
pub const IMAGE_HOT_PATCH_INDIRECT: DWORD = 0x0005C000;
pub const IMAGE_HOT_PATCH_NO_CALL_TARGET: DWORD = 0x00064000;
pub const IMAGE_HOT_PATCH_DYNAMIC_VALUE: DWORD = 0x00078000;
pub const IMAGE_GUARD_CF_INSTRUMENTED: DWORD = 0x00000100;
pub const IMAGE_GUARD_CFW_INSTRUMENTED: DWORD = 0x00000200;
pub const IMAGE_GUARD_CF_FUNCTION_TABLE_PRESENT: DWORD = 0x00000400;
pub const IMAGE_GUARD_SECURITY_COOKIE_UNUSED: DWORD = 0x00000800;
pub const IMAGE_GUARD_PROTECT_DELAYLOAD_IAT: DWORD = 0x00001000;
pub const IMAGE_GUARD_DELAYLOAD_IAT_IN_ITS_OWN_SECTION: DWORD = 0x00002000;
pub const IMAGE_GUARD_CF_EXPORT_SUPPRESSION_INFO_PRESENT: DWORD = 0x00004000;
pub const IMAGE_GUARD_CF_ENABLE_EXPORT_SUPPRESSION: DWORD = 0x00008000;
pub const IMAGE_GUARD_CF_LONGJUMP_TABLE_PRESENT: DWORD = 0x00010000;
pub const IMAGE_GUARD_RF_INSTRUMENTED: DWORD = 0x00020000;
pub const IMAGE_GUARD_RF_ENABLE: DWORD = 0x00040000;
pub const IMAGE_GUARD_RF_STRICT: DWORD = 0x00080000;
pub const IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_MASK: DWORD = 0xF0000000;
pub const IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_SHIFT: usize = 28;
pub const IMAGE_GUARD_FLAG_FID_SUPPRESSED: DWORD = 0x01;
pub const IMAGE_GUARD_FLAG_EXPORT_SUPPRESSED: DWORD = 0x02;
STRUCT!{struct IMAGE_CE_RUNTIME_FUNCTION_ENTRY {
    FuncStart: DWORD,
    BitFields: DWORD,
}}
BITFIELD!{IMAGE_CE_RUNTIME_FUNCTION_ENTRY BitFields: DWORD [
    PrologLen set_PrologLen[0..8],
    FuncLen set_FuncLen[8..30],
    ThirtyTwoBit set_ThirtyTwoBit[30..31],
    ExceptionFlag set_ExceptionFlag[31..32],
]}
pub type PIMAGE_CE_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_CE_RUNTIME_FUNCTION_ENTRY;
STRUCT!{struct IMAGE_ARM_RUNTIME_FUNCTION_ENTRY {
    BeginAddress: DWORD,
    UnwindData: DWORD,
}}
BITFIELD!{IMAGE_ARM_RUNTIME_FUNCTION_ENTRY UnwindData: DWORD [
    Flag set_Flag[0..2],
    FunctionLength set_FunctionLength[2..13],
    Ret set_Ret[13..15],
    H set_H[15..16],
    Reg set_Reg[16..19],
    R set_R[19..20],
    L set_L[20..21],
    C set_c[21..22],
    StackAdjust set_StackAdjust[22..32],
]}
pub type PIMAGE_ARM_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ARM_RUNTIME_FUNCTION_ENTRY;
STRUCT!{struct IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY {
    BeginAddress: DWORD,
    UnwindData: DWORD,
}}
BITFIELD!{IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY UnwindData: DWORD [
    Flag set_Flag[0..2],
    FunctionLength set_FunctionLength[2..13],
    RegF set_RegF[13..16],
    RegI set_RegI[16..20],
    H set_H[20..21],
    CR set_cR[21..23],
    FrameSize set_FrameSize[23..32],
]}
pub type PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
STRUCT!{struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY {
    BeginAddress: ULONGLONG,
    EndAddress: ULONGLONG,
    ExceptionHandler: ULONGLONG,
    HandlerData: ULONGLONG,
    PrologEndAddress: ULONGLONG,
}}
pub type PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY;
STRUCT!{struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY {
    BeginAddress: DWORD,
    EndAddress: DWORD,
    ExceptionHandler: DWORD,
    HandlerData: DWORD,
    PrologEndAddress: DWORD,
}}
pub type PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY;
UNION!{union IMAGE_RUNTIME_FUNCTION_ENTRY_u {
    [u32; 1],
    UnwindInfoAddress UnwindInfoAddress_mut: DWORD,
    UnwindData UnwindData_mut: DWORD,
}}
STRUCT!{struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
    BeginAddress: DWORD,
    EndAddress: DWORD,
    u: IMAGE_RUNTIME_FUNCTION_ENTRY_u,
}}
pub type _PIMAGE_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type IMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY;
#[cfg(target_arch = "aarch64")]
IFDEF!{
pub type IMAGE_RUNTIME_FUNCTION_ENTRY = IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
pub type PIMAGE_RUNTIME_FUNCTION_ENTRY = PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
}
#[cfg(not(target_arch = "aarch64"))]
IFDEF!{
pub type IMAGE_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY;
pub type PIMAGE_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY;
}
STRUCT!{struct IMAGE_DEBUG_DIRECTORY {
    Characteristics: DWORD,
    TimeDateStamp: DWORD,
    MajorVersion: WORD,
    MinorVersion: WORD,
    Type: DWORD,
    SizeOfData: DWORD,
    AddressOfRawData: DWORD,
    PointerToRawData: DWORD,
}}
pub type PIMAGE_DEBUG_DIRECTORY = *mut IMAGE_DEBUG_DIRECTORY;
pub const IMAGE_DEBUG_TYPE_UNKNOWN: DWORD = 0;
pub const IMAGE_DEBUG_TYPE_COFF: DWORD = 1;
pub const IMAGE_DEBUG_TYPE_CODEVIEW: DWORD = 2;
pub const IMAGE_DEBUG_TYPE_FPO: DWORD = 3;
pub const IMAGE_DEBUG_TYPE_MISC: DWORD = 4;
pub const IMAGE_DEBUG_TYPE_EXCEPTION: DWORD = 5;
pub const IMAGE_DEBUG_TYPE_FIXUP: DWORD = 6;
pub const IMAGE_DEBUG_TYPE_OMAP_TO_SRC: DWORD = 7;
pub const IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: DWORD = 8;
pub const IMAGE_DEBUG_TYPE_BORLAND: DWORD = 9;
pub const IMAGE_DEBUG_TYPE_RESERVED10: DWORD = 10;
pub const IMAGE_DEBUG_TYPE_CLSID: DWORD = 11;
pub const IMAGE_DEBUG_TYPE_VC_FEATURE: DWORD = 12;
pub const IMAGE_DEBUG_TYPE_POGO: DWORD = 13;
pub const IMAGE_DEBUG_TYPE_ILTCG: DWORD = 14;
pub const IMAGE_DEBUG_TYPE_MPX: DWORD = 15;
pub const IMAGE_DEBUG_TYPE_REPRO: DWORD = 16;
STRUCT!{struct IMAGE_COFF_SYMBOLS_HEADER {
    NumberOfSymbols: DWORD,
    LvaToFirstSymbol: DWORD,
    NumberOfLinenumbers: DWORD,
    LvaToFirstLinenumber: DWORD,
    RvaToFirstByteOfCode: DWORD,
    RvaToLastByteOfCode: DWORD,
    RvaToFirstByteOfData: DWORD,
    RvaToLastByteOfData: DWORD,
}}
pub type PIMAGE_COFF_SYMBOLS_HEADER = *mut IMAGE_COFF_SYMBOLS_HEADER;
pub const FRAME_FPO: WORD = 0;
pub const FRAME_TRAP: WORD = 1;
pub const FRAME_TSS: WORD = 2;
pub const FRAME_NONFPO: WORD = 3;
STRUCT!{struct FPO_DATA {
    ulOffStart: DWORD,
    cbProcSize: DWORD,
    cdwLocals: DWORD,
    cdwParams: WORD,
    BitFields: WORD,
}}
BITFIELD!{FPO_DATA BitFields: WORD [
    cbProlog set_cbProlog[0..8],
    cbRegs set_cbRegs[8..11],
    fHasSEH set_fHasSEH[11..12],
    fUseBP set_fUseBP[12..13],
    reserved set_reserved[13..14],
    cbFrame set_cbFrame[14..16],
]}
pub type PFPO_DATA = *mut FPO_DATA;
pub const SIZEOF_RFPO_DATA: usize = 16;
pub const IMAGE_DEBUG_MISC_EXENAME: DWORD = 1;
STRUCT!{struct IMAGE_DEBUG_MISC {
    DataType: DWORD,
    Length: DWORD,
    Unicode: BOOLEAN,
    Reserved: [BYTE; 3],
    Data: [BYTE; 1],
}}
pub type PIMAGE_DEBUG_MISC = *mut IMAGE_DEBUG_MISC;
STRUCT!{struct IMAGE_FUNCTION_ENTRY {
    StartingAddress: DWORD,
    EndingAddress: DWORD,
    EndOfPrologue: DWORD,
}}
pub type PIMAGE_FUNCTION_ENTRY = *mut IMAGE_FUNCTION_ENTRY;
UNION!{union IMAGE_FUNCTION_ENTRY64_u {
    [u64; 1],
    EndOfPrologue EndOfPrologue_mut: ULONGLONG,
    UnwindInfoAddress UnwindInfoAddress_mut: ULONGLONG,
}}
STRUCT!{struct IMAGE_FUNCTION_ENTRY64 {
    StartingAddress: ULONGLONG,
    EndingAddress: ULONGLONG,
    u: IMAGE_FUNCTION_ENTRY64_u,
}}
pub type PIMAGE_FUNCTION_ENTRY64 = *mut IMAGE_FUNCTION_ENTRY64;
STRUCT!{struct IMAGE_SEPARATE_DEBUG_HEADER {
    Signature: WORD,
    Flags: WORD,
    Machine: WORD,
    Characteristics: WORD,
    TimeDateStamp: DWORD,
    CheckSum: DWORD,
    ImageBase: DWORD,
    SizeOfImage: DWORD,
    NumberOfSections: DWORD,
    ExportedNamesSize: DWORD,
    DebugDirectorySize: DWORD,
    SectionAlignment: DWORD,
    Reserved: [DWORD; 2],
}}
pub type PIMAGE_SEPARATE_DEBUG_HEADER = *mut IMAGE_SEPARATE_DEBUG_HEADER;
STRUCT!{struct NON_PAGED_DEBUG_INFO {
    Signature: WORD,
    Flags: WORD,
    Size: DWORD,
    Machine: WORD,
    Characteristics: WORD,
    TimeDateStamp: DWORD,
    CheckSum: DWORD,
    SizeOfImage: DWORD,
    ImageBase: ULONGLONG,
}}
pub type PNON_PAGED_DEBUG_INFO = *mut NON_PAGED_DEBUG_INFO;
pub const IMAGE_SEPARATE_DEBUG_SIGNATURE: WORD = 0x4944;
pub const NON_PAGED_DEBUG_SIGNATURE: WORD = 0x494E;
pub const IMAGE_SEPARATE_DEBUG_FLAGS_MASK: WORD = 0x8000;
pub const IMAGE_SEPARATE_DEBUG_MISMATCH: WORD = 0x8000;
STRUCT!{struct IMAGE_ARCHITECTURE_HEADER {
    BitFields: c_uint,
    FirstEntryRVA: DWORD,
}}
BITFIELD!{IMAGE_ARCHITECTURE_HEADER BitFields: c_uint [
    AmaskValue set_AmaskValue[0..1],
    unused1 set_unused1[1..8],
    AmaskShift set_AmaskShift[8..16],
    unused2 set_unused2[8..32],
]}
pub type PIMAGE_ARCHITECTURE_HEADER = *mut IMAGE_ARCHITECTURE_HEADER;
STRUCT!{struct IMAGE_ARCHITECTURE_ENTRY {
    FixupInstRVA: DWORD,
    NewInst: DWORD,
}}
pub type PIMAGE_ARCHITECTURE_ENTRY = *mut IMAGE_ARCHITECTURE_ENTRY;
pub const IMPORT_OBJECT_HDR_SIG2: WORD = 0xffff;
UNION!{union IMPORT_OBJECT_HEADER_u {
    [u16; 1],
    Ordinal Ordinal_mut: WORD,
    Hint Hint_mut: WORD,
}}
STRUCT!{struct IMPORT_OBJECT_HEADER {
    Sig1: WORD,
    Sig2: WORD,
    Version: WORD,
    Machine: WORD,
    TimeDateStamp: DWORD,
    SizeOfData: DWORD,
    u: IMPORT_OBJECT_HEADER_u,
    BitFields: WORD,
}}
BITFIELD!{IMPORT_OBJECT_HEADER BitFields: WORD [
    Type set_Type[0..2],
    NameType set_NameType[2..5],
    Reserved set_Reserved[5..16],
]}
ENUM!{enum IMPORT_OBJECT_TYPE {
    IMPORT_OBJECT_CODE = 0,
    IMPORT_OBJECT_DATA = 1,
    IMPORT_OBJECT_CONST = 2,
}}
ENUM!{enum IMPORT_OBJECT_NAME_TYPE {
    IMPORT_OBJECT_ORDINAL = 0,
    IMPORT_OBJECT_NAME = 1,
    IMPORT_OBJECT_NAME_NO_PREFIX = 2,
    IMPORT_OBJECT_NAME_UNDECORATE = 3,
    IMPORT_OBJECT_NAME_EXPORTAS = 4,
}}
ENUM!{enum ReplacesCorHdrNumericDefines {
    COMIMAGE_FLAGS_ILONLY = 0x00000001,
    COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002,
    COMIMAGE_FLAGS_IL_LIBRARY = 0x00000004,
    COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008,
    COMIMAGE_FLAGS_NATIVE_ENTRYPOINT = 0x00000010,
    COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000,
    COMIMAGE_FLAGS_32BITPREFERRED = 0x00020000,
    COR_VERSION_MAJOR_V2 = 2,
    COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2,
    COR_VERSION_MINOR = 5,
    COR_DELETED_NAME_LENGTH = 8,
    COR_VTABLEGAP_NAME_LENGTH = 8,
    NATIVE_TYPE_MAX_CB = 1,
    COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE= 0xFF,
    IMAGE_COR_MIH_METHODRVA = 0x01,
    IMAGE_COR_MIH_EHRVA = 0x02,
    IMAGE_COR_MIH_BASICBLOCK = 0x08,
    COR_VTABLE_32BIT = 0x01,
    COR_VTABLE_64BIT = 0x02,
    COR_VTABLE_FROM_UNMANAGED = 0x04,
    COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN = 0x08,
    COR_VTABLE_CALL_MOST_DERIVED = 0x10,
    IMAGE_COR_EATJ_THUNK_SIZE = 32,
    MAX_CLASS_NAME = 1024,
    MAX_PACKAGE_NAME = 1024,
}}
UNION!{union IMAGE_COR20_HEADER_u {
    [u32; 1],
    EntryPointToken EntryPointToken_mut: DWORD,
    EntryPointRVA EntryPointRVA_mut: DWORD,
}}
STRUCT!{struct IMAGE_COR20_HEADER {
    cb: DWORD,
    MajorRuntimeVersion: WORD,
    MinorRuntimeVersion: WORD,
    MetaData: IMAGE_DATA_DIRECTORY,
    Flags: DWORD,
    u: IMAGE_COR20_HEADER_u,
    Resources: IMAGE_DATA_DIRECTORY,
    StrongNameSignature: IMAGE_DATA_DIRECTORY,
    CodeManagerTable: IMAGE_DATA_DIRECTORY,
    VTableFixups: IMAGE_DATA_DIRECTORY,
    ExportAddressTableJumps: IMAGE_DATA_DIRECTORY,
    ManagedNativeHeader: IMAGE_DATA_DIRECTORY,
}}
pub type PIMAGE_COR20_HEADER = *mut IMAGE_COR20_HEADER;
extern "system" {
    pub fn RtlCaptureStackBackTrace(
        FramesToSkip: DWORD,
        FramesToCapture: DWORD,
        BackTrace: *mut PVOID,
        BackTraceHash: PDWORD,
    ) -> WORD;
    pub fn RtlCaptureContext(
        ContextRecord: PCONTEXT,
    );
    pub fn RtlUnwind(
        TargetFrame: PVOID,
        TargetIp: PVOID,
        ExceptionRecord: PEXCEPTION_RECORD,
        ReturnValue: PVOID,
    );
}
#[cfg(target_pointer_width = "64")]
extern "system" {
    pub fn RtlAddFunctionTable(
        FunctionTable: PRUNTIME_FUNCTION,
        EntryCount: DWORD,
        BaseAddress: DWORD64,
    ) -> BOOLEAN;
    pub fn RtlDeleteFunctionTable(
        FunctionTable: PRUNTIME_FUNCTION,
    ) -> BOOLEAN;
    pub fn RtlInstallFunctionTableCallback(
        TableIdentifier: DWORD64,
        BaseAddress: DWORD64,
        Length: DWORD,
        Callback: PGET_RUNTIME_FUNCTION_CALLBACK,
        Context: PVOID,
        OutOfProcessCallbackDll: PCWSTR,
    ) -> BOOLEAN;
    pub fn RtlAddGrowableFunctionTable(
        DynamicTable: *mut PVOID,
        FunctionTable: PRUNTIME_FUNCTION,
        EntryCount: DWORD,
        MaximumEntryCount: DWORD,
        RangeBase: ULONG_PTR,
        RangeEnd: ULONG_PTR,
    ) -> DWORD;
    pub fn RtlGrowFunctionTable(
        DynamicTable: PVOID,
        NewEntryCount: DWORD,
    );
    pub fn RtlDeleteGrowableFunctionTable(
        DynamicTable: PVOID,
    );
    pub fn RtlLookupFunctionEntry(
        ControlPc: DWORD64,
        ImageBase: PDWORD64,
        HistoryTable: PUNWIND_HISTORY_TABLE,
    ) -> PRUNTIME_FUNCTION;
}
#[cfg(target_arch = "x86_64")]
IFDEF!{
extern "C" {
    pub fn RtlRestoreContext(
        ContextRecord: PCONTEXT,
        ExceptionRecord: *mut EXCEPTION_RECORD,
    );
}
extern "system" {
    pub fn RtlUnwindEx(
        TargetFrame: PVOID,
        TargetIp: PVOID,
        ExceptionRecord: PEXCEPTION_RECORD,
        ReturnValue: PVOID,
        ContextRecord: PCONTEXT,
        HistoryTable: PUNWIND_HISTORY_TABLE,
    );
    pub fn RtlVirtualUnwind(
        HandlerType: DWORD,
        ImageBase: DWORD64,
        ControlPc: DWORD64,
        FunctionEntry: PRUNTIME_FUNCTION,
        ContextRecord: PCONTEXT,
        HandlerData: *mut PVOID,
        EstablisherFrame: PDWORD64,
        ContextPointers: PKNONVOLATILE_CONTEXT_POINTERS,
    ) -> PEXCEPTION_ROUTINE;
}
}
extern "system" {
    pub fn RtlPcToFileHeader(
        PcValue: PVOID,
        BaseOfImage: *mut PVOID,
    ) -> PVOID;
    pub fn RtlCompareMemory(
        Source1: *const VOID,
        Source2: *const VOID,
        Length: SIZE_T,
    ) -> SIZE_T;
}
STRUCT!{struct SLIST_ENTRY {
    Next: *mut SLIST_ENTRY,
}}
pub type PSLIST_ENTRY = *mut SLIST_ENTRY;
#[cfg(target_pointer_width = "64")]
IFDEF!{
STRUCT!{struct SLIST_HEADER_s {
    Alignment: ULONGLONG,
    Region: ULONGLONG,
}}
STRUCT!{struct SLIST_HEADER_HeaderX64 {
    BitFields1: ULONGLONG,
    BitFields2: ULONGLONG,
}}
BITFIELD!{SLIST_HEADER_HeaderX64 BitFields1: ULONGLONG [
    Depth set_Depth[0..16],
    Sequence set_Sequence[16..64],
]}
BITFIELD!{SLIST_HEADER_HeaderX64 BitFields2: ULONGLONG [
    Reserved set_Reserved[0..4],
    NextEntry set_NextEntry[4..64],
]}
UNION!{union SLIST_HEADER {
    [u64; 2],
    s s_mut: SLIST_HEADER_s,
    HeaderX64 HeaderX64_mut: SLIST_HEADER_HeaderX64,
}}
pub type PSLIST_HEADER = *mut SLIST_HEADER;
}
#[cfg(target_pointer_width = "32")]
IFDEF!{
STRUCT!{struct SLIST_HEADER_s {
    Next: SLIST_ENTRY,
    Depth: WORD,
    Reserved: WORD,
}}
UNION!{union SLIST_HEADER {
    [u64; 1],
    Alignment Alignment_mut: ULONGLONG,
    s s_mut: SLIST_HEADER_s,
}}
pub type PSLIST_HEADER = *mut SLIST_HEADER;
}
extern "system" {
    pub fn RtlInitializeSListHead(
        ListHead: PSLIST_HEADER,
    );
    pub fn RtlFirstEntrySList(
        ListHead: *const SLIST_HEADER,
    ) -> PSLIST_ENTRY;
    pub fn RtlInterlockedPopEntrySList(
        ListHead: PSLIST_HEADER,
    ) -> PSLIST_ENTRY;
    pub fn RtlInterlockedPushEntrySList(
        ListHead: PSLIST_HEADER,
        ListEntry: PSLIST_ENTRY,
    ) -> PSLIST_ENTRY;
    pub fn RtlInterlockedPushListSListEx(
        ListHead: PSLIST_HEADER,
        ListEntry: PSLIST_ENTRY,
        ListEnd: PSLIST_ENTRY,
        Count: DWORD,
    ) -> PSLIST_ENTRY;
    pub fn RtlInterlockedFlushSList(
        ListHead: PSLIST_HEADER,
    ) -> PSLIST_ENTRY;
    pub fn RtlQueryDepthSList(
        ListHead: PSLIST_HEADER,
    ) -> WORD;
}
pub const RTL_RUN_ONCE_INIT: RTL_RUN_ONCE = RTL_RUN_ONCE { Ptr: 0 as PVOID };
pub const RTL_RUN_ONCE_CHECK_ONLY: ULONG = 0x00000001;
pub const RTL_RUN_ONCE_ASYNC: ULONG = 0x00000002;
pub const RTL_RUN_ONCE_INIT_FAILED: ULONG = 0x00000004;
STRUCT!{struct RTL_RUN_ONCE {
    Ptr: PVOID,
}}
pub type PRTL_RUN_ONCE = *mut RTL_RUN_ONCE;
STRUCT!{struct RTL_BARRIER {
    Reserved1: DWORD,
    Reserved2: DWORD,
    Reserved3: [ULONG_PTR; 2],
    Reserved4: DWORD,
    Reserved5: DWORD,
}}
pub type PRTL_BARRIER = *mut RTL_BARRIER;
pub const FAST_FAIL_LEGACY_GS_VIOLATION: c_uint = 0;
pub const FAST_FAIL_VTGUARD_CHECK_FAILURE: c_uint = 1;
pub const FAST_FAIL_STACK_COOKIE_CHECK_FAILURE: c_uint = 2;
pub const FAST_FAIL_CORRUPT_LIST_ENTRY: c_uint = 3;
pub const FAST_FAIL_INCORRECT_STACK: c_uint = 4;
pub const FAST_FAIL_INVALID_ARG: c_uint = 5;
pub const FAST_FAIL_GS_COOKIE_INIT: c_uint = 6;
pub const FAST_FAIL_FATAL_APP_EXIT: c_uint = 7;
pub const FAST_FAIL_RANGE_CHECK_FAILURE: c_uint = 8;
pub const FAST_FAIL_UNSAFE_REGISTRY_ACCESS: c_uint = 9;
pub const FAST_FAIL_GUARD_ICALL_CHECK_FAILURE: c_uint = 10;
pub const FAST_FAIL_GUARD_WRITE_CHECK_FAILURE: c_uint = 11;
pub const FAST_FAIL_INVALID_FIBER_SWITCH: c_uint = 12;
pub const FAST_FAIL_INVALID_SET_OF_CONTEXT: c_uint = 13;
pub const FAST_FAIL_INVALID_REFERENCE_COUNT: c_uint = 14;
pub const FAST_FAIL_INVALID_JUMP_BUFFER: c_uint = 18;
pub const FAST_FAIL_MRDATA_MODIFIED: c_uint = 19;
pub const FAST_FAIL_CERTIFICATION_FAILURE: c_uint = 20;
pub const FAST_FAIL_INVALID_EXCEPTION_CHAIN: c_uint = 21;
pub const FAST_FAIL_CRYPTO_LIBRARY: c_uint = 22;
pub const FAST_FAIL_INVALID_CALL_IN_DLL_CALLOUT: c_uint = 23;
pub const FAST_FAIL_INVALID_IMAGE_BASE: c_uint = 24;
pub const FAST_FAIL_DLOAD_PROTECTION_FAILURE: c_uint = 25;
pub const FAST_FAIL_UNSAFE_EXTENSION_CALL: c_uint = 26;
pub const FAST_FAIL_DEPRECATED_SERVICE_INVOKED: c_uint = 27;
pub const FAST_FAIL_INVALID_BUFFER_ACCESS: c_uint = 28;
pub const FAST_FAIL_INVALID_BALANCED_TREE: c_uint = 29;
pub const FAST_FAIL_INVALID_NEXT_THREAD: c_uint = 30;
pub const FAST_FAIL_GUARD_ICALL_CHECK_SUPPRESSED: c_uint = 31;
pub const FAST_FAIL_APCS_DISABLED: c_uint = 32;
pub const FAST_FAIL_INVALID_IDLE_STATE: c_uint = 33;
pub const FAST_FAIL_MRDATA_PROTECTION_FAILURE: c_uint = 34;
pub const FAST_FAIL_UNEXPECTED_HEAP_EXCEPTION: c_uint = 35;
pub const FAST_FAIL_INVALID_LOCK_STATE: c_uint = 36;
pub const FAST_FAIL_GUARD_JUMPTABLE: c_uint = 37;
pub const FAST_FAIL_INVALID_LONGJUMP_TARGET: c_uint = 38;
pub const FAST_FAIL_INVALID_DISPATCH_CONTEXT: c_uint = 39;
pub const FAST_FAIL_INVALID_THREAD: c_uint = 40;
pub const FAST_FAIL_INVALID_SYSCALL_NUMBER: c_uint = 41;
pub const FAST_FAIL_INVALID_FILE_OPERATION: c_uint = 42;
pub const FAST_FAIL_LPAC_ACCESS_DENIED: c_uint = 43;
pub const FAST_FAIL_GUARD_SS_FAILURE: c_uint = 44;
pub const FAST_FAIL_LOADER_CONTINUITY_FAILURE: c_uint = 45;
pub const FAST_FAIL_GUARD_EXPORT_SUPPRESSION_FAILURE: c_uint = 46;
pub const FAST_FAIL_INVALID_CONTROL_STACK: c_uint = 47;
pub const FAST_FAIL_SET_CONTEXT_DENIED: c_uint = 48;
pub const FAST_FAIL_INVALID_FAST_FAIL_CODE: c_uint = 0xFFFFFFFF;
pub const HEAP_NO_SERIALIZE: DWORD = 0x00000001;
pub const HEAP_GROWABLE: DWORD = 0x00000002;
pub const HEAP_GENERATE_EXCEPTIONS: DWORD = 0x00000004;
pub const HEAP_ZERO_MEMORY: DWORD = 0x00000008;
pub const HEAP_REALLOC_IN_PLACE_ONLY: DWORD = 0x00000010;
pub const HEAP_TAIL_CHECKING_ENABLED: DWORD = 0x00000020;
pub const HEAP_FREE_CHECKING_ENABLED: DWORD = 0x00000040;
pub const HEAP_DISABLE_COALESCE_ON_FREE: DWORD = 0x00000080;
pub const HEAP_CREATE_ALIGN_16: DWORD = 0x00010000;
pub const HEAP_CREATE_ENABLE_TRACING: DWORD = 0x00020000;
pub const HEAP_CREATE_ENABLE_EXECUTE: DWORD = 0x00040000;
pub const HEAP_MAXIMUM_TAG: DWORD = 0x0FFF;
pub const HEAP_PSEUDO_TAG_FLAG: DWORD = 0x8000;
pub const HEAP_TAG_SHIFT: usize = 18;
pub const HEAP_CREATE_SEGMENT_HEAP: DWORD = 0x00000100;
pub const HEAP_CREATE_HARDENED: DWORD = 0x00000200;
#[inline]
pub fn HEAP_MAKE_TAG_FLAGS(TagBase: DWORD, Tag: DWORD) -> DWORD {
    TagBase + (Tag << HEAP_TAG_SHIFT)
}
pub const IS_TEXT_UNICODE_ASCII16: INT = 0x0001;
pub const IS_TEXT_UNICODE_REVERSE_ASCII16: INT = 0x0010;
pub const IS_TEXT_UNICODE_STATISTICS: INT = 0x0002;
pub const IS_TEXT_UNICODE_REVERSE_STATISTICS: INT = 0x0020;
pub const IS_TEXT_UNICODE_CONTROLS: INT = 0x0004;
pub const IS_TEXT_UNICODE_REVERSE_CONTROLS: INT = 0x0040;
pub const IS_TEXT_UNICODE_SIGNATURE: INT = 0x0008;
pub const IS_TEXT_UNICODE_REVERSE_SIGNATURE: INT = 0x0080;
pub const IS_TEXT_UNICODE_ILLEGAL_CHARS: INT = 0x0100;
pub const IS_TEXT_UNICODE_ODD_LENGTH: INT = 0x0200;
pub const IS_TEXT_UNICODE_DBCS_LEADBYTE: INT = 0x0400;
pub const IS_TEXT_UNICODE_NULL_BYTES: INT = 0x1000;
pub const IS_TEXT_UNICODE_UNICODE_MASK: INT = 0x000F;
pub const IS_TEXT_UNICODE_REVERSE_MASK: INT = 0x00F0;
pub const IS_TEXT_UNICODE_NOT_UNICODE_MASK: INT = 0x0F00;
pub const IS_TEXT_UNICODE_NOT_ASCII_MASK: INT = 0xF000;
pub const COMPRESSION_FORMAT_NONE: USHORT = 0x0000;
pub const COMPRESSION_FORMAT_DEFAULT: USHORT = 0x0001;
pub const COMPRESSION_FORMAT_LZNT1: USHORT = 0x0002;
pub const COMPRESSION_FORMAT_XPRESS: USHORT = 0x0003;
pub const COMPRESSION_FORMAT_XPRESS_HUFF: USHORT = 0x0004;
pub const COMPRESSION_ENGINE_STANDARD: USHORT = 0x0000;
pub const COMPRESSION_ENGINE_MAXIMUM: USHORT = 0x0100;
pub const COMPRESSION_ENGINE_HIBER: USHORT = 0x0200;
// RtlEqualMemory
#[inline]
pub unsafe fn RtlMoveMemory(Destination: *mut c_void, Source: *const c_void, Length: usize) {
    use core::ptr::copy;
    copy(Source as *const u8, Destination as *mut u8, Length);
}
#[inline]
pub unsafe fn RtlCopyMemory(Destination: *mut c_void, Source: *const c_void, Length: usize) {
    use core::ptr::copy_nonoverlapping;
    copy_nonoverlapping(Source as *const u8, Destination as *mut u8, Length);
}
#[inline]
pub unsafe fn RtlFillMemory(Destination: *mut c_void, Length: usize, Fill: u8) {
    use core::ptr::write_bytes;
    write_bytes(Destination as *mut u8, Fill, Length);
}
#[inline]
pub unsafe fn RtlZeroMemory(Destination: *mut c_void, Length: usize) {
    use core::ptr::write_bytes;
    write_bytes(Destination as *mut u8, 0, Length);
}
pub const SEF_DACL_AUTO_INHERIT: ULONG = 0x01;
pub const SEF_SACL_AUTO_INHERIT: ULONG = 0x02;
pub const SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT: ULONG = 0x04;
pub const SEF_AVOID_PRIVILEGE_CHECK: ULONG = 0x08;
pub const SEF_AVOID_OWNER_CHECK: ULONG = 0x10;
pub const SEF_DEFAULT_OWNER_FROM_PARENT: ULONG = 0x20;
pub const SEF_DEFAULT_GROUP_FROM_PARENT: ULONG = 0x40;
pub const SEF_MACL_NO_WRITE_UP: ULONG = 0x100;
pub const SEF_MACL_NO_READ_UP: ULONG = 0x200;
pub const SEF_MACL_NO_EXECUTE_UP: ULONG = 0x400;
pub const SEF_AI_USE_EXTRA_PARAMS: ULONG = 0x800;
pub const SEF_AVOID_OWNER_RESTRICTION: ULONG = 0x1000;
pub const SEF_MACL_VALID_FLAGS: ULONG = SEF_MACL_NO_WRITE_UP | SEF_MACL_NO_READ_UP
    | SEF_MACL_NO_EXECUTE_UP;
STRUCT!{struct MESSAGE_RESOURCE_ENTRY {
    Length: WORD,
    Flags: WORD,
    Text: [BYTE; 1],
}}
pub type PMESSAGE_RESOURCE_ENTRY = *mut MESSAGE_RESOURCE_ENTRY;
pub const MESSAGE_RESOURCE_UNICODE: WORD = 0x0001;
STRUCT!{struct MESSAGE_RESOURCE_BLOCK {
    LowId: DWORD,
    HighId: DWORD,
    OffsetToEntries: DWORD,
}}
pub type PMESSAGE_RESOURCE_BLOCK = *mut MESSAGE_RESOURCE_BLOCK;
STRUCT!{struct MESSAGE_RESOURCE_DATA {
    NumberOfBlocks: DWORD,
    Blocks: [MESSAGE_RESOURCE_BLOCK; 1],
}}
pub type PMESSAGE_RESOURCE_DATA = *mut MESSAGE_RESOURCE_DATA;
STRUCT!{struct OSVERSIONINFOA {
    dwOSVersionInfoSize: DWORD,
    dwMajorVersion: DWORD,
    dwMinorVersion: DWORD,
    dwBuildNumber: DWORD,
    dwPlatformId: DWORD,
    szCSDVersion: [CHAR; 128],
}}
pub type POSVERSIONINFOA = *mut OSVERSIONINFOA;
pub type LPOSVERSIONINFOA = *mut OSVERSIONINFOA;
STRUCT!{struct OSVERSIONINFOW {
    dwOSVersionInfoSize: DWORD,
    dwMajorVersion: DWORD,
    dwMinorVersion: DWORD,
    dwBuildNumber: DWORD,
    dwPlatformId: DWORD,
    szCSDVersion: [WCHAR; 128],
}}
pub type POSVERSIONINFOW = *mut OSVERSIONINFOW;
pub type LPOSVERSIONINFOW = *mut OSVERSIONINFOW;
pub type RTL_OSVERSIONINFOW = OSVERSIONINFOW;
pub type PRTL_OSVERSIONINFOW = *mut OSVERSIONINFOW;
STRUCT!{struct OSVERSIONINFOEXA {
    dwOSVersionInfoSize: DWORD,
    dwMajorVersion: DWORD,
    dwMinorVersion: DWORD,
    dwBuildNumber: DWORD,
    dwPlatformId: DWORD,
    szCSDVersion: [CHAR; 128],
    wServicePackMajor: WORD,
    wServicePackMinor: WORD,
    wSuiteMask: WORD,
    wProductType: BYTE,
    wReserved: BYTE,
}}
pub type POSVERSIONINFOEXA = *mut OSVERSIONINFOEXA;
pub type LPOSVERSIONINFOEXA = *mut OSVERSIONINFOEXA;
STRUCT!{struct OSVERSIONINFOEXW {
    dwOSVersionInfoSize: DWORD,
    dwMajorVersion: DWORD,
    dwMinorVersion: DWORD,
    dwBuildNumber: DWORD,
    dwPlatformId: DWORD,
    szCSDVersion: [WCHAR; 128],
    wServicePackMajor: WORD,
    wServicePackMinor: WORD,
    wSuiteMask: WORD,
    wProductType: BYTE,
    wReserved: BYTE,
}}
pub type POSVERSIONINFOEXW = *mut OSVERSIONINFOEXW;
pub type LPOSVERSIONINFOEXW = *mut OSVERSIONINFOEXW;
pub type RTL_OSVERSIONINFOEXW = OSVERSIONINFOEXW;
pub type PRTL_OSVERSIONINFOEXW = *mut OSVERSIONINFOEXW;
pub const VER_EQUAL: BYTE = 1;
pub const VER_GREATER: BYTE = 2;
pub const VER_GREATER_EQUAL: BYTE = 3;
pub const VER_LESS: BYTE = 4;
pub const VER_LESS_EQUAL: BYTE = 5;
pub const VER_AND: BYTE = 6;
pub const VER_OR: BYTE = 7;
pub const VER_CONDITION_MASK: BYTE = 7;
pub const VER_NUM_BITS_PER_CONDITION_MASK: BYTE = 3;
pub const VER_MINORVERSION: DWORD = 0x0000001;
pub const VER_MAJORVERSION: DWORD = 0x0000002;
pub const VER_BUILDNUMBER: DWORD = 0x0000004;
pub const VER_PLATFORMID: DWORD = 0x0000008;
pub const VER_SERVICEPACKMINOR: DWORD = 0x0000010;
pub const VER_SERVICEPACKMAJOR: DWORD = 0x0000020;
pub const VER_SUITENAME: DWORD = 0x0000040;
pub const VER_PRODUCT_TYPE: DWORD = 0x0000080;
pub const VER_NT_WORKSTATION: BYTE = 0x0000001;
pub const VER_NT_DOMAIN_CONTROLLER: BYTE = 0x0000002;
pub const VER_NT_SERVER: BYTE = 0x0000003;
pub const VER_PLATFORM_WIN32s: DWORD = 0;
pub const VER_PLATFORM_WIN32_WINDOWS: DWORD = 1;
pub const VER_PLATFORM_WIN32_NT: DWORD = 2;
extern "system" {
    pub fn VerSetConditionMask(
        ConditionMask: ULONGLONG,
        TypeMask: DWORD,
        Condition: BYTE,
    ) -> ULONGLONG;
    pub fn RtlGetProductInfo(
        OSMajorVersion: DWORD,
        OSMinorVersion: DWORD,
        SpMajorVersion: DWORD,
        SpMinorVersion: DWORD,
        ReturnedProductType: PDWORD,
    ) -> BOOLEAN;
}
pub const RTL_UMS_VERSION: DWORD = 0x100;
ENUM!{enum RTL_UMS_THREAD_INFO_CLASS {
    UmsThreadInvalidInfoClass = 0,
    UmsThreadUserContext,
    UmsThreadPriority,
    UmsThreadAffinity,
    UmsThreadTeb,
    UmsThreadIsSuspended,
    UmsThreadIsTerminated,
    UmsThreadMaxInfoClass,
}}
ENUM!{enum RTL_UMS_SCHEDULER_REASON {
    UmsSchedulerStartup = 0,
    UmsSchedulerThreadBlocked,
    UmsSchedulerThreadYield,
}}
FN!{stdcall PRTL_UMS_SCHEDULER_ENTRY_POINT(
    Reason: RTL_UMS_SCHEDULER_REASON,
    ActivationPayload: ULONG_PTR,
    SchedulerParam: PVOID,
) -> ()}
#[inline]
pub fn IS_VALIDATION_ENABLED(C: DWORD, L: DWORD) -> bool {
    (L & C) != 0
}
pub const VRL_PREDEFINED_CLASS_BEGIN: DWORD = 1 << 0;
pub const VRL_CUSTOM_CLASS_BEGIN: DWORD = 1 << 8;
pub const VRL_CLASS_CONSISTENCY: DWORD = VRL_CUSTOM_CLASS_BEGIN << 8;
pub const VRL_ENABLE_KERNEL_BREAKS: DWORD = 1 << 31;
pub const CTMF_INCLUDE_APPCONTAINER: ULONG = 0x00000001;
pub const CTMF_INCLUDE_LPAC: ULONG = 0x00000002;
pub const CTMF_VALID_FLAGS: ULONG = CTMF_INCLUDE_APPCONTAINER | CTMF_INCLUDE_LPAC;
extern "system" {
    pub fn RtlCrc32(
        Buffer: *const c_void,
        Size: size_t,
        InitialCrc: DWORD,
    ) -> DWORD;
    pub fn RtlCrc64(
        Buffer: *const c_void,
        Size: size_t,
        InitialCrc: ULONGLONG,
    ) -> ULONGLONG;
}
ENUM!{enum OS_DEPLOYEMENT_STATE_VALUES {
    OS_DEPLOYMENT_STANDARD = 1,
    OS_DEPLOYMENT_COMPACT,
}}
extern "system" {
    pub fn RtlOsDeploymentState(
        Flags: DWORD,
    ) -> OS_DEPLOYEMENT_STATE_VALUES;
}
#[cfg(target_arch = "x86_64")]
IFDEF!{
STRUCT!{struct NV_MEMORY_RANGE {
    BaseAddress: *mut VOID,
    Length: SIZE_T,
}}
pub type PNV_MEMORY_RANGE = *mut NV_MEMORY_RANGE;
pub const FLUSH_NV_MEMORY_IN_FLAG_NO_DRAIN: ULONG = 0x00000001;
pub const FLUSH_NV_MEMORY_DEFAULT_TOKEN: ULONG_PTR = -1isize as usize;
}
STRUCT!{struct RTL_CRITICAL_SECTION_DEBUG {
    Type: WORD,
    CreatorBackTraceIndex: WORD,
    CriticalSection: *mut RTL_CRITICAL_SECTION,
    ProcessLocksList: LIST_ENTRY,
    EntryCount: DWORD,
    ContentionCount: DWORD,
    Flags: DWORD,
    CreatorBackTraceIndexHigh: WORD,
    SpareWORD: WORD,
}}
pub type PRTL_CRITICAL_SECTION_DEBUG = *mut RTL_CRITICAL_SECTION_DEBUG;
pub type RTL_RESOURCE_DEBUG = RTL_CRITICAL_SECTION_DEBUG;
pub type PRTL_RESOURCE_DEBUG = *mut RTL_CRITICAL_SECTION_DEBUG;
pub const RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO: ULONG_PTR = 0x01000000;
pub const RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN: ULONG_PTR = 0x02000000;
pub const RTL_CRITICAL_SECTION_FLAG_STATIC_INIT: ULONG_PTR = 0x04000000;
pub const RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE: ULONG_PTR = 0x08000000;
pub const RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO: ULONG_PTR = 0x10000000;
pub const RTL_CRITICAL_SECTION_ALL_FLAG_BITS: ULONG_PTR = 0xFF000000;
pub const RTL_CRITICAL_SECTION_FLAG_RESERVED: ULONG_PTR = RTL_CRITICAL_SECTION_ALL_FLAG_BITS
    & !(RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO | RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN
        | RTL_CRITICAL_SECTION_FLAG_STATIC_INIT | RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE
        | RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
pub const RTL_CRITICAL_SECTION_DEBUG_FLAG_STATIC_INIT: DWORD = 0x00000001;
STRUCT!{struct RTL_CRITICAL_SECTION {
    DebugInfo: PRTL_CRITICAL_SECTION_DEBUG,
    LockCount: LONG,
    RecursionCount: LONG,
    OwningThread: HANDLE,
    LockSemaphore: HANDLE,
    SpinCount: ULONG_PTR,
}}
pub type PRTL_CRITICAL_SECTION = *mut RTL_CRITICAL_SECTION;
STRUCT!{struct RTL_SRWLOCK {
    Ptr: PVOID,
}}
pub type PRTL_SRWLOCK = *mut RTL_SRWLOCK;
pub const RTL_SRWLOCK_INIT: RTL_SRWLOCK = RTL_SRWLOCK { Ptr: 0 as PVOID };
STRUCT!{struct RTL_CONDITION_VARIABLE {
    Ptr: PVOID,
}}
pub type PRTL_CONDITION_VARIABLE = *mut RTL_CONDITION_VARIABLE;
pub const RTL_CONDITION_VARIABLE_INIT: RTL_CONDITION_VARIABLE = RTL_CONDITION_VARIABLE {
    Ptr: 0 as PVOID,
};
pub const RTL_CONDITION_VARIABLE_LOCKMODE_SHARED: DWORD = 0x1;
FN!{stdcall PAPCFUNC(
    Parameter: ULONG_PTR,
) -> ()}
FN!{stdcall PVECTORED_EXCEPTION_HANDLER(
    ExceptionInfo: *mut EXCEPTION_POINTERS,
) -> LONG}
ENUM!{enum HEAP_INFORMATION_CLASS {
    HeapCompatibilityInformation = 0,
    HeapEnableTerminationOnCorruption = 1,
    HeapOptimizeResources = 3,
}}
pub const HEAP_OPTIMIZE_RESOURCES_CURRENT_VERSION: DWORD = 1;
STRUCT!{struct HEAP_OPTIMIZE_RESOURCES_INFORMATION {
    Version: DWORD,
    Flags: DWORD,
}}
pub type PHEAP_OPTIMIZE_RESOURCES_INFORMATION = *mut HEAP_OPTIMIZE_RESOURCES_INFORMATION;
pub const WT_EXECUTEDEFAULT: ULONG = 0x00000000;
pub const WT_EXECUTEINIOTHREAD: ULONG = 0x00000001;
pub const WT_EXECUTEINUITHREAD: ULONG = 0x00000002;
pub const WT_EXECUTEINWAITTHREAD: ULONG = 0x00000004;
pub const WT_EXECUTEONLYONCE: ULONG = 0x00000008;
pub const WT_EXECUTEINTIMERTHREAD: ULONG = 0x00000020;
pub const WT_EXECUTELONGFUNCTION: ULONG = 0x00000010;
pub const WT_EXECUTEINPERSISTENTIOTHREAD: ULONG = 0x00000040;
pub const WT_EXECUTEINPERSISTENTTHREAD: ULONG = 0x00000080;
pub const WT_TRANSFER_IMPERSONATION: ULONG = 0x00000100;
#[inline]
pub fn WT_SET_MAX_THREADPOOL_THREADS(Flags: ULONG, Limit: ULONG) -> ULONG {
    Flags | (Limit << 16)
}
FN!{stdcall WAITORTIMERCALLBACKFUNC(
    PVOID,
    BOOLEAN,
) -> ()}
FN!{stdcall WORKERCALLBACKFUNC(
    PVOID,
) -> ()}
FN!{stdcall APC_CALLBACK_FUNCTION(
    DWORD,
    PVOID,
    PVOID,
) -> ()}
pub type WAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC;
FN!{stdcall PFLS_CALLBACK_FUNCTION(
    lpFlsData: PVOID,
) -> ()}
FN!{stdcall PSECURE_MEMORY_CACHE_CALLBACK(
    Addr: PVOID,
    Range: SIZE_T,
) -> BOOLEAN}
pub const WT_EXECUTEINLONGTHREAD: ULONG = 0x00000010;
pub const WT_EXECUTEDELETEWAIT: ULONG = 0x00000008;
ENUM!{enum ACTIVATION_CONTEXT_INFO_CLASS {
    ActivationContextBasicInformation = 1,
    ActivationContextDetailedInformation = 2,
    AssemblyDetailedInformationInActivationContext = 3,
    FileInformationInAssemblyOfAssemblyInActivationContext = 4,
    RunlevelInformationInActivationContext = 5,
    CompatibilityInformationInActivationContext = 6,
    ActivationContextManifestResourceName = 7,
    MaxActivationContextInfoClass,
    AssemblyDetailedInformationInActivationContxt = 3,
    FileInformationInAssemblyOfAssemblyInActivationContxt = 4,
}}
pub type ACTIVATIONCONTEXTINFOCLASS = ACTIVATION_CONTEXT_INFO_CLASS;
STRUCT!{struct ACTIVATION_CONTEXT_QUERY_INDEX {
    ulAssemblyIndex: DWORD,
    ulFileIndexInAssembly: DWORD,
}}
pub type PACTIVATION_CONTEXT_QUERY_INDEX = *mut ACTIVATION_CONTEXT_QUERY_INDEX;
pub type PCACTIVATION_CONTEXT_QUERY_INDEX = *const ACTIVATION_CONTEXT_QUERY_INDEX;
pub const ACTIVATION_CONTEXT_PATH_TYPE_NONE: DWORD = 1;
pub const ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE: DWORD = 2;
pub const ACTIVATION_CONTEXT_PATH_TYPE_URL: DWORD = 3;
pub const ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF: DWORD = 4;
STRUCT!{struct ASSEMBLY_FILE_DETAILED_INFORMATION {
    ulFlags: DWORD,
    ulFilenameLength: DWORD,
    ulPathLength: DWORD,
    lpFileName: PCWSTR,
    lpFilePath: PCWSTR,
}}
pub type PASSEMBLY_FILE_DETAILED_INFORMATION = *mut ASSEMBLY_FILE_DETAILED_INFORMATION;
pub type PCASSEMBLY_FILE_DETAILED_INFORMATION = *const ASSEMBLY_FILE_DETAILED_INFORMATION;
pub type ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = ASSEMBLY_FILE_DETAILED_INFORMATION;
pub type PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PASSEMBLY_FILE_DETAILED_INFORMATION;
pub type PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PCASSEMBLY_FILE_DETAILED_INFORMATION;
STRUCT!{struct ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION {
    ulFlags: DWORD,
    ulEncodedAssemblyIdentityLength: DWORD,
    ulManifestPathType: DWORD,
    ulManifestPathLength: DWORD,
    liManifestLastWriteTime: LARGE_INTEGER,
    ulPolicyPathType: DWORD,
    ulPolicyPathLength: DWORD,
    liPolicyLastWriteTime: LARGE_INTEGER,
    ulMetadataSatelliteRosterIndex: DWORD,
    ulManifestVersionMajor: DWORD,
    ulManifestVersionMinor: DWORD,
    ulPolicyVersionMajor: DWORD,
    ulPolicyVersionMinor: DWORD,
    ulAssemblyDirectoryNameLength: DWORD,
    lpAssemblyEncodedAssemblyIdentity: PCWSTR,
    lpAssemblyManifestPath: PCWSTR,
    lpAssemblyPolicyPath: PCWSTR,
    lpAssemblyDirectoryName: PCWSTR,
    ulFileCount: DWORD,
}}
pub type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
    = *mut ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
pub type PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
    = *const ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
ENUM!{enum ACTCTX_REQUESTED_RUN_LEVEL {
    ACTCTX_RUN_LEVEL_UNSPECIFIED = 0,
    ACTCTX_RUN_LEVEL_AS_INVOKER,
    ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE,
    ACTCTX_RUN_LEVEL_REQUIRE_ADMIN,
    ACTCTX_RUN_LEVEL_NUMBERS,
}}
STRUCT!{struct ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION {
    ulFlags: DWORD,
    RunLevel: ACTCTX_REQUESTED_RUN_LEVEL,
    UiAccess: DWORD,
}}
pub type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = *mut ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION;
pub type PCACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION
    = *const ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION;
ENUM!{enum ACTCTX_COMPATIBILITY_ELEMENT_TYPE {
    ACTCTX_COMPATIBILITY_ELEMENT_TYPE_UNKNOWN = 0,
    ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS,
    ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MITIGATION,
}}
STRUCT!{struct COMPATIBILITY_CONTEXT_ELEMENT {
    Id: GUID,
    Type: ACTCTX_COMPATIBILITY_ELEMENT_TYPE,
}}
pub type PCOMPATIBILITY_CONTEXT_ELEMENT = *mut COMPATIBILITY_CONTEXT_ELEMENT;
pub type PCCOMPATIBILITY_CONTEXT_ELEMENT = *const COMPATIBILITY_CONTEXT_ELEMENT;
STRUCT!{struct ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION {
    ElementCount: DWORD,
    Elements: [COMPATIBILITY_CONTEXT_ELEMENT; 0],
}}
pub type PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION
    = *mut ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION;
pub type PCACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION
    = *const ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION;
STRUCT!{struct SUPPORTED_OS_INFO {
    MajorVersion: WORD,
    MinorVersion: WORD,
}}
pub type PSUPPORTED_OS_INFO = *mut SUPPORTED_OS_INFO;
STRUCT!{struct ACTIVATION_CONTEXT_DETAILED_INFORMATION {
    dwFlags: DWORD,
    ulFormatVersion: DWORD,
    ulAssemblyCount: DWORD,
    ulRootManifestPathType: DWORD,
    ulRootManifestPathChars: DWORD,
    ulRootConfigurationPathType: DWORD,
    ulRootConfigurationPathChars: DWORD,
    ulAppDirPathType: DWORD,
    ulAppDirPathChars: DWORD,
    lpRootManifestPath: PCWSTR,
    lpRootConfigurationPath: PCWSTR,
    lpAppDirPath: PCWSTR,
}}
pub type PACTIVATION_CONTEXT_DETAILED_INFORMATION = *mut ACTIVATION_CONTEXT_DETAILED_INFORMATION;
pub type PCACTIVATION_CONTEXT_DETAILED_INFORMATION
    = *const ACTIVATION_CONTEXT_DETAILED_INFORMATION;
pub const CREATE_BOUNDARY_DESCRIPTOR_ADD_APPCONTAINER_SID: DWORD = 0x1;
STRUCT!{struct HARDWARE_COUNTER_DATA {
    Type: HARDWARE_COUNTER_TYPE,
    Reserved: DWORD,
    Value: DWORD64,
}}
pub type PHARDWARE_COUNTER_DATA = *mut HARDWARE_COUNTER_DATA;
pub const PERFORMANCE_DATA_VERSION: BYTE = 1;
STRUCT!{struct PERFORMANCE_DATA {
    Size: WORD,
    Version: BYTE,
    HwCountersCount: BYTE,
    ContextSwitchCount: DWORD,
    WaitReasonBitMap: DWORD64,
    CycleTime: DWORD64,
    RetryCount: DWORD,
    Reserved: DWORD,
    HwCounters: [HARDWARE_COUNTER_DATA; MAX_HW_COUNTERS],
}}
pub type PPERFORMANCE_DATA = *mut PERFORMANCE_DATA;
pub const READ_THREAD_PROFILING_FLAG_DISPATCHING: DWORD = 0x00000001;
pub const READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS: DWORD = 0x00000002;
pub const UNIFIEDBUILDREVISION_KEY: &'static str
    = "\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion";
pub const UNIFIEDBUILDREVISION_VALUE: &'static str = "UBR";
pub const UNIFIEDBUILDREVISION_MIN: DWORD = 0x00000000;
pub const DEVICEFAMILYDEVICEFORM_KEY: &'static str
    = "\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\OEM";
pub const DEVICEFAMILYDEVICEFORM_VALUE: &'static str = "DeviceForm";
pub const DEVICEFAMILYINFOENUM_UAP: DWORD = 0x00000000;
pub const DEVICEFAMILYINFOENUM_WINDOWS_8X: DWORD = 0x00000001;
pub const DEVICEFAMILYINFOENUM_WINDOWS_PHONE_8X: DWORD = 0x00000002;
pub const DEVICEFAMILYINFOENUM_DESKTOP: DWORD = 0x00000003;
pub const DEVICEFAMILYINFOENUM_MOBILE: DWORD = 0x00000004;
pub const DEVICEFAMILYINFOENUM_XBOX: DWORD = 0x00000005;
pub const DEVICEFAMILYINFOENUM_TEAM: DWORD = 0x00000006;
pub const DEVICEFAMILYINFOENUM_IOT: DWORD = 0x00000007;
pub const DEVICEFAMILYINFOENUM_IOT_HEADLESS: DWORD = 0x00000008;
pub const DEVICEFAMILYINFOENUM_SERVER: DWORD = 0x00000009;
pub const DEVICEFAMILYINFOENUM_HOLOGRAPHIC: DWORD = 0x0000000A;
pub const DEVICEFAMILYINFOENUM_XBOXSRA: DWORD = 0x0000000B;
pub const DEVICEFAMILYINFOENUM_XBOXERA: DWORD = 0x0000000C;
pub const DEVICEFAMILYINFOENUM_SERVER_NANO: DWORD = 0x0000000D;
pub const DEVICEFAMILYINFOENUM_MAX: DWORD = 0x0000000D;
pub const DEVICEFAMILYDEVICEFORM_UNKNOWN: DWORD = 0x00000000;
pub const DEVICEFAMILYDEVICEFORM_PHONE: DWORD = 0x00000001;
pub const DEVICEFAMILYDEVICEFORM_TABLET: DWORD = 0x00000002;
pub const DEVICEFAMILYDEVICEFORM_DESKTOP: DWORD = 0x00000003;
pub const DEVICEFAMILYDEVICEFORM_NOTEBOOK: DWORD = 0x00000004;
pub const DEVICEFAMILYDEVICEFORM_CONVERTIBLE: DWORD = 0x00000005;
pub const DEVICEFAMILYDEVICEFORM_DETACHABLE: DWORD = 0x00000006;
pub const DEVICEFAMILYDEVICEFORM_ALLINONE: DWORD = 0x00000007;
pub const DEVICEFAMILYDEVICEFORM_STICKPC: DWORD = 0x00000008;
pub const DEVICEFAMILYDEVICEFORM_PUCK: DWORD = 0x00000009;
pub const DEVICEFAMILYDEVICEFORM_LARGESCREEN: DWORD = 0x0000000A;
pub const DEVICEFAMILYDEVICEFORM_HMD: DWORD = 0x0000000B;
pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_HANDHELD: DWORD = 0x0000000C;
pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_TABLET: DWORD = 0x0000000D;
pub const DEVICEFAMILYDEVICEFORM_BANKING: DWORD = 0x0000000E;
pub const DEVICEFAMILYDEVICEFORM_BUILDING_AUTOMATION: DWORD = 0x0000000F;
pub const DEVICEFAMILYDEVICEFORM_DIGITAL_SIGNAGE: DWORD = 0x00000010;
pub const DEVICEFAMILYDEVICEFORM_GAMING: DWORD = 0x00000011;
pub const DEVICEFAMILYDEVICEFORM_HOME_AUTOMATION: DWORD = 0x00000012;
pub const DEVICEFAMILYDEVICEFORM_INDUSTRIAL_AUTOMATION: DWORD = 0x00000013;
pub const DEVICEFAMILYDEVICEFORM_KIOSK: DWORD = 0x00000014;
pub const DEVICEFAMILYDEVICEFORM_MAKER_BOARD: DWORD = 0x00000015;
pub const DEVICEFAMILYDEVICEFORM_MEDICAL: DWORD = 0x00000016;
pub const DEVICEFAMILYDEVICEFORM_NETWORKING: DWORD = 0x00000017;
pub const DEVICEFAMILYDEVICEFORM_POINT_OF_SERVICE: DWORD = 0x00000018;
pub const DEVICEFAMILYDEVICEFORM_PRINTING: DWORD = 0x00000019;
pub const DEVICEFAMILYDEVICEFORM_THIN_CLIENT: DWORD = 0x0000001A;
pub const DEVICEFAMILYDEVICEFORM_TOY: DWORD = 0x0000001B;
pub const DEVICEFAMILYDEVICEFORM_VENDING: DWORD = 0x0000001C;
pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_OTHER: DWORD = 0x0000001D;
pub const DEVICEFAMILYDEVICEFORM_MAX: DWORD = 0x0000001D;
extern "system" {
    pub fn RtlGetDeviceFamilyInfoEnum(
        pullUAPInfo: *mut ULONGLONG,
        pulDeviceFamily: *mut DWORD,
        pulDeviceForm: *mut DWORD,
    );
    pub fn RtlConvertDeviceFamilyInfoToString(
        pulDeviceFamilyBufferSize: PDWORD,
        pulDeviceFormBufferSize: PDWORD,
        DeviceFamily: PWSTR,
        DeviceForm: PWSTR,
    ) -> DWORD;
    pub fn RtlSwitchedVVI(
        VersionInfo: PRTL_OSVERSIONINFOEXW,
        TypeMask: DWORD,
        ConditionMask: ULONGLONG,
    ) -> DWORD;
}
pub const DLL_PROCESS_ATTACH: DWORD = 1;
pub const DLL_THREAD_ATTACH: DWORD = 2;
pub const DLL_THREAD_DETACH: DWORD = 3;
pub const DLL_PROCESS_DETACH: DWORD = 0;
pub const EVENTLOG_SEQUENTIAL_READ: DWORD = 0x0001;
pub const EVENTLOG_SEEK_READ: DWORD = 0x0002;
pub const EVENTLOG_FORWARDS_READ: DWORD = 0x0004;
pub const EVENTLOG_BACKWARDS_READ: DWORD = 0x0008;
pub const EVENTLOG_SUCCESS: WORD = 0x0000;
pub const EVENTLOG_ERROR_TYPE: WORD = 0x0001;
pub const EVENTLOG_WARNING_TYPE: WORD = 0x0002;
pub const EVENTLOG_INFORMATION_TYPE: WORD = 0x0004;
pub const EVENTLOG_AUDIT_SUCCESS: WORD = 0x0008;
pub const EVENTLOG_AUDIT_FAILURE: WORD = 0x0010;
pub const EVENTLOG_START_PAIRED_EVENT: WORD = 0x0001;
pub const EVENTLOG_END_PAIRED_EVENT: WORD = 0x0002;
pub const EVENTLOG_END_ALL_PAIRED_EVENTS: WORD = 0x0004;
pub const EVENTLOG_PAIRED_EVENT_ACTIVE: WORD = 0x0008;
pub const EVENTLOG_PAIRED_EVENT_INACTIVE: WORD = 0x0010;
STRUCT!{struct EVENTLOGRECORD {
    Length: DWORD,
    Reserved: DWORD,
    RecordNumber: DWORD,
    TimeGenerated: DWORD,
    TimeWritten: DWORD,
    EventID: DWORD,
    EventType: WORD,
    NumStrings: WORD,
    EventCategory: WORD,
    ReservedFlags: WORD,
    ClosingRecordNumber: DWORD,
    StringOffset: DWORD,
    UserSidLength: DWORD,
    UserSidOffset: DWORD,
    DataLength: DWORD,
    DataOffset: DWORD,
}}
pub type PEVENTLOGRECORD = *mut EVENTLOGRECORD;
pub const MAXLOGICALLOGNAMESIZE: usize = 256;
pub type PEVENTSFORLOGFILE = *mut EVENTSFORLOGFILE;
pub type PPACKEDEVENTINFO = *mut PACKEDEVENTINFO;
STRUCT!{struct EVENTSFORLOGFILE {
    ulSize: DWORD,
    szLogicalLogFile: [WCHAR; MAXLOGICALLOGNAMESIZE],
    ulNumRecords: DWORD,
    pEventLogRecords: [EVENTLOGRECORD; 0],
}}
STRUCT!{struct PACKEDEVENTINFO {
    ulSize: DWORD,
    ulNumEventsForLogFile: DWORD,
    ulOffsets: [DWORD; 0],
}}
pub const KEY_QUERY_VALUE: u32 = 0x0001;
pub const KEY_SET_VALUE: u32 = 0x0002;
pub const KEY_CREATE_SUB_KEY: u32 = 0x0004;
pub const KEY_ENUMERATE_SUB_KEYS: u32 = 0x0008;
pub const KEY_NOTIFY: u32 = 0x0010;
pub const KEY_CREATE_LINK: u32 = 0x0020;
pub const KEY_WOW64_32KEY: u32 = 0x0200;
pub const KEY_WOW64_64KEY: u32 = 0x0100;
pub const KEY_WOW64_RES: u32 = 0x0300;
pub const KEY_READ: u32 = (STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS
    | KEY_NOTIFY) & !SYNCHRONIZE;
pub const KEY_WRITE: u32 = (STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY)
    & !SYNCHRONIZE;
pub const KEY_EXECUTE: u32 = KEY_READ & !SYNCHRONIZE;
pub const KEY_ALL_ACCESS: u32 = (STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE
    | KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_CREATE_LINK) & !SYNCHRONIZE;
pub const REG_OPTION_RESERVED: DWORD = 0x00000000;
pub const REG_OPTION_NON_VOLATILE: DWORD = 0x00000000;
pub const REG_OPTION_VOLATILE: DWORD = 0x00000001;
pub const REG_OPTION_CREATE_LINK: DWORD = 0x00000002;
pub const REG_OPTION_BACKUP_RESTORE: DWORD = 0x00000004;
pub const REG_OPTION_OPEN_LINK: DWORD = 0x00000008;
pub const REG_OPTION_DONT_VIRTUALIZE: DWORD = 0x00000010;
pub const REG_LEGAL_OPTION: DWORD = REG_OPTION_RESERVED | REG_OPTION_NON_VOLATILE
    | REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK | REG_OPTION_BACKUP_RESTORE
    | REG_OPTION_OPEN_LINK | REG_OPTION_DONT_VIRTUALIZE;
pub const REG_OPEN_LEGAL_OPTION: DWORD = REG_OPTION_RESERVED | REG_OPTION_BACKUP_RESTORE
    | REG_OPTION_OPEN_LINK | REG_OPTION_DONT_VIRTUALIZE;
pub const REG_CREATED_NEW_KEY: DWORD = 0x00000001;
pub const REG_OPENED_EXISTING_KEY: DWORD = 0x00000002;
pub const REG_STANDARD_FORMAT: DWORD = 1;
pub const REG_LATEST_FORMAT: DWORD = 2;
pub const REG_NO_COMPRESSION: DWORD = 4;
pub const REG_WHOLE_HIVE_VOLATILE: DWORD = 0x00000001;
pub const REG_REFRESH_HIVE: DWORD = 0x00000002;
pub const REG_NO_LAZY_FLUSH: DWORD = 0x00000004;
pub const REG_FORCE_RESTORE: DWORD = 0x00000008;
pub const REG_APP_HIVE: DWORD = 0x00000010;
pub const REG_PROCESS_PRIVATE: DWORD = 0x00000020;
pub const REG_START_JOURNAL: DWORD = 0x00000040;
pub const REG_HIVE_EXACT_FILE_GROWTH: DWORD = 0x00000080;
pub const REG_HIVE_NO_RM: DWORD = 0x00000100;
pub const REG_HIVE_SINGLE_LOG: DWORD = 0x00000200;
pub const REG_BOOT_HIVE: DWORD = 0x00000400;
pub const REG_LOAD_HIVE_OPEN_HANDLE: DWORD = 0x00000800;
pub const REG_FLUSH_HIVE_FILE_GROWTH: DWORD = 0x00001000;
pub const REG_OPEN_READ_ONLY: DWORD = 0x00002000;
pub const REG_IMMUTABLE: DWORD = 0x00004000;
pub const REG_APP_HIVE_OPEN_READ_ONLY: DWORD = REG_OPEN_READ_ONLY;
pub const REG_FORCE_UNLOAD: DWORD = 1;
pub const REG_UNLOAD_LEGAL_FLAGS: DWORD = REG_FORCE_UNLOAD;
pub const REG_NOTIFY_CHANGE_NAME: DWORD = 0x00000001;
pub const REG_NOTIFY_CHANGE_ATTRIBUTES: DWORD = 0x00000002;
pub const REG_NOTIFY_CHANGE_LAST_SET: DWORD = 0x00000004;
pub const REG_NOTIFY_CHANGE_SECURITY: DWORD = 0x00000008;
pub const REG_NOTIFY_THREAD_AGNOSTIC: DWORD = 0x10000000;
pub const REG_LEGAL_CHANGE_FILTER: DWORD = REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES
    | REG_NOTIFY_CHANGE_LAST_SET | REG_NOTIFY_CHANGE_SECURITY | REG_NOTIFY_THREAD_AGNOSTIC;
pub const REG_NONE: DWORD = 0;
pub const REG_SZ: DWORD = 1;
pub const REG_EXPAND_SZ: DWORD = 2;
pub const REG_BINARY: DWORD = 3;
pub const REG_DWORD: DWORD = 4;
pub const REG_DWORD_LITTLE_ENDIAN: DWORD = 4;
pub const REG_DWORD_BIG_ENDIAN: DWORD = 5;
pub const REG_LINK: DWORD = 6;
pub const REG_MULTI_SZ: DWORD = 7;
pub const REG_RESOURCE_LIST: DWORD = 8;
pub const REG_FULL_RESOURCE_DESCRIPTOR: DWORD = 9;
pub const REG_RESOURCE_REQUIREMENTS_LIST: DWORD = 10;
pub const REG_QWORD: DWORD = 11;
pub const REG_QWORD_LITTLE_ENDIAN: DWORD = 11;
pub const SERVICE_KERNEL_DRIVER: DWORD = 0x00000001;
pub const SERVICE_FILE_SYSTEM_DRIVER: DWORD = 0x00000002;
pub const SERVICE_ADAPTER: DWORD = 0x00000004;
pub const SERVICE_RECOGNIZER_DRIVER: DWORD = 0x00000008;
pub const SERVICE_DRIVER: DWORD = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER
    | SERVICE_RECOGNIZER_DRIVER;
pub const SERVICE_WIN32_OWN_PROCESS: DWORD = 0x00000010;
pub const SERVICE_WIN32_SHARE_PROCESS: DWORD = 0x00000020;
pub const SERVICE_WIN32: DWORD = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS;
pub const SERVICE_USER_SERVICE: DWORD = 0x00000040;
pub const SERVICE_USERSERVICE_INSTANCE: DWORD = 0x00000080;
pub const SERVICE_USER_SHARE_PROCESS: DWORD = SERVICE_USER_SERVICE | SERVICE_WIN32_SHARE_PROCESS;
pub const SERVICE_USER_OWN_PROCESS: DWORD = SERVICE_USER_SERVICE | SERVICE_WIN32_OWN_PROCESS;
pub const SERVICE_INTERACTIVE_PROCESS: DWORD = 0x00000100;
pub const SERVICE_PKG_SERVICE: DWORD = 0x00000200;
pub const SERVICE_TYPE_ALL: DWORD = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER
    | SERVICE_INTERACTIVE_PROCESS | SERVICE_USER_SERVICE | SERVICE_USERSERVICE_INSTANCE
    | SERVICE_PKG_SERVICE;
pub const SERVICE_BOOT_START: DWORD = 0x00000000;
pub const SERVICE_SYSTEM_START: DWORD = 0x00000001;
pub const SERVICE_AUTO_START: DWORD = 0x00000002;
pub const SERVICE_DEMAND_START: DWORD = 0x00000003;
pub const SERVICE_DISABLED: DWORD = 0x00000004;
pub const SERVICE_ERROR_IGNORE: DWORD = 0x00000000;
pub const SERVICE_ERROR_NORMAL: DWORD = 0x00000001;
pub const SERVICE_ERROR_SEVERE: DWORD = 0x00000002;
pub const SERVICE_ERROR_CRITICAL: DWORD = 0x00000003;
ENUM!{enum SERVICE_NODE_TYPE {
    DriverType = SERVICE_KERNEL_DRIVER,
    FileSystemType = SERVICE_FILE_SYSTEM_DRIVER,
    Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS,
    Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS,
    AdapterType = SERVICE_ADAPTER,
    RecognizerType = SERVICE_RECOGNIZER_DRIVER,
}}
ENUM!{enum SERVICE_LOAD_TYPE {
    BootLoad = SERVICE_BOOT_START,
    SystemLoad = SERVICE_SYSTEM_START,
    AutoLoad = SERVICE_AUTO_START,
    DemandLoad = SERVICE_DEMAND_START,
    DisableLoad = SERVICE_DISABLED,
}}
ENUM!{enum SERVICE_ERROR_TYPE {
    IgnoreError = SERVICE_ERROR_IGNORE,
    NormalError = SERVICE_ERROR_NORMAL,
    SevereError = SERVICE_ERROR_SEVERE,
    CriticalError = SERVICE_ERROR_CRITICAL,
}}
pub const CM_SERVICE_NETWORK_BOOT_LOAD: DWORD = 0x00000001;
pub const CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD: DWORD = 0x00000002;
pub const CM_SERVICE_USB_DISK_BOOT_LOAD: DWORD = 0x00000004;
pub const CM_SERVICE_SD_DISK_BOOT_LOAD: DWORD = 0x00000008;
pub const CM_SERVICE_USB3_DISK_BOOT_LOAD: DWORD = 0x00000010;
pub const CM_SERVICE_MEASURED_BOOT_LOAD: DWORD = 0x00000020;
pub const CM_SERVICE_VERIFIER_BOOT_LOAD: DWORD = 0x00000040;
pub const CM_SERVICE_WINPE_BOOT_LOAD: DWORD = 0x00000080;
pub const CM_SERVICE_VALID_PROMOTION_MASK: DWORD = CM_SERVICE_NETWORK_BOOT_LOAD
    | CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | CM_SERVICE_USB_DISK_BOOT_LOAD
    | CM_SERVICE_SD_DISK_BOOT_LOAD | CM_SERVICE_USB3_DISK_BOOT_LOAD
    | CM_SERVICE_MEASURED_BOOT_LOAD | CM_SERVICE_VERIFIER_BOOT_LOAD | CM_SERVICE_WINPE_BOOT_LOAD;
pub const TAPE_ERASE_SHORT: DWORD = 0;
pub const TAPE_ERASE_LONG: DWORD = 1;
STRUCT!{struct TAPE_ERASE {
    Type: DWORD,
    Immediate: BOOLEAN,
}}
pub type PTAPE_ERASE = *mut TAPE_ERASE;
pub const TAPE_LOAD: DWORD = 0;
pub const TAPE_UNLOAD: DWORD = 1;
pub const TAPE_TENSION: DWORD = 2;
pub const TAPE_LOCK: DWORD = 3;
pub const TAPE_UNLOCK: DWORD = 4;
pub const TAPE_FORMAT: DWORD = 5;
STRUCT!{struct TAPE_PREPARE {
    Operation: DWORD,
    Immediate: BOOLEAN,
}}
pub type PTAPE_PREPARE = *mut TAPE_PREPARE;
pub const TAPE_SETMARKS: DWORD = 0;
pub const TAPE_FILEMARKS: DWORD = 1;
pub const TAPE_SHORT_FILEMARKS: DWORD = 2;
pub const TAPE_LONG_FILEMARKS: DWORD = 3;
STRUCT!{struct TAPE_WRITE_MARKS {
    Type: DWORD,
    Count: DWORD,
    Immediate: BOOLEAN,
}}
pub type PTAPE_WRITE_MARKS = *mut TAPE_WRITE_MARKS;
pub const TAPE_ABSOLUTE_POSITION: DWORD = 0;
pub const TAPE_LOGICAL_POSITION: DWORD = 1;
pub const TAPE_PSEUDO_LOGICAL_POSITION: DWORD = 2;
STRUCT!{struct TAPE_GET_POSITION {
    Type: DWORD,
    Partition: DWORD,
    Offset: LARGE_INTEGER,
}}
pub type PTAPE_GET_POSITION = *mut TAPE_GET_POSITION;
pub const TAPE_REWIND: DWORD = 0;
pub const TAPE_ABSOLUTE_BLOCK: DWORD = 1;
pub const TAPE_LOGICAL_BLOCK: DWORD = 2;
pub const TAPE_PSEUDO_LOGICAL_BLOCK: DWORD = 3;
pub const TAPE_SPACE_END_OF_DATA: DWORD = 4;
pub const TAPE_SPACE_RELATIVE_BLOCKS: DWORD = 5;
pub const TAPE_SPACE_FILEMARKS: DWORD = 6;
pub const TAPE_SPACE_SEQUENTIAL_FMKS: DWORD = 7;
pub const TAPE_SPACE_SETMARKS: DWORD = 8;
pub const TAPE_SPACE_SEQUENTIAL_SMKS: DWORD = 9;
STRUCT!{struct TAPE_SET_POSITION {
    Method: DWORD,
    Partition: DWORD,
    Offset: LARGE_INTEGER,
    Immediate: BOOLEAN,
}}
pub type PTAPE_SET_POSITION = *mut TAPE_SET_POSITION;
pub const TAPE_DRIVE_FIXED: DWORD = 0x00000001;
pub const TAPE_DRIVE_SELECT: DWORD = 0x00000002;
pub const TAPE_DRIVE_INITIATOR: DWORD = 0x00000004;
pub const TAPE_DRIVE_ERASE_SHORT: DWORD = 0x00000010;
pub const TAPE_DRIVE_ERASE_LONG: DWORD = 0x00000020;
pub const TAPE_DRIVE_ERASE_BOP_ONLY: DWORD = 0x00000040;
pub const TAPE_DRIVE_ERASE_IMMEDIATE: DWORD = 0x00000080;
pub const TAPE_DRIVE_TAPE_CAPACITY: DWORD = 0x00000100;
pub const TAPE_DRIVE_TAPE_REMAINING: DWORD = 0x00000200;
pub const TAPE_DRIVE_FIXED_BLOCK: DWORD = 0x00000400;
pub const TAPE_DRIVE_VARIABLE_BLOCK: DWORD = 0x00000800;
pub const TAPE_DRIVE_WRITE_PROTECT: DWORD = 0x00001000;
pub const TAPE_DRIVE_EOT_WZ_SIZE: DWORD = 0x00002000;
pub const TAPE_DRIVE_ECC: DWORD = 0x00010000;
pub const TAPE_DRIVE_COMPRESSION: DWORD = 0x00020000;
pub const TAPE_DRIVE_PADDING: DWORD = 0x00040000;
pub const TAPE_DRIVE_REPORT_SMKS: DWORD = 0x00080000;
pub const TAPE_DRIVE_GET_ABSOLUTE_BLK: DWORD = 0x00100000;
pub const TAPE_DRIVE_GET_LOGICAL_BLK: DWORD = 0x00200000;
pub const TAPE_DRIVE_SET_EOT_WZ_SIZE: DWORD = 0x00400000;
pub const TAPE_DRIVE_EJECT_MEDIA: DWORD = 0x01000000;
pub const TAPE_DRIVE_CLEAN_REQUESTS: DWORD = 0x02000000;
pub const TAPE_DRIVE_SET_CMP_BOP_ONLY: DWORD = 0x04000000;
pub const TAPE_DRIVE_RESERVED_BIT: DWORD = 0x80000000;
pub const TAPE_DRIVE_LOAD_UNLOAD: DWORD = 0x80000001;
pub const TAPE_DRIVE_TENSION: DWORD = 0x80000002;
pub const TAPE_DRIVE_LOCK_UNLOCK: DWORD = 0x80000004;
pub const TAPE_DRIVE_REWIND_IMMEDIATE: DWORD = 0x80000008;
pub const TAPE_DRIVE_SET_BLOCK_SIZE: DWORD = 0x80000010;
pub const TAPE_DRIVE_LOAD_UNLD_IMMED: DWORD = 0x80000020;
pub const TAPE_DRIVE_TENSION_IMMED: DWORD = 0x80000040;
pub const TAPE_DRIVE_LOCK_UNLK_IMMED: DWORD = 0x80000080;
pub const TAPE_DRIVE_SET_ECC: DWORD = 0x80000100;
pub const TAPE_DRIVE_SET_COMPRESSION: DWORD = 0x80000200;
pub const TAPE_DRIVE_SET_PADDING: DWORD = 0x80000400;
pub const TAPE_DRIVE_SET_REPORT_SMKS: DWORD = 0x80000800;
pub const TAPE_DRIVE_ABSOLUTE_BLK: DWORD = 0x80001000;
pub const TAPE_DRIVE_ABS_BLK_IMMED: DWORD = 0x80002000;
pub const TAPE_DRIVE_LOGICAL_BLK: DWORD = 0x80004000;
pub const TAPE_DRIVE_LOG_BLK_IMMED: DWORD = 0x80008000;
pub const TAPE_DRIVE_END_OF_DATA: DWORD = 0x80010000;
pub const TAPE_DRIVE_RELATIVE_BLKS: DWORD = 0x80020000;
pub const TAPE_DRIVE_FILEMARKS: DWORD = 0x80040000;
pub const TAPE_DRIVE_SEQUENTIAL_FMKS: DWORD = 0x80080000;
pub const TAPE_DRIVE_SETMARKS: DWORD = 0x80100000;
pub const TAPE_DRIVE_SEQUENTIAL_SMKS: DWORD = 0x80200000;
pub const TAPE_DRIVE_REVERSE_POSITION: DWORD = 0x80400000;
pub const TAPE_DRIVE_SPACE_IMMEDIATE: DWORD = 0x80800000;
pub const TAPE_DRIVE_WRITE_SETMARKS: DWORD = 0x81000000;
pub const TAPE_DRIVE_WRITE_FILEMARKS: DWORD = 0x82000000;
pub const TAPE_DRIVE_WRITE_SHORT_FMKS: DWORD = 0x84000000;
pub const TAPE_DRIVE_WRITE_LONG_FMKS: DWORD = 0x88000000;
pub const TAPE_DRIVE_WRITE_MARK_IMMED: DWORD = 0x90000000;
pub const TAPE_DRIVE_FORMAT: DWORD = 0xA0000000;
pub const TAPE_DRIVE_FORMAT_IMMEDIATE: DWORD = 0xC0000000;
pub const TAPE_DRIVE_HIGH_FEATURES: DWORD = 0x80000000;
STRUCT!{struct TAPE_GET_DRIVE_PARAMETERS {
    ECC: BOOLEAN,
    Compression: BOOLEAN,
    DataPadding: BOOLEAN,
    ReportSetmarks: BOOLEAN,
    DefaultBlockSize: DWORD,
    MaximumBlockSize: DWORD,
    MinimumBlockSize: DWORD,
    MaximumPartitionCount: DWORD,
    FeaturesLow: DWORD,
    FeaturesHigh: DWORD,
    EOTWarningZoneSize: DWORD,
}}
pub type PTAPE_GET_DRIVE_PARAMETERS = *mut TAPE_GET_DRIVE_PARAMETERS;
STRUCT!{struct TAPE_SET_DRIVE_PARAMETERS {
    ECC: BOOLEAN,
    Compression: BOOLEAN,
    DataPadding: BOOLEAN,
    ReportSetmarks: BOOLEAN,
    EOTWarningZoneSize: DWORD,
}}
pub type PTAPE_SET_DRIVE_PARAMETERS = *mut TAPE_SET_DRIVE_PARAMETERS;
STRUCT!{struct TAPE_GET_MEDIA_PARAMETERS {
    Capacity: LARGE_INTEGER,
    Remaining: LARGE_INTEGER,
    BlockSize: DWORD,
    PartitionCount: DWORD,
    WriteProtected: BOOLEAN,
}}
pub type PTAPE_GET_MEDIA_PARAMETERS = *mut TAPE_GET_MEDIA_PARAMETERS;
STRUCT!{struct TAPE_SET_MEDIA_PARAMETERS {
    BlockSize: DWORD,
}}
pub type PTAPE_SET_MEDIA_PARAMETERS = *mut TAPE_SET_MEDIA_PARAMETERS;
pub const TAPE_FIXED_PARTITIONS: DWORD = 0;
pub const TAPE_SELECT_PARTITIONS: DWORD = 1;
pub const TAPE_INITIATOR_PARTITIONS: DWORD = 2;
STRUCT!{struct TAPE_CREATE_PARTITION {
    Method: DWORD,
    Count: DWORD,
    Size: DWORD,
}}
pub type PTAPE_CREATE_PARTITION = *mut TAPE_CREATE_PARTITION;
pub const TAPE_QUERY_DRIVE_PARAMETERS: DWORD = 0;
pub const TAPE_QUERY_MEDIA_CAPACITY: DWORD = 1;
pub const TAPE_CHECK_FOR_DRIVE_PROBLEM: DWORD = 2;
pub const TAPE_QUERY_IO_ERROR_DATA: DWORD = 3;
pub const TAPE_QUERY_DEVICE_ERROR_DATA: DWORD = 4;
STRUCT!{struct TAPE_WMI_OPERATIONS {
    Method: DWORD,
    DataBufferSize: DWORD,
    DataBuffer: PVOID,
}}
pub type PTAPE_WMI_OPERATIONS = *mut TAPE_WMI_OPERATIONS;
ENUM!{enum TAPE_DRIVE_PROBLEM_TYPE {
    TapeDriveProblemNone,
    TapeDriveReadWriteWarning,
    TapeDriveReadWriteError,
    TapeDriveReadWarning,
    TapeDriveWriteWarning,
    TapeDriveReadError,
    TapeDriveWriteError,
    TapeDriveHardwareError,
    TapeDriveUnsupportedMedia,
    TapeDriveScsiConnectionError,
    TapeDriveTimetoClean,
    TapeDriveCleanDriveNow,
    TapeDriveMediaLifeExpired,
    TapeDriveSnappedTape,
}}
pub const TRANSACTIONMANAGER_QUERY_INFORMATION: DWORD = 0x0001;
pub const TRANSACTIONMANAGER_SET_INFORMATION: DWORD = 0x0002;
pub const TRANSACTIONMANAGER_RECOVER: DWORD = 0x0004;
pub const TRANSACTIONMANAGER_RENAME: DWORD = 0x0008;
pub const TRANSACTIONMANAGER_CREATE_RM: DWORD = 0x0010;
pub const TRANSACTIONMANAGER_BIND_TRANSACTION: DWORD = 0x0020;
pub const TRANSACTIONMANAGER_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ
    | TRANSACTIONMANAGER_QUERY_INFORMATION;
pub const TRANSACTIONMANAGER_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE
    | TRANSACTIONMANAGER_SET_INFORMATION | TRANSACTIONMANAGER_RECOVER | TRANSACTIONMANAGER_RENAME
    | TRANSACTIONMANAGER_CREATE_RM;
pub const TRANSACTIONMANAGER_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE;
pub const TRANSACTIONMANAGER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED
    | TRANSACTIONMANAGER_GENERIC_READ | TRANSACTIONMANAGER_GENERIC_WRITE
    | TRANSACTIONMANAGER_GENERIC_EXECUTE | TRANSACTIONMANAGER_BIND_TRANSACTION;
pub const TRANSACTION_QUERY_INFORMATION: DWORD = 0x0001;
pub const TRANSACTION_SET_INFORMATION: DWORD = 0x0002;
pub const TRANSACTION_ENLIST: DWORD = 0x0004;
pub const TRANSACTION_COMMIT: DWORD = 0x0008;
pub const TRANSACTION_ROLLBACK: DWORD = 0x0010;
pub const TRANSACTION_PROPAGATE: DWORD = 0x0020;
pub const TRANSACTION_RIGHT_RESERVED1: DWORD = 0x0040;
pub const TRANSACTION_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | TRANSACTION_QUERY_INFORMATION
    | SYNCHRONIZE;
pub const TRANSACTION_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION
    | TRANSACTION_COMMIT | TRANSACTION_ENLIST | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE
    | SYNCHRONIZE;
pub const TRANSACTION_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | TRANSACTION_COMMIT
    | TRANSACTION_ROLLBACK | SYNCHRONIZE;
pub const TRANSACTION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | TRANSACTION_GENERIC_READ
    | TRANSACTION_GENERIC_WRITE | TRANSACTION_GENERIC_EXECUTE;
pub const TRANSACTION_RESOURCE_MANAGER_RIGHTS: DWORD = TRANSACTION_GENERIC_READ
    | STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION | TRANSACTION_ENLIST
    | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE | SYNCHRONIZE;
pub const RESOURCEMANAGER_QUERY_INFORMATION: DWORD = 0x0001;
pub const RESOURCEMANAGER_SET_INFORMATION: DWORD = 0x0002;
pub const RESOURCEMANAGER_RECOVER: DWORD = 0x0004;
pub const RESOURCEMANAGER_ENLIST: DWORD = 0x0008;
pub const RESOURCEMANAGER_GET_NOTIFICATION: DWORD = 0x0010;
pub const RESOURCEMANAGER_REGISTER_PROTOCOL: DWORD = 0x0020;
pub const RESOURCEMANAGER_COMPLETE_PROPAGATION: DWORD = 0x0040;
pub const RESOURCEMANAGER_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ
    | RESOURCEMANAGER_QUERY_INFORMATION | SYNCHRONIZE;
pub const RESOURCEMANAGER_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE
    | RESOURCEMANAGER_SET_INFORMATION | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST
    | RESOURCEMANAGER_GET_NOTIFICATION | RESOURCEMANAGER_REGISTER_PROTOCOL
    | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE;
pub const RESOURCEMANAGER_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE
    | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST | RESOURCEMANAGER_GET_NOTIFICATION
    | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE;
pub const RESOURCEMANAGER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED
    | RESOURCEMANAGER_GENERIC_READ | RESOURCEMANAGER_GENERIC_WRITE
    | RESOURCEMANAGER_GENERIC_EXECUTE;
pub const ENLISTMENT_QUERY_INFORMATION: DWORD = 0x0001;
pub const ENLISTMENT_SET_INFORMATION: DWORD = 0x0002;
pub const ENLISTMENT_RECOVER: DWORD = 0x0004;
pub const ENLISTMENT_SUBORDINATE_RIGHTS: DWORD = 0x0008;
pub const ENLISTMENT_SUPERIOR_RIGHTS: DWORD = 0x0010;
pub const ENLISTMENT_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | ENLISTMENT_QUERY_INFORMATION;
pub const ENLISTMENT_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | ENLISTMENT_SET_INFORMATION
    | ENLISTMENT_RECOVER | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS;
pub const ENLISTMENT_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | ENLISTMENT_RECOVER
    | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS;
pub const ENLISTMENT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | ENLISTMENT_GENERIC_READ
    | ENLISTMENT_GENERIC_WRITE | ENLISTMENT_GENERIC_EXECUTE;
ENUM!{enum TRANSACTION_OUTCOME {
    TransactionOutcomeUndetermined = 1,
    TransactionOutcomeCommitted,
    TransactionOutcomeAborted,
}}
ENUM!{enum TRANSACTION_STATE {
    TransactionStateNormal = 1,
    TransactionStateIndoubt,
    TransactionStateCommittedNotify,
}}
STRUCT!{struct TRANSACTION_BASIC_INFORMATION {
    TransactionId: GUID,
    State: DWORD,
    Outcome: DWORD,
}}
pub type PTRANSACTION_BASIC_INFORMATION = *mut TRANSACTION_BASIC_INFORMATION;
STRUCT!{struct TRANSACTIONMANAGER_BASIC_INFORMATION {
    TmIdentity: GUID,
    VirtualClock: LARGE_INTEGER,
}}
pub type PTRANSACTIONMANAGER_BASIC_INFORMATION = *mut TRANSACTIONMANAGER_BASIC_INFORMATION;
STRUCT!{struct TRANSACTIONMANAGER_LOG_INFORMATION {
    LogIdentity: GUID,
}}
pub type PTRANSACTIONMANAGER_LOG_INFORMATION = *mut TRANSACTIONMANAGER_LOG_INFORMATION;
STRUCT!{struct TRANSACTIONMANAGER_LOGPATH_INFORMATION {
    LogPathLength: DWORD,
    LogPath: [WCHAR; 1],
}}
pub type PTRANSACTIONMANAGER_LOGPATH_INFORMATION = *mut TRANSACTIONMANAGER_LOGPATH_INFORMATION;
STRUCT!{struct TRANSACTIONMANAGER_RECOVERY_INFORMATION {
    LastRecoveredLsn: ULONGLONG,
}}
pub type PTRANSACTIONMANAGER_RECOVERY_INFORMATION = *mut TRANSACTIONMANAGER_RECOVERY_INFORMATION;
STRUCT!{struct TRANSACTIONMANAGER_OLDEST_INFORMATION {
    OldestTransactionGuid: GUID,
}}
pub type PTRANSACTIONMANAGER_OLDEST_INFORMATION = *mut TRANSACTIONMANAGER_OLDEST_INFORMATION;
STRUCT!{struct TRANSACTION_PROPERTIES_INFORMATION {
    IsolationLevel: DWORD,
    IsolationFlags: DWORD,
    Timeout: LARGE_INTEGER,
    Outcome: DWORD,
    DescriptionLength: DWORD,
    Description: [WCHAR; 1],
}}
pub type PTRANSACTION_PROPERTIES_INFORMATION = *mut TRANSACTION_PROPERTIES_INFORMATION;
STRUCT!{struct TRANSACTION_BIND_INFORMATION {
    TmHandle: HANDLE,
}}
pub type PTRANSACTION_BIND_INFORMATION = *mut TRANSACTION_BIND_INFORMATION;
STRUCT!{struct TRANSACTION_ENLISTMENT_PAIR {
    EnlistmentId: GUID,
    ResourceManagerId: GUID,
}}
pub type PTRANSACTION_ENLISTMENT_PAIR = *mut TRANSACTION_ENLISTMENT_PAIR;
STRUCT!{struct TRANSACTION_ENLISTMENTS_INFORMATION {
    NumberOfEnlistments: DWORD,
    EnlistmentPair: [TRANSACTION_ENLISTMENT_PAIR; 1],
}}
pub type PTRANSACTION_ENLISTMENTS_INFORMATION = *mut TRANSACTION_ENLISTMENTS_INFORMATION;
STRUCT!{struct TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION {
    SuperiorEnlistmentPair: TRANSACTION_ENLISTMENT_PAIR,
}}
pub type PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION
    = *mut TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION;
STRUCT!{struct RESOURCEMANAGER_BASIC_INFORMATION {
    ResourceManagerId: GUID,
    DescriptionLength: DWORD,
    Description: [WCHAR; 1],
}}
pub type PRESOURCEMANAGER_BASIC_INFORMATION = *mut RESOURCEMANAGER_BASIC_INFORMATION;
STRUCT!{struct RESOURCEMANAGER_COMPLETION_INFORMATION {
    IoCompletionPortHandle: HANDLE,
    CompletionKey: ULONG_PTR,
}}
pub type PRESOURCEMANAGER_COMPLETION_INFORMATION = *mut RESOURCEMANAGER_COMPLETION_INFORMATION;
ENUM!{enum TRANSACTION_INFORMATION_CLASS {
    TransactionBasicInformation,
    TransactionPropertiesInformation,
    TransactionEnlistmentInformation,
    TransactionSuperiorEnlistmentInformation,
    TransactionBindInformation,
    TransactionDTCPrivateInformation,
}}
ENUM!{enum TRANSACTIONMANAGER_INFORMATION_CLASS {
    TransactionManagerBasicInformation,
    TransactionManagerLogInformation,
    TransactionManagerLogPathInformation,
    TransactionManagerRecoveryInformation = 4,
    TransactionManagerOnlineProbeInformation = 3,
    TransactionManagerOldestTransactionInformation = 5,
}}
ENUM!{enum RESOURCEMANAGER_INFORMATION_CLASS {
    ResourceManagerBasicInformation,
    ResourceManagerCompletionInformation,
}}
STRUCT!{struct ENLISTMENT_BASIC_INFORMATION {
    EnlistmentId: GUID,
    TransactionId: GUID,
    ResourceManagerId: GUID,
}}
pub type PENLISTMENT_BASIC_INFORMATION = *mut ENLISTMENT_BASIC_INFORMATION;
STRUCT!{struct ENLISTMENT_CRM_INFORMATION {
    CrmTransactionManagerId: GUID,
    CrmResourceManagerId: GUID,
    CrmEnlistmentId: GUID,
}}
pub type PENLISTMENT_CRM_INFORMATION = *mut ENLISTMENT_CRM_INFORMATION;
ENUM!{enum ENLISTMENT_INFORMATION_CLASS {
    EnlistmentBasicInformation,
    EnlistmentRecoveryInformation,
    EnlistmentCrmInformation,
}}
STRUCT!{struct TRANSACTION_LIST_ENTRY {
    UOW: UOW,
}}
pub type PTRANSACTION_LIST_ENTRY = *mut TRANSACTION_LIST_ENTRY;
STRUCT!{struct TRANSACTION_LIST_INFORMATION {
    NumberOfTransactions: DWORD,
    TransactionInformation: [TRANSACTION_LIST_ENTRY; 1],
}}
pub type PTRANSACTION_LIST_INFORMATION = *mut TRANSACTION_LIST_INFORMATION;
ENUM!{enum KTMOBJECT_TYPE {
    KTMOBJECT_TRANSACTION,
    KTMOBJECT_TRANSACTION_MANAGER,
    KTMOBJECT_RESOURCE_MANAGER,
    KTMOBJECT_ENLISTMENT,
    KTMOBJECT_INVALID,
}}
pub type PKTMOBJECT_TYPE = *mut KTMOBJECT_TYPE;
STRUCT!{struct KTMOBJECT_CURSOR {
    LastQuery: GUID,
    ObjectIdCount: DWORD,
    ObjectIds: [GUID; 1],
}}
pub type PKTMOBJECT_CURSOR = *mut KTMOBJECT_CURSOR;
pub type TP_VERSION = DWORD;
pub type PTP_VERSION = *mut DWORD;
STRUCT!{struct TP_CALLBACK_INSTANCE {
    dummy: *mut c_void,
}}
pub type PTP_CALLBACK_INSTANCE = *mut TP_CALLBACK_INSTANCE;
FN!{stdcall PTP_SIMPLE_CALLBACK(
    Instance: PTP_CALLBACK_INSTANCE,
    Context: PVOID,
) -> ()}
STRUCT!{struct TP_POOL {
    dummy: *mut c_void,
}}
pub type PTP_POOL = *mut TP_POOL;
ENUM!{enum TP_CALLBACK_PRIORITY {
    TP_CALLBACK_PRIORITY_HIGH,
    TP_CALLBACK_PRIORITY_NORMAL,
    TP_CALLBACK_PRIORITY_LOW,
    TP_CALLBACK_PRIORITY_INVALID,
    TP_CALLBACK_PRIORITY_COUNT = TP_CALLBACK_PRIORITY_INVALID,
}}
STRUCT!{struct TP_POOL_STACK_INFORMATION {
    StackReserve: SIZE_T,
    StackCommit: SIZE_T,
}}
pub type PTP_POOL_STACK_INFORMATION = *mut TP_POOL_STACK_INFORMATION;
STRUCT!{struct TP_CLEANUP_GROUP {
    dummy: *mut c_void,
}}
pub type PTP_CLEANUP_GROUP = *mut TP_CLEANUP_GROUP;
FN!{stdcall PTP_CLEANUP_GROUP_CANCEL_CALLBACK(
    ObjectContext: PVOID,
    CleanupContext: PVOID,
) -> ()}
STRUCT!{struct TP_CALLBACK_ENVIRON_V3_u_s {
    BitFields: DWORD,
}}
BITFIELD!{TP_CALLBACK_ENVIRON_V3_u_s BitFields: DWORD [
    LongFunction set_LongFunction[0..1],
    Persistent set_Persistent[1..2],
    Private set_Private[2..32],
]}
UNION!{union TP_CALLBACK_ENVIRON_V3_u {
    [u32; 1],
    Flags Flags_mut: DWORD,
    s s_mut: TP_CALLBACK_ENVIRON_V3_u_s,
}}
STRUCT!{struct TP_CALLBACK_ENVIRON_V3 {
    Version: TP_VERSION,
    Pool: PTP_POOL,
    CleanupGroup: PTP_CLEANUP_GROUP,
    CleanupGroupCancelCallback: PTP_CLEANUP_GROUP_CANCEL_CALLBACK,
    RaceDll: PVOID,
    ActivationContext: *mut ACTIVATION_CONTEXT,
    FinalizationCallback: PTP_SIMPLE_CALLBACK,
    u: TP_CALLBACK_ENVIRON_V3_u,
    CallbackPriority: TP_CALLBACK_PRIORITY,
    Size: DWORD,
}}
pub type TP_CALLBACK_ENVIRON = TP_CALLBACK_ENVIRON_V3;
pub type PTP_CALLBACK_ENVIRON = *mut TP_CALLBACK_ENVIRON_V3;
STRUCT!{struct TP_WORK {
    dummy: *mut c_void,
}}
pub type PTP_WORK = *mut TP_WORK;
FN!{stdcall PTP_WORK_CALLBACK(
    Instance: PTP_CALLBACK_INSTANCE,
    Context: PVOID,
    Work: PTP_WORK,
) -> ()}
STRUCT!{struct TP_TIMER {
    dummy: *mut c_void,
}}
pub type PTP_TIMER = *mut TP_TIMER;
FN!{stdcall PTP_TIMER_CALLBACK(
    Instance: PTP_CALLBACK_INSTANCE,
    Context: PVOID,
    Timer: PTP_TIMER,
) -> ()}
pub type TP_WAIT_RESULT = DWORD;
STRUCT!{struct TP_WAIT {
    dummy: *mut c_void,
}}
pub type PTP_WAIT = *mut TP_WAIT;
FN!{stdcall PTP_WAIT_CALLBACK(
    Instance: PTP_CALLBACK_INSTANCE,
    Context: PVOID,
    Wait: PTP_WAIT,
    WaitResult: TP_WAIT_RESULT,
) -> ()}
STRUCT!{struct TP_IO {
    dummy: *mut c_void,
}}
pub type PTP_IO = *mut TP_IO;
pub const ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION: ULONG = 1;
pub const ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION: ULONG = 2;
pub const ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION: ULONG = 3;
pub const ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION: ULONG = 4;
pub const ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION: ULONG = 5;
pub const ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION: ULONG = 6;
pub const ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION: ULONG = 7;
pub const ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE: ULONG = 8;
pub const ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES: ULONG = 9;
pub const ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS: ULONG = 10;
pub const ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO: ULONG = 11;
STRUCT!{struct ACTIVATION_CONTEXT {
    dummy: *mut c_void,
}}