Avoid ftruncate to work around broken UMSDOS file system.
[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
11 @HEADER  /* start of C declarations */
12
13 #include <stdlib.h>
14 #include <time.h>
15 #include "winbase.h"
16
17 struct request_header
18 {
19     int            req;          /* request code */
20     unsigned short var_offset;   /* offset of the variable part of the request */
21     unsigned short var_size;     /* size of the variable part of the request */
22     unsigned int   error;        /* error result */
23 };
24
25 struct reply_header
26 {
27     unsigned int   error;        /* error result */
28     unsigned short var_offset;   /* offset of the variable part of the request */
29     unsigned short var_size;     /* size of the variable part of the request */
30 };
31
32 /* placeholder structure for the maximum allowed request size */
33 /* this is used to construct the generic_request union */
34 struct request_max_size
35 {
36     int pad[16]; /* the max request size is 16 ints */
37 };
38
39 /* max size of the variable part of a request */
40 #define REQUEST_MAX_VAR_SIZE  1024
41
42 typedef int handle_t;
43 typedef unsigned short atom_t;
44 typedef unsigned int user_handle_t;
45
46 #define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
47 #define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */
48
49
50 /* definitions of the event data depending on the event code */
51 struct debug_event_exception
52 {
53     EXCEPTION_RECORD record;   /* exception record */
54     int              first;    /* first chance exception? */
55 };
56 struct debug_event_create_thread
57 {
58     handle_t    handle;     /* handle to the new thread */
59     void       *teb;        /* thread teb (in debugged process address space) */
60     void       *start;      /* thread startup routine */
61 };
62 struct debug_event_create_process
63 {
64     handle_t    file;       /* handle to the process exe file */
65     handle_t    process;    /* handle to the new process */
66     handle_t    thread;     /* handle to the new thread */
67     void       *base;       /* base of executable image */
68     int         dbg_offset; /* offset of debug info in file */
69     int         dbg_size;   /* size of debug info */
70     void       *teb;        /* thread teb (in debugged process address space) */
71     void       *start;      /* thread startup routine */
72     void       *name;       /* image name (optional) */
73     int         unicode;    /* is it Unicode? */
74 };
75 struct debug_event_exit
76 {
77     int         exit_code;  /* thread or process exit code */
78 };
79 struct debug_event_load_dll
80 {
81     handle_t    handle;     /* file handle for the dll */
82     void       *base;       /* base address of the dll */
83     int         dbg_offset; /* offset of debug info in file */
84     int         dbg_size;   /* size of debug info */
85     void       *name;       /* image name (optional) */
86     int         unicode;    /* is it Unicode? */
87 };
88 struct debug_event_unload_dll
89 {
90     void       *base;       /* base address of the dll */
91 };
92 struct debug_event_output_string
93 {
94     void       *string;     /* string to display (in debugged process address space) */
95     int         unicode;    /* is it Unicode? */
96     int         length;     /* string length */
97 };
98 struct debug_event_rip_info
99 {
100     int         error;      /* ??? */
101     int         type;       /* ??? */
102 };
103 union debug_event_data
104 {
105     struct debug_event_exception      exception;
106     struct debug_event_create_thread  create_thread;
107     struct debug_event_create_process create_process;
108     struct debug_event_exit           exit;
109     struct debug_event_load_dll       load_dll;
110     struct debug_event_unload_dll     unload_dll;
111     struct debug_event_output_string  output_string;
112     struct debug_event_rip_info       rip_info;
113 };
114
115 /* debug event data */
116 typedef struct
117 {
118     int                      code;   /* event code */
119     union debug_event_data   info;   /* event information */
120 } debug_event_t;
121
122 /* structure used in sending an fd from client to server */
123 struct send_fd
124 {
125     void  *tid;  /* thread id */
126     int    fd;   /* file descriptor on client-side */
127 };
128
129 /* structure sent by the server on the wait fifo */
130 struct wake_up_reply
131 {
132     void *cookie;    /* magic cookie that was passed in select_request */
133     int   signaled;  /* wait result */
134 };
135
136 /* structure returned in the list of window properties */
137 typedef struct
138 {
139     atom_t         atom;     /* property atom */
140     short          string;   /* was atom a string originally? */
141     handle_t       handle;   /* handle stored in property */
142 } property_data_t;
143
144 /* structure to specify window rectangles */
145 typedef struct
146 {
147     int  left;
148     int  top;
149     int  right;
150     int  bottom;
151 } rectangle_t;
152
153 /****************************************************************/
154 /* Request declarations */
155
156 /* Create a new process from the context of the parent */
157 @REQ(new_process)
158     int          inherit_all;  /* inherit all handles from parent */
159     int          create_flags; /* creation flags */
160     int          start_flags;  /* flags from startup info */
161     handle_t     exe_file;     /* file handle for main exe */
162     handle_t     hstdin;       /* handle for stdin */
163     handle_t     hstdout;      /* handle for stdout */
164     handle_t     hstderr;      /* handle for stderr */
165     int          cmd_show;     /* main window show mode */
166     VARARG(filename,string);   /* file name of main exe */
167 @REPLY
168     handle_t     info;         /* new process info handle */
169 @END
170
171
172 /* Retrieve information about a newly started process */
173 @REQ(get_new_process_info)
174     handle_t     info;         /* info handle returned from new_process_request */
175     int          pinherit;     /* process handle inherit flag */
176     int          tinherit;     /* thread handle inherit flag */
177 @REPLY
178     void*        pid;          /* process id */
179     handle_t     phandle;      /* process handle (in the current process) */
180     void*        tid;          /* thread id */
181     handle_t     thandle;      /* thread handle (in the current process) */
182     handle_t     event;        /* event handle to signal startup */
183 @END
184
185
186 /* Create a new thread from the context of the parent */
187 @REQ(new_thread)
188     int          suspend;      /* new thread should be suspended on creation */
189     int          inherit;      /* inherit flag */
190     int          request_fd;   /* fd for request pipe */
191 @REPLY
192     void*        tid;          /* thread id */
193     handle_t     handle;       /* thread handle (in the current process) */
194 @END
195
196
197 /* Signal that we are finished booting on the client side */
198 @REQ(boot_done)
199     int          debug_level;  /* new debug level */
200 @END
201
202
203 /* Initialize a process; called from the new process context */
204 @REQ(init_process)
205     void*        ldt_copy;     /* addr of LDT copy */
206     int          ppid;         /* parent Unix pid */
207 @REPLY
208     int          create_flags; /* creation flags */
209     int          start_flags;  /* flags from startup info */
210     unsigned int server_start; /* server start time (GetTickCount) */
211     handle_t     exe_file;     /* file handle for main exe */
212     handle_t     hstdin;       /* handle for stdin */
213     handle_t     hstdout;      /* handle for stdout */
214     handle_t     hstderr;      /* handle for stderr */
215     int          cmd_show;     /* main window show mode */
216     VARARG(filename,string);   /* file name of main exe */
217 @END
218
219
220 /* Signal the end of the process initialization */
221 @REQ(init_process_done)
222     void*        module;       /* main module base address */
223     void*        entry;        /* process entry point */
224     void*        name;         /* ptr to ptr to name (in process addr space) */
225     handle_t     exe_file;     /* file handle for main exe */
226     int          gui;          /* is it a GUI process? */
227 @REPLY
228     int          debugged;     /* being debugged? */
229 @END
230
231
232 /* Initialize a thread; called from the child after fork()/clone() */
233 @REQ(init_thread)
234     int          unix_pid;     /* Unix pid of new thread */
235     void*        teb;          /* TEB of new thread (in thread address space) */
236     void*        entry;        /* thread entry point (in thread address space) */
237     int          reply_fd;     /* fd for reply pipe */
238     int          wait_fd;      /* fd for blocking calls pipe */
239 @REPLY
240     void*        pid;          /* process id of the new thread's process */
241     void*        tid;          /* thread id of the new thread */
242     int          boot;         /* is this the boot thread? */
243     int          version;      /* protocol version */
244 @END
245
246
247 /* Set the shared buffer for a thread */
248 @REQ(set_thread_buffer)
249     int          fd;           /* fd to mmap as shared buffer */
250 @REPLY
251     unsigned int offset;       /* offset of buffer in file */
252     unsigned int size;         /* size of buffer */
253 @END
254
255
256 /* Terminate a process */
257 @REQ(terminate_process)
258     handle_t     handle;       /* process handle to terminate */
259     int          exit_code;    /* process exit code */
260 @REPLY
261     int          self;         /* suicide? */
262 @END
263
264
265 /* Terminate a thread */
266 @REQ(terminate_thread)
267     handle_t     handle;       /* thread handle to terminate */
268     int          exit_code;    /* thread exit code */
269 @REPLY
270     int          self;         /* suicide? */
271     int          last;         /* last thread in this process? */
272 @END
273
274
275 /* Retrieve information about a process */
276 @REQ(get_process_info)
277     handle_t     handle;           /* process handle */
278 @REPLY
279     void*        pid;              /* server process id */
280     int          debugged;         /* debugged? */
281     int          exit_code;        /* process exit code */
282     int          priority;         /* priority class */
283     int          process_affinity; /* process affinity mask */
284     int          system_affinity;  /* system affinity mask */
285 @END
286
287
288 /* Set a process informations */
289 @REQ(set_process_info)
290     handle_t     handle;       /* process handle */
291     int          mask;         /* setting mask (see below) */
292     int          priority;     /* priority class */
293     int          affinity;     /* affinity mask */
294 @END
295 #define SET_PROCESS_INFO_PRIORITY 0x01
296 #define SET_PROCESS_INFO_AFFINITY 0x02
297
298
299 /* Retrieve information about a thread */
300 @REQ(get_thread_info)
301     handle_t     handle;       /* thread handle */
302     void*        tid_in;       /* thread id (optional) */
303 @REPLY
304     void*        tid;          /* server thread id */
305     void*        teb;          /* thread teb pointer */
306     int          exit_code;    /* thread exit code */
307     int          priority;     /* thread priority level */
308 @END
309
310
311 /* Set a thread informations */
312 @REQ(set_thread_info)
313     handle_t     handle;       /* thread handle */
314     int          mask;         /* setting mask (see below) */
315     int          priority;     /* priority class */
316     int          affinity;     /* affinity mask */
317 @END
318 #define SET_THREAD_INFO_PRIORITY 0x01
319 #define SET_THREAD_INFO_AFFINITY 0x02
320
321
322 /* Suspend a thread */
323 @REQ(suspend_thread)
324     handle_t     handle;       /* thread handle */
325 @REPLY
326     int          count;        /* new suspend count */
327 @END
328
329
330 /* Resume a thread */
331 @REQ(resume_thread)
332     handle_t     handle;       /* thread handle */
333 @REPLY
334     int          count;        /* new suspend count */
335 @END
336
337
338 /* Notify the server that a dll has been loaded */
339 @REQ(load_dll)
340     handle_t     handle;       /* file handle */
341     void*        base;         /* base address */
342     int          dbg_offset;   /* debug info offset */
343     int          dbg_size;     /* debug info size */
344     void*        name;         /* ptr to ptr to name (in process addr space) */
345 @END
346
347
348 /* Notify the server that a dll is being unloaded */
349 @REQ(unload_dll)
350     void*        base;         /* base address */
351 @END
352
353
354 /* Queue an APC for a thread */
355 @REQ(queue_apc)
356     handle_t     handle;       /* thread handle */
357     int          user;         /* user or system apc? */
358     void*        func;         /* function to call */
359     void*        param;        /* param for function to call */
360 @END
361
362
363 /* Get next APC to call */
364 @REQ(get_apc)
365     int          alertable;    /* is thread alertable? */
366 @REPLY
367     void*        func;         /* function to call */
368     int          type;         /* function type */
369     VARARG(args,ptrs);         /* function arguments */
370 @END
371 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
372
373
374 /* Close a handle for the current process */
375 @REQ(close_handle)
376     handle_t     handle;       /* handle to close */
377 @REPLY
378     int          fd;           /* associated fd to close */
379 @END
380
381
382 /* Set a handle information */
383 @REQ(set_handle_info)
384     handle_t     handle;       /* handle we are interested in */
385     int          flags;        /* new handle flags */
386     int          mask;         /* mask for flags to set */
387     int          fd;           /* file descriptor or -1 */
388 @REPLY
389     int          old_flags;    /* old flag value */
390     int          cur_fd;       /* current file descriptor */
391 @END
392
393
394 /* Duplicate a handle */
395 @REQ(dup_handle)
396     handle_t     src_process;  /* src process handle */
397     handle_t     src_handle;   /* src handle to duplicate */
398     handle_t     dst_process;  /* dst process handle */
399     unsigned int access;       /* wanted access rights */
400     int          inherit;      /* inherit flag */
401     int          options;      /* duplicate options (see below) */
402 @REPLY
403     handle_t     handle;       /* duplicated handle in dst process */
404     int          fd;           /* associated fd to close */
405 @END
406 #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
407 #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
408 #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */
409
410
411 /* Open a handle to a process */
412 @REQ(open_process)
413     void*        pid;          /* process id to open */
414     unsigned int access;       /* wanted access rights */
415     int          inherit;      /* inherit flag */
416 @REPLY
417     handle_t     handle;       /* handle to the process */
418 @END
419
420
421 /* Wait for handles */
422 @REQ(select)
423     int          flags;        /* wait flags (see below) */
424     void*        cookie;       /* magic cookie to return to client */
425     int          sec;          /* absolute timeout */
426     int          usec;         /* absolute timeout */
427     VARARG(handles,handles);   /* handles to select on */
428 @END
429 #define SELECT_ALL           1
430 #define SELECT_ALERTABLE     2
431 #define SELECT_INTERRUPTIBLE 4
432 #define SELECT_TIMEOUT       8
433
434
435 /* Create an event */
436 @REQ(create_event)
437     int          manual_reset;  /* manual reset event */
438     int          initial_state; /* initial state of the event */
439     int          inherit;       /* inherit flag */
440     VARARG(name,unicode_str);   /* object name */
441 @REPLY
442     handle_t     handle;        /* handle to the event */
443 @END
444
445 /* Event operation */
446 @REQ(event_op)
447     handle_t      handle;       /* handle to event */
448     int           op;           /* event operation (see below) */
449 @END
450 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
451
452
453 /* Open an event */
454 @REQ(open_event)
455     unsigned int access;        /* wanted access rights */
456     int          inherit;       /* inherit flag */
457     VARARG(name,unicode_str);   /* object name */
458 @REPLY
459     handle_t     handle;        /* handle to the event */
460 @END
461
462
463 /* Create a mutex */
464 @REQ(create_mutex)
465     int          owned;         /* initially owned? */
466     int          inherit;       /* inherit flag */
467     VARARG(name,unicode_str);   /* object name */
468 @REPLY
469     handle_t     handle;        /* handle to the mutex */
470 @END
471
472
473 /* Release a mutex */
474 @REQ(release_mutex)
475     handle_t     handle;        /* handle to the mutex */
476 @END
477
478
479 /* Open a mutex */
480 @REQ(open_mutex)
481     unsigned int access;        /* wanted access rights */
482     int          inherit;       /* inherit flag */
483     VARARG(name,unicode_str);   /* object name */
484 @REPLY
485     handle_t     handle;        /* handle to the mutex */
486 @END
487
488
489 /* Create a semaphore */
490 @REQ(create_semaphore)
491     unsigned int initial;       /* initial count */
492     unsigned int max;           /* maximum count */
493     int          inherit;       /* inherit flag */
494     VARARG(name,unicode_str);   /* object name */
495 @REPLY
496     handle_t     handle;        /* handle to the semaphore */
497 @END
498
499
500 /* Release a semaphore */
501 @REQ(release_semaphore)
502     handle_t     handle;        /* handle to the semaphore */
503     unsigned int count;         /* count to add to semaphore */
504 @REPLY
505     unsigned int prev_count;    /* previous semaphore count */
506 @END
507
508
509 /* Open a semaphore */
510 @REQ(open_semaphore)
511     unsigned int access;        /* wanted access rights */
512     int          inherit;       /* inherit flag */
513     VARARG(name,unicode_str);   /* object name */
514 @REPLY
515     handle_t     handle;        /* handle to the semaphore */
516 @END
517
518
519 /* Create a file */
520 @REQ(create_file)
521     unsigned int access;        /* wanted access rights */
522     int          inherit;       /* inherit flag */
523     unsigned int sharing;       /* sharing flags */
524     int          create;        /* file create action */
525     unsigned int attrs;         /* file attributes for creation */
526     int          drive_type;    /* type of drive the file is on */
527     VARARG(filename,string);    /* file name */
528 @REPLY
529     handle_t     handle;        /* handle to the file */
530 @END
531
532
533 /* Allocate a file handle for a Unix fd */
534 @REQ(alloc_file_handle)
535     unsigned int access;        /* wanted access rights */
536     int          fd;            /* file descriptor on the client side */
537 @REPLY
538     handle_t     handle;        /* handle to the file */
539 @END
540
541
542 /* Get a Unix fd to access a file */
543 @REQ(get_handle_fd)
544     handle_t     handle;        /* handle to the file */
545     unsigned int access;        /* wanted access rights */
546 @REPLY
547     int          fd;            /* file descriptor */
548     int          type;          /* the type of file */
549 @END
550 #define FD_TYPE_INVALID    0
551 #define FD_TYPE_DEFAULT    1
552 #define FD_TYPE_CONSOLE    2
553 #define FD_TYPE_OVERLAPPED 3
554 #define FD_TYPE_TIMEOUT    4
555
556
557 /* Set a file current position */
558 @REQ(set_file_pointer)
559     handle_t     handle;        /* handle to the file */
560     int          low;           /* position low word */
561     int          high;          /* position high word */
562     int          whence;        /* whence to seek */
563 @REPLY
564     int          new_low;       /* new position low word */
565     int          new_high;      /* new position high word */
566 @END
567
568
569 /* Truncate (or extend) a file */
570 @REQ(truncate_file)
571     handle_t     handle;        /* handle to the file */
572 @END
573
574
575 /* Set a file access and modification times */
576 @REQ(set_file_time)
577     handle_t     handle;        /* handle to the file */
578     time_t       access_time;   /* last access time */
579     time_t       write_time;    /* last write time */
580 @END
581
582
583 /* Flush a file buffers */
584 @REQ(flush_file)
585     handle_t     handle;        /* handle to the file */
586 @END
587
588
589 /* Get information about a file */
590 @REQ(get_file_info)
591     handle_t     handle;        /* handle to the file */
592 @REPLY
593     int          type;          /* file type */
594     int          attr;          /* file attributes */
595     time_t       access_time;   /* last access time */
596     time_t       write_time;    /* last write time */
597     int          size_high;     /* file size */
598     int          size_low;      /* file size */
599     int          links;         /* number of links */
600     int          index_high;    /* unique index */
601     int          index_low;     /* unique index */
602     unsigned int serial;        /* volume serial number */
603 @END
604
605
606 /* Lock a region of a file */
607 @REQ(lock_file)
608     handle_t     handle;        /* handle to the file */
609     unsigned int offset_low;    /* offset of start of lock */
610     unsigned int offset_high;   /* offset of start of lock */
611     unsigned int count_low;     /* count of bytes to lock */
612     unsigned int count_high;    /* count of bytes to lock */
613 @END
614
615
616 /* Unlock a region of a file */
617 @REQ(unlock_file)
618     handle_t     handle;        /* handle to the file */
619     unsigned int offset_low;    /* offset of start of unlock */
620     unsigned int offset_high;   /* offset of start of unlock */
621     unsigned int count_low;     /* count of bytes to unlock */
622     unsigned int count_high;    /* count of bytes to unlock */
623 @END
624
625
626 /* Create an anonymous pipe */
627 @REQ(create_pipe)
628     int          inherit;       /* inherit flag */
629 @REPLY
630     handle_t     handle_read;   /* handle to the read-side of the pipe */
631     handle_t     handle_write;  /* handle to the write-side of the pipe */
632 @END
633
634
635 /* Create a socket */
636 @REQ(create_socket)
637     unsigned int access;        /* wanted access rights */
638     int          inherit;       /* inherit flag */
639     int          family;        /* family, see socket manpage */
640     int          type;          /* type, see socket manpage */
641     int          protocol;      /* protocol, see socket manpage */
642 @REPLY
643     handle_t     handle;        /* handle to the new socket */
644 @END
645
646
647 /* Accept a socket */
648 @REQ(accept_socket)
649     handle_t     lhandle;       /* handle to the listening socket */
650     unsigned int access;        /* wanted access rights */
651     int          inherit;       /* inherit flag */
652 @REPLY
653     handle_t     handle;        /* handle to the new socket */
654 @END
655
656
657 /* Set socket event parameters */
658 @REQ(set_socket_event)
659     handle_t     handle;        /* handle to the socket */
660     unsigned int mask;          /* event mask */
661     handle_t     event;         /* event object */
662 @END
663
664
665 /* Get socket event parameters */
666 @REQ(get_socket_event)
667     handle_t     handle;        /* handle to the socket */
668     int          service;       /* clear pending? */
669     handle_t     s_event;       /* "expected" event object */
670     handle_t     c_event;       /* event to clear */
671 @REPLY
672     unsigned int mask;          /* event mask */
673     unsigned int pmask;         /* pending events */
674     unsigned int state;         /* status bits */
675     VARARG(errors,ints);        /* event errors */
676 @END
677
678
679 /* Reenable pending socket events */
680 @REQ(enable_socket_event)
681     handle_t     handle;        /* handle to the socket */
682     unsigned int mask;          /* events to re-enable */
683     unsigned int sstate;        /* status bits to set */
684     unsigned int cstate;        /* status bits to clear */
685 @END
686
687
688 /* Allocate a console for the current process */
689 @REQ(alloc_console)
690     unsigned int access;        /* wanted access rights */
691     int          inherit;       /* inherit flag */
692 @REPLY
693     handle_t     handle_in;     /* handle to console input */
694     handle_t     handle_out;    /* handle to console output */
695 @END
696
697
698 /* Free the console of the current process */
699 @REQ(free_console)
700 @END
701
702
703 /* Open a handle to the process console */
704 @REQ(open_console)
705     int          output;        /* input or output? */
706     unsigned int access;        /* wanted access rights */
707     int          inherit;       /* inherit flag */
708 @REPLY
709     handle_t     handle;        /* handle to the console */
710 @END
711
712
713 /* Set a console file descriptor */
714 @REQ(set_console_fd)
715     handle_t     handle;        /* handle to the console */
716     int          fd_in;         /* file descriptor to use as input */
717     int          fd_out;        /* file descriptor to use as output */
718     int          pid;           /* pid of xterm (hack) */
719 @END
720
721
722 /* Get a console mode (input or output) */
723 @REQ(get_console_mode)
724     handle_t     handle;        /* handle to the console */
725 @REPLY
726     int          mode;          /* console mode */
727 @END
728
729
730 /* Set a console mode (input or output) */
731 @REQ(set_console_mode)
732     handle_t     handle;        /* handle to the console */
733     int          mode;          /* console mode */
734 @END
735
736
737 /* Set info about a console (output only) */
738 @REQ(set_console_info)
739     handle_t     handle;        /* handle to the console */
740     int          mask;          /* setting mask (see below) */
741     int          cursor_size;   /* size of cursor (percentage filled) */
742     int          cursor_visible;/* cursor visibility flag */
743     VARARG(title,string);       /* console title */
744 @END
745 #define SET_CONSOLE_INFO_CURSOR 0x01
746 #define SET_CONSOLE_INFO_TITLE  0x02
747
748 /* Get info about a console (output only) */
749 @REQ(get_console_info)
750     handle_t     handle;        /* handle to the console */
751 @REPLY
752     int          cursor_size;   /* size of cursor (percentage filled) */
753     int          cursor_visible;/* cursor visibility flag */
754     int          pid;           /* pid of xterm (hack) */
755     VARARG(title,string);       /* console title */
756 @END
757
758
759 /* Add input records to a console input queue */
760 @REQ(write_console_input)
761     handle_t     handle;        /* handle to the console input */
762     VARARG(rec,input_records);  /* input records */
763 @REPLY
764     int          written;       /* number of records written */
765 @END
766
767 /* Fetch input records from a console input queue */
768 @REQ(read_console_input)
769     handle_t     handle;        /* handle to the console input */
770     int          flush;         /* flush the retrieved records from the queue? */
771 @REPLY
772     int          read;          /* number of records read */
773     VARARG(rec,input_records);  /* input records */
774 @END
775
776
777 /* Create a change notification */
778 @REQ(create_change_notification)
779     int          subtree;       /* watch all the subtree */
780     int          filter;        /* notification filter */
781 @REPLY
782     handle_t     handle;        /* handle to the change notification */
783 @END
784
785
786 /* Create a file mapping */
787 @REQ(create_mapping)
788     int          size_high;     /* mapping size */
789     int          size_low;      /* mapping size */
790     int          protect;       /* protection flags (see below) */
791     int          inherit;       /* inherit flag */
792     handle_t     file_handle;   /* file handle */
793     VARARG(name,unicode_str);   /* object name */
794 @REPLY
795     handle_t     handle;        /* handle to the mapping */
796 @END
797 /* protection flags */
798 #define VPROT_READ       0x01
799 #define VPROT_WRITE      0x02
800 #define VPROT_EXEC       0x04
801 #define VPROT_WRITECOPY  0x08
802 #define VPROT_GUARD      0x10
803 #define VPROT_NOCACHE    0x20
804 #define VPROT_COMMITTED  0x40
805 #define VPROT_IMAGE      0x80
806
807
808 /* Open a mapping */
809 @REQ(open_mapping)
810     unsigned int access;        /* wanted access rights */
811     int          inherit;       /* inherit flag */
812     VARARG(name,unicode_str);   /* object name */
813 @REPLY
814     handle_t     handle;        /* handle to the mapping */
815 @END
816
817
818 /* Get information about a file mapping */
819 @REQ(get_mapping_info)
820     handle_t     handle;        /* handle to the mapping */
821 @REPLY
822     int          size_high;     /* mapping size */
823     int          size_low;      /* mapping size */
824     int          protect;       /* protection flags */
825     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
826     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
827     handle_t     shared_file;   /* shared mapping file handle */
828     int          shared_size;   /* shared mapping size */
829     int          drive_type;    /* type of drive the file is on */
830 @END
831
832
833 /* Create a device */
834 @REQ(create_device)
835     unsigned int access;        /* wanted access rights */
836     int          inherit;       /* inherit flag */
837     int          id;            /* client private id */
838 @REPLY
839     handle_t     handle;        /* handle to the device */
840 @END
841
842
843 /* Create a snapshot */
844 @REQ(create_snapshot)
845     int          inherit;       /* inherit flag */
846     int          flags;         /* snapshot flags (TH32CS_*) */
847     void*        pid;           /* process id */
848 @REPLY
849     handle_t     handle;        /* handle to the snapshot */
850 @END
851
852
853 /* Get the next process from a snapshot */
854 @REQ(next_process)
855     handle_t     handle;        /* handle to the snapshot */
856     int          reset;         /* reset snapshot position? */
857 @REPLY
858     int          count;         /* process usage count */
859     void*        pid;           /* process id */
860     int          threads;       /* number of threads */
861     int          priority;      /* process priority */
862 @END
863
864
865 /* Get the next thread from a snapshot */
866 @REQ(next_thread)
867     handle_t     handle;        /* handle to the snapshot */
868     int          reset;         /* reset snapshot position? */
869 @REPLY
870     int          count;         /* thread usage count */
871     void*        pid;           /* process id */
872     void*        tid;           /* thread id */
873     int          base_pri;      /* base priority */
874     int          delta_pri;     /* delta priority */
875 @END
876
877
878 /* Get the next module from a snapshot */
879 @REQ(next_module)
880     handle_t     handle;        /* handle to the snapshot */
881     int          reset;         /* reset snapshot position? */
882 @REPLY
883     void*        pid;           /* process id */
884     void*        base;          /* module base address */
885 @END
886
887
888 /* Wait for a debug event */
889 @REQ(wait_debug_event)
890     int           get_handle;  /* should we alloc a handle for waiting? */
891 @REPLY
892     void*         pid;         /* process id */
893     void*         tid;         /* thread id */
894     handle_t      wait;        /* wait handle if no event ready */
895     VARARG(event,debug_event); /* debug event data */
896 @END
897
898
899 /* Queue an exception event */
900 @REQ(queue_exception_event)
901     int              first;    /* first chance exception? */
902     VARARG(record,exc_event);  /* thread context followed by exception record */
903 @REPLY
904     handle_t         handle;   /* handle to the queued event */
905 @END
906
907
908 /* Retrieve the status of an exception event */
909 @REQ(get_exception_status)
910 @REPLY
911     handle_t         handle;   /* handle to the queued event */
912     int              status;   /* event continuation status */
913     VARARG(context,context);   /* modified thread context */
914 @END
915
916
917 /* Send an output string to the debugger */
918 @REQ(output_debug_string)
919     void*         string;      /* string to display (in debugged process address space) */
920     int           unicode;     /* is it Unicode? */
921     int           length;      /* string length */
922 @END
923
924
925 /* Continue a debug event */
926 @REQ(continue_debug_event)
927     void*        pid;          /* process id to continue */
928     void*        tid;          /* thread id to continue */
929     int          status;       /* continuation status */
930 @END
931
932
933 /* Start debugging an existing process */
934 @REQ(debug_process)
935     void*        pid;          /* id of the process to debug */
936 @END
937
938
939 /* Read data from a process address space */
940 @REQ(read_process_memory)
941     handle_t     handle;       /* process handle */
942     void*        addr;         /* addr to read from (must be int-aligned) */
943     int          len;          /* number of ints to read */
944 @REPLY
945     VARARG(data,bytes);        /* result data */
946 @END
947
948
949 /* Write data to a process address space */
950 @REQ(write_process_memory)
951     handle_t     handle;       /* process handle */
952     void*        addr;         /* addr to write to (must be int-aligned) */
953     int          len;          /* number of ints to write */
954     unsigned int first_mask;   /* mask for first word */
955     unsigned int last_mask;    /* mask for last word */
956     VARARG(data,bytes);        /* result data */
957 @END
958
959
960 /* Create a registry key */
961 @REQ(create_key)
962     handle_t     parent;       /* handle to the parent key */
963     unsigned int access;       /* desired access rights */
964     unsigned int options;      /* creation options */
965     time_t       modif;        /* last modification time */
966     VARARG(name,unicode_len_str);  /* key name */
967     VARARG(class,unicode_str);     /* class name */
968 @REPLY
969     handle_t     hkey;         /* handle to the created key */
970     int          created;      /* has it been newly created? */
971 @END
972
973 /* Open a registry key */
974 @REQ(open_key)
975     handle_t     parent;       /* handle to the parent key */
976     unsigned int access;       /* desired access rights */
977     VARARG(name,unicode_str);  /* key name */
978 @REPLY
979     handle_t     hkey;         /* handle to the open key */
980 @END
981
982
983 /* Delete a registry key */
984 @REQ(delete_key)
985     handle_t     hkey;         /* handle to the key */
986 @END
987
988
989 /* Enumerate registry subkeys */
990 @REQ(enum_key)
991     handle_t     hkey;         /* handle to registry key */
992     int          index;        /* index of subkey (or -1 for current key) */
993     int          full;         /* return the full info? */
994 @REPLY
995     int          subkeys;      /* number of subkeys */
996     int          max_subkey;   /* longest subkey name */
997     int          max_class;    /* longest class name */
998     int          values;       /* number of values */
999     int          max_value;    /* longest value name */
1000     int          max_data;     /* longest value data */
1001     time_t       modif;        /* last modification time */
1002     VARARG(name,unicode_len_str);  /* key name */
1003     VARARG(class,unicode_str);     /* class name */
1004 @END
1005
1006
1007 /* Set a value of a registry key */
1008 @REQ(set_key_value)
1009     handle_t     hkey;         /* handle to registry key */
1010     int          type;         /* value type */
1011     unsigned int total;        /* total value len */
1012     unsigned int offset;       /* offset for setting data */
1013     VARARG(name,unicode_len_str);  /* value name */
1014     VARARG(data,bytes);        /* value data */
1015 @END
1016
1017
1018 /* Retrieve the value of a registry key */
1019 @REQ(get_key_value)
1020     handle_t     hkey;         /* handle to registry key */
1021     unsigned int offset;       /* offset for getting data */
1022     VARARG(name,unicode_len_str);  /* value name */
1023 @REPLY
1024     int          type;         /* value type */
1025     int          len;          /* value data len */
1026     VARARG(data,bytes);        /* value data */
1027 @END
1028
1029
1030 /* Enumerate a value of a registry key */
1031 @REQ(enum_key_value)
1032     handle_t     hkey;         /* handle to registry key */
1033     int          index;        /* value index */
1034     unsigned int offset;       /* offset for getting data */
1035 @REPLY
1036     int          type;         /* value type */
1037     int          len;          /* value data len */
1038     VARARG(name,unicode_len_str);  /* value name */
1039     VARARG(data,bytes);        /* value data */
1040 @END
1041
1042
1043 /* Delete a value of a registry key */
1044 @REQ(delete_key_value)
1045     handle_t     hkey;         /* handle to registry key */
1046     VARARG(name,unicode_str);  /* value name */
1047 @END
1048
1049
1050 /* Load a registry branch from a file */
1051 @REQ(load_registry)
1052     handle_t     hkey;         /* root key to load to */
1053     handle_t     file;         /* file to load from */
1054     VARARG(name,unicode_str);  /* subkey name */
1055 @END
1056
1057
1058 /* Save a registry branch to a file */
1059 @REQ(save_registry)
1060     handle_t     hkey;         /* key to save */
1061     handle_t     file;         /* file to save to */
1062 @END
1063
1064
1065 /* Save a registry branch at server exit */
1066 @REQ(save_registry_atexit)
1067     handle_t     hkey;         /* key to save */
1068     VARARG(file,string);       /* file to save to */
1069 @END
1070
1071
1072 /* Set the current and saving level for the registry */
1073 @REQ(set_registry_levels)
1074     int          current;      /* new current level */
1075     int          saving;       /* new saving level */
1076     int          period;       /* duration between periodic saves (milliseconds) */
1077 @END
1078
1079
1080 /* Create a waitable timer */
1081 @REQ(create_timer)
1082     int          inherit;       /* inherit flag */
1083     int          manual;        /* manual reset */
1084     VARARG(name,unicode_str);   /* object name */
1085 @REPLY
1086     handle_t     handle;        /* handle to the timer */
1087 @END
1088
1089
1090 /* Open a waitable timer */
1091 @REQ(open_timer)
1092     unsigned int access;        /* wanted access rights */
1093     int          inherit;       /* inherit flag */
1094     VARARG(name,unicode_str);   /* object name */
1095 @REPLY
1096     handle_t     handle;        /* handle to the timer */
1097 @END
1098
1099 /* Set a waitable timer */
1100 @REQ(set_timer)
1101     handle_t     handle;        /* handle to the timer */
1102     int          sec;           /* next expiration absolute time */
1103     int          usec;          /* next expiration absolute time */
1104     int          period;        /* timer period in ms */
1105     void*        callback;      /* callback function */
1106     void*        arg;           /* callback argument */
1107 @END
1108
1109 /* Cancel a waitable timer */
1110 @REQ(cancel_timer)
1111     handle_t     handle;        /* handle to the timer */
1112 @END
1113
1114
1115 /* Retrieve the current context of a thread */
1116 @REQ(get_thread_context)
1117     handle_t     handle;       /* thread handle */
1118     unsigned int flags;        /* context flags */
1119 @REPLY
1120     VARARG(context,context);   /* thread context */
1121 @END
1122
1123
1124 /* Set the current context of a thread */
1125 @REQ(set_thread_context)
1126     handle_t     handle;       /* thread handle */
1127     unsigned int flags;        /* context flags */
1128     VARARG(context,context);   /* thread context */
1129 @END
1130
1131
1132 /* Fetch a selector entry for a thread */
1133 @REQ(get_selector_entry)
1134     handle_t      handle;      /* thread handle */
1135     int           entry;       /* LDT entry */
1136 @REPLY
1137     unsigned int  base;        /* selector base */
1138     unsigned int  limit;       /* selector limit */
1139     unsigned char flags;       /* selector flags */
1140 @END
1141
1142
1143 /* Add an atom */
1144 @REQ(add_atom)
1145     int           local;       /* is atom in local process table? */
1146     VARARG(name,unicode_str);  /* atom name */
1147 @REPLY
1148     atom_t        atom;        /* resulting atom */
1149 @END
1150
1151
1152 /* Delete an atom */
1153 @REQ(delete_atom)
1154     atom_t        atom;        /* atom handle */
1155     int           local;       /* is atom in local process table? */
1156 @END
1157
1158
1159 /* Find an atom */
1160 @REQ(find_atom)
1161     int          local;        /* is atom in local process table? */
1162     VARARG(name,unicode_str);  /* atom name */
1163 @REPLY
1164     atom_t       atom;         /* atom handle */
1165 @END
1166
1167
1168 /* Get an atom name */
1169 @REQ(get_atom_name)
1170     atom_t       atom;         /* atom handle */
1171     int          local;        /* is atom in local process table? */
1172 @REPLY
1173     int          count;        /* atom lock count */
1174     VARARG(name,unicode_str);  /* atom name */
1175 @END
1176
1177
1178 /* Init the process atom table */
1179 @REQ(init_atom_table)
1180     int          entries;      /* number of entries */
1181 @END
1182
1183
1184 /* Get the message queue of the current thread */
1185 @REQ(get_msg_queue)
1186 @REPLY
1187     handle_t     handle;       /* handle to the queue */
1188 @END
1189
1190
1191 /* Increment the message queue paint count */
1192 @REQ(inc_queue_paint_count)
1193     void*           id;        /* thread id */
1194     int             incr;      /* increment (can be negative) */
1195 @END
1196
1197
1198 /* Set the current message queue wakeup mask */
1199 @REQ(set_queue_mask)
1200     unsigned int wake_mask;    /* wakeup bits mask */
1201     unsigned int changed_mask; /* changed bits mask */
1202     int          skip_wait;    /* will we skip waiting if signaled? */
1203 @REPLY
1204     unsigned int wake_bits;    /* current wake bits */
1205     unsigned int changed_bits; /* current changed bits */
1206 @END
1207
1208
1209 /* Get the current message queue status */
1210 @REQ(get_queue_status)
1211     int          clear;        /* should we clear the change bits? */
1212 @REPLY
1213     unsigned int wake_bits;    /* wake bits */
1214     unsigned int changed_bits; /* changed bits since last time */
1215 @END
1216
1217
1218 /* Wait for a process to start waiting on input */
1219 @REQ(wait_input_idle)
1220     handle_t     handle;       /* process handle */
1221     int          timeout;      /* timeout */
1222 @REPLY
1223     handle_t     event;        /* handle to idle event */
1224 @END
1225
1226
1227 /* Send a message to a thread queue */
1228 @REQ(send_message)
1229     void*           id;        /* thread id */
1230     int             type;      /* message type (see below) */
1231     user_handle_t   win;       /* window handle */
1232     unsigned int    msg;       /* message code */
1233     unsigned int    wparam;    /* parameters */
1234     unsigned int    lparam;    /* parameters */
1235     int             x;         /* x position */
1236     int             y;         /* y position */
1237     unsigned int    time;      /* message time */
1238     unsigned int    info;      /* extra info */
1239     int             timeout;   /* timeout for reply */
1240     VARARG(data,bytes);        /* message data for sent messages */
1241 @END
1242
1243 enum message_type
1244 {
1245     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1246     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1247     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1248     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1249     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1250     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1251     MSG_HARDWARE_RAW,   /* raw hardware message */
1252     MSG_HARDWARE_COOKED /* cooked hardware message */
1253 };
1254
1255
1256 /* Get a message from the current queue */
1257 @REQ(get_message)
1258     int             flags;     /* see below */
1259     user_handle_t   get_win;   /* window handle to get */
1260     unsigned int    get_first; /* first message code to get */
1261     unsigned int    get_last;  /* last message code to get */
1262 @REPLY
1263     int             type;      /* message type */
1264     user_handle_t   win;       /* window handle */
1265     unsigned int    msg;       /* message code */
1266     unsigned int    wparam;    /* parameters */
1267     unsigned int    lparam;    /* parameters */
1268     int             x;         /* x position */
1269     int             y;         /* y position */
1270     unsigned int    time;      /* message time */
1271     unsigned int    info;      /* extra info */
1272     VARARG(data,bytes);        /* message data for sent messages */
1273 @END
1274 #define GET_MSG_REMOVE      1  /* remove the message */
1275 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1276 #define GET_MSG_REMOVE_LAST 4  /* remove last message returned before checking for a new one */
1277
1278 /* Reply to a sent message */
1279 @REQ(reply_message)
1280     unsigned int    result;    /* message result */
1281     int             remove;    /* should we remove the message? */
1282     VARARG(data,bytes);        /* message data for sent messages */
1283 @END
1284
1285
1286 /* Retrieve the reply for the last message sent */
1287 @REQ(get_message_reply)
1288     int             cancel;    /* cancel message if not ready? */
1289 @REPLY
1290     unsigned int    result;    /* message result */
1291     VARARG(data,bytes);        /* message data for sent messages */
1292 @END
1293
1294
1295 /* Set a window timer */
1296 @REQ(set_win_timer)
1297     user_handle_t   win;       /* window handle */
1298     unsigned int    msg;       /* message to post */
1299     unsigned int    id;        /* timer id */
1300     unsigned int    rate;      /* timer rate in ms */
1301     unsigned int    lparam;    /* message lparam (callback proc) */
1302 @END
1303
1304
1305 /* Kill a window timer */
1306 @REQ(kill_win_timer)
1307     user_handle_t   win;       /* window handle */
1308     unsigned int    msg;       /* message to post */
1309     unsigned int    id;        /* timer id */
1310 @END
1311
1312
1313 /* Open a serial port */
1314 @REQ(create_serial)
1315     unsigned int access;       /* wanted access rights */
1316     int          inherit;      /* inherit flag */
1317     unsigned int attributes;   /* eg. FILE_FLAG_OVERLAPPED */
1318     unsigned int sharing;      /* sharing flags */
1319     VARARG(name,string);       /* file name */
1320 @REPLY
1321     handle_t     handle;       /* handle to the port */
1322 @END
1323
1324
1325 /* Retrieve info about a serial port */
1326 @REQ(get_serial_info)
1327     handle_t     handle;       /* handle to comm port */
1328 @REPLY
1329     unsigned int readinterval;
1330     unsigned int readconst;
1331     unsigned int readmult;
1332     unsigned int writeconst;
1333     unsigned int writemult;
1334     unsigned int eventmask;
1335     unsigned int commerror;
1336 @END
1337
1338
1339 /* Set info about a serial port */
1340 @REQ(set_serial_info)
1341     handle_t     handle;       /* handle to comm port */
1342     int          flags;        /* bitmask to set values (see below) */
1343     unsigned int readinterval;
1344     unsigned int readconst;
1345     unsigned int readmult;
1346     unsigned int writeconst;
1347     unsigned int writemult;
1348     unsigned int eventmask;
1349     unsigned int commerror;
1350 @END
1351 #define SERIALINFO_SET_TIMEOUTS  0x01
1352 #define SERIALINFO_SET_MASK      0x02
1353 #define SERIALINFO_SET_ERROR     0x04
1354
1355
1356 /* Create an async I/O */
1357 @REQ(create_async)
1358     handle_t     file_handle;  /* handle to comm port, socket or file */
1359     int          count;
1360     int          type;
1361 @REPLY
1362     int          timeout;
1363 @END
1364 #define ASYNC_TYPE_READ  0x01
1365 #define ASYNC_TYPE_WRITE 0x02
1366 #define ASYNC_TYPE_WAIT  0x03
1367
1368
1369 /* Create a named pipe */
1370 @REQ(create_named_pipe)
1371     unsigned int   openmode;
1372     unsigned int   pipemode;
1373     unsigned int   maxinstances;
1374     unsigned int   outsize;
1375     unsigned int   insize;
1376     unsigned int   timeout;
1377     VARARG(filename,string);    /* pipe name */
1378 @REPLY
1379     handle_t       handle;     /* handle to the pipe */
1380 @END
1381
1382
1383 /* Open an existing named pipe */
1384 @REQ(open_named_pipe)
1385     unsigned int   access;
1386     VARARG(filename,string);    /* pipe name */
1387 @REPLY
1388     handle_t       handle;     /* handle to the pipe */
1389 @END
1390
1391
1392 /* Connect to a named pipe */
1393 @REQ(connect_named_pipe)
1394     handle_t       handle;
1395     void*          overlapped;
1396     void*          func;
1397 @END
1398
1399
1400 /* Wait for a named pipe */
1401 @REQ(wait_named_pipe)
1402     unsigned int   timeout;
1403     void*          overlapped;
1404     void*          func;
1405     VARARG(filename,string);    /* pipe name */
1406 @END
1407
1408
1409 /* Disconnect a named pipe */
1410 @REQ(disconnect_named_pipe)
1411     handle_t       handle;
1412 @END
1413
1414
1415 @REQ(get_named_pipe_info)
1416     handle_t       handle;
1417 @REPLY
1418     unsigned int   flags;
1419     unsigned int   maxinstances;
1420     unsigned int   outsize;
1421     unsigned int   insize;
1422 @END
1423
1424
1425 /* Create a window */
1426 @REQ(create_window)
1427     user_handle_t  parent;      /* parent window */
1428     user_handle_t  owner;       /* owner window */
1429     atom_t         atom;        /* class atom */
1430 @REPLY
1431     user_handle_t  handle;      /* created window */
1432 @END
1433
1434
1435 /* Link a window into the tree */
1436 @REQ(link_window)
1437     user_handle_t  handle;      /* handle to the window */
1438     user_handle_t  parent;      /* handle to the parent */
1439     user_handle_t  previous;    /* previous child in Z-order */
1440 @REPLY
1441     user_handle_t  full_parent; /* full handle of new parent */
1442 @END
1443
1444
1445 /* Destroy a window */
1446 @REQ(destroy_window)
1447     user_handle_t  handle;      /* handle to the window */
1448 @END
1449
1450
1451 /* Set a window owner */
1452 @REQ(set_window_owner)
1453     user_handle_t  handle;      /* handle to the window */
1454     user_handle_t  owner;       /* new owner */
1455 @REPLY
1456     user_handle_t  full_owner;  /* full handle of new owner */
1457 @END
1458
1459
1460 /* Get information from a window handle */
1461 @REQ(get_window_info)
1462     user_handle_t  handle;      /* handle to the window */
1463 @REPLY
1464     user_handle_t  full_handle; /* full 32-bit handle */
1465     void*          pid;         /* process owning the window */
1466     void*          tid;         /* thread owning the window */
1467     atom_t         atom;        /* class atom */
1468 @END
1469
1470
1471 /* Set some information in a window */
1472 @REQ(set_window_info)
1473     user_handle_t  handle;        /* handle to the window */
1474     unsigned int   flags;         /* flags for fields to set (see below) */
1475     unsigned int   style;         /* window style */
1476     unsigned int   ex_style;      /* window extended style */
1477     unsigned int   id;            /* window id */
1478     void*          instance;      /* creator instance */
1479     void*          user_data;     /* user-specific data */
1480 @REPLY
1481     unsigned int   old_style;     /* old window style */
1482     unsigned int   old_ex_style;  /* old window extended style */
1483     unsigned int   old_id;        /* old window id */
1484     void*          old_instance;  /* old creator instance */
1485     void*          old_user_data; /* old user-specific data */
1486 @END
1487 #define SET_WIN_STYLE     0x01
1488 #define SET_WIN_EXSTYLE   0x02
1489 #define SET_WIN_ID        0x04
1490 #define SET_WIN_INSTANCE  0x08
1491 #define SET_WIN_USERDATA  0x10
1492
1493
1494 /* Get a list of the window parents, up to the root of the tree */
1495 @REQ(get_window_parents)
1496     user_handle_t  handle;        /* handle to the window */
1497 @REPLY
1498     int            count;         /* total count of parents */
1499     VARARG(parents,user_handles); /* parent handles */
1500 @END
1501
1502
1503 /* Get a list of the window children */
1504 @REQ(get_window_children)
1505     user_handle_t  parent;        /* parent window */
1506     atom_t         atom;          /* class atom for the listed children */
1507     void*          tid;           /* thread owning the listed children */
1508 @REPLY
1509     int            count;         /* total count of children */
1510     VARARG(children,user_handles); /* children handles */
1511 @END
1512
1513
1514 /* Get window tree information from a window handle */
1515 @REQ(get_window_tree)
1516     user_handle_t  handle;        /* handle to the window */
1517 @REPLY
1518     user_handle_t  parent;        /* parent window */
1519     user_handle_t  owner;         /* owner window */
1520     user_handle_t  next_sibling;  /* next sibling in Z-order */
1521     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1522     user_handle_t  first_sibling; /* first sibling in Z-order */
1523     user_handle_t  last_sibling;  /* last sibling in Z-order */
1524     user_handle_t  first_child;   /* first child */
1525     user_handle_t  last_child;    /* last child */
1526 @END
1527
1528 /* Set the window and client rectangles of a window */
1529 @REQ(set_window_rectangles)
1530     user_handle_t  handle;        /* handle to the window */
1531     rectangle_t    window;        /* window rectangle */
1532     rectangle_t    client;        /* client rectangle */
1533 @END
1534
1535
1536 /* Get the window and client rectangles of a window */
1537 @REQ(get_window_rectangles)
1538     user_handle_t  handle;        /* handle to the window */
1539 @REPLY
1540     rectangle_t    window;        /* window rectangle */
1541     rectangle_t    client;        /* client rectangle */
1542 @END
1543
1544
1545 /* Get the coordinates offset between two windows */
1546 @REQ(get_windows_offset)
1547     user_handle_t  from;          /* handle to the first window */
1548     user_handle_t  to;            /* handle to the second window */
1549 @REPLY
1550     int            x;             /* x coordinate offset */
1551     int            y;             /* y coordinate offset */
1552 @END
1553
1554
1555 /* Set a window property */
1556 @REQ(set_window_property)
1557     user_handle_t  window;        /* handle to the window */
1558     atom_t         atom;          /* property atom (high-word set if it was a string) */
1559     int            string;        /* was atom a string originally? */
1560     handle_t       handle;        /* handle to store */
1561 @END
1562
1563
1564 /* Remove a window property */
1565 @REQ(remove_window_property)
1566     user_handle_t  window;        /* handle to the window */
1567     atom_t         atom;          /* property atom */
1568 @REPLY
1569     handle_t       handle;        /* handle stored in property */
1570 @END
1571
1572
1573 /* Get a window property */
1574 @REQ(get_window_property)
1575     user_handle_t  window;        /* handle to the window */
1576     atom_t         atom;          /* property atom */
1577 @REPLY
1578     handle_t       handle;        /* handle stored in property */
1579 @END
1580
1581
1582 /* Get the list of properties of a window */
1583 @REQ(get_window_properties)
1584     user_handle_t  window;        /* handle to the window */
1585 @REPLY
1586     VARARG(props,properties);     /* list of properties */
1587 @END