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