Skip queue cleanups if queue has been destroyed already.
[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          inherit;       /* inherit flag */
537     int          fd;            /* file descriptor on the client side */
538 @REPLY
539     handle_t     handle;        /* handle to the file */
540 @END
541
542
543 /* Get a Unix fd to access a file */
544 @REQ(get_handle_fd)
545     handle_t     handle;        /* handle to the file */
546     unsigned int access;        /* wanted access rights */
547 @REPLY
548     int          fd;            /* file descriptor */
549     int          type;          /* the type of file */
550 @END
551 #define FD_TYPE_INVALID    0
552 #define FD_TYPE_DEFAULT    1
553 #define FD_TYPE_CONSOLE    2
554 #define FD_TYPE_OVERLAPPED 3
555 #define FD_TYPE_TIMEOUT    4
556
557
558 /* Set a file current position */
559 @REQ(set_file_pointer)
560     handle_t     handle;        /* handle to the file */
561     int          low;           /* position low word */
562     int          high;          /* position high word */
563     int          whence;        /* whence to seek */
564 @REPLY
565     int          new_low;       /* new position low word */
566     int          new_high;      /* new position high word */
567 @END
568
569
570 /* Truncate (or extend) a file */
571 @REQ(truncate_file)
572     handle_t     handle;        /* handle to the file */
573 @END
574
575
576 /* Set a file access and modification times */
577 @REQ(set_file_time)
578     handle_t     handle;        /* handle to the file */
579     time_t       access_time;   /* last access time */
580     time_t       write_time;    /* last write time */
581 @END
582
583
584 /* Flush a file buffers */
585 @REQ(flush_file)
586     handle_t     handle;        /* handle to the file */
587 @END
588
589
590 /* Get information about a file */
591 @REQ(get_file_info)
592     handle_t     handle;        /* handle to the file */
593 @REPLY
594     int          type;          /* file type */
595     int          attr;          /* file attributes */
596     time_t       access_time;   /* last access time */
597     time_t       write_time;    /* last write time */
598     int          size_high;     /* file size */
599     int          size_low;      /* file size */
600     int          links;         /* number of links */
601     int          index_high;    /* unique index */
602     int          index_low;     /* unique index */
603     unsigned int serial;        /* volume serial number */
604 @END
605
606
607 /* Lock a region of a file */
608 @REQ(lock_file)
609     handle_t     handle;        /* handle to the file */
610     unsigned int offset_low;    /* offset of start of lock */
611     unsigned int offset_high;   /* offset of start of lock */
612     unsigned int count_low;     /* count of bytes to lock */
613     unsigned int count_high;    /* count of bytes to lock */
614 @END
615
616
617 /* Unlock a region of a file */
618 @REQ(unlock_file)
619     handle_t     handle;        /* handle to the file */
620     unsigned int offset_low;    /* offset of start of unlock */
621     unsigned int offset_high;   /* offset of start of unlock */
622     unsigned int count_low;     /* count of bytes to unlock */
623     unsigned int count_high;    /* count of bytes to unlock */
624 @END
625
626
627 /* Create an anonymous pipe */
628 @REQ(create_pipe)
629     int          inherit;       /* inherit flag */
630 @REPLY
631     handle_t     handle_read;   /* handle to the read-side of the pipe */
632     handle_t     handle_write;  /* handle to the write-side of the pipe */
633 @END
634
635
636 /* Create a socket */
637 @REQ(create_socket)
638     unsigned int access;        /* wanted access rights */
639     int          inherit;       /* inherit flag */
640     int          family;        /* family, see socket manpage */
641     int          type;          /* type, see socket manpage */
642     int          protocol;      /* protocol, see socket manpage */
643 @REPLY
644     handle_t     handle;        /* handle to the new socket */
645 @END
646
647
648 /* Accept a socket */
649 @REQ(accept_socket)
650     handle_t     lhandle;       /* handle to the listening socket */
651     unsigned int access;        /* wanted access rights */
652     int          inherit;       /* inherit flag */
653 @REPLY
654     handle_t     handle;        /* handle to the new socket */
655 @END
656
657
658 /* Set socket event parameters */
659 @REQ(set_socket_event)
660     handle_t     handle;        /* handle to the socket */
661     unsigned int mask;          /* event mask */
662     handle_t     event;         /* event object */
663 @END
664
665
666 /* Get socket event parameters */
667 @REQ(get_socket_event)
668     handle_t     handle;        /* handle to the socket */
669     int          service;       /* clear pending? */
670     handle_t     s_event;       /* "expected" event object */
671     handle_t     c_event;       /* event to clear */
672 @REPLY
673     unsigned int mask;          /* event mask */
674     unsigned int pmask;         /* pending events */
675     unsigned int state;         /* status bits */
676     VARARG(errors,ints);        /* event errors */
677 @END
678
679
680 /* Reenable pending socket events */
681 @REQ(enable_socket_event)
682     handle_t     handle;        /* handle to the socket */
683     unsigned int mask;          /* events to re-enable */
684     unsigned int sstate;        /* status bits to set */
685     unsigned int cstate;        /* status bits to clear */
686 @END
687
688
689 /* Allocate a console (only used by a console renderer) */
690 @REQ(alloc_console)
691     unsigned int access;        /* wanted access rights */
692     int          inherit;       /* inherit flag */
693     void*        pid;           /* pid of process which shall be attached to the console */
694 @REPLY
695     handle_t     handle_in;     /* handle to console input */
696     handle_t     event;         /* handle to renderer events change notification */
697 @END
698
699
700 /* Free the console of the current process */
701 @REQ(free_console)
702 @END
703
704
705 #define CONSOLE_RENDERER_NONE_EVENT        0x00
706 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
707 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
708 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
709 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
710 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
711 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
712 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
713 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
714 struct console_renderer_event
715 {
716     short event;
717     union
718     {
719         struct update
720         {
721             short top;
722             short bottom;
723         } update;
724         struct resize
725         {
726             short width;
727             short height;
728         } resize;
729         struct cursor_pos
730         {
731             short x;
732             short y;
733         } cursor_pos;
734         struct cursor_geom
735         {
736             short visible;
737             short size;
738         } cursor_geom;
739         struct display
740         {
741             short left;
742             short top;
743             short width;
744             short height;
745         } display;
746     } u;
747 };
748
749 /* retrieve console events for the renderer */
750 @REQ(get_console_renderer_events)
751     handle_t     handle;        /* handle to console input events */
752 @REPLY
753     VARARG(data,bytes);         /* the various console_renderer_events */
754 @END
755
756
757 /* Open a handle to the process console */
758 @REQ(open_console)
759     int          from;          /* 0 (resp 1) input (resp output) of current process console */
760                                 /* otherwise console_in handle to get active screen buffer? */
761     unsigned int access;        /* wanted access rights */
762     int          inherit;       /* inherit flag */
763     int          share;         /* share mask (only for output handles) */
764 @REPLY
765     handle_t     handle;        /* handle to the console */
766 @END
767
768
769 /* Get a console mode (input or output) */
770 @REQ(get_console_mode)
771     handle_t     handle;        /* handle to the console */
772 @REPLY
773     int          mode;          /* console mode */
774 @END
775
776
777 /* Set a console mode (input or output) */
778 @REQ(set_console_mode)
779     handle_t     handle;        /* handle to the console */
780     int          mode;          /* console mode */
781 @END
782
783
784 /* Set info about a console (input only) */
785 @REQ(set_console_input_info)
786     handle_t     handle;        /* handle to console input, or 0 for process' console */
787     int          mask;          /* setting mask (see below) */
788     handle_t     active_sb;     /* active screen buffer */
789     int          history_mode;  /* whether we duplicate lines in history */
790     int          history_size;  /* number of lines in history */
791     VARARG(title,unicode_str);  /* console title */
792 @END
793 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
794 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
795 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
796 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
797
798
799 /* Get info about a console (input only) */
800 @REQ(get_console_input_info)
801     handle_t     handle;        /* handle to console input, or 0 for process' console */
802 @REPLY
803     int          history_mode;  /* whether we duplicate lines in history */
804     int          history_size;  /* number of lines in history */
805     int          history_index; /* number of used lines in history */
806     VARARG(title,unicode_str);  /* console title */
807 @END
808
809
810 /* appends a string to console's history */
811 @REQ(append_console_input_history)
812     handle_t     handle;        /* handle to console input, or 0 for process' console */
813     VARARG(line,unicode_str);   /* line to add */
814 @END
815
816
817 /* appends a string to console's history */
818 @REQ(get_console_input_history)
819     handle_t     handle;        /* handle to console input, or 0 for process' console */
820     int          index;         /* index to get line from */
821 @REPLY
822     VARARG(line,unicode_str);   /* line to add */
823 @END
824
825
826 /* creates a new screen buffer on process' console */
827 @REQ(create_console_output)
828     handle_t     handle_in;     /* handle to console input, or 0 for process' console */
829     int          access;        /* wanted access rights */
830     int          share;         /* sharing credentials */
831     int          inherit;       /* inherit flag */
832 @REPLY
833     handle_t     handle_out;    /* handle to the screen buffer */
834 @END
835
836
837 /* Set info about a console (output only) */
838 @REQ(set_console_output_info)
839     handle_t     handle;        /* handle to the console */
840     int          mask;          /* setting mask (see below) */
841     short int    cursor_size;   /* size of cursor (percentage filled) */
842     short int    cursor_visible;/* cursor visibility flag */
843     short int    cursor_x;      /* position of cursor (x, y) */
844     short int    cursor_y;
845     short int    width;         /* width of the screen buffer */
846     short int    height;        /* height of the screen buffer */
847     short int    attr;          /* default attribute */
848     short int    win_left;      /* window actually displayed by renderer */
849     short int    win_top;       /* the rect area is expressed withing the */
850     short int    win_right;     /* boundaries of the screen buffer */
851     short int    win_bottom;
852     short int    max_width;     /* maximum size (width x height) for the window */
853     short int    max_height;
854 @END
855 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
856 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
857 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
858 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
859 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
860 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
861
862
863 /* Get info about a console (output only) */
864 @REQ(get_console_output_info)
865     handle_t     handle;        /* handle to the console */
866 @REPLY
867     short int    cursor_size;   /* size of cursor (percentage filled) */
868     short int    cursor_visible;/* cursor visibility flag */
869     short int    cursor_x;      /* position of cursor (x, y) */
870     short int    cursor_y;
871     short int    width;         /* width of the screen buffer */
872     short int    height;        /* height of the screen buffer */
873     short int    attr;          /* default attribute */
874     short int    win_left;      /* window actually displayed by renderer */
875     short int    win_top;       /* the rect area is expressed withing the */
876     short int    win_right;     /* boundaries of the screen buffer */
877     short int    win_bottom;
878     short int    max_width;     /* maximum size (width x height) for the window */
879     short int    max_height;
880 @END
881
882 /* Add input records to a console input queue */
883 @REQ(write_console_input)
884     handle_t     handle;        /* handle to the console input */
885     VARARG(rec,input_records);  /* input records */
886 @REPLY
887     int          written;       /* number of records written */
888 @END
889
890
891 /* Fetch input records from a console input queue */
892 @REQ(read_console_input)
893     handle_t     handle;        /* handle to the console input */
894     int          flush;         /* flush the retrieved records from the queue? */
895 @REPLY
896     int          read;          /* number of records read */
897     VARARG(rec,input_records);  /* input records */
898 @END
899
900
901 /* write data (chars and/or attributes) in a screen buffer */
902 @REQ(write_console_output)
903     handle_t     handle;        /* handle to the console input */
904     int          mode;          /* 0 for text, 1, for attributes, 2 for both */
905                                 /* bit3 (4) set if uniform pattern in data */
906     short int    x;             /* position where to start writing */
907     short int    y;
908     VARARG(data,bytes);         /* info to write */
909 @REPLY
910     int          written;       /* number of bytes actually written */
911 @END
912 #define WRITE_CONSOLE_MODE_TEXT         0x00
913 #define WRITE_CONSOLE_MODE_ATTR         0x01
914 #define WRITE_CONSOLE_MODE_TEXTATTR     0x02
915 #define WRITE_CONSOLE_MODE_TEXTSTDATTR  0x03
916 #define WRITE_CONSOLE_MODE_UNIFORM      0x04
917
918
919 /* read data (chars and/or attrubutes) from a screen buffer */
920 @REQ(read_console_output)
921     handle_t     handle;        /* handle to the console input */
922     short int    x;             /* position (x,y) where to start reading from */
923     short int    y;
924     short int    w;             /* size of area to read from (width x height) */
925     short int    h;
926 @REPLY
927     short int    eff_w;         /* effective width read */
928     short int    eff_h;         /* effective height read */
929     VARARG(data,bytes);
930 @END
931
932 /* move a rect (of data) in screen buffer content */
933 @REQ(move_console_output)
934     handle_t     handle;        /* handle to the console output */
935     short int    x_src;         /* position (x, y) of rect to start moving from */
936     short int    y_src;
937     short int    x_dst;         /* position (x, y) of rect to move to */
938     short int    y_dst;
939     short int    w;             /* size of the rect (width, height) to move */
940     short int    h;
941 @END
942
943
944 /* Create a change notification */
945 @REQ(create_change_notification)
946     int          subtree;       /* watch all the subtree */
947     int          filter;        /* notification filter */
948 @REPLY
949     handle_t     handle;        /* handle to the change notification */
950 @END
951
952
953 /* Create a file mapping */
954 @REQ(create_mapping)
955     int          size_high;     /* mapping size */
956     int          size_low;      /* mapping size */
957     int          protect;       /* protection flags (see below) */
958     int          inherit;       /* inherit flag */
959     handle_t     file_handle;   /* file handle */
960     VARARG(name,unicode_str);   /* object name */
961 @REPLY
962     handle_t     handle;        /* handle to the mapping */
963 @END
964 /* protection flags */
965 #define VPROT_READ       0x01
966 #define VPROT_WRITE      0x02
967 #define VPROT_EXEC       0x04
968 #define VPROT_WRITECOPY  0x08
969 #define VPROT_GUARD      0x10
970 #define VPROT_NOCACHE    0x20
971 #define VPROT_COMMITTED  0x40
972 #define VPROT_IMAGE      0x80
973
974
975 /* Open a mapping */
976 @REQ(open_mapping)
977     unsigned int access;        /* wanted access rights */
978     int          inherit;       /* inherit flag */
979     VARARG(name,unicode_str);   /* object name */
980 @REPLY
981     handle_t     handle;        /* handle to the mapping */
982 @END
983
984
985 /* Get information about a file mapping */
986 @REQ(get_mapping_info)
987     handle_t     handle;        /* handle to the mapping */
988 @REPLY
989     int          size_high;     /* mapping size */
990     int          size_low;      /* mapping size */
991     int          protect;       /* protection flags */
992     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
993     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
994     handle_t     shared_file;   /* shared mapping file handle */
995     int          shared_size;   /* shared mapping size */
996     int          drive_type;    /* type of drive the file is on */
997 @END
998
999
1000 /* Create a device */
1001 @REQ(create_device)
1002     unsigned int access;        /* wanted access rights */
1003     int          inherit;       /* inherit flag */
1004     int          id;            /* client private id */
1005 @REPLY
1006     handle_t     handle;        /* handle to the device */
1007 @END
1008
1009
1010 /* Create a snapshot */
1011 @REQ(create_snapshot)
1012     int          inherit;       /* inherit flag */
1013     int          flags;         /* snapshot flags (TH32CS_*) */
1014     void*        pid;           /* process id */
1015 @REPLY
1016     handle_t     handle;        /* handle to the snapshot */
1017 @END
1018
1019
1020 /* Get the next process from a snapshot */
1021 @REQ(next_process)
1022     handle_t     handle;        /* handle to the snapshot */
1023     int          reset;         /* reset snapshot position? */
1024 @REPLY
1025     int          count;         /* process usage count */
1026     void*        pid;           /* process id */
1027     int          threads;       /* number of threads */
1028     int          priority;      /* process priority */
1029 @END
1030
1031
1032 /* Get the next thread from a snapshot */
1033 @REQ(next_thread)
1034     handle_t     handle;        /* handle to the snapshot */
1035     int          reset;         /* reset snapshot position? */
1036 @REPLY
1037     int          count;         /* thread usage count */
1038     void*        pid;           /* process id */
1039     void*        tid;           /* thread id */
1040     int          base_pri;      /* base priority */
1041     int          delta_pri;     /* delta priority */
1042 @END
1043
1044
1045 /* Get the next module from a snapshot */
1046 @REQ(next_module)
1047     handle_t     handle;        /* handle to the snapshot */
1048     int          reset;         /* reset snapshot position? */
1049 @REPLY
1050     void*        pid;           /* process id */
1051     void*        base;          /* module base address */
1052 @END
1053
1054
1055 /* Wait for a debug event */
1056 @REQ(wait_debug_event)
1057     int           get_handle;  /* should we alloc a handle for waiting? */
1058 @REPLY
1059     void*         pid;         /* process id */
1060     void*         tid;         /* thread id */
1061     handle_t      wait;        /* wait handle if no event ready */
1062     VARARG(event,debug_event); /* debug event data */
1063 @END
1064
1065
1066 /* Queue an exception event */
1067 @REQ(queue_exception_event)
1068     int              first;    /* first chance exception? */
1069     VARARG(record,exc_event);  /* thread context followed by exception record */
1070 @REPLY
1071     handle_t         handle;   /* handle to the queued event */
1072 @END
1073
1074
1075 /* Retrieve the status of an exception event */
1076 @REQ(get_exception_status)
1077 @REPLY
1078     handle_t         handle;   /* handle to the queued event */
1079     int              status;   /* event continuation status */
1080     VARARG(context,context);   /* modified thread context */
1081 @END
1082
1083
1084 /* Send an output string to the debugger */
1085 @REQ(output_debug_string)
1086     void*         string;      /* string to display (in debugged process address space) */
1087     int           unicode;     /* is it Unicode? */
1088     int           length;      /* string length */
1089 @END
1090
1091
1092 /* Continue a debug event */
1093 @REQ(continue_debug_event)
1094     void*        pid;          /* process id to continue */
1095     void*        tid;          /* thread id to continue */
1096     int          status;       /* continuation status */
1097 @END
1098
1099
1100 /* Start debugging an existing process */
1101 @REQ(debug_process)
1102     void*        pid;          /* id of the process to debug */
1103 @END
1104
1105
1106 /* Read data from a process address space */
1107 @REQ(read_process_memory)
1108     handle_t     handle;       /* process handle */
1109     void*        addr;         /* addr to read from (must be int-aligned) */
1110     int          len;          /* number of ints to read */
1111 @REPLY
1112     VARARG(data,bytes);        /* result data */
1113 @END
1114
1115
1116 /* Write data to a process address space */
1117 @REQ(write_process_memory)
1118     handle_t     handle;       /* process handle */
1119     void*        addr;         /* addr to write to (must be int-aligned) */
1120     int          len;          /* number of ints to write */
1121     unsigned int first_mask;   /* mask for first word */
1122     unsigned int last_mask;    /* mask for last word */
1123     VARARG(data,bytes);        /* result data */
1124 @END
1125
1126
1127 /* Create a registry key */
1128 @REQ(create_key)
1129     handle_t     parent;       /* handle to the parent key */
1130     unsigned int access;       /* desired access rights */
1131     unsigned int options;      /* creation options */
1132     time_t       modif;        /* last modification time */
1133     VARARG(name,unicode_len_str);  /* key name */
1134     VARARG(class,unicode_str);     /* class name */
1135 @REPLY
1136     handle_t     hkey;         /* handle to the created key */
1137     int          created;      /* has it been newly created? */
1138 @END
1139
1140 /* Open a registry key */
1141 @REQ(open_key)
1142     handle_t     parent;       /* handle to the parent key */
1143     unsigned int access;       /* desired access rights */
1144     VARARG(name,unicode_str);  /* key name */
1145 @REPLY
1146     handle_t     hkey;         /* handle to the open key */
1147 @END
1148
1149
1150 /* Delete a registry key */
1151 @REQ(delete_key)
1152     handle_t     hkey;         /* handle to the key */
1153 @END
1154
1155
1156 /* Enumerate registry subkeys */
1157 @REQ(enum_key)
1158     handle_t     hkey;         /* handle to registry key */
1159     int          index;        /* index of subkey (or -1 for current key) */
1160     int          full;         /* return the full info? */
1161 @REPLY
1162     int          subkeys;      /* number of subkeys */
1163     int          max_subkey;   /* longest subkey name */
1164     int          max_class;    /* longest class name */
1165     int          values;       /* number of values */
1166     int          max_value;    /* longest value name */
1167     int          max_data;     /* longest value data */
1168     time_t       modif;        /* last modification time */
1169     VARARG(name,unicode_len_str);  /* key name */
1170     VARARG(class,unicode_str);     /* class name */
1171 @END
1172
1173
1174 /* Set a value of a registry key */
1175 @REQ(set_key_value)
1176     handle_t     hkey;         /* handle to registry key */
1177     int          type;         /* value type */
1178     unsigned int total;        /* total value len */
1179     unsigned int offset;       /* offset for setting data */
1180     VARARG(name,unicode_len_str);  /* value name */
1181     VARARG(data,bytes);        /* value data */
1182 @END
1183
1184
1185 /* Retrieve the value of a registry key */
1186 @REQ(get_key_value)
1187     handle_t     hkey;         /* handle to registry key */
1188     unsigned int offset;       /* offset for getting data */
1189     VARARG(name,unicode_len_str);  /* value name */
1190 @REPLY
1191     int          type;         /* value type */
1192     int          len;          /* value data len */
1193     VARARG(data,bytes);        /* value data */
1194 @END
1195
1196
1197 /* Enumerate a value of a registry key */
1198 @REQ(enum_key_value)
1199     handle_t     hkey;         /* handle to registry key */
1200     int          index;        /* value index */
1201     unsigned int offset;       /* offset for getting data */
1202 @REPLY
1203     int          type;         /* value type */
1204     int          len;          /* value data len */
1205     VARARG(name,unicode_len_str);  /* value name */
1206     VARARG(data,bytes);        /* value data */
1207 @END
1208
1209
1210 /* Delete a value of a registry key */
1211 @REQ(delete_key_value)
1212     handle_t     hkey;         /* handle to registry key */
1213     VARARG(name,unicode_str);  /* value name */
1214 @END
1215
1216
1217 /* Load a registry branch from a file */
1218 @REQ(load_registry)
1219     handle_t     hkey;         /* root key to load to */
1220     handle_t     file;         /* file to load from */
1221     VARARG(name,unicode_str);  /* subkey name */
1222 @END
1223
1224
1225 /* Save a registry branch to a file */
1226 @REQ(save_registry)
1227     handle_t     hkey;         /* key to save */
1228     handle_t     file;         /* file to save to */
1229 @END
1230
1231
1232 /* Save a registry branch at server exit */
1233 @REQ(save_registry_atexit)
1234     handle_t     hkey;         /* key to save */
1235     VARARG(file,string);       /* file to save to */
1236 @END
1237
1238
1239 /* Set the current and saving level for the registry */
1240 @REQ(set_registry_levels)
1241     int          current;      /* new current level */
1242     int          saving;       /* new saving level */
1243     int          period;       /* duration between periodic saves (milliseconds) */
1244 @END
1245
1246
1247 /* Create a waitable timer */
1248 @REQ(create_timer)
1249     int          inherit;       /* inherit flag */
1250     int          manual;        /* manual reset */
1251     VARARG(name,unicode_str);   /* object name */
1252 @REPLY
1253     handle_t     handle;        /* handle to the timer */
1254 @END
1255
1256
1257 /* Open a waitable timer */
1258 @REQ(open_timer)
1259     unsigned int access;        /* wanted access rights */
1260     int          inherit;       /* inherit flag */
1261     VARARG(name,unicode_str);   /* object name */
1262 @REPLY
1263     handle_t     handle;        /* handle to the timer */
1264 @END
1265
1266 /* Set a waitable timer */
1267 @REQ(set_timer)
1268     handle_t     handle;        /* handle to the timer */
1269     int          sec;           /* next expiration absolute time */
1270     int          usec;          /* next expiration absolute time */
1271     int          period;        /* timer period in ms */
1272     void*        callback;      /* callback function */
1273     void*        arg;           /* callback argument */
1274 @END
1275
1276 /* Cancel a waitable timer */
1277 @REQ(cancel_timer)
1278     handle_t     handle;        /* handle to the timer */
1279 @END
1280
1281
1282 /* Retrieve the current context of a thread */
1283 @REQ(get_thread_context)
1284     handle_t     handle;       /* thread handle */
1285     unsigned int flags;        /* context flags */
1286 @REPLY
1287     VARARG(context,context);   /* thread context */
1288 @END
1289
1290
1291 /* Set the current context of a thread */
1292 @REQ(set_thread_context)
1293     handle_t     handle;       /* thread handle */
1294     unsigned int flags;        /* context flags */
1295     VARARG(context,context);   /* thread context */
1296 @END
1297
1298
1299 /* Fetch a selector entry for a thread */
1300 @REQ(get_selector_entry)
1301     handle_t      handle;      /* thread handle */
1302     int           entry;       /* LDT entry */
1303 @REPLY
1304     unsigned int  base;        /* selector base */
1305     unsigned int  limit;       /* selector limit */
1306     unsigned char flags;       /* selector flags */
1307 @END
1308
1309
1310 /* Add an atom */
1311 @REQ(add_atom)
1312     int           local;       /* is atom in local process table? */
1313     VARARG(name,unicode_str);  /* atom name */
1314 @REPLY
1315     atom_t        atom;        /* resulting atom */
1316 @END
1317
1318
1319 /* Delete an atom */
1320 @REQ(delete_atom)
1321     atom_t        atom;        /* atom handle */
1322     int           local;       /* is atom in local process table? */
1323 @END
1324
1325
1326 /* Find an atom */
1327 @REQ(find_atom)
1328     int          local;        /* is atom in local process table? */
1329     VARARG(name,unicode_str);  /* atom name */
1330 @REPLY
1331     atom_t       atom;         /* atom handle */
1332 @END
1333
1334
1335 /* Get an atom name */
1336 @REQ(get_atom_name)
1337     atom_t       atom;         /* atom handle */
1338     int          local;        /* is atom in local process table? */
1339 @REPLY
1340     int          count;        /* atom lock count */
1341     VARARG(name,unicode_str);  /* atom name */
1342 @END
1343
1344
1345 /* Init the process atom table */
1346 @REQ(init_atom_table)
1347     int          entries;      /* number of entries */
1348 @END
1349
1350
1351 /* Get the message queue of the current thread */
1352 @REQ(get_msg_queue)
1353 @REPLY
1354     handle_t     handle;       /* handle to the queue */
1355 @END
1356
1357
1358 /* Set the current message queue wakeup mask */
1359 @REQ(set_queue_mask)
1360     unsigned int wake_mask;    /* wakeup bits mask */
1361     unsigned int changed_mask; /* changed bits mask */
1362     int          skip_wait;    /* will we skip waiting if signaled? */
1363 @REPLY
1364     unsigned int wake_bits;    /* current wake bits */
1365     unsigned int changed_bits; /* current changed bits */
1366 @END
1367
1368
1369 /* Get the current message queue status */
1370 @REQ(get_queue_status)
1371     int          clear;        /* should we clear the change bits? */
1372 @REPLY
1373     unsigned int wake_bits;    /* wake bits */
1374     unsigned int changed_bits; /* changed bits since last time */
1375 @END
1376
1377
1378 /* Wait for a process to start waiting on input */
1379 @REQ(wait_input_idle)
1380     handle_t     handle;       /* process handle */
1381     int          timeout;      /* timeout */
1382 @REPLY
1383     handle_t     event;        /* handle to idle event */
1384 @END
1385
1386
1387 /* Send a message to a thread queue */
1388 @REQ(send_message)
1389     void*           id;        /* thread id */
1390     int             type;      /* message type (see below) */
1391     user_handle_t   win;       /* window handle */
1392     unsigned int    msg;       /* message code */
1393     unsigned int    wparam;    /* parameters */
1394     unsigned int    lparam;    /* parameters */
1395     int             x;         /* x position */
1396     int             y;         /* y position */
1397     unsigned int    time;      /* message time */
1398     unsigned int    info;      /* extra info */
1399     int             timeout;   /* timeout for reply */
1400     VARARG(data,bytes);        /* message data for sent messages */
1401 @END
1402
1403 enum message_type
1404 {
1405     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1406     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1407     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1408     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1409     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1410     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1411     MSG_HARDWARE_RAW,   /* raw hardware message */
1412     MSG_HARDWARE_COOKED /* cooked hardware message */
1413 };
1414
1415
1416 /* Get a message from the current queue */
1417 @REQ(get_message)
1418     int             flags;     /* see below */
1419     user_handle_t   get_win;   /* window handle to get */
1420     unsigned int    get_first; /* first message code to get */
1421     unsigned int    get_last;  /* last message code to get */
1422 @REPLY
1423     int             type;      /* message type */
1424     user_handle_t   win;       /* window handle */
1425     unsigned int    msg;       /* message code */
1426     unsigned int    wparam;    /* parameters */
1427     unsigned int    lparam;    /* parameters */
1428     int             x;         /* x position */
1429     int             y;         /* y position */
1430     unsigned int    time;      /* message time */
1431     unsigned int    info;      /* extra info */
1432     VARARG(data,bytes);        /* message data for sent messages */
1433 @END
1434 #define GET_MSG_REMOVE      1  /* remove the message */
1435 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1436 #define GET_MSG_REMOVE_LAST 4  /* remove last message returned before checking for a new one */
1437
1438 /* Reply to a sent message */
1439 @REQ(reply_message)
1440     unsigned int    result;    /* message result */
1441     int             remove;    /* should we remove the message? */
1442     VARARG(data,bytes);        /* message data for sent messages */
1443 @END
1444
1445
1446 /* Retrieve the reply for the last message sent */
1447 @REQ(get_message_reply)
1448     int             cancel;    /* cancel message if not ready? */
1449 @REPLY
1450     unsigned int    result;    /* message result */
1451     VARARG(data,bytes);        /* message data for sent messages */
1452 @END
1453
1454
1455 /* Set a window timer */
1456 @REQ(set_win_timer)
1457     user_handle_t   win;       /* window handle */
1458     unsigned int    msg;       /* message to post */
1459     unsigned int    id;        /* timer id */
1460     unsigned int    rate;      /* timer rate in ms */
1461     unsigned int    lparam;    /* message lparam (callback proc) */
1462 @END
1463
1464
1465 /* Kill a window timer */
1466 @REQ(kill_win_timer)
1467     user_handle_t   win;       /* window handle */
1468     unsigned int    msg;       /* message to post */
1469     unsigned int    id;        /* timer id */
1470 @END
1471
1472
1473 /* Open a serial port */
1474 @REQ(create_serial)
1475     unsigned int access;       /* wanted access rights */
1476     int          inherit;      /* inherit flag */
1477     unsigned int attributes;   /* eg. FILE_FLAG_OVERLAPPED */
1478     unsigned int sharing;      /* sharing flags */
1479     VARARG(name,string);       /* file name */
1480 @REPLY
1481     handle_t     handle;       /* handle to the port */
1482 @END
1483
1484
1485 /* Retrieve info about a serial port */
1486 @REQ(get_serial_info)
1487     handle_t     handle;       /* handle to comm port */
1488 @REPLY
1489     unsigned int readinterval;
1490     unsigned int readconst;
1491     unsigned int readmult;
1492     unsigned int writeconst;
1493     unsigned int writemult;
1494     unsigned int eventmask;
1495     unsigned int commerror;
1496 @END
1497
1498
1499 /* Set info about a serial port */
1500 @REQ(set_serial_info)
1501     handle_t     handle;       /* handle to comm port */
1502     int          flags;        /* bitmask to set values (see below) */
1503     unsigned int readinterval;
1504     unsigned int readconst;
1505     unsigned int readmult;
1506     unsigned int writeconst;
1507     unsigned int writemult;
1508     unsigned int eventmask;
1509     unsigned int commerror;
1510 @END
1511 #define SERIALINFO_SET_TIMEOUTS  0x01
1512 #define SERIALINFO_SET_MASK      0x02
1513 #define SERIALINFO_SET_ERROR     0x04
1514
1515
1516 /* Create an async I/O */
1517 @REQ(create_async)
1518     handle_t     file_handle;  /* handle to comm port, socket or file */
1519     int          count;
1520     int          type;
1521 @REPLY
1522     int          timeout;
1523 @END
1524 #define ASYNC_TYPE_READ  0x01
1525 #define ASYNC_TYPE_WRITE 0x02
1526 #define ASYNC_TYPE_WAIT  0x03
1527
1528
1529 /* Create a named pipe */
1530 @REQ(create_named_pipe)
1531     unsigned int   openmode;
1532     unsigned int   pipemode;
1533     unsigned int   maxinstances;
1534     unsigned int   outsize;
1535     unsigned int   insize;
1536     unsigned int   timeout;
1537     VARARG(filename,string);    /* pipe name */
1538 @REPLY
1539     handle_t       handle;     /* handle to the pipe */
1540 @END
1541
1542
1543 /* Open an existing named pipe */
1544 @REQ(open_named_pipe)
1545     unsigned int   access;
1546     VARARG(filename,string);    /* pipe name */
1547 @REPLY
1548     handle_t       handle;     /* handle to the pipe */
1549 @END
1550
1551
1552 /* Connect to a named pipe */
1553 @REQ(connect_named_pipe)
1554     handle_t       handle;
1555     void*          overlapped;
1556     void*          func;
1557 @END
1558
1559
1560 /* Wait for a named pipe */
1561 @REQ(wait_named_pipe)
1562     unsigned int   timeout;
1563     void*          overlapped;
1564     void*          func;
1565     VARARG(filename,string);    /* pipe name */
1566 @END
1567
1568
1569 /* Disconnect a named pipe */
1570 @REQ(disconnect_named_pipe)
1571     handle_t       handle;
1572 @END
1573
1574
1575 @REQ(get_named_pipe_info)
1576     handle_t       handle;
1577 @REPLY
1578     unsigned int   flags;
1579     unsigned int   maxinstances;
1580     unsigned int   outsize;
1581     unsigned int   insize;
1582 @END
1583
1584
1585 /* Create a window */
1586 @REQ(create_window)
1587     user_handle_t  parent;      /* parent window */
1588     user_handle_t  owner;       /* owner window */
1589     atom_t         atom;        /* class atom */
1590 @REPLY
1591     user_handle_t  handle;      /* created window */
1592 @END
1593
1594
1595 /* Link a window into the tree */
1596 @REQ(link_window)
1597     user_handle_t  handle;      /* handle to the window */
1598     user_handle_t  parent;      /* handle to the parent */
1599     user_handle_t  previous;    /* previous child in Z-order */
1600 @REPLY
1601     user_handle_t  full_parent; /* full handle of new parent */
1602 @END
1603
1604
1605 /* Destroy a window */
1606 @REQ(destroy_window)
1607     user_handle_t  handle;      /* handle to the window */
1608 @END
1609
1610
1611 /* Set a window owner */
1612 @REQ(set_window_owner)
1613     user_handle_t  handle;      /* handle to the window */
1614     user_handle_t  owner;       /* new owner */
1615 @REPLY
1616     user_handle_t  full_owner;  /* full handle of new owner */
1617 @END
1618
1619
1620 /* Get information from a window handle */
1621 @REQ(get_window_info)
1622     user_handle_t  handle;      /* handle to the window */
1623 @REPLY
1624     user_handle_t  full_handle; /* full 32-bit handle */
1625     void*          pid;         /* process owning the window */
1626     void*          tid;         /* thread owning the window */
1627     atom_t         atom;        /* class atom */
1628 @END
1629
1630
1631 /* Set some information in a window */
1632 @REQ(set_window_info)
1633     user_handle_t  handle;        /* handle to the window */
1634     unsigned int   flags;         /* flags for fields to set (see below) */
1635     unsigned int   style;         /* window style */
1636     unsigned int   ex_style;      /* window extended style */
1637     unsigned int   id;            /* window id */
1638     void*          instance;      /* creator instance */
1639     void*          user_data;     /* user-specific data */
1640 @REPLY
1641     unsigned int   old_style;     /* old window style */
1642     unsigned int   old_ex_style;  /* old window extended style */
1643     unsigned int   old_id;        /* old window id */
1644     void*          old_instance;  /* old creator instance */
1645     void*          old_user_data; /* old user-specific data */
1646 @END
1647 #define SET_WIN_STYLE     0x01
1648 #define SET_WIN_EXSTYLE   0x02
1649 #define SET_WIN_ID        0x04
1650 #define SET_WIN_INSTANCE  0x08
1651 #define SET_WIN_USERDATA  0x10
1652
1653
1654 /* Get a list of the window parents, up to the root of the tree */
1655 @REQ(get_window_parents)
1656     user_handle_t  handle;        /* handle to the window */
1657 @REPLY
1658     int            count;         /* total count of parents */
1659     VARARG(parents,user_handles); /* parent handles */
1660 @END
1661
1662
1663 /* Get a list of the window children */
1664 @REQ(get_window_children)
1665     user_handle_t  parent;        /* parent window */
1666     atom_t         atom;          /* class atom for the listed children */
1667     void*          tid;           /* thread owning the listed children */
1668 @REPLY
1669     int            count;         /* total count of children */
1670     VARARG(children,user_handles); /* children handles */
1671 @END
1672
1673
1674 /* Get window tree information from a window handle */
1675 @REQ(get_window_tree)
1676     user_handle_t  handle;        /* handle to the window */
1677 @REPLY
1678     user_handle_t  parent;        /* parent window */
1679     user_handle_t  owner;         /* owner window */
1680     user_handle_t  next_sibling;  /* next sibling in Z-order */
1681     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1682     user_handle_t  first_sibling; /* first sibling in Z-order */
1683     user_handle_t  last_sibling;  /* last sibling in Z-order */
1684     user_handle_t  first_child;   /* first child */
1685     user_handle_t  last_child;    /* last child */
1686 @END
1687
1688 /* Set the window and client rectangles of a window */
1689 @REQ(set_window_rectangles)
1690     user_handle_t  handle;        /* handle to the window */
1691     rectangle_t    window;        /* window rectangle */
1692     rectangle_t    client;        /* client rectangle */
1693 @END
1694
1695
1696 /* Get the window and client rectangles of a window */
1697 @REQ(get_window_rectangles)
1698     user_handle_t  handle;        /* handle to the window */
1699 @REPLY
1700     rectangle_t    window;        /* window rectangle */
1701     rectangle_t    client;        /* client rectangle */
1702 @END
1703
1704
1705 /* Get the window text */
1706 @REQ(get_window_text)
1707     user_handle_t  handle;        /* handle to the window */
1708 @REPLY
1709     VARARG(text,unicode_str);     /* window text */
1710 @END
1711
1712
1713 /* Set the window text */
1714 @REQ(set_window_text)
1715     user_handle_t  handle;        /* handle to the window */
1716     VARARG(text,unicode_str);     /* window text */
1717 @END
1718
1719
1720 /* Increment the window paint count */
1721 @REQ(inc_window_paint_count)
1722     user_handle_t  handle;        /* handle to the window */
1723     int             incr;         /* increment (can be negative) */
1724 @END
1725
1726
1727 /* Get the coordinates offset between two windows */
1728 @REQ(get_windows_offset)
1729     user_handle_t  from;          /* handle to the first window */
1730     user_handle_t  to;            /* handle to the second window */
1731 @REPLY
1732     int            x;             /* x coordinate offset */
1733     int            y;             /* y coordinate offset */
1734 @END
1735
1736
1737 /* Set a window property */
1738 @REQ(set_window_property)
1739     user_handle_t  window;        /* handle to the window */
1740     atom_t         atom;          /* property atom (high-word set if it was a string) */
1741     int            string;        /* was atom a string originally? */
1742     handle_t       handle;        /* handle to store */
1743 @END
1744
1745
1746 /* Remove a window property */
1747 @REQ(remove_window_property)
1748     user_handle_t  window;        /* handle to the window */
1749     atom_t         atom;          /* property atom */
1750 @REPLY
1751     handle_t       handle;        /* handle stored in property */
1752 @END
1753
1754
1755 /* Get a window property */
1756 @REQ(get_window_property)
1757     user_handle_t  window;        /* handle to the window */
1758     atom_t         atom;          /* property atom */
1759 @REPLY
1760     handle_t       handle;        /* handle stored in property */
1761 @END
1762
1763
1764 /* Get the list of properties of a window */
1765 @REQ(get_window_properties)
1766     user_handle_t  window;        /* handle to the window */
1767 @REPLY
1768     VARARG(props,properties);     /* list of properties */
1769 @END