This file is indexed.

/usr/i686-w64-mingw32/include/winddi.h is in mingw-w64-i686-dev 2.0.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
/*
 * winddi.h
 *
 * GDI device driver interface
 *
 * This file is part of the w32api package.
 *
 * Contributors:
 *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
 *
 * THIS SOFTWARE IS NOT COPYRIGHTED
 *
 * This source code is offered for use in the public domain. You may
 * use, modify or distribute it freely.
 *
 * This code is distributed in the hope that it will be useful but
 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
 * DISCLAIMED. This includes but is not limited to warranties of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 */

#ifndef _WINDDI_
#define _WINDDI_

#ifdef __VIDEO_H__
#error video.h cannot be included with winddi.h
#else

#include <ddrawint.h>
#include <d3dnthal.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT __attribute__((dllimport))
#endif

#ifndef WIN32KAPI
#define WIN32KAPI DECLSPEC_ADDRSAFE
#endif

#define DDI_DRIVER_VERSION_NT4            0x00020000
#define DDI_DRIVER_VERSION_SP3            0x00020003
#define DDI_DRIVER_VERSION_NT5            0x00030000
#define DDI_DRIVER_VERSION_NT5_01         0x00030100

#define GDI_DRIVER_VERSION                0x4000

#ifdef _X86_

typedef DWORD FLOATL;

#else /* !_X86_ */

typedef FLOAT FLOATL;

#endif

typedef SHORT FWORD;
typedef LONG LDECI4;
typedef ULONG IDENT;

typedef ULONG_PTR HFF;
typedef ULONG_PTR HFC;

typedef LONG PTRDIFF;
typedef PTRDIFF *PPTRDIFF;
typedef LONG FIX;
typedef FIX *PFIX;
typedef ULONG ROP4;
typedef ULONG MIX;
typedef ULONG HGLYPH;
typedef HGLYPH *PHGLYPH;

typedef LONG_PTR (APIENTRY *PFN)();

DECLARE_HANDLE(HBM);
DECLARE_HANDLE(HDEV);
DECLARE_HANDLE(HSURF);
DECLARE_HANDLE(DHSURF);
DECLARE_HANDLE(DHPDEV);
DECLARE_HANDLE(HDRVOBJ);

#ifndef _NTDDVDEO_
typedef struct _ENG_EVENT *PEVENT;
#endif

#define OPENGL_CMD                        4352
#define OPENGL_GETINFO                    4353
#define WNDOBJ_SETUP                      4354

#define FD_ERROR                          0xFFFFFFFF
#define DDI_ERROR                         0xFFFFFFFF

#define HFF_INVALID                       ((HFF) 0)
#define HFC_INVALID                       ((HFC) 0)
#define HGLYPH_INVALID                    ((HGLYPH) -1)

#define FP_ALTERNATEMODE                  1
#define FP_WINDINGMODE                    2

#define DN_ACCELERATION_LEVEL             1
#define DN_DEVICE_ORIGIN                  2
#define DN_SLEEP_MODE                     3
#define DN_DRAWING_BEGIN                  4

#define DCR_SOLID                         0
#define DCR_DRIVER                        1
#define DCR_HALFTONE                      2

#define GX_IDENTITY                       0
#define GX_OFFSET                         1
#define GX_SCALE                          2
#define GX_GENERAL                        3

#define LTOFX(x)        ((x) << 4)
#define FXTOL(x)        ((x) >> 4)
#define FXTOLFLOOR(x)   ((x) >> 4)
#define FXTOLCEILING(x) ((x + 0x0F) >> 4)
#define FXTOLROUND(x)   ((((x) >> 3) + 1) >> 1)

typedef struct _POINTE {
	FLOATL  x;
	FLOATL  y;
} POINTE, *PPOINTE;

typedef union _FLOAT_LONG {
  FLOATL  e;
  LONG  l;
} FLOAT_LONG, *PFLOAT_LONG;

typedef struct _POINTFIX {
  FIX  x;
  FIX  y;
} POINTFIX, *PPOINTFIX;

typedef struct _RECTFX {
  FIX  xLeft;
  FIX  yTop;
  FIX  xRight;
  FIX  yBottom;
} RECTFX, *PRECTFX;

typedef struct _POINTQF {
  LARGE_INTEGER  x;
  LARGE_INTEGER  y;
} POINTQF, *PPOINTQF;


typedef struct _BLENDOBJ {
  BLENDFUNCTION  BlendFunction;
} BLENDOBJ,*PBLENDOBJ;

/* BRUSHOBJ.flColorType */
#define BR_DEVICE_ICM    0x01
#define BR_HOST_ICM      0x02
#define BR_CMYKCOLOR     0x04
#define BR_ORIGCOLOR     0x08

typedef struct _BRUSHOBJ {
  ULONG  iSolidColor;
  PVOID  pvRbrush;
  FLONG  flColorType;
} BRUSHOBJ;

typedef struct _CIECHROMA {
  LDECI4  x;
  LDECI4  y;
  LDECI4  Y;
} CIECHROMA;

typedef struct _RUN {
  LONG  iStart;
  LONG  iStop;
} RUN, *PRUN;

typedef struct _CLIPLINE {
  POINTFIX  ptfxA;
  POINTFIX  ptfxB;
  LONG  lStyleState;
  ULONG  c;
  RUN  arun[1];
} CLIPLINE, *PCLIPLINE;

/* CLIPOBJ.iDComplexity constants */
#define DC_TRIVIAL                        0
#define DC_RECT                           1
#define DC_COMPLEX                        3

/* CLIPOBJ.iFComplexity constants */
#define FC_RECT                           1
#define FC_RECT4                          2
#define FC_COMPLEX                        3

/* CLIPOBJ.iMode constants */
#define TC_RECTANGLES                     0
#define TC_PATHOBJ                        2

/* CLIPOBJ.fjOptions constants */
#define OC_BANK_CLIP                      1

typedef struct _CLIPOBJ {
  ULONG  iUniq;
  RECTL  rclBounds;
  BYTE  iDComplexity;
  BYTE  iFComplexity;
  BYTE  iMode;
  BYTE  fjOptions;
} CLIPOBJ;

typedef struct _COLORINFO {
  CIECHROMA  Red;
  CIECHROMA  Green;
  CIECHROMA  Blue;
  CIECHROMA  Cyan;
  CIECHROMA  Magenta;
  CIECHROMA  Yellow;
  CIECHROMA  AlignmentWhite;
  LDECI4  RedGamma;
  LDECI4  GreenGamma;
  LDECI4  BlueGamma;
  LDECI4  MagentaInCyanDye;
  LDECI4  YellowInCyanDye;
  LDECI4  CyanInMagentaDye;
  LDECI4  YellowInMagentaDye;
  LDECI4  CyanInYellowDye;
  LDECI4  MagentaInYellowDye;
} COLORINFO, *PCOLORINFO;

/* DEVHTADJDATA.DeviceFlags constants */
#define DEVHTADJF_COLOR_DEVICE            0x00000001
#define DEVHTADJF_ADDITIVE_DEVICE         0x00000002

typedef struct _DEVHTINFO {
  DWORD  HTFlags;
  DWORD  HTPatternSize;
  DWORD  DevPelsDPI;
  COLORINFO  ColorInfo;
} DEVHTINFO, *PDEVHTINFO;

typedef struct _DEVHTADJDATA {
  DWORD   DeviceFlags;
  DWORD   DeviceXDPI;
  DWORD   DeviceYDPI;
  PDEVHTINFO  pDefHTInfo;
  PDEVHTINFO  pAdjHTInfo;
} DEVHTADJDATA, *PDEVHTADJDATA;

/* DEVINFO.flGraphicsCaps flags */
#define GCAPS_BEZIERS           0x00000001
#define GCAPS_GEOMETRICWIDE     0x00000002
#define GCAPS_ALTERNATEFILL     0x00000004
#define GCAPS_WINDINGFILL       0x00000008
#define GCAPS_HALFTONE          0x00000010
#define GCAPS_COLOR_DITHER      0x00000020
#define GCAPS_HORIZSTRIKE       0x00000040
#define GCAPS_VERTSTRIKE        0x00000080
#define GCAPS_OPAQUERECT        0x00000100
#define GCAPS_VECTORFONT        0x00000200
#define GCAPS_MONO_DITHER       0x00000400
#define GCAPS_ASYNCCHANGE       0x00000800
#define GCAPS_ASYNCMOVE         0x00001000
#define GCAPS_DONTJOURNAL       0x00002000
#define GCAPS_DIRECTDRAW        0x00004000
#define GCAPS_ARBRUSHOPAQUE     0x00008000
#define GCAPS_PANNING           0x00010000
#define GCAPS_HIGHRESTEXT       0x00040000
#define GCAPS_PALMANAGED        0x00080000
#define GCAPS_DITHERONREALIZE   0x00200000
#define GCAPS_NO64BITMEMACCESS  0x00400000
#define GCAPS_FORCEDITHER       0x00800000
#define GCAPS_GRAY16            0x01000000
#define GCAPS_ICM               0x02000000
#define GCAPS_CMYKCOLOR         0x04000000
#define GCAPS_LAYERED           0x08000000
#define GCAPS_ARBRUSHTEXT       0x10000000
#define GCAPS_SCREENPRECISION   0x20000000
#define GCAPS_FONT_RASTERIZER   0x40000000
#define GCAPS_NUP               0x80000000

/* DEVINFO.iDitherFormat constants */
#define BMF_1BPP       1L
#define BMF_4BPP       2L
#define BMF_8BPP       3L
#define BMF_16BPP      4L
#define BMF_24BPP      5L
#define BMF_32BPP      6L
#define BMF_4RLE       7L
#define BMF_8RLE       8L
#define BMF_JPEG       9L
#define BMF_PNG       10L

/* DEVINFO.flGraphicsCaps2 flags */
#define GCAPS2_JPEGSRC          0x00000001
#define GCAPS2_xxxx             0x00000002
#define GCAPS2_PNGSRC           0x00000008
#define GCAPS2_CHANGEGAMMARAMP  0x00000010
#define GCAPS2_ALPHACURSOR      0x00000020
#define GCAPS2_SYNCFLUSH        0x00000040
#define GCAPS2_SYNCTIMER        0x00000080
#define GCAPS2_ICD_MULTIMON     0x00000100
#define GCAPS2_MOUSETRAILS      0x00000200
#define GCAPS2_RESERVED1        0x00000400

typedef struct _DEVINFO {
  FLONG  flGraphicsCaps;
  LOGFONTW  lfDefaultFont;
  LOGFONTW  lfAnsiVarFont;
  LOGFONTW  lfAnsiFixFont;
  ULONG  cFonts;
  ULONG  iDitherFormat;
  USHORT  cxDither;
  USHORT  cyDither;
  HPALETTE  hpalDefault;
  FLONG  flGraphicsCaps2;
} DEVINFO, *PDEVINFO;

struct _DRIVEROBJ;

typedef WINBOOL
(APIENTRY CALLBACK *FREEOBJPROC)(
  struct _DRIVEROBJ  *pDriverObj);

typedef struct _DRIVEROBJ {
  PVOID  pvObj;
  FREEOBJPROC  pFreeProc;
  HDEV  hdev;
  DHPDEV  dhpdev;
} DRIVEROBJ;

/* DRVFN.iFunc constants */
#define INDEX_DrvEnablePDEV               0L
#define INDEX_DrvCompletePDEV             1L
#define INDEX_DrvDisablePDEV              2L
#define INDEX_DrvEnableSurface            3L
#define INDEX_DrvDisableSurface           4L
#define INDEX_DrvAssertMode               5L
#define INDEX_DrvOffset                   6L
#define INDEX_DrvResetPDEV                7L
#define INDEX_DrvDisableDriver            8L
#define INDEX_DrvUnknown1                 9L
#define INDEX_DrvCreateDeviceBitmap       10L
#define INDEX_DrvDeleteDeviceBitmap       11L
#define INDEX_DrvRealizeBrush             12L
#define INDEX_DrvDitherColor              13L
#define INDEX_DrvStrokePath               14L
#define INDEX_DrvFillPath                 15L
#define INDEX_DrvStrokeAndFillPath        16L
#define INDEX_DrvPaint                    17L
#define INDEX_DrvBitBlt                   18L
#define INDEX_DrvCopyBits                 19L
#define INDEX_DrvStretchBlt               20L
#define INDEX_DrvUnknown2                 21L
#define INDEX_DrvSetPalette               22L
#define INDEX_DrvTextOut                  23L
#define INDEX_DrvEscape                   24L
#define INDEX_DrvDrawEscape               25L
#define INDEX_DrvQueryFont                26L
#define INDEX_DrvQueryFontTree            27L
#define INDEX_DrvQueryFontData            28L
#define INDEX_DrvSetPointerShape          29L
#define INDEX_DrvMovePointer              30L
#define INDEX_DrvLineTo                   31L
#define INDEX_DrvSendPage                 32L
#define INDEX_DrvStartPage                33L
#define INDEX_DrvEndDoc                   34L
#define INDEX_DrvStartDoc                 35L
#define INDEX_DrvUnknown3                 36L
#define INDEX_DrvGetGlyphMode             37L
#define INDEX_DrvSynchronize              38L
#define INDEX_DrvUnknown4                 39L
#define INDEX_DrvSaveScreenBits           40L
#define INDEX_DrvGetModes                 41L
#define INDEX_DrvFree                     42L
#define INDEX_DrvDestroyFont              43L
#define INDEX_DrvQueryFontCaps            44L
#define INDEX_DrvLoadFontFile             45L
#define INDEX_DrvUnloadFontFile           46L
#define INDEX_DrvFontManagement           47L
#define INDEX_DrvQueryTrueTypeTable       48L
#define INDEX_DrvQueryTrueTypeOutline     49L
#define INDEX_DrvGetTrueTypeFile          50L
#define INDEX_DrvQueryFontFile            51L
#define INDEX_DrvMovePanning              52L
#define INDEX_DrvQueryAdvanceWidths       53L
#define INDEX_DrvSetPixelFormat           54L
#define INDEX_DrvDescribePixelFormat      55L
#define INDEX_DrvSwapBuffers              56L
#define INDEX_DrvStartBanding             57L
#define INDEX_DrvNextBand                 58L
#define INDEX_DrvGetDirectDrawInfo        59L
#define INDEX_DrvEnableDirectDraw         60L
#define INDEX_DrvDisableDirectDraw        61L
#define INDEX_DrvQuerySpoolType           62L
#define INDEX_DrvUnknown5                 63L
#define INDEX_DrvIcmCreateColorTransform  64L
#define INDEX_DrvIcmDeleteColorTransform  65L
#define INDEX_DrvIcmCheckBitmapBits       66L
#define INDEX_DrvIcmSetDeviceGammaRamp    67L
#define INDEX_DrvGradientFill             68L
#define INDEX_DrvStretchBltROP            69L
#define INDEX_DrvPlgBlt                   70L
#define INDEX_DrvAlphaBlend               71L
#define INDEX_DrvSynthesizeFont           72L
#define INDEX_DrvGetSynthesizedFontFiles  73L
#define INDEX_DrvTransparentBlt           74L
#define INDEX_DrvQueryPerBandInfo         75L
#define INDEX_DrvQueryDeviceSupport       76L
#define INDEX_DrvReserved1                77L
#define INDEX_DrvReserved2                78L
#define INDEX_DrvReserved3                79L
#define INDEX_DrvReserved4                80L
#define INDEX_DrvReserved5                81L
#define INDEX_DrvReserved6                82L
#define INDEX_DrvReserved7                83L
#define INDEX_DrvReserved8                84L
#define INDEX_DrvDeriveSurface            85L
#define INDEX_DrvQueryGlyphAttrs          86L
#define INDEX_DrvNotify                   87L
#define INDEX_DrvSynchronizeSurface       88L
#define INDEX_DrvResetDevice              89L
#define INDEX_DrvReserved9                90L
#define INDEX_DrvReserved10               91L
#define INDEX_DrvReserved11               92L
#define INDEX_LAST                        93L

typedef struct _DRVFN {
  ULONG  iFunc;
  PFN  pfn;
} DRVFN, *PDRVFN;

/* DRVENABLEDATA.iDriverVersion constants */
#define DDI_DRIVER_VERSION_NT4            0x00020000
#define DDI_DRIVER_VERSION_SP3            0x00020003
#define DDI_DRIVER_VERSION_NT5            0x00030000
#define DDI_DRIVER_VERSION_NT5_01         0x00030100
#define DDI_DRIVER_VERSION_NT5_01_SP1     0x00030101

typedef struct _DRVENABLEDATA {
  ULONG  iDriverVersion;
  ULONG  c;
  DRVFN  *pdrvfn;
} DRVENABLEDATA, *PDRVENABLEDATA;

DECLARE_HANDLE(HSEMAPHORE);

typedef struct {
  DWORD  nSize;
  HDC  hdc;
  PBYTE  pvEMF;
  PBYTE  pvCurrentRecord;
} EMFINFO, *PEMFINFO;

typedef struct _ENGSAFESEMAPHORE {
  HSEMAPHORE  hsem;
  LONG  lCount;
} ENGSAFESEMAPHORE;

typedef struct _ENG_TIME_FIELDS {
  USHORT  usYear;
  USHORT  usMonth;
  USHORT  usDay;
  USHORT  usHour;
  USHORT  usMinute;
  USHORT  usSecond;
  USHORT  usMilliseconds;
  USHORT  usWeekday;
} ENG_TIME_FIELDS, *PENG_TIME_FIELDS;

typedef struct _ENUMRECTS {
  ULONG  c;
  RECTL  arcl[1];
} ENUMRECTS;

typedef struct _FD_XFORM {
  FLOATL  eXX;
  FLOATL  eXY;
  FLOATL  eYX;
  FLOATL  eYY;
} FD_XFORM, *PFD_XFORM;

/* FD_DEVICEMETRICS.flRealizedType constants */
#define FDM_TYPE_BM_SIDE_CONST            0x00000001
#define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE     0x00000002
#define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE   0x00000004
#define FDM_TYPE_ZERO_BEARINGS            0x00000008
#define FDM_TYPE_CONST_BEARINGS           0x00000010

typedef struct _FD_DEVICEMETRICS {
  FLONG  flRealizedType;
  POINTE  pteBase;
  POINTE  pteSide;
  LONG  lD;
  FIX  fxMaxAscender;
  FIX  fxMaxDescender;
  POINTL  ptlUnderline1;
  POINTL  ptlStrikeout;
  POINTL  ptlULThickness;
  POINTL  ptlSOThickness;
  ULONG  cxMax;
  ULONG  cyMax;
  ULONG  cjGlyphMax;
  FD_XFORM  fdxQuantized;
  LONG  lNonLinearExtLeading;
  LONG  lNonLinearIntLeading;
  LONG  lNonLinearMaxCharWidth;
  LONG  lNonLinearAvgCharWidth;
  LONG  lMinA;
  LONG  lMinC;
  LONG  lMinD;
  LONG  alReserved[1];
} FD_DEVICEMETRICS, *PFD_DEVICEMETRICS;

/* FD_GLYPHATTR.iMode constants */
#define FO_ATTR_MODE_ROTATE               1

typedef struct _FD_GLYPHATTR {
  ULONG  cjThis;
  ULONG  cGlyphs;
  ULONG  iMode;
  BYTE  aGlyphAttr[1];
} FD_GLYPHATTR, *PFD_GLYPHATTR;

/* FD_GLYPHSET.flAccel */
#define GS_UNICODE_HANDLES                0x00000001
#define GS_8BIT_HANDLES                   0x00000002
#define GS_16BIT_HANDLES                  0x00000004

typedef struct _WCRUN {
  WCHAR  wcLow;
  USHORT  cGlyphs;
  HGLYPH  *phg;
} WCRUN, *PWCRUN;

typedef struct _FD_GLYPHSET {
  ULONG  cjThis;
  FLONG  flAccel;
  ULONG  cGlyphsSupported;
  ULONG  cRuns;
  WCRUN  awcrun[1];
} FD_GLYPHSET, *PFD_GLYPHSET;

typedef struct _FD_KERNINGPAIR {
  WCHAR  wcFirst;
  WCHAR  wcSecond;
  FWORD  fwdKern;
} FD_KERNINGPAIR;

#if defined(_X86_) && !defined(USERMODE_DRIVER)
typedef struct _FLOATOBJ
{
  ULONG  ul1;
  ULONG  ul2;
} FLOATOBJ, *PFLOATOBJ;
#else
typedef FLOAT FLOATOBJ, *PFLOATOBJ;
#endif

typedef struct _FLOATOBJ_XFORM {
  FLOATOBJ  eM11;
  FLOATOBJ  eM12;
  FLOATOBJ  eM21;
  FLOATOBJ  eM22;
  FLOATOBJ  eDx;
  FLOATOBJ  eDy;
} FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM;

/* FONTDIFF.fsSelection */
#define FM_SEL_ITALIC                     0x0001
#define FM_SEL_UNDERSCORE                 0x0002
#define FM_SEL_NEGATIVE                   0x0004
#define FM_SEL_OUTLINED                   0x0008
#define FM_SEL_STRIKEOUT                  0x0010
#define FM_SEL_BOLD                       0x0020
#define FM_SEL_REGULAR                    0x0040

typedef struct _FONTDIFF {
  BYTE  jReserved1;
  BYTE  jReserved2;
  BYTE  jReserved3;
  BYTE  bWeight;
  USHORT  usWinWeight;
  FSHORT  fsSelection;
  FWORD  fwdAveCharWidth;
  FWORD  fwdMaxCharInc;
  POINTL  ptlCaret;
} FONTDIFF;

typedef struct _FONTSIM {
  PTRDIFF  dpBold;
  PTRDIFF  dpItalic;
  PTRDIFF  dpBoldItalic;
} FONTSIM;

/* FONTINFO.flCaps constants */
#define FO_DEVICE_FONT                    1L
#define FO_OUTLINE_CAPABLE                2L

typedef struct _FONTINFO {
  ULONG  cjThis;
  FLONG  flCaps;
  ULONG  cGlyphsSupported;
  ULONG  cjMaxGlyph1;
  ULONG  cjMaxGlyph4;
  ULONG  cjMaxGlyph8;
  ULONG  cjMaxGlyph32;
} FONTINFO, *PFONTINFO;

/* FONTOBJ.flFontType constants */
#define FO_TYPE_RASTER   RASTER_FONTTYPE
#define FO_TYPE_DEVICE   DEVICE_FONTTYPE
#define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE
#define FO_TYPE_OPENTYPE OPENTYPE_FONTTYPE

#define FO_SIM_BOLD      0x00002000
#define FO_SIM_ITALIC    0x00004000
#define FO_EM_HEIGHT     0x00008000
#define FO_GRAY16        0x00010000
#define FO_NOGRAY16      0x00020000
#define FO_NOHINTS       0x00040000
#define FO_NO_CHOICE     0x00080000
#define FO_CFF            0x00100000
#define FO_POSTSCRIPT     0x00200000
#define FO_MULTIPLEMASTER 0x00400000
#define FO_VERT_FACE      0x00800000
#define FO_DBCS_FONT      0X01000000
#define FO_NOCLEARTYPE    0x02000000
#define FO_CLEARTYPE_X    0x10000000
#define FO_CLEARTYPE_Y    0x20000000

typedef struct _FONTOBJ {
  ULONG  iUniq;
  ULONG  iFace;
  ULONG  cxMax;
  FLONG  flFontType;
  ULONG_PTR  iTTUniq;
  ULONG_PTR  iFile;
  SIZE  sizLogResPpi;
  ULONG  ulStyleSize;
  PVOID  pvConsumer;
  PVOID  pvProducer;
} FONTOBJ;

typedef struct _GAMMARAMP {
  WORD  Red[256];
  WORD  Green[256];
  WORD  Blue[256];
} GAMMARAMP, *PGAMMARAMP;

/* GDIINFO.ulPrimaryOrder constants */
#define PRIMARY_ORDER_ABC                 0
#define PRIMARY_ORDER_ACB                 1
#define PRIMARY_ORDER_BAC                 2
#define PRIMARY_ORDER_BCA                 3
#define PRIMARY_ORDER_CBA                 4
#define PRIMARY_ORDER_CAB                 5

/* GDIINFO.ulHTPatternSize constants */
#define HT_PATSIZE_2x2                    0
#define HT_PATSIZE_2x2_M                  1
#define HT_PATSIZE_4x4                    2
#define HT_PATSIZE_4x4_M                  3
#define HT_PATSIZE_6x6                    4
#define HT_PATSIZE_6x6_M                  5
#define HT_PATSIZE_8x8                    6
#define HT_PATSIZE_8x8_M                  7
#define HT_PATSIZE_10x10                  8
#define HT_PATSIZE_10x10_M                9
#define HT_PATSIZE_12x12                  10
#define HT_PATSIZE_12x12_M                11
#define HT_PATSIZE_14x14                  12
#define HT_PATSIZE_14x14_M                13
#define HT_PATSIZE_16x16                  14
#define HT_PATSIZE_16x16_M                15
#define HT_PATSIZE_SUPERCELL              16
#define HT_PATSIZE_SUPERCELL_M            17
#define HT_PATSIZE_USER                   18
#define HT_PATSIZE_MAX_INDEX              HT_PATSIZE_USER
#define HT_PATSIZE_DEFAULT                HT_PATSIZE_SUPERCELL_M
#define HT_USERPAT_CX_MIN                 4
#define HT_USERPAT_CX_MAX                 256
#define HT_USERPAT_CY_MIN                 4
#define HT_USERPAT_CY_MAX                 256

/* GDIINFO.ulHTOutputFormat constants */
#define HT_FORMAT_1BPP                    0
#define HT_FORMAT_4BPP                    2
#define HT_FORMAT_4BPP_IRGB               3
#define HT_FORMAT_8BPP                    4
#define HT_FORMAT_16BPP                   5
#define HT_FORMAT_24BPP                   6
#define HT_FORMAT_32BPP                   7

/* GDIINFO.flHTFlags */
#define HT_FLAG_SQUARE_DEVICE_PEL         0x00000001
#define HT_FLAG_HAS_BLACK_DYE             0x00000002
#define HT_FLAG_ADDITIVE_PRIMS            0x00000004
#define HT_FLAG_USE_8BPP_BITMASK          0x00000008
#define HT_FLAG_INK_HIGH_ABSORPTION       0x00000010
#define HT_FLAG_INK_ABSORPTION_INDICES    0x00000060
#define HT_FLAG_DO_DEVCLR_XFORM           0x00000080
#define HT_FLAG_OUTPUT_CMY                0x00000100
#define HT_FLAG_PRINT_DRAFT_MODE          0x00000200
#define HT_FLAG_INVERT_8BPP_BITMASK_IDX   0x00000400
#define HT_FLAG_8BPP_CMY332_MASK          0xFF000000

#define MAKE_CMYMASK_BYTE(c,m,y)          ((BYTE)(((BYTE)(c) & 0x07) << 5) \
                                          |(BYTE)(((BYTE)(m) & 0x07) << 2) \
                                          |(BYTE)((BYTE)(y) & 0x03))

#define MAKE_CMY332_MASK(c,m,y)           ((DWORD)(((DWORD)(c) & 0x07) << 29)\
                                          |(DWORD)(((DWORD)(m) & 0x07) << 26)\
                                          |(DWORD)(((DWORD)(y) & 0x03) << 24))

/* GDIINFO.flHTFlags constants */
#define HT_FLAG_INK_ABSORPTION_IDX0       0x00000000
#define HT_FLAG_INK_ABSORPTION_IDX1       0x00000020
#define HT_FLAG_INK_ABSORPTION_IDX2       0x00000040
#define HT_FLAG_INK_ABSORPTION_IDX3       0x00000060

#define HT_FLAG_HIGHEST_INK_ABSORPTION    (HT_FLAG_INK_HIGH_ABSORPTION \
                                          |HT_FLAG_INK_ABSORPTION_IDX3)
#define HT_FLAG_HIGHER_INK_ABSORPTION     (HT_FLAG_INK_HIGH_ABSORPTION \
                                          |HT_FLAG_INK_ABSORPTION_IDX2)
#define HT_FLAG_HIGH_INK_ABSORPTION       (HT_FLAG_INK_HIGH_ABSORPTION \
                                          |HT_FLAG_INK_ABSORPTION_IDX1)
#define HT_FLAG_NORMAL_INK_ABSORPTION     HT_FLAG_INK_ABSORPTION_IDX0
#define HT_FLAG_LOW_INK_ABSORPTION        HT_FLAG_INK_ABSORPTION_IDX1
#define HT_FLAG_LOWER_INK_ABSORPTION      HT_FLAG_INK_ABSORPTION_IDX2
#define HT_FLAG_LOWEST_INK_ABSORPTION     HT_FLAG_INK_ABSORPTION_IDX3

#define HT_BITMASKPALRGB                  (DWORD)'0BGR'
#define HT_SET_BITMASKPAL2RGB(pPal)       (*((LPDWORD)(pPal)) = HT_BITMASKPALRGB)
#define HT_IS_BITMASKPALRGB(pPal)         (*((LPDWORD)(pPal)) == (DWORD)0)

/* GDIINFO.ulPhysicalPixelCharacteristics constants */
#define PPC_DEFAULT                       0x0
#define PPC_UNDEFINED                     0x1
#define PPC_RGB_ORDER_VERTICAL_STRIPES    0x2
#define PPC_BGR_ORDER_VERTICAL_STRIPES    0x3
#define PPC_RGB_ORDER_HORIZONTAL_STRIPES  0x4
#define PPC_BGR_ORDER_HORIZONTAL_STRIPES  0x5

#define PPG_DEFAULT                       0
#define PPG_SRGB                          1

typedef struct _GDIINFO {
  ULONG  ulVersion;
  ULONG  ulTechnology;
  ULONG  ulHorzSize;
  ULONG  ulVertSize;
  ULONG  ulHorzRes;
  ULONG  ulVertRes;
  ULONG  cBitsPixel;
  ULONG  cPlanes;
  ULONG  ulNumColors;
  ULONG  flRaster;
  ULONG  ulLogPixelsX;
  ULONG  ulLogPixelsY;
  ULONG  flTextCaps;
  ULONG  ulDACRed;
  ULONG  ulDACGreen;
  ULONG  ulDACBlue;
  ULONG  ulAspectX;
  ULONG  ulAspectY;
  ULONG  ulAspectXY;
  LONG  xStyleStep;
  LONG  yStyleStep;
  LONG  denStyleStep;
  POINTL  ptlPhysOffset;
  SIZEL  szlPhysSize;
  ULONG  ulNumPalReg;
  COLORINFO  ciDevice;
  ULONG  ulDevicePelsDPI;
  ULONG  ulPrimaryOrder;
  ULONG  ulHTPatternSize;
  ULONG  ulHTOutputFormat;
  ULONG  flHTFlags;
  ULONG  ulVRefresh;
  ULONG  ulBltAlignment;
  ULONG  ulPanningHorzRes;
  ULONG  ulPanningVertRes;
  ULONG  xPanningAlignment;
  ULONG  yPanningAlignment;
  ULONG  cxHTPat;
  ULONG  cyHTPat;
  LPBYTE  pHTPatA;
  LPBYTE  pHTPatB;
  LPBYTE  pHTPatC;
  ULONG  flShadeBlend;
  ULONG  ulPhysicalPixelCharacteristics;
  ULONG  ulPhysicalPixelGamma;
} GDIINFO, *PGDIINFO;

/* PATHDATA.flags constants */
#define PD_BEGINSUBPATH                   0x00000001
#define PD_ENDSUBPATH                     0x00000002
#define PD_RESETSTYLE                     0x00000004
#define PD_CLOSEFIGURE                    0x00000008
#define PD_BEZIERS                        0x00000010
#define PD_ALL                            (PD_BEGINSUBPATH \
                                          |PD_ENDSUBPATH \
                                          |PD_RESETSTYLE \
                                          |PD_CLOSEFIGURE \
                                          PD_BEZIERS)

typedef struct _PATHDATA {
  FLONG  flags;
  ULONG  count;
  POINTFIX  *pptfx;
} PATHDATA, *PPATHDATA;

/* PATHOBJ.fl constants */
#define PO_BEZIERS                        0x00000001
#define PO_ELLIPSE                        0x00000002
#define PO_ALL_INTEGERS                   0x00000004
#define PO_ENUM_AS_INTEGERS               0x00000008

typedef struct _PATHOBJ {
  FLONG  fl;
  ULONG  cCurves;
} PATHOBJ;

typedef struct _GLYPHBITS {
  POINTL  ptlOrigin;
  SIZEL  sizlBitmap;
  BYTE  aj[1];
} GLYPHBITS;

typedef union _GLYPHDEF {
  GLYPHBITS  *pgb;
  PATHOBJ  *ppo;
} GLYPHDEF;

typedef struct _GLYPHPOS {
  HGLYPH  hg;
  GLYPHDEF  *pgdf;
  POINTL  ptl;
} GLYPHPOS, *PGLYPHPOS;

typedef struct _GLYPHDATA {
  GLYPHDEF  gdf;
  HGLYPH  hg;
  FIX  fxD;
  FIX  fxA;
  FIX  fxAB;
  FIX  fxInkTop;
  FIX  fxInkBottom;
  RECTL  rclInk;
  POINTQF  ptqD;
} GLYPHDATA;

typedef struct _IFIEXTRA {
  ULONG  ulIdentifier;
  PTRDIFF  dpFontSig;
  ULONG  cig;
  PTRDIFF  dpDesignVector;
  PTRDIFF  dpAxesInfoW;
  ULONG  aulReserved[1];
} IFIEXTRA, *PIFIEXTRA;

/* IFIMETRICS constants */

#define FM_VERSION_NUMBER                 0x0

/* IFIMETRICS.fsType constants */
#define FM_TYPE_LICENSED                  0x2
#define FM_READONLY_EMBED                 0x4
#define FM_EDITABLE_EMBED                 0x8
#define FM_NO_EMBEDDING                   FM_TYPE_LICENSED

/* IFIMETRICS.flInfo constants */
#define FM_INFO_TECH_TRUETYPE             0x00000001
#define FM_INFO_TECH_BITMAP               0x00000002
#define FM_INFO_TECH_STROKE               0x00000004
#define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008
#define FM_INFO_ARB_XFORMS                0x00000010
#define FM_INFO_1BPP                      0x00000020
#define FM_INFO_4BPP                      0x00000040
#define FM_INFO_8BPP                      0x00000080
#define FM_INFO_16BPP                     0x00000100
#define FM_INFO_24BPP                     0x00000200
#define FM_INFO_32BPP                     0x00000400
#define FM_INFO_INTEGER_WIDTH             0x00000800
#define FM_INFO_CONSTANT_WIDTH            0x00001000
#define FM_INFO_NOT_CONTIGUOUS            0x00002000
#define FM_INFO_TECH_MM                   0x00004000
#define FM_INFO_RETURNS_OUTLINES          0x00008000
#define FM_INFO_RETURNS_STROKES           0x00010000
#define FM_INFO_RETURNS_BITMAPS           0x00020000
#define FM_INFO_DSIG                      0x00040000
#define FM_INFO_RIGHT_HANDED              0x00080000
#define FM_INFO_INTEGRAL_SCALING          0x00100000
#define FM_INFO_90DEGREE_ROTATIONS        0x00200000
#define FM_INFO_OPTICALLY_FIXED_PITCH     0x00400000
#define FM_INFO_DO_NOT_ENUMERATE          0x00800000
#define FM_INFO_ISOTROPIC_SCALING_ONLY    0x01000000
#define FM_INFO_ANISOTROPIC_SCALING_ONLY  0x02000000
#define FM_INFO_TECH_CFF                  0x04000000
#define FM_INFO_FAMILY_EQUIV              0x08000000
#define FM_INFO_DBCS_FIXED_PITCH          0x10000000
#define FM_INFO_NONNEGATIVE_AC            0x20000000
#define FM_INFO_IGNORE_TC_RA_ABLE         0x40000000
#define FM_INFO_TECH_TYPE1                0x80000000

#define MAXCHARSETS                       16

/* IFIMETRICS.ulPanoseCulture constants */
#define  FM_PANOSE_CULTURE_LATIN          0x0

typedef struct _IFIMETRICS {
  ULONG  cjThis;
  ULONG  cjIfiExtra;
  PTRDIFF  dpwszFamilyName;
  PTRDIFF  dpwszStyleName;
  PTRDIFF  dpwszFaceName;
  PTRDIFF  dpwszUniqueName;
  PTRDIFF  dpFontSim;
  LONG  lEmbedId;
  LONG  lItalicAngle;
  LONG  lCharBias;
  PTRDIFF  dpCharSets;
  BYTE  jWinCharSet;
  BYTE  jWinPitchAndFamily;
  USHORT  usWinWeight;
  ULONG  flInfo;
  USHORT  fsSelection;
  USHORT  fsType;
  FWORD  fwdUnitsPerEm;
  FWORD  fwdLowestPPEm;
  FWORD  fwdWinAscender;
  FWORD  fwdWinDescender;
  FWORD  fwdMacAscender;
  FWORD  fwdMacDescender;
  FWORD  fwdMacLineGap;
  FWORD  fwdTypoAscender;
  FWORD  fwdTypoDescender;
  FWORD  fwdTypoLineGap;
  FWORD  fwdAveCharWidth;
  FWORD  fwdMaxCharInc;
  FWORD  fwdCapHeight;
  FWORD  fwdXHeight;
  FWORD  fwdSubscriptXSize;
  FWORD  fwdSubscriptYSize;
  FWORD  fwdSubscriptXOffset;
  FWORD  fwdSubscriptYOffset;
  FWORD  fwdSuperscriptXSize;
  FWORD  fwdSuperscriptYSize;
  FWORD  fwdSuperscriptXOffset;
  FWORD  fwdSuperscriptYOffset;
  FWORD  fwdUnderscoreSize;
  FWORD  fwdUnderscorePosition;
  FWORD  fwdStrikeoutSize;
  FWORD  fwdStrikeoutPosition;
  BYTE  chFirstChar;
  BYTE  chLastChar;
  BYTE  chDefaultChar;
  BYTE  chBreakChar;
  WCHAR  wcFirstChar;
  WCHAR  wcLastChar;
  WCHAR  wcDefaultChar;
  WCHAR  wcBreakChar;
  POINTL  ptlBaseline;
  POINTL  ptlAspect;
  POINTL  ptlCaret;
  RECTL  rclFontBox;
  BYTE  achVendId[4];
  ULONG  cKerningPairs;
  ULONG  ulPanoseCulture;
  PANOSE  panose;
#if defined(_WIN64)
  PVOID  Align;
#endif
} IFIMETRICS, *PIFIMETRICS;

/* LINEATTRS.fl */
#define LA_GEOMETRIC                      0x00000001
#define LA_ALTERNATE                      0x00000002
#define LA_STARTGAP                       0x00000004
#define LA_STYLED                         0x00000008

/* LINEATTRS.iJoin */
#define JOIN_ROUND                        0L
#define JOIN_BEVEL                        1L
#define JOIN_MITER                        2L

/* LINEATTRS.iEndCap */
#define ENDCAP_ROUND                      0L
#define ENDCAP_SQUARE                     1L
#define ENDCAP_BUTT                       2L

typedef struct _LINEATTRS {
  FLONG  fl;
  ULONG  iJoin;
  ULONG  iEndCap;
  FLOAT_LONG  elWidth;
  FLOATL  eMiterLimit;
  ULONG  cstyle;
  PFLOAT_LONG  pstyle;
  FLOAT_LONG  elStyleState;
} LINEATTRS, *PLINEATTRS;

typedef struct _PALOBJ {
  ULONG  ulReserved;
} PALOBJ;

typedef struct _PERBANDINFO {
  WINBOOL  bRepeatThisBand;
  SIZEL  szlBand;
  ULONG  ulHorzRes;
  ULONG  ulVertRes;
} PERBANDINFO, *PPERBANDINFO;

/* STROBJ.flAccel constants */
#define SO_FLAG_DEFAULT_PLACEMENT        0x00000001
#define SO_HORIZONTAL                    0x00000002
#define SO_VERTICAL                      0x00000004
#define SO_REVERSED                      0x00000008
#define SO_ZERO_BEARINGS                 0x00000010
#define SO_CHAR_INC_EQUAL_BM_BASE        0x00000020
#define SO_MAXEXT_EQUAL_BM_SIDE          0x00000040
#define SO_DO_NOT_SUBSTITUTE_DEVICE_FONT 0x00000080
#define SO_GLYPHINDEX_TEXTOUT            0x00000100
#define SO_ESC_NOT_ORIENT                0x00000200
#define SO_DXDY                          0x00000400
#define SO_CHARACTER_EXTRA               0x00000800
#define SO_BREAK_EXTRA                   0x00001000

typedef struct _STROBJ {
  ULONG  cGlyphs;
  FLONG  flAccel;
  ULONG  ulCharInc;
  RECTL  rclBkGround;
  GLYPHPOS  *pgp;
  LPWSTR  pwszOrg;
} STROBJ;



/* SURFOBJ.iType constants */
#define STYPE_BITMAP                      0L
#define STYPE_DEVICE                      1L
#define STYPE_DEVBITMAP                   3L

/* SURFOBJ.fjBitmap constants */
#define BMF_TOPDOWN                       0x0001
#define BMF_NOZEROINIT                    0x0002
#define BMF_DONTCACHE                     0x0004
#define BMF_USERMEM                       0x0008
#define BMF_KMSECTION                     0x0010
#define BMF_NOTSYSMEM                     0x0020
#define BMF_WINDOW_BLT                    0x0040
#define BMF_UMPDMEM                       0x0080
#define BMF_RESERVED                      0xFF00

typedef struct _SURFOBJ {
  DHSURF  dhsurf;
  HSURF  hsurf;
  DHPDEV  dhpdev;
  HDEV  hdev;
  SIZEL  sizlBitmap;
  ULONG  cjBits;
  PVOID  pvBits;
  PVOID  pvScan0;
  LONG  lDelta;
  ULONG  iUniq;
  ULONG  iBitmapFormat;
  USHORT  iType;
  USHORT  fjBitmap;
} SURFOBJ;

typedef struct _TYPE1_FONT {
  HANDLE  hPFM;
  HANDLE  hPFB;
  ULONG  ulIdentifier;
} TYPE1_FONT;

typedef struct _WNDOBJ {
  CLIPOBJ  coClient;
  PVOID  pvConsumer;
  RECTL  rclClient;
  SURFOBJ  *psoOwner;
} WNDOBJ, *PWNDOBJ;

typedef struct _XFORML {
  FLOATL  eM11;
  FLOATL  eM12;
  FLOATL  eM21;
  FLOATL  eM22;
  FLOATL  eDx;
  FLOATL  eDy;
} XFORML, *PXFORML;

typedef struct _XFORMOBJ {
  ULONG  ulReserved;
} XFORMOBJ;

/* XLATEOBJ.flXlate constants */
#define XO_TRIVIAL                        0x00000001
#define XO_TABLE                          0x00000002
#define XO_TO_MONO                        0x00000004
#define XO_FROM_CMYK                      0x00000008
#define XO_DEVICE_ICM                     0x00000010
#define XO_HOST_ICM                       0x00000020

typedef struct _XLATEOBJ {
  ULONG  iUniq;
  FLONG  flXlate;
  USHORT  iSrcType;
  USHORT  iDstType;
  ULONG  cEntries;
  ULONG  *pulXlate;
} XLATEOBJ;

/* WNDOBJCHANGEPROC.fl constants */
#define WOC_RGN_CLIENT_DELTA              0x00000001
#define WOC_RGN_CLIENT                    0x00000002
#define WOC_RGN_SURFACE_DELTA             0x00000004
#define WOC_RGN_SURFACE                   0x00000008
#define WOC_CHANGED                       0x00000010
#define WOC_DELETE                        0x00000020
#define WOC_DRAWN                         0x00000040
#define WOC_SPRITE_OVERLAP                0x00000080
#define WOC_SPRITE_NO_OVERLAP             0x00000100

typedef VOID (APIENTRY CALLBACK *WNDOBJCHANGEPROC)(
  WNDOBJ  *pwo,
  FLONG  fl);


WIN32KAPI
HANDLE
APIENTRY
BRUSHOBJ_hGetColorTransform(
  BRUSHOBJ  *pbo);

WIN32KAPI
PVOID
APIENTRY
BRUSHOBJ_pvAllocRbrush(
  BRUSHOBJ  *pbo,
  ULONG  cj);

WIN32KAPI
PVOID
APIENTRY
BRUSHOBJ_pvGetRbrush(
  BRUSHOBJ  *pbo);

WIN32KAPI
ULONG
APIENTRY
BRUSHOBJ_ulGetBrushColor(
  BRUSHOBJ  *pbo);

WIN32KAPI
WINBOOL
APIENTRY
CLIPOBJ_bEnum(
  CLIPOBJ  *pco,
  ULONG  cj,
  ULONG  *pv);

/* CLIPOBJ_cEnumStart.iType constants */
#define CT_RECTANGLES                     0L

/* CLIPOBJ_cEnumStart.iDirection constants */
#define CD_RIGHTDOWN                      0x00000000
#define CD_LEFTDOWN                       0x00000001
#define CD_LEFTWARDS                      0x00000001
#define CD_RIGHTUP                        0x00000002
#define CD_UPWARDS                        0x00000002
#define CD_LEFTUP                         0x00000003
#define CD_ANY                            0x00000004

WIN32KAPI
ULONG
APIENTRY
CLIPOBJ_cEnumStart(
  CLIPOBJ  *pco,
  WINBOOL  bAll,
  ULONG  iType,
  ULONG  iDirection,
  ULONG  cLimit);

WIN32KAPI
PATHOBJ*
APIENTRY
CLIPOBJ_ppoGetPath(
  CLIPOBJ  *pco);

WIN32KAPI
VOID
APIENTRY
EngAcquireSemaphore(
  HSEMAPHORE  hsem);

#define FL_ZERO_MEMORY                    0x00000001
#define FL_NONPAGED_MEMORY                0x00000002

WIN32KAPI
PVOID
APIENTRY
EngAllocMem(
  ULONG  Flags,
  ULONG  MemSize,
  ULONG  Tag);

WIN32KAPI
PVOID
APIENTRY
EngAllocPrivateUserMem(
  PDD_SURFACE_LOCAL  psl,
  SIZE_T  cj,
  ULONG  tag);

WIN32KAPI
PVOID
APIENTRY
EngAllocUserMem(
  SIZE_T  cj,
  ULONG  tag);

WIN32KAPI
WINBOOL
APIENTRY
EngAlphaBlend(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  BLENDOBJ  *pBlendObj);

/* EngAssociateSurface.flHooks constants */
#define HOOK_BITBLT                       0x00000001
#define HOOK_STRETCHBLT                   0x00000002
#define HOOK_PLGBLT                       0x00000004
#define HOOK_TEXTOUT                      0x00000008
#define HOOK_PAINT                        0x00000010
#define HOOK_STROKEPATH                   0x00000020
#define HOOK_FILLPATH                     0x00000040
#define HOOK_STROKEANDFILLPATH            0x00000080
#define HOOK_LINETO                       0x00000100
#define HOOK_COPYBITS                     0x00000400
#define HOOK_MOVEPANNING                  0x00000800
#define HOOK_SYNCHRONIZE                  0x00001000
#define HOOK_STRETCHBLTROP                0x00002000
#define HOOK_SYNCHRONIZEACCESS            0x00004000
#define HOOK_TRANSPARENTBLT               0x00008000
#define HOOK_ALPHABLEND                   0x00010000
#define HOOK_GRADIENTFILL                 0x00020000
#define HOOK_FLAGS                        0x0003b5ff

WIN32KAPI
WINBOOL
APIENTRY
EngAssociateSurface(
  HSURF  hsurf,
  HDEV  hdev,
  FLONG  flHooks);

WIN32KAPI
WINBOOL
APIENTRY
EngBitBlt(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclTrg,
  POINTL  *pptlSrc,
  POINTL  *pptlMask,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrush,
  ROP4  rop4);

WIN32KAPI
WINBOOL
APIENTRY
EngCheckAbort(
  SURFOBJ  *pso);

WIN32KAPI
VOID
APIENTRY
EngClearEvent(
  PEVENT  pEvent);

WIN32KAPI
FD_GLYPHSET*
APIENTRY
EngComputeGlyphSet(
  INT  nCodePage,
  INT  nFirstChar,
  INT  cChars);

/* EngControlSprites.fl constants */
#define ECS_TEARDOWN                      0x00000001
#define ECS_REDRAW                        0x00000002

WIN32KAPI
WINBOOL
APIENTRY
EngControlSprites(
  WNDOBJ  *pwo,
  FLONG  fl);

WIN32KAPI
WINBOOL
APIENTRY
EngCopyBits(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  POINTL  *pptlSrc);

WIN32KAPI
HBITMAP
APIENTRY
EngCreateBitmap(
  SIZEL  sizl,
  LONG  lWidth,
  ULONG  iFormat,
  FLONG  fl,
  PVOID  pvBits);

WIN32KAPI
CLIPOBJ*
APIENTRY
EngCreateClip(
  VOID);

WIN32KAPI
HBITMAP
APIENTRY
EngCreateDeviceBitmap(
  DHSURF  dhsurf,
  SIZEL  sizl,
  ULONG  iFormatCompat);

WIN32KAPI
HSURF
APIENTRY
EngCreateDeviceSurface(
  DHSURF  dhsurf,
  SIZEL  sizl,
  ULONG  iFormatCompat);

#if 0
WIN32KAPI
HDRVOBJ
APIENTRY
EngCreateDriverObj(
  PVOID  pvObj,
  FREEOBJPROC  pFreeObjProc,
  HDEV  hdev);
#endif

WIN32KAPI
WINBOOL
APIENTRY
EngCreateEvent(
  PEVENT  *ppEvent);

/* EngCreatePalette.iMode constants */
#define PAL_INDEXED                       0x00000001
#define PAL_BITFIELDS                     0x00000002
#define PAL_RGB                           0x00000004
#define PAL_BGR                           0x00000008
#define PAL_CMYK                          0x00000010

WIN32KAPI
HPALETTE
APIENTRY
EngCreatePalette(
  ULONG  iMode,
  ULONG  cColors,
  ULONG  *pulColors,
  FLONG  flRed,
  FLONG  flGreen,
  FLONG  flBlue);

WIN32KAPI
PATHOBJ*
APIENTRY
EngCreatePath(
  VOID);

WIN32KAPI
HSEMAPHORE
APIENTRY
EngCreateSemaphore(
  VOID);

/* EngCreateWnd.fl constants */
#define WO_RGN_CLIENT_DELTA               0x00000001
#define WO_RGN_CLIENT                     0x00000002
#define WO_RGN_SURFACE_DELTA              0x00000004
#define WO_RGN_SURFACE                    0x00000008
#define WO_RGN_UPDATE_ALL                 0x00000010
#define WO_RGN_WINDOW                     0x00000020
#define WO_DRAW_NOTIFY                    0x00000040
#define WO_SPRITE_NOTIFY                  0x00000080
#define WO_RGN_DESKTOP_COORD              0x00000100

WIN32KAPI
WNDOBJ*
APIENTRY
EngCreateWnd(
  SURFOBJ  *pso,
  HWND  hwnd,
  WNDOBJCHANGEPROC  pfn,
  FLONG  fl,
  int  iPixelFormat);

WIN32KAPI
VOID
APIENTRY
EngDebugBreak(
  VOID);

WIN32KAPI
VOID
APIENTRY
EngDebugPrint(
  PCHAR StandardPrefix,
  PCHAR DebugMessage,
  va_list ap);

WIN32KAPI
VOID
APIENTRY
EngDeleteClip(
  CLIPOBJ  *pco);

WIN32KAPI
WINBOOL
APIENTRY
EngDeleteDriverObj(
  HDRVOBJ  hdo,
  WINBOOL  bCallBack,
  WINBOOL  bLocked);

WIN32KAPI
WINBOOL
APIENTRY
EngDeleteEvent(
  PEVENT  pEvent);

WIN32KAPI
WINBOOL
APIENTRY
EngDeleteFile(
  LPWSTR  pwszFileName);

WIN32KAPI
WINBOOL
APIENTRY
EngDeletePalette(
  HPALETTE  hpal);

WIN32KAPI
VOID
APIENTRY
EngDeletePath(
  PATHOBJ  *ppo);

WIN32KAPI
VOID
APIENTRY
EngDeleteSafeSemaphore(
  ENGSAFESEMAPHORE  *pssem);

WIN32KAPI
VOID
APIENTRY
EngDeleteSemaphore(
  HSEMAPHORE  hsem);

WIN32KAPI
WINBOOL
APIENTRY
EngDeleteSurface(
  HSURF  hsurf);

WIN32KAPI
VOID
APIENTRY
EngDeleteWnd(
  WNDOBJ  *pwo);

WIN32KAPI
DWORD
APIENTRY
EngDeviceIoControl(
  HANDLE  hDevice,
  DWORD  dwIoControlCode,
  LPVOID  lpInBuffer,
  DWORD  nInBufferSize,
  LPVOID  lpOutBuffer,
  DWORD  nOutBufferSize,
  LPDWORD  lpBytesReturned);

WIN32KAPI
ULONG
APIENTRY
EngDitherColor(
  HDEV  hdev,
  ULONG  iMode,
  ULONG  rgb,
  ULONG  *pul);

WIN32KAPI
WINBOOL
APIENTRY
EngEnumForms(
  HANDLE  hPrinter,
  DWORD  Level,
  LPBYTE  pForm,
  DWORD  cbBuf,
  LPDWORD  pcbNeeded,
  LPDWORD  pcReturned);

WIN32KAPI
WINBOOL
APIENTRY
EngEraseSurface(
  SURFOBJ  *pso,
  RECTL  *prcl,
  ULONG  iColor);

WIN32KAPI
WINBOOL
APIENTRY
EngFillPath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix,
  FLONG  flOptions);

WIN32KAPI
PVOID
APIENTRY
EngFindImageProcAddress(
  HANDLE  hModule,
  LPSTR  lpProcName);

WIN32KAPI
PVOID
APIENTRY
EngFindResource(
  HANDLE  h,
  int  iName,
  int  iType,
  PULONG  pulSize);

WIN32KAPI
PVOID
APIENTRY
EngFntCacheAlloc(
  ULONG  FastCheckSum,
  ULONG  ulSize);

/* EngFntCacheFault.iFaultMode constants */
#define ENG_FNT_CACHE_READ_FAULT          0x00000001
#define ENG_FNT_CACHE_WRITE_FAULT         0x00000002

WIN32KAPI
VOID
APIENTRY
EngFntCacheFault(
  ULONG  ulFastCheckSum,
  ULONG  iFaultMode);

WIN32KAPI
PVOID
APIENTRY
EngFntCacheLookUp(
  ULONG  FastCheckSum,
  ULONG  *pulSize);

WIN32KAPI
VOID
APIENTRY
EngFreeMem(
  PVOID  Mem);

WIN32KAPI
VOID
APIENTRY
EngFreeModule(
  HANDLE  h);

WIN32KAPI
VOID
APIENTRY
EngFreePrivateUserMem(
  PDD_SURFACE_LOCAL  psl,
  PVOID  pv);

WIN32KAPI
VOID
APIENTRY
EngFreeUserMem(
  PVOID  pv);

WIN32KAPI
VOID
APIENTRY
EngGetCurrentCodePage(
  PUSHORT  OemCodePage,
  PUSHORT  AnsiCodePage);

WIN32KAPI
HANDLE
APIENTRY
EngGetCurrentProcessId(
  VOID);

WIN32KAPI
HANDLE
APIENTRY
EngGetCurrentThreadId(
  VOID);

WIN32KAPI
LPWSTR
APIENTRY
EngGetDriverName(
  HDEV  hdev);

WIN32KAPI
WINBOOL
APIENTRY
EngGetFileChangeTime(
  HANDLE  h,
  LARGE_INTEGER  *pChangeTime);

WIN32KAPI
WINBOOL
APIENTRY
EngGetFilePath(
  HANDLE  h,
  WCHAR  (*pDest)[MAX_PATH+1]);

WIN32KAPI
WINBOOL
APIENTRY
EngGetForm(
  HANDLE  hPrinter,
  LPWSTR  pFormName,
  DWORD  Level,
  LPBYTE  pForm,
  DWORD  cbBuf,
  LPDWORD  pcbNeeded);

WIN32KAPI
ULONG
APIENTRY
EngGetLastError(
  VOID);

WIN32KAPI
WINBOOL
APIENTRY
EngGetPrinter(
  HANDLE  hPrinter,
  DWORD  dwLevel,
  LPBYTE  pPrinter,
  DWORD  cbBuf,
  LPDWORD  pcbNeeded);

WIN32KAPI
DWORD
APIENTRY
EngGetPrinterData(
  HANDLE  hPrinter,
  LPWSTR  pValueName,
  LPDWORD  pType,
  LPBYTE  pData,
  DWORD  nSize,
  LPDWORD  pcbNeeded);

WIN32KAPI
LPWSTR
APIENTRY
EngGetPrinterDataFileName(
  HDEV  hdev);

WIN32KAPI
WINBOOL
APIENTRY
EngGetPrinterDriver(
  HANDLE  hPrinter,
  LPWSTR  pEnvironment,
  DWORD  dwLevel,
  BYTE  *lpbDrvInfo,
  DWORD  cbBuf,
  DWORD  *pcbNeeded);

WIN32KAPI
HANDLE
APIENTRY
EngGetProcessHandle(
  VOID);

WIN32KAPI
WINBOOL
APIENTRY
EngGetType1FontList(
  HDEV  hdev,
  TYPE1_FONT  *pType1Buffer,
  ULONG  cjType1Buffer,
  PULONG  pulLocalFonts,
  PULONG  pulRemoteFonts,
  LARGE_INTEGER  *pLastModified);

WIN32KAPI
WINBOOL
APIENTRY
EngGradientFill(
  SURFOBJ  *psoDest,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  TRIVERTEX  *pVertex,
  ULONG  nVertex,
  PVOID  pMesh,
  ULONG  nMesh,
  RECTL  *prclExtents,
  POINTL  *pptlDitherOrg,
  ULONG  ulMode);

/* EngHangNotification return values */
#define EHN_RESTORED                      0x00000000
#define EHN_ERROR                         0x00000001

WIN32KAPI
ULONG
APIENTRY
EngHangNotification(
  HDEV  hDev,
  PVOID  Reserved);

WIN32KAPI
WINBOOL
APIENTRY
EngInitializeSafeSemaphore(
  ENGSAFESEMAPHORE  *pssem);

WIN32KAPI
WINBOOL
APIENTRY
EngIsSemaphoreOwned(
  HSEMAPHORE  hsem);

WIN32KAPI
WINBOOL
APIENTRY
EngIsSemaphoreOwnedByCurrentThread(
  HSEMAPHORE  hsem);

WIN32KAPI
WINBOOL
APIENTRY
EngLineTo(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  LONG  x1,
  LONG  y1,
  LONG  x2,
  LONG  y2,
  RECTL  *prclBounds,
  MIX  mix);

WIN32KAPI
HANDLE
APIENTRY
EngLoadImage(
  LPWSTR  pwszDriver);

WIN32KAPI
HANDLE
APIENTRY
EngLoadModule(
  LPWSTR  pwsz);

WIN32KAPI
HANDLE
APIENTRY
EngLoadModuleForWrite(
  LPWSTR  pwsz,
  ULONG  cjSizeOfModule);

WIN32KAPI
PDD_SURFACE_LOCAL
APIENTRY
EngLockDirectDrawSurface(
  HANDLE  hSurface);

WIN32KAPI
DRIVEROBJ*
APIENTRY
EngLockDriverObj(
  HDRVOBJ  hdo);

WIN32KAPI
SURFOBJ*
APIENTRY
EngLockSurface(
  HSURF  hsurf);

WIN32KAPI
WINBOOL
APIENTRY
EngLpkInstalled(
  VOID);

WIN32KAPI
PEVENT
APIENTRY
EngMapEvent(
  HDEV  hDev,
  HANDLE  hUserObject,
  PVOID  Reserved1,
  PVOID  Reserved2,
  PVOID  Reserved3);

WIN32KAPI
PVOID
APIENTRY
EngMapFile(
  LPWSTR  pwsz,
  ULONG  cjSize,
  ULONG_PTR  *piFile);

WIN32KAPI
WINBOOL
APIENTRY
EngMapFontFile(
  ULONG_PTR  iFile,
  PULONG  *ppjBuf,
  ULONG  *pcjBuf);

WIN32KAPI
WINBOOL
APIENTRY
EngMapFontFileFD(
  ULONG_PTR  iFile,
  PULONG  *ppjBuf,
  ULONG  *pcjBuf);

WIN32KAPI
PVOID
APIENTRY
EngMapModule(
  HANDLE  h,
  PULONG  pSize);

WIN32KAPI
WINBOOL
APIENTRY
EngMarkBandingSurface(
  HSURF  hsurf);

/* EngModifySurface.flSurface constants */
#define MS_NOTSYSTEMMEMORY                0x00000001
#define MS_SHAREDACCESS                   0x00000002

WIN32KAPI
WINBOOL
APIENTRY
EngModifySurface(
  HSURF  hsurf,
  HDEV  hdev,
  FLONG  flHooks,
  FLONG  flSurface,
  DHSURF  dhsurf,
  VOID  *pvScan0,
  LONG  lDelta,
  VOID  *pvReserved);

WIN32KAPI
VOID
APIENTRY
EngMovePointer(
  SURFOBJ  *pso,
  LONG  x,
  LONG  y,
  RECTL  *prcl);

WIN32KAPI
int
APIENTRY
EngMulDiv(
  int  a,
  int  b,
  int  c);

WIN32KAPI
VOID
APIENTRY
EngMultiByteToUnicodeN(
  LPWSTR  UnicodeString,
  ULONG  MaxBytesInUnicodeString,
  PULONG  BytesInUnicodeString,
  PCHAR  MultiByteString,
  ULONG  BytesInMultiByteString);

WIN32KAPI
INT
APIENTRY
EngMultiByteToWideChar(
  UINT  CodePage,
  LPWSTR  WideCharString,
  INT  BytesInWideCharString,
  LPSTR  MultiByteString,
  INT  BytesInMultiByteString);

WIN32KAPI
WINBOOL
APIENTRY
EngPaint(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix);

WIN32KAPI
WINBOOL
APIENTRY
EngPlgBlt(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMsk,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlBrushOrg,
  POINTFIX  *pptfx,
  RECTL  *prcl,
  POINTL  *pptl,
  ULONG  iMode);

WIN32KAPI
VOID
APIENTRY
EngProbeForRead(
  PVOID  Address,
  ULONG  Length,
  ULONG  Alignment);

WIN32KAPI
VOID
APIENTRY
EngProbeForReadAndWrite(
  PVOID  Address,
  ULONG  Length,
  ULONG  Alignment);

typedef enum _ENG_DEVICE_ATTRIBUTE {
  QDA_RESERVED = 0,
  QDA_ACCELERATION_LEVEL
} ENG_DEVICE_ATTRIBUTE;

WIN32KAPI
WINBOOL
APIENTRY
EngQueryDeviceAttribute(
  HDEV  hdev,
  ENG_DEVICE_ATTRIBUTE  devAttr,
  VOID  *pvIn,
  ULONG  ulInSize,
  VOID  *pvOut,
  ULONG  ulOutSize);

WIN32KAPI
LARGE_INTEGER
APIENTRY
EngQueryFileTimeStamp(
  LPWSTR  pwsz);

WIN32KAPI
VOID
APIENTRY
EngQueryLocalTime(
  PENG_TIME_FIELDS  ptf);

WIN32KAPI
ULONG
APIENTRY
EngQueryPalette(
  HPALETTE  hPal,
  ULONG  *piMode,
  ULONG  cColors,
  ULONG  *pulColors);

WIN32KAPI
VOID
APIENTRY
EngQueryPerformanceCounter(
  LONGLONG  *pPerformanceCount);

WIN32KAPI
VOID
APIENTRY
EngQueryPerformanceFrequency(
  LONGLONG  *pFrequency);

typedef enum _ENG_SYSTEM_ATTRIBUTE {
  EngProcessorFeature = 1,
  EngNumberOfProcessors,
  EngOptimumAvailableUserMemory,
  EngOptimumAvailableSystemMemory,
} ENG_SYSTEM_ATTRIBUTE;

#define QSA_MMX                           0x00000100
#define QSA_SSE                           0x00002000
#define QSA_3DNOW                         0x00004000

WIN32KAPI
WINBOOL
APIENTRY
EngQuerySystemAttribute(
  ENG_SYSTEM_ATTRIBUTE  CapNum,
  PDWORD  pCapability);

WIN32KAPI
LONG
APIENTRY
EngReadStateEvent(
  PEVENT  pEvent);

WIN32KAPI
VOID
APIENTRY
EngReleaseSemaphore(
  HSEMAPHORE  hsem);

WIN32KAPI
WINBOOL
APIENTRY
EngRestoreFloatingPointState(
  VOID  *pBuffer);

WIN32KAPI
ULONG
APIENTRY
EngSaveFloatingPointState(
  VOID  *pBuffer,
  ULONG  cjBufferSize);

WIN32KAPI
HANDLE
APIENTRY
EngSecureMem(
  PVOID  Address,
  ULONG  Length);

WIN32KAPI
LONG
APIENTRY
EngSetEvent(
  PEVENT  pEvent);

WIN32KAPI
VOID
APIENTRY
EngSetLastError(
  ULONG  iError);

WIN32KAPI
ULONG
APIENTRY
EngSetPointerShape(
  SURFOBJ  *pso,
  SURFOBJ  *psoMask,
  SURFOBJ  *psoColor,
  XLATEOBJ  *pxlo,
  LONG  xHot,
  LONG  yHot,
  LONG  x,
  LONG  y,
  RECTL  *prcl,
  FLONG  fl);

WIN32KAPI
WINBOOL
APIENTRY
EngSetPointerTag(
  HDEV  hdev,
  SURFOBJ  *psoMask,
  SURFOBJ  *psoColor,
  XLATEOBJ  *pxlo,
  FLONG  fl);

WIN32KAPI
DWORD
APIENTRY
EngSetPrinterData(
  HANDLE  hPrinter,
  LPWSTR  pType,
  DWORD  dwType,
  LPBYTE  lpbPrinterData,
  DWORD  cjPrinterData);

typedef int (CDECL *SORTCOMP)(const void *pv1, const void *pv2);

WIN32KAPI
VOID
APIENTRY
EngSort(
  PBYTE  pjBuf,
  ULONG  c,
  ULONG  cjElem,
  SORTCOMP  pfnComp);

WIN32KAPI
WINBOOL
APIENTRY
EngStretchBlt(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode);

WIN32KAPI
WINBOOL
APIENTRY
EngStretchBltROP(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode,
  BRUSHOBJ  *pbo,
  DWORD  rop4);

WIN32KAPI
WINBOOL
APIENTRY
EngStrokeAndFillPath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pboStroke,
  LINEATTRS  *plineattrs,
  BRUSHOBJ  *pboFill,
  POINTL  *pptlBrushOrg,
  MIX  mixFill,
  FLONG  flOptions);

WIN32KAPI
WINBOOL
APIENTRY
EngStrokePath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  LINEATTRS  *plineattrs,
  MIX  mix);

WIN32KAPI
WINBOOL
APIENTRY
EngTextOut(
  SURFOBJ  *pso,
  STROBJ  *pstro,
  FONTOBJ  *pfo,
  CLIPOBJ  *pco,
  RECTL  *prclExtra,
  RECTL  *prclOpaque,
  BRUSHOBJ  *pboFore,
  BRUSHOBJ  *pboOpaque,
  POINTL  *pptlOrg,
  MIX  mix);

WIN32KAPI
WINBOOL
APIENTRY
EngTransparentBlt(
  SURFOBJ  *psoDst,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDst,
  RECTL  *prclSrc,
  ULONG  iTransColor,
  ULONG  ulReserved);

WIN32KAPI
VOID
APIENTRY
EngUnicodeToMultiByteN(
  PCHAR  MultiByteString,
  ULONG  MaxBytesInMultiByteString,
  PULONG  BytesInMultiByteString,
  PWSTR  UnicodeString,
  ULONG  BytesInUnicodeString);

WIN32KAPI
VOID
APIENTRY
EngUnloadImage(
  HANDLE  hModule);

WIN32KAPI
WINBOOL
APIENTRY
EngUnlockDirectDrawSurface(
  PDD_SURFACE_LOCAL  pSurface);

WIN32KAPI
WINBOOL
APIENTRY
EngUnlockDriverObj(
  HDRVOBJ  hdo);

WIN32KAPI
VOID
APIENTRY
EngUnlockSurface(
  SURFOBJ  *pso);

WIN32KAPI
WINBOOL
APIENTRY
EngUnmapEvent(
  PEVENT  pEvent);

WIN32KAPI
WINBOOL
APIENTRY
EngUnmapFile(
  ULONG_PTR  iFile);

WIN32KAPI
VOID
APIENTRY
EngUnmapFontFile(
  ULONG_PTR  iFile);

WIN32KAPI
VOID
APIENTRY
EngUnmapFontFileFD(
  ULONG_PTR  iFile);

WIN32KAPI
VOID
APIENTRY
EngUnsecureMem(
  HANDLE  hSecure);

WIN32KAPI
WINBOOL
APIENTRY
EngWaitForSingleObject(
  PEVENT  pEvent,
  PLARGE_INTEGER  pTimeOut);

WIN32KAPI
INT
APIENTRY
EngWideCharToMultiByte(
  UINT  CodePage,
  LPWSTR  WideCharString,
  INT  BytesInWideCharString,
  LPSTR  MultiByteString,
  INT  BytesInMultiByteString);

WIN32KAPI
WINBOOL
APIENTRY
EngWritePrinter(
  HANDLE  hPrinter,
  LPVOID  pBuf,
  DWORD  cbBuf,
  LPDWORD  pcWritten);

#if defined(_X86_) && !defined(USERMODE_DRIVER)
WIN32KAPI
VOID
APIENTRY
FLOATOBJ_Add(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_AddFloat(
  PFLOATOBJ  pf,
  FLOATL  f);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_AddLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_Div(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_DivFloat(
  PFLOATOBJ  pf,
  FLOATL  f);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_DivLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_Equal(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_EqualLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
LONG
APIENTRY
FLOATOBJ_GetFloat(
  PFLOATOBJ  pf);

WIN32KAPI
LONG
APIENTRY
FLOATOBJ_GetLong(
  PFLOATOBJ  pf);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_GreaterThan(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_GreaterThanLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_LessThan(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
WINBOOL
APIENTRY
FLOATOBJ_LessThanLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_Mul(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_MulFloat(
  PFLOATOBJ  pf,
  FLOATL  f);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_MulLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_Neg(
  PFLOATOBJ  pf);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_SetFloat(
  PFLOATOBJ  pf,
  FLOATL  f);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_SetLong(
  PFLOATOBJ  pf,
  LONG  l);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_Sub(
  PFLOATOBJ  pf,
  PFLOATOBJ  pf1);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_SubFloat(
  PFLOATOBJ  pf,
  FLOATL  f);

WIN32KAPI
VOID
APIENTRY
FLOATOBJ_SubLong(
  PFLOATOBJ  pf,
  LONG  l);

#else

#define FLOATOBJ_SetFloat(pf, f)        {*(pf) = (f);}
#define FLOATOBJ_SetLong(pf, l)         {*(pf) = (FLOAT)(l);}
#define FLOATOBJ_GetFloat(pf)           (*(PULONG)(pf))
#define FLOATOBJ_GetLong(pf)            ((LONG)*(pf))
#define FLOATOBJ_Add(pf, pf1)           {*(pf) += *(pf1);}
#define FLOATOBJ_AddFloat(pf, f)        {*(pf) += (f);}
#define FLOATOBJ_AddLong(pf, l)         {*(pf) += (l);}
#define FLOATOBJ_Sub(pf, pf1)           {*(pf) -= *(pf1);}
#define FLOATOBJ_SubFloat(pf, f)        {*(pf) -= (f);}
#define FLOATOBJ_SubLong(pf, l)         {*(pf) -= (l);}
#define FLOATOBJ_Mul(pf, pf1)           {*(pf) *= *(pf1);}
#define FLOATOBJ_MulFloat(pf, f)        {*(pf) *= (f);}
#define FLOATOBJ_MulLong(pf, l)         {*(pf) *= (l);}
#define FLOATOBJ_Div(pf, pf1)           {*(pf) /= *(pf1);}
#define FLOATOBJ_DivFloat(pf, f)        {*(pf) /= (f);}
#define FLOATOBJ_DivLong(pf, l)         {*(pf) /= (l);}
#define FLOATOBJ_Neg(pf)                {*(pf) = -(*(pf));}
#define FLOATOBJ_Equal(pf, pf1)         (*(pf) == *(pf1))
#define FLOATOBJ_GreaterThan(pf, pf1)   (*(pf) > *(pf1))
#define FLOATOBJ_LessThan(pf, pf1)      (*(pf) < *(pf1))
#define FLOATOBJ_EqualLong(pf, l)       (*(pf) == (FLOAT)(l))
#define FLOATOBJ_GreaterThanLong(pf, l) (*(pf) > (FLOAT)(l))
#define FLOATOBJ_LessThanLong(pf, l)    (*(pf) < (FLOAT)(l))

#endif

WIN32KAPI
ULONG
APIENTRY
FONTOBJ_cGetAllGlyphHandles(
  FONTOBJ  *pfo,
  HGLYPH  *phg);

WIN32KAPI
ULONG
APIENTRY
FONTOBJ_cGetGlyphs(
  FONTOBJ  *pfo,
  ULONG  iMode,
  ULONG  cGlyph,
  HGLYPH  *phg,
  PVOID  *ppvGlyph);

WIN32KAPI
FD_GLYPHSET*
APIENTRY
FONTOBJ_pfdg(
  FONTOBJ  *pfo);

WIN32KAPI
IFIMETRICS*
APIENTRY
FONTOBJ_pifi(
  FONTOBJ  *pfo);

WIN32KAPI
PBYTE
APIENTRY
FONTOBJ_pjOpenTypeTablePointer(
  FONTOBJ  *pfo,
  ULONG  ulTag,
  ULONG  *pcjTable);

WIN32KAPI
PFD_GLYPHATTR
APIENTRY
FONTOBJ_pQueryGlyphAttrs(
  FONTOBJ  *pfo,
  ULONG  iMode);

WIN32KAPI
PVOID
APIENTRY
FONTOBJ_pvTrueTypeFontFile(
  FONTOBJ  *pfo,
  ULONG  *pcjFile);

WIN32KAPI
LPWSTR
APIENTRY
FONTOBJ_pwszFontFilePaths(
  FONTOBJ  *pfo,
  ULONG  *pcwc);

WIN32KAPI
XFORMOBJ*
APIENTRY
FONTOBJ_pxoGetXform(
  FONTOBJ  *pfo);

WIN32KAPI
VOID
APIENTRY
FONTOBJ_vGetInfo(
  FONTOBJ  *pfo,
  ULONG  cjSize,
  FONTINFO  *pfi);



WIN32KAPI
LONG
APIENTRY
HT_ComputeRGBGammaTable(
  USHORT  GammaTableEntries,
  USHORT  GammaTableType,
  USHORT  RedGamma,
  USHORT  GreenGamma,
  USHORT  BlueGamma,
  LPBYTE  pGammaTable);

WIN32KAPI
LONG
APIENTRY
HT_Get8BPPFormatPalette(
  LPPALETTEENTRY  pPaletteEntry,
  USHORT  RedGamma,
  USHORT  GreenGamma,
  USHORT  BlueGamma);

WIN32KAPI
LONG
APIENTRY
HT_Get8BPPMaskPalette(
  LPPALETTEENTRY  pPaletteEntry,
  WINBOOL  Use8BPPMaskPal,
  BYTE  CMYMask,
  USHORT  RedGamma,
  USHORT  GreenGamma,
  USHORT  BlueGamma);

WIN32KAPI
LONG
APIENTRY
HTUI_DeviceColorAdjustment(
  LPSTR  pDeviceName,
  PDEVHTADJDATA  pDevHTAdjData);

WIN32KAPI
ULONG
APIENTRY
PALOBJ_cGetColors(
  PALOBJ  *ppalo,
  ULONG  iStart,
  ULONG  cColors,
  ULONG  *pulColors);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bCloseFigure(
  PATHOBJ  *ppo);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bEnum(
  PATHOBJ  *ppo,
  PATHDATA  *ppd);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bEnumClipLines(
  PATHOBJ  *ppo,
  ULONG  cb,
  CLIPLINE  *pcl);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bMoveTo(
  PATHOBJ  *ppo,
  POINTFIX  ptfx);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bPolyBezierTo(
  PATHOBJ  *ppo,
  POINTFIX  *pptfx,
  ULONG  cptfx);

WIN32KAPI
WINBOOL
APIENTRY
PATHOBJ_bPolyLineTo(
  PATHOBJ  *ppo,
  POINTFIX  *pptfx,
  ULONG  cptfx);

WIN32KAPI
VOID
APIENTRY
PATHOBJ_vEnumStart(
  PATHOBJ  *ppo);

WIN32KAPI
VOID
APIENTRY
PATHOBJ_vEnumStartClipLines(
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  SURFOBJ  *pso,
  LINEATTRS  *pla);

WIN32KAPI
VOID
APIENTRY
PATHOBJ_vGetBounds(
  PATHOBJ  *ppo,
  PRECTFX  prectfx);

WIN32KAPI
WINBOOL
APIENTRY
STROBJ_bEnum(
  STROBJ  *pstro,
  ULONG  *pc,
  PGLYPHPOS  *ppgpos);

WIN32KAPI
WINBOOL
APIENTRY
STROBJ_bEnumPositionsOnly(
  STROBJ  *pstro,
  ULONG  *pc,
  PGLYPHPOS  *ppgpos);

WIN32KAPI
WINBOOL
APIENTRY
STROBJ_bGetAdvanceWidths(
  STROBJ  *pso,
  ULONG  iFirst,
  ULONG  c,
  POINTQF  *pptqD);

WIN32KAPI
DWORD
APIENTRY
STROBJ_dwGetCodePage(
  STROBJ  *pstro);

WIN32KAPI
FIX
APIENTRY
STROBJ_fxBreakExtra(
  STROBJ  *pstro);

WIN32KAPI
FIX
APIENTRY
STROBJ_fxCharacterExtra(
  STROBJ  *pstro);

WIN32KAPI
VOID
APIENTRY
STROBJ_vEnumStart(
  STROBJ  *pstro);

WIN32KAPI
WINBOOL
APIENTRY
WNDOBJ_bEnum(
  WNDOBJ  *pwo,
  ULONG  cj,
  ULONG  *pul);

WIN32KAPI
ULONG
APIENTRY
WNDOBJ_cEnumStart(
  WNDOBJ  *pwo,
  ULONG  iType,
  ULONG  iDirection,
  ULONG  cLimit);

WIN32KAPI
VOID
APIENTRY
WNDOBJ_vSetConsumer(
  WNDOBJ  *pwo,
  PVOID  pvConsumer);

/* XFORMOBJ_bApplyXform.iMode constants */
#define XF_LTOL                           0L
#define XF_INV_LTOL                       1L
#define XF_LTOFX                          2L
#define XF_INV_FXTOL                      3L

WIN32KAPI
WINBOOL
APIENTRY
XFORMOBJ_bApplyXform(
  XFORMOBJ  *pxo,
  ULONG  iMode,
  ULONG  cPoints,
  PVOID  pvIn,
  PVOID  pvOut);

WIN32KAPI
ULONG
APIENTRY
XFORMOBJ_iGetFloatObjXform(
  XFORMOBJ  *pxo,
  FLOATOBJ_XFORM  *pxfo);

WIN32KAPI
ULONG
APIENTRY
XFORMOBJ_iGetXform(
  XFORMOBJ  *pxo,
  XFORML  *pxform);

/* XLATEOBJ_cGetPalette.iPal constants */
#define XO_SRCPALETTE                     1
#define XO_DESTPALETTE                    2
#define XO_DESTDCPALETTE                  3
#define XO_SRCBITFIELDS                   4
#define XO_DESTBITFIELDS                  5

WIN32KAPI
ULONG
APIENTRY
XLATEOBJ_cGetPalette(
  XLATEOBJ  *pxlo,
  ULONG  iPal,
  ULONG  cPal,
  ULONG  *pPal);

WIN32KAPI
HANDLE
APIENTRY
XLATEOBJ_hGetColorTransform(
  XLATEOBJ  *pxlo);

WIN32KAPI
ULONG
APIENTRY
XLATEOBJ_iXlate(
  XLATEOBJ  *pxlo,
  ULONG  iColor);

WIN32KAPI
ULONG*
APIENTRY
XLATEOBJ_piVector(
  XLATEOBJ  *pxlo);



/* Graphics Driver Functions */

WINBOOL
APIENTRY
DrvAlphaBlend(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  BLENDOBJ  *pBlendObj);

WINBOOL
APIENTRY
DrvAssertMode(
  DHPDEV  dhpdev,
  WINBOOL  bEnable);

WINBOOL
APIENTRY
DrvBitBlt(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclTrg,
  POINTL  *pptlSrc,
  POINTL  *pptlMask,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrush,
  ROP4  rop4);

VOID
APIENTRY
DrvCompletePDEV(
  DHPDEV  dhpdev,
  HDEV  hdev);

WINBOOL
APIENTRY
DrvCopyBits(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  POINTL  *pptlSrc);

HBITMAP
APIENTRY
DrvCreateDeviceBitmap(
  DHPDEV  dhpdev,
  SIZEL  sizl,
  ULONG  iFormat);

VOID
APIENTRY
DrvDeleteDeviceBitmap(
  DHSURF  dhsurf);

HBITMAP
APIENTRY
DrvDeriveSurface(
  DD_DIRECTDRAW_GLOBAL  *pDirectDraw,
  DD_SURFACE_LOCAL  *pSurface);

LONG
APIENTRY
DrvDescribePixelFormat(
  DHPDEV  dhpdev,
  LONG  iPixelFormat,
  ULONG  cjpfd,
  PIXELFORMATDESCRIPTOR  *ppfd);

VOID
APIENTRY
DrvDestroyFont(
  FONTOBJ  *pfo);

VOID
APIENTRY
DrvDisableDriver(
  VOID);

VOID
APIENTRY
DrvDisablePDEV(
  DHPDEV  dhpdev);

VOID
APIENTRY
DrvDisableSurface(
  DHPDEV  dhpdev);

#define DM_DEFAULT                        0x00000001
#define DM_MONOCHROME                     0x00000002

ULONG
APIENTRY
DrvDitherColor(
  DHPDEV  dhpdev,
  ULONG  iMode,
  ULONG  rgb,
  ULONG  *pul);

ULONG
APIENTRY
DrvDrawEscape(
  SURFOBJ  *pso,
  ULONG  iEsc,
  CLIPOBJ  *pco,
  RECTL  *prcl,
  ULONG  cjIn,
  PVOID  pvIn);

WINBOOL
APIENTRY
DrvEnableDriver(
  ULONG  iEngineVersion,
  ULONG  cj,
  DRVENABLEDATA  *pded);

DHPDEV
APIENTRY
DrvEnablePDEV(
  DEVMODEW  *pdm,
  LPWSTR  pwszLogAddress,
  ULONG  cPat,
  HSURF  *phsurfPatterns,
  ULONG  cjCaps,
  ULONG  *pdevcaps,
  ULONG  cjDevInfo,
  DEVINFO  *pdi,
  HDEV  hdev,
  LPWSTR  pwszDeviceName,
  HANDLE  hDriver);

HSURF
APIENTRY
DrvEnableSurface(
  DHPDEV  dhpdev);

/* DrvEndDoc.fl constants */
#define ED_ABORTDOC                       0x00000001

WINBOOL
APIENTRY
DrvEndDoc(
  SURFOBJ  *pso,
  FLONG  fl);

ULONG
APIENTRY
DrvEscape(
  SURFOBJ  *pso,
  ULONG  iEsc,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

WINBOOL
APIENTRY
DrvFillPath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix,
  FLONG  flOptions);

ULONG
APIENTRY
DrvFontManagement(
  SURFOBJ  *pso,
  FONTOBJ  *pfo,
  ULONG  iMode,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

VOID
APIENTRY
DrvFree(
  PVOID  pv,
  ULONG_PTR  id);

/* DrvGetGlyphMode return values */
#define FO_HGLYPHS                        0L
#define FO_GLYPHBITS                      1L
#define FO_PATHOBJ                        2L

ULONG
APIENTRY
DrvGetGlyphMode(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo);

ULONG
APIENTRY
DrvGetModes(
  HANDLE  hDriver,
  ULONG  cjSize,
  DEVMODEW  *pdm);

PVOID
APIENTRY
DrvGetTrueTypeFile(
  ULONG_PTR  iFile,
  ULONG  *pcj);

WINBOOL
APIENTRY
DrvGradientFill(
  SURFOBJ  *psoDest,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  TRIVERTEX  *pVertex,
  ULONG  nVertex,
  PVOID  pMesh,
  ULONG  nMesh,
  RECTL  *prclExtents,
  POINTL  *pptlDitherOrg,
  ULONG  ulMode);

WINBOOL
APIENTRY
DrvIcmCheckBitmapBits(
  DHPDEV  dhpdev,
  HANDLE  hColorTransform,
  SURFOBJ  *pso,
  PBYTE  paResults);

HANDLE
APIENTRY
DrvIcmCreateColorTransform(
  DHPDEV  dhpdev,
  LPLOGCOLORSPACEW  pLogColorSpace,
  PVOID  pvSourceProfile,
  ULONG  cjSourceProfile,
  PVOID  pvDestProfile,
  ULONG  cjDestProfile,
  PVOID  pvTargetProfile,
  ULONG  cjTargetProfile,
  DWORD  dwReserved);

WINBOOL
APIENTRY
DrvIcmDeleteColorTransform(
  DHPDEV  dhpdev,
  HANDLE  hcmXform);

/* DrvIcmSetDeviceGammaRamp.iFormat constants */
#define IGRF_RGB_256BYTES                 0x00000000
#define IGRF_RGB_256WORDS                 0x00000001

WINBOOL
APIENTRY
DrvIcmSetDeviceGammaRamp(
  DHPDEV  dhpdev,
  ULONG  iFormat,
  LPVOID  lpRamp);

WINBOOL
APIENTRY
DrvLineTo(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  LONG  x1,
  LONG  y1,
  LONG  x2,
  LONG  y2,
  RECTL  *prclBounds,
  MIX  mix);

ULONG_PTR
APIENTRY
DrvLoadFontFile(
  ULONG  cFiles,
  ULONG_PTR  *piFile,
  PVOID  *ppvView,
  ULONG  *pcjView,
  DESIGNVECTOR  *pdv,
  ULONG  ulLangID,
  ULONG  ulFastCheckSum);

VOID
APIENTRY
DrvMovePointer(
  SURFOBJ  *pso,
  LONG  x,
  LONG  y,
  RECTL  *prcl);

WINBOOL
APIENTRY
DrvNextBand(
  SURFOBJ  *pso,
  POINTL  *pptl);

VOID
APIENTRY
DrvNotify(
  SURFOBJ  *pso,
  ULONG  iType,
  PVOID  pvData);

WINBOOL
APIENTRY
DrvOffset(
  SURFOBJ  *pso,
  LONG  x,
  LONG  y,
  FLONG  flReserved);

WINBOOL
APIENTRY
DrvPaint(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix);

WINBOOL
APIENTRY
DrvPlgBlt(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMsk,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlBrushOrg,
  POINTFIX  *pptfx,
  RECTL  *prcl,
  POINTL  *pptl,
  ULONG  iMode);

/* DrvQueryAdvanceWidths.iMode constants */
#define QAW_GETWIDTHS                     0
#define QAW_GETEASYWIDTHS                 1

WINBOOL
APIENTRY
DrvQueryAdvanceWidths(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  ULONG  iMode,
  HGLYPH  *phg,
  PVOID  pvWidths,
  ULONG  cGlyphs);

/* DrvQueryDeviceSupport.iType constants */
#define QDS_CHECKJPEGFORMAT               0x00000000
#define QDS_CHECKPNGFORMAT                0x00000001

WINBOOL
APIENTRY
DrvQueryDeviceSupport(
  SURFOBJ  *pso,
  XLATEOBJ  *pxlo,
  XFORMOBJ  *pxo,
  ULONG  iType,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

/* DrvQueryDriverInfo.dwMode constants */
#define DRVQUERY_USERMODE                 0x00000001

WINBOOL
APIENTRY
DrvQueryDriverInfo(
  DWORD  dwMode,
  PVOID  pBuffer,
  DWORD  cbBuf,
  PDWORD  pcbNeeded);

PIFIMETRICS
APIENTRY
DrvQueryFont(
  DHPDEV  dhpdev,
  ULONG_PTR  iFile,
  ULONG  iFace,
  ULONG_PTR  *pid);

/* DrvQueryFontCaps.pulCaps constants */
#define QC_OUTLINES                       0x00000001
#define QC_1BIT                           0x00000002
#define QC_4BIT                           0x00000004

#define QC_FONTDRIVERCAPS (QC_OUTLINES | QC_1BIT | QC_4BIT)

LONG
APIENTRY
DrvQueryFontCaps(
  ULONG  culCaps,
  ULONG  *pulCaps);

/* DrvQueryFontData.iMode constants */
#define QFD_GLYPHANDBITMAP                1L
#define QFD_GLYPHANDOUTLINE               2L
#define QFD_MAXEXTENTS                    3L
#define QFD_TT_GLYPHANDBITMAP             4L
#define QFD_TT_GRAY1_BITMAP               5L
#define QFD_TT_GRAY2_BITMAP               6L
#define QFD_TT_GRAY4_BITMAP               8L
#define QFD_TT_GRAY8_BITMAP               9L

#define QFD_TT_MONO_BITMAP QFD_TT_GRAY1_BITMAP

LONG
APIENTRY
DrvQueryFontData(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  ULONG  iMode,
  HGLYPH  hg,
  GLYPHDATA  *pgd,
  PVOID  pv,
  ULONG  cjSize);

/* DrvQueryFontFile.ulMode constants */
#define QFF_DESCRIPTION                   0x00000001
#define QFF_NUMFACES                      0x00000002

LONG
APIENTRY
DrvQueryFontFile(
  ULONG_PTR  iFile,
  ULONG  ulMode,
  ULONG  cjBuf,
  ULONG  *pulBuf);

/* DrvQueryFontTree.iMode constants */
#define QFT_UNICODE                       0L
#define QFT_LIGATURES                     1L
#define QFT_KERNPAIRS                     2L
#define QFT_GLYPHSET                      3L

PVOID
APIENTRY
DrvQueryFontTree(
  DHPDEV  dhpdev,
  ULONG_PTR  iFile,
  ULONG  iFace,
  ULONG  iMode,
  ULONG_PTR  *pid);

PFD_GLYPHATTR
APIENTRY
DrvQueryGlyphAttrs(
  FONTOBJ  *pfo,
  ULONG  iMode);

ULONG
APIENTRY
DrvQueryPerBandInfo(
  SURFOBJ  *pso,
  PERBANDINFO  *pbi);

/* DrvQueryTrueTypeOutline.bMetricsOnly constants */
#define TTO_METRICS_ONLY                  0x00000001
#define TTO_QUBICS                        0x00000002
#define TTO_UNHINTED                      0x00000004

LONG
APIENTRY
DrvQueryTrueTypeOutline(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  HGLYPH  hglyph,
  WINBOOL  bMetricsOnly,
  GLYPHDATA  *pgldt,
  ULONG  cjBuf,
  TTPOLYGONHEADER  *ppoly);

LONG
APIENTRY
DrvQueryTrueTypeTable(
  ULONG_PTR  iFile,
  ULONG  ulFont,
  ULONG  ulTag,
  PTRDIFF  dpStart,
  ULONG  cjBuf,
  BYTE  *pjBuf,
  PBYTE  *ppjTable,
  ULONG *pcjTable);

/* DrvRealizeBrush.iHatch constants */
#define RB_DITHERCOLOR                    0x80000000L

#define HS_DDI_MAX                        6

WINBOOL
APIENTRY
DrvRealizeBrush(
  BRUSHOBJ  *pbo,
  SURFOBJ  *psoTarget,
  SURFOBJ  *psoPattern,
  SURFOBJ  *psoMask,
  XLATEOBJ  *pxlo,
  ULONG  iHatch);

/* DrvResetDevice return values */
#define DRD_SUCCESS                       0
#define DRD_ERROR                         1

ULONG
APIENTRY
DrvResetDevice(
  DHPDEV dhpdev,
  PVOID Reserved);

WINBOOL
APIENTRY
DrvResetPDEV(
  DHPDEV  dhpdevOld,
  DHPDEV  dhpdevNew);

/* DrvSaveScreenBits.iMode constants */
#define SS_SAVE                           0x00000000
#define SS_RESTORE                        0x00000001
#define SS_FREE                           0x00000002

ULONG_PTR
APIENTRY
DrvSaveScreenBits(
  SURFOBJ  *pso,
  ULONG  iMode,
  ULONG_PTR  ident,
  RECTL  *prcl);

WINBOOL
APIENTRY
DrvSendPage(
  SURFOBJ  *pso);

WINBOOL
APIENTRY
DrvSetPalette(
  DHPDEV  dhpdev,
  PALOBJ  *ppalo,
  FLONG  fl,
  ULONG  iStart,
  ULONG  cColors);

WINBOOL
APIENTRY
DrvSetPixelFormat(
  SURFOBJ  *pso,
  LONG  iPixelFormat,
  HWND  hwnd);

/* DrvSetPointerShape return values */
#define SPS_ERROR                         0x00000000
#define SPS_DECLINE                       0x00000001
#define SPS_ACCEPT_NOEXCLUDE              0x00000002
#define SPS_ACCEPT_EXCLUDE                0x00000003
#define SPS_ACCEPT_SYNCHRONOUS            0x00000004

/* DrvSetPointerShape.fl constants */
#define SPS_CHANGE                        0x00000001L
#define SPS_ASYNCCHANGE                   0x00000002L
#define SPS_ANIMATESTART                  0x00000004L
#define SPS_ANIMATEUPDATE                 0x00000008L
#define SPS_ALPHA                         0x00000010L
#define SPS_LENGTHMASK                    0x00000F00L
#define SPS_FREQMASK                      0x000FF000L

ULONG
APIENTRY
DrvSetPointerShape(
  SURFOBJ  *pso,
  SURFOBJ  *psoMask,
  SURFOBJ  *psoColor,
  XLATEOBJ  *pxlo,
  LONG  xHot,
  LONG  yHot,
  LONG  x,
  LONG  y,
  RECTL  *prcl,
  FLONG  fl);

WINBOOL
APIENTRY
DrvStartBanding(
  SURFOBJ  *pso,
  POINTL  *pptl);

WINBOOL
APIENTRY
DrvStartDoc(
  SURFOBJ  *pso,
  LPWSTR  pwszDocName,
  DWORD  dwJobId);

WINBOOL
APIENTRY
DrvStartPage(
  SURFOBJ  *pso);

WINBOOL
APIENTRY
DrvStretchBlt(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode);

WINBOOL
APIENTRY
DrvStretchBltROP(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode,
  BRUSHOBJ  *pbo,
  DWORD  rop4);

WINBOOL
APIENTRY
DrvStrokeAndFillPath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pboStroke,
  LINEATTRS  *plineattrs,
  BRUSHOBJ  *pboFill,
  POINTL  *pptlBrushOrg,
  MIX  mixFill,
  FLONG  flOptions);

WINBOOL
APIENTRY
DrvStrokePath(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  LINEATTRS  *plineattrs,
  MIX  mix);

WINBOOL
APIENTRY
DrvSwapBuffers(
  SURFOBJ  *pso,
  WNDOBJ  *pwo);

VOID
APIENTRY
DrvSynchronize(
  DHPDEV  dhpdev,
  RECTL  *prcl);

/* DrvSynchronizeSurface.fl constants */
#define DSS_TIMER_EVENT                   0x00000001
#define DSS_FLUSH_EVENT                   0x00000002

VOID
APIENTRY
DrvSynchronizeSurface(
  SURFOBJ  *pso,
  RECTL  *prcl,
  FLONG  fl);

WINBOOL
APIENTRY
DrvTextOut(
  SURFOBJ  *pso,
  STROBJ  *pstro,
  FONTOBJ  *pfo,
  CLIPOBJ  *pco,
  RECTL  *prclExtra,
  RECTL  *prclOpaque,
  BRUSHOBJ  *pboFore,
  BRUSHOBJ  *pboOpaque,
  POINTL  *pptlOrg,
  MIX  mix);

WINBOOL
APIENTRY
DrvTransparentBlt(
  SURFOBJ  *psoDst,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDst,
  RECTL  *prclSrc,
  ULONG  iTransColor,
  ULONG  ulReserved);

WINBOOL
APIENTRY
DrvUnloadFontFile(
  ULONG_PTR  iFile);

typedef WINBOOL
(APIENTRY *PFN_DrvAlphaBlend)(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  BLENDOBJ  *pBlendObj);

typedef WINBOOL
(APIENTRY *PFN_DrvAssertMode)(
  DHPDEV  dhpdev,
  WINBOOL  bEnable);

typedef WINBOOL
(APIENTRY *PFN_DrvBitBlt)(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclTrg,
  POINTL  *pptlSrc,
  POINTL  *pptlMask,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrush,
  ROP4  rop4);

typedef VOID
(APIENTRY *PFN_DrvCompletePDEV)(
  DHPDEV  dhpdev,
  HDEV  hdev);

typedef WINBOOL
(APIENTRY *PFN_DrvCopyBits)(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDest,
  POINTL  *pptlSrc);

typedef HBITMAP
(APIENTRY *PFN_DrvCreateDeviceBitmap)(
  DHPDEV  dhpdev,
  SIZEL  sizl,
  ULONG  iFormat);

typedef VOID
(APIENTRY *PFN_DrvDeleteDeviceBitmap)(
  DHSURF  dhsurf);

typedef HBITMAP
(APIENTRY *PFN_DrvDeriveSurface)(
  DD_DIRECTDRAW_GLOBAL  *pDirectDraw,
  DD_SURFACE_LOCAL  *pSurface);

typedef LONG
(APIENTRY *PFN_DrvDescribePixelFormat)(
  DHPDEV  dhpdev,
  LONG  iPixelFormat,
  ULONG  cjpfd,
  PIXELFORMATDESCRIPTOR  *ppfd);

typedef VOID
(APIENTRY *PFN_DrvDestroyFont)(
  FONTOBJ  *pfo);

typedef VOID
(APIENTRY *PFN_DrvDisableDriver)(
  VOID);

typedef VOID
(APIENTRY *PFN_DrvDisablePDEV)(
  DHPDEV  dhpdev);

typedef VOID
(APIENTRY *PFN_DrvDisableSurface)(
  DHPDEV  dhpdev);

typedef ULONG
(APIENTRY *PFN_DrvDitherColor)(
  DHPDEV  dhpdev,
  ULONG  iMode,
  ULONG  rgb,
  ULONG  *pul);

typedef ULONG
(APIENTRY *PFN_DrvDrawEscape)(
  SURFOBJ  *pso,
  ULONG  iEsc,
  CLIPOBJ  *pco,
  RECTL  *prcl,
  ULONG  cjIn,
  PVOID  pvIn);

typedef WINBOOL
(APIENTRY *PFN_DrvEnableDriver)(
  ULONG  iEngineVersion,
  ULONG  cj,
  DRVENABLEDATA  *pded);

typedef DHPDEV 
(APIENTRY *PFN_DrvEnablePDEV)(
  DEVMODEW  *pdm,
  LPWSTR  pwszLogAddress,
  ULONG  cPat,
  HSURF  *phsurfPatterns,
  ULONG  cjCaps,
  GDIINFO  *pdevcaps,
  ULONG  cjDevInfo,
  DEVINFO  *pdi,
  HDEV  hdev,
  LPWSTR  pwszDeviceName,
  HANDLE  hDriver);

typedef HSURF
(APIENTRY *PFN_DrvEnableSurface)(
  DHPDEV  dhpdev);

typedef WINBOOL
(APIENTRY *PFN_DrvEndDoc)(
  SURFOBJ  *pso,
  FLONG  fl);

typedef ULONG
(APIENTRY *PFN_DrvEscape)(
  SURFOBJ  *pso,
  ULONG  iEsc,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

typedef WINBOOL
(APIENTRY *PFN_DrvFillPath)(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix,
  FLONG  flOptions);

typedef ULONG
(APIENTRY *PFN_DrvFontManagement)(
  SURFOBJ  *pso,
  FONTOBJ  *pfo,
  ULONG  iMode,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

typedef VOID
(APIENTRY *PFN_DrvFree)(
  PVOID  pv,
  ULONG_PTR  id);

typedef ULONG
(APIENTRY *PFN_DrvGetGlyphMode)(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo);

typedef ULONG
(APIENTRY *PFN_DrvGetModes)(
  HANDLE  hDriver,
  ULONG  cjSize,
  DEVMODEW  *pdm);

typedef PVOID
(APIENTRY *PFN_DrvGetTrueTypeFile)(
  ULONG_PTR  iFile,
  ULONG  *pcj);

typedef WINBOOL
(APIENTRY *PFN_DrvGradientFill)(
  SURFOBJ  *psoDest,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  TRIVERTEX  *pVertex,
  ULONG  nVertex,
  PVOID  pMesh,
  ULONG  nMesh,
  RECTL  *prclExtents,
  POINTL  *pptlDitherOrg,
  ULONG  ulMode);

typedef WINBOOL
(APIENTRY *PFN_DrvIcmCheckBitmapBits)(
  DHPDEV  dhpdev,
  HANDLE  hColorTransform,
  SURFOBJ  *pso,
  PBYTE  paResults);

typedef HANDLE
(APIENTRY *PFN_DrvIcmCreateColorTransform)(
  DHPDEV  dhpdev,
  LPLOGCOLORSPACEW  pLogColorSpace,
  PVOID  pvSourceProfile,
  ULONG  cjSourceProfile,
  PVOID  pvDestProfile,
  ULONG  cjDestProfile,
  PVOID  pvTargetProfile,
  ULONG  cjTargetProfile,
  DWORD  dwReserved);

typedef WINBOOL
(APIENTRY *PFN_DrvIcmDeleteColorTransform)(
  DHPDEV  dhpdev,
  HANDLE  hcmXform);

typedef WINBOOL
(APIENTRY *PFN_DrvIcmSetDeviceGammaRamp)(
  DHPDEV  dhpdev,
  ULONG  iFormat,
  LPVOID  lpRamp);

typedef WINBOOL
(APIENTRY *PFN_DrvLineTo)(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  LONG  x1,
  LONG  y1,
  LONG  x2,
  LONG  y2,
  RECTL  *prclBounds,
  MIX  mix);

typedef ULONG_PTR
(APIENTRY *PFN_DrvLoadFontFile)(
  ULONG  cFiles,
  ULONG_PTR  *piFile,
  PVOID  *ppvView,
  ULONG  *pcjView,
  DESIGNVECTOR  *pdv,
  ULONG  ulLangID,
  ULONG  ulFastCheckSum);

typedef VOID
(APIENTRY *PFN_DrvMovePointer)(
  SURFOBJ  *pso,
  LONG  x,
  LONG  y,
  RECTL  *prcl);

typedef WINBOOL
(APIENTRY *PFN_DrvNextBand)(
  SURFOBJ  *pso,
  POINTL  *pptl);

typedef VOID
(APIENTRY *PFN_DrvNotify)(
  SURFOBJ  *pso,
  ULONG  iType,
  PVOID  pvData);

typedef WINBOOL
(APIENTRY *PFN_DrvOffset)(
  SURFOBJ  *pso,
  LONG  x,
  LONG  y,
  FLONG  flReserved);

typedef WINBOOL
(APIENTRY *PFN_DrvPaint)(
  SURFOBJ  *pso,
  CLIPOBJ  *pco,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  MIX  mix);

typedef WINBOOL
(APIENTRY *PFN_DrvPlgBlt)(
  SURFOBJ  *psoTrg,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMsk,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlBrushOrg,
  POINTFIX  *pptfx,
  RECTL  *prcl,
  POINTL  *pptl,
  ULONG  iMode);

typedef WINBOOL
(APIENTRY *PFN_DrvQueryAdvanceWidths)(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  ULONG  iMode,
  HGLYPH  *phg,
  PVOID  pvWidths,
  ULONG  cGlyphs);

typedef WINBOOL
(APIENTRY *PFN_DrvQueryDeviceSupport)(
  SURFOBJ  *pso,
  XLATEOBJ  *pxlo,
  XFORMOBJ  *pxo,
  ULONG  iType,
  ULONG  cjIn,
  PVOID  pvIn,
  ULONG  cjOut,
  PVOID  pvOut);

typedef WINBOOL
(APIENTRY *PFN_DrvQueryDriverInfo)(
  DWORD  dwMode,
  PVOID  pBuffer,
  DWORD  cbBuf,
  PDWORD  pcbNeeded);

typedef PIFIMETRICS
(APIENTRY *PFN_DrvQueryFont)(
  DHPDEV  dhpdev,
  ULONG_PTR  iFile,
  ULONG  iFace,
  ULONG_PTR  *pid);

typedef LONG
(APIENTRY *PFN_DrvQueryFontCaps)(
  ULONG  culCaps,
  ULONG  *pulCaps);

typedef LONG
(APIENTRY *PFN_DrvQueryFontData)(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  ULONG  iMode,
  HGLYPH  hg,
  GLYPHDATA  *pgd,
  PVOID  pv,
  ULONG  cjSize);

typedef LONG
(APIENTRY *PFN_DrvQueryFontFile)(
  ULONG_PTR  iFile,
  ULONG  ulMode,
  ULONG  cjBuf,
  ULONG  *pulBuf);

typedef PVOID
(APIENTRY *PFN_DrvQueryFontTree)(
  DHPDEV  dhpdev,
  ULONG_PTR  iFile,
  ULONG  iFace,
  ULONG  iMode,
  ULONG_PTR  *pid);

typedef PFD_GLYPHATTR
(APIENTRY *PFN_DrvQueryGlyphAttrs)(
  FONTOBJ  *pfo,
  ULONG  iMode);

typedef ULONG
(APIENTRY *PFN_DrvQueryPerBandInfo)(
  SURFOBJ  *pso,
  PERBANDINFO  *pbi);

typedef LONG
(APIENTRY *PFN_DrvQueryTrueTypeOutline)(
  DHPDEV  dhpdev,
  FONTOBJ  *pfo,
  HGLYPH  hglyph,
  WINBOOL  bMetricsOnly,
  GLYPHDATA  *pgldt,
  ULONG  cjBuf,
  TTPOLYGONHEADER  *ppoly);

typedef LONG
(APIENTRY *PFN_DrvQueryTrueTypeTable)(
  ULONG_PTR  iFile,
  ULONG  ulFont,
  ULONG  ulTag,
  PTRDIFF  dpStart,
  ULONG  cjBuf,
  BYTE  *pjBuf,
  PBYTE  *ppjTable,
  ULONG *pcjTable);

typedef WINBOOL
(APIENTRY *PFN_DrvRealizeBrush)(
  BRUSHOBJ  *pbo,
  SURFOBJ  *psoTarget,
  SURFOBJ  *psoPattern,
  SURFOBJ  *psoMask,
  XLATEOBJ  *pxlo,
  ULONG  iHatch);

typedef ULONG
(APIENTRY *PFN_DrvResetDevice)(
  DHPDEV dhpdev,
  PVOID Reserved);

typedef WINBOOL
(APIENTRY *PFN_DrvResetPDEV)(
  DHPDEV  dhpdevOld,
  DHPDEV  dhpdevNew);

typedef ULONG_PTR
(APIENTRY *PFN_DrvSaveScreenBits)(
  SURFOBJ  *pso,
  ULONG  iMode,
  ULONG_PTR  ident,
  RECTL  *prcl);

typedef WINBOOL
(APIENTRY *PFN_DrvSendPage)(
  SURFOBJ  *pso);

typedef WINBOOL
(APIENTRY *PFN_DrvSetPalette)(
  DHPDEV  dhpdev,
  PALOBJ  *ppalo,
  FLONG  fl,
  ULONG  iStart,
  ULONG  cColors);

typedef WINBOOL
(APIENTRY *PFN_DrvSetPixelFormat)(
  SURFOBJ  *pso,
  LONG  iPixelFormat,
  HWND  hwnd);

typedef ULONG
(APIENTRY *PFN_DrvSetPointerShape)(
  SURFOBJ  *pso,
  SURFOBJ  *psoMask,
  SURFOBJ  *psoColor,
  XLATEOBJ  *pxlo,
  LONG  xHot,
  LONG  yHot,
  LONG  x,
  LONG  y,
  RECTL  *prcl,
  FLONG  fl);

typedef WINBOOL
(APIENTRY *PFN_DrvStartBanding)(
  SURFOBJ  *pso,
  POINTL  *pptl);

typedef WINBOOL
(APIENTRY *PFN_DrvStartDoc)(
  SURFOBJ  *pso,
  LPWSTR  pwszDocName,
  DWORD  dwJobId);

typedef WINBOOL
(APIENTRY *PFN_DrvStartPage)(
  SURFOBJ  *pso);

typedef WINBOOL
(APIENTRY *PFN_DrvStretchBlt)(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode);

typedef WINBOOL
(APIENTRY *PFN_DrvStretchBltROP)(
  SURFOBJ  *psoDest,
  SURFOBJ  *psoSrc,
  SURFOBJ  *psoMask,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  COLORADJUSTMENT  *pca,
  POINTL  *pptlHTOrg,
  RECTL  *prclDest,
  RECTL  *prclSrc,
  POINTL  *pptlMask,
  ULONG  iMode,
  BRUSHOBJ  *pbo,
  DWORD  rop4);

typedef WINBOOL
(APIENTRY *PFN_DrvStrokeAndFillPath)(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pboStroke,
  LINEATTRS  *plineattrs,
  BRUSHOBJ  *pboFill,
  POINTL  *pptlBrushOrg,
  MIX  mixFill,
  FLONG  flOptions);

typedef WINBOOL
(APIENTRY *PFN_DrvStrokePath)(
  SURFOBJ  *pso,
  PATHOBJ  *ppo,
  CLIPOBJ  *pco,
  XFORMOBJ  *pxo,
  BRUSHOBJ  *pbo,
  POINTL  *pptlBrushOrg,
  LINEATTRS  *plineattrs,
  MIX  mix);

typedef WINBOOL
(APIENTRY *PFN_DrvSwapBuffers)(
  SURFOBJ  *pso,
  WNDOBJ  *pwo);

typedef VOID
(APIENTRY *PFN_DrvSynchronize)(
  DHPDEV  dhpdev,
  RECTL  *prcl);

typedef VOID
(APIENTRY *PFN_DrvSynchronizeSurface)(
  SURFOBJ  *pso,
  RECTL  *prcl,
  FLONG  fl);

typedef WINBOOL
(APIENTRY *PFN_DrvTextOut)(
  SURFOBJ  *pso,
  STROBJ  *pstro,
  FONTOBJ  *pfo,
  CLIPOBJ  *pco,
  RECTL  *prclExtra,
  RECTL  *prclOpaque,
  BRUSHOBJ  *pboFore,
  BRUSHOBJ  *pboOpaque,
  POINTL  *pptlOrg,
  MIX  mix);

typedef WINBOOL
(APIENTRY *PFN_DrvTransparentBlt)(
  SURFOBJ  *psoDst,
  SURFOBJ  *psoSrc,
  CLIPOBJ  *pco,
  XLATEOBJ  *pxlo,
  RECTL  *prclDst,
  RECTL  *prclSrc,
  ULONG  iTransColor,
  ULONG  ulReserved);

typedef WINBOOL
(APIENTRY *PFN_DrvUnloadFontFile)(
  ULONG_PTR  iFile);


WIN32KAPI
VOID
APIENTRY
DrvDisableDirectDraw(
  DHPDEV  dhpdev);

typedef VOID
(APIENTRY *PFN_DrvDisableDirectDraw)(
  DHPDEV  dhpdev);

WIN32KAPI
WINBOOL
APIENTRY
DrvEnableDirectDraw(
  DHPDEV  dhpdev,
  DD_CALLBACKS  *pCallBacks,
  DD_SURFACECALLBACKS  *pSurfaceCallBacks,
  DD_PALETTECALLBACKS  *pPaletteCallBacks);

typedef WINBOOL
(APIENTRY *PFN_DrvEnableDirectDraw)(
  DHPDEV  dhpdev,
  DD_CALLBACKS  *pCallBacks,
  DD_SURFACECALLBACKS  *pSurfaceCallBacks,
  DD_PALETTECALLBACKS  *pPaletteCallBacks);

WIN32KAPI
WINBOOL
APIENTRY
DrvGetDirectDrawInfo(
  DHPDEV  dhpdev,
  DD_HALINFO  *pHalInfo,
  DWORD  *pdwNumHeaps,
  VIDEOMEMORY  *pvmList,
  DWORD  *pdwNumFourCCCodes,
  DWORD  *pdwFourCC);

typedef WINBOOL
(APIENTRY *PFN_DrvGetDirectDrawInfo)(
  DHPDEV  dhpdev,
  DD_HALINFO  *pHalInfo,
  DWORD  *pdwNumHeaps,
  VIDEOMEMORY  *pvmList,
  DWORD  *pdwNumFourCCCodes,
  DWORD  *pdwFourCC);

//DECLSPEC_DEPRECATED_DDK
WINBOOL
APIENTRY
DrvQuerySpoolType(
  DHPDEV dhpdev,
  LPWSTR pwchType);

typedef WINBOOL
(APIENTRY *PFN_DrvQuerySpoolType)(
  DHPDEV dhpdev,
  LPWSTR pwchType);


#ifdef __cplusplus
}
#endif

#endif /* defined __VIDEO_H__ */

#endif /* _WINDDI_ */