lisette-stdlib 0.2.2

Little language inspired by Rust that compiles to Go
Documentation
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
// Generated by Lisette bindgen
// Source: syscall (Go stdlib)
// Go: 1.25.10
// Lisette: 0.2.1

import "go:sync"

pub enum Errno: uintptr {
  E2BIG = 536870912,
  EACCES = 536870913,
  EADDRINUSE = 536870914,
  EADDRNOTAVAIL = 536870915,
  EADV = 536870916,
  EAFNOSUPPORT = 536870917,
  EAGAIN = 536870918,
  EALREADY = 536870919,
  EBADE = 536870920,
  EBADF = 536870921,
  EBADFD = 536870922,
  EBADMSG = 536870923,
  EBADR = 536870924,
  EBADRQC = 536870925,
  EBADSLT = 536870926,
  EBFONT = 536870927,
  EBUSY = 536870928,
  ECANCELED = 536870929,
  ECHILD = 536870930,
  ECHRNG = 536870931,
  ECOMM = 536870932,
  ECONNABORTED = 536870933,
  ECONNREFUSED = 536870934,
  ECONNRESET = 536870935,
  EDEADLK = 536870936,
  EDEADLOCK = 536870937,
  EDESTADDRREQ = 536870938,
  EDOM = 536870939,
  EDOTDOT = 536870940,
  EDQUOT = 536870941,
  EEXIST = 536870942,
  EFAULT = 536870943,
  EFBIG = 536870944,
  EHOSTDOWN = 536870945,
  EHOSTUNREACH = 536870946,
  EIDRM = 536870947,
  EILSEQ = 536870948,
  EINPROGRESS = 536870949,
  EINTR = 536870950,
  EINVAL = 536870951,
  EIO = 536870952,
  EISCONN = 536870953,
  EISDIR = 536870954,
  EISNAM = 536870955,
  EKEYEXPIRED = 536870956,
  EKEYREJECTED = 536870957,
  EKEYREVOKED = 536870958,
  EL2HLT = 536870959,
  EL2NSYNC = 536870960,
  EL3HLT = 536870961,
  EL3RST = 536870962,
  ELIBACC = 536870963,
  ELIBBAD = 536870964,
  ELIBEXEC = 536870965,
  ELIBMAX = 536870966,
  ELIBSCN = 536870967,
  ELNRNG = 536870968,
  ELOOP = 536870969,
  EMEDIUMTYPE = 536870970,
  EMFILE = 536870971,
  EMLINK = 536870972,
  EMSGSIZE = 536870973,
  EMULTIHOP = 536870974,
  ENAMETOOLONG = 536870975,
  ENAVAIL = 536870976,
  ENETDOWN = 536870977,
  ENETRESET = 536870978,
  ENETUNREACH = 536870979,
  ENFILE = 536870980,
  ENOANO = 536870981,
  ENOBUFS = 536870982,
  ENOCSI = 536870983,
  ENODATA = 536870984,
  ENODEV = 536870985,
  ENOENT = 2,
  ENOEXEC = 536870986,
  ENOKEY = 536870987,
  ENOLCK = 536870988,
  ENOLINK = 536870989,
  ENOMEDIUM = 536870990,
  ENOMEM = 536870991,
  ENOMSG = 536870992,
  ENONET = 536870993,
  ENOPKG = 536870994,
  ENOPROTOOPT = 536870995,
  ENOSPC = 536870996,
  ENOSR = 536870997,
  ENOSTR = 536870998,
  ENOSYS = 536870999,
  ENOTBLK = 536871000,
  ENOTCONN = 536871001,
  ENOTDIR = 3,
  ENOTEMPTY = 536871002,
  ENOTNAM = 536871003,
  ENOTRECOVERABLE = 536871004,
  ENOTSOCK = 536871005,
  ENOTSUP = 536871006,
  ENOTTY = 536871007,
  ENOTUNIQ = 536871008,
  ENXIO = 536871009,
  EOPNOTSUPP = 536871010,
  EOVERFLOW = 536871011,
  EOWNERDEAD = 536871012,
  EPERM = 536871013,
  EPFNOSUPPORT = 536871014,
  EPIPE = 536871015,
  EPROTO = 536871016,
  EPROTONOSUPPORT = 536871017,
  EPROTOTYPE = 536871018,
  ERANGE = 536871019,
  EREMCHG = 536871020,
  EREMOTE = 536871021,
  EREMOTEIO = 536871022,
  ERESTART = 536871023,
  EROFS = 536871024,
  ERROR_ACCESS_DENIED = 5,
  ERROR_ALREADY_EXISTS = 183,
  ERROR_BROKEN_PIPE = 109,
  ERROR_BUFFER_OVERFLOW = 111,
  ERROR_DIR_NOT_EMPTY = 145,
  ERROR_ENVVAR_NOT_FOUND = 203,
  ERROR_FILE_EXISTS = 80,
  ERROR_FILE_NOT_FOUND = 2,
  ERROR_HANDLE_EOF = 38,
  ERROR_INSUFFICIENT_BUFFER = 122,
  ERROR_IO_PENDING = 997,
  ERROR_MOD_NOT_FOUND = 126,
  ERROR_MORE_DATA = 234,
  ERROR_NETNAME_DELETED = 64,
  ERROR_NOT_FOUND = 1168,
  ERROR_NO_MORE_FILES = 18,
  ERROR_OPERATION_ABORTED = 995,
  ERROR_PATH_NOT_FOUND = 3,
  ERROR_PRIVILEGE_NOT_HELD = 1314,
  ERROR_PROC_NOT_FOUND = 127,
  ESHUTDOWN = 536871025,
  ESOCKTNOSUPPORT = 536871026,
  ESPIPE = 536871027,
  ESRCH = 536871028,
  ESRMNT = 536871029,
  ESTALE = 536871030,
  ESTRPIPE = 536871031,
  ETIME = 536871032,
  ETIMEDOUT = 536871033,
  ETOOMANYREFS = 536871034,
  ETXTBSY = 536871035,
  EUCLEAN = 536871036,
  EUNATCH = 536871037,
  EUSERS = 536871038,
  EWINDOWS = 536871042,
  EWOULDBLOCK = 536871039,
  EXDEV = 536871040,
  EXFULL = 536871041,
  WSAEACCES = 10013,
  WSAECONNABORTED = 10053,
  WSAECONNRESET = 10054,
  WSAENOPROTOOPT = 10042,
}

pub const E2BIG: Errno = 536870912

pub const EACCES: Errno = 536870913

pub const EADDRINUSE: Errno = 536870914

pub const EADDRNOTAVAIL: Errno = 536870915

pub const EADV: Errno = 536870916

pub const EAFNOSUPPORT: Errno = 536870917

pub const EAGAIN: Errno = 536870918

pub const EALREADY: Errno = 536870919

pub const EBADE: Errno = 536870920

pub const EBADF: Errno = 536870921

pub const EBADFD: Errno = 536870922

pub const EBADMSG: Errno = 536870923

pub const EBADR: Errno = 536870924

pub const EBADRQC: Errno = 536870925

pub const EBADSLT: Errno = 536870926

pub const EBFONT: Errno = 536870927

pub const EBUSY: Errno = 536870928

pub const ECANCELED: Errno = 536870929

pub const ECHILD: Errno = 536870930

pub const ECHRNG: Errno = 536870931

pub const ECOMM: Errno = 536870932

pub const ECONNABORTED: Errno = 536870933

pub const ECONNREFUSED: Errno = 536870934

pub const ECONNRESET: Errno = 536870935

pub const EDEADLK: Errno = 536870936

pub const EDEADLOCK: Errno = 536870937

pub const EDESTADDRREQ: Errno = 536870938

pub const EDOM: Errno = 536870939

pub const EDOTDOT: Errno = 536870940

pub const EDQUOT: Errno = 536870941

pub const EEXIST: Errno = 536870942

pub const EFAULT: Errno = 536870943

pub const EFBIG: Errno = 536870944

pub const EHOSTDOWN: Errno = 536870945

pub const EHOSTUNREACH: Errno = 536870946

pub const EIDRM: Errno = 536870947

pub const EILSEQ: Errno = 536870948

pub const EINPROGRESS: Errno = 536870949

pub const EINTR: Errno = 536870950

pub const EINVAL: Errno = 536870951

pub const EIO: Errno = 536870952

pub const EISCONN: Errno = 536870953

pub const EISDIR: Errno = 536870954

pub const EISNAM: Errno = 536870955

pub const EKEYEXPIRED: Errno = 536870956

pub const EKEYREJECTED: Errno = 536870957

pub const EKEYREVOKED: Errno = 536870958

pub const EL2HLT: Errno = 536870959

pub const EL2NSYNC: Errno = 536870960

pub const EL3HLT: Errno = 536870961

pub const EL3RST: Errno = 536870962

pub const ELIBACC: Errno = 536870963

pub const ELIBBAD: Errno = 536870964

pub const ELIBEXEC: Errno = 536870965

pub const ELIBMAX: Errno = 536870966

pub const ELIBSCN: Errno = 536870967

pub const ELNRNG: Errno = 536870968

pub const ELOOP: Errno = 536870969

pub const EMEDIUMTYPE: Errno = 536870970

pub const EMFILE: Errno = 536870971

pub const EMLINK: Errno = 536870972

pub const EMSGSIZE: Errno = 536870973

pub const EMULTIHOP: Errno = 536870974

pub const ENAMETOOLONG: Errno = 536870975

pub const ENAVAIL: Errno = 536870976

pub const ENETDOWN: Errno = 536870977

pub const ENETRESET: Errno = 536870978

pub const ENETUNREACH: Errno = 536870979

pub const ENFILE: Errno = 536870980

pub const ENOANO: Errno = 536870981

pub const ENOBUFS: Errno = 536870982

pub const ENOCSI: Errno = 536870983

pub const ENODATA: Errno = 536870984

pub const ENODEV: Errno = 536870985

pub const ENOENT: Errno = 2

pub const ENOEXEC: Errno = 536870986

pub const ENOKEY: Errno = 536870987

pub const ENOLCK: Errno = 536870988

pub const ENOLINK: Errno = 536870989

pub const ENOMEDIUM: Errno = 536870990

pub const ENOMEM: Errno = 536870991

pub const ENOMSG: Errno = 536870992

pub const ENONET: Errno = 536870993

pub const ENOPKG: Errno = 536870994

pub const ENOPROTOOPT: Errno = 536870995

pub const ENOSPC: Errno = 536870996

pub const ENOSR: Errno = 536870997

pub const ENOSTR: Errno = 536870998

pub const ENOSYS: Errno = 536870999

pub const ENOTBLK: Errno = 536871000

pub const ENOTCONN: Errno = 536871001

pub const ENOTDIR: Errno = 3

pub const ENOTEMPTY: Errno = 536871002

pub const ENOTNAM: Errno = 536871003

pub const ENOTRECOVERABLE: Errno = 536871004

pub const ENOTSOCK: Errno = 536871005

pub const ENOTSUP: Errno = 536871006

pub const ENOTTY: Errno = 536871007

pub const ENOTUNIQ: Errno = 536871008

pub const ENXIO: Errno = 536871009

pub const EOPNOTSUPP: Errno = 536871010

pub const EOVERFLOW: Errno = 536871011

pub const EOWNERDEAD: Errno = 536871012

pub const EPERM: Errno = 536871013

pub const EPFNOSUPPORT: Errno = 536871014

pub const EPIPE: Errno = 536871015

pub const EPROTO: Errno = 536871016

pub const EPROTONOSUPPORT: Errno = 536871017

pub const EPROTOTYPE: Errno = 536871018

pub const ERANGE: Errno = 536871019

pub const EREMCHG: Errno = 536871020

pub const EREMOTE: Errno = 536871021

pub const EREMOTEIO: Errno = 536871022

pub const ERESTART: Errno = 536871023

pub const EROFS: Errno = 536871024

pub const ERROR_ACCESS_DENIED: Errno = 5

pub const ERROR_ALREADY_EXISTS: Errno = 183

pub const ERROR_BROKEN_PIPE: Errno = 109

pub const ERROR_BUFFER_OVERFLOW: Errno = 111

pub const ERROR_DIR_NOT_EMPTY: Errno = 145

pub const ERROR_ENVVAR_NOT_FOUND: Errno = 203

pub const ERROR_FILE_EXISTS: Errno = 80

pub const ERROR_FILE_NOT_FOUND: Errno = 2

pub const ERROR_HANDLE_EOF: Errno = 38

pub const ERROR_INSUFFICIENT_BUFFER: Errno = 122

pub const ERROR_IO_PENDING: Errno = 997

pub const ERROR_MOD_NOT_FOUND: Errno = 126

pub const ERROR_MORE_DATA: Errno = 234

pub const ERROR_NETNAME_DELETED: Errno = 64

pub const ERROR_NOT_FOUND: Errno = 1168

pub const ERROR_NO_MORE_FILES: Errno = 18

pub const ERROR_OPERATION_ABORTED: Errno = 995

pub const ERROR_PATH_NOT_FOUND: Errno = 3

pub const ERROR_PRIVILEGE_NOT_HELD: Errno = 1314

pub const ERROR_PROC_NOT_FOUND: Errno = 127

pub const ESHUTDOWN: Errno = 536871025

pub const ESOCKTNOSUPPORT: Errno = 536871026

pub const ESPIPE: Errno = 536871027

pub const ESRCH: Errno = 536871028

pub const ESRMNT: Errno = 536871029

pub const ESTALE: Errno = 536871030

pub const ESTRPIPE: Errno = 536871031

pub const ETIME: Errno = 536871032

pub const ETIMEDOUT: Errno = 536871033

pub const ETOOMANYREFS: Errno = 536871034

pub const ETXTBSY: Errno = 536871035

pub const EUCLEAN: Errno = 536871036

pub const EUNATCH: Errno = 536871037

pub const EUSERS: Errno = 536871038

pub const EWINDOWS: Errno = 536871042

pub const EWOULDBLOCK: Errno = 536871039

pub const EXDEV: Errno = 536871040

pub const EXFULL: Errno = 536871041

pub const WSAEACCES: Errno = 10013

pub const WSAECONNABORTED: Errno = 10053

pub const WSAECONNRESET: Errno = 10054

pub const WSAENOPROTOOPT: Errno = 10042

pub enum Signal: int {
  SIGABRT = 6,
  SIGALRM = 14,
  SIGBUS = 7,
  SIGFPE = 8,
  SIGHUP = 1,
  SIGILL = 4,
  SIGINT = 2,
  SIGKILL = 9,
  SIGPIPE = 13,
  SIGQUIT = 3,
  SIGSEGV = 11,
  SIGTERM = 15,
  SIGTRAP = 5,
}

pub const SIGABRT: Signal = 6

pub const SIGALRM: Signal = 14

pub const SIGBUS: Signal = 7

pub const SIGFPE: Signal = 8

pub const SIGHUP: Signal = 1

pub const SIGILL: Signal = 4

pub const SIGINT: Signal = 2

pub const SIGKILL: Signal = 9

pub const SIGPIPE: Signal = 13

pub const SIGQUIT: Signal = 3

pub const SIGSEGV: Signal = 11

pub const SIGTERM: Signal = 15

pub const SIGTRAP: Signal = 5

pub fn Accept(fd: Handle) -> Result<(Handle, Sockaddr), error>

pub fn AcceptEx(
  ls: Handle,
  as_: Handle,
  buf: Ref<byte>,
  rxdatalen: uint32,
  laddrlen: uint32,
  raddrlen: uint32,
  recvd: Ref<uint32>,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

pub fn Bind(fd: Handle, sa: Sockaddr) -> Result<(), error>

/// BytePtrFromString returns a pointer to a NUL-terminated array of
/// bytes containing the text of s. If s contains a NUL byte at any
/// location, it returns (nil, [EINVAL]).
pub fn BytePtrFromString(s: string) -> Result<Ref<byte>, error>

/// ByteSliceFromString returns a NUL-terminated slice of bytes
/// containing the text of s. If s contains a NUL byte at any
/// location, it returns (nil, [EINVAL]).
pub fn ByteSliceFromString(s: string) -> Result<Slice<byte>, error>

pub fn CancelIo(s: Handle) -> Result<(), error>

pub fn CancelIoEx(s: Handle, o: Ref<Overlapped>) -> Result<(), error>

pub fn CertAddCertificateContextToStore(
  store: Handle,
  certContext: Ref<CertContext>,
  addDisposition: uint32,
  storeContext: Ref<Ref<CertContext>>,
) -> Result<(), error>

pub fn CertCloseStore(store: Handle, flags: uint32) -> Result<(), error>

pub fn CertCreateCertificateContext(
  certEncodingType: uint32,
  certEncoded: Ref<byte>,
  encodedLen: uint32,
) -> Result<Ref<CertContext>, error>

pub fn CertEnumCertificatesInStore(store: Handle, prevContext: Ref<CertContext>) -> Result<Ref<CertContext>, error>

pub fn CertFreeCertificateChain(ctx: Ref<CertChainContext>)

pub fn CertFreeCertificateContext(ctx: Ref<CertContext>) -> Result<(), error>

pub fn CertGetCertificateChain(
  engine: Handle,
  leaf: Ref<CertContext>,
  time: Ref<Filetime>,
  additionalStore: Handle,
  para: Ref<CertChainPara>,
  flags: uint32,
  reserved: uint,
  chainCtx: Ref<Ref<CertChainContext>>,
) -> Result<(), error>

pub fn CertOpenStore(
  storeProvider: uint,
  msgAndCertEncodingType: uint32,
  cryptProv: uint,
  flags: uint32,
  para: uint,
) -> Result<Handle, error>

pub fn CertOpenSystemStore(hprov: Handle, name: Ref<uint16>) -> Result<Handle, error>

pub fn CertVerifyCertificateChainPolicy(
  policyOID: uint,
  chain: Ref<CertChainContext>,
  para: Ref<CertChainPolicyPara>,
  status: Ref<CertChainPolicyStatus>,
) -> Result<(), error>

pub fn Chdir(path: string) -> Result<(), error>

pub fn Chmod(path: string, mode: uint32) -> Result<(), error>

pub fn Chown(path: string, uid: int, gid: int) -> Result<(), error>

pub fn Clearenv()

pub fn Close(fd: Handle) -> Result<(), error>

pub fn CloseHandle(handle: Handle) -> Result<(), error>

pub fn CloseOnExec(fd: Handle)

pub fn Closesocket(s: Handle) -> Result<(), error>

pub fn CommandLineToArgv(cmd: Ref<uint16>, argc: Ref<int32>) -> Result<Unknown, error>

pub fn ComputerName() -> Result<string, error>

pub fn Connect(fd: Handle, sa: Sockaddr) -> Result<(), error>

pub fn ConnectEx(
  fd: Handle,
  sa: Sockaddr,
  sendBuf: Ref<byte>,
  sendDataLen: uint32,
  bytesSent: Ref<uint32>,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

pub fn ConvertSidToStringSid(sid: Ref<SID>, stringSid: Ref<Ref<uint16>>) -> Result<(), error>

pub fn ConvertStringSidToSid(stringSid: Ref<uint16>, sid: Ref<Ref<SID>>) -> Result<(), error>

pub fn CopySid(destSidLen: uint32, destSid: Ref<SID>, srcSid: Ref<SID>) -> Result<(), error>

pub fn CreateDirectory(path: Ref<uint16>, sa: Ref<SecurityAttributes>) -> Result<(), error>

pub fn CreateFile(
  name: Ref<uint16>,
  access: uint32,
  mode: uint32,
  sa: Ref<SecurityAttributes>,
  createmode: uint32,
  attrs: uint32,
  templatefile: int32,
) -> Result<Handle, error>

pub fn CreateFileMapping(
  fhandle: Handle,
  sa: Ref<SecurityAttributes>,
  prot: uint32,
  maxSizeHigh: uint32,
  maxSizeLow: uint32,
  name: Ref<uint16>,
) -> Result<Handle, error>

pub fn CreateHardLink(
  filename: Ref<uint16>,
  existingfilename: Ref<uint16>,
  reserved: uint,
) -> Result<(), error>

/// Deprecated: CreateIoCompletionPort has the wrong function signature. Use x/sys/windows.CreateIoCompletionPort.
pub fn CreateIoCompletionPort(
  filehandle: Handle,
  cphandle: Handle,
  key: uint32,
  threadcnt: uint32,
) -> Result<Handle, error>

pub fn CreatePipe(
  readhandle: Ref<Handle>,
  writehandle: Ref<Handle>,
  sa: Ref<SecurityAttributes>,
  size: uint32,
) -> Result<(), error>

pub fn CreateProcess(
  appName: Ref<uint16>,
  commandLine: Ref<uint16>,
  procSecurity: Ref<SecurityAttributes>,
  threadSecurity: Ref<SecurityAttributes>,
  inheritHandles: bool,
  creationFlags: uint32,
  env: Ref<uint16>,
  currentDir: Ref<uint16>,
  startupInfo: Ref<StartupInfo>,
  outProcInfo: Ref<ProcessInformation>,
) -> Result<(), error>

pub fn CreateProcessAsUser(
  token: Token,
  appName: Ref<uint16>,
  commandLine: Ref<uint16>,
  procSecurity: Ref<SecurityAttributes>,
  threadSecurity: Ref<SecurityAttributes>,
  inheritHandles: bool,
  creationFlags: uint32,
  env: Ref<uint16>,
  currentDir: Ref<uint16>,
  startupInfo: Ref<StartupInfo>,
  outProcInfo: Ref<ProcessInformation>,
) -> Result<(), error>

pub fn CreateSymbolicLink(
  symlinkfilename: Ref<uint16>,
  targetfilename: Ref<uint16>,
  flags: uint32,
) -> Result<(), error>

pub fn CreateToolhelp32Snapshot(flags: uint32, processId: uint32) -> Result<Handle, error>

pub fn CryptAcquireContext(
  provhandle: Ref<Handle>,
  container: Ref<uint16>,
  provider: Ref<uint16>,
  provtype: uint32,
  flags: uint32,
) -> Result<(), error>

pub fn CryptGenRandom(provhandle: Handle, buflen: uint32, buf: Ref<byte>) -> Result<(), error>

pub fn CryptReleaseContext(provhandle: Handle, flags: uint32) -> Result<(), error>

pub fn DeleteFile(path: Ref<uint16>) -> Result<(), error>

pub fn DeviceIoControl(
  handle: Handle,
  ioControlCode: uint32,
  inBuffer: Ref<byte>,
  inBufferSize: uint32,
  outBuffer: Ref<byte>,
  outBufferSize: uint32,
  bytesReturned: Ref<uint32>,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

pub fn DnsNameCompare(name1: Ref<uint16>, name2: Ref<uint16>) -> bool

pub fn DnsQuery(
  name: string,
  qtype: uint16,
  options: uint32,
  extra: Ref<byte>,
  qrs: Ref<Ref<DNSRecord>>,
  pr: Ref<byte>,
) -> Result<(), error>

pub fn DnsRecordListFree(rl: Ref<DNSRecord>, freetype: uint32)

pub fn DuplicateHandle(
  hSourceProcessHandle: Handle,
  hSourceHandle: Handle,
  hTargetProcessHandle: Handle,
  lpTargetHandle: Ref<Handle>,
  dwDesiredAccess: uint32,
  bInheritHandle: bool,
  dwOptions: uint32,
) -> Result<(), error>

pub fn Environ() -> Slice<string>

/// EscapeArg rewrites command line argument s as prescribed
/// in https://msdn.microsoft.com/en-us/library/ms880421.
/// This function returns "" (2 double quotes) if s is empty.
/// Alternatively, these transformations are done:
///   - every back slash (\) is doubled, but only if immediately
///     followed by double quote (");
///   - every double quote (") is escaped by back slash (\);
///   - finally, s is wrapped with double quotes (arg -> "arg"),
///     but only if there is space or tab inside s.
pub fn EscapeArg(s: string) -> string

pub fn Exec(argv0: string, argv: Slice<string>, envv: Slice<string>) -> Result<(), error>

pub fn Exit(code: int)

pub fn ExitProcess(exitcode: uint32)

pub fn Fchdir(fd: Handle) -> Result<(), error>

pub fn Fchmod(fd: Handle, mode: uint32) -> Result<(), error>

pub fn Fchown(fd: Handle, uid: int, gid: int) -> Result<(), error>

pub fn FindClose(handle: Handle) -> Result<(), error>

pub fn FindFirstFile(name: Ref<uint16>, data: Ref<Win32finddata>) -> Result<Handle, error>

pub fn FindNextFile(handle: Handle, data: Ref<Win32finddata>) -> Result<(), error>

pub fn FlushFileBuffers(handle: Handle) -> Result<(), error>

pub fn FlushViewOfFile(addr: uint, length: uint) -> Result<(), error>

/// FormatMessage is deprecated (msgsrc should be uintptr, not uint32, but can
/// not be changed due to the Go 1 compatibility guarantee).
/// 
/// Deprecated: Use FormatMessage from golang.org/x/sys/windows instead.
pub fn FormatMessage(
  flags: uint32,
  msgsrc: uint32,
  msgid: uint32,
  langid: uint32,
  buf: Slice<uint16>,
  args: Ref<byte>,
) -> Result<uint32, error>

pub fn FreeAddrInfoW(addrinfo: Ref<AddrinfoW>)

pub fn FreeEnvironmentStrings(envs: Ref<uint16>) -> Result<(), error>

pub fn FreeLibrary(handle: Handle) -> Result<(), error>

pub fn Fsync(fd: Handle) -> Result<(), error>

pub fn Ftruncate(fd: Handle, length: int64) -> Result<(), error>

/// FullPath retrieves the full path of the specified file.
pub fn FullPath(name: string) -> Result<string, error>

pub fn GetAcceptExSockaddrs(
  buf: Ref<byte>,
  rxdatalen: uint32,
  laddrlen: uint32,
  raddrlen: uint32,
  lrsa: Ref<Ref<RawSockaddrAny>>,
  lrsalen: Ref<int32>,
  rrsa: Ref<Ref<RawSockaddrAny>>,
  rrsalen: Ref<int32>,
)

pub fn GetAdaptersInfo(ai: Ref<IpAdapterInfo>, ol: Ref<uint32>) -> Result<(), error>

pub fn GetAddrInfoW(
  nodename: Ref<uint16>,
  servicename: Ref<uint16>,
  hints: Ref<AddrinfoW>,
  result: Ref<Ref<AddrinfoW>>,
) -> Result<(), error>

pub fn GetCommandLine() -> Option<Ref<uint16>>

pub fn GetComputerName(buf: Ref<uint16>, n: Ref<uint32>) -> Result<(), error>

pub fn GetConsoleMode(console: Handle, mode: Ref<uint32>) -> Result<(), error>

pub fn GetCurrentDirectory(buflen: uint32, buf: Ref<uint16>) -> Result<uint32, error>

pub fn GetCurrentProcess() -> Result<Handle, error>

pub fn GetEnvironmentStrings() -> Result<Ref<uint16>, error>

pub fn GetEnvironmentVariable(
  name: Ref<uint16>,
  buffer: Ref<uint16>,
  size: uint32,
) -> Result<uint32, error>

pub fn GetExitCodeProcess(handle: Handle, exitcode: Ref<uint32>) -> Result<(), error>

pub fn GetFileAttributes(name: Ref<uint16>) -> Result<uint32, error>

pub fn GetFileAttributesEx(name: Ref<uint16>, level: uint32, info: Ref<byte>) -> Result<(), error>

pub fn GetFileInformationByHandle(
  handle: Handle,
  data: Ref<ByHandleFileInformation>,
) -> Result<(), error>

pub fn GetFileType(filehandle: Handle) -> Result<uint32, error>

pub fn GetFullPathName(
  path: Ref<uint16>,
  buflen: uint32,
  buf: Ref<uint16>,
  fname: Ref<Ref<uint16>>,
) -> Result<uint32, error>

pub fn GetHostByName(name: string) -> Result<Ref<Hostent>, error>

pub fn GetIfEntry(pIfRow: Ref<MibIfRow>) -> Result<(), error>

pub fn GetLastError() -> Result<(), error>

pub fn GetLengthSid(sid: Ref<SID>) -> uint32

pub fn GetLongPathName(path: Ref<uint16>, buf: Ref<uint16>, buflen: uint32) -> Result<uint32, error>

pub fn GetProcAddress(module: Handle, procname: string) -> Result<uint, error>

pub fn GetProcessTimes(
  handle: Handle,
  creationTime: Ref<Filetime>,
  exitTime: Ref<Filetime>,
  kernelTime: Ref<Filetime>,
  userTime: Ref<Filetime>,
) -> Result<(), error>

pub fn GetProtoByName(name: string) -> Result<Ref<Protoent>, error>

/// Deprecated: GetQueuedCompletionStatus has the wrong function signature. Use x/sys/windows.GetQueuedCompletionStatus.
pub fn GetQueuedCompletionStatus(
  cphandle: Handle,
  qty: Ref<uint32>,
  key: Ref<uint32>,
  overlapped: Ref<Ref<Overlapped>>,
  timeout: uint32,
) -> Result<(), error>

pub fn GetServByName(name: string, proto: string) -> Result<Ref<Servent>, error>

pub fn GetShortPathName(
  longpath: Ref<uint16>,
  shortpath: Ref<uint16>,
  buflen: uint32,
) -> Result<uint32, error>

pub fn GetStartupInfo(startupInfo: Ref<StartupInfo>) -> Result<(), error>

pub fn GetStdHandle(stdhandle: int) -> Result<Handle, error>

pub fn GetSystemTimeAsFileTime(time: Ref<Filetime>)

pub fn GetTempPath(buflen: uint32, buf: Ref<uint16>) -> Result<uint32, error>

pub fn GetTimeZoneInformation(tzi: Ref<Timezoneinformation>) -> Result<uint32, error>

pub fn GetTokenInformation(
  t: Token,
  infoClass: uint32,
  info: Ref<byte>,
  infoLen: uint32,
  returnedLen: Ref<uint32>,
) -> Result<(), error>

pub fn GetUserNameEx(
  nameFormat: uint32,
  nameBuffre: Ref<uint16>,
  nSize: Ref<uint32>,
) -> Result<(), error>

pub fn GetUserProfileDirectory(t: Token, dir: Ref<uint16>, dirLen: Ref<uint32>) -> Result<(), error>

pub fn GetVersion() -> Result<uint32, error>

pub fn Getegid() -> int

pub fn Getenv(key: string) -> Option<string>

pub fn Geteuid() -> int

pub fn Getgid() -> int

pub fn Getgroups() -> Result<Slice<int>, error>

pub fn Getpagesize() -> int

pub fn Getpeername(fd: Handle) -> Result<Sockaddr, error>

pub fn Getpid() -> int

pub fn Getppid() -> int

pub fn Getsockname(fd: Handle) -> Result<Sockaddr, error>

pub fn Getsockopt(
  s: Handle,
  level: int32,
  optname: int32,
  optval: Ref<byte>,
  optlen: Ref<int32>,
) -> Result<(), error>

pub fn GetsockoptInt(fd: Handle, level: int, opt: int) -> Result<int, error>

pub fn Gettimeofday(tv: Ref<Timeval>) -> Result<(), error>

pub fn Getuid() -> int

pub fn Getwd() -> Result<string, error>

pub fn Lchown(path: string, uid: int, gid: int) -> Result<(), error>

/// TODO(brainman): fix all needed for os
pub fn Link(oldpath: string, newpath: string) -> Result<(), error>

pub fn Listen(s: Handle, n: int) -> Result<(), error>

pub fn LoadCancelIoEx() -> Result<(), error>

pub fn LoadConnectEx() -> Result<(), error>

pub fn LoadCreateSymbolicLink() -> Result<(), error>

/// LoadDLL loads the named DLL file into memory.
/// 
/// If name is not an absolute path and is not a known system DLL used by
/// Go, Windows will search for the named DLL in many locations, causing
/// potential DLL preloading attacks.
/// 
/// Use [LazyDLL] in golang.org/x/sys/windows for a secure way to
/// load system DLLs.
pub fn LoadDLL(name: string) -> Result<Ref<DLL>, error>

pub fn LoadGetAddrInfo() -> Result<(), error>

pub fn LoadLibrary(libname: string) -> Result<Handle, error>

pub fn LoadSetFileCompletionNotificationModes() -> Result<(), error>

pub fn LocalFree(hmem: Handle) -> Result<Handle, error>

pub fn LookupAccountName(
  systemName: Ref<uint16>,
  accountName: Ref<uint16>,
  sid: Ref<SID>,
  sidLen: Ref<uint32>,
  refdDomainName: Ref<uint16>,
  refdDomainNameLen: Ref<uint32>,
  use: Ref<uint32>,
) -> Result<(), error>

pub fn LookupAccountSid(
  systemName: Ref<uint16>,
  sid: Ref<SID>,
  name: Ref<uint16>,
  nameLen: Ref<uint32>,
  refdDomainName: Ref<uint16>,
  refdDomainNameLen: Ref<uint32>,
  use: Ref<uint32>,
) -> Result<(), error>

/// LookupSID retrieves a security identifier sid for the account
/// and the name of the domain on which the account was found.
/// System specify target computer to search.
pub fn LookupSID(system: string, account: string) -> Result<(Ref<SID>, string, uint32), error>

pub fn MapViewOfFile(
  handle: Handle,
  access: uint32,
  offsetHigh: uint32,
  offsetLow: uint32,
  length: uint,
) -> Result<uint, error>

pub fn Mkdir(path: string, mode: uint32) -> Result<(), error>

pub fn MoveFile(from: Ref<uint16>, to: Ref<uint16>) -> Result<(), error>

/// MustLoadDLL is like [LoadDLL] but panics if load operation fails.
pub fn MustLoadDLL(name: string) -> Ref<DLL>

pub fn NetApiBufferFree(buf: Ref<byte>) -> Result<(), error>

pub fn NetGetJoinInformation(
  server: Ref<uint16>,
  name: Ref<Ref<uint16>>,
  bufType: Ref<uint32>,
) -> Result<(), error>

pub fn NetUserGetInfo(
  serverName: Ref<uint16>,
  userName: Ref<uint16>,
  level: uint32,
  buf: Ref<Ref<byte>>,
) -> Result<(), error>

/// NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention.
/// This is useful when interoperating with Windows code requiring callbacks.
/// The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr.
/// Only a limited number of callbacks may be created in a single Go process, and any memory allocated
/// for these callbacks is never released.
/// Between NewCallback and NewCallbackCDecl, at least 1024 callbacks can always be created.
pub fn NewCallback(fn_: Unknown) -> uint

/// NewCallbackCDecl converts a Go function to a function pointer conforming to the cdecl calling convention.
/// This is useful when interoperating with Windows code requiring callbacks.
/// The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr.
/// Only a limited number of callbacks may be created in a single Go process, and any memory allocated
/// for these callbacks is never released.
/// Between NewCallback and NewCallbackCDecl, at least 1024 callbacks can always be created.
pub fn NewCallbackCDecl(fn_: Unknown) -> uint

/// NewLazyDLL creates new [LazyDLL] associated with [DLL] file.
pub fn NewLazyDLL(name: string) -> Ref<LazyDLL>

pub fn NsecToFiletime(nsec: int64) -> Filetime

pub fn NsecToTimespec(nsec: int64) -> Timespec

pub fn NsecToTimeval(nsec: int64) -> Timeval

pub fn Ntohs(netshort: uint16) -> uint16

pub fn Open(name: string, flag: int, perm: uint32) -> Result<Handle, error>

/// OpenCurrentProcessToken opens the access token
/// associated with current process.
pub fn OpenCurrentProcessToken() -> Result<Token, error>

pub fn OpenProcess(da: uint32, inheritHandle: bool, pid: uint32) -> Result<Handle, error>

pub fn OpenProcessToken(h: Handle, access: uint32, token: Ref<Token>) -> Result<(), error>

pub fn Pipe(mut p: Slice<Handle>) -> Result<(), error>

/// Deprecated: PostQueuedCompletionStatus has the wrong function signature. Use x/sys/windows.PostQueuedCompletionStatus.
pub fn PostQueuedCompletionStatus(
  cphandle: Handle,
  qty: uint32,
  key: uint32,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

pub fn Process32First(snapshot: Handle, procEntry: Ref<ProcessEntry32>) -> Result<(), error>

pub fn Process32Next(snapshot: Handle, procEntry: Ref<ProcessEntry32>) -> Result<(), error>

pub fn Read(fd: Handle, mut p: Slice<byte>) -> Result<int, error>

pub fn ReadConsole(
  console: Handle,
  buf: Ref<uint16>,
  toread: uint32,
  read: Ref<uint32>,
  inputControl: Ref<byte>,
) -> Result<(), error>

pub fn ReadDirectoryChanges(
  handle: Handle,
  buf: Ref<byte>,
  buflen: uint32,
  watchSubTree: bool,
  mask: uint32,
  retlen: Ref<uint32>,
  overlapped: Ref<Overlapped>,
  completionRoutine: uint,
) -> Result<(), error>

pub fn ReadFile(
  fd: Handle,
  p: Slice<byte>,
  done: Ref<uint32>,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

/// Readlink returns the destination of the named symbolic link.
pub fn Readlink(path: string, mut buf: Slice<byte>) -> Result<int, error>

pub fn Recvfrom(fd: Handle, mut p: Slice<byte>, flags: int) -> Result<(int, Sockaddr), error>

pub fn RegCloseKey(key: Handle) -> Result<(), error>

/// RegEnumKeyEx enumerates the subkeys of an open registry key.
/// Each call retrieves information about one subkey. name is
/// a buffer that should be large enough to hold the name of the
/// subkey plus a null terminating character. nameLen is its
/// length. On return, nameLen will contain the actual length of the
/// subkey.
/// 
/// Should name not be large enough to hold the subkey, this function
/// will return ERROR_MORE_DATA, and must be called again with an
/// appropriately sized buffer.
/// 
/// reserved must be nil. class and classLen behave like name and nameLen
/// but for the class of the subkey, except that they are optional.
/// lastWriteTime, if not nil, will be populated with the time the subkey
/// was last written.
/// 
/// The caller must enumerate all subkeys in order. That is
/// RegEnumKeyEx must be called with index starting at 0, incrementing
/// the index until the function returns ERROR_NO_MORE_ITEMS, or with
/// the index of the last subkey (obtainable from RegQueryInfoKey),
/// decrementing until index 0 is enumerated.
/// 
/// Successive calls to this API must happen on the same OS thread,
/// so call [runtime.LockOSThread] before calling this function.
pub fn RegEnumKeyEx(
  key: Handle,
  index: uint32,
  name: Ref<uint16>,
  nameLen: Ref<uint32>,
  reserved: Ref<uint32>,
  class: Ref<uint16>,
  classLen: Ref<uint32>,
  lastWriteTime: Ref<Filetime>,
) -> Result<(), error>

pub fn RegOpenKeyEx(
  key: Handle,
  subkey: Ref<uint16>,
  options: uint32,
  desiredAccess: uint32,
  result: Ref<Handle>,
) -> Result<(), error>

pub fn RegQueryInfoKey(
  key: Handle,
  class: Ref<uint16>,
  classLen: Ref<uint32>,
  reserved: Ref<uint32>,
  subkeysLen: Ref<uint32>,
  maxSubkeyLen: Ref<uint32>,
  maxClassLen: Ref<uint32>,
  valuesLen: Ref<uint32>,
  maxValueNameLen: Ref<uint32>,
  maxValueLen: Ref<uint32>,
  saLen: Ref<uint32>,
  lastWriteTime: Ref<Filetime>,
) -> Result<(), error>

pub fn RegQueryValueEx(
  key: Handle,
  name: Ref<uint16>,
  reserved: Ref<uint32>,
  valtype: Ref<uint32>,
  buf: Ref<byte>,
  buflen: Ref<uint32>,
) -> Result<(), error>

pub fn RemoveDirectory(path: Ref<uint16>) -> Result<(), error>

pub fn Rename(oldpath: string, newpath: string) -> Result<(), error>

pub fn Rmdir(path: string) -> Result<(), error>

pub fn Seek(fd: Handle, offset: int64, whence: int) -> Result<int64, error>

pub fn Sendto(fd: Handle, p: Slice<byte>, flags: int, to: Sockaddr) -> Result<(), error>

pub fn SetCurrentDirectory(path: Ref<uint16>) -> Result<(), error>

pub fn SetEndOfFile(handle: Handle) -> Result<(), error>

pub fn SetEnvironmentVariable(name: Ref<uint16>, value: Ref<uint16>) -> Result<(), error>

pub fn SetFileAttributes(name: Ref<uint16>, attrs: uint32) -> Result<(), error>

pub fn SetFileCompletionNotificationModes(handle: Handle, flags: uint8) -> Result<(), error>

pub fn SetFilePointer(
  handle: Handle,
  lowoffset: int32,
  highoffsetptr: Ref<int32>,
  whence: uint32,
) -> Result<uint32, error>

pub fn SetFileTime(
  handle: Handle,
  ctime: Ref<Filetime>,
  atime: Ref<Filetime>,
  wtime: Ref<Filetime>,
) -> Result<(), error>

pub fn SetHandleInformation(handle: Handle, mask: uint32, flags: uint32) -> Result<(), error>

pub fn SetNonblock(fd: Handle, nonblocking: bool) -> Result<(), error>

pub fn Setenv(key: string, value: string) -> Result<(), error>

pub fn Setsockopt(
  s: Handle,
  level: int32,
  optname: int32,
  optval: Ref<byte>,
  optlen: int32,
) -> Result<(), error>

pub fn SetsockoptIPMreq(fd: Handle, level: int, opt: int, mreq: Ref<IPMreq>) -> Result<(), error>

pub fn SetsockoptIPv6Mreq(fd: Handle, level: int, opt: int, mreq: Ref<IPv6Mreq>) -> Result<(), error>

// SKIPPED: SetsockoptInet4Addr - array-currently-not-representable
// fixed-size array cannot currently be represented in Lisette

pub fn SetsockoptInt(fd: Handle, level: int, opt: int, value: int) -> Result<(), error>

pub fn SetsockoptLinger(fd: Handle, level: int, opt: int, l: Ref<Linger>) -> Result<(), error>

pub fn SetsockoptTimeval(fd: Handle, level: int, opt: int, tv: Ref<Timeval>) -> Result<(), error>

pub fn Shutdown(fd: Handle, how: int) -> Result<(), error>

pub fn Socket(domain: int, typ: int, proto: int) -> Result<Handle, error>

pub fn StartProcess(argv0: string, argv: Slice<string>, attr: Ref<ProcAttr>) -> Result<(int, uint), error>

/// StringBytePtr returns a pointer to a NUL-terminated array of bytes.
/// If s contains a NUL byte this function panics instead of returning
/// an error.
/// 
/// Deprecated: Use [BytePtrFromString] instead.
pub fn StringBytePtr(s: string) -> Ref<byte>

/// StringByteSlice converts a string to a NUL-terminated []byte,
/// If s contains a NUL byte this function panics instead of
/// returning an error.
/// 
/// Deprecated: Use ByteSliceFromString instead.
pub fn StringByteSlice(s: string) -> Slice<byte>

/// StringToSid converts a string-format security identifier
/// sid into a valid, functional sid.
pub fn StringToSid(s: string) -> Result<Ref<SID>, error>

/// StringToUTF16 returns the UTF-16 encoding of the UTF-8 string s,
/// with a terminating NUL added. If s contains a NUL byte this
/// function panics instead of returning an error.
/// 
/// Deprecated: Use [UTF16FromString] instead.
pub fn StringToUTF16(s: string) -> Slice<uint16>

/// StringToUTF16Ptr returns pointer to the UTF-16 encoding of
/// the UTF-8 string s, with a terminating NUL added. If s
/// contains a NUL byte this function panics instead of
/// returning an error.
/// 
/// Deprecated: Use [UTF16PtrFromString] instead.
pub fn StringToUTF16Ptr(s: string) -> Ref<uint16>

pub fn Symlink(path: string, link: string) -> Result<(), error>

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall(trap: uint, nargs: uint, a1: uint, a2: uint, a3: uint) -> (uint, uint, Errno)

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall12(
  trap: uint,
  nargs: uint,
  a1: uint,
  a2: uint,
  a3: uint,
  a4: uint,
  a5: uint,
  a6: uint,
  a7: uint,
  a8: uint,
  a9: uint,
  a10: uint,
  a11: uint,
  a12: uint,
) -> (uint, uint, Errno)

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall15(
  trap: uint,
  nargs: uint,
  a1: uint,
  a2: uint,
  a3: uint,
  a4: uint,
  a5: uint,
  a6: uint,
  a7: uint,
  a8: uint,
  a9: uint,
  a10: uint,
  a11: uint,
  a12: uint,
  a13: uint,
  a14: uint,
  a15: uint,
) -> (uint, uint, Errno)

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall18(
  trap: uint,
  nargs: uint,
  a1: uint,
  a2: uint,
  a3: uint,
  a4: uint,
  a5: uint,
  a6: uint,
  a7: uint,
  a8: uint,
  a9: uint,
  a10: uint,
  a11: uint,
  a12: uint,
  a13: uint,
  a14: uint,
  a15: uint,
  a16: uint,
  a17: uint,
  a18: uint,
) -> (uint, uint, Errno)

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall6(
  trap: uint,
  nargs: uint,
  a1: uint,
  a2: uint,
  a3: uint,
  a4: uint,
  a5: uint,
  a6: uint,
) -> (uint, uint, Errno)

/// Deprecated: Use [SyscallN] instead.
pub fn Syscall9(
  trap: uint,
  nargs: uint,
  a1: uint,
  a2: uint,
  a3: uint,
  a4: uint,
  a5: uint,
  a6: uint,
  a7: uint,
  a8: uint,
  a9: uint,
) -> (uint, uint, Errno)

pub fn SyscallN(trap: uint, args: VarArgs<uint>) -> (uint, uint, Errno)

pub fn TerminateProcess(handle: Handle, exitcode: uint32) -> Result<(), error>

pub fn TimespecToNsec(ts: Timespec) -> int64

/// TranslateAccountName converts a directory service
/// object name from one format to another.
pub fn TranslateAccountName(
  username: string,
  from: uint32,
  to: uint32,
  initSize: int,
) -> Result<string, error>

pub fn TranslateName(
  accName: Ref<uint16>,
  accNameFormat: uint32,
  desiredNameFormat: uint32,
  translatedName: Ref<uint16>,
  nSize: Ref<uint32>,
) -> Result<(), error>

pub fn TransmitFile(
  s: Handle,
  handle: Handle,
  bytesToWrite: uint32,
  bytsPerSend: uint32,
  overlapped: Ref<Overlapped>,
  transmitFileBuf: Ref<TransmitFileBuffers>,
  flags: uint32,
) -> Result<(), error>

/// UTF16FromString returns the UTF-16 encoding of the UTF-8 string
/// s, with a terminating NUL added. If s contains a NUL byte at any
/// location, it returns (nil, [EINVAL]). Unpaired surrogates
/// are encoded using WTF-8.
pub fn UTF16FromString(s: string) -> Result<Slice<uint16>, error>

/// UTF16PtrFromString returns pointer to the UTF-16 encoding of
/// the UTF-8 string s, with a terminating NUL added. If s
/// contains a NUL byte at any location, it returns (nil, EINVAL).
/// Unpaired surrogates are encoded using WTF-8.
pub fn UTF16PtrFromString(s: string) -> Result<Ref<uint16>, error>

/// UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s,
/// with a terminating NUL removed. Unpaired surrogates are decoded
/// using WTF-8 instead of UTF-8 encoding.
pub fn UTF16ToString(s: Slice<uint16>) -> string

pub fn Unlink(path: string) -> Result<(), error>

pub fn UnmapViewOfFile(addr: uint) -> Result<(), error>

pub fn Unsetenv(key: string) -> Result<(), error>

pub fn Utimes(path: string, tv: Slice<Timeval>) -> Result<(), error>

pub fn UtimesNano(path: string, ts: Slice<Timespec>) -> Result<(), error>

pub fn VirtualLock(addr: uint, length: uint) -> Result<(), error>

pub fn VirtualUnlock(addr: uint, length: uint) -> Result<(), error>

pub fn WSACleanup() -> Result<(), error>

pub fn WSAEnumProtocols(
  protocols: Ref<int32>,
  protocolBuffer: Ref<WSAProtocolInfo>,
  bufferLength: Ref<uint32>,
) -> Result<int32, error>

pub fn WSAIoctl(
  s: Handle,
  iocc: uint32,
  inbuf: Ref<byte>,
  cbif: uint32,
  outbuf: Ref<byte>,
  cbob: uint32,
  cbbr: Ref<uint32>,
  overlapped: Ref<Overlapped>,
  completionRoutine: uint,
) -> Result<(), error>

pub fn WSARecv(
  s: Handle,
  bufs: Ref<WSABuf>,
  bufcnt: uint32,
  recvd: Ref<uint32>,
  flags: Ref<uint32>,
  overlapped: Ref<Overlapped>,
  croutine: Ref<byte>,
) -> Result<(), error>

pub fn WSARecvFrom(
  s: Handle,
  bufs: Ref<WSABuf>,
  bufcnt: uint32,
  recvd: Ref<uint32>,
  flags: Ref<uint32>,
  from: Ref<RawSockaddrAny>,
  fromlen: Ref<int32>,
  overlapped: Ref<Overlapped>,
  croutine: Ref<byte>,
) -> Result<(), error>

pub fn WSASend(
  s: Handle,
  bufs: Ref<WSABuf>,
  bufcnt: uint32,
  sent: Ref<uint32>,
  flags: uint32,
  overlapped: Ref<Overlapped>,
  croutine: Ref<byte>,
) -> Result<(), error>

pub fn WSASendTo(
  s: Handle,
  bufs: Ref<WSABuf>,
  bufcnt: uint32,
  sent: Ref<uint32>,
  flags: uint32,
  to: Ref<RawSockaddrAny>,
  tolen: int32,
  overlapped: Ref<Overlapped>,
  croutine: Ref<byte>,
) -> Result<(), error>

pub fn WSASendto(
  s: Handle,
  bufs: Ref<WSABuf>,
  bufcnt: uint32,
  sent: Ref<uint32>,
  flags: uint32,
  to: Sockaddr,
  overlapped: Ref<Overlapped>,
  croutine: Ref<byte>,
) -> Result<(), error>

pub fn WSAStartup(verreq: uint32, data: Ref<WSAData>) -> Result<(), error>

pub fn WaitForSingleObject(handle: Handle, waitMilliseconds: uint32) -> Result<uint32, error>

pub fn Write(fd: Handle, p: Slice<byte>) -> Result<int, error>

pub fn WriteConsole(
  console: Handle,
  buf: Ref<uint16>,
  towrite: uint32,
  written: Ref<uint32>,
  reserved: Ref<byte>,
) -> Result<(), error>

pub fn WriteFile(
  fd: Handle,
  p: Slice<byte>,
  done: Ref<uint32>,
  overlapped: Ref<Overlapped>,
) -> Result<(), error>

pub struct AddrinfoW {
  pub Flags: int32,
  pub Family: int32,
  pub Socktype: int32,
  pub Protocol: int32,
  pub Addrlen: uint,
  pub Canonname: Option<uint16>,
  pub Addr: Pointer,
  pub Next: Option<Ref<AddrinfoW>>,
}

pub struct ByHandleFileInformation {
  pub FileAttributes: uint32,
  pub CreationTime: Filetime,
  pub LastAccessTime: Filetime,
  pub LastWriteTime: Filetime,
  pub VolumeSerialNumber: uint32,
  pub FileSizeHigh: uint32,
  pub FileSizeLow: uint32,
  pub NumberOfLinks: uint32,
  pub FileIndexHigh: uint32,
  pub FileIndexLow: uint32,
}

pub struct CertChainContext {
  pub Size: uint32,
  pub TrustStatus: CertTrustStatus,
  pub ChainCount: uint32,
  pub Chains: Option<Ref<Ref<CertSimpleChain>>>,
  pub LowerQualityChainCount: uint32,
  pub LowerQualityChains: Option<Ref<Ref<CertChainContext>>>,
  pub HasRevocationFreshnessTime: uint32,
  pub RevocationFreshnessTime: uint32,
}

pub struct CertChainElement {
  pub Size: uint32,
  pub CertContext: Option<Ref<CertContext>>,
  pub TrustStatus: CertTrustStatus,
  pub RevocationInfo: Option<Ref<CertRevocationInfo>>,
  pub IssuanceUsage: Option<Ref<CertEnhKeyUsage>>,
  pub ApplicationUsage: Option<Ref<CertEnhKeyUsage>>,
  pub ExtendedErrorInfo: Option<uint16>,
}

pub struct CertChainPara {
  pub Size: uint32,
  pub RequestedUsage: CertUsageMatch,
  pub RequstedIssuancePolicy: CertUsageMatch,
  pub URLRetrievalTimeout: uint32,
  pub CheckRevocationFreshnessTime: uint32,
  pub RevocationFreshnessTime: uint32,
  pub CacheResync: Option<Ref<Filetime>>,
}

pub struct CertChainPolicyPara {
  pub Size: uint32,
  pub Flags: uint32,
  pub ExtraPolicyPara: Pointer,
}

pub struct CertChainPolicyStatus {
  pub Size: uint32,
  pub Error: uint32,
  pub ChainIndex: uint32,
  pub ElementIndex: uint32,
  pub ExtraPolicyStatus: Pointer,
}

pub struct CertContext {
  pub EncodingType: uint32,
  pub EncodedCert: Option<Ref<byte>>,
  pub Length: uint32,
  pub CertInfo: Option<Ref<CertInfo>>,
  pub Store: Handle,
}

pub struct CertEnhKeyUsage {
  pub Length: uint32,
  pub UsageIdentifiers: Option<Ref<Ref<byte>>>,
}

pub type CertInfo

pub type CertRevocationCrlInfo

pub struct CertRevocationInfo {
  pub Size: uint32,
  pub RevocationResult: uint32,
  pub RevocationOid: Option<Ref<byte>>,
  pub OidSpecificInfo: Pointer,
  pub HasFreshnessTime: uint32,
  pub FreshnessTime: uint32,
  pub CrlInfo: Option<Ref<CertRevocationCrlInfo>>,
}

pub struct CertSimpleChain {
  pub Size: uint32,
  pub TrustStatus: CertTrustStatus,
  pub NumElements: uint32,
  pub Elements: Option<Ref<Ref<CertChainElement>>>,
  pub TrustListInfo: Option<Ref<CertTrustListInfo>>,
  pub HasRevocationFreshnessTime: uint32,
  pub RevocationFreshnessTime: uint32,
}

pub type CertTrustListInfo

pub struct CertTrustStatus {
  pub ErrorStatus: uint32,
  pub InfoStatus: uint32,
}

pub struct CertUsageMatch {
  pub Type: uint32,
  pub Usage: CertEnhKeyUsage,
}

/// Conn is implemented by some types in the net and os packages to provide
/// access to the underlying file descriptor or handle.
pub interface Conn {
  fn SyscallConn() -> Result<RawConn, error>
}

/// A DLL implements access to a single DLL.
pub struct DLL {
  pub Name: string,
  pub Handle: Handle,
}

/// DLLError describes reasons for DLL load failures.
pub struct DLLError {
  pub Err: error,
  pub ObjName: string,
  pub Msg: string,
}

pub struct DNSMXData {
  pub NameExchange: Option<uint16>,
  pub Preference: uint16,
  pub Pad: uint16,
}

pub struct DNSPTRData {
  pub Host: Option<uint16>,
}

pub struct DNSRecord {
  pub Next: Option<Ref<DNSRecord>>,
  pub Name: Option<uint16>,
  pub Type: uint16,
  pub Length: uint16,
  pub Dw: uint32,
  pub Ttl: uint32,
  pub Reserved: uint32,
  // SKIPPED field "Data": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct DNSSRVData {
  pub Target: Option<uint16>,
  pub Priority: uint16,
  pub Weight: uint16,
  pub Port: uint16,
  pub Pad: uint16,
}

pub struct DNSTXTData {
  pub StringCount: uint16,
  // SKIPPED field "StringArray": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct FileNotifyInformation {
  pub NextEntryOffset: uint32,
  pub Action: uint32,
  pub FileNameLength: uint32,
  pub FileName: uint16,
}

pub struct Filetime {
  pub LowDateTime: uint32,
  pub HighDateTime: uint32,
}

pub struct GUID {
  pub Data1: uint32,
  pub Data2: uint16,
  pub Data3: uint16,
  // SKIPPED field "Data4": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct Handle(uint)

pub struct Hostent {
  pub Name: Option<Ref<byte>>,
  pub Aliases: Option<Ref<Ref<byte>>>,
  pub AddrType: uint16,
  pub Length: uint16,
  pub AddrList: Option<Ref<Ref<byte>>>,
}

// SKIPPED field "Multiaddr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
// SKIPPED field "Interface": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
pub type IPMreq

pub struct IPv6Mreq {
  // SKIPPED field "Multiaddr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub Interface: uint32,
}

pub struct InterfaceInfo {
  pub Flags: uint32,
  pub Address: SockaddrGen,
  pub BroadcastAddress: SockaddrGen,
  pub Netmask: SockaddrGen,
}

pub struct IpAdapterInfo {
  pub Next: Option<Ref<IpAdapterInfo>>,
  pub ComboIndex: uint32,
  // SKIPPED field "AdapterName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  // SKIPPED field "Description": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub AddressLength: uint32,
  // SKIPPED field "Address": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub Index: uint32,
  pub Type: uint32,
  pub DhcpEnabled: uint32,
  pub CurrentIpAddress: Option<Ref<IpAddrString>>,
  pub IpAddressList: IpAddrString,
  pub GatewayList: IpAddrString,
  pub DhcpServer: IpAddrString,
  pub HaveWins: bool,
  pub PrimaryWinsServer: IpAddrString,
  pub SecondaryWinsServer: IpAddrString,
  pub LeaseObtained: int64,
  pub LeaseExpires: int64,
}

pub struct IpAddrString {
  pub Next: Option<Ref<IpAddrString>>,
  pub IpAddress: IpAddressString,
  pub IpMask: IpMaskString,
  pub Context: uint32,
}

// SKIPPED field "String": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
pub type IpAddressString

// SKIPPED field "String": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
pub type IpMaskString

/// A LazyDLL implements access to a single [DLL].
/// It will delay the load of the DLL until the first
/// call to its [LazyDLL.Handle] method or to one of its
/// [LazyProc]'s Addr method.
/// 
/// LazyDLL is subject to the same DLL preloading attacks as documented
/// on [LoadDLL].
/// 
/// Use LazyDLL in golang.org/x/sys/windows for a secure way to
/// load system DLLs.
pub struct LazyDLL {
  pub Name: string,
}

/// A LazyProc implements access to a procedure inside a [LazyDLL].
/// It delays the lookup until the [LazyProc.Addr], [LazyProc.Call], or [LazyProc.Find] method is called.
pub struct LazyProc {
  pub Name: string,
}

pub struct Linger {
  pub Onoff: int32,
  pub Linger: int32,
}

pub struct MibIfRow {
  // SKIPPED field "Name": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub Index: uint32,
  pub Type: uint32,
  pub Mtu: uint32,
  pub Speed: uint32,
  pub PhysAddrLen: uint32,
  // SKIPPED field "PhysAddr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub AdminStatus: uint32,
  pub OperStatus: uint32,
  pub LastChange: uint32,
  pub InOctets: uint32,
  pub InUcastPkts: uint32,
  pub InNUcastPkts: uint32,
  pub InDiscards: uint32,
  pub InErrors: uint32,
  pub InUnknownProtos: uint32,
  pub OutOctets: uint32,
  pub OutUcastPkts: uint32,
  pub OutNUcastPkts: uint32,
  pub OutDiscards: uint32,
  pub OutErrors: uint32,
  pub OutQLen: uint32,
  pub DescrLen: uint32,
  // SKIPPED field "Descr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct Overlapped {
  pub Internal: uint,
  pub InternalHigh: uint,
  pub Offset: uint32,
  pub OffsetHigh: uint32,
  pub HEvent: Handle,
}

/// Pointer represents a pointer to an arbitrary Windows type.
/// 
/// Pointer-typed fields may point to one of many different types. It's
/// up to the caller to provide a pointer to the appropriate type, cast
/// to Pointer. The caller must obey the unsafe.Pointer rules while
/// doing so.
pub struct Pointer(Ref<()>)

/// A Proc implements access to a procedure inside a [DLL].
pub struct Proc {
  pub Dll: Option<Ref<DLL>>,
  pub Name: string,
}

pub struct ProcAttr {
  pub Dir: string,
  pub Env: Slice<string>,
  pub Files: Slice<uint>,
  pub Sys: Option<Ref<SysProcAttr>>,
}

pub struct ProcessEntry32 {
  pub Size: uint32,
  pub Usage: uint32,
  pub ProcessID: uint32,
  pub DefaultHeapID: uint,
  pub ModuleID: uint32,
  pub Threads: uint32,
  pub ParentProcessID: uint32,
  pub PriClassBase: int32,
  pub Flags: uint32,
  // SKIPPED field "ExeFile": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct ProcessInformation {
  pub Process: Handle,
  pub Thread: Handle,
  pub ProcessId: uint32,
  pub ThreadId: uint32,
}

pub struct Protoent {
  pub Name: Option<Ref<byte>>,
  pub Aliases: Option<Ref<Ref<byte>>>,
  pub Proto: uint16,
}

/// A RawConn is a raw network connection.
pub interface RawConn {
  fn Control(f: fn(uint) -> ()) -> Result<(), error>
  fn Read(f: fn(uint) -> bool) -> Result<(), error>
  fn Write(f: fn(uint) -> bool) -> Result<(), error>
}

pub struct RawSockaddr {
  pub Family: uint16,
  // SKIPPED field "Data": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct RawSockaddrAny {
  pub Addr: RawSockaddr,
  // SKIPPED field "Pad": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct RawSockaddrInet4 {
  pub Family: uint16,
  pub Port: uint16,
  // SKIPPED field "Addr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  // SKIPPED field "Zero": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct RawSockaddrInet6 {
  pub Family: uint16,
  pub Port: uint16,
  pub Flowinfo: uint32,
  // SKIPPED field "Addr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub Scope_id: uint32,
}

pub struct RawSockaddrUnix {
  pub Family: uint16,
  // SKIPPED field "Path": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

/// Invented structures to support what package os expects.
pub struct Rusage {
  pub CreationTime: Filetime,
  pub ExitTime: Filetime,
  pub KernelTime: Filetime,
  pub UserTime: Filetime,
}

/// The security identifier (SID) structure is a variable-length
/// structure used to uniquely identify users or groups.
pub type SID

pub struct SIDAndAttributes {
  pub Sid: Option<Ref<SID>>,
  pub Attributes: uint32,
}

pub struct SSLExtraCertChainPolicyPara {
  pub Size: uint32,
  pub AuthType: uint32,
  pub Checks: uint32,
  pub ServerName: Option<uint16>,
}

pub struct SecurityAttributes {
  pub Length: uint32,
  pub SecurityDescriptor: uint,
  pub InheritHandle: uint32,
}

pub struct Servent {
  pub Name: Option<Ref<byte>>,
  pub Aliases: Option<Ref<Ref<byte>>>,
  pub Proto: Option<Ref<byte>>,
  pub Port: uint16,
}

pub interface Sockaddr {}

pub struct SockaddrGen(Slice<byte>)

pub struct SockaddrInet4 {
  pub Port: int,
  // SKIPPED field "Addr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct SockaddrInet6 {
  pub Port: int,
  pub ZoneId: uint32,
  // SKIPPED field "Addr": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct SockaddrUnix {
  pub Name: string,
}

pub struct StartupInfo {
  pub Cb: uint32,
  pub Desktop: Option<uint16>,
  pub Title: Option<uint16>,
  pub X: uint32,
  pub Y: uint32,
  pub XSize: uint32,
  pub YSize: uint32,
  pub XCountChars: uint32,
  pub YCountChars: uint32,
  pub FillAttribute: uint32,
  pub Flags: uint32,
  pub ShowWindow: uint16,
  pub StdInput: Handle,
  pub StdOutput: Handle,
  pub StdErr: Handle,
}

pub struct SysProcAttr {
  pub HideWindow: bool,
  pub CmdLine: string,
  pub CreationFlags: uint32,
  pub Token: Token,
  pub ProcessAttributes: Option<Ref<SecurityAttributes>>,
  pub ThreadAttributes: Option<Ref<SecurityAttributes>>,
  pub NoInheritHandles: bool,
  pub AdditionalInheritedHandles: Slice<Handle>,
  pub ParentProcess: Handle,
}

pub struct Systemtime {
  pub Year: uint16,
  pub Month: uint16,
  pub DayOfWeek: uint16,
  pub Day: uint16,
  pub Hour: uint16,
  pub Minute: uint16,
  pub Second: uint16,
  pub Milliseconds: uint16,
}

pub struct TCPKeepalive {
  pub OnOff: uint32,
  pub Time: uint32,
  pub Interval: uint32,
}

/// Timespec is an invented structure on Windows, but here for
/// consistency with the syscall package for other operating systems.
pub struct Timespec {
  pub Sec: int64,
  pub Nsec: int64,
}

/// Invented values to support what package os expects.
pub struct Timeval {
  pub Sec: int32,
  pub Usec: int32,
}

pub struct Timezoneinformation {
  pub Bias: int32,
  // SKIPPED field "StandardName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub StandardDate: Systemtime,
  pub StandardBias: int32,
  // SKIPPED field "DaylightName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  pub DaylightDate: Systemtime,
  pub DaylightBias: int32,
}

/// An access token contains the security information for a logon session.
/// The system creates an access token when a user logs on, and every
/// process executed on behalf of the user has a copy of the token.
/// The token identifies the user, the user's groups, and the user's
/// privileges. The system uses the token to control access to securable
/// objects and to control the ability of the user to perform various
/// system-related operations on the local computer.
pub struct Token(uint)

pub struct Tokenprimarygroup {
  pub PrimaryGroup: Option<Ref<SID>>,
}

pub struct Tokenuser {
  pub User: SIDAndAttributes,
}

pub struct TransmitFileBuffers {
  pub Head: uint,
  pub HeadLength: uint32,
  pub Tail: uint,
  pub TailLength: uint32,
}

pub struct UserInfo10 {
  pub Name: Option<uint16>,
  pub Comment: Option<uint16>,
  pub UsrComment: Option<uint16>,
  pub FullName: Option<uint16>,
}

pub struct WSABuf {
  pub Len: uint32,
  pub Buf: Option<Ref<byte>>,
}

pub struct WSAData {
  pub Version: uint16,
  pub HighVersion: uint16,
  pub MaxSockets: uint16,
  pub MaxUdpDg: uint16,
  pub VendorInfo: Option<Ref<byte>>,
  // SKIPPED field "Description": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  // SKIPPED field "SystemStatus": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct WSAProtocolChain {
  pub ChainLen: int32,
  // SKIPPED field "ChainEntries": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct WSAProtocolInfo {
  pub ServiceFlags1: uint32,
  pub ServiceFlags2: uint32,
  pub ServiceFlags3: uint32,
  pub ServiceFlags4: uint32,
  pub ProviderFlags: uint32,
  pub ProviderId: GUID,
  pub CatalogEntryId: uint32,
  pub ProtocolChain: WSAProtocolChain,
  pub Version: int32,
  pub AddressFamily: int32,
  pub MaxSockAddr: int32,
  pub MinSockAddr: int32,
  pub SocketType: int32,
  pub Protocol: int32,
  pub ProtocolMaxOffset: int32,
  pub NetworkByteOrder: int32,
  pub SecurityScheme: int32,
  pub MessageSize: uint32,
  pub ProviderReserved: uint32,
  // SKIPPED field "ProtocolName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub struct WaitStatus {
  pub ExitCode: uint32,
}

pub struct Win32FileAttributeData {
  pub FileAttributes: uint32,
  pub CreationTime: Filetime,
  pub LastAccessTime: Filetime,
  pub LastWriteTime: Filetime,
  pub FileSizeHigh: uint32,
  pub FileSizeLow: uint32,
}

pub struct Win32finddata {
  pub FileAttributes: uint32,
  pub CreationTime: Filetime,
  pub LastAccessTime: Filetime,
  pub LastWriteTime: Filetime,
  pub FileSizeHigh: uint32,
  pub FileSizeLow: uint32,
  pub Reserved0: uint32,
  pub Reserved1: uint32,
  // SKIPPED field "FileName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
  // SKIPPED field "AlternateFileName": array-currently-not-representable — fixed-size array cannot currently be represented in Lisette
}

pub const AF_INET = 2

pub const AF_INET6 = 23

pub const AF_NETBIOS = 17

pub const AF_UNIX = 1

pub const AF_UNSPEC = 0

pub const AI_CANONNAME = 2

pub const AI_NUMERICHOST = 4

pub const AI_PASSIVE = 1

/// Windows reserves errors >= 1<<29 for application use.
pub const APPLICATION_ERROR = 536870912

pub const AUTHTYPE_CLIENT = 1

pub const AUTHTYPE_SERVER = 2

pub const BASE_PROTOCOL = 1

pub const CERT_CHAIN_POLICY_AUTHENTICODE = 2

pub const CERT_CHAIN_POLICY_AUTHENTICODE_TS = 3

pub const CERT_CHAIN_POLICY_BASE = 1

pub const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5

pub const CERT_CHAIN_POLICY_EV = 8

pub const CERT_CHAIN_POLICY_MICROSOFT_ROOT = 7

pub const CERT_CHAIN_POLICY_NT_AUTH = 6

pub const CERT_CHAIN_POLICY_SSL = 4

pub const CERT_E_CN_NO_MATCH = 0x800B010F

pub const CERT_E_EXPIRED = 0x800B0101

pub const CERT_E_PURPOSE = 0x800B0106

pub const CERT_E_ROLE = 0x800B0103

pub const CERT_E_UNTRUSTEDROOT = 0x800B0109

pub const CERT_STORE_ADD_ALWAYS = 4

pub const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004

pub const CERT_STORE_PROV_MEMORY = 2

pub const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000

pub const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000

pub const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000

pub const CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 0x08000000

pub const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000

pub const CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400

pub const CERT_TRUST_INVALID_EXTENSION = 0x00000100

pub const CERT_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800

pub const CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200

pub const CERT_TRUST_IS_CYCLIC = 0x00000080

pub const CERT_TRUST_IS_EXPLICIT_DISTRUST = 0x04000000

pub const CERT_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008

pub const CERT_TRUST_IS_NOT_TIME_VALID = 0x00000001

pub const CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010

pub const CERT_TRUST_IS_OFFLINE_REVOCATION = 0x01000000

pub const CERT_TRUST_IS_REVOKED = 0x00000004

pub const CERT_TRUST_IS_UNTRUSTED_ROOT = 0x00000020

pub const CERT_TRUST_NO_ERROR = 0x00000000

pub const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000

pub const CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040

pub const CREATE_ALWAYS = 2

pub const CREATE_NEW = 1

pub const CREATE_NEW_PROCESS_GROUP = 0x00000200

pub const CREATE_UNICODE_ENVIRONMENT = 0x00000400

pub const CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080

pub const CRYPT_DELETEKEYSET = 0x00000010

pub const CRYPT_MACHINE_KEYSET = 0x00000020

pub const CRYPT_NEWKEYSET = 0x00000008

pub const CRYPT_SILENT = 0x00000040

pub const CRYPT_VERIFYCONTEXT = 0xF0000000

pub const CTRL_BREAK_EVENT = 1

pub const CTRL_CLOSE_EVENT = 2

pub const CTRL_C_EVENT = 0

pub const CTRL_LOGOFF_EVENT = 5

pub const CTRL_SHUTDOWN_EVENT = 6

pub const DNS_INFO_NO_RECORDS = 0x251D

pub const DNS_TYPE_A = 0x0001

pub const DNS_TYPE_A6 = 0x0026

pub const DNS_TYPE_AAAA = 0x001c

pub const DNS_TYPE_ADDRS = 0x00f8

pub const DNS_TYPE_AFSDB = 0x0012

pub const DNS_TYPE_ALL = 0x00ff

pub const DNS_TYPE_ANY = 0x00ff

pub const DNS_TYPE_ATMA = 0x0022

pub const DNS_TYPE_AXFR = 0x00fc

pub const DNS_TYPE_CERT = 0x0025

pub const DNS_TYPE_CNAME = 0x0005

pub const DNS_TYPE_DHCID = 0x0031

pub const DNS_TYPE_DNAME = 0x0027

pub const DNS_TYPE_DNSKEY = 0x0030

pub const DNS_TYPE_DS = 0x002B

pub const DNS_TYPE_EID = 0x001f

pub const DNS_TYPE_GID = 0x0066

pub const DNS_TYPE_GPOS = 0x001b

pub const DNS_TYPE_HINFO = 0x000d

pub const DNS_TYPE_ISDN = 0x0014

pub const DNS_TYPE_IXFR = 0x00fb

pub const DNS_TYPE_KEY = 0x0019

pub const DNS_TYPE_KX = 0x0024

pub const DNS_TYPE_LOC = 0x001d

pub const DNS_TYPE_MAILA = 0x00fe

pub const DNS_TYPE_MAILB = 0x00fd

pub const DNS_TYPE_MB = 0x0007

pub const DNS_TYPE_MD = 0x0003

pub const DNS_TYPE_MF = 0x0004

pub const DNS_TYPE_MG = 0x0008

pub const DNS_TYPE_MINFO = 0x000e

pub const DNS_TYPE_MR = 0x0009

pub const DNS_TYPE_MX = 0x000f

pub const DNS_TYPE_NAPTR = 0x0023

pub const DNS_TYPE_NBSTAT = 0xff01

pub const DNS_TYPE_NIMLOC = 0x0020

pub const DNS_TYPE_NS = 0x0002

pub const DNS_TYPE_NSAP = 0x0016

pub const DNS_TYPE_NSAPPTR = 0x0017

pub const DNS_TYPE_NSEC = 0x002F

pub const DNS_TYPE_NULL = 0x000a

pub const DNS_TYPE_NXT = 0x001e

pub const DNS_TYPE_OPT = 0x0029

pub const DNS_TYPE_PTR = 0x000c

pub const DNS_TYPE_PX = 0x001a

pub const DNS_TYPE_RP = 0x0011

pub const DNS_TYPE_RRSIG = 0x002E

pub const DNS_TYPE_RT = 0x0015

pub const DNS_TYPE_SIG = 0x0018

pub const DNS_TYPE_SINK = 0x0028

pub const DNS_TYPE_SOA = 0x0006

pub const DNS_TYPE_SRV = 0x0021

pub const DNS_TYPE_TEXT = 0x0010

pub const DNS_TYPE_TKEY = 0x00f9

pub const DNS_TYPE_TSIG = 0x00fa

pub const DNS_TYPE_UID = 0x0065

pub const DNS_TYPE_UINFO = 0x0064

pub const DNS_TYPE_UNSPEC = 0x0067

pub const DNS_TYPE_WINS = 0xff01

pub const DNS_TYPE_WINSR = 0xff02

pub const DNS_TYPE_WKS = 0x000b

pub const DNS_TYPE_X25 = 0x0013

pub const DUPLICATE_CLOSE_SOURCE = 0x00000001

pub const DUPLICATE_SAME_ACCESS = 0x00000002

pub const DnsSectionAdditional = 0x0003

pub const DnsSectionAnswer = 0x0001

pub const DnsSectionAuthority = 0x0002

pub const DnsSectionQuestion = 0x0000

pub const FILE_ACTION_ADDED = 1

pub const FILE_ACTION_MODIFIED = 3

pub const FILE_ACTION_REMOVED = 2

pub const FILE_ACTION_RENAMED_NEW_NAME = 5

pub const FILE_ACTION_RENAMED_OLD_NAME = 4

pub const FILE_APPEND_DATA = 0x00000004

pub const FILE_ATTRIBUTE_ARCHIVE = 0x00000020

pub const FILE_ATTRIBUTE_DIRECTORY = 0x00000010

pub const FILE_ATTRIBUTE_HIDDEN = 0x00000002

pub const FILE_ATTRIBUTE_NORMAL = 0x00000080

pub const FILE_ATTRIBUTE_READONLY = 0x00000001

pub const FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400

pub const FILE_ATTRIBUTE_SYSTEM = 0x00000004

pub const FILE_BEGIN = 0

pub const FILE_CURRENT = 1

pub const FILE_END = 2

pub const FILE_FLAG_BACKUP_SEMANTICS = 0x02000000

pub const FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000

pub const FILE_FLAG_OVERLAPPED = 0x40000000

pub const FILE_LIST_DIRECTORY = 0x00000001

pub const FILE_MAP_COPY = 0x01

pub const FILE_MAP_EXECUTE = 0x20

pub const FILE_MAP_READ = 0x04

pub const FILE_MAP_WRITE = 0x02

pub const FILE_NOTIFY_CHANGE_ATTRIBUTES = 4

pub const FILE_NOTIFY_CHANGE_CREATION = 64

pub const FILE_NOTIFY_CHANGE_DIR_NAME = 2

pub const FILE_NOTIFY_CHANGE_FILE_NAME = 1

pub const FILE_NOTIFY_CHANGE_LAST_ACCESS = 32

pub const FILE_NOTIFY_CHANGE_LAST_WRITE = 16

pub const FILE_NOTIFY_CHANGE_SIZE = 8

pub const FILE_SHARE_DELETE = 0x00000004

pub const FILE_SHARE_READ = 0x00000001

pub const FILE_SHARE_WRITE = 0x00000002

pub const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1

pub const FILE_SKIP_SET_EVENT_ON_HANDLE = 2

pub const FILE_TYPE_CHAR = 0x0002

pub const FILE_TYPE_DISK = 0x0001

pub const FILE_TYPE_PIPE = 0x0003

pub const FILE_TYPE_REMOTE = 0x8000

pub const FILE_TYPE_UNKNOWN = 0x0000

pub const FILE_WRITE_ATTRIBUTES = 0x00000100

pub const FORMAT_MESSAGE_ALLOCATE_BUFFER = 256

pub const FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192

pub const FORMAT_MESSAGE_FROM_HMODULE = 2048

pub const FORMAT_MESSAGE_FROM_STRING = 1024

pub const FORMAT_MESSAGE_FROM_SYSTEM = 4096

pub const FORMAT_MESSAGE_IGNORE_INSERTS = 512

pub const FORMAT_MESSAGE_MAX_WIDTH_MASK = 255

pub const FSCTL_GET_REPARSE_POINT = 0x900A8

pub const GENERIC_ALL = 0x10000000

pub const GENERIC_EXECUTE = 0x20000000

pub const GENERIC_READ = 0x80000000

pub const GENERIC_WRITE = 0x40000000

pub const GetFileExInfoStandard = 0

pub const GetFileExMaxInfoLevel = 1

pub const HANDLE_FLAG_INHERIT = 0x00000001

pub const HKEY_CLASSES_ROOT = 2147483648

pub const HKEY_CURRENT_CONFIG = 2147483653

pub const HKEY_CURRENT_USER = 2147483649

pub const HKEY_DYN_DATA = 2147483654

pub const HKEY_LOCAL_MACHINE = 2147483650

pub const HKEY_PERFORMANCE_DATA = 2147483652

pub const HKEY_USERS = 2147483651

pub const IFF_BROADCAST = 2

pub const IFF_LOOPBACK = 4

pub const IFF_MULTICAST = 16

pub const IFF_POINTTOPOINT = 8

pub const IFF_UP = 1

pub const IGNORE = 0

pub const INFINITE = 0xffffffff

pub const INVALID_FILE_ATTRIBUTES = 0xffffffff

pub const IOC_IN = 0x80000000

pub const IOC_INOUT = 3221225472

pub const IOC_OUT = 0x40000000

pub const IOC_VENDOR = 0x18000000

pub const IOC_WS2 = 0x08000000

pub const IO_REPARSE_TAG_SYMLINK = 0xA000000C

pub const IPPROTO_IP = 0

pub const IPPROTO_IPV6 = 0x29

pub const IPPROTO_TCP = 6

pub const IPPROTO_UDP = 17

pub const IPV6_JOIN_GROUP = 0xc

pub const IPV6_LEAVE_GROUP = 0xd

pub const IPV6_MULTICAST_HOPS = 0xa

pub const IPV6_MULTICAST_IF = 0x9

pub const IPV6_MULTICAST_LOOP = 0xb

pub const IPV6_UNICAST_HOPS = 0x4

pub const IPV6_V6ONLY = 0x1b

pub const IP_ADD_MEMBERSHIP = 0xc

pub const IP_DROP_MEMBERSHIP = 0xd

pub const IP_MULTICAST_IF = 0x9

pub const IP_MULTICAST_LOOP = 0xb

pub const IP_MULTICAST_TTL = 0xa

pub const IP_TOS = 0x3

pub const IP_TTL = 0x4

pub const ImplementsGetwd = true

pub const InvalidHandle: Handle = 18446744073709551615

pub const KEY_ALL_ACCESS = 0xf003f

pub const KEY_CREATE_LINK = 32

pub const KEY_CREATE_SUB_KEY = 4

pub const KEY_ENUMERATE_SUB_KEYS = 8

pub const KEY_EXECUTE = 0x20019

pub const KEY_NOTIFY = 16

pub const KEY_QUERY_VALUE = 1

pub const KEY_READ = 0x20019

pub const KEY_SET_VALUE = 2

pub const KEY_WOW64_32KEY = 0x0200

pub const KEY_WOW64_64KEY = 0x0100

pub const KEY_WRITE = 0x20006

pub const LANG_ENGLISH = 0x09

pub const LAYERED_PROTOCOL = 0

pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16384

pub const MAXLEN_IFDESCR = 256

pub const MAXLEN_PHYSADDR = 8

pub const MAX_ADAPTER_ADDRESS_LENGTH = 8

pub const MAX_ADAPTER_DESCRIPTION_LENGTH = 128

pub const MAX_ADAPTER_NAME_LENGTH = 256

pub const MAX_COMPUTERNAME_LENGTH = 15

pub const MAX_INTERFACE_NAME_LEN = 256

pub const MAX_LONG_PATH = 32768

pub const MAX_PATH = 260

pub const MAX_PROTOCOL_CHAIN = 7

pub const MaxTokenInfoClass = 29

pub const NameCanonical = 7

pub const NameCanonicalEx = 9

pub const NameDisplay = 3

pub const NameDnsDomain = 12

pub const NameFullyQualifiedDN = 1

pub const NameSamCompatible = 2

pub const NameServicePrincipal = 10

pub const NameUniqueId = 6

pub const NameUnknown = 0

pub const NameUserPrincipal = 8

pub const NetSetupDomainName = 3

pub const NetSetupUnjoined = 1

pub const NetSetupUnknownStatus = 0

pub const NetSetupWorkgroupName = 2

pub const OPEN_ALWAYS = 4

pub const OPEN_EXISTING = 3

pub const O_APPEND = 0x00400

pub const O_ASYNC = 0x02000

pub const O_CLOEXEC = 0x80000

pub const O_CREAT = 0x00040

pub const O_EXCL = 0x00080

pub const O_NOCTTY = 0x00100

pub const O_NONBLOCK = 0x00800

pub const O_RDONLY = 0x00000

pub const O_RDWR = 0x00002

pub const O_SYNC = 0x01000

pub const O_TRUNC = 0x00200

pub const O_WRONLY = 0x00001

pub const PAGE_EXECUTE_READ = 0x20

pub const PAGE_EXECUTE_READWRITE = 0x40

pub const PAGE_EXECUTE_WRITECOPY = 0x80

pub const PAGE_READONLY = 0x02

pub const PAGE_READWRITE = 0x04

pub const PAGE_WRITECOPY = 0x08

pub const PFL_HIDDEN = 0x00000004

pub const PFL_MATCHES_PROTOCOL_ZERO = 0x00000008

pub const PFL_MULTIPLE_PROTO_ENTRIES = 0x00000001

pub const PFL_NETWORKDIRECT_PROVIDER = 0x00000010

pub const PFL_RECOMMENDED_PROTO_ENTRY = 0x00000002

pub const PKCS_7_ASN_ENCODING = 0x00010000

pub const PROCESS_QUERY_INFORMATION = 0x00000400

pub const PROCESS_TERMINATE = 1

pub const PROV_DH_SCHANNEL = 18

pub const PROV_DSS = 3

pub const PROV_DSS_DH = 13

pub const PROV_EC_ECDSA_FULL = 16

pub const PROV_EC_ECDSA_SIG = 14

pub const PROV_EC_ECNRA_FULL = 17

pub const PROV_EC_ECNRA_SIG = 15

pub const PROV_FORTEZZA = 4

pub const PROV_INTEL_SEC = 22

pub const PROV_MS_EXCHANGE = 5

pub const PROV_REPLACE_OWF = 23

pub const PROV_RNG = 21

pub const PROV_RSA_AES = 24

pub const PROV_RSA_FULL = 1

pub const PROV_RSA_SCHANNEL = 12

pub const PROV_RSA_SIG = 2

pub const PROV_SPYRUS_LYNKS = 20

pub const PROV_SSL = 6

pub const REG_BINARY = 3

pub const REG_DWORD = 4

pub const REG_DWORD_BIG_ENDIAN = 5

pub const REG_DWORD_LITTLE_ENDIAN = 4

pub const REG_EXPAND_SZ = 2

pub const REG_FULL_RESOURCE_DESCRIPTOR = 9

pub const REG_LINK = 6

pub const REG_MULTI_SZ = 7

pub const REG_NONE = 0

pub const REG_QWORD = 11

pub const REG_QWORD_LITTLE_ENDIAN = 11

pub const REG_RESOURCE_LIST = 8

pub const REG_RESOURCE_REQUIREMENTS_LIST = 10

pub const REG_SZ = 1

pub const SHUT_RD = 0

pub const SHUT_RDWR = 2

pub const SHUT_WR = 1

pub const SIO_GET_EXTENSION_FUNCTION_POINTER = 3355443206

pub const SIO_GET_INTERFACE_LIST = 0x4004747F

pub const SIO_KEEPALIVE_VALS = 2550136836

pub const SIO_UDP_CONNRESET = 2550136844

pub const SOCK_DGRAM = 2

pub const SOCK_RAW = 3

pub const SOCK_SEQPACKET = 5

pub const SOCK_STREAM = 1

pub const SOL_SOCKET = 0xffff

pub const SOMAXCONN = 0x7fffffff

pub const SO_BROADCAST = 32

pub const SO_DONTROUTE = 16

pub const SO_KEEPALIVE = 8

pub const SO_LINGER = 128

pub const SO_RCVBUF = 0x1002

pub const SO_REUSEADDR = 4

pub const SO_SNDBUF = 0x1001

pub const SO_UPDATE_ACCEPT_CONTEXT = 0x700b

pub const SO_UPDATE_CONNECT_CONTEXT = 0x7010

pub const STANDARD_RIGHTS_ALL = 0x1F0000

pub const STANDARD_RIGHTS_EXECUTE = 0x20000

pub const STANDARD_RIGHTS_READ = 0x20000

pub const STANDARD_RIGHTS_REQUIRED = 0xf0000

pub const STANDARD_RIGHTS_WRITE = 0x20000

pub const STARTF_USESHOWWINDOW = 0x00000001

pub const STARTF_USESTDHANDLES = 0x00000100

pub const STD_ERROR_HANDLE = -12

pub const STD_INPUT_HANDLE = -10

pub const STD_OUTPUT_HANDLE = -11

pub const SUBLANG_ENGLISH_US = 0x01

/// ShowWindow constants
pub const SW_FORCEMINIMIZE = 11

/// ShowWindow constants
pub const SW_HIDE = 0

/// ShowWindow constants
pub const SW_MAXIMIZE = 3

/// ShowWindow constants
pub const SW_MINIMIZE = 6

/// ShowWindow constants
pub const SW_NORMAL = 1

/// ShowWindow constants
pub const SW_RESTORE = 9

/// ShowWindow constants
pub const SW_SHOW = 5

/// ShowWindow constants
pub const SW_SHOWDEFAULT = 10

/// ShowWindow constants
pub const SW_SHOWMAXIMIZED = 3

/// ShowWindow constants
pub const SW_SHOWMINIMIZED = 2

/// ShowWindow constants
pub const SW_SHOWMINNOACTIVE = 7

/// ShowWindow constants
pub const SW_SHOWNA = 8

/// ShowWindow constants
pub const SW_SHOWNOACTIVATE = 4

/// ShowWindow constants
pub const SW_SHOWNORMAL = 1

pub const SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1

pub const SYNCHRONIZE = 0x00100000

/// Invented values to support what package os expects.
pub const S_IFBLK = 0x6000

/// Invented values to support what package os expects.
pub const S_IFCHR = 0x2000

/// Invented values to support what package os expects.
pub const S_IFDIR = 0x4000

/// Invented values to support what package os expects.
pub const S_IFIFO = 0x1000

/// Invented values to support what package os expects.
pub const S_IFLNK = 0xa000

/// Invented values to support what package os expects.
pub const S_IFMT = 0x1f000

/// Invented values to support what package os expects.
pub const S_IFREG = 0x8000

/// Invented values to support what package os expects.
pub const S_IFSOCK = 0xc000

/// Invented values to support what package os expects.
pub const S_IRUSR = 0x100

/// Invented values to support what package os expects.
pub const S_ISGID = 0x400

/// Invented values to support what package os expects.
pub const S_ISUID = 0x800

/// Invented values to support what package os expects.
pub const S_ISVTX = 0x200

/// Invented values to support what package os expects.
pub const S_IWRITE = 0x80

/// Invented values to support what package os expects.
pub const S_IWUSR = 0x80

/// Invented values to support what package os expects.
pub const S_IXUSR = 0x40

pub const SidTypeAlias = 4

pub const SidTypeComputer = 9

pub const SidTypeDeletedAccount = 6

pub const SidTypeDomain = 3

pub const SidTypeGroup = 2

pub const SidTypeInvalid = 7

pub const SidTypeLabel = 10

pub const SidTypeUnknown = 8

pub const SidTypeUser = 1

pub const SidTypeWellKnownGroup = 5

pub const TCP_NODELAY = 1

pub const TF_DISCONNECT = 1

pub const TF_REUSE_SOCKET = 2

pub const TF_USE_DEFAULT_WORKER = 0

pub const TF_USE_KERNEL_APC = 32

pub const TF_USE_SYSTEM_THREAD = 16

pub const TF_WRITE_BEHIND = 4

pub const TH32CS_INHERIT = 0x80000000

pub const TH32CS_SNAPALL = 15

pub const TH32CS_SNAPHEAPLIST = 0x01

pub const TH32CS_SNAPMODULE = 0x08

pub const TH32CS_SNAPMODULE32 = 0x10

pub const TH32CS_SNAPPROCESS = 0x02

pub const TH32CS_SNAPTHREAD = 0x04

pub const TIME_ZONE_ID_DAYLIGHT = 2

pub const TIME_ZONE_ID_STANDARD = 1

pub const TIME_ZONE_ID_UNKNOWN = 0

pub const TOKEN_ADJUST_DEFAULT = 128

pub const TOKEN_ADJUST_GROUPS = 64

pub const TOKEN_ADJUST_PRIVILEGES = 32

pub const TOKEN_ADJUST_SESSIONID = 256

pub const TOKEN_ALL_ACCESS = 983551

pub const TOKEN_ASSIGN_PRIMARY = 1

pub const TOKEN_DUPLICATE = 2

pub const TOKEN_EXECUTE = 131072

pub const TOKEN_IMPERSONATE = 4

pub const TOKEN_QUERY = 8

pub const TOKEN_QUERY_SOURCE = 16

pub const TOKEN_READ = 131080

pub const TOKEN_WRITE = 131296

pub const TRUNCATE_EXISTING = 5

pub const TokenAccessInformation = 22

pub const TokenAuditPolicy = 16

pub const TokenDefaultDacl = 6

pub const TokenElevation = 20

pub const TokenElevationType = 18

pub const TokenGroups = 2

pub const TokenGroupsAndPrivileges = 13

pub const TokenHasRestrictions = 21

pub const TokenImpersonationLevel = 9

pub const TokenIntegrityLevel = 25

pub const TokenLinkedToken = 19

pub const TokenLogonSid = 28

pub const TokenMandatoryPolicy = 27

pub const TokenOrigin = 17

pub const TokenOwner = 4

pub const TokenPrimaryGroup = 5

pub const TokenPrivileges = 3

pub const TokenRestrictedSids = 11

pub const TokenSandBoxInert = 15

pub const TokenSessionId = 12

pub const TokenSessionReference = 14

pub const TokenSource = 7

pub const TokenStatistics = 10

pub const TokenType = 8

pub const TokenUIAccess = 26

pub const TokenUser = 1

pub const TokenVirtualizationAllowed = 23

pub const TokenVirtualizationEnabled = 24

pub const UNIX_PATH_MAX = 108

pub const USAGE_MATCH_TYPE_AND = 0

pub const USAGE_MATCH_TYPE_OR = 1

pub const WAIT_ABANDONED = 0x00000080

pub const WAIT_FAILED = 0xFFFFFFFF

pub const WAIT_OBJECT_0 = 0x00000000

pub const WAIT_TIMEOUT = 258

pub const WSADESCRIPTION_LEN = 256

pub const WSAPROTOCOL_LEN = 255

pub const WSASYS_STATUS_LEN = 128

pub const X509_ASN_ENCODING = 0x00000001

pub const XP1_CONNECTIONLESS = 0x00000001

pub const XP1_CONNECT_DATA = 0x00000080

pub const XP1_DISCONNECT_DATA = 0x00000100

pub const XP1_EXPEDITED_DATA = 0x00000040

pub const XP1_GRACEFUL_CLOSE = 0x00000020

pub const XP1_GUARANTEED_DELIVERY = 0x00000002

pub const XP1_GUARANTEED_ORDER = 0x00000004

pub const XP1_IFS_HANDLES = 0x00020000

pub const XP1_MESSAGE_ORIENTED = 0x00000008

pub const XP1_MULTIPOINT_CONTROL_PLANE = 0x00000800

pub const XP1_MULTIPOINT_DATA_PLANE = 0x00001000

pub const XP1_PARTIAL_MESSAGE = 0x00040000

pub const XP1_PSEUDO_STREAM = 0x00000010

pub const XP1_QOS_SUPPORTED = 0x00002000

pub const XP1_SAN_SUPPORT_SDP = 0x00080000

pub const XP1_SUPPORT_BROADCAST = 0x00000200

pub const XP1_SUPPORT_MULTIPOINT = 0x00000400

pub const XP1_UNI_RECV = 0x00010000

pub const XP1_UNI_SEND = 0x00008000

/// ForkLock is not used on Windows.
pub var ForkLock: sync.RWMutex

pub var OID_PKIX_KP_SERVER_AUTH: Slice<byte>

pub var OID_SERVER_GATED_CRYPTO: Slice<byte>

pub var OID_SGC_NETSCAPE: Slice<byte>

/// For testing: clients can set this flag to force
/// creation of IPv6 sockets to return [EAFNOSUPPORT].
pub var SocketDisableIPv6: bool

pub var Stderr: Handle

pub var Stdin: Handle

pub var Stdout: Handle

pub var WSAID_CONNECTEX: GUID

impl DLL {
  /// FindProc searches [DLL] d for procedure named name and returns [*Proc]
  /// if found. It returns an error if search fails.
  fn FindProc(self: Ref<DLL>, name: string) -> Result<Ref<Proc>, error>

  /// MustFindProc is like [DLL.FindProc] but panics if search fails.
  fn MustFindProc(self: Ref<DLL>, name: string) -> Ref<Proc>

  /// Release unloads [DLL] d from memory.
  fn Release(self: Ref<DLL>) -> Result<(), error>
}

impl DLLError {
  fn Error(self: Ref<DLLError>) -> string

  fn Unwrap(self: Ref<DLLError>) -> Option<error>
}

impl Errno {
  fn Error(self) -> string

  fn Is(self, target: error) -> bool

  fn Temporary(self) -> bool

  fn Timeout(self) -> bool
}

impl Filetime {
  /// Nanoseconds returns Filetime ft in nanoseconds
  /// since Epoch (00:00:00 UTC, January 1, 1970).
  fn Nanoseconds(self: Ref<Filetime>) -> int64
}

impl LazyDLL {
  /// Handle returns d's module handle.
  fn Handle(self: Ref<LazyDLL>) -> uint

  /// Load loads DLL file d.Name into memory. It returns an error if fails.
  /// Load will not try to load DLL, if it is already loaded into memory.
  fn Load(self: Ref<LazyDLL>) -> Result<(), error>

  /// NewProc returns a [LazyProc] for accessing the named procedure in the [DLL] d.
  fn NewProc(self: Ref<LazyDLL>, name: string) -> Ref<LazyProc>
}

impl LazyProc {
  /// Addr returns the address of the procedure represented by p.
  /// The return value can be passed to Syscall to run the procedure.
  fn Addr(self: Ref<LazyProc>) -> uint

  /// Call executes procedure p with arguments a. See the documentation of
  /// Proc.Call for more information.
  fn Call(self: Ref<LazyProc>, a: VarArgs<uint>) -> Result<(uint, uint), error>

  /// Find searches [DLL] for procedure named p.Name. It returns
  /// an error if search fails. Find will not search procedure,
  /// if it is already found and loaded into memory.
  fn Find(self: Ref<LazyProc>) -> Result<(), error>
}

impl Proc {
  /// Addr returns the address of the procedure represented by p.
  /// The return value can be passed to Syscall to run the procedure.
  fn Addr(self: Ref<Proc>) -> uint

  /// Call executes procedure p with arguments a.
  /// 
  /// The returned error is always non-nil, constructed from the result of GetLastError.
  /// Callers must inspect the primary return value to decide whether an error occurred
  /// (according to the semantics of the specific function being called) before consulting
  /// the error. The error always has type [Errno].
  /// 
  /// On amd64, Call can pass and return floating-point values. To pass
  /// an argument x with C type "float", use
  /// uintptr(math.Float32bits(x)). To pass an argument with C type
  /// "double", use uintptr(math.Float64bits(x)). Floating-point return
  /// values are returned in r2. The return value for C type "float" is
  /// [math.Float32frombits](uint32(r2)). For C type "double", it is
  /// [math.Float64frombits](uint64(r2)).
  fn Call(self: Ref<Proc>, a: VarArgs<uint>) -> Result<(uint, uint), error>
}

impl RawSockaddrAny {
  fn Sockaddr(self: Ref<RawSockaddrAny>) -> Result<Sockaddr, error>
}

impl SID {
  /// Copy creates a duplicate of security identifier sid.
  fn Copy(self: Ref<SID>) -> Result<Ref<SID>, error>

  /// Len returns the length, in bytes, of a valid security identifier sid.
  fn Len(self: Ref<SID>) -> int

  /// LookupAccount retrieves the name of the account for this sid
  /// and the name of the first domain on which this sid is found.
  /// System specify target computer to search for.
  fn LookupAccount(self: Ref<SID>, system: string) -> Result<(string, string, uint32), error>

  /// String converts sid to a string format
  /// suitable for display, storage, or transmission.
  fn String(self: Ref<SID>) -> Result<string, error>
}

impl Signal {
  fn Signal(self)

  fn String(self) -> string
}

impl Timespec {
  /// Nano returns the time stored in ts as nanoseconds.
  fn Nano(self: Ref<Timespec>) -> int64

  /// Unix returns the time stored in ts as seconds plus nanoseconds.
  fn Unix(self: Ref<Timespec>) -> (int64, int64)
}

impl Timeval {
  /// Nano returns the time stored in tv as nanoseconds.
  fn Nano(self: Ref<Timeval>) -> int64

  fn Nanoseconds(self: Ref<Timeval>) -> int64

  /// Unix returns the time stored in tv as seconds plus nanoseconds.
  fn Unix(self: Ref<Timeval>) -> (int64, int64)
}

impl Token {
  /// Close releases access to access token.
  #[allow(unused_result)]
  fn Close(self) -> Result<(), error>

  /// GetTokenPrimaryGroup retrieves access token t primary group information.
  /// A pointer to a SID structure representing a group that will become
  /// the primary group of any objects created by a process using this access token.
  fn GetTokenPrimaryGroup(self) -> Result<Ref<Tokenprimarygroup>, error>

  /// GetTokenUser retrieves access token t user account information.
  fn GetTokenUser(self) -> Result<Ref<Tokenuser>, error>

  /// GetUserProfileDirectory retrieves path to the
  /// root directory of the access token t user's profile.
  fn GetUserProfileDirectory(self) -> Result<string, error>
}

impl WaitStatus {
  fn Continued(self) -> bool

  fn CoreDump(self) -> bool

  fn ExitStatus(self) -> int

  fn Exited(self) -> bool

  fn Signal(self) -> Signal

  fn Signaled(self) -> bool

  fn StopSignal(self) -> Signal

  fn Stopped(self) -> bool

  fn TrapCause(self) -> int
}