protocol.def 90.1 KB
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
/* -*- C -*-
 *
 * Wine server protocol definition
 *
 * Copyright (C) 2001 Alexandre Julliard
 *
 * This file is used by tools/make_requests to build the
 * protocol structures in include/wine/server_protocol.h
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

@HEADER  /* start of C declarations */

#include <stdarg.h>
#include <stdlib.h>
#include <time.h>

#include <windef.h>
#include <winbase.h>

typedef void *obj_handle_t;
typedef void *user_handle_t;
typedef unsigned short atom_t;
typedef unsigned int process_id_t;
typedef unsigned int thread_id_t;
typedef unsigned int data_size_t;

struct request_header
{
    int          req;          /* request code */
    data_size_t  request_size; /* request variable part size */
    data_size_t  reply_size;   /* reply variable part maximum size */
};

struct reply_header
{
    unsigned int error;        /* error result */
    data_size_t  reply_size;   /* reply variable part size */
};

/* placeholder structure for the maximum allowed request size */
/* this is used to construct the generic_request union */
struct request_max_size
{
    int pad[16]; /* the max request size is 16 ints */
};

#define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
#define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */


/* definitions of the event data depending on the event code */
struct debug_event_exception
{
    EXCEPTION_RECORD record;   /* exception record */
    int              first;    /* first chance exception? */
};
struct debug_event_create_thread
{
    obj_handle_t handle;     /* handle to the new thread */
    void        *teb;        /* thread teb (in debugged process address space) */
    void        *start;      /* thread startup routine */
};
struct debug_event_create_process
{
    obj_handle_t file;       /* handle to the process exe file */
    obj_handle_t process;    /* handle to the new process */
    obj_handle_t thread;     /* handle to the new thread */
    void        *base;       /* base of executable image */
    int          dbg_offset; /* offset of debug info in file */
    int          dbg_size;   /* size of debug info */
    void        *teb;        /* thread teb (in debugged process address space) */
    void        *start;      /* thread startup routine */
    void        *name;       /* image name (optional) */
    int          unicode;    /* is it Unicode? */
};
struct debug_event_exit
{
    int          exit_code;  /* thread or process exit code */
};
struct debug_event_load_dll
{
    obj_handle_t handle;     /* file handle for the dll */
    void        *base;       /* base address of the dll */
    int          dbg_offset; /* offset of debug info in file */
    int          dbg_size;   /* size of debug info */
    void        *name;       /* image name (optional) */
    int          unicode;    /* is it Unicode? */
};
struct debug_event_unload_dll
{
    void       *base;       /* base address of the dll */
};
struct debug_event_output_string
{
    void       *string;     /* string to display (in debugged process address space) */
    int         unicode;    /* is it Unicode? */
    int         length;     /* string length */
};
struct debug_event_rip_info
{
    int         error;      /* ??? */
    int         type;       /* ??? */
};
union debug_event_data
{
    struct debug_event_exception      exception;
    struct debug_event_create_thread  create_thread;
    struct debug_event_create_process create_process;
    struct debug_event_exit           exit;
    struct debug_event_load_dll       load_dll;
    struct debug_event_unload_dll     unload_dll;
    struct debug_event_output_string  output_string;
    struct debug_event_rip_info       rip_info;
};

/* debug event data */
typedef struct
{
    int                      code;   /* event code */
    union debug_event_data   info;   /* event information */
} debug_event_t;

/* structure used in sending an fd from client to server */
struct send_fd
{
    thread_id_t tid;  /* thread id */
    int         fd;   /* file descriptor on client-side */
};

/* structure sent by the server on the wait fifo */
struct wake_up_reply
{
    void *cookie;    /* magic cookie that was passed in select_request */
    int   signaled;  /* wait result */
};

/* structure for absolute timeouts */
typedef struct
{
    int            sec;      /* seconds since Unix epoch */
    int            usec;     /* microseconds */
} abs_time_t;

/* structure returned in the list of window properties */
typedef struct
{
    atom_t         atom;     /* property atom */
    short          string;   /* was atom a string originally? */
    obj_handle_t   handle;   /* handle stored in property */
} property_data_t;

/* structure to specify window rectangles */
typedef struct
{
    int  left;
    int  top;
    int  right;
    int  bottom;
} rectangle_t;

/* structures for extra message data */

struct callback_msg_data
{
    void           *callback;   /* callback function */
    unsigned long   data;       /* user data for callback */
    unsigned long   result;     /* message result */
};

struct winevent_msg_data
{
    user_handle_t   hook;       /* hook handle */
    thread_id_t     tid;        /* thread id */
    void           *hook_proc;  /* hook proc address */
    /* followed by module name if any */
};

typedef union
{
    unsigned char            bytes[1];   /* raw data for sent messages */
    struct callback_msg_data callback;
    struct winevent_msg_data winevent;
} message_data_t;

/* structure for console char/attribute info */
typedef struct
{
    WCHAR          ch;
    unsigned short attr;
} char_info_t;

#define MAX_ACL_LEN 65535

struct security_descriptor
{
    unsigned int control;       /* SE_ flags */
    data_size_t  owner_len;
    data_size_t  group_len;
    data_size_t  sacl_len;
    data_size_t  dacl_len;
    /* VARARGS(owner,SID); */
    /* VARARGS(group,SID); */
    /* VARARGS(sacl,ACL); */
    /* VARARGS(dacl,ACL); */
};

struct token_groups
{
    unsigned int count;
    /* unsigned int attributes[count]; */
    /* VARARGS(sids,SID); */
};

/****************************************************************/
/* Request declarations */

/* Create a new process from the context of the parent */
@REQ(new_process)
    int          inherit_all;    /* inherit all handles from parent */
    unsigned int create_flags;   /* creation flags */
    int          socket_fd;      /* file descriptor for process socket */
    obj_handle_t exe_file;       /* file handle for main exe */
    obj_handle_t hstdin;         /* handle for stdin */
    obj_handle_t hstdout;        /* handle for stdout */
    obj_handle_t hstderr;        /* handle for stderr */
    unsigned int process_access; /* access rights for process object */
    unsigned int process_attr;   /* attributes for process object */
    unsigned int thread_access;  /* access rights for thread object */
    unsigned int thread_attr;    /* attributes for thread object */
    VARARG(info,startup_info);   /* startup information */
    VARARG(env,unicode_str);     /* environment for new process */
@REPLY
    obj_handle_t info;           /* new process info handle */
    process_id_t pid;            /* process id */
    obj_handle_t phandle;        /* process handle (in the current process) */
    thread_id_t  tid;            /* thread id */
    obj_handle_t thandle;        /* thread handle (in the current process) */
@END


/* Retrieve information about a newly started process */
@REQ(get_new_process_info)
    obj_handle_t info;           /* info handle returned from new_process_request */
@REPLY
    int          success;      /* did the process start successfully? */
    int          exit_code;    /* process exit code if failed */
@END


/* Create a new thread from the context of the parent */
@REQ(new_thread)
    unsigned int access;       /* wanted access rights */
    unsigned int attributes;   /* object attributes */
    int          suspend;      /* new thread should be suspended on creation */
    int          request_fd;   /* fd for request pipe */
@REPLY
    thread_id_t  tid;          /* thread id */
    obj_handle_t handle;       /* thread handle (in the current process) */
@END


/* Retrieve the new process startup info */
@REQ(get_startup_info)
@REPLY
    obj_handle_t exe_file;     /* file handle for main exe */
    obj_handle_t hstdin;       /* handle for stdin */
    obj_handle_t hstdout;      /* handle for stdout */
    obj_handle_t hstderr;      /* handle for stderr */
    VARARG(info,startup_info); /* startup information */
    VARARG(env,unicode_str);   /* environment */
@END


/* Signal the end of the process initialization */
@REQ(init_process_done)
    void*        module;       /* main module base address */
    void*        entry;        /* process entry point */
    int          gui;          /* is it a GUI process? */
@END


/* Initialize a thread; called from the child after fork()/clone() */
@REQ(init_thread)
    int          unix_pid;     /* Unix pid of new thread */
    int          unix_tid;     /* Unix tid of new thread */
    int          debug_level;  /* new debug level */
    void*        teb;          /* TEB of new thread (in thread address space) */
    void*        peb;          /* address of PEB (in thread address space) */
    void*        entry;        /* thread entry point (in thread address space) */
    void*        ldt_copy;     /* address of LDT copy (in thread address space) */
    int          reply_fd;     /* fd for reply pipe */
    int          wait_fd;      /* fd for blocking calls pipe */
@REPLY
    process_id_t pid;          /* process id of the new thread's process */
    thread_id_t  tid;          /* thread id of the new thread */
    data_size_t  info_size;    /* total size of startup info */
    abs_time_t   server_start; /* server start time */
    int          version;      /* protocol version */
@END


/* Terminate a process */
@REQ(terminate_process)
    obj_handle_t handle;       /* process handle to terminate */
    int          exit_code;    /* process exit code */
@REPLY
    int          self;         /* suicide? */
@END


/* Terminate a thread */
@REQ(terminate_thread)
    obj_handle_t handle;       /* thread handle to terminate */
    int          exit_code;    /* thread exit code */
@REPLY
    int          self;         /* suicide? */
    int          last;         /* last thread in this process? */
@END


/* Retrieve information about a process */
@REQ(get_process_info)
    obj_handle_t handle;           /* process handle */
@REPLY
    process_id_t pid;              /* server process id */
    process_id_t ppid;             /* server process id of parent */
    int          exit_code;        /* process exit code */
    int          priority;         /* priority class */
    int          affinity;         /* process affinity mask */
    void*        peb;              /* PEB address in process address space */
    abs_time_t   start_time;       /* process start time */
    abs_time_t   end_time;         /* process end time */
@END


/* Set a process informations */
@REQ(set_process_info)
    obj_handle_t handle;       /* process handle */
    int          mask;         /* setting mask (see below) */
    int          priority;     /* priority class */
    int          affinity;     /* affinity mask */
@END
#define SET_PROCESS_INFO_PRIORITY 0x01
#define SET_PROCESS_INFO_AFFINITY 0x02


/* Retrieve information about a thread */
@REQ(get_thread_info)
    obj_handle_t handle;        /* thread handle */
    thread_id_t  tid_in;        /* thread id (optional) */
@REPLY
    process_id_t pid;           /* server process id */
    thread_id_t  tid;           /* server thread id */
    void*        teb;           /* thread teb pointer */
    int          exit_code;     /* thread exit code */
    int          priority;      /* thread priority level */
    int          affinity;      /* thread affinity mask */
    abs_time_t   creation_time; /* thread creation time */
    abs_time_t   exit_time;     /* thread exit time */
    int          last;          /* last thread in process */
@END


/* Set a thread informations */
@REQ(set_thread_info)
    obj_handle_t handle;       /* thread handle */
    int          mask;         /* setting mask (see below) */
    int          priority;     /* priority class */
    int          affinity;     /* affinity mask */
    obj_handle_t token;        /* impersonation token */
@END
#define SET_THREAD_INFO_PRIORITY 0x01
#define SET_THREAD_INFO_AFFINITY 0x02
#define SET_THREAD_INFO_TOKEN    0x04


/* Retrieve information about a module */
@REQ(get_dll_info)
    obj_handle_t handle;       /* process handle */
    void*        base_address; /* base address of module */
@REPLY
    size_t       size;          /* module size */
    void*        entry_point;
    VARARG(filename,unicode_str); /* file name of module */
@END


/* Suspend a thread */
@REQ(suspend_thread)
    obj_handle_t handle;       /* thread handle */
@REPLY
    int          count;        /* new suspend count */
@END


/* Resume a thread */
@REQ(resume_thread)
    obj_handle_t handle;       /* thread handle */
@REPLY
    int          count;        /* new suspend count */
@END


/* Notify the server that a dll has been loaded */
@REQ(load_dll)
    obj_handle_t handle;       /* file handle */
    void*        base;         /* base address */
    size_t       size;         /* dll size */
    int          dbg_offset;   /* debug info offset */
    int          dbg_size;     /* debug info size */
    void*        name;         /* ptr to ptr to name (in process addr space) */
    VARARG(filename,unicode_str); /* file name of dll */
@END


/* Notify the server that a dll is being unloaded */
@REQ(unload_dll)
    void*        base;         /* base address */
@END


/* Queue an APC for a thread */
@REQ(queue_apc)
    obj_handle_t handle;       /* thread handle */
    int          user;         /* user or system apc? */
    void*        func;         /* function to call */
    void*        arg1;         /* params for function to call */
    void*        arg2;
    void*        arg3;
@END


/* Get next APC to call */
@REQ(get_apc)
    int          alertable;    /* is thread alertable? */
@REPLY
    void*        func;         /* function to call */
    int          type;         /* function type */
    void*        arg1;         /* function arguments */
    void*        arg2;
    void*        arg3;
@END
enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC_IO };


/* Close a handle for the current process */
@REQ(close_handle)
    obj_handle_t handle;       /* handle to close */
@END


/* Set a handle information */
@REQ(set_handle_info)
    obj_handle_t handle;       /* handle we are interested in */
    int          flags;        /* new handle flags */
    int          mask;         /* mask for flags to set */
@REPLY
    int          old_flags;    /* old flag value */
@END


/* Duplicate a handle */
@REQ(dup_handle)
    obj_handle_t src_process;  /* src process handle */
    obj_handle_t src_handle;   /* src handle to duplicate */
    obj_handle_t dst_process;  /* dst process handle */
    unsigned int access;       /* wanted access rights */
    unsigned int attributes;   /* object attributes */
    unsigned int options;      /* duplicate options (see below) */
@REPLY
    obj_handle_t handle;       /* duplicated handle in dst process */
    int          closed;       /* whether the source handle has been closed */
@END
#define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
#define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
#define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */


/* Open a handle to a process */
@REQ(open_process)
    process_id_t pid;          /* process id to open */
    unsigned int access;       /* wanted access rights */
    unsigned int attributes;   /* object attributes */
@REPLY
    obj_handle_t handle;       /* handle to the process */
@END


/* Open a handle to a thread */
@REQ(open_thread)
    thread_id_t  tid;          /* thread id to open */
    unsigned int access;       /* wanted access rights */
    unsigned int attributes;   /* object attributes */
@REPLY
    obj_handle_t handle;       /* handle to the thread */
@END


/* Wait for handles */
@REQ(select)
    int          flags;        /* wait flags (see below) */
    void*        cookie;       /* magic cookie to return to client */
    obj_handle_t signal;       /* object to signal (0 if none) */
    abs_time_t   timeout;      /* absolute timeout */
    VARARG(handles,handles);   /* handles to select on */
@END
#define SELECT_ALL           1
#define SELECT_ALERTABLE     2
#define SELECT_INTERRUPTIBLE 4
#define SELECT_TIMEOUT       8


/* Create an event */
@REQ(create_event)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    int          manual_reset;  /* manual reset event */
    int          initial_state; /* initial state of the event */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the event */
@END

/* Event operation */
@REQ(event_op)
    obj_handle_t  handle;       /* handle to event */
    int           op;           /* event operation (see below) */
@END
enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };


/* Open an event */
@REQ(open_event)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the event */
@END


/* Create a mutex */
@REQ(create_mutex)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    int          owned;         /* initially owned? */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the mutex */
@END


/* Release a mutex */
@REQ(release_mutex)
    obj_handle_t handle;        /* handle to the mutex */
@REPLY
    unsigned int prev_count;    /* value of internal counter, before release */
@END


/* Open a mutex */
@REQ(open_mutex)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the mutex */
@END


/* Create a semaphore */
@REQ(create_semaphore)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    unsigned int initial;       /* initial count */
    unsigned int max;           /* maximum count */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the semaphore */
@END


/* Release a semaphore */
@REQ(release_semaphore)
    obj_handle_t handle;        /* handle to the semaphore */
    unsigned int count;         /* count to add to semaphore */
@REPLY
    unsigned int prev_count;    /* previous semaphore count */
@END


/* Open a semaphore */
@REQ(open_semaphore)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the semaphore */
@END


/* Create a file */
@REQ(create_file)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    unsigned int sharing;       /* sharing flags */
    int          create;        /* file create action */
    unsigned int options;       /* file options */
    unsigned int attrs;         /* file attributes for creation */
    VARARG(filename,string);    /* file name */
@REPLY
    obj_handle_t handle;        /* handle to the file */
@END


/* Open a file object */
@REQ(open_file_object)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* open attributes */
    obj_handle_t rootdir;       /* root directory */
    unsigned int sharing;       /* sharing flags */
    VARARG(filename,unicode_str); /* file name */
@REPLY
    obj_handle_t handle;        /* handle to the file */
@END


/* Allocate a file handle for a Unix fd */
@REQ(alloc_file_handle)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    int          fd;            /* file descriptor on the client side */
@REPLY
    obj_handle_t handle;        /* handle to the file */
@END


/* Get a Unix fd to access a file */
@REQ(get_handle_fd)
    obj_handle_t handle;        /* handle to the file */
    unsigned int access;        /* wanted access rights */
    int          cached;        /* is it cached on the client already? */
@REPLY
    int          type;          /* file type (see below) */
    int          flags;         /* file read/write flags (see below) */
@END
enum server_fd_type
{
    FD_TYPE_INVALID,  /* invalid file (no associated fd) */
    FD_TYPE_FILE,     /* regular file */
    FD_TYPE_DIR,      /* directory */
    FD_TYPE_SOCKET,   /* socket */
    FD_TYPE_SERIAL,   /* serial port */
    FD_TYPE_PIPE,     /* named pipe */
    FD_TYPE_MAILSLOT, /* mailslot */
    FD_TYPE_DEVICE,   /* Windows device file */
    FD_TYPE_NB_TYPES
};
#define FD_FLAG_OVERLAPPED         0x01 /* fd opened in overlapped mode */
#define FD_FLAG_TIMEOUT            0x02 /* read/write is synchronous */
#define FD_FLAG_RECV_SHUTDOWN      0x04
#define FD_FLAG_SEND_SHUTDOWN      0x08
#define FD_FLAG_AVAILABLE          0x10 /* in overlap read/write operation, 
                                         * only handle available data (don't wait) */
#define FD_FLAG_REMOVABLE          0x20 /* is it on a removable device? */

/* Flush a file buffers */
@REQ(flush_file)
    obj_handle_t handle;        /* handle to the file */
@REPLY
    obj_handle_t event;         /* event set when finished */
@END


/* Lock a region of a file */
@REQ(lock_file)
    obj_handle_t handle;        /* handle to the file */
    unsigned int offset_low;    /* offset of start of lock */
    unsigned int offset_high;   /* offset of start of lock */
    unsigned int count_low;     /* count of bytes to lock */
    unsigned int count_high;    /* count of bytes to lock */
    int          shared;        /* shared or exclusive lock? */
    int          wait;          /* do we want to wait? */
@REPLY
    obj_handle_t handle;        /* handle to wait on */
    int          overlapped;    /* is it an overlapped I/O handle? */
@END


/* Unlock a region of a file */
@REQ(unlock_file)
    obj_handle_t handle;        /* handle to the file */
    unsigned int offset_low;    /* offset of start of unlock */
    unsigned int offset_high;   /* offset of start of unlock */
    unsigned int count_low;     /* count of bytes to unlock */
    unsigned int count_high;    /* count of bytes to unlock */
@END


/* Get ready to unmount a Unix device */
@REQ(unmount_device)
    obj_handle_t handle;        /* handle to a file on the device */
@END


/* Create a socket */
@REQ(create_socket)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    int          family;        /* family, see socket manpage */
    int          type;          /* type, see socket manpage */
    int          protocol;      /* protocol, see socket manpage */
    unsigned int flags;         /* socket flags */
@REPLY
    obj_handle_t handle;        /* handle to the new socket */
@END


/* Accept a socket */
@REQ(accept_socket)
    obj_handle_t lhandle;       /* handle to the listening socket */
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
@REPLY
    obj_handle_t handle;        /* handle to the new socket */
@END


/* Set socket event parameters */
@REQ(set_socket_event)
    obj_handle_t  handle;        /* handle to the socket */
    unsigned int  mask;          /* event mask */
    obj_handle_t  event;         /* event object */
    user_handle_t window;        /* window to send the message to */
    unsigned int  msg;           /* message to send */
@END


/* Get socket event parameters */
@REQ(get_socket_event)
    obj_handle_t handle;        /* handle to the socket */
    int          service;       /* clear pending? */
    obj_handle_t c_event;       /* event to clear */
@REPLY
    unsigned int mask;          /* event mask */
    unsigned int pmask;         /* pending events */
    unsigned int state;         /* status bits */
    VARARG(errors,ints);        /* event errors */
@END


/* Reenable pending socket events */
@REQ(enable_socket_event)
    obj_handle_t handle;        /* handle to the socket */
    unsigned int mask;          /* events to re-enable */
    unsigned int sstate;        /* status bits to set */
    unsigned int cstate;        /* status bits to clear */
@END

@REQ(set_socket_deferred)
    obj_handle_t handle;        /* handle to the socket */
    obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
@END

/* Allocate a console (only used by a console renderer) */
@REQ(alloc_console)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    process_id_t pid;           /* pid of process which shall be attached to the console */
@REPLY
    obj_handle_t handle_in;     /* handle to console input */
    obj_handle_t event;         /* handle to renderer events change notification */
@END


/* Free the console of the current process */
@REQ(free_console)
@END


#define CONSOLE_RENDERER_NONE_EVENT        0x00
#define CONSOLE_RENDERER_TITLE_EVENT       0x01
#define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
#define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
#define CONSOLE_RENDERER_UPDATE_EVENT      0x04
#define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
#define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
#define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
#define CONSOLE_RENDERER_EXIT_EVENT        0x08
struct console_renderer_event
{
    short event;
    union
    {
        struct update
        {
            short top;
            short bottom;
        } update;
        struct resize
        {
            short width;
            short height;
        } resize;
        struct cursor_pos
        {
            short x;
            short y;
        } cursor_pos;
        struct cursor_geom
        {
            short visible;
            short size;
        } cursor_geom;
        struct display
        {
            short left;
            short top;
            short width;
            short height;
        } display;
    } u;
};

/* retrieve console events for the renderer */
@REQ(get_console_renderer_events)
    obj_handle_t handle;        /* handle to console input events */
@REPLY
    VARARG(data,bytes);         /* the various console_renderer_events */
@END


/* Open a handle to the process console */
@REQ(open_console)
    obj_handle_t from;          /* 0 (resp 1) input (resp output) of current process console */
                                /* otherwise console_in handle to get active screen buffer? */
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    int          share;         /* share mask (only for output handles) */
@REPLY
    obj_handle_t handle;        /* handle to the console */
@END


/* Get the input queue wait event */
@REQ(get_console_wait_event)
@REPLY
    obj_handle_t handle;
@END

/* Get a console mode (input or output) */
@REQ(get_console_mode)
    obj_handle_t handle;        /* handle to the console */
@REPLY
    int          mode;          /* console mode */
@END


/* Set a console mode (input or output) */
@REQ(set_console_mode)
    obj_handle_t handle;        /* handle to the console */
    int          mode;          /* console mode */
@END


/* Set info about a console (input only) */
@REQ(set_console_input_info)
    obj_handle_t handle;        /* handle to console input, or 0 for process' console */
    int          mask;          /* setting mask (see below) */
    obj_handle_t active_sb;     /* active screen buffer */
    int          history_mode;  /* whether we duplicate lines in history */
    int          history_size;  /* number of lines in history */
    int          edition_mode;  /* index to the edition mode flavors */
    VARARG(title,unicode_str);  /* console title */
@END
#define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
#define SET_CONSOLE_INPUT_INFO_TITLE            0x02
#define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
#define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
#define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10


/* Get info about a console (input only) */
@REQ(get_console_input_info)
    obj_handle_t handle;        /* handle to console input, or 0 for process' console */
@REPLY
    int          history_mode;  /* whether we duplicate lines in history */
    int          history_size;  /* number of lines in history */
    int          history_index; /* number of used lines in history */
    int          edition_mode;  /* index to the edition mode flavors */
    VARARG(title,unicode_str);  /* console title */
@END


/* appends a string to console's history */
@REQ(append_console_input_history)
    obj_handle_t handle;        /* handle to console input, or 0 for process' console */
    VARARG(line,unicode_str);   /* line to add */
@END


/* appends a string to console's history */
@REQ(get_console_input_history)
    obj_handle_t handle;        /* handle to console input, or 0 for process' console */
    int          index;         /* index to get line from */
@REPLY
    int          total;         /* total length of line in Unicode chars */
    VARARG(line,unicode_str);   /* line to add */
@END


/* creates a new screen buffer on process' console */
@REQ(create_console_output)
    obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    unsigned int share;         /* sharing credentials */
@REPLY
    obj_handle_t handle_out;    /* handle to the screen buffer */
@END


/* Set info about a console (output only) */
@REQ(set_console_output_info)
    obj_handle_t handle;        /* handle to the console */
    int          mask;          /* setting mask (see below) */
    short int    cursor_size;   /* size of cursor (percentage filled) */
    short int    cursor_visible;/* cursor visibility flag */
    short int    cursor_x;      /* position of cursor (x, y) */
    short int    cursor_y;
    short int    width;         /* width of the screen buffer */
    short int    height;        /* height of the screen buffer */
    short int    attr;          /* default attribute */
    short int    win_left;      /* window actually displayed by renderer */
    short int    win_top;       /* the rect area is expressed withing the */
    short int    win_right;     /* boundaries of the screen buffer */
    short int    win_bottom;
    short int    max_width;     /* maximum size (width x height) for the window */
    short int    max_height;
@END
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
#define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
#define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20


/* Get info about a console (output only) */
@REQ(get_console_output_info)
    obj_handle_t handle;        /* handle to the console */
@REPLY
    short int    cursor_size;   /* size of cursor (percentage filled) */
    short int    cursor_visible;/* cursor visibility flag */
    short int    cursor_x;      /* position of cursor (x, y) */
    short int    cursor_y;
    short int    width;         /* width of the screen buffer */
    short int    height;        /* height of the screen buffer */
    short int    attr;          /* default attribute */
    short int    win_left;      /* window actually displayed by renderer */
    short int    win_top;       /* the rect area is expressed withing the */
    short int    win_right;     /* boundaries of the screen buffer */
    short int    win_bottom;
    short int    max_width;     /* maximum size (width x height) for the window */
    short int    max_height;
@END

/* Add input records to a console input queue */
@REQ(write_console_input)
    obj_handle_t handle;        /* handle to the console input */
    VARARG(rec,input_records);  /* input records */
@REPLY
    int          written;       /* number of records written */
@END


/* Fetch input records from a console input queue */
@REQ(read_console_input)
    obj_handle_t handle;        /* handle to the console input */
    int          flush;         /* flush the retrieved records from the queue? */
@REPLY
    int          read;          /* number of records read */
    VARARG(rec,input_records);  /* input records */
@END


/* write data (chars and/or attributes) in a screen buffer */
@REQ(write_console_output)
    obj_handle_t handle;        /* handle to the console output */
    int          x;             /* position where to start writing */
    int          y;
    int          mode;          /* char info (see below) */
    int          wrap;          /* wrap around at end of line? */
    VARARG(data,bytes);         /* info to write */
@REPLY
    int          written;       /* number of char infos actually written */
    int          width;         /* width of screen buffer */
    int          height;        /* height of screen buffer */
@END
enum char_info_mode
{
    CHAR_INFO_MODE_TEXT,        /* characters only */
    CHAR_INFO_MODE_ATTR,        /* attributes only */
    CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
    CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
};


/* fill a screen buffer with constant data (chars and/or attributes) */
@REQ(fill_console_output)
    obj_handle_t handle;        /* handle to the console output */
    int          x;             /* position where to start writing */
    int          y;
    int          mode;          /* char info mode */
    int          count;         /* number to write */
    int          wrap;          /* wrap around at end of line? */
    char_info_t  data;          /* data to write */
@REPLY
    int          written;       /* number of char infos actually written */
@END


/* read data (chars and/or attributes) from a screen buffer */
@REQ(read_console_output)
    obj_handle_t handle;        /* handle to the console output */
    int          x;             /* position (x,y) where to start reading */
    int          y;
    int          mode;          /* char info mode */
    int          wrap;          /* wrap around at end of line? */
@REPLY
    int          width;         /* width of screen buffer */
    int          height;        /* height of screen buffer */
    VARARG(data,bytes);
@END


/* move a rect (of data) in screen buffer content */
@REQ(move_console_output)
    obj_handle_t handle;        /* handle to the console output */
    short int    x_src;         /* position (x, y) of rect to start moving from */
    short int    y_src;
    short int    x_dst;         /* position (x, y) of rect to move to */
    short int    y_dst;
    short int    w;             /* size of the rect (width, height) to move */
    short int    h;
@END


/* Sends a signal to a process group */
@REQ(send_console_signal)
    int          signal;        /* the signal to send */
    process_id_t group_id;      /* the group to send the signal to */
@END


/* enable directory change notifications */
@REQ(read_directory_changes)
    unsigned int filter;        /* notification filter */
    obj_handle_t handle;        /* handle to the directory */
    obj_handle_t event;         /* handle to the event */
    int          subtree;       /* watch the subtree? */
    int          want_data;     /* flag indicating whether change data should be collected */
    void*        io_apc;        /* APC routine to queue upon end of async */
    void*        io_sb;         /* I/O status block (unique across all async on this handle) */
    void*        io_user;       /* data to pass back to caller */
@END


@REQ(read_change)
    obj_handle_t handle;
@REPLY
    int          action;        /* type of change */
    VARARG(name,string);        /* name of directory entry that changed */
@END


/* Create a file mapping */
@REQ(create_mapping)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    int          size_high;     /* mapping size */
    int          size_low;      /* mapping size */
    int          protect;       /* protection flags (see below) */
    obj_handle_t file_handle;   /* file handle */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the mapping */
@END
/* protection flags */
#define VPROT_READ       0x01
#define VPROT_WRITE      0x02
#define VPROT_EXEC       0x04
#define VPROT_WRITECOPY  0x08
#define VPROT_GUARD      0x10
#define VPROT_NOCACHE    0x20
#define VPROT_COMMITTED  0x40
#define VPROT_IMAGE      0x80


/* Open a mapping */
@REQ(open_mapping)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the mapping */
@END


/* Get information about a file mapping */
@REQ(get_mapping_info)
    obj_handle_t handle;        /* handle to the mapping */
@REPLY
    int          size_high;     /* mapping size */
    int          size_low;      /* mapping size */
    int          protect;       /* protection flags */
    int          header_size;   /* header size (for VPROT_IMAGE mapping) */
    void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
    obj_handle_t shared_file;   /* shared mapping file handle */
    int          shared_size;   /* shared mapping size */
@END


#define SNAP_HEAPLIST   0x00000001
#define SNAP_PROCESS    0x00000002
#define SNAP_THREAD     0x00000004
#define SNAP_MODULE     0x00000008
/* Create a snapshot */
@REQ(create_snapshot)
    unsigned int attributes;    /* object attributes */
    int          flags;         /* snapshot flags (SNAP_*) */
    process_id_t pid;           /* process id */
@REPLY
    obj_handle_t handle;        /* handle to the snapshot */
@END


/* Get the next process from a snapshot */
@REQ(next_process)
    obj_handle_t handle;        /* handle to the snapshot */
    int          reset;         /* reset snapshot position? */
@REPLY
    int          count;         /* process usage count */
    process_id_t pid;           /* process id */
    process_id_t ppid;          /* parent process id */
    void*        heap;          /* heap base */
    void*        module;        /* main module */
    int          threads;       /* number of threads */
    int          priority;      /* process priority */
    int          handles;       /* number of handles */
    VARARG(filename,unicode_str); /* file name of main exe */
@END


/* Get the next thread from a snapshot */
@REQ(next_thread)
    obj_handle_t handle;        /* handle to the snapshot */
    int          reset;         /* reset snapshot position? */
@REPLY
    int          count;         /* thread usage count */
    process_id_t pid;           /* process id */
    thread_id_t  tid;           /* thread id */
    int          base_pri;      /* base priority */
    int          delta_pri;     /* delta priority */
@END


/* Get the next module from a snapshot */
@REQ(next_module)
    obj_handle_t handle;        /* handle to the snapshot */
    int          reset;         /* reset snapshot position? */
@REPLY
    process_id_t pid;           /* process id */
    void*        base;          /* module base address */
    size_t       size;          /* module size */
    VARARG(filename,unicode_str); /* file name of module */
@END


/* Wait for a debug event */
@REQ(wait_debug_event)
    int           get_handle;  /* should we alloc a handle for waiting? */
@REPLY
    process_id_t  pid;         /* process id */
    thread_id_t   tid;         /* thread id */
    obj_handle_t  wait;        /* wait handle if no event ready */
    VARARG(event,debug_event); /* debug event data */
@END


/* Queue an exception event */
@REQ(queue_exception_event)
    int              first;    /* first chance exception? */
    VARARG(record,exc_event);  /* thread context followed by exception record */
@REPLY
    obj_handle_t     handle;   /* handle to the queued event */
@END


/* Retrieve the status of an exception event */
@REQ(get_exception_status)
    obj_handle_t     handle;   /* handle to the queued event */
@REPLY
    VARARG(context,context);   /* modified thread context */
@END


/* Send an output string to the debugger */
@REQ(output_debug_string)
    void*         string;      /* string to display (in debugged process address space) */
    int           unicode;     /* is it Unicode? */
    int           length;      /* string length */
@END


/* Continue a debug event */
@REQ(continue_debug_event)
    process_id_t pid;          /* process id to continue */
    thread_id_t  tid;          /* thread id to continue */
    int          status;       /* continuation status */
@END


/* Start/stop debugging an existing process */
@REQ(debug_process)
    process_id_t pid;          /* id of the process to debug */
    int          attach;       /* 1=attaching / 0=detaching from the process */
@END


/* Simulate a breakpoint in a process */
@REQ(debug_break)
    obj_handle_t handle;       /* process handle */
@REPLY
    int          self;         /* was it the caller itself? */
@END


/* Set debugger kill on exit flag */
@REQ(set_debugger_kill_on_exit)
    int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
@END


/* Read data from a process address space */
@REQ(read_process_memory)
    obj_handle_t handle;       /* process handle */
    void*        addr;         /* addr to read from */
@REPLY
    VARARG(data,bytes);        /* result data */
@END


/* Write data to a process address space */
@REQ(write_process_memory)
    obj_handle_t handle;       /* process handle */
    void*        addr;         /* addr to write to */
    VARARG(data,bytes);        /* data to write */
@END


/* Create a registry key */
@REQ(create_key)
    obj_handle_t parent;       /* handle to the parent key */
    unsigned int access;       /* desired access rights */
    unsigned int attributes;   /* object attributes */
    unsigned int options;      /* creation options */
    time_t       modif;        /* last modification time */
    data_size_t  namelen;      /* length of key name in bytes */
    VARARG(name,unicode_str,namelen);  /* key name */
    VARARG(class,unicode_str);         /* class name */
@REPLY
    obj_handle_t hkey;         /* handle to the created key */
    int          created;      /* has it been newly created? */
@END

/* Open a registry key */
@REQ(open_key)
    obj_handle_t parent;       /* handle to the parent key */
    unsigned int access;       /* desired access rights */
    unsigned int attributes;   /* object attributes */
    VARARG(name,unicode_str);  /* key name */
@REPLY
    obj_handle_t hkey;         /* handle to the open key */
@END


/* Delete a registry key */
@REQ(delete_key)
    obj_handle_t hkey;         /* handle to the key */
@END


/* Flush a registry key */
@REQ(flush_key)
    obj_handle_t hkey;         /* handle to the key */
@END


/* Enumerate registry subkeys */
@REQ(enum_key)
    obj_handle_t hkey;         /* handle to registry key */
    int          index;        /* index of subkey (or -1 for current key) */
    int          info_class;   /* requested information class */
@REPLY
    int          subkeys;      /* number of subkeys */
    int          max_subkey;   /* longest subkey name */
    int          max_class;    /* longest class name */
    int          values;       /* number of values */
    int          max_value;    /* longest value name */
    int          max_data;     /* longest value data */
    time_t       modif;        /* last modification time */
    data_size_t  total;        /* total length needed for full name and class */
    data_size_t  namelen;      /* length of key name in bytes */
    VARARG(name,unicode_str,namelen);  /* key name */
    VARARG(class,unicode_str);         /* class name */
@END


/* Set a value of a registry key */
@REQ(set_key_value)
    obj_handle_t hkey;         /* handle to registry key */
    int          type;         /* value type */
    data_size_t  namelen;      /* length of value name in bytes */
    VARARG(name,unicode_str,namelen);  /* value name */
    VARARG(data,bytes);                /* value data */
@END


/* Retrieve the value of a registry key */
@REQ(get_key_value)
    obj_handle_t hkey;         /* handle to registry key */
    VARARG(name,unicode_str);  /* value name */
@REPLY
    int          type;         /* value type */
    data_size_t  total;        /* total length needed for data */
    VARARG(data,bytes);        /* value data */
@END


/* Enumerate a value of a registry key */
@REQ(enum_key_value)
    obj_handle_t hkey;         /* handle to registry key */
    int          index;        /* value index */
    int          info_class;   /* requested information class */
@REPLY
    int          type;         /* value type */
    data_size_t  total;        /* total length needed for full name and data */
    data_size_t  namelen;      /* length of value name in bytes */
    VARARG(name,unicode_str,namelen);  /* value name */
    VARARG(data,bytes);                /* value data */
@END


/* Delete a value of a registry key */
@REQ(delete_key_value)
    obj_handle_t hkey;         /* handle to registry key */
    VARARG(name,unicode_str);  /* value name */
@END


/* Load a registry branch from a file */
@REQ(load_registry)
    obj_handle_t hkey;         /* root key to load to */
    obj_handle_t file;         /* file to load from */
    VARARG(name,unicode_str);  /* subkey name */
@END


/* UnLoad a registry branch from a file */
@REQ(unload_registry)
    obj_handle_t hkey;         /* root key to unload to */
@END


/* Save a registry branch to a file */
@REQ(save_registry)
    obj_handle_t hkey;         /* key to save */
    obj_handle_t file;         /* file to save to */
@END


/* Add a registry key change notification */
@REQ(set_registry_notification)
    obj_handle_t hkey;         /* key to watch for changes */
    obj_handle_t event;        /* event to set */
    int          subtree;      /* should we watch the whole subtree? */
    unsigned int filter;       /* things to watch */
@END


/* Create a waitable timer */
@REQ(create_timer)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    int          manual;        /* manual reset */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the timer */
@END


/* Open a waitable timer */
@REQ(open_timer)
    unsigned int access;        /* wanted access rights */
    unsigned int attributes;    /* object attributes */
    obj_handle_t rootdir;       /* root directory */
    VARARG(name,unicode_str);   /* object name */
@REPLY
    obj_handle_t handle;        /* handle to the timer */
@END

/* Set a waitable timer */
@REQ(set_timer)
    obj_handle_t handle;        /* handle to the timer */
    abs_time_t   expire;        /* next expiration absolute time */
    int          period;        /* timer period in ms */
    void*        callback;      /* callback function */
    void*        arg;           /* callback argument */
@REPLY
    int          signaled;      /* was the timer signaled before this call ? */
@END

/* Cancel a waitable timer */
@REQ(cancel_timer)
    obj_handle_t handle;        /* handle to the timer */
@REPLY
     int         signaled;      /* was the timer signaled before this calltime ? */
@END

/* Get information on a waitable timer */
@REQ(get_timer_info)
    obj_handle_t handle;        /* handle to the timer */
@REPLY
    abs_time_t   when;          /* absolute time when the timer next expires */
    int          signaled;      /* is the timer signaled? */
@END


/* Retrieve the current context of a thread */
@REQ(get_thread_context)
    obj_handle_t handle;       /* thread handle */
    unsigned int flags;        /* context flags */
    int          suspend;      /* if getting context during suspend */
@REPLY
    int          self;         /* was it a handle to the current thread? */
    VARARG(context,context);   /* thread context */
@END


/* Set the current context of a thread */
@REQ(set_thread_context)
    obj_handle_t handle;       /* thread handle */
    unsigned int flags;        /* context flags */
    int          suspend;      /* if setting context during suspend */
    VARARG(context,context);   /* thread context */
@REPLY
    int          self;         /* was it a handle to the current thread? */
@END


/* Fetch a selector entry for a thread */
@REQ(get_selector_entry)
    obj_handle_t  handle;      /* thread handle */
    int           entry;       /* LDT entry */
@REPLY
    unsigned int  base;        /* selector base */
    unsigned int  limit;       /* selector limit */
    unsigned char flags;       /* selector flags */
@END


/* Add an atom */
@REQ(add_atom)
    obj_handle_t  table;       /* which table to add atom to */
    VARARG(name,unicode_str);  /* atom name */
@REPLY
    atom_t        atom;        /* resulting atom */
@END


/* Delete an atom */
@REQ(delete_atom)
    obj_handle_t  table;       /* which table to delete atom from */
    atom_t        atom;        /* atom handle */
@END


/* Find an atom */
@REQ(find_atom)
    obj_handle_t table;        /* which table to find atom from */
    VARARG(name,unicode_str);  /* atom name */
@REPLY
    atom_t       atom;         /* atom handle */
@END


/* Get information about an atom */
@REQ(get_atom_information)
    obj_handle_t table;        /* which table to find atom from */
    atom_t       atom;         /* atom handle */
@REPLY
    int          count;        /* atom lock count */
    int          pinned;       /* whether the atom has been pinned */
    data_size_t  total;        /* actual length of atom name */
    VARARG(name,unicode_str);  /* atom name */
@END


/* Set information about an atom */
@REQ(set_atom_information)
    obj_handle_t table;        /* which table to find atom from */
    atom_t       atom;         /* atom handle */
    int          pinned;       /* whether to bump atom information */
@END


/* Empty an atom table */
@REQ(empty_atom_table)
    obj_handle_t table;        /* which table to find atom from */
    int          if_pinned;    /* whether to delete pinned atoms */
@END


/* Init an atom table */
@REQ(init_atom_table)
    int          entries;      /* number of entries (only for local) */
@REPLY
    obj_handle_t table;        /* handle to the atom table */
@END


/* Get the message queue of the current thread */
@REQ(get_msg_queue)
@REPLY
    obj_handle_t handle;       /* handle to the queue */
@END


/* Set the current message queue wakeup mask */
@REQ(set_queue_mask)
    unsigned int wake_mask;    /* wakeup bits mask */
    unsigned int changed_mask; /* changed bits mask */
    int          skip_wait;    /* will we skip waiting if signaled? */
@REPLY
    unsigned int wake_bits;    /* current wake bits */
    unsigned int changed_bits; /* current changed bits */
@END


/* Get the current message queue status */
@REQ(get_queue_status)
    int          clear;        /* should we clear the change bits? */
@REPLY
    unsigned int wake_bits;    /* wake bits */
    unsigned int changed_bits; /* changed bits since last time */
@END


/* Retrieve the process idle event */
@REQ(get_process_idle_event)
    obj_handle_t handle;       /* process handle */
@REPLY
    obj_handle_t event;        /* handle to idle event */
@END


/* Send a message to a thread queue */
@REQ(send_message)
    thread_id_t     id;        /* thread id */
    int             type;      /* message type (see below) */
    int             flags;     /* message flags (see below) */
    user_handle_t   win;       /* window handle */
    unsigned int    msg;       /* message code */
    unsigned long   wparam;    /* parameters */
    unsigned long   lparam;    /* parameters */
    int             timeout;   /* timeout for reply */
    VARARG(data,message_data); /* message data for sent messages */
@END

@REQ(post_quit_message)
    int             exit_code; /* exit code to return */
@END

enum message_type
{
    MSG_ASCII,          /* Ascii message (from SendMessageA) */
    MSG_UNICODE,        /* Unicode message (from SendMessageW) */
    MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
    MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
    MSG_CALLBACK_RESULT,/* result of a callback message */
    MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
    MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
    MSG_HARDWARE,       /* hardware message */
    MSG_WINEVENT        /* winevent message */
};
#define SEND_MSG_ABORT_IF_HUNG  0x01


/* Send a hardware message to a thread queue */
@REQ(send_hardware_message)
    thread_id_t     id;        /* thread id */
    user_handle_t   win;       /* window handle */
    unsigned int    msg;       /* message code */
    unsigned int    time;      /* message time */
    unsigned long   wparam;    /* parameters */
    unsigned long   lparam;    /* parameters */
    unsigned long   info;      /* extra info */
    int             x;         /* x position */
    int             y;         /* y position */
@END


/* Get a message from the current queue */
@REQ(get_message)
    int             flags;     /* see below */
    user_handle_t   get_win;   /* window handle to get */
    unsigned int    get_first; /* first message code to get */
    unsigned int    get_last;  /* last message code to get */
    unsigned int    hw_id;     /* id of the previous hardware message (or 0) */
@REPLY
    user_handle_t   win;       /* window handle */
    int             type;      /* message type */
    unsigned int    msg;       /* message code */
    unsigned long   wparam;    /* parameters */
    unsigned long   lparam;    /* parameters */
    unsigned long   info;      /* extra info */
    int             x;         /* x position */
    int             y;         /* y position */
    unsigned int    time;      /* message time */
    unsigned int    hw_id;     /* id if hardware message */
    unsigned int    active_hooks; /* active hooks bitmap */
    data_size_t     total;     /* total size of extra data */
    VARARG(data,message_data); /* message data for sent messages */
@END
#define GET_MSG_REMOVE      1  /* remove the message */
#define GET_MSG_SENT_ONLY   2  /* only get sent messages */

/* Reply to a sent message */
@REQ(reply_message)
    unsigned int    result;    /* message result */
    int             remove;    /* should we remove the message? */
    VARARG(data,bytes);        /* message data for sent messages */
@END


/* Accept the current hardware message */
@REQ(accept_hardware_message)
    unsigned int    hw_id;     /* id of the hardware message */
    int             remove;    /* should we remove the message? */
    user_handle_t   new_win;   /* new destination window for current message */
@END


/* Retrieve the reply for the last message sent */
@REQ(get_message_reply)
    int             cancel;    /* cancel message if not ready? */
@REPLY
    unsigned int    result;    /* message result */
    VARARG(data,bytes);        /* message data for sent messages */
@END


/* Set a window timer */
@REQ(set_win_timer)
    user_handle_t   win;       /* window handle */
    unsigned int    msg;       /* message to post */
    unsigned int    rate;      /* timer rate in ms */
    unsigned long   id;        /* timer id */
    unsigned long   lparam;    /* message lparam (callback proc) */
@REPLY
    unsigned long   id;        /* timer id */
@END


/* Kill a window timer */
@REQ(kill_win_timer)
    user_handle_t   win;       /* window handle */
    unsigned int    msg;       /* message to post */
    unsigned long   id;        /* timer id */
@END


/* Retrieve info about a serial port */
@REQ(get_serial_info)
    obj_handle_t handle;       /* handle to comm port */
@REPLY
    unsigned int readinterval;
    unsigned int readconst;
    unsigned int readmult;
    unsigned int writeconst;
    unsigned int writemult;
    unsigned int eventmask;
@END


/* Set info about a serial port */
@REQ(set_serial_info)
    obj_handle_t handle;       /* handle to comm port */
    int          flags;        /* bitmask to set values (see below) */
    unsigned int readinterval;
    unsigned int readconst;
    unsigned int readmult;
    unsigned int writeconst;
    unsigned int writemult;
    unsigned int eventmask;
@END
#define SERIALINFO_SET_TIMEOUTS  0x01
#define SERIALINFO_SET_MASK      0x02


/* Create an async I/O */
@REQ(register_async)
    obj_handle_t handle;        /* handle to comm port, socket or file */
    int          type;          /* type of queue to look after */
    void*        io_apc;        /* APC routine to queue upon end of async */
    void*        io_sb;         /* I/O status block (unique across all async on this handle) */
    void*        io_user;       /* data to pass back to caller */
    int          count;         /* count - usually # of bytes to be read/written */
@END
#define ASYNC_TYPE_READ  0x01
#define ASYNC_TYPE_WRITE 0x02
#define ASYNC_TYPE_WAIT  0x03


/* Cancel all async op on a fd */
@REQ(cancel_async)
    obj_handle_t handle;        /* handle to comm port, socket or file */
@END


/* Create a named pipe */
@REQ(create_named_pipe)
    unsigned int   access;
    unsigned int   attributes;   /* object attributes */
    obj_handle_t   rootdir;      /* root directory */
    unsigned int   options;
    unsigned int   flags;
    unsigned int   maxinstances;
    unsigned int   outsize;
    unsigned int   insize;
    unsigned int   timeout;
    VARARG(name,unicode_str);    /* pipe name */
@REPLY
    obj_handle_t   handle;       /* handle to the pipe */
@END

/* flags in create_named_pipe and get_named_pipe_info */
#define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
#define NAMED_PIPE_MESSAGE_STREAM_READ  0x0002
#define NAMED_PIPE_NONBLOCKING_MODE     0x0004
#define NAMED_PIPE_SERVER_END           0x8000

/* Open an existing named pipe */
@REQ(open_named_pipe)
    unsigned int   access;
    unsigned int   attributes;   /* object attributes */
    obj_handle_t   rootdir;      /* root directory */
    unsigned int   flags;        /* file flags */
    VARARG(name,unicode_str);    /* pipe name */
@REPLY
    obj_handle_t   handle;       /* handle to the pipe */
@END


/* Connect to a named pipe */
@REQ(connect_named_pipe)
    obj_handle_t   handle;
    obj_handle_t   event;
    void*          func;
@END


/* Wait for a named pipe */
@REQ(wait_named_pipe)
    obj_handle_t   handle;
    unsigned int   timeout;
    obj_handle_t   event;
    void*          func;
    VARARG(name,unicode_str);    /* pipe name */
@END


/* Disconnect a named pipe */
@REQ(disconnect_named_pipe)
    obj_handle_t   handle;
@END


@REQ(get_named_pipe_info)
    obj_handle_t   handle;
@REPLY
    unsigned int   flags;
    unsigned int   maxinstances;
    unsigned int   instances;
    unsigned int   outsize;
    unsigned int   insize;
@END


/* Create a window */
@REQ(create_window)
    user_handle_t  parent;      /* parent window */
    user_handle_t  owner;       /* owner window */
    atom_t         atom;        /* class atom */
    void*          instance;    /* module instance */
@REPLY
    user_handle_t  handle;      /* created window */
    user_handle_t  parent;      /* full handle of parent */
    user_handle_t  owner;       /* full handle of owner */
    int            extra;       /* number of extra bytes */
    void*          class_ptr;   /* pointer to class in client address space */
@END


/* Destroy a window */
@REQ(destroy_window)
    user_handle_t  handle;      /* handle to the window */
@END


/* Retrieve the desktop window for the current thread */
@REQ(get_desktop_window)
    int            force;       /* force creation if it doesn't exist */
@REPLY
    user_handle_t  handle;      /* handle to the desktop window */
@END


/* Set a window owner */
@REQ(set_window_owner)
    user_handle_t  handle;      /* handle to the window */
    user_handle_t  owner;       /* new owner */
@REPLY
    user_handle_t  full_owner;  /* full handle of new owner */
    user_handle_t  prev_owner;  /* full handle of previous owner */
@END


/* Get information from a window handle */
@REQ(get_window_info)
    user_handle_t  handle;      /* handle to the window */
@REPLY
    user_handle_t  full_handle; /* full 32-bit handle */
    user_handle_t  last_active; /* last active popup */
    process_id_t   pid;         /* process owning the window */
    thread_id_t    tid;         /* thread owning the window */
    atom_t         atom;        /* class atom */
    int            is_unicode;  /* ANSI or unicode */
@END


/* Set some information in a window */
@REQ(set_window_info)
    unsigned int   flags;         /* flags for fields to set (see below) */
    user_handle_t  handle;        /* handle to the window */
    unsigned int   style;         /* window style */
    unsigned int   ex_style;      /* window extended style */
    unsigned int   id;            /* window id */
    int            is_unicode;    /* ANSI or unicode */
    void*          instance;      /* creator instance */
    unsigned long  user_data;     /* user-specific data */
    int            extra_offset;  /* offset to set in extra bytes */
    data_size_t    extra_size;    /* size to set in extra bytes */
    unsigned long  extra_value;   /* value to set in extra bytes */
@REPLY
    unsigned int   old_style;     /* old window style */
    unsigned int   old_ex_style;  /* old window extended style */
    unsigned int   old_id;        /* old window id */
    void*          old_instance;  /* old creator instance */
    unsigned long  old_user_data; /* old user-specific data */
    unsigned long  old_extra_value; /* old value in extra bytes */
@END
#define SET_WIN_STYLE     0x01
#define SET_WIN_EXSTYLE   0x02
#define SET_WIN_ID        0x04
#define SET_WIN_INSTANCE  0x08
#define SET_WIN_USERDATA  0x10
#define SET_WIN_EXTRA     0x20
#define SET_WIN_UNICODE   0x40


/* Set the parent of a window */
@REQ(set_parent)
    user_handle_t  handle;      /* handle to the window */
    user_handle_t  parent;      /* handle to the parent */
@REPLY
    user_handle_t  old_parent;  /* old parent window */
    user_handle_t  full_parent; /* full handle of new parent */
@END


/* Get a list of the window parents, up to the root of the tree */
@REQ(get_window_parents)
    user_handle_t  handle;        /* handle to the window */
@REPLY
    int            count;         /* total count of parents */
    VARARG(parents,user_handles); /* parent handles */
@END


/* Get a list of the window children */
@REQ(get_window_children)
    user_handle_t  parent;        /* parent window */
    atom_t         atom;          /* class atom for the listed children */
    thread_id_t    tid;           /* thread owning the listed children */
@REPLY
    int            count;         /* total count of children */
    VARARG(children,user_handles); /* children handles */
@END


/* Get a list of the window children that contain a given point */
@REQ(get_window_children_from_point)
    user_handle_t  parent;        /* parent window */
    int            x;             /* point in parent coordinates */
    int            y;
@REPLY
    int            count;         /* total count of children */
    VARARG(children,user_handles); /* children handles */
@END


/* Get window tree information from a window handle */
@REQ(get_window_tree)
    user_handle_t  handle;        /* handle to the window */
@REPLY
    user_handle_t  parent;        /* parent window */
    user_handle_t  owner;         /* owner window */
    user_handle_t  next_sibling;  /* next sibling in Z-order */
    user_handle_t  prev_sibling;  /* prev sibling in Z-order */
    user_handle_t  first_sibling; /* first sibling in Z-order */
    user_handle_t  last_sibling;  /* last sibling in Z-order */
    user_handle_t  first_child;   /* first child */
    user_handle_t  last_child;    /* last child */
@END

/* Set the position and Z order of a window */
@REQ(set_window_pos)
    unsigned int   flags;         /* SWP_* flags */
    user_handle_t  handle;        /* handle to the window */
    user_handle_t  previous;      /* previous window in Z order */
    rectangle_t    window;        /* window rectangle */
    rectangle_t    client;        /* client rectangle */
    VARARG(valid,rectangles);     /* valid rectangles from WM_NCCALCSIZE */
@REPLY
    unsigned int   new_style;     /* new window style */
@END


/* Get the window and client rectangles of a window */
@REQ(get_window_rectangles)
    user_handle_t  handle;        /* handle to the window */
@REPLY
    rectangle_t    window;        /* window rectangle */
    rectangle_t    visible;       /* visible part of the window rectangle */
    rectangle_t    client;        /* client rectangle */
@END


/* Get the window text */
@REQ(get_window_text)
    user_handle_t  handle;        /* handle to the window */
@REPLY
    VARARG(text,unicode_str);     /* window text */
@END


/* Set the window text */
@REQ(set_window_text)
    user_handle_t  handle;        /* handle to the window */
    VARARG(text,unicode_str);     /* window text */
@END


/* Get the coordinates offset between two windows */
@REQ(get_windows_offset)
    user_handle_t  from;          /* handle to the first window */
    user_handle_t  to;            /* handle to the second window */
@REPLY
    int            x;             /* x coordinate offset */
    int            y;             /* y coordinate offset */
@END


/* Get the visible region of a window */
@REQ(get_visible_region)
    user_handle_t  window;        /* handle to the window */
    unsigned int   flags;         /* DCX flags */
@REPLY
    user_handle_t  top_win;       /* top window to clip against */
    rectangle_t    top_rect;      /* top window visible rect with screen coords */
    rectangle_t    win_rect;      /* window rect in screen coords */
    data_size_t    total_size;    /* total size of the resulting region */
    VARARG(region,rectangles);    /* list of rectangles for the region (in screen coords) */
@END


/* Get the window region */
@REQ(get_window_region)
    user_handle_t  window;        /* handle to the window */
@REPLY
    data_size_t    total_size;    /* total size of the resulting region */
    VARARG(region,rectangles);    /* list of rectangles for the region */
@END


/* Set the window region */
@REQ(set_window_region)
    user_handle_t  window;        /* handle to the window */
    VARARG(region,rectangles);    /* list of rectangles for the region */
@END


/* Get the window update region */
@REQ(get_update_region)
    user_handle_t  window;        /* handle to the window */
    user_handle_t  from_child;    /* child to start searching from */
    unsigned int   flags;         /* update flags (see below) */
@REPLY
    user_handle_t  child;         /* child to repaint (or window itself) */
    unsigned int   flags;         /* resulting update flags (see below) */
    data_size_t    total_size;    /* total size of the resulting region */
    VARARG(region,rectangles);    /* list of rectangles for the region */
@END
#define UPDATE_NONCLIENT       0x01  /* get region for repainting non-client area */
#define UPDATE_ERASE           0x02  /* get region for erasing client area */
#define UPDATE_PAINT           0x04  /* get region for painting client area */
#define UPDATE_INTERNALPAINT   0x08  /* get region if internal paint is pending */
#define UPDATE_ALLCHILDREN     0x10  /* force repaint of all children */
#define UPDATE_NOCHILDREN      0x20  /* don't try to repaint any children */
#define UPDATE_NOREGION        0x40  /* don't return a region, only the flags */


/* Update the z order of a window so that a given rectangle is fully visible */
@REQ(update_window_zorder)
    user_handle_t  window;        /* handle to the window */
    rectangle_t    rect;          /* rectangle that must be visible */
@END


/* Mark parts of a window as needing a redraw */
@REQ(redraw_window)
    user_handle_t  window;        /* handle to the window */
    unsigned int   flags;         /* RDW_* flags */
    VARARG(region,rectangles);    /* list of rectangles for the region */
@END


/* Set a window property */
@REQ(set_window_property)
    user_handle_t  window;        /* handle to the window */
    atom_t         atom;          /* property atom (if no name specified) */
    obj_handle_t   handle;        /* handle to store */
    VARARG(name,unicode_str);     /* property name */
@END


/* Remove a window property */
@REQ(remove_window_property)
    user_handle_t  window;        /* handle to the window */
    atom_t         atom;          /* property atom (if no name specified) */
    VARARG(name,unicode_str);     /* property name */
@REPLY
    obj_handle_t   handle;        /* handle stored in property */
@END


/* Get a window property */
@REQ(get_window_property)
    user_handle_t  window;        /* handle to the window */
    atom_t         atom;          /* property atom (if no name specified) */
    VARARG(name,unicode_str);     /* property name */
@REPLY
    obj_handle_t   handle;        /* handle stored in property */
@END


/* Get the list of properties of a window */
@REQ(get_window_properties)
    user_handle_t  window;        /* handle to the window */
@REPLY
    int            total;         /* total number of properties */
    VARARG(props,properties);     /* list of properties */
@END


/* Create a window station */
@REQ(create_winstation)
    unsigned int flags;           /* window station flags */
    unsigned int access;          /* wanted access rights */
    unsigned int attributes;      /* object attributes */
    VARARG(name,unicode_str);     /* object name */
@REPLY
    obj_handle_t handle;          /* handle to the window station */
@END


/* Open a handle to a window station */
@REQ(open_winstation)
    unsigned int access;          /* wanted access rights */
    unsigned int attributes;      /* object attributes */
    VARARG(name,unicode_str);     /* object name */
@REPLY
    obj_handle_t handle;          /* handle to the window station */
@END


/* Close a window station */
@REQ(close_winstation)
    obj_handle_t handle;          /* handle to the window station */
@END


/* Get the process current window station */
@REQ(get_process_winstation)
@REPLY
    obj_handle_t handle;          /* handle to the window station */
@END


/* Set the process current window station */
@REQ(set_process_winstation)
    obj_handle_t handle;          /* handle to the window station */
@END


/* Create a desktop */
@REQ(create_desktop)
    unsigned int flags;           /* desktop flags */
    unsigned int access;          /* wanted access rights */
    unsigned int attributes;      /* object attributes */
    VARARG(name,unicode_str);     /* object name */
@REPLY
    obj_handle_t handle;          /* handle to the desktop */
@END


/* Open a handle to a desktop */
@REQ(open_desktop)
    unsigned int flags;           /* desktop flags */
    unsigned int access;          /* wanted access rights */
    unsigned int attributes;      /* object attributes */
    VARARG(name,unicode_str);     /* object name */
@REPLY
    obj_handle_t handle;          /* handle to the desktop */
@END


/* Close a desktop */
@REQ(close_desktop)
    obj_handle_t handle;          /* handle to the desktop */
@END


/* Get the thread current desktop */
@REQ(get_thread_desktop)
    thread_id_t  tid;             /* thread id */
@REPLY
    obj_handle_t handle;          /* handle to the desktop */
@END


/* Set the thread current desktop */
@REQ(set_thread_desktop)
    obj_handle_t handle;          /* handle to the desktop */
@END


/* Get/set information about a user object (window station or desktop) */
@REQ(set_user_object_info)
    obj_handle_t handle;          /* handle to the object */
    unsigned int flags;           /* information to set */
    unsigned int obj_flags;       /* new object flags */
@REPLY
    int          is_desktop;      /* is object a desktop? */
    unsigned int old_obj_flags;   /* old object flags */
    VARARG(name,unicode_str);     /* object name */
@END
#define SET_USER_OBJECT_FLAGS 1


/* Attach (or detach) thread inputs */
@REQ(attach_thread_input)
    thread_id_t    tid_from;       /* thread to be attached */
    thread_id_t    tid_to;         /* thread to which tid_from should be attached */
    int            attach;         /* is it an attach? */
@END


/* Get input data for a given thread */
@REQ(get_thread_input)
    thread_id_t    tid;           /* id of thread */
@REPLY
    user_handle_t  focus;         /* handle to the focus window */
    user_handle_t  capture;       /* handle to the capture window */
    user_handle_t  active;        /* handle to the active window */
    user_handle_t  foreground;    /* handle to the global foreground window */
    user_handle_t  menu_owner;    /* handle to the menu owner */
    user_handle_t  move_size;     /* handle to the moving/resizing window */
    user_handle_t  caret;         /* handle to the caret window */
    rectangle_t    rect;          /* caret rectangle */
@END


/* Get the time of the last input event */
@REQ(get_last_input_time)
@REPLY
    unsigned int time;
@END


/* Retrieve queue keyboard state for a given thread */
@REQ(get_key_state)
    thread_id_t    tid;           /* id of thread */
    int            key;           /* optional key code or -1 */
@REPLY
    unsigned char  state;         /* state of specified key */
    VARARG(keystate,bytes);       /* state array for all the keys */
@END

/* Set queue keyboard state for a given thread */
@REQ(set_key_state)
    thread_id_t    tid;           /* id of thread */
    VARARG(keystate,bytes);       /* state array for all the keys */
@END

/* Set the system foreground window */
@REQ(set_foreground_window)
    user_handle_t  handle;        /* handle to the foreground window */
@REPLY
    user_handle_t  previous;      /* handle to the previous foreground window */
    int            send_msg_old;  /* whether we have to send a msg to the old window */
    int            send_msg_new;  /* whether we have to send a msg to the new window */
@END

/* Set the current thread focus window */
@REQ(set_focus_window)
    user_handle_t  handle;        /* handle to the focus window */
@REPLY
    user_handle_t  previous;      /* handle to the previous focus window */
@END

/* Set the current thread active window */
@REQ(set_active_window)
    user_handle_t  handle;        /* handle to the active window */
@REPLY
    user_handle_t  previous;      /* handle to the previous active window */
@END

/* Set the current thread capture window */
@REQ(set_capture_window)
    user_handle_t  handle;        /* handle to the capture window */
    unsigned int   flags;         /* capture flags (see below) */
@REPLY
    user_handle_t  previous;      /* handle to the previous capture window */
    user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
@END
#define CAPTURE_MENU     0x01  /* capture is for a menu */
#define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */


/* Set the current thread caret window */
@REQ(set_caret_window)
    user_handle_t  handle;        /* handle to the caret window */
    int            width;         /* caret width */
    int            height;        /* caret height */
@REPLY
    user_handle_t  previous;      /* handle to the previous caret window */
    rectangle_t    old_rect;      /* previous caret rectangle */
    int            old_hide;      /* previous hide count */
    int            old_state;     /* previous caret state (1=on, 0=off) */
@END


/* Set the current thread caret information */
@REQ(set_caret_info)
    unsigned int   flags;         /* caret flags (see below) */
    user_handle_t  handle;        /* handle to the caret window */
    int            x;             /* caret x position */
    int            y;             /* caret y position */
    int            hide;          /* increment for hide count (can be negative to show it) */
    int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
@REPLY
    user_handle_t  full_handle;   /* handle to the current caret window */
    rectangle_t    old_rect;      /* previous caret rectangle */
    int            old_hide;      /* previous hide count */
    int            old_state;     /* previous caret state (1=on, 0=off) */
@END
#define SET_CARET_POS        0x01  /* set the caret position from x,y */
#define SET_CARET_HIDE       0x02  /* increment the caret hide count */
#define SET_CARET_STATE      0x04  /* set the caret on/off state */


/* Set a window hook */
@REQ(set_hook)
    int            id;             /* id of the hook */
    process_id_t   pid;            /* id of process to set the hook into */
    thread_id_t    tid;            /* id of thread to set the hook into */
    int            event_min;
    int            event_max;
    int            flags;
    void*          proc;           /* hook procedure */
    int            unicode;        /* is it a unicode hook? */
    VARARG(module,unicode_str);    /* module name */
@REPLY
    user_handle_t  handle;         /* handle to the hook */
    unsigned int   active_hooks;   /* active hooks bitmap */
@END


/* Remove a window hook */
@REQ(remove_hook)
    user_handle_t  handle;         /* handle to the hook */
    int            id;             /* id of the hook if handle is 0 */
    void*          proc;           /* hook procedure if handle is 0 */
@REPLY
    unsigned int   active_hooks;   /* active hooks bitmap */
@END


/* Start calling a hook chain */
@REQ(start_hook_chain)
    int            id;             /* id of the hook */
    int            event;          /* signalled event */
    user_handle_t  window;         /* handle to the event window */
    int            object_id;      /* object id for out of context winevent */
    int            child_id;       /* child id for out of context winevent */
@REPLY
    user_handle_t  handle;         /* handle to the next hook */
    process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
    thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
    void*          proc;           /* hook procedure */
    int            unicode;        /* is it a unicode hook? */
    unsigned int   active_hooks;   /* active hooks bitmap */
    VARARG(module,unicode_str);    /* module name */
@END


/* Finished calling a hook chain */
@REQ(finish_hook_chain)
    int            id;             /* id of the hook */
@END


/* Get the hook information */
@REQ(get_hook_info)
    user_handle_t  handle;         /* handle to the current hook */
    int            get_next;       /* do we want info about current or next hook? */
    int            event;          /* signalled event */
    user_handle_t  window;         /* handle to the event window */
    int            object_id;      /* object id for out of context winevent */
    int            child_id;       /* child id for out of context winevent */
@REPLY
    user_handle_t  handle;         /* handle to the hook */
    int            id;             /* id of the hook */
    process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
    thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
    void*          proc;           /* hook procedure */
    int            unicode;        /* is it a unicode hook? */
    VARARG(module,unicode_str);    /* module name */
@END


/* Create a window class */
@REQ(create_class)
    int            local;          /* is it a local class? */
    atom_t         atom;           /* class atom */
    unsigned int   style;          /* class style */
    void*          instance;       /* module instance */
    int            extra;          /* number of extra class bytes */
    int            win_extra;      /* number of window extra bytes */
    void*          client_ptr;     /* pointer to class in client address space */
@END


/* Destroy a window class */
@REQ(destroy_class)
    atom_t         atom;           /* class atom */
    void*          instance;       /* module instance */
@REPLY
    void*          client_ptr;     /* pointer to class in client address space */
@END


/* Set some information in a class */
@REQ(set_class_info)
    user_handle_t  window;         /* handle to the window */
    unsigned int   flags;          /* flags for info to set (see below) */
    atom_t         atom;           /* class atom */
    unsigned int   style;          /* class style */
    int            win_extra;      /* number of window extra bytes */
    void*          instance;       /* module instance */
    int            extra_offset;   /* offset to set in extra bytes */
    data_size_t    extra_size;     /* size to set in extra bytes */
    unsigned long  extra_value;    /* value to set in extra bytes */
@REPLY
    atom_t         old_atom;       /* previous class atom */
    unsigned int   old_style;      /* previous class style */
    int            old_extra;      /* previous number of class extra bytes */
    int            old_win_extra;  /* previous number of window extra bytes */
    void*          old_instance;   /* previous module instance */
    unsigned long  old_extra_value; /* old value in extra bytes */
@END
#define SET_CLASS_ATOM      0x0001
#define SET_CLASS_STYLE     0x0002
#define SET_CLASS_WINEXTRA  0x0004
#define SET_CLASS_INSTANCE  0x0008
#define SET_CLASS_EXTRA     0x0010


/* Set/get clipboard information */
@REQ(set_clipboard_info)
    unsigned int   flags;       /* flags for fields to set (see below) */
    user_handle_t  clipboard;   /* clipboard window */
    user_handle_t  owner;       /* clipboard owner */
    user_handle_t  viewer;      /* first clipboard viewer */
    unsigned int   seqno;       /* change sequence number */
@REPLY
    unsigned int   flags;           /* status flags (see below) */
    user_handle_t  old_clipboard;   /* old clipboard window */
    user_handle_t  old_owner;       /* old clipboard owner */
    user_handle_t  old_viewer;      /* old clipboard viewer */
    unsigned int   seqno;           /* current sequence number */
@END

#define SET_CB_OPEN      0x001
#define SET_CB_OWNER     0x002
#define SET_CB_VIEWER    0x004
#define SET_CB_SEQNO     0x008
#define SET_CB_RELOWNER  0x010
#define SET_CB_CLOSE     0x020
#define CB_OPEN          0x040
#define CB_OWNER         0x080
#define CB_PROCESS       0x100


/* Open a security token */
@REQ(open_token)
    obj_handle_t   handle;    /* handle to the thread or process */
    unsigned int   access;    /* access rights to the new token */
    unsigned int   attributes;/* object attributes */
    unsigned int   flags;     /* flags (see below) */
@REPLY
    obj_handle_t   token;    /* handle to the token */
@END
#define OPEN_TOKEN_THREAD   1
#define OPEN_TOKEN_AS_SELF  2


/* Set/get the global windows */
@REQ(set_global_windows)
    unsigned int   flags;               /* flags for fields to set (see below) */
    user_handle_t  shell_window;        /* handle to the new shell window */
    user_handle_t  shell_listview;      /* handle to the new shell listview window */
    user_handle_t  progman_window;      /* handle to the new program manager window */
    user_handle_t  taskman_window;      /* handle to the new task manager window */
@REPLY
    user_handle_t  old_shell_window;    /* handle to the shell window */
    user_handle_t  old_shell_listview;  /* handle to the shell listview window */
    user_handle_t  old_progman_window;  /* handle to the new program manager window */
    user_handle_t  old_taskman_window;  /* handle to the new task manager window */
@END
#define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
#define SET_GLOBAL_PROGMAN_WINDOW  0x02
#define SET_GLOBAL_TASKMAN_WINDOW  0x04

/* Adjust the privileges held by a token */
@REQ(adjust_token_privileges)
    obj_handle_t  handle; /* handle to the token */
    int           disable_all; /* disable all privileges? */
    int           get_modified_state; /* get modified privileges? */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
@REPLY
    unsigned int  len; /* total length in bytes required to store token privileges */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
@END

/* Retrieves the set of privileges held by or available to a token */
@REQ(get_token_privileges)
    obj_handle_t  handle; /* handle to the token */
@REPLY
    unsigned int  len; /* total length in bytes required to store token privileges */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
@END

/* Check the token has the required privileges */
@REQ(check_token_privileges)
    obj_handle_t  handle; /* handle to the token */
    int           all_required; /* are all the privileges required for the check to succeed? */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
@REPLY
    int           has_privileges; /* does the token have the required privileges? */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
@END

@REQ(duplicate_token)
    obj_handle_t  handle;        /* handle to the token to duplicate */
    unsigned int  access;        /* access rights to the new token */
    unsigned int  attributes;    /* object attributes */
    int           primary;       /* is the new token to be a primary one? */
    int           impersonation_level; /* impersonation level of the new token */
@REPLY
    obj_handle_t  new_handle; /* duplicated handle */
@END

@REQ(access_check)
    obj_handle_t    handle; /* handle to the token */
    unsigned int    desired_access; /* desired access to the object */
    unsigned int    mapping_read; /* mapping from generic read to specific rights */
    unsigned int    mapping_write; /* mapping from generic write to specific rights */
    unsigned int    mapping_execute; /* mapping from generic execute to specific rights */
    unsigned int    mapping_all; /* mapping from generic all to specific rights */
    VARARG(sd,security_descriptor); /* security descriptor to check */
@REPLY
    unsigned int    access_granted; /* access rights actually granted */
    unsigned int    access_status; /* was access granted? */
    unsigned int    privileges_len; /* length needed to store privileges */
    VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
@END

@REQ(get_token_user)
    obj_handle_t    handle;       /* handle to the token */
@REPLY
    data_size_t     user_len;     /* length needed to store user */
    VARARG(user,SID);             /* sid of the user the token represents */
@END

@REQ(get_token_groups)
    obj_handle_t    handle;       /* handle to the token */
@REPLY
    data_size_t     user_len;     /* length needed to store user */
    VARARG(user,token_groups); /* groups the token's user belongs to */
@END

/* Create a mailslot */
@REQ(create_mailslot)
    unsigned int   access;        /* wanted access rights */
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    unsigned int   max_msgsize;
    int            read_timeout;
    VARARG(name,unicode_str);     /* mailslot name */
@REPLY
    obj_handle_t   handle;        /* handle to the mailslot */
@END


/* Open an existing mailslot */
@REQ(open_mailslot)
    unsigned int   access;
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    unsigned int   sharing;       /* sharing mode */
    VARARG(name,unicode_str);     /* mailslot name */
@REPLY
    obj_handle_t   handle;        /* handle to the mailslot */
@END


/* Set mailslot information */
@REQ(set_mailslot_info)
    obj_handle_t   handle;        /* handle to the mailslot */
    unsigned int   flags;
    int            read_timeout;
@REPLY
    unsigned int   max_msgsize;
    int            read_timeout;
@END
#define MAILSLOT_SET_READ_TIMEOUT  1


/* Create a directory object */
@REQ(create_directory)
    unsigned int   access;        /* access flags */
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    VARARG(directory_name,unicode_str); /* Directory name */
@REPLY
    obj_handle_t   handle;        /* handle to the directory */
@END


/* Open a directory object */
@REQ(open_directory)
    unsigned int   access;        /* access flags */
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    VARARG(directory_name,unicode_str); /* Directory name */
@REPLY
    obj_handle_t   handle;        /* handle to the directory */
@END


/* Create a symbolic link object */
@REQ(create_symlink)
    unsigned int   access;        /* access flags */
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    data_size_t    name_len;      /* length of the symlink name in bytes */
    VARARG(name,unicode_str,name_len); /* symlink name */
    VARARG(target_name,unicode_str);   /* target name */
@REPLY
    obj_handle_t   handle;        /* handle to the symlink */
@END


/* Open a symbolic link object */
@REQ(open_symlink)
    unsigned int   access;        /* access flags */
    unsigned int   attributes;    /* object attributes */
    obj_handle_t   rootdir;       /* root directory */
    VARARG(name,unicode_str);     /* symlink name */
@REPLY
    obj_handle_t   handle;        /* handle to the symlink */
@END


/* Query a symbolic link object */
@REQ(query_symlink)
    obj_handle_t   handle;        /* handle to the symlink */
@REPLY
    VARARG(target_name,unicode_str); /* target name */
@END