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