shell32/tests: Some more type consistency fixes for the ShellExecute() return value...
[wine] / server / protocol.def
1 /* -*- C -*-
2  *
3  * Wine server protocol definition
4  *
5  * Copyright (C) 2001 Alexandre Julliard
6  *
7  * This file is used by tools/make_requests to build the
8  * protocol structures in include/wine/server_protocol.h
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24
25 @HEADER  /* start of C declarations */
26
27 #include <stdarg.h>
28 #include <stdlib.h>
29 #include <time.h>
30
31 #include <windef.h>
32 #include <winbase.h>
33
34 typedef unsigned int obj_handle_t;
35 typedef unsigned int user_handle_t;
36 typedef unsigned int atom_t;
37 typedef unsigned int process_id_t;
38 typedef unsigned int thread_id_t;
39 typedef unsigned int data_size_t;
40 typedef unsigned int ioctl_code_t;
41 typedef unsigned __int64 lparam_t;
42 typedef unsigned __int64 apc_param_t;
43 typedef unsigned __int64 mem_size_t;
44 typedef unsigned __int64 file_pos_t;
45 typedef unsigned __int64 client_ptr_t;
46 typedef unsigned __int64 affinity_t;
47 typedef client_ptr_t mod_handle_t;
48
49 struct request_header
50 {
51     int          req;          /* request code */
52     data_size_t  request_size; /* request variable part size */
53     data_size_t  reply_size;   /* reply variable part maximum size */
54 };
55
56 struct reply_header
57 {
58     unsigned int error;        /* error result */
59     data_size_t  reply_size;   /* reply variable part size */
60 };
61
62 /* placeholder structure for the maximum allowed request size */
63 /* this is used to construct the generic_request union */
64 struct request_max_size
65 {
66     int pad[16]; /* the max request size is 16 ints */
67 };
68
69 #define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
70 #define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */
71
72
73 /* debug event data */
74 typedef union
75 {
76     int code;   /* event code */
77     struct
78     {
79         int              code;       /* EXCEPTION_DEBUG_EVENT */
80         int              first;      /* first chance exception? */
81         unsigned int     exc_code;   /* exception code */
82         unsigned int     flags;      /* exception flags */
83         client_ptr_t     record;     /* exception record */
84         client_ptr_t     address;    /* exception address */
85         int              nb_params;  /* number of parameters */
86         int              __pad;
87         client_ptr_t     params[15]; /* parameters */
88     } exception;
89     struct
90     {
91         int          code;       /* CREATE_THREAD_DEBUG_EVENT */
92         obj_handle_t handle;     /* handle to the new thread */
93         client_ptr_t teb;        /* thread teb (in debugged process address space) */
94         client_ptr_t start;      /* thread startup routine */
95     } create_thread;
96     struct
97     {
98         int          code;       /* CREATE_PROCESS_DEBUG_EVENT */
99         obj_handle_t file;       /* handle to the process exe file */
100         obj_handle_t process;    /* handle to the new process */
101         obj_handle_t thread;     /* handle to the new thread */
102         mod_handle_t base;       /* base of executable image */
103         int          dbg_offset; /* offset of debug info in file */
104         int          dbg_size;   /* size of debug info */
105         client_ptr_t teb;        /* thread teb (in debugged process address space) */
106         client_ptr_t start;      /* thread startup routine */
107         client_ptr_t name;       /* image name (optional) */
108         int          unicode;    /* is it Unicode? */
109     } create_process;
110     struct
111     {
112         int          code;       /* EXIT_THREAD_DEBUG_EVENT/EXIT_PROCESS_DEBUG_EVENT */
113         int          exit_code;  /* thread or process exit code */
114     } exit;
115     struct
116     {
117         int          code;       /* LOAD_DLL_DEBUG_EVENT */
118         obj_handle_t handle;     /* file handle for the dll */
119         mod_handle_t base;       /* base address of the dll */
120         int          dbg_offset; /* offset of debug info in file */
121         int          dbg_size;   /* size of debug info */
122         client_ptr_t name;       /* image name (optional) */
123         int          unicode;    /* is it Unicode? */
124     } load_dll;
125     struct
126     {
127         int          code;       /* UNLOAD_DLL_DEBUG_EVENT */
128         int          __pad;
129         mod_handle_t base;       /* base address of the dll */
130     } unload_dll;
131     struct
132     {
133         int          code;       /* OUTPUT_DEBUG_STRING_EVENT */
134         data_size_t  length;     /* string length */
135         client_ptr_t string;     /* string to display (in debugged process address space) */
136     } output_string;
137     struct
138     {
139         int          code;       /* RIP_EVENT */
140         int          error;      /* ??? */
141         int          type;       /* ??? */
142     } rip_info;
143 } debug_event_t;
144
145 /* supported CPU types */
146 enum cpu_type
147 {
148     CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_SPARC
149 };
150 typedef int cpu_type_t;
151
152 /* context data */
153 typedef struct
154 {
155     cpu_type_t       cpu;        /* cpu type */
156     unsigned int     flags;      /* SERVER_CTX_* flags */
157     union
158     {
159         struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
160         struct { unsigned __int64 rip, rbp, rsp;
161                  unsigned int cs, ss, flags, __pad; } x86_64_regs;
162         struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc_regs;
163         struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
164         struct { unsigned int psr, pc, npc, y, wim, tbr; } sparc_regs;
165     } ctl;  /* selected by SERVER_CTX_CONTROL */
166     union
167     {
168         struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
169         struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
170                                   r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
171         struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
172         struct { unsigned int r[13]; } arm_regs;
173         struct { unsigned int g[8], o[8], l[8], i[8]; } sparc_regs;
174     } integer;  /* selected by SERVER_CTX_INTEGER */
175     union
176     {
177         struct { unsigned int ds, es, fs, gs; } i386_regs;
178         struct { unsigned int ds, es, fs, gs; } x86_64_regs;
179     } seg;  /* selected by SERVER_CTX_SEGMENTS */
180     union
181     {
182         struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
183                  unsigned char regs[80]; } i386_regs;
184         struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
185         struct { double fpr[32], fpscr; } powerpc_regs;
186     } fp;  /* selected by SERVER_CTX_FLOATING_POINT */
187     union
188     {
189         struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
190         struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
191         struct { unsigned int dr[8]; } powerpc_regs;
192     } debug;  /* selected by SERVER_CTX_DEBUG_REGISTERS */
193     union
194     {
195         unsigned char i386_regs[512];
196     } ext;                       /* selected by SERVER_CTX_EXTENDED_REGISTERS */
197 } context_t;
198
199 #define SERVER_CTX_CONTROL            0x01
200 #define SERVER_CTX_INTEGER            0x02
201 #define SERVER_CTX_SEGMENTS           0x04
202 #define SERVER_CTX_FLOATING_POINT     0x08
203 #define SERVER_CTX_DEBUG_REGISTERS    0x10
204 #define SERVER_CTX_EXTENDED_REGISTERS 0x20
205
206 /* structure used in sending an fd from client to server */
207 struct send_fd
208 {
209     thread_id_t tid;  /* thread id */
210     int         fd;   /* file descriptor on client-side */
211 };
212
213 /* structure sent by the server on the wait fifo */
214 struct wake_up_reply
215 {
216     client_ptr_t cookie;    /* magic cookie that was passed in select_request */
217     int          signaled;  /* wait result */
218     int          __pad;
219 };
220
221 /* NT-style timeout, in 100ns units, negative means relative timeout */
222 typedef __int64 timeout_t;
223 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
224
225 /* structure for process startup info */
226 typedef struct
227 {
228     unsigned int debug_flags;
229     unsigned int console_flags;
230     obj_handle_t console;
231     obj_handle_t hstdin;
232     obj_handle_t hstdout;
233     obj_handle_t hstderr;
234     unsigned int x;
235     unsigned int y;
236     unsigned int xsize;
237     unsigned int ysize;
238     unsigned int xchars;
239     unsigned int ychars;
240     unsigned int attribute;
241     unsigned int flags;
242     unsigned int show;
243     data_size_t  curdir_len;
244     data_size_t  dllpath_len;
245     data_size_t  imagepath_len;
246     data_size_t  cmdline_len;
247     data_size_t  title_len;
248     data_size_t  desktop_len;
249     data_size_t  shellinfo_len;
250     data_size_t  runtime_len;
251     /* VARARG(curdir,unicode_str,curdir_len); */
252     /* VARARG(dllpath,unicode_str,dllpath_len); */
253     /* VARARG(imagepath,unicode_str,imagepath_len); */
254     /* VARARG(cmdline,unicode_str,cmdline_len); */
255     /* VARARG(title,unicode_str,title_len); */
256     /* VARARG(desktop,unicode_str,desktop_len); */
257     /* VARARG(shellinfo,unicode_str,shellinfo_len); */
258     /* VARARG(runtime,unicode_str,runtime_len); */
259 } startup_info_t;
260
261 /* structure returned in the list of window properties */
262 typedef struct
263 {
264     atom_t         atom;     /* property atom */
265     int            string;   /* was atom a string originally? */
266     lparam_t       data;     /* data stored in property */
267 } property_data_t;
268
269 /* structure to specify window rectangles */
270 typedef struct
271 {
272     int  left;
273     int  top;
274     int  right;
275     int  bottom;
276 } rectangle_t;
277
278 /* structure for parameters of async I/O calls */
279 typedef struct
280 {
281     obj_handle_t    handle;        /* object to perform I/O on */
282     obj_handle_t    event;         /* event to signal when done */
283     client_ptr_t    callback;      /* client-side callback to call upon end of async */
284     client_ptr_t    iosb;          /* I/O status block in client addr space */
285     client_ptr_t    arg;           /* opaque user data to pass to callback */
286     apc_param_t     cvalue;        /* completion value to use for completion events */
287 } async_data_t;
288
289 /* structures for extra message data */
290
291 struct hardware_msg_data
292 {
293     lparam_t        info;      /* extra info */
294     int             x;         /* x position */
295     int             y;         /* y position */
296     unsigned int    hw_id;     /* unique id */
297     unsigned int    flags;     /* hook flags */
298     union
299     {
300         int type;
301         struct
302         {
303             int            type;    /* RIM_TYPEKEYBOARD */
304             unsigned int   message; /* message generated by this rawinput event */
305             unsigned short vkey;    /* virtual key code */
306             unsigned short scan;    /* scan code */
307         } kbd;
308         struct
309         {
310             int            type;    /* RIM_TYPEMOUSE */
311             int            x;       /* x coordinate */
312             int            y;       /* y coordinate */
313             unsigned int   data;    /* mouse data */
314         } mouse;
315     } rawinput;
316 };
317
318 struct callback_msg_data
319 {
320     client_ptr_t    callback;   /* callback function */
321     lparam_t        data;       /* user data for callback */
322     lparam_t        result;     /* message result */
323 };
324
325 struct winevent_msg_data
326 {
327     user_handle_t   hook;       /* hook handle */
328     thread_id_t     tid;        /* thread id */
329     client_ptr_t    hook_proc;  /* hook proc address */
330     /* followed by module name if any */
331 };
332
333 typedef union
334 {
335     int type;
336     struct
337     {
338         int            type;    /* INPUT_KEYBOARD */
339         unsigned short vkey;    /* virtual key code */
340         unsigned short scan;    /* scan code */
341         unsigned int   flags;   /* event flags */
342         unsigned int   time;    /* event time */
343         lparam_t       info;    /* extra info */
344     } kbd;
345     struct
346     {
347         int            type;    /* INPUT_MOUSE */
348         int            x;       /* coordinates */
349         int            y;
350         unsigned int   data;    /* mouse data */
351         unsigned int   flags;   /* event flags */
352         unsigned int   time;    /* event time */
353         lparam_t       info;    /* extra info */
354     } mouse;
355     struct
356     {
357         int            type;    /* INPUT_HARDWARE */
358         unsigned int   msg;     /* message code */
359         lparam_t       lparam;  /* message param */
360     } hw;
361 } hw_input_t;
362
363 typedef union
364 {
365     unsigned char            bytes[1];   /* raw data for sent messages */
366     struct hardware_msg_data hardware;
367     struct callback_msg_data callback;
368     struct winevent_msg_data winevent;
369 } message_data_t;
370
371 /* structure for console char/attribute info */
372 typedef struct
373 {
374     WCHAR          ch;
375     unsigned short attr;
376 } char_info_t;
377
378 /* structure returned in filesystem events */
379 struct filesystem_event
380 {
381     int         action;
382     data_size_t len;
383     char        name[1];
384 };
385
386 typedef struct
387 {
388     unsigned int low_part;
389     int          high_part;
390 } luid_t;
391
392 #define MAX_ACL_LEN 65535
393
394 struct security_descriptor
395 {
396     unsigned int control;       /* SE_ flags */
397     data_size_t  owner_len;
398     data_size_t  group_len;
399     data_size_t  sacl_len;
400     data_size_t  dacl_len;
401     /* VARARG(owner,SID); */
402     /* VARARG(group,SID); */
403     /* VARARG(sacl,ACL); */
404     /* VARARG(dacl,ACL); */
405 };
406
407 struct object_attributes
408 {
409     obj_handle_t rootdir; /* root directory */
410     data_size_t sd_len;   /* length of security_descriptor data. may be 0 */
411     data_size_t name_len; /* length of the name string. may be 0 */
412     /* VARARG(sd,security_descriptor); */
413     /* VARARG(name,unicode_str); */
414 };
415
416 struct token_groups
417 {
418     unsigned int count;
419     /* unsigned int attributes[count]; */
420     /* VARARG(sids,SID); */
421 };
422
423 enum apc_type
424 {
425     APC_NONE,
426     APC_USER,
427     APC_TIMER,
428     APC_ASYNC_IO,
429     APC_VIRTUAL_ALLOC,
430     APC_VIRTUAL_FREE,
431     APC_VIRTUAL_QUERY,
432     APC_VIRTUAL_PROTECT,
433     APC_VIRTUAL_FLUSH,
434     APC_VIRTUAL_LOCK,
435     APC_VIRTUAL_UNLOCK,
436     APC_MAP_VIEW,
437     APC_UNMAP_VIEW,
438     APC_CREATE_THREAD
439 };
440
441 typedef union
442 {
443     enum apc_type type;
444     struct
445     {
446         enum apc_type    type;     /* APC_USER */
447         int              __pad;
448         client_ptr_t     func;     /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
449         apc_param_t      args[3];  /* arguments for user function */
450     } user;
451     struct
452     {
453         enum apc_type    type;     /* APC_TIMER */
454         int              __pad;
455         client_ptr_t     func;     /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
456         timeout_t        time;     /* absolute time of expiration */
457         client_ptr_t     arg;      /* user argument */
458     } timer;
459     struct
460     {
461         enum apc_type    type;     /* APC_ASYNC_IO */
462         unsigned int     status;   /* I/O status */
463         client_ptr_t     func;     /* unsigned int (*func)(void*, void*, unsigned int, void **); */
464         client_ptr_t     user;     /* user pointer */
465         client_ptr_t     sb;       /* status block */
466     } async_io;
467     struct
468     {
469         enum apc_type    type;      /* APC_VIRTUAL_ALLOC */
470         unsigned int     op_type;   /* type of operation */
471         client_ptr_t     addr;      /* requested address */
472         mem_size_t       size;      /* allocation size */
473         unsigned int     zero_bits; /* allocation alignment */
474         unsigned int     prot;      /* memory protection flags */
475     } virtual_alloc;
476     struct
477     {
478         enum apc_type    type;      /* APC_VIRTUAL_FREE */
479         unsigned int     op_type;   /* type of operation */
480         client_ptr_t     addr;      /* requested address */
481         mem_size_t       size;      /* allocation size */
482     } virtual_free;
483     struct
484     {
485         enum apc_type    type;      /* APC_VIRTUAL_QUERY */
486         int              __pad;
487         client_ptr_t     addr;      /* requested address */
488     } virtual_query;
489     struct
490     {
491         enum apc_type    type;      /* APC_VIRTUAL_PROTECT */
492         unsigned int     prot;      /* new protection flags */
493         client_ptr_t     addr;      /* requested address */
494         mem_size_t       size;      /* requested size */
495     } virtual_protect;
496     struct
497     {
498         enum apc_type    type;      /* APC_VIRTUAL_FLUSH */
499         int              __pad;
500         client_ptr_t     addr;      /* requested address */
501         mem_size_t       size;      /* requested size */
502     } virtual_flush;
503     struct
504     {
505         enum apc_type    type;      /* APC_VIRTUAL_LOCK */
506         int              __pad;
507         client_ptr_t     addr;      /* requested address */
508         mem_size_t       size;      /* requested size */
509     } virtual_lock;
510     struct
511     {
512         enum apc_type    type;      /* APC_VIRTUAL_UNLOCK */
513         int              __pad;
514         client_ptr_t     addr;      /* requested address */
515         mem_size_t       size;      /* requested size */
516     } virtual_unlock;
517     struct
518     {
519         enum apc_type    type;      /* APC_MAP_VIEW */
520         obj_handle_t     handle;    /* mapping handle */
521         client_ptr_t     addr;      /* requested address */
522         mem_size_t       size;      /* allocation size */
523         file_pos_t       offset;    /* file offset */
524         unsigned int     alloc_type;/* allocation type */
525         unsigned short   zero_bits; /* allocation alignment */
526         unsigned short   prot;      /* memory protection flags */
527     } map_view;
528     struct
529     {
530         enum apc_type    type;      /* APC_UNMAP_VIEW */
531         int              __pad;
532         client_ptr_t     addr;      /* view address */
533     } unmap_view;
534     struct
535     {
536         enum apc_type    type;      /* APC_CREATE_THREAD */
537         int              suspend;   /* suspended thread? */
538         client_ptr_t     func;      /* void (__stdcall *func)(void*);  start function */
539         client_ptr_t     arg;       /* argument for start function */
540         mem_size_t       reserve;   /* reserve size for thread stack */
541         mem_size_t       commit;    /* commit size for thread stack */
542     } create_thread;
543 } apc_call_t;
544
545 typedef union
546 {
547     enum apc_type type;
548     struct
549     {
550         enum apc_type    type;      /* APC_ASYNC_IO */
551         unsigned int     status;    /* new status of async operation */
552         client_ptr_t     apc;       /* user APC to call */
553         unsigned int     total;     /* bytes transferred */
554     } async_io;
555     struct
556     {
557         enum apc_type    type;      /* APC_VIRTUAL_ALLOC */
558         unsigned int     status;    /* status returned by call */
559         client_ptr_t     addr;      /* resulting address */
560         mem_size_t       size;      /* resulting size */
561     } virtual_alloc;
562     struct
563     {
564         enum apc_type    type;      /* APC_VIRTUAL_FREE */
565         unsigned int     status;    /* status returned by call */
566         client_ptr_t     addr;      /* resulting address */
567         mem_size_t       size;      /* resulting size */
568     } virtual_free;
569     struct
570     {
571         enum apc_type    type;      /* APC_VIRTUAL_QUERY */
572         unsigned int     status;    /* status returned by call */
573         client_ptr_t     base;      /* resulting base address */
574         client_ptr_t     alloc_base;/* resulting allocation base */
575         mem_size_t       size;      /* resulting region size */
576         unsigned short   state;     /* resulting region state */
577         unsigned short   prot;      /* resulting region protection */
578         unsigned short   alloc_prot;/* resulting allocation protection */
579         unsigned short   alloc_type;/* resulting region allocation type */
580     } virtual_query;
581     struct
582     {
583         enum apc_type    type;      /* APC_VIRTUAL_PROTECT */
584         unsigned int     status;    /* status returned by call */
585         client_ptr_t     addr;      /* resulting address */
586         mem_size_t       size;      /* resulting size */
587         unsigned int     prot;      /* old protection flags */
588     } virtual_protect;
589     struct
590     {
591         enum apc_type    type;      /* APC_VIRTUAL_FLUSH */
592         unsigned int     status;    /* status returned by call */
593         client_ptr_t     addr;      /* resulting address */
594         mem_size_t       size;      /* resulting size */
595     } virtual_flush;
596     struct
597     {
598         enum apc_type    type;      /* APC_VIRTUAL_LOCK */
599         unsigned int     status;    /* status returned by call */
600         client_ptr_t     addr;      /* resulting address */
601         mem_size_t       size;      /* resulting size */
602     } virtual_lock;
603     struct
604     {
605         enum apc_type    type;      /* APC_VIRTUAL_UNLOCK */
606         unsigned int     status;    /* status returned by call */
607         client_ptr_t     addr;      /* resulting address */
608         mem_size_t       size;      /* resulting size */
609     } virtual_unlock;
610     struct
611     {
612         enum apc_type    type;      /* APC_MAP_VIEW */
613         unsigned int     status;    /* status returned by call */
614         client_ptr_t     addr;      /* resulting address */
615         mem_size_t       size;      /* resulting size */
616     } map_view;
617     struct
618     {
619         enum apc_type    type;      /* APC_MAP_VIEW */
620         unsigned int     status;    /* status returned by call */
621     } unmap_view;
622     struct
623     {
624         enum apc_type    type;      /* APC_CREATE_THREAD */
625         unsigned int     status;    /* status returned by call */
626         thread_id_t      tid;       /* thread id */
627         obj_handle_t     handle;    /* handle to new thread */
628     } create_thread;
629 } apc_result_t;
630
631 struct rawinput_device
632 {
633     unsigned short usage_page;
634     unsigned short usage;
635     unsigned int   flags;
636     user_handle_t  target;
637 };
638
639 /****************************************************************/
640 /* Request declarations */
641
642 /* Create a new process from the context of the parent */
643 @REQ(new_process)
644     int          inherit_all;    /* inherit all handles from parent */
645     unsigned int create_flags;   /* creation flags */
646     int          socket_fd;      /* file descriptor for process socket */
647     obj_handle_t exe_file;       /* file handle for main exe */
648     unsigned int process_access; /* access rights for process object */
649     unsigned int process_attr;   /* attributes for process object */
650     unsigned int thread_access;  /* access rights for thread object */
651     unsigned int thread_attr;    /* attributes for thread object */
652     data_size_t  info_size;      /* size of startup info */
653     VARARG(info,startup_info,info_size); /* startup information */
654     VARARG(env,unicode_str);     /* environment for new process */
655 @REPLY
656     obj_handle_t info;           /* new process info handle */
657     process_id_t pid;            /* process id */
658     obj_handle_t phandle;        /* process handle (in the current process) */
659     thread_id_t  tid;            /* thread id */
660     obj_handle_t thandle;        /* thread handle (in the current process) */
661 @END
662
663
664 /* Retrieve information about a newly started process */
665 @REQ(get_new_process_info)
666     obj_handle_t info;           /* info handle returned from new_process_request */
667 @REPLY
668     int          success;      /* did the process start successfully? */
669     int          exit_code;    /* process exit code if failed */
670 @END
671
672
673 /* Create a new thread from the context of the parent */
674 @REQ(new_thread)
675     unsigned int access;       /* wanted access rights */
676     unsigned int attributes;   /* object attributes */
677     int          suspend;      /* new thread should be suspended on creation */
678     int          request_fd;   /* fd for request pipe */
679 @REPLY
680     thread_id_t  tid;          /* thread id */
681     obj_handle_t handle;       /* thread handle (in the current process) */
682 @END
683
684
685 /* Retrieve the new process startup info */
686 @REQ(get_startup_info)
687 @REPLY
688     obj_handle_t exe_file;     /* file handle for main exe */
689     data_size_t  info_size;    /* size of startup info */
690     VARARG(info,startup_info,info_size); /* startup information */
691     VARARG(env,unicode_str);   /* environment */
692 @END
693
694
695 /* Signal the end of the process initialization */
696 @REQ(init_process_done)
697     int          gui;          /* is it a GUI process? */
698     mod_handle_t module;       /* main module base address */
699     client_ptr_t ldt_copy;     /* address of LDT copy (in thread address space) */
700     client_ptr_t entry;        /* process entry point */
701 @END
702
703
704 /* Initialize a thread; called from the child after fork()/clone() */
705 @REQ(init_thread)
706     int          unix_pid;     /* Unix pid of new thread */
707     int          unix_tid;     /* Unix tid of new thread */
708     int          debug_level;  /* new debug level */
709     client_ptr_t teb;          /* TEB of new thread (in thread address space) */
710     client_ptr_t entry;        /* entry point or PEB if initial thread (in thread address space) */
711     int          reply_fd;     /* fd for reply pipe */
712     int          wait_fd;      /* fd for blocking calls pipe */
713     cpu_type_t   cpu;          /* CPU that this thread is running on */
714 @REPLY
715     process_id_t pid;          /* process id of the new thread's process */
716     thread_id_t  tid;          /* thread id of the new thread */
717     timeout_t    server_start; /* server start time */
718     data_size_t  info_size;    /* total size of startup info */
719     int          version;      /* protocol version */
720     unsigned int all_cpus;     /* bitset of supported CPUs */
721 @END
722
723
724 /* Terminate a process */
725 @REQ(terminate_process)
726     obj_handle_t handle;       /* process handle to terminate */
727     int          exit_code;    /* process exit code */
728 @REPLY
729     int          self;         /* suicide? */
730 @END
731
732
733 /* Terminate a thread */
734 @REQ(terminate_thread)
735     obj_handle_t handle;       /* thread handle to terminate */
736     int          exit_code;    /* thread exit code */
737 @REPLY
738     int          self;         /* suicide? */
739     int          last;         /* last thread in this process? */
740 @END
741
742
743 /* Retrieve information about a process */
744 @REQ(get_process_info)
745     obj_handle_t handle;           /* process handle */
746 @REPLY
747     process_id_t pid;              /* server process id */
748     process_id_t ppid;             /* server process id of parent */
749     affinity_t   affinity;         /* process affinity mask */
750     client_ptr_t peb;              /* PEB address in process address space */
751     timeout_t    start_time;       /* process start time */
752     timeout_t    end_time;         /* process end time */
753     int          exit_code;        /* process exit code */
754     int          priority;         /* priority class */
755     cpu_type_t   cpu;              /* CPU that this process is running on */
756     int          debugger_present; /* process is being debugged */
757 @END
758
759
760 /* Set a process information */
761 @REQ(set_process_info)
762     obj_handle_t handle;       /* process handle */
763     int          mask;         /* setting mask (see below) */
764     int          priority;     /* priority class */
765     affinity_t   affinity;     /* affinity mask */
766 @END
767 #define SET_PROCESS_INFO_PRIORITY 0x01
768 #define SET_PROCESS_INFO_AFFINITY 0x02
769
770
771 /* Retrieve information about a thread */
772 @REQ(get_thread_info)
773     obj_handle_t handle;        /* thread handle */
774     thread_id_t  tid_in;        /* thread id (optional) */
775 @REPLY
776     process_id_t pid;           /* server process id */
777     thread_id_t  tid;           /* server thread id */
778     client_ptr_t teb;           /* thread teb pointer */
779     affinity_t   affinity;      /* thread affinity mask */
780     timeout_t    creation_time; /* thread creation time */
781     timeout_t    exit_time;     /* thread exit time */
782     int          exit_code;     /* thread exit code */
783     int          priority;      /* thread priority level */
784     int          last;          /* last thread in process */
785 @END
786
787
788 /* Set a thread information */
789 @REQ(set_thread_info)
790     obj_handle_t handle;       /* thread handle */
791     int          mask;         /* setting mask (see below) */
792     int          priority;     /* priority class */
793     affinity_t   affinity;     /* affinity mask */
794     obj_handle_t token;        /* impersonation token */
795 @END
796 #define SET_THREAD_INFO_PRIORITY 0x01
797 #define SET_THREAD_INFO_AFFINITY 0x02
798 #define SET_THREAD_INFO_TOKEN    0x04
799
800
801 /* Retrieve information about a module */
802 @REQ(get_dll_info)
803     obj_handle_t handle;       /* process handle */
804     mod_handle_t base_address; /* base address of module */
805 @REPLY
806     client_ptr_t entry_point;
807     data_size_t  size;            /* module size */
808     data_size_t  filename_len;    /* buffer len in bytes required to store filename */
809     VARARG(filename,unicode_str); /* file name of module */
810 @END
811
812
813 /* Suspend a thread */
814 @REQ(suspend_thread)
815     obj_handle_t handle;       /* thread handle */
816 @REPLY
817     int          count;        /* new suspend count */
818 @END
819
820
821 /* Resume a thread */
822 @REQ(resume_thread)
823     obj_handle_t handle;       /* thread handle */
824 @REPLY
825     int          count;        /* new suspend count */
826 @END
827
828
829 /* Notify the server that a dll has been loaded */
830 @REQ(load_dll)
831     obj_handle_t mapping;      /* file mapping handle */
832     mod_handle_t base;         /* base address */
833     client_ptr_t name;         /* ptr to ptr to name (in process addr space) */
834     data_size_t  size;         /* dll size */
835     int          dbg_offset;   /* debug info offset */
836     int          dbg_size;     /* debug info size */
837     VARARG(filename,unicode_str); /* file name of dll */
838 @END
839
840
841 /* Notify the server that a dll is being unloaded */
842 @REQ(unload_dll)
843     mod_handle_t base;         /* base address */
844 @END
845
846
847 /* Queue an APC for a thread or process */
848 @REQ(queue_apc)
849     obj_handle_t handle;       /* thread or process handle */
850     apc_call_t   call;         /* call arguments */
851 @REPLY
852     obj_handle_t handle;       /* APC handle */
853     int          self;         /* run APC in caller itself? */
854 @END
855
856
857 /* Get the result of an APC call */
858 @REQ(get_apc_result)
859     obj_handle_t handle;       /* handle to the APC */
860 @REPLY
861     apc_result_t result;       /* result of the APC */
862 @END
863
864
865 /* Close a handle for the current process */
866 @REQ(close_handle)
867     obj_handle_t handle;       /* handle to close */
868 @END
869
870
871 /* Set a handle information */
872 @REQ(set_handle_info)
873     obj_handle_t handle;       /* handle we are interested in */
874     int          flags;        /* new handle flags */
875     int          mask;         /* mask for flags to set */
876 @REPLY
877     int          old_flags;    /* old flag value */
878 @END
879
880
881 /* Duplicate a handle */
882 @REQ(dup_handle)
883     obj_handle_t src_process;  /* src process handle */
884     obj_handle_t src_handle;   /* src handle to duplicate */
885     obj_handle_t dst_process;  /* dst process handle */
886     unsigned int access;       /* wanted access rights */
887     unsigned int attributes;   /* object attributes */
888     unsigned int options;      /* duplicate options (see below) */
889 @REPLY
890     obj_handle_t handle;       /* duplicated handle in dst process */
891     int          self;         /* is the source the current process? */
892     int          closed;       /* whether the source handle has been closed */
893 @END
894 #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
895 #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
896 #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */
897
898
899 /* Open a handle to a process */
900 @REQ(open_process)
901     process_id_t pid;          /* process id to open */
902     unsigned int access;       /* wanted access rights */
903     unsigned int attributes;   /* object attributes */
904 @REPLY
905     obj_handle_t handle;       /* handle to the process */
906 @END
907
908
909 /* Open a handle to a thread */
910 @REQ(open_thread)
911     thread_id_t  tid;          /* thread id to open */
912     unsigned int access;       /* wanted access rights */
913     unsigned int attributes;   /* object attributes */
914 @REPLY
915     obj_handle_t handle;       /* handle to the thread */
916 @END
917
918
919 /* Wait for handles */
920 @REQ(select)
921     int          flags;        /* wait flags (see below) */
922     client_ptr_t cookie;       /* magic cookie to return to client */
923     obj_handle_t signal;       /* object to signal (0 if none) */
924     obj_handle_t prev_apc;     /* handle to previous APC */
925     timeout_t    timeout;      /* timeout */
926     VARARG(result,apc_result); /* result of previous APC */
927     VARARG(handles,handles);   /* handles to select on */
928 @REPLY
929     timeout_t    timeout;      /* timeout converted to absolute */
930     apc_call_t   call;         /* APC call arguments */
931     obj_handle_t apc_handle;   /* handle to next APC */
932 @END
933 #define SELECT_ALL           1
934 #define SELECT_ALERTABLE     2
935 #define SELECT_INTERRUPTIBLE 4
936
937
938 /* Create an event */
939 @REQ(create_event)
940     unsigned int access;        /* wanted access rights */
941     unsigned int attributes;    /* object attributes */
942     int          manual_reset;  /* manual reset event */
943     int          initial_state; /* initial state of the event */
944     VARARG(objattr,object_attributes); /* object attributes */
945 @REPLY
946     obj_handle_t handle;        /* handle to the event */
947 @END
948
949 /* Event operation */
950 @REQ(event_op)
951     obj_handle_t  handle;       /* handle to event */
952     int           op;           /* event operation (see below) */
953 @END
954 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
955
956
957 /* Open an event */
958 @REQ(open_event)
959     unsigned int access;        /* wanted access rights */
960     unsigned int attributes;    /* object attributes */
961     obj_handle_t rootdir;       /* root directory */
962     VARARG(name,unicode_str);   /* object name */
963 @REPLY
964     obj_handle_t handle;        /* handle to the event */
965 @END
966
967
968 /* Create a mutex */
969 @REQ(create_mutex)
970     unsigned int access;        /* wanted access rights */
971     unsigned int attributes;    /* object attributes */
972     int          owned;         /* initially owned? */
973     VARARG(objattr,object_attributes); /* object attributes */
974 @REPLY
975     obj_handle_t handle;        /* handle to the mutex */
976 @END
977
978
979 /* Release a mutex */
980 @REQ(release_mutex)
981     obj_handle_t handle;        /* handle to the mutex */
982 @REPLY
983     unsigned int prev_count;    /* value of internal counter, before release */
984 @END
985
986
987 /* Open a mutex */
988 @REQ(open_mutex)
989     unsigned int access;        /* wanted access rights */
990     unsigned int attributes;    /* object attributes */
991     obj_handle_t rootdir;       /* root directory */
992     VARARG(name,unicode_str);   /* object name */
993 @REPLY
994     obj_handle_t handle;        /* handle to the mutex */
995 @END
996
997
998 /* Create a semaphore */
999 @REQ(create_semaphore)
1000     unsigned int access;        /* wanted access rights */
1001     unsigned int attributes;    /* object attributes */
1002     unsigned int initial;       /* initial count */
1003     unsigned int max;           /* maximum count */
1004     VARARG(objattr,object_attributes); /* object attributes */
1005 @REPLY
1006     obj_handle_t handle;        /* handle to the semaphore */
1007 @END
1008
1009
1010 /* Release a semaphore */
1011 @REQ(release_semaphore)
1012     obj_handle_t handle;        /* handle to the semaphore */
1013     unsigned int count;         /* count to add to semaphore */
1014 @REPLY
1015     unsigned int prev_count;    /* previous semaphore count */
1016 @END
1017
1018
1019 /* Open a semaphore */
1020 @REQ(open_semaphore)
1021     unsigned int access;        /* wanted access rights */
1022     unsigned int attributes;    /* object attributes */
1023     obj_handle_t rootdir;       /* root directory */
1024     VARARG(name,unicode_str);   /* object name */
1025 @REPLY
1026     obj_handle_t handle;        /* handle to the semaphore */
1027 @END
1028
1029
1030 /* Create a file */
1031 @REQ(create_file)
1032     unsigned int access;        /* wanted access rights */
1033     unsigned int attributes;    /* object attributes */
1034     unsigned int sharing;       /* sharing flags */
1035     int          create;        /* file create action */
1036     unsigned int options;       /* file options */
1037     unsigned int attrs;         /* file attributes for creation */
1038     VARARG(objattr,object_attributes); /* object attributes */
1039     VARARG(filename,string);    /* file name */
1040 @REPLY
1041     obj_handle_t handle;        /* handle to the file */
1042 @END
1043
1044
1045 /* Open a file object */
1046 @REQ(open_file_object)
1047     unsigned int access;        /* wanted access rights */
1048     unsigned int attributes;    /* open attributes */
1049     obj_handle_t rootdir;       /* root directory */
1050     unsigned int sharing;       /* sharing flags */
1051     unsigned int options;       /* file options */
1052     VARARG(filename,unicode_str); /* file name */
1053 @REPLY
1054     obj_handle_t handle;        /* handle to the file */
1055 @END
1056
1057
1058 /* Allocate a file handle for a Unix fd */
1059 @REQ(alloc_file_handle)
1060     unsigned int access;        /* wanted access rights */
1061     unsigned int attributes;    /* object attributes */
1062     int          fd;            /* file descriptor on the client side */
1063 @REPLY
1064     obj_handle_t handle;        /* handle to the file */
1065 @END
1066
1067
1068 /* Get the Unix name from a file handle */
1069 @REQ(get_handle_unix_name)
1070     obj_handle_t   handle;      /* file handle */
1071 @REPLY
1072     data_size_t    name_len;    /* unix name length */
1073     VARARG(name,string);        /* unix name */
1074 @END
1075
1076
1077 /* Get a Unix fd to access a file */
1078 @REQ(get_handle_fd)
1079     obj_handle_t handle;        /* handle to the file */
1080 @REPLY
1081     int          type;          /* file type (see below) */
1082     int          cacheable;     /* can fd be cached in the client? */
1083     unsigned int access;        /* file access rights */
1084     unsigned int options;       /* file open options */
1085 @END
1086 enum server_fd_type
1087 {
1088     FD_TYPE_INVALID,  /* invalid file (no associated fd) */
1089     FD_TYPE_FILE,     /* regular file */
1090     FD_TYPE_DIR,      /* directory */
1091     FD_TYPE_SOCKET,   /* socket */
1092     FD_TYPE_SERIAL,   /* serial port */
1093     FD_TYPE_PIPE,     /* named pipe */
1094     FD_TYPE_MAILSLOT, /* mailslot */
1095     FD_TYPE_CHAR,     /* unspecified char device */
1096     FD_TYPE_DEVICE,   /* Windows device file */
1097     FD_TYPE_NB_TYPES
1098 };
1099
1100
1101 /* Flush a file buffers */
1102 @REQ(flush_file)
1103     obj_handle_t handle;        /* handle to the file */
1104 @REPLY
1105     obj_handle_t event;         /* event set when finished */
1106 @END
1107
1108
1109 /* Lock a region of a file */
1110 @REQ(lock_file)
1111     obj_handle_t handle;        /* handle to the file */
1112     file_pos_t   offset;        /* offset of start of lock */
1113     file_pos_t   count;         /* count of bytes to lock */
1114     int          shared;        /* shared or exclusive lock? */
1115     int          wait;          /* do we want to wait? */
1116 @REPLY
1117     obj_handle_t handle;        /* handle to wait on */
1118     int          overlapped;    /* is it an overlapped I/O handle? */
1119 @END
1120
1121
1122 /* Unlock a region of a file */
1123 @REQ(unlock_file)
1124     obj_handle_t handle;        /* handle to the file */
1125     file_pos_t   offset;        /* offset of start of unlock */
1126     file_pos_t   count;         /* count of bytes to unlock */
1127 @END
1128
1129
1130 /* Create a socket */
1131 @REQ(create_socket)
1132     unsigned int access;        /* wanted access rights */
1133     unsigned int attributes;    /* object attributes */
1134     int          family;        /* family, see socket manpage */
1135     int          type;          /* type, see socket manpage */
1136     int          protocol;      /* protocol, see socket manpage */
1137     unsigned int flags;         /* socket flags */
1138 @REPLY
1139     obj_handle_t handle;        /* handle to the new socket */
1140 @END
1141
1142
1143 /* Accept a socket */
1144 @REQ(accept_socket)
1145     obj_handle_t lhandle;       /* handle to the listening socket */
1146     unsigned int access;        /* wanted access rights */
1147     unsigned int attributes;    /* object attributes */
1148 @REPLY
1149     obj_handle_t handle;        /* handle to the new socket */
1150 @END
1151
1152
1153 /* Accept into an initialized socket */
1154 @REQ(accept_into_socket)
1155     obj_handle_t lhandle;       /* handle to the listening socket */
1156     obj_handle_t ahandle;       /* handle to the accepting socket */
1157 @END
1158
1159
1160 /* Set socket event parameters */
1161 @REQ(set_socket_event)
1162     obj_handle_t  handle;        /* handle to the socket */
1163     unsigned int  mask;          /* event mask */
1164     obj_handle_t  event;         /* event object */
1165     user_handle_t window;        /* window to send the message to */
1166     unsigned int  msg;           /* message to send */
1167 @END
1168
1169
1170 /* Get socket event parameters */
1171 @REQ(get_socket_event)
1172     obj_handle_t handle;        /* handle to the socket */
1173     int          service;       /* clear pending? */
1174     obj_handle_t c_event;       /* event to clear */
1175 @REPLY
1176     unsigned int mask;          /* event mask */
1177     unsigned int pmask;         /* pending events */
1178     unsigned int state;         /* status bits */
1179     VARARG(errors,ints);        /* event errors */
1180 @END
1181
1182
1183 /* Re-enable pending socket events */
1184 @REQ(enable_socket_event)
1185     obj_handle_t handle;        /* handle to the socket */
1186     unsigned int mask;          /* events to re-enable */
1187     unsigned int sstate;        /* status bits to set */
1188     unsigned int cstate;        /* status bits to clear */
1189 @END
1190
1191 @REQ(set_socket_deferred)
1192     obj_handle_t handle;        /* handle to the socket */
1193     obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
1194 @END
1195
1196 /* Allocate a console (only used by a console renderer) */
1197 @REQ(alloc_console)
1198     unsigned int access;        /* wanted access rights */
1199     unsigned int attributes;    /* object attributes */
1200     process_id_t pid;           /* pid of process which shall be attached to the console */
1201     int          input_fd;      /* if pid=-1 (bare console to current process), fd for input */
1202 @REPLY
1203     obj_handle_t handle_in;     /* handle to console input */
1204     obj_handle_t event;         /* handle to renderer events change notification */
1205 @END
1206
1207
1208 /* Free the console of the current process */
1209 @REQ(free_console)
1210 @END
1211
1212
1213 #define CONSOLE_RENDERER_NONE_EVENT        0x00
1214 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
1215 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
1216 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
1217 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
1218 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
1219 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1220 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
1221 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
1222 struct console_renderer_event
1223 {
1224     short event;
1225     union
1226     {
1227         struct update
1228         {
1229             short top;
1230             short bottom;
1231         } update;
1232         struct resize
1233         {
1234             short width;
1235             short height;
1236         } resize;
1237         struct cursor_pos
1238         {
1239             short x;
1240             short y;
1241         } cursor_pos;
1242         struct cursor_geom
1243         {
1244             short visible;
1245             short size;
1246         } cursor_geom;
1247         struct display
1248         {
1249             short left;
1250             short top;
1251             short width;
1252             short height;
1253         } display;
1254     } u;
1255 };
1256
1257 /* retrieve console events for the renderer */
1258 @REQ(get_console_renderer_events)
1259     obj_handle_t handle;        /* handle to console input events */
1260 @REPLY
1261     VARARG(data,bytes);         /* the various console_renderer_events */
1262 @END
1263
1264
1265 /* Open a handle to the process console */
1266 @REQ(open_console)
1267     obj_handle_t from;          /* 0 (resp 1) input (resp output) of current process console */
1268                                 /* otherwise console_in handle to get active screen buffer? */
1269     unsigned int access;        /* wanted access rights */
1270     unsigned int attributes;    /* object attributes */
1271     int          share;         /* share mask (only for output handles) */
1272 @REPLY
1273     obj_handle_t handle;        /* handle to the console */
1274 @END
1275
1276
1277 /* Get the input queue wait event */
1278 @REQ(get_console_wait_event)
1279 @REPLY
1280     obj_handle_t handle;
1281 @END
1282
1283 /* Get a console mode (input or output) */
1284 @REQ(get_console_mode)
1285     obj_handle_t handle;        /* handle to the console */
1286 @REPLY
1287     int          mode;          /* console mode */
1288 @END
1289
1290
1291 /* Set a console mode (input or output) */
1292 @REQ(set_console_mode)
1293     obj_handle_t handle;        /* handle to the console */
1294     int          mode;          /* console mode */
1295 @END
1296
1297
1298 /* Set info about a console (input only) */
1299 @REQ(set_console_input_info)
1300     obj_handle_t  handle;        /* handle to console input, or 0 for process' console */
1301     int           mask;          /* setting mask (see below) */
1302     obj_handle_t  active_sb;     /* active screen buffer */
1303     int           history_mode;  /* whether we duplicate lines in history */
1304     int           history_size;  /* number of lines in history */
1305     int           edition_mode;  /* index to the edition mode flavors */
1306     int           input_cp;      /* console input codepage */
1307     int           output_cp;     /* console output codepage */
1308     user_handle_t win;           /* console window if backend supports it */
1309     VARARG(title,unicode_str);   /* console title */
1310 @END
1311 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
1312 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
1313 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
1314 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
1315 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10
1316 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE   0x20
1317 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE  0x40
1318 #define SET_CONSOLE_INPUT_INFO_WIN              0x80
1319
1320
1321 /* Get info about a console (input only) */
1322 @REQ(get_console_input_info)
1323     obj_handle_t  handle;         /* handle to console input, or 0 for process' console */
1324 @REPLY
1325     int           history_mode;   /* whether we duplicate lines in history */
1326     int           history_size;   /* number of lines in history */
1327     int           history_index;  /* number of used lines in history */
1328     int           edition_mode;   /* index to the edition mode flavors */
1329     int           input_cp;       /* console input codepage */
1330     int           output_cp;      /* console output codepage */
1331     user_handle_t win;            /* console window if backend supports it */
1332     VARARG(title,unicode_str);    /* console title */
1333 @END
1334
1335
1336 /* appends a string to console's history */
1337 @REQ(append_console_input_history)
1338     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
1339     VARARG(line,unicode_str);   /* line to add */
1340 @END
1341
1342
1343 /* appends a string to console's history */
1344 @REQ(get_console_input_history)
1345     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
1346     int          index;         /* index to get line from */
1347 @REPLY
1348     int          total;         /* total length of line in Unicode chars */
1349     VARARG(line,unicode_str);   /* line to add */
1350 @END
1351
1352
1353 /* creates a new screen buffer on process' console */
1354 @REQ(create_console_output)
1355     obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
1356     unsigned int access;        /* wanted access rights */
1357     unsigned int attributes;    /* object attributes */
1358     unsigned int share;         /* sharing credentials */
1359     int          fd;            /* for bare consoles, fd the screen-buffer is attached to */
1360 @REPLY
1361     obj_handle_t handle_out;    /* handle to the screen buffer */
1362 @END
1363
1364
1365 /* Set info about a console (output only) */
1366 @REQ(set_console_output_info)
1367     obj_handle_t handle;        /* handle to the console */
1368     int          mask;          /* setting mask (see below) */
1369     short int    cursor_size;   /* size of cursor (percentage filled) */
1370     short int    cursor_visible;/* cursor visibility flag */
1371     short int    cursor_x;      /* position of cursor (x, y) */
1372     short int    cursor_y;
1373     short int    width;         /* width of the screen buffer */
1374     short int    height;        /* height of the screen buffer */
1375     short int    attr;          /* default attribute */
1376     short int    win_left;      /* window actually displayed by renderer */
1377     short int    win_top;       /* the rect area is expressed within the */
1378     short int    win_right;     /* boundaries of the screen buffer */
1379     short int    win_bottom;
1380     short int    max_width;     /* maximum size (width x height) for the window */
1381     short int    max_height;
1382 @END
1383 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
1384 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
1385 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
1386 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
1387 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
1388 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
1389
1390
1391 /* Get info about a console (output only) */
1392 @REQ(get_console_output_info)
1393     obj_handle_t handle;        /* handle to the console */
1394 @REPLY
1395     short int    cursor_size;   /* size of cursor (percentage filled) */
1396     short int    cursor_visible;/* cursor visibility flag */
1397     short int    cursor_x;      /* position of cursor (x, y) */
1398     short int    cursor_y;
1399     short int    width;         /* width of the screen buffer */
1400     short int    height;        /* height of the screen buffer */
1401     short int    attr;          /* default attribute */
1402     short int    win_left;      /* window actually displayed by renderer */
1403     short int    win_top;       /* the rect area is expressed within the */
1404     short int    win_right;     /* boundaries of the screen buffer */
1405     short int    win_bottom;
1406     short int    max_width;     /* maximum size (width x height) for the window */
1407     short int    max_height;
1408 @END
1409
1410 /* Add input records to a console input queue */
1411 @REQ(write_console_input)
1412     obj_handle_t handle;        /* handle to the console input */
1413     VARARG(rec,input_records);  /* input records */
1414 @REPLY
1415     int          written;       /* number of records written */
1416 @END
1417
1418
1419 /* Fetch input records from a console input queue */
1420 @REQ(read_console_input)
1421     obj_handle_t handle;        /* handle to the console input */
1422     int          flush;         /* flush the retrieved records from the queue? */
1423 @REPLY
1424     int          read;          /* number of records read */
1425     VARARG(rec,input_records);  /* input records */
1426 @END
1427
1428
1429 /* write data (chars and/or attributes) in a screen buffer */
1430 @REQ(write_console_output)
1431     obj_handle_t handle;        /* handle to the console output */
1432     int          x;             /* position where to start writing */
1433     int          y;
1434     int          mode;          /* char info (see below) */
1435     int          wrap;          /* wrap around at end of line? */
1436     VARARG(data,bytes);         /* info to write */
1437 @REPLY
1438     int          written;       /* number of char infos actually written */
1439     int          width;         /* width of screen buffer */
1440     int          height;        /* height of screen buffer */
1441 @END
1442 enum char_info_mode
1443 {
1444     CHAR_INFO_MODE_TEXT,        /* characters only */
1445     CHAR_INFO_MODE_ATTR,        /* attributes only */
1446     CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
1447     CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
1448 };
1449
1450
1451 /* fill a screen buffer with constant data (chars and/or attributes) */
1452 @REQ(fill_console_output)
1453     obj_handle_t handle;        /* handle to the console output */
1454     int          x;             /* position where to start writing */
1455     int          y;
1456     int          mode;          /* char info mode */
1457     int          count;         /* number to write */
1458     int          wrap;          /* wrap around at end of line? */
1459     char_info_t  data;          /* data to write */
1460 @REPLY
1461     int          written;       /* number of char infos actually written */
1462 @END
1463
1464
1465 /* read data (chars and/or attributes) from a screen buffer */
1466 @REQ(read_console_output)
1467     obj_handle_t handle;        /* handle to the console output */
1468     int          x;             /* position (x,y) where to start reading */
1469     int          y;
1470     int          mode;          /* char info mode */
1471     int          wrap;          /* wrap around at end of line? */
1472 @REPLY
1473     int          width;         /* width of screen buffer */
1474     int          height;        /* height of screen buffer */
1475     VARARG(data,bytes);
1476 @END
1477
1478
1479 /* move a rect (of data) in screen buffer content */
1480 @REQ(move_console_output)
1481     obj_handle_t handle;        /* handle to the console output */
1482     short int    x_src;         /* position (x, y) of rect to start moving from */
1483     short int    y_src;
1484     short int    x_dst;         /* position (x, y) of rect to move to */
1485     short int    y_dst;
1486     short int    w;             /* size of the rect (width, height) to move */
1487     short int    h;
1488 @END
1489
1490
1491 /* Sends a signal to a process group */
1492 @REQ(send_console_signal)
1493     int          signal;        /* the signal to send */
1494     process_id_t group_id;      /* the group to send the signal to */
1495 @END
1496
1497
1498 /* enable directory change notifications */
1499 @REQ(read_directory_changes)
1500     unsigned int filter;        /* notification filter */
1501     int          subtree;       /* watch the subtree? */
1502     int          want_data;     /* flag indicating whether change data should be collected */
1503     async_data_t async;         /* async I/O parameters */
1504 @END
1505
1506
1507 @REQ(read_change)
1508     obj_handle_t handle;
1509 @REPLY
1510     VARARG(events,filesystem_event);  /* collected filesystem events */
1511 @END
1512
1513
1514 /* Create a file mapping */
1515 @REQ(create_mapping)
1516     unsigned int access;        /* wanted access rights */
1517     unsigned int attributes;    /* object attributes */
1518     unsigned int protect;       /* protection flags (see below) */
1519     mem_size_t   size;          /* mapping size */
1520     obj_handle_t file_handle;   /* file handle */
1521     VARARG(objattr,object_attributes); /* object attributes */
1522 @REPLY
1523     obj_handle_t handle;        /* handle to the mapping */
1524 @END
1525 /* per-page protection flags */
1526 #define VPROT_READ       0x01
1527 #define VPROT_WRITE      0x02
1528 #define VPROT_EXEC       0x04
1529 #define VPROT_WRITECOPY  0x08
1530 #define VPROT_GUARD      0x10
1531 #define VPROT_NOCACHE    0x20
1532 #define VPROT_COMMITTED  0x40
1533 #define VPROT_WRITEWATCH 0x80
1534 /* per-mapping protection flags */
1535 #define VPROT_IMAGE      0x0100  /* mapping for an exe image */
1536 #define VPROT_SYSTEM     0x0200  /* system view (underlying mmap not under our control) */
1537 #define VPROT_VALLOC     0x0400  /* allocated by VirtualAlloc */
1538 #define VPROT_NOEXEC     0x0800  /* don't force exec permission */
1539
1540
1541 /* Open a mapping */
1542 @REQ(open_mapping)
1543     unsigned int access;        /* wanted access rights */
1544     unsigned int attributes;    /* object attributes */
1545     obj_handle_t rootdir;       /* root directory */
1546     VARARG(name,unicode_str);   /* object name */
1547 @REPLY
1548     obj_handle_t handle;        /* handle to the mapping */
1549 @END
1550
1551
1552 /* Get information about a file mapping */
1553 @REQ(get_mapping_info)
1554     obj_handle_t handle;        /* handle to the mapping */
1555     unsigned int access;        /* wanted access rights */
1556 @REPLY
1557     mem_size_t   size;          /* mapping size */
1558     int          protect;       /* protection flags */
1559     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
1560     client_ptr_t base;          /* default base addr (for VPROT_IMAGE mapping) */
1561     obj_handle_t mapping;       /* duplicate mapping handle unless removable */
1562     obj_handle_t shared_file;   /* shared mapping file handle */
1563 @END
1564
1565
1566 /* Get a range of committed pages in a file mapping */
1567 @REQ(get_mapping_committed_range)
1568     obj_handle_t handle;        /* handle to the mapping */
1569     file_pos_t   offset;        /* starting offset (page-aligned, in bytes) */
1570 @REPLY
1571     mem_size_t   size;          /* size of range starting at offset (page-aligned, in bytes) */
1572     int          committed;     /* whether it is a committed range */
1573 @END
1574
1575
1576 /* Add a range to the committed pages in a file mapping */
1577 @REQ(add_mapping_committed_range)
1578     obj_handle_t handle;        /* handle to the mapping */
1579     file_pos_t   offset;        /* starting offset (page-aligned, in bytes) */
1580     mem_size_t   size;          /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1581 @END
1582
1583
1584 #define SNAP_PROCESS    0x00000001
1585 #define SNAP_THREAD     0x00000002
1586 /* Create a snapshot */
1587 @REQ(create_snapshot)
1588     unsigned int attributes;    /* object attributes */
1589     unsigned int flags;         /* snapshot flags (SNAP_*) */
1590 @REPLY
1591     obj_handle_t handle;        /* handle to the snapshot */
1592 @END
1593
1594
1595 /* Get the next process from a snapshot */
1596 @REQ(next_process)
1597     obj_handle_t handle;        /* handle to the snapshot */
1598     int          reset;         /* reset snapshot position? */
1599 @REPLY
1600     int          count;         /* process usage count */
1601     process_id_t pid;           /* process id */
1602     process_id_t ppid;          /* parent process id */
1603     int          threads;       /* number of threads */
1604     int          priority;      /* process priority */
1605     int          handles;       /* number of handles */
1606     int          unix_pid;      /* Unix pid */
1607     VARARG(filename,unicode_str); /* file name of main exe */
1608 @END
1609
1610
1611 /* Get the next thread from a snapshot */
1612 @REQ(next_thread)
1613     obj_handle_t handle;        /* handle to the snapshot */
1614     int          reset;         /* reset snapshot position? */
1615 @REPLY
1616     int          count;         /* thread usage count */
1617     process_id_t pid;           /* process id */
1618     thread_id_t  tid;           /* thread id */
1619     int          base_pri;      /* base priority */
1620     int          delta_pri;     /* delta priority */
1621 @END
1622
1623
1624 /* Wait for a debug event */
1625 @REQ(wait_debug_event)
1626     int           get_handle;  /* should we alloc a handle for waiting? */
1627 @REPLY
1628     process_id_t  pid;         /* process id */
1629     thread_id_t   tid;         /* thread id */
1630     obj_handle_t  wait;        /* wait handle if no event ready */
1631     VARARG(event,debug_event); /* debug event data */
1632 @END
1633
1634
1635 /* Queue an exception event */
1636 @REQ(queue_exception_event)
1637     int           first;       /* first chance exception? */
1638     unsigned int  code;        /* exception code */
1639     unsigned int  flags;       /* exception flags */
1640     client_ptr_t  record;      /* exception record */
1641     client_ptr_t  address;     /* exception address */
1642     data_size_t   len;         /* size of parameters */
1643     VARARG(params,uints64,len);/* exception parameters */
1644     VARARG(context,context);   /* thread context */
1645 @REPLY
1646     obj_handle_t     handle;   /* handle to the queued event */
1647 @END
1648
1649
1650 /* Retrieve the status of an exception event */
1651 @REQ(get_exception_status)
1652     obj_handle_t     handle;   /* handle to the queued event */
1653 @REPLY
1654     VARARG(context,context);   /* modified thread context */
1655 @END
1656
1657
1658 /* Send an output string to the debugger */
1659 @REQ(output_debug_string)
1660     data_size_t   length;      /* string length */
1661     client_ptr_t  string;      /* string to display (in debugged process address space) */
1662 @END
1663
1664
1665 /* Continue a debug event */
1666 @REQ(continue_debug_event)
1667     process_id_t pid;          /* process id to continue */
1668     thread_id_t  tid;          /* thread id to continue */
1669     int          status;       /* continuation status */
1670 @END
1671
1672
1673 /* Start/stop debugging an existing process */
1674 @REQ(debug_process)
1675     process_id_t pid;          /* id of the process to debug */
1676     int          attach;       /* 1=attaching / 0=detaching from the process */
1677 @END
1678
1679
1680 /* Simulate a breakpoint in a process */
1681 @REQ(debug_break)
1682     obj_handle_t handle;       /* process handle */
1683 @REPLY
1684     int          self;         /* was it the caller itself? */
1685 @END
1686
1687
1688 /* Set debugger kill on exit flag */
1689 @REQ(set_debugger_kill_on_exit)
1690     int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
1691 @END
1692
1693
1694 /* Read data from a process address space */
1695 @REQ(read_process_memory)
1696     obj_handle_t handle;       /* process handle */
1697     client_ptr_t addr;         /* addr to read from */
1698 @REPLY
1699     VARARG(data,bytes);        /* result data */
1700 @END
1701
1702
1703 /* Write data to a process address space */
1704 @REQ(write_process_memory)
1705     obj_handle_t handle;       /* process handle */
1706     client_ptr_t addr;         /* addr to write to */
1707     VARARG(data,bytes);        /* data to write */
1708 @END
1709
1710
1711 /* Create a registry key */
1712 @REQ(create_key)
1713     obj_handle_t parent;       /* handle to the parent key */
1714     unsigned int access;       /* desired access rights */
1715     unsigned int attributes;   /* object attributes */
1716     unsigned int options;      /* creation options */
1717     data_size_t  namelen;      /* length of key name in bytes */
1718     VARARG(name,unicode_str,namelen);  /* key name */
1719     VARARG(class,unicode_str);         /* class name */
1720 @REPLY
1721     obj_handle_t hkey;         /* handle to the created key */
1722     int          created;      /* has it been newly created? */
1723 @END
1724
1725 /* Open a registry key */
1726 @REQ(open_key)
1727     obj_handle_t parent;       /* handle to the parent key */
1728     unsigned int access;       /* desired access rights */
1729     unsigned int attributes;   /* object attributes */
1730     VARARG(name,unicode_str);  /* key name */
1731 @REPLY
1732     obj_handle_t hkey;         /* handle to the open key */
1733 @END
1734
1735
1736 /* Delete a registry key */
1737 @REQ(delete_key)
1738     obj_handle_t hkey;         /* handle to the key */
1739 @END
1740
1741
1742 /* Flush a registry key */
1743 @REQ(flush_key)
1744     obj_handle_t hkey;         /* handle to the key */
1745 @END
1746
1747
1748 /* Enumerate registry subkeys */
1749 @REQ(enum_key)
1750     obj_handle_t hkey;         /* handle to registry key */
1751     int          index;        /* index of subkey (or -1 for current key) */
1752     int          info_class;   /* requested information class */
1753 @REPLY
1754     int          subkeys;      /* number of subkeys */
1755     int          max_subkey;   /* longest subkey name */
1756     int          max_class;    /* longest class name */
1757     int          values;       /* number of values */
1758     int          max_value;    /* longest value name */
1759     int          max_data;     /* longest value data */
1760     timeout_t    modif;        /* last modification time */
1761     data_size_t  total;        /* total length needed for full name and class */
1762     data_size_t  namelen;      /* length of key name in bytes */
1763     VARARG(name,unicode_str,namelen);  /* key name */
1764     VARARG(class,unicode_str);         /* class name */
1765 @END
1766
1767
1768 /* Set a value of a registry key */
1769 @REQ(set_key_value)
1770     obj_handle_t hkey;         /* handle to registry key */
1771     int          type;         /* value type */
1772     data_size_t  namelen;      /* length of value name in bytes */
1773     VARARG(name,unicode_str,namelen);  /* value name */
1774     VARARG(data,bytes);                /* value data */
1775 @END
1776
1777
1778 /* Retrieve the value of a registry key */
1779 @REQ(get_key_value)
1780     obj_handle_t hkey;         /* handle to registry key */
1781     VARARG(name,unicode_str);  /* value name */
1782 @REPLY
1783     int          type;         /* value type */
1784     data_size_t  total;        /* total length needed for data */
1785     VARARG(data,bytes);        /* value data */
1786 @END
1787
1788
1789 /* Enumerate a value of a registry key */
1790 @REQ(enum_key_value)
1791     obj_handle_t hkey;         /* handle to registry key */
1792     int          index;        /* value index */
1793     int          info_class;   /* requested information class */
1794 @REPLY
1795     int          type;         /* value type */
1796     data_size_t  total;        /* total length needed for full name and data */
1797     data_size_t  namelen;      /* length of value name in bytes */
1798     VARARG(name,unicode_str,namelen);  /* value name */
1799     VARARG(data,bytes);                /* value data */
1800 @END
1801
1802
1803 /* Delete a value of a registry key */
1804 @REQ(delete_key_value)
1805     obj_handle_t hkey;         /* handle to registry key */
1806     VARARG(name,unicode_str);  /* value name */
1807 @END
1808
1809
1810 /* Load a registry branch from a file */
1811 @REQ(load_registry)
1812     obj_handle_t hkey;         /* root key to load to */
1813     obj_handle_t file;         /* file to load from */
1814     VARARG(name,unicode_str);  /* subkey name */
1815 @END
1816
1817
1818 /* UnLoad a registry branch from a file */
1819 @REQ(unload_registry)
1820     obj_handle_t hkey;         /* root key to unload to */
1821 @END
1822
1823
1824 /* Save a registry branch to a file */
1825 @REQ(save_registry)
1826     obj_handle_t hkey;         /* key to save */
1827     obj_handle_t file;         /* file to save to */
1828 @END
1829
1830
1831 /* Add a registry key change notification */
1832 @REQ(set_registry_notification)
1833     obj_handle_t hkey;         /* key to watch for changes */
1834     obj_handle_t event;        /* event to set */
1835     int          subtree;      /* should we watch the whole subtree? */
1836     unsigned int filter;       /* things to watch */
1837 @END
1838
1839
1840 /* Create a waitable timer */
1841 @REQ(create_timer)
1842     unsigned int access;        /* wanted access rights */
1843     unsigned int attributes;    /* object attributes */
1844     obj_handle_t rootdir;       /* root directory */
1845     int          manual;        /* manual reset */
1846     VARARG(name,unicode_str);   /* object name */
1847 @REPLY
1848     obj_handle_t handle;        /* handle to the timer */
1849 @END
1850
1851
1852 /* Open a waitable timer */
1853 @REQ(open_timer)
1854     unsigned int access;        /* wanted access rights */
1855     unsigned int attributes;    /* object attributes */
1856     obj_handle_t rootdir;       /* root directory */
1857     VARARG(name,unicode_str);   /* object name */
1858 @REPLY
1859     obj_handle_t handle;        /* handle to the timer */
1860 @END
1861
1862 /* Set a waitable timer */
1863 @REQ(set_timer)
1864     obj_handle_t handle;        /* handle to the timer */
1865     timeout_t    expire;        /* next expiration absolute time */
1866     client_ptr_t callback;      /* callback function */
1867     client_ptr_t arg;           /* callback argument */
1868     int          period;        /* timer period in ms */
1869 @REPLY
1870     int          signaled;      /* was the timer signaled before this call ? */
1871 @END
1872
1873 /* Cancel a waitable timer */
1874 @REQ(cancel_timer)
1875     obj_handle_t handle;        /* handle to the timer */
1876 @REPLY
1877      int         signaled;      /* was the timer signaled before this calltime ? */
1878 @END
1879
1880 /* Get information on a waitable timer */
1881 @REQ(get_timer_info)
1882     obj_handle_t handle;        /* handle to the timer */
1883 @REPLY
1884     timeout_t    when;          /* absolute time when the timer next expires */
1885     int          signaled;      /* is the timer signaled? */
1886 @END
1887
1888
1889 /* Retrieve the current context of a thread */
1890 @REQ(get_thread_context)
1891     obj_handle_t handle;       /* thread handle */
1892     unsigned int flags;        /* context flags */
1893     int          suspend;      /* suspend the thread if needed */
1894 @REPLY
1895     int          self;         /* was it a handle to the current thread? */
1896     VARARG(context,context);   /* thread context */
1897 @END
1898
1899
1900 /* Set the current context of a thread */
1901 @REQ(set_thread_context)
1902     obj_handle_t handle;       /* thread handle */
1903     int          suspend;      /* suspend the thread if needed */
1904     VARARG(context,context);   /* thread context */
1905 @REPLY
1906     int          self;         /* was it a handle to the current thread? */
1907 @END
1908
1909
1910 /* Fetch a selector entry for a thread */
1911 @REQ(get_selector_entry)
1912     obj_handle_t  handle;      /* thread handle */
1913     int           entry;       /* LDT entry */
1914 @REPLY
1915     unsigned int  base;        /* selector base */
1916     unsigned int  limit;       /* selector limit */
1917     unsigned char flags;       /* selector flags */
1918 @END
1919
1920
1921 /* Add an atom */
1922 @REQ(add_atom)
1923     obj_handle_t  table;       /* which table to add atom to */
1924     VARARG(name,unicode_str);  /* atom name */
1925 @REPLY
1926     atom_t        atom;        /* resulting atom */
1927 @END
1928
1929
1930 /* Delete an atom */
1931 @REQ(delete_atom)
1932     obj_handle_t  table;       /* which table to delete atom from */
1933     atom_t        atom;        /* atom handle */
1934 @END
1935
1936
1937 /* Find an atom */
1938 @REQ(find_atom)
1939     obj_handle_t table;        /* which table to find atom from */
1940     VARARG(name,unicode_str);  /* atom name */
1941 @REPLY
1942     atom_t       atom;         /* atom handle */
1943 @END
1944
1945
1946 /* Get information about an atom */
1947 @REQ(get_atom_information)
1948     obj_handle_t table;        /* which table to find atom from */
1949     atom_t       atom;         /* atom handle */
1950 @REPLY
1951     int          count;        /* atom lock count */
1952     int          pinned;       /* whether the atom has been pinned */
1953     data_size_t  total;        /* actual length of atom name */
1954     VARARG(name,unicode_str);  /* atom name */
1955 @END
1956
1957
1958 /* Set information about an atom */
1959 @REQ(set_atom_information)
1960     obj_handle_t table;        /* which table to find atom from */
1961     atom_t       atom;         /* atom handle */
1962     int          pinned;       /* whether to bump atom information */
1963 @END
1964
1965
1966 /* Empty an atom table */
1967 @REQ(empty_atom_table)
1968     obj_handle_t table;        /* which table to find atom from */
1969     int          if_pinned;    /* whether to delete pinned atoms */
1970 @END
1971
1972
1973 /* Init an atom table */
1974 @REQ(init_atom_table)
1975     int          entries;      /* number of entries (only for local) */
1976 @REPLY
1977     obj_handle_t table;        /* handle to the atom table */
1978 @END
1979
1980
1981 /* Get the message queue of the current thread */
1982 @REQ(get_msg_queue)
1983 @REPLY
1984     obj_handle_t handle;       /* handle to the queue */
1985 @END
1986
1987
1988 /* Set the file descriptor associated to the current thread queue */
1989 @REQ(set_queue_fd)
1990     obj_handle_t handle;       /* handle to the file descriptor */
1991 @END
1992
1993
1994 /* Set the current message queue wakeup mask */
1995 @REQ(set_queue_mask)
1996     unsigned int wake_mask;    /* wakeup bits mask */
1997     unsigned int changed_mask; /* changed bits mask */
1998     int          skip_wait;    /* will we skip waiting if signaled? */
1999 @REPLY
2000     unsigned int wake_bits;    /* current wake bits */
2001     unsigned int changed_bits; /* current changed bits */
2002 @END
2003
2004
2005 /* Get the current message queue status */
2006 @REQ(get_queue_status)
2007     int          clear;        /* should we clear the change bits? */
2008 @REPLY
2009     unsigned int wake_bits;    /* wake bits */
2010     unsigned int changed_bits; /* changed bits since last time */
2011 @END
2012
2013
2014 /* Retrieve the process idle event */
2015 @REQ(get_process_idle_event)
2016     obj_handle_t handle;       /* process handle */
2017 @REPLY
2018     obj_handle_t event;        /* handle to idle event */
2019 @END
2020
2021
2022 /* Send a message to a thread queue */
2023 @REQ(send_message)
2024     thread_id_t     id;        /* thread id */
2025     int             type;      /* message type (see below) */
2026     int             flags;     /* message flags (see below) */
2027     user_handle_t   win;       /* window handle */
2028     unsigned int    msg;       /* message code */
2029     lparam_t        wparam;    /* parameters */
2030     lparam_t        lparam;    /* parameters */
2031     timeout_t       timeout;   /* timeout for reply */
2032     VARARG(data,message_data); /* message data for sent messages */
2033 @END
2034
2035 @REQ(post_quit_message)
2036     int             exit_code; /* exit code to return */
2037 @END
2038
2039 enum message_type
2040 {
2041     MSG_ASCII,          /* Ascii message (from SendMessageA) */
2042     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
2043     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
2044     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
2045     MSG_CALLBACK_RESULT,/* result of a callback message */
2046     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
2047     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
2048     MSG_HARDWARE,       /* hardware message */
2049     MSG_WINEVENT,       /* winevent message */
2050     MSG_HOOK_LL         /* low-level hardware hook */
2051 };
2052 #define SEND_MSG_ABORT_IF_HUNG  0x01
2053
2054
2055 /* Send a hardware message to a thread queue */
2056 @REQ(send_hardware_message)
2057     user_handle_t   win;       /* window handle */
2058     hw_input_t      input;     /* input data */
2059     unsigned int    flags;     /* flags (see below) */
2060 @REPLY
2061     int             wait;      /* do we need to wait for a reply? */
2062     int             prev_x;    /* previous cursor position */
2063     int             prev_y;
2064     int             new_x;     /* new cursor position */
2065     int             new_y;
2066     VARARG(keystate,bytes);    /* global state array for all the keys */
2067 @END
2068 #define SEND_HWMSG_INJECTED    0x01
2069
2070
2071 /* Get a message from the current queue */
2072 @REQ(get_message)
2073     unsigned int    flags;     /* PM_* flags */
2074     user_handle_t   get_win;   /* window handle to get */
2075     unsigned int    get_first; /* first message code to get */
2076     unsigned int    get_last;  /* last message code to get */
2077     unsigned int    hw_id;     /* id of the previous hardware message (or 0) */
2078     unsigned int    wake_mask; /* wakeup bits mask */
2079     unsigned int    changed_mask; /* changed bits mask */
2080 @REPLY
2081     user_handle_t   win;       /* window handle */
2082     unsigned int    msg;       /* message code */
2083     lparam_t        wparam;    /* parameters */
2084     lparam_t        lparam;    /* parameters */
2085     int             type;      /* message type */
2086     unsigned int    time;      /* message time */
2087     unsigned int    active_hooks; /* active hooks bitmap */
2088     data_size_t     total;     /* total size of extra data */
2089     VARARG(data,message_data); /* message data for sent messages */
2090 @END
2091
2092
2093 /* Reply to a sent message */
2094 @REQ(reply_message)
2095     int             remove;    /* should we remove the message? */
2096     lparam_t        result;    /* message result */
2097     VARARG(data,bytes);        /* message data for sent messages */
2098 @END
2099
2100
2101 /* Accept the current hardware message */
2102 @REQ(accept_hardware_message)
2103     unsigned int    hw_id;     /* id of the hardware message */
2104     int             remove;    /* should we remove the message? */
2105     user_handle_t   new_win;   /* new destination window for current message */
2106 @END
2107
2108
2109 /* Retrieve the reply for the last message sent */
2110 @REQ(get_message_reply)
2111     int             cancel;    /* cancel message if not ready? */
2112 @REPLY
2113     lparam_t        result;    /* message result */
2114     VARARG(data,bytes);        /* message data for sent messages */
2115 @END
2116
2117
2118 /* Set a window timer */
2119 @REQ(set_win_timer)
2120     user_handle_t   win;       /* window handle */
2121     unsigned int    msg;       /* message to post */
2122     unsigned int    rate;      /* timer rate in ms */
2123     lparam_t        id;        /* timer id */
2124     lparam_t        lparam;    /* message lparam (callback proc) */
2125 @REPLY
2126     lparam_t        id;        /* timer id */
2127 @END
2128
2129
2130 /* Kill a window timer */
2131 @REQ(kill_win_timer)
2132     user_handle_t   win;       /* window handle */
2133     lparam_t        id;        /* timer id */
2134     unsigned int    msg;       /* message to post */
2135 @END
2136
2137
2138 /* check if the thread owning the window is hung */
2139 @REQ(is_window_hung)
2140     user_handle_t   win;       /* window handle */
2141 @REPLY
2142     int is_hung;
2143 @END
2144
2145
2146 /* Retrieve info about a serial port */
2147 @REQ(get_serial_info)
2148     obj_handle_t handle;       /* handle to comm port */
2149 @REPLY
2150     unsigned int readinterval;
2151     unsigned int readconst;
2152     unsigned int readmult;
2153     unsigned int writeconst;
2154     unsigned int writemult;
2155     unsigned int eventmask;
2156 @END
2157
2158
2159 /* Set info about a serial port */
2160 @REQ(set_serial_info)
2161     obj_handle_t handle;       /* handle to comm port */
2162     int          flags;        /* bitmask to set values (see below) */
2163     unsigned int readinterval;
2164     unsigned int readconst;
2165     unsigned int readmult;
2166     unsigned int writeconst;
2167     unsigned int writemult;
2168     unsigned int eventmask;
2169 @END
2170 #define SERIALINFO_SET_TIMEOUTS  0x01
2171 #define SERIALINFO_SET_MASK      0x02
2172
2173
2174 /* Create an async I/O */
2175 @REQ(register_async)
2176     int          type;          /* type of queue to look after */
2177     async_data_t async;         /* async I/O parameters */
2178     int          count;         /* count - usually # of bytes to be read/written */
2179 @END
2180 #define ASYNC_TYPE_READ  0x01
2181 #define ASYNC_TYPE_WRITE 0x02
2182 #define ASYNC_TYPE_WAIT  0x03
2183
2184
2185 /* Cancel all async op on a fd */
2186 @REQ(cancel_async)
2187     obj_handle_t handle;        /* handle to comm port, socket or file */
2188     client_ptr_t iosb;          /* I/O status block (NULL=all) */
2189     int          only_thread;   /* cancel matching this thread */
2190 @END
2191
2192
2193 /* Perform an ioctl on a file */
2194 @REQ(ioctl)
2195     ioctl_code_t   code;          /* ioctl code */
2196     async_data_t   async;         /* async I/O parameters */
2197     int            blocking;      /* whether it's a blocking ioctl */
2198     VARARG(in_data,bytes);        /* ioctl input data */
2199 @REPLY
2200     obj_handle_t   wait;          /* handle to wait on for blocking ioctl */
2201     unsigned int   options;       /* device open options */
2202     VARARG(out_data,bytes);       /* ioctl output data */
2203 @END
2204
2205
2206 /* Retrieve results of an async ioctl */
2207 @REQ(get_ioctl_result)
2208     obj_handle_t   handle;        /* handle to the device */
2209     client_ptr_t   user_arg;      /* user arg used to identify the request */
2210 @REPLY
2211     VARARG(out_data,bytes);       /* ioctl output data */
2212 @END
2213
2214
2215 /* Create a named pipe */
2216 @REQ(create_named_pipe)
2217     unsigned int   access;
2218     unsigned int   attributes;   /* object attributes */
2219     obj_handle_t   rootdir;      /* root directory */
2220     unsigned int   options;
2221     unsigned int   sharing;
2222     unsigned int   maxinstances;
2223     unsigned int   outsize;
2224     unsigned int   insize;
2225     timeout_t      timeout;
2226     unsigned int   flags;
2227     VARARG(name,unicode_str);    /* pipe name */
2228 @REPLY
2229     obj_handle_t   handle;       /* handle to the pipe */
2230 @END
2231
2232 /* flags in create_named_pipe and get_named_pipe_info */
2233 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2234 #define NAMED_PIPE_MESSAGE_STREAM_READ  0x0002
2235 #define NAMED_PIPE_NONBLOCKING_MODE     0x0004
2236 #define NAMED_PIPE_SERVER_END           0x8000
2237
2238
2239 @REQ(get_named_pipe_info)
2240     obj_handle_t   handle;
2241 @REPLY
2242     unsigned int   flags;
2243     unsigned int   sharing;
2244     unsigned int   maxinstances;
2245     unsigned int   instances;
2246     unsigned int   outsize;
2247     unsigned int   insize;
2248 @END
2249
2250
2251 /* Create a window */
2252 @REQ(create_window)
2253     user_handle_t  parent;      /* parent window */
2254     user_handle_t  owner;       /* owner window */
2255     atom_t         atom;        /* class atom */
2256     mod_handle_t   instance;    /* module instance */
2257     VARARG(class,unicode_str);  /* class name */
2258 @REPLY
2259     user_handle_t  handle;      /* created window */
2260     user_handle_t  parent;      /* full handle of parent */
2261     user_handle_t  owner;       /* full handle of owner */
2262     int            extra;       /* number of extra bytes */
2263     client_ptr_t   class_ptr;   /* pointer to class in client address space */
2264 @END
2265
2266
2267 /* Destroy a window */
2268 @REQ(destroy_window)
2269     user_handle_t  handle;      /* handle to the window */
2270 @END
2271
2272
2273 /* Retrieve the desktop window for the current thread */
2274 @REQ(get_desktop_window)
2275     int            force;       /* force creation if it doesn't exist */
2276 @REPLY
2277     user_handle_t  top_window;  /* handle to the desktop window */
2278     user_handle_t  msg_window;  /* handle to the top-level HWND_MESSAGE parent */
2279 @END
2280
2281
2282 /* Set a window owner */
2283 @REQ(set_window_owner)
2284     user_handle_t  handle;      /* handle to the window */
2285     user_handle_t  owner;       /* new owner */
2286 @REPLY
2287     user_handle_t  full_owner;  /* full handle of new owner */
2288     user_handle_t  prev_owner;  /* full handle of previous owner */
2289 @END
2290
2291
2292 /* Get information from a window handle */
2293 @REQ(get_window_info)
2294     user_handle_t  handle;      /* handle to the window */
2295 @REPLY
2296     user_handle_t  full_handle; /* full 32-bit handle */
2297     user_handle_t  last_active; /* last active popup */
2298     process_id_t   pid;         /* process owning the window */
2299     thread_id_t    tid;         /* thread owning the window */
2300     atom_t         atom;        /* class atom */
2301     int            is_unicode;  /* ANSI or unicode */
2302 @END
2303
2304
2305 /* Set some information in a window */
2306 @REQ(set_window_info)
2307     unsigned short flags;         /* flags for fields to set (see below) */
2308     short int      is_unicode;    /* ANSI or unicode */
2309     user_handle_t  handle;        /* handle to the window */
2310     unsigned int   style;         /* window style */
2311     unsigned int   ex_style;      /* window extended style */
2312     unsigned int   id;            /* window id */
2313     mod_handle_t   instance;      /* creator instance */
2314     lparam_t       user_data;     /* user-specific data */
2315     int            extra_offset;  /* offset to set in extra bytes */
2316     data_size_t    extra_size;    /* size to set in extra bytes */
2317     lparam_t       extra_value;   /* value to set in extra bytes */
2318 @REPLY
2319     unsigned int   old_style;     /* old window style */
2320     unsigned int   old_ex_style;  /* old window extended style */
2321     mod_handle_t   old_instance;  /* old creator instance */
2322     lparam_t       old_user_data; /* old user-specific data */
2323     lparam_t       old_extra_value; /* old value in extra bytes */
2324     unsigned int   old_id;        /* old window id */
2325 @END
2326 #define SET_WIN_STYLE     0x01
2327 #define SET_WIN_EXSTYLE   0x02
2328 #define SET_WIN_ID        0x04
2329 #define SET_WIN_INSTANCE  0x08
2330 #define SET_WIN_USERDATA  0x10
2331 #define SET_WIN_EXTRA     0x20
2332 #define SET_WIN_UNICODE   0x40
2333
2334
2335 /* Set the parent of a window */
2336 @REQ(set_parent)
2337     user_handle_t  handle;      /* handle to the window */
2338     user_handle_t  parent;      /* handle to the parent */
2339 @REPLY
2340     user_handle_t  old_parent;  /* old parent window */
2341     user_handle_t  full_parent; /* full handle of new parent */
2342 @END
2343
2344
2345 /* Get a list of the window parents, up to the root of the tree */
2346 @REQ(get_window_parents)
2347     user_handle_t  handle;        /* handle to the window */
2348 @REPLY
2349     int            count;         /* total count of parents */
2350     VARARG(parents,user_handles); /* parent handles */
2351 @END
2352
2353
2354 /* Get a list of the window children */
2355 @REQ(get_window_children)
2356     obj_handle_t   desktop;       /* handle to desktop */
2357     user_handle_t  parent;        /* parent window */
2358     atom_t         atom;          /* class atom for the listed children */
2359     thread_id_t    tid;           /* thread owning the listed children */
2360     VARARG(class,unicode_str);    /* class name */
2361 @REPLY
2362     int            count;         /* total count of children */
2363     VARARG(children,user_handles); /* children handles */
2364 @END
2365
2366
2367 /* Get a list of the window children that contain a given point */
2368 @REQ(get_window_children_from_point)
2369     user_handle_t  parent;        /* parent window */
2370     int            x;             /* point in parent coordinates */
2371     int            y;
2372 @REPLY
2373     int            count;         /* total count of children */
2374     VARARG(children,user_handles); /* children handles */
2375 @END
2376
2377
2378 /* Get window tree information from a window handle */
2379 @REQ(get_window_tree)
2380     user_handle_t  handle;        /* handle to the window */
2381 @REPLY
2382     user_handle_t  parent;        /* parent window */
2383     user_handle_t  owner;         /* owner window */
2384     user_handle_t  next_sibling;  /* next sibling in Z-order */
2385     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
2386     user_handle_t  first_sibling; /* first sibling in Z-order */
2387     user_handle_t  last_sibling;  /* last sibling in Z-order */
2388     user_handle_t  first_child;   /* first child */
2389     user_handle_t  last_child;    /* last child */
2390 @END
2391
2392 /* Set the position and Z order of a window */
2393 @REQ(set_window_pos)
2394     unsigned int   flags;         /* SWP_* flags */
2395     user_handle_t  handle;        /* handle to the window */
2396     user_handle_t  previous;      /* previous window in Z order */
2397     rectangle_t    window;        /* window rectangle (in parent coords) */
2398     rectangle_t    client;        /* client rectangle (in parent coords) */
2399     VARARG(valid,rectangles);     /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2400 @REPLY
2401     unsigned int   new_style;     /* new window style */
2402     unsigned int   new_ex_style;  /* new window extended style */
2403 @END
2404
2405
2406 /* Get the window and client rectangles of a window */
2407 @REQ(get_window_rectangles)
2408     user_handle_t  handle;        /* handle to the window */
2409     int            relative;      /* coords relative to (see below) */
2410 @REPLY
2411     rectangle_t    window;        /* window rectangle */
2412     rectangle_t    visible;       /* visible part of the window rectangle */
2413     rectangle_t    client;        /* client rectangle */
2414 @END
2415 enum coords_relative
2416 {
2417     COORDS_CLIENT,   /* relative to client area */
2418     COORDS_WINDOW,   /* relative to whole window area */
2419     COORDS_PARENT,   /* relative to parent's client area */
2420     COORDS_SCREEN    /* relative to screen origin */
2421 };
2422
2423
2424 /* Get the window text */
2425 @REQ(get_window_text)
2426     user_handle_t  handle;        /* handle to the window */
2427 @REPLY
2428     VARARG(text,unicode_str);     /* window text */
2429 @END
2430
2431
2432 /* Set the window text */
2433 @REQ(set_window_text)
2434     user_handle_t  handle;        /* handle to the window */
2435     VARARG(text,unicode_str);     /* window text */
2436 @END
2437
2438
2439 /* Get the coordinates offset between two windows */
2440 @REQ(get_windows_offset)
2441     user_handle_t  from;          /* handle to the first window */
2442     user_handle_t  to;            /* handle to the second window */
2443 @REPLY
2444     int            x;             /* x coordinate offset */
2445     int            y;             /* y coordinate offset */
2446     int            mirror;        /* whether to mirror the x coordinate */
2447 @END
2448
2449
2450 /* Get the visible region of a window */
2451 @REQ(get_visible_region)
2452     user_handle_t  window;        /* handle to the window */
2453     unsigned int   flags;         /* DCX flags */
2454 @REPLY
2455     user_handle_t  top_win;       /* top window to clip against */
2456     rectangle_t    top_rect;      /* top window visible rect with screen coords */
2457     rectangle_t    win_rect;      /* window rect in screen coords */
2458     data_size_t    total_size;    /* total size of the resulting region */
2459     VARARG(region,rectangles);    /* list of rectangles for the region (in screen coords) */
2460 @END
2461
2462
2463 /* Get the window region */
2464 @REQ(get_window_region)
2465     user_handle_t  window;        /* handle to the window */
2466 @REPLY
2467     data_size_t    total_size;    /* total size of the resulting region */
2468     VARARG(region,rectangles);    /* list of rectangles for the region (in window coords) */
2469 @END
2470
2471
2472 /* Set the window region */
2473 @REQ(set_window_region)
2474     user_handle_t  window;        /* handle to the window */
2475     int            redraw;        /* redraw the window? */
2476     VARARG(region,rectangles);    /* list of rectangles for the region (in window coords) */
2477 @END
2478
2479
2480 /* Get the window update region */
2481 @REQ(get_update_region)
2482     user_handle_t  window;        /* handle to the window */
2483     user_handle_t  from_child;    /* child to start searching from */
2484     unsigned int   flags;         /* update flags (see below) */
2485 @REPLY
2486     user_handle_t  child;         /* child to repaint (or window itself) */
2487     unsigned int   flags;         /* resulting update flags (see below) */
2488     data_size_t    total_size;    /* total size of the resulting region */
2489     VARARG(region,rectangles);    /* list of rectangles for the region (in screen coords) */
2490 @END
2491 #define UPDATE_NONCLIENT       0x01  /* get region for repainting non-client area */
2492 #define UPDATE_ERASE           0x02  /* get region for erasing client area */
2493 #define UPDATE_PAINT           0x04  /* get region for painting client area */
2494 #define UPDATE_INTERNALPAINT   0x08  /* get region if internal paint is pending */
2495 #define UPDATE_ALLCHILDREN     0x10  /* force repaint of all children */
2496 #define UPDATE_NOCHILDREN      0x20  /* don't try to repaint any children */
2497 #define UPDATE_NOREGION        0x40  /* don't return a region, only the flags */
2498 #define UPDATE_DELAYED_ERASE   0x80  /* still needs erase after BeginPaint */
2499
2500
2501 /* Update the z order of a window so that a given rectangle is fully visible */
2502 @REQ(update_window_zorder)
2503     user_handle_t  window;        /* handle to the window */
2504     rectangle_t    rect;          /* rectangle that must be visible (in client coords) */
2505 @END
2506
2507
2508 /* Mark parts of a window as needing a redraw */
2509 @REQ(redraw_window)
2510     user_handle_t  window;        /* handle to the window */
2511     unsigned int   flags;         /* RDW_* flags */
2512     VARARG(region,rectangles);    /* list of rectangles for the region (in window coords) */
2513 @END
2514
2515
2516 /* Set a window property */
2517 @REQ(set_window_property)
2518     user_handle_t  window;        /* handle to the window */
2519     lparam_t       data;          /* data to store */
2520     atom_t         atom;          /* property atom (if no name specified) */
2521     VARARG(name,unicode_str);     /* property name */
2522 @END
2523
2524
2525 /* Remove a window property */
2526 @REQ(remove_window_property)
2527     user_handle_t  window;        /* handle to the window */
2528     atom_t         atom;          /* property atom (if no name specified) */
2529     VARARG(name,unicode_str);     /* property name */
2530 @REPLY
2531     lparam_t       data;          /* data stored in property */
2532 @END
2533
2534
2535 /* Get a window property */
2536 @REQ(get_window_property)
2537     user_handle_t  window;        /* handle to the window */
2538     atom_t         atom;          /* property atom (if no name specified) */
2539     VARARG(name,unicode_str);     /* property name */
2540 @REPLY
2541     lparam_t       data;          /* data stored in property */
2542 @END
2543
2544
2545 /* Get the list of properties of a window */
2546 @REQ(get_window_properties)
2547     user_handle_t  window;        /* handle to the window */
2548 @REPLY
2549     int            total;         /* total number of properties */
2550     VARARG(props,properties);     /* list of properties */
2551 @END
2552
2553
2554 /* Create a window station */
2555 @REQ(create_winstation)
2556     unsigned int flags;           /* window station flags */
2557     unsigned int access;          /* wanted access rights */
2558     unsigned int attributes;      /* object attributes */
2559     VARARG(name,unicode_str);     /* object name */
2560 @REPLY
2561     obj_handle_t handle;          /* handle to the window station */
2562 @END
2563
2564
2565 /* Open a handle to a window station */
2566 @REQ(open_winstation)
2567     unsigned int access;          /* wanted access rights */
2568     unsigned int attributes;      /* object attributes */
2569     VARARG(name,unicode_str);     /* object name */
2570 @REPLY
2571     obj_handle_t handle;          /* handle to the window station */
2572 @END
2573
2574
2575 /* Close a window station */
2576 @REQ(close_winstation)
2577     obj_handle_t handle;          /* handle to the window station */
2578 @END
2579
2580
2581 /* Get the process current window station */
2582 @REQ(get_process_winstation)
2583 @REPLY
2584     obj_handle_t handle;          /* handle to the window station */
2585 @END
2586
2587
2588 /* Set the process current window station */
2589 @REQ(set_process_winstation)
2590     obj_handle_t handle;          /* handle to the window station */
2591 @END
2592
2593
2594 /* Enumerate window stations */
2595 @REQ(enum_winstation)
2596     unsigned int index;           /* current index */
2597 @REPLY
2598     unsigned int next;            /* next index */
2599     VARARG(name,unicode_str);     /* window station name */
2600 @END
2601
2602
2603 /* Create a desktop */
2604 @REQ(create_desktop)
2605     unsigned int flags;           /* desktop flags */
2606     unsigned int access;          /* wanted access rights */
2607     unsigned int attributes;      /* object attributes */
2608     VARARG(name,unicode_str);     /* object name */
2609 @REPLY
2610     obj_handle_t handle;          /* handle to the desktop */
2611 @END
2612
2613
2614 /* Open a handle to a desktop */
2615 @REQ(open_desktop)
2616     obj_handle_t winsta;          /* window station to open (null allowed) */
2617     unsigned int flags;           /* desktop flags */
2618     unsigned int access;          /* wanted access rights */
2619     unsigned int attributes;      /* object attributes */
2620     VARARG(name,unicode_str);     /* object name */
2621 @REPLY
2622     obj_handle_t handle;          /* handle to the desktop */
2623 @END
2624
2625
2626 /* Close a desktop */
2627 @REQ(close_desktop)
2628     obj_handle_t handle;          /* handle to the desktop */
2629 @END
2630
2631
2632 /* Get the thread current desktop */
2633 @REQ(get_thread_desktop)
2634     thread_id_t  tid;             /* thread id */
2635 @REPLY
2636     obj_handle_t handle;          /* handle to the desktop */
2637 @END
2638
2639
2640 /* Set the thread current desktop */
2641 @REQ(set_thread_desktop)
2642     obj_handle_t handle;          /* handle to the desktop */
2643 @END
2644
2645
2646 /* Enumerate desktops */
2647 @REQ(enum_desktop)
2648     obj_handle_t winstation;      /* handle to the window station */
2649     unsigned int index;           /* current index */
2650 @REPLY
2651     unsigned int next;            /* next index */
2652     VARARG(name,unicode_str);     /* window station name */
2653 @END
2654
2655
2656 /* Get/set information about a user object (window station or desktop) */
2657 @REQ(set_user_object_info)
2658     obj_handle_t handle;          /* handle to the object */
2659     unsigned int flags;           /* information to set */
2660     unsigned int obj_flags;       /* new object flags */
2661 @REPLY
2662     int          is_desktop;      /* is object a desktop? */
2663     unsigned int old_obj_flags;   /* old object flags */
2664     VARARG(name,unicode_str);     /* object name */
2665 @END
2666 #define SET_USER_OBJECT_FLAGS 1
2667
2668
2669 /* Register a hotkey */
2670 @REQ(register_hotkey)
2671     user_handle_t  window;        /* handle to the window */
2672     int            id;            /* hotkey identifier */
2673     unsigned int   flags;         /* modifier keys */
2674     unsigned int   vkey;          /* virtual key code */
2675 @REPLY
2676     int            replaced;      /* did we replace an existing hotkey? */
2677     unsigned int   flags;         /* flags of replaced hotkey */
2678     unsigned int   vkey;          /* virtual key code of replaced hotkey */
2679 @END
2680
2681
2682 /* Unregister a hotkey */
2683 @REQ(unregister_hotkey)
2684     user_handle_t  window;        /* handle to the window */
2685     int            id;            /* hotkey identifier */
2686 @REPLY
2687     unsigned int   flags;         /* flags of removed hotkey */
2688     unsigned int   vkey;          /* virtual key code of removed hotkey */
2689 @END
2690
2691
2692 /* Attach (or detach) thread inputs */
2693 @REQ(attach_thread_input)
2694     thread_id_t    tid_from;       /* thread to be attached */
2695     thread_id_t    tid_to;         /* thread to which tid_from should be attached */
2696     int            attach;         /* is it an attach? */
2697 @END
2698
2699
2700 /* Get input data for a given thread */
2701 @REQ(get_thread_input)
2702     thread_id_t    tid;           /* id of thread */
2703 @REPLY
2704     user_handle_t  focus;         /* handle to the focus window */
2705     user_handle_t  capture;       /* handle to the capture window */
2706     user_handle_t  active;        /* handle to the active window */
2707     user_handle_t  foreground;    /* handle to the global foreground window */
2708     user_handle_t  menu_owner;    /* handle to the menu owner */
2709     user_handle_t  move_size;     /* handle to the moving/resizing window */
2710     user_handle_t  caret;         /* handle to the caret window */
2711     user_handle_t  cursor;        /* handle to the cursor */
2712     int            show_count;    /* cursor show count */
2713     rectangle_t    rect;          /* caret rectangle */
2714 @END
2715
2716
2717 /* Get the time of the last input event */
2718 @REQ(get_last_input_time)
2719 @REPLY
2720     unsigned int time;
2721 @END
2722
2723
2724 /* Retrieve queue keyboard state for a given thread */
2725 @REQ(get_key_state)
2726     thread_id_t    tid;           /* id of thread */
2727     int            key;           /* optional key code or -1 */
2728 @REPLY
2729     unsigned char  state;         /* state of specified key */
2730     VARARG(keystate,bytes);       /* state array for all the keys */
2731 @END
2732
2733 /* Set queue keyboard state for a given thread */
2734 @REQ(set_key_state)
2735     thread_id_t    tid;           /* id of thread */
2736     int            async;         /* whether to change the async state too */
2737     VARARG(keystate,bytes);       /* state array for all the keys */
2738 @END
2739
2740 /* Set the system foreground window */
2741 @REQ(set_foreground_window)
2742     user_handle_t  handle;        /* handle to the foreground window */
2743 @REPLY
2744     user_handle_t  previous;      /* handle to the previous foreground window */
2745     int            send_msg_old;  /* whether we have to send a msg to the old window */
2746     int            send_msg_new;  /* whether we have to send a msg to the new window */
2747 @END
2748
2749 /* Set the current thread focus window */
2750 @REQ(set_focus_window)
2751     user_handle_t  handle;        /* handle to the focus window */
2752 @REPLY
2753     user_handle_t  previous;      /* handle to the previous focus window */
2754 @END
2755
2756 /* Set the current thread active window */
2757 @REQ(set_active_window)
2758     user_handle_t  handle;        /* handle to the active window */
2759 @REPLY
2760     user_handle_t  previous;      /* handle to the previous active window */
2761 @END
2762
2763 /* Set the current thread capture window */
2764 @REQ(set_capture_window)
2765     user_handle_t  handle;        /* handle to the capture window */
2766     unsigned int   flags;         /* capture flags (see below) */
2767 @REPLY
2768     user_handle_t  previous;      /* handle to the previous capture window */
2769     user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
2770 @END
2771 #define CAPTURE_MENU     0x01  /* capture is for a menu */
2772 #define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */
2773
2774
2775 /* Set the current thread caret window */
2776 @REQ(set_caret_window)
2777     user_handle_t  handle;        /* handle to the caret window */
2778     int            width;         /* caret width */
2779     int            height;        /* caret height */
2780 @REPLY
2781     user_handle_t  previous;      /* handle to the previous caret window */
2782     rectangle_t    old_rect;      /* previous caret rectangle */
2783     int            old_hide;      /* previous hide count */
2784     int            old_state;     /* previous caret state (1=on, 0=off) */
2785 @END
2786
2787
2788 /* Set the current thread caret information */
2789 @REQ(set_caret_info)
2790     unsigned int   flags;         /* caret flags (see below) */
2791     user_handle_t  handle;        /* handle to the caret window */
2792     int            x;             /* caret x position */
2793     int            y;             /* caret y position */
2794     int            hide;          /* increment for hide count (can be negative to show it) */
2795     int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
2796 @REPLY
2797     user_handle_t  full_handle;   /* handle to the current caret window */
2798     rectangle_t    old_rect;      /* previous caret rectangle */
2799     int            old_hide;      /* previous hide count */
2800     int            old_state;     /* previous caret state (1=on, 0=off) */
2801 @END
2802 #define SET_CARET_POS        0x01  /* set the caret position from x,y */
2803 #define SET_CARET_HIDE       0x02  /* increment the caret hide count */
2804 #define SET_CARET_STATE      0x04  /* set the caret on/off state */
2805
2806
2807 /* Set a window hook */
2808 @REQ(set_hook)
2809     int            id;             /* id of the hook */
2810     process_id_t   pid;            /* id of process to set the hook into */
2811     thread_id_t    tid;            /* id of thread to set the hook into */
2812     int            event_min;
2813     int            event_max;
2814     client_ptr_t   proc;           /* hook procedure */
2815     int            flags;
2816     int            unicode;        /* is it a unicode hook? */
2817     VARARG(module,unicode_str);    /* module name */
2818 @REPLY
2819     user_handle_t  handle;         /* handle to the hook */
2820     unsigned int   active_hooks;   /* active hooks bitmap */
2821 @END
2822
2823
2824 /* Remove a window hook */
2825 @REQ(remove_hook)
2826     user_handle_t  handle;         /* handle to the hook */
2827     client_ptr_t   proc;           /* hook procedure if handle is 0 */
2828     int            id;             /* id of the hook if handle is 0 */
2829 @REPLY
2830     unsigned int   active_hooks;   /* active hooks bitmap */
2831 @END
2832
2833
2834 /* Start calling a hook chain */
2835 @REQ(start_hook_chain)
2836     int            id;             /* id of the hook */
2837     int            event;          /* signalled event */
2838     user_handle_t  window;         /* handle to the event window */
2839     int            object_id;      /* object id for out of context winevent */
2840     int            child_id;       /* child id for out of context winevent */
2841 @REPLY
2842     user_handle_t  handle;         /* handle to the next hook */
2843     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2844     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2845     int            unicode;        /* is it a unicode hook? */
2846     client_ptr_t   proc;           /* hook procedure */
2847     unsigned int   active_hooks;   /* active hooks bitmap */
2848     VARARG(module,unicode_str);    /* module name */
2849 @END
2850
2851
2852 /* Finished calling a hook chain */
2853 @REQ(finish_hook_chain)
2854     int            id;             /* id of the hook */
2855 @END
2856
2857
2858 /* Get the hook information */
2859 @REQ(get_hook_info)
2860     user_handle_t  handle;         /* handle to the current hook */
2861     int            get_next;       /* do we want info about current or next hook? */
2862     int            event;          /* signalled event */
2863     user_handle_t  window;         /* handle to the event window */
2864     int            object_id;      /* object id for out of context winevent */
2865     int            child_id;       /* child id for out of context winevent */
2866 @REPLY
2867     user_handle_t  handle;         /* handle to the hook */
2868     int            id;             /* id of the hook */
2869     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2870     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2871     client_ptr_t   proc;           /* hook procedure */
2872     int            unicode;        /* is it a unicode hook? */
2873     VARARG(module,unicode_str);    /* module name */
2874 @END
2875
2876
2877 /* Create a window class */
2878 @REQ(create_class)
2879     int            local;          /* is it a local class? */
2880     atom_t         atom;           /* class atom */
2881     unsigned int   style;          /* class style */
2882     mod_handle_t   instance;       /* module instance */
2883     int            extra;          /* number of extra class bytes */
2884     int            win_extra;      /* number of window extra bytes */
2885     client_ptr_t   client_ptr;     /* pointer to class in client address space */
2886     VARARG(name,unicode_str);      /* class name */
2887 @REPLY
2888     atom_t         atom;           /* resulting class atom */
2889 @END
2890
2891
2892 /* Destroy a window class */
2893 @REQ(destroy_class)
2894     atom_t         atom;           /* class atom */
2895     mod_handle_t   instance;       /* module instance */
2896     VARARG(name,unicode_str);      /* class name */
2897 @REPLY
2898     client_ptr_t   client_ptr;     /* pointer to class in client address space */
2899 @END
2900
2901
2902 /* Set some information in a class */
2903 @REQ(set_class_info)
2904     user_handle_t  window;         /* handle to the window */
2905     unsigned int   flags;          /* flags for info to set (see below) */
2906     atom_t         atom;           /* class atom */
2907     unsigned int   style;          /* class style */
2908     int            win_extra;      /* number of window extra bytes */
2909     mod_handle_t   instance;       /* module instance */
2910     int            extra_offset;   /* offset to set in extra bytes */
2911     data_size_t    extra_size;     /* size to set in extra bytes */
2912     lparam_t       extra_value;    /* value to set in extra bytes */
2913 @REPLY
2914     atom_t         old_atom;       /* previous class atom */
2915     unsigned int   old_style;      /* previous class style */
2916     int            old_extra;      /* previous number of class extra bytes */
2917     int            old_win_extra;  /* previous number of window extra bytes */
2918     mod_handle_t   old_instance;   /* previous module instance */
2919     lparam_t       old_extra_value; /* old value in extra bytes */
2920 @END
2921 #define SET_CLASS_ATOM      0x0001
2922 #define SET_CLASS_STYLE     0x0002
2923 #define SET_CLASS_WINEXTRA  0x0004
2924 #define SET_CLASS_INSTANCE  0x0008
2925 #define SET_CLASS_EXTRA     0x0010
2926
2927
2928 /* Set/get clipboard information */
2929 @REQ(set_clipboard_info)
2930     unsigned int   flags;       /* flags for fields to set (see below) */
2931     user_handle_t  clipboard;   /* clipboard window */
2932     user_handle_t  owner;       /* clipboard owner */
2933     user_handle_t  viewer;      /* first clipboard viewer */
2934     unsigned int   seqno;       /* change sequence number */
2935 @REPLY
2936     unsigned int   flags;           /* status flags (see below) */
2937     user_handle_t  old_clipboard;   /* old clipboard window */
2938     user_handle_t  old_owner;       /* old clipboard owner */
2939     user_handle_t  old_viewer;      /* old clipboard viewer */
2940     unsigned int   seqno;           /* current sequence number */
2941 @END
2942
2943 #define SET_CB_OPEN      0x001
2944 #define SET_CB_OWNER     0x002
2945 #define SET_CB_VIEWER    0x004
2946 #define SET_CB_SEQNO     0x008
2947 #define SET_CB_RELOWNER  0x010
2948 #define SET_CB_CLOSE     0x020
2949 #define CB_OPEN          0x040
2950 #define CB_OWNER         0x080
2951 #define CB_PROCESS       0x100
2952
2953
2954 /* Open a security token */
2955 @REQ(open_token)
2956     obj_handle_t   handle;    /* handle to the thread or process */
2957     unsigned int   access;    /* access rights to the new token */
2958     unsigned int   attributes;/* object attributes */
2959     unsigned int   flags;     /* flags (see below) */
2960 @REPLY
2961     obj_handle_t   token;    /* handle to the token */
2962 @END
2963 #define OPEN_TOKEN_THREAD   1
2964 #define OPEN_TOKEN_AS_SELF  2
2965
2966
2967 /* Set/get the global windows */
2968 @REQ(set_global_windows)
2969     unsigned int   flags;               /* flags for fields to set (see below) */
2970     user_handle_t  shell_window;        /* handle to the new shell window */
2971     user_handle_t  shell_listview;      /* handle to the new shell listview window */
2972     user_handle_t  progman_window;      /* handle to the new program manager window */
2973     user_handle_t  taskman_window;      /* handle to the new task manager window */
2974 @REPLY
2975     user_handle_t  old_shell_window;    /* handle to the shell window */
2976     user_handle_t  old_shell_listview;  /* handle to the shell listview window */
2977     user_handle_t  old_progman_window;  /* handle to the new program manager window */
2978     user_handle_t  old_taskman_window;  /* handle to the new task manager window */
2979 @END
2980 #define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
2981 #define SET_GLOBAL_PROGMAN_WINDOW  0x02
2982 #define SET_GLOBAL_TASKMAN_WINDOW  0x04
2983
2984 /* Adjust the privileges held by a token */
2985 @REQ(adjust_token_privileges)
2986     obj_handle_t  handle; /* handle to the token */
2987     int           disable_all; /* disable all privileges? */
2988     int           get_modified_state; /* get modified privileges? */
2989     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2990 @REPLY
2991     unsigned int  len; /* total length in bytes required to store token privileges */
2992     VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2993 @END
2994
2995 /* Retrieves the set of privileges held by or available to a token */
2996 @REQ(get_token_privileges)
2997     obj_handle_t  handle; /* handle to the token */
2998 @REPLY
2999     unsigned int  len; /* total length in bytes required to store token privileges */
3000     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3001 @END
3002
3003 /* Check the token has the required privileges */
3004 @REQ(check_token_privileges)
3005     obj_handle_t  handle; /* handle to the token */
3006     int           all_required; /* are all the privileges required for the check to succeed? */
3007     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
3008 @REPLY
3009     int           has_privileges; /* does the token have the required privileges? */
3010     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3011 @END
3012
3013 @REQ(duplicate_token)
3014     obj_handle_t  handle;        /* handle to the token to duplicate */
3015     unsigned int  access;        /* access rights to the new token */
3016     unsigned int  attributes;    /* object attributes */
3017     int           primary;       /* is the new token to be a primary one? */
3018     int           impersonation_level; /* impersonation level of the new token */
3019 @REPLY
3020     obj_handle_t  new_handle; /* duplicated handle */
3021 @END
3022
3023 @REQ(access_check)
3024     obj_handle_t    handle; /* handle to the token */
3025     unsigned int    desired_access; /* desired access to the object */
3026     unsigned int    mapping_read; /* mapping from generic read to specific rights */
3027     unsigned int    mapping_write; /* mapping from generic write to specific rights */
3028     unsigned int    mapping_execute; /* mapping from generic execute to specific rights */
3029     unsigned int    mapping_all; /* mapping from generic all to specific rights */
3030     VARARG(sd,security_descriptor); /* security descriptor to check */
3031 @REPLY
3032     unsigned int    access_granted; /* access rights actually granted */
3033     unsigned int    access_status; /* was access granted? */
3034     unsigned int    privileges_len; /* length needed to store privileges */
3035     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
3036 @END
3037
3038 @REQ(get_token_sid)
3039     obj_handle_t    handle;       /* handle to the token */
3040     unsigned int    which_sid;    /* which SID to retrieve from the token */
3041 @REPLY
3042     data_size_t     sid_len;      /* length needed to store sid */
3043     VARARG(sid,SID);              /* the sid specified by which_sid from the token */
3044 @END
3045
3046 @REQ(get_token_groups)
3047     obj_handle_t    handle;       /* handle to the token */
3048 @REPLY
3049     data_size_t     user_len;     /* length needed to store user */
3050     VARARG(user,token_groups);    /* groups the token's user belongs to */
3051 @END
3052
3053 @REQ(get_token_default_dacl)
3054     obj_handle_t    handle;     /* handle to the token */
3055 @REPLY
3056     data_size_t     acl_len;    /* length needed to store access control list */
3057     VARARG(acl,ACL);            /* access control list */
3058 @END
3059
3060 @REQ(set_token_default_dacl)
3061     obj_handle_t    handle;     /* handle to the token */
3062     VARARG(acl,ACL);            /* default dacl to set */
3063 @END
3064
3065 @REQ(set_security_object)
3066     obj_handle_t    handle;       /* handle to the object */
3067     unsigned int    security_info; /* which parts of security descriptor to set */
3068     VARARG(sd,security_descriptor); /* security descriptor to set */
3069 @END
3070
3071 @REQ(get_security_object)
3072     obj_handle_t    handle;       /* handle to the object */
3073     unsigned int    security_info; /* which parts of security descriptor to get */
3074 @REPLY
3075     unsigned int    sd_len;         /* buffer size needed for sd */
3076     VARARG(sd,security_descriptor); /* retrieved security descriptor */
3077 @END
3078
3079 /* Create a mailslot */
3080 @REQ(create_mailslot)
3081     unsigned int   access;        /* wanted access rights */
3082     unsigned int   attributes;    /* object attributes */
3083     obj_handle_t   rootdir;       /* root directory */
3084     timeout_t      read_timeout;
3085     unsigned int   max_msgsize;
3086     VARARG(name,unicode_str);     /* mailslot name */
3087 @REPLY
3088     obj_handle_t   handle;        /* handle to the mailslot */
3089 @END
3090
3091
3092 /* Set mailslot information */
3093 @REQ(set_mailslot_info)
3094     obj_handle_t   handle;        /* handle to the mailslot */
3095     timeout_t      read_timeout;
3096     unsigned int   flags;
3097 @REPLY
3098     timeout_t      read_timeout;
3099     unsigned int   max_msgsize;
3100 @END
3101 #define MAILSLOT_SET_READ_TIMEOUT  1
3102
3103
3104 /* Create a directory object */
3105 @REQ(create_directory)
3106     unsigned int   access;        /* access flags */
3107     unsigned int   attributes;    /* object attributes */
3108     obj_handle_t   rootdir;       /* root directory */
3109     VARARG(directory_name,unicode_str); /* Directory name */
3110 @REPLY
3111     obj_handle_t   handle;        /* handle to the directory */
3112 @END
3113
3114
3115 /* Open a directory object */
3116 @REQ(open_directory)
3117     unsigned int   access;        /* access flags */
3118     unsigned int   attributes;    /* object attributes */
3119     obj_handle_t   rootdir;       /* root directory */
3120     VARARG(directory_name,unicode_str); /* Directory name */
3121 @REPLY
3122     obj_handle_t   handle;        /* handle to the directory */
3123 @END
3124
3125
3126 /* Get a directory entry by index */
3127 @REQ(get_directory_entry)
3128     obj_handle_t   handle;             /* handle to the directory */
3129     unsigned int   index;              /* entry index */
3130 @REPLY
3131     data_size_t    name_len;           /* length of the entry name in bytes */
3132     VARARG(name,unicode_str,name_len); /* entry name */
3133     VARARG(type,unicode_str);          /* entry type */
3134 @END
3135
3136
3137 /* Create a symbolic link object */
3138 @REQ(create_symlink)
3139     unsigned int   access;        /* access flags */
3140     unsigned int   attributes;    /* object attributes */
3141     obj_handle_t   rootdir;       /* root directory */
3142     data_size_t    name_len;      /* length of the symlink name in bytes */
3143     VARARG(name,unicode_str,name_len); /* symlink name */
3144     VARARG(target_name,unicode_str);   /* target name */
3145 @REPLY
3146     obj_handle_t   handle;        /* handle to the symlink */
3147 @END
3148
3149
3150 /* Open a symbolic link object */
3151 @REQ(open_symlink)
3152     unsigned int   access;        /* access flags */
3153     unsigned int   attributes;    /* object attributes */
3154     obj_handle_t   rootdir;       /* root directory */
3155     VARARG(name,unicode_str);     /* symlink name */
3156 @REPLY
3157     obj_handle_t   handle;        /* handle to the symlink */
3158 @END
3159
3160
3161 /* Query a symbolic link object */
3162 @REQ(query_symlink)
3163     obj_handle_t   handle;        /* handle to the symlink */
3164 @REPLY
3165     data_size_t    total;         /* total needed size for name */
3166     VARARG(target_name,unicode_str); /* target name */
3167 @END
3168
3169
3170 /* Query basic object information */
3171 @REQ(get_object_info)
3172     obj_handle_t   handle;        /* handle to the object */
3173 @REPLY
3174     unsigned int   access;        /* granted access mask */
3175     unsigned int   ref_count;     /* object ref count */
3176     data_size_t    total;         /* total needed size for name */
3177     VARARG(name,unicode_str);     /* object name */
3178 @END
3179
3180
3181 /* Unlink a named object */
3182 @REQ(unlink_object)
3183     obj_handle_t   handle;        /* handle to the object */
3184 @END
3185
3186
3187 /* Query the impersonation level of an impersonation token */
3188 @REQ(get_token_impersonation_level)
3189     obj_handle_t   handle;        /* handle to the object */
3190 @REPLY
3191     int            impersonation_level; /* impersonation level of the impersonation token */
3192 @END
3193
3194 /* Allocate a locally-unique identifier */
3195 @REQ(allocate_locally_unique_id)
3196 @REPLY
3197     luid_t         luid;
3198 @END
3199
3200
3201 /* Create a device manager */
3202 @REQ(create_device_manager)
3203     unsigned int access;          /* wanted access rights */
3204     unsigned int attributes;      /* object attributes */
3205 @REPLY
3206     obj_handle_t handle;          /* handle to the device */
3207 @END
3208
3209
3210 /* Create a device */
3211 @REQ(create_device)
3212     unsigned int access;          /* wanted access rights */
3213     unsigned int attributes;      /* object attributes */
3214     obj_handle_t rootdir;         /* root directory */
3215     client_ptr_t user_ptr;        /* opaque ptr for use by client */
3216     obj_handle_t manager;         /* device manager */
3217     VARARG(name,unicode_str);     /* object name */
3218 @REPLY
3219     obj_handle_t handle;          /* handle to the device */
3220 @END
3221
3222
3223 /* Delete a device */
3224 @REQ(delete_device)
3225     obj_handle_t handle;          /* handle to the device */
3226 @END
3227
3228
3229 /* Retrieve the next pending device ioctl request */
3230 @REQ(get_next_device_request)
3231     obj_handle_t manager;         /* handle to the device manager */
3232     obj_handle_t prev;            /* handle to the previous ioctl */
3233     unsigned int status;          /* status of the previous ioctl */
3234     VARARG(prev_data,bytes);      /* output data of the previous ioctl */
3235 @REPLY
3236     obj_handle_t next;            /* handle to the next ioctl */
3237     ioctl_code_t code;            /* ioctl code */
3238     client_ptr_t user_ptr;        /* opaque ptr for the device */
3239     process_id_t client_pid;      /* pid of process calling ioctl */
3240     thread_id_t  client_tid;      /* tid of thread calling ioctl */
3241     data_size_t  in_size;         /* total needed input size */
3242     data_size_t  out_size;        /* needed output size */
3243     VARARG(next_data,bytes);      /* input data of the next ioctl */
3244 @END
3245
3246
3247 /* Make the current process a system process */
3248 @REQ(make_process_system)
3249 @REPLY
3250     obj_handle_t event;           /* event signaled when all user processes have exited */
3251 @END
3252
3253
3254 /* Get detailed fixed-size information about a token */
3255 @REQ(get_token_statistics)
3256     obj_handle_t   handle;        /* handle to the object */
3257 @REPLY
3258     luid_t         token_id;      /* locally-unique identifier of the token */
3259     luid_t         modified_id;   /* locally-unique identifier of the modified version of the token */
3260     int            primary;       /* is the token primary or impersonation? */
3261     int            impersonation_level; /* level of impersonation */
3262     int            group_count;   /* the number of groups the token is a member of */
3263     int            privilege_count; /* the number of privileges the token has */
3264 @END
3265
3266
3267 /* Create I/O completion port */
3268 @REQ(create_completion)
3269     unsigned int access;          /* desired access to a port */
3270     unsigned int attributes;      /* object attributes */
3271     unsigned int concurrent;      /* max number of concurrent active threads */
3272     obj_handle_t rootdir;         /* root directory */
3273     VARARG(filename,string);      /* port name */
3274 @REPLY
3275     obj_handle_t handle;          /* port handle */
3276 @END
3277
3278
3279 /* Open I/O completion port */
3280 @REQ(open_completion)
3281     unsigned int access;          /* desired access to a port */
3282     unsigned int attributes;      /* object attributes */
3283     obj_handle_t rootdir;         /* root directory */
3284     VARARG(filename,string);      /* port name */
3285 @REPLY
3286     obj_handle_t handle;          /* port handle */
3287 @END
3288
3289
3290 /* add completion to completion port */
3291 @REQ(add_completion)
3292     obj_handle_t  handle;         /* port handle */
3293     apc_param_t   ckey;           /* completion key */
3294     apc_param_t   cvalue;         /* completion value */
3295     unsigned int  information;    /* IO_STATUS_BLOCK Information */
3296     unsigned int  status;         /* completion result */
3297 @END
3298
3299
3300 /* get completion from completion port queue */
3301 @REQ(remove_completion)
3302     obj_handle_t handle;          /* port handle */
3303 @REPLY
3304     apc_param_t   ckey;           /* completion key */
3305     apc_param_t   cvalue;         /* completion value */
3306     unsigned int  information;    /* IO_STATUS_BLOCK Information */
3307     unsigned int  status;         /* completion result */
3308 @END
3309
3310
3311 /* get completion queue depth */
3312 @REQ(query_completion)
3313     obj_handle_t  handle;         /* port handle */
3314 @REPLY
3315     unsigned int  depth;          /* completion queue depth */
3316 @END
3317
3318
3319 /* associate object with completion port */
3320 @REQ(set_completion_info)
3321     obj_handle_t  handle;         /* object handle */
3322     apc_param_t   ckey;           /* completion key */
3323     obj_handle_t  chandle;        /* port handle */
3324 @END
3325
3326
3327 /* check for associated completion and push msg */
3328 @REQ(add_fd_completion)
3329     obj_handle_t   handle;        /* async' object */
3330     apc_param_t    cvalue;        /* completion value */
3331     unsigned int   status;        /* completion status */
3332     unsigned int   information;   /* IO_STATUS_BLOCK Information */
3333 @END
3334
3335
3336 /* Retrieve layered info for a window */
3337 @REQ(get_window_layered_info)
3338     user_handle_t  handle;        /* handle to the window */
3339 @REPLY
3340     unsigned int   color_key;     /* color key */
3341     unsigned int   alpha;         /* alpha (0..255) */
3342     unsigned int   flags;         /* LWA_* flags */
3343 @END
3344
3345
3346 /* Set layered info for a window */
3347 @REQ(set_window_layered_info)
3348     user_handle_t  handle;        /* handle to the window */
3349     unsigned int   color_key;     /* color key */
3350     unsigned int   alpha;         /* alpha (0..255) */
3351     unsigned int   flags;         /* LWA_* flags */
3352 @END
3353
3354
3355 /* Allocate an arbitrary user handle */
3356 @REQ(alloc_user_handle)
3357 @REPLY
3358     user_handle_t  handle;        /* allocated handle */
3359 @END
3360
3361
3362 /* Free an arbitrary user handle */
3363 @REQ(free_user_handle)
3364     user_handle_t  handle;        /* handle to free*/
3365 @END
3366
3367
3368 /* Set/get the current cursor */
3369 @REQ(set_cursor)
3370     unsigned int   flags;         /* flags for fields to set (see below) */
3371     user_handle_t  handle;        /* handle to the cursor */
3372     int            show_count;    /* show count increment/decrement */
3373     int            x;             /* cursor position */
3374     int            y;
3375     rectangle_t    clip;          /* cursor clip rectangle */
3376     unsigned int   clip_msg;      /* message to post on cursor clip changes */
3377 @REPLY
3378     user_handle_t  prev_handle;   /* previous handle */
3379     int            prev_count;    /* previous show count */
3380     int            prev_x;        /* previous position */
3381     int            prev_y;
3382     int            new_x;         /* new position */
3383     int            new_y;
3384     rectangle_t    new_clip;      /* new clip rectangle */
3385     unsigned int   last_change;   /* time of last position change */
3386 @END
3387 #define SET_CURSOR_HANDLE 0x01
3388 #define SET_CURSOR_COUNT  0x02
3389 #define SET_CURSOR_POS    0x04
3390 #define SET_CURSOR_CLIP   0x08
3391 #define SET_CURSOR_NOCLIP 0x10
3392
3393
3394 /* Modify the list of registered rawinput devices */
3395 @REQ(update_rawinput_devices)
3396     VARARG(devices,rawinput_devices);
3397 @END
3398
3399
3400 /* Retrieve the suspended context of a thread */
3401 @REQ(get_suspend_context)
3402 @REPLY
3403     VARARG(context,context);   /* thread context */
3404 @END
3405
3406
3407 /* Store the suspend context of a thread */
3408 @REQ(set_suspend_context)
3409     VARARG(context,context);   /* thread context */
3410 @END