Use pread/pwrite everywhere to avoid changing the file position while
[wine] / server / protocol.def
1 /* -*- C -*-
2  *
3  * Wine server protocol definition
4  *
5  * Copyright (C) 2001 Alexandre Julliard
6  *
7  * This file is used by tools/make_requests to build the
8  * protocol structures in include/wine/server_protocol.h
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24
25 @HEADER  /* start of C declarations */
26
27 #include <stdarg.h>
28 #include <stdlib.h>
29 #include <time.h>
30
31 #include <windef.h>
32 #include <winbase.h>
33
34 struct request_header
35 {
36     int          req;          /* request code */
37     size_t       request_size; /* request variable part size */
38     size_t       reply_size;   /* reply variable part maximum size */
39 };
40
41 struct reply_header
42 {
43     unsigned int error;        /* error result */
44     size_t       reply_size;   /* reply variable part size */
45 };
46
47 /* placeholder structure for the maximum allowed request size */
48 /* this is used to construct the generic_request union */
49 struct request_max_size
50 {
51     int pad[16]; /* the max request size is 16 ints */
52 };
53
54 typedef void *obj_handle_t;
55 typedef void *user_handle_t;
56 typedef unsigned short atom_t;
57 typedef unsigned int process_id_t;
58 typedef unsigned int thread_id_t;
59
60 #define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
61 #define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */
62
63
64 /* definitions of the event data depending on the event code */
65 struct debug_event_exception
66 {
67     EXCEPTION_RECORD record;   /* exception record */
68     int              first;    /* first chance exception? */
69 };
70 struct debug_event_create_thread
71 {
72     obj_handle_t handle;     /* handle to the new thread */
73     void        *teb;        /* thread teb (in debugged process address space) */
74     void        *start;      /* thread startup routine */
75 };
76 struct debug_event_create_process
77 {
78     obj_handle_t file;       /* handle to the process exe file */
79     obj_handle_t process;    /* handle to the new process */
80     obj_handle_t thread;     /* handle to the new thread */
81     void        *base;       /* base of executable image */
82     int          dbg_offset; /* offset of debug info in file */
83     int          dbg_size;   /* size of debug info */
84     void        *teb;        /* thread teb (in debugged process address space) */
85     void        *start;      /* thread startup routine */
86     void        *name;       /* image name (optional) */
87     int          unicode;    /* is it Unicode? */
88 };
89 struct debug_event_exit
90 {
91     int          exit_code;  /* thread or process exit code */
92 };
93 struct debug_event_load_dll
94 {
95     obj_handle_t handle;     /* file handle for the dll */
96     void        *base;       /* base address of the dll */
97     int          dbg_offset; /* offset of debug info in file */
98     int          dbg_size;   /* size of debug info */
99     void        *name;       /* image name (optional) */
100     int          unicode;    /* is it Unicode? */
101 };
102 struct debug_event_unload_dll
103 {
104     void       *base;       /* base address of the dll */
105 };
106 struct debug_event_output_string
107 {
108     void       *string;     /* string to display (in debugged process address space) */
109     int         unicode;    /* is it Unicode? */
110     int         length;     /* string length */
111 };
112 struct debug_event_rip_info
113 {
114     int         error;      /* ??? */
115     int         type;       /* ??? */
116 };
117 union debug_event_data
118 {
119     struct debug_event_exception      exception;
120     struct debug_event_create_thread  create_thread;
121     struct debug_event_create_process create_process;
122     struct debug_event_exit           exit;
123     struct debug_event_load_dll       load_dll;
124     struct debug_event_unload_dll     unload_dll;
125     struct debug_event_output_string  output_string;
126     struct debug_event_rip_info       rip_info;
127 };
128
129 /* debug event data */
130 typedef struct
131 {
132     int                      code;   /* event code */
133     union debug_event_data   info;   /* event information */
134 } debug_event_t;
135
136 /* structure used in sending an fd from client to server */
137 struct send_fd
138 {
139     thread_id_t tid;  /* thread id */
140     int         fd;   /* file descriptor on client-side */
141 };
142
143 /* structure sent by the server on the wait fifo */
144 struct wake_up_reply
145 {
146     void *cookie;    /* magic cookie that was passed in select_request */
147     int   signaled;  /* wait result */
148 };
149
150 /* structure for absolute timeouts */
151 typedef struct
152 {
153     int            sec;      /* seconds since Unix epoch */
154     int            usec;     /* microseconds */
155 } abs_time_t;
156
157 /* structure returned in the list of window properties */
158 typedef struct
159 {
160     atom_t         atom;     /* property atom */
161     short          string;   /* was atom a string originally? */
162     obj_handle_t   handle;   /* handle stored in property */
163 } property_data_t;
164
165 /* structure to specify window rectangles */
166 typedef struct
167 {
168     int  left;
169     int  top;
170     int  right;
171     int  bottom;
172 } rectangle_t;
173
174 /* structure for console char/attribute info */
175 typedef struct
176 {
177     WCHAR          ch;
178     unsigned short attr;
179 } char_info_t;
180
181 /****************************************************************/
182 /* Request declarations */
183
184 /* Create a new process from the context of the parent */
185 @REQ(new_process)
186     int          inherit_all;  /* inherit all handles from parent */
187     int          create_flags; /* creation flags */
188     int          unix_pid;     /* Unix pid of new process */
189     obj_handle_t exe_file;     /* file handle for main exe */
190     obj_handle_t hstdin;       /* handle for stdin */
191     obj_handle_t hstdout;      /* handle for stdout */
192     obj_handle_t hstderr;      /* handle for stderr */
193     VARARG(info,startup_info); /* startup information */
194 @REPLY
195     obj_handle_t info;         /* new process info handle */
196 @END
197
198
199 /* Retrieve information about a newly started process */
200 @REQ(get_new_process_info)
201     obj_handle_t info;         /* info handle returned from new_process_request */
202     int          pinherit;     /* process handle inherit flag */
203     int          tinherit;     /* thread handle inherit flag */
204 @REPLY
205     process_id_t pid;          /* process id */
206     obj_handle_t phandle;      /* process handle (in the current process) */
207     thread_id_t  tid;          /* thread id */
208     obj_handle_t thandle;      /* thread handle (in the current process) */
209     int          success;      /* did the process start successfully? */
210 @END
211
212
213 /* Create a new thread from the context of the parent */
214 @REQ(new_thread)
215     int          suspend;      /* new thread should be suspended on creation */
216     int          inherit;      /* inherit flag */
217     int          request_fd;   /* fd for request pipe */
218 @REPLY
219     thread_id_t  tid;          /* thread id */
220     obj_handle_t handle;       /* thread handle (in the current process) */
221 @END
222
223
224 /* Signal that we are finished booting on the client side */
225 @REQ(boot_done)
226     int          debug_level;  /* new debug level */
227 @END
228
229
230 /* Initialize a process; called from the new process context */
231 @REQ(init_process)
232     void*        peb;          /* addr of PEB */
233     void*        ldt_copy;     /* addr of LDT copy */
234 @REPLY
235     int          create_flags; /* creation flags */
236     unsigned int server_start; /* server start time (GetTickCount) */
237     size_t       info_size;    /* total size of startup info */
238     obj_handle_t exe_file;     /* file handle for main exe */
239     obj_handle_t hstdin;       /* handle for stdin */
240     obj_handle_t hstdout;      /* handle for stdout */
241     obj_handle_t hstderr;      /* handle for stderr */
242 @END
243
244
245 /* Retrieve the new process startup info */
246 @REQ(get_startup_info)
247 @REPLY
248     VARARG(info,startup_info); /* startup information */
249 @END
250
251
252 /* Signal the end of the process initialization */
253 @REQ(init_process_done)
254     void*        module;       /* main module base address */
255     size_t       module_size;  /* main module size */
256     void*        entry;        /* process entry point */
257     void*        name;         /* ptr to ptr to name (in process addr space) */
258     obj_handle_t exe_file;     /* file handle for main exe */
259     int          gui;          /* is it a GUI process? */
260     VARARG(filename,unicode_str); /* file name of main exe */
261 @END
262
263
264 /* Initialize a thread; called from the child after fork()/clone() */
265 @REQ(init_thread)
266     int          unix_pid;     /* Unix pid of new thread */
267     int          unix_tid;     /* Unix tid of new thread */
268     void*        teb;          /* TEB of new thread (in thread address space) */
269     void*        entry;        /* thread entry point (in thread address space) */
270     int          reply_fd;     /* fd for reply pipe */
271     int          wait_fd;      /* fd for blocking calls pipe */
272 @REPLY
273     process_id_t pid;          /* process id of the new thread's process */
274     thread_id_t  tid;          /* thread id of the new thread */
275     int          boot;         /* is this the boot thread? */
276     int          version;      /* protocol version */
277 @END
278
279
280 /* Terminate a process */
281 @REQ(terminate_process)
282     obj_handle_t handle;       /* process handle to terminate */
283     int          exit_code;    /* process exit code */
284 @REPLY
285     int          self;         /* suicide? */
286 @END
287
288
289 /* Terminate a thread */
290 @REQ(terminate_thread)
291     obj_handle_t handle;       /* thread handle to terminate */
292     int          exit_code;    /* thread exit code */
293 @REPLY
294     int          self;         /* suicide? */
295     int          last;         /* last thread in this process? */
296 @END
297
298
299 /* Retrieve information about a process */
300 @REQ(get_process_info)
301     obj_handle_t handle;           /* process handle */
302 @REPLY
303     process_id_t pid;              /* server process id */
304     int          exit_code;        /* process exit code */
305     int          priority;         /* priority class */
306     int          process_affinity; /* process affinity mask */
307     int          system_affinity;  /* system affinity mask */
308 @END
309
310
311 /* Set a process informations */
312 @REQ(set_process_info)
313     obj_handle_t handle;       /* process handle */
314     int          mask;         /* setting mask (see below) */
315     int          priority;     /* priority class */
316     int          affinity;     /* affinity mask */
317 @END
318 #define SET_PROCESS_INFO_PRIORITY 0x01
319 #define SET_PROCESS_INFO_AFFINITY 0x02
320
321
322 /* Retrieve information about a thread */
323 @REQ(get_thread_info)
324     obj_handle_t handle;        /* thread handle */
325     thread_id_t  tid_in;        /* thread id (optional) */
326 @REPLY
327     process_id_t pid;           /* server process id */
328     thread_id_t  tid;           /* server thread id */
329     void*        teb;           /* thread teb pointer */
330     int          exit_code;     /* thread exit code */
331     int          priority;      /* thread priority level */
332     int          affinity;      /* thread affinity mask */
333     time_t       creation_time; /* thread creation time */
334     time_t       exit_time;     /* thread exit time */
335 @END
336
337
338 /* Set a thread informations */
339 @REQ(set_thread_info)
340     obj_handle_t handle;       /* thread handle */
341     int          mask;         /* setting mask (see below) */
342     int          priority;     /* priority class */
343     int          affinity;     /* affinity mask */
344 @END
345 #define SET_THREAD_INFO_PRIORITY 0x01
346 #define SET_THREAD_INFO_AFFINITY 0x02
347
348
349 /* Retrieve information about a module */
350 @REQ(get_dll_info)
351     obj_handle_t handle;       /* process handle */
352     void*        base_address; /* base address of module */
353 @REPLY
354     size_t       size;          /* module size */
355     void*        entry_point;
356     VARARG(filename,unicode_str); /* file name of module */
357 @END
358
359
360 /* Suspend a thread */
361 @REQ(suspend_thread)
362     obj_handle_t handle;       /* thread handle */
363 @REPLY
364     int          count;        /* new suspend count */
365 @END
366
367
368 /* Resume a thread */
369 @REQ(resume_thread)
370     obj_handle_t handle;       /* thread handle */
371 @REPLY
372     int          count;        /* new suspend count */
373 @END
374
375
376 /* Notify the server that a dll has been loaded */
377 @REQ(load_dll)
378     obj_handle_t handle;       /* file handle */
379     void*        base;         /* base address */
380     size_t       size;         /* dll size */
381     int          dbg_offset;   /* debug info offset */
382     int          dbg_size;     /* debug info size */
383     void*        name;         /* ptr to ptr to name (in process addr space) */
384     VARARG(filename,unicode_str); /* file name of dll */
385 @END
386
387
388 /* Notify the server that a dll is being unloaded */
389 @REQ(unload_dll)
390     void*        base;         /* base address */
391 @END
392
393
394 /* Queue an APC for a thread */
395 @REQ(queue_apc)
396     obj_handle_t handle;       /* thread handle */
397     int          user;         /* user or system apc? */
398     void*        func;         /* function to call */
399     void*        arg1;         /* params for function to call */
400     void*        arg2;
401     void*        arg3;
402 @END
403
404
405 /* Get next APC to call */
406 @REQ(get_apc)
407     int          alertable;    /* is thread alertable? */
408 @REPLY
409     void*        func;         /* function to call */
410     int          type;         /* function type */
411     void*        arg1;         /* function arguments */
412     void*        arg2;
413     void*        arg3;
414 @END
415 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
416
417
418 /* Close a handle for the current process */
419 @REQ(close_handle)
420     obj_handle_t handle;       /* handle to close */
421 @REPLY
422     int          fd;           /* associated fd to close */
423 @END
424
425
426 /* Set a handle information */
427 @REQ(set_handle_info)
428     obj_handle_t handle;       /* handle we are interested in */
429     int          flags;        /* new handle flags */
430     int          mask;         /* mask for flags to set */
431     int          fd;           /* file descriptor or -1 */
432 @REPLY
433     int          old_flags;    /* old flag value */
434     int          cur_fd;       /* current file descriptor */
435 @END
436
437
438 /* Duplicate a handle */
439 @REQ(dup_handle)
440     obj_handle_t src_process;  /* src process handle */
441     obj_handle_t src_handle;   /* src handle to duplicate */
442     obj_handle_t dst_process;  /* dst process handle */
443     unsigned int access;       /* wanted access rights */
444     int          inherit;      /* inherit flag */
445     int          options;      /* duplicate options (see below) */
446 @REPLY
447     obj_handle_t handle;       /* duplicated handle in dst process */
448     int          fd;           /* associated fd to close */
449 @END
450 #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
451 #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
452 #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */
453
454
455 /* Open a handle to a process */
456 @REQ(open_process)
457     process_id_t pid;          /* process id to open */
458     unsigned int access;       /* wanted access rights */
459     int          inherit;      /* inherit flag */
460 @REPLY
461     obj_handle_t handle;       /* handle to the process */
462 @END
463
464
465 /* Open a handle to a thread */
466 @REQ(open_thread)
467     thread_id_t  tid;          /* thread id to open */
468     unsigned int access;       /* wanted access rights */
469     int          inherit;      /* inherit flag */
470 @REPLY
471     obj_handle_t handle;       /* handle to the thread */
472 @END
473
474
475 /* Wait for handles */
476 @REQ(select)
477     int          flags;        /* wait flags (see below) */
478     void*        cookie;       /* magic cookie to return to client */
479     abs_time_t   timeout;      /* absolute timeout */
480     VARARG(handles,handles);   /* handles to select on */
481 @END
482 #define SELECT_ALL           1
483 #define SELECT_ALERTABLE     2
484 #define SELECT_INTERRUPTIBLE 4
485 #define SELECT_TIMEOUT       8
486
487
488 /* Create an event */
489 @REQ(create_event)
490     int          manual_reset;  /* manual reset event */
491     int          initial_state; /* initial state of the event */
492     int          inherit;       /* inherit flag */
493     VARARG(name,unicode_str);   /* object name */
494 @REPLY
495     obj_handle_t handle;        /* handle to the event */
496 @END
497
498 /* Event operation */
499 @REQ(event_op)
500     obj_handle_t  handle;       /* handle to event */
501     int           op;           /* event operation (see below) */
502 @END
503 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
504
505
506 /* Open an event */
507 @REQ(open_event)
508     unsigned int access;        /* wanted access rights */
509     int          inherit;       /* inherit flag */
510     VARARG(name,unicode_str);   /* object name */
511 @REPLY
512     obj_handle_t handle;        /* handle to the event */
513 @END
514
515
516 /* Create a mutex */
517 @REQ(create_mutex)
518     int          owned;         /* initially owned? */
519     int          inherit;       /* inherit flag */
520     VARARG(name,unicode_str);   /* object name */
521 @REPLY
522     obj_handle_t handle;        /* handle to the mutex */
523 @END
524
525
526 /* Release a mutex */
527 @REQ(release_mutex)
528     obj_handle_t handle;        /* handle to the mutex */
529 @END
530
531
532 /* Open a mutex */
533 @REQ(open_mutex)
534     unsigned int access;        /* wanted access rights */
535     int          inherit;       /* inherit flag */
536     VARARG(name,unicode_str);   /* object name */
537 @REPLY
538     obj_handle_t handle;        /* handle to the mutex */
539 @END
540
541
542 /* Create a semaphore */
543 @REQ(create_semaphore)
544     unsigned int initial;       /* initial count */
545     unsigned int max;           /* maximum count */
546     int          inherit;       /* inherit flag */
547     VARARG(name,unicode_str);   /* object name */
548 @REPLY
549     obj_handle_t handle;        /* handle to the semaphore */
550 @END
551
552
553 /* Release a semaphore */
554 @REQ(release_semaphore)
555     obj_handle_t handle;        /* handle to the semaphore */
556     unsigned int count;         /* count to add to semaphore */
557 @REPLY
558     unsigned int prev_count;    /* previous semaphore count */
559 @END
560
561
562 /* Open a semaphore */
563 @REQ(open_semaphore)
564     unsigned int access;        /* wanted access rights */
565     int          inherit;       /* inherit flag */
566     VARARG(name,unicode_str);   /* object name */
567 @REPLY
568     obj_handle_t handle;        /* handle to the semaphore */
569 @END
570
571
572 /* Create a file */
573 @REQ(create_file)
574     unsigned int access;        /* wanted access rights */
575     int          inherit;       /* inherit flag */
576     unsigned int sharing;       /* sharing flags */
577     int          create;        /* file create action */
578     unsigned int options;       /* file options */
579     unsigned int attrs;         /* file attributes for creation */
580     VARARG(filename,string);    /* file name */
581 @REPLY
582     obj_handle_t handle;        /* handle to the file */
583 @END
584
585
586 /* Allocate a file handle for a Unix fd */
587 @REQ(alloc_file_handle)
588     unsigned int access;        /* wanted access rights */
589     int          inherit;       /* inherit flag */
590     int          fd;            /* file descriptor on the client side */
591 @REPLY
592     obj_handle_t handle;        /* handle to the file */
593 @END
594
595
596 /* Get a Unix fd to access a file */
597 @REQ(get_handle_fd)
598     obj_handle_t handle;        /* handle to the file */
599     unsigned int access;        /* wanted access rights */
600 @REPLY
601     int          fd;            /* file descriptor */
602     int          type;          /* the type of file (see below) */
603     int          flags;         /* file read/write flags (see below) */
604 @END
605 enum fd_type
606 {
607     FD_TYPE_INVALID,
608     FD_TYPE_DEFAULT,
609     FD_TYPE_SOCKET,
610     FD_TYPE_SMB
611 };
612 #define FD_FLAG_OVERLAPPED         0x01
613 #define FD_FLAG_TIMEOUT            0x02
614 #define FD_FLAG_RECV_SHUTDOWN      0x04
615 #define FD_FLAG_SEND_SHUTDOWN      0x08
616
617
618 /* Flush a file buffers */
619 @REQ(flush_file)
620     obj_handle_t handle;        /* handle to the file */
621 @REPLY
622     obj_handle_t event;         /* event set when finished */
623 @END
624
625
626 /* Lock a region of a file */
627 @REQ(lock_file)
628     obj_handle_t handle;        /* handle to the file */
629     unsigned int offset_low;    /* offset of start of lock */
630     unsigned int offset_high;   /* offset of start of lock */
631     unsigned int count_low;     /* count of bytes to lock */
632     unsigned int count_high;    /* count of bytes to lock */
633     int          shared;        /* shared or exclusive lock? */
634     int          wait;          /* do we want to wait? */
635 @REPLY
636     obj_handle_t handle;        /* handle to wait on */
637     int          overlapped;    /* is it an overlapped I/O handle? */
638 @END
639
640
641 /* Unlock a region of a file */
642 @REQ(unlock_file)
643     obj_handle_t handle;        /* handle to the file */
644     unsigned int offset_low;    /* offset of start of unlock */
645     unsigned int offset_high;   /* offset of start of unlock */
646     unsigned int count_low;     /* count of bytes to unlock */
647     unsigned int count_high;    /* count of bytes to unlock */
648 @END
649
650
651 /* Create a socket */
652 @REQ(create_socket)
653     unsigned int access;        /* wanted access rights */
654     int          inherit;       /* inherit flag */
655     int          family;        /* family, see socket manpage */
656     int          type;          /* type, see socket manpage */
657     int          protocol;      /* protocol, see socket manpage */
658     unsigned int flags;         /* socket flags */
659 @REPLY
660     obj_handle_t handle;        /* handle to the new socket */
661 @END
662
663
664 /* Accept a socket */
665 @REQ(accept_socket)
666     obj_handle_t lhandle;       /* handle to the listening socket */
667     unsigned int access;        /* wanted access rights */
668     int          inherit;       /* inherit flag */
669 @REPLY
670     obj_handle_t handle;        /* handle to the new socket */
671 @END
672
673
674 /* Set socket event parameters */
675 @REQ(set_socket_event)
676     obj_handle_t  handle;        /* handle to the socket */
677     unsigned int  mask;          /* event mask */
678     obj_handle_t  event;         /* event object */
679     user_handle_t window;        /* window to send the message to */
680     unsigned int  msg;           /* message to send */
681 @END
682
683
684 /* Get socket event parameters */
685 @REQ(get_socket_event)
686     obj_handle_t handle;        /* handle to the socket */
687     int          service;       /* clear pending? */
688     obj_handle_t c_event;       /* event to clear */
689 @REPLY
690     unsigned int mask;          /* event mask */
691     unsigned int pmask;         /* pending events */
692     unsigned int state;         /* status bits */
693     VARARG(errors,ints);        /* event errors */
694 @END
695
696
697 /* Reenable pending socket events */
698 @REQ(enable_socket_event)
699     obj_handle_t handle;        /* handle to the socket */
700     unsigned int mask;          /* events to re-enable */
701     unsigned int sstate;        /* status bits to set */
702     unsigned int cstate;        /* status bits to clear */
703 @END
704
705 @REQ(set_socket_deferred)
706     obj_handle_t handle;        /* handle to the socket */
707     obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
708 @END
709
710 /* Allocate a console (only used by a console renderer) */
711 @REQ(alloc_console)
712     unsigned int access;        /* wanted access rights */
713     int          inherit;       /* inherit flag */
714     process_id_t pid;           /* pid of process which shall be attached to the console */
715 @REPLY
716     obj_handle_t handle_in;     /* handle to console input */
717     obj_handle_t event;         /* handle to renderer events change notification */
718 @END
719
720
721 /* Free the console of the current process */
722 @REQ(free_console)
723 @END
724
725
726 #define CONSOLE_RENDERER_NONE_EVENT        0x00
727 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
728 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
729 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
730 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
731 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
732 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
733 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
734 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
735 struct console_renderer_event
736 {
737     short event;
738     union
739     {
740         struct update
741         {
742             short top;
743             short bottom;
744         } update;
745         struct resize
746         {
747             short width;
748             short height;
749         } resize;
750         struct cursor_pos
751         {
752             short x;
753             short y;
754         } cursor_pos;
755         struct cursor_geom
756         {
757             short visible;
758             short size;
759         } cursor_geom;
760         struct display
761         {
762             short left;
763             short top;
764             short width;
765             short height;
766         } display;
767     } u;
768 };
769
770 /* retrieve console events for the renderer */
771 @REQ(get_console_renderer_events)
772     obj_handle_t handle;        /* handle to console input events */
773 @REPLY
774     VARARG(data,bytes);         /* the various console_renderer_events */
775 @END
776
777
778 /* Open a handle to the process console */
779 @REQ(open_console)
780     int          from;          /* 0 (resp 1) input (resp output) of current process console */
781                                 /* otherwise console_in handle to get active screen buffer? */
782     unsigned int access;        /* wanted access rights */
783     int          inherit;       /* inherit flag */
784     int          share;         /* share mask (only for output handles) */
785 @REPLY
786     obj_handle_t handle;        /* handle to the console */
787 @END
788
789
790 /* Get the input queue wait event */
791 @REQ(get_console_wait_event)
792 @REPLY
793     obj_handle_t handle;
794 @END
795
796 /* Get a console mode (input or output) */
797 @REQ(get_console_mode)
798     obj_handle_t handle;        /* handle to the console */
799 @REPLY
800     int          mode;          /* console mode */
801 @END
802
803
804 /* Set a console mode (input or output) */
805 @REQ(set_console_mode)
806     obj_handle_t handle;        /* handle to the console */
807     int          mode;          /* console mode */
808 @END
809
810
811 /* Set info about a console (input only) */
812 @REQ(set_console_input_info)
813     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
814     int          mask;          /* setting mask (see below) */
815     obj_handle_t active_sb;     /* active screen buffer */
816     int          history_mode;  /* whether we duplicate lines in history */
817     int          history_size;  /* number of lines in history */
818     int          edition_mode;  /* index to the edition mode flavors */
819     VARARG(title,unicode_str);  /* console title */
820 @END
821 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
822 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
823 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
824 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
825 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10
826
827
828 /* Get info about a console (input only) */
829 @REQ(get_console_input_info)
830     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
831 @REPLY
832     int          history_mode;  /* whether we duplicate lines in history */
833     int          history_size;  /* number of lines in history */
834     int          history_index; /* number of used lines in history */
835     int          edition_mode;  /* index to the edition mode flavors */
836     VARARG(title,unicode_str);  /* console title */
837 @END
838
839
840 /* appends a string to console's history */
841 @REQ(append_console_input_history)
842     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
843     VARARG(line,unicode_str);   /* line to add */
844 @END
845
846
847 /* appends a string to console's history */
848 @REQ(get_console_input_history)
849     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
850     int          index;         /* index to get line from */
851 @REPLY
852     int          total;         /* total length of line in Unicode chars */
853     VARARG(line,unicode_str);   /* line to add */
854 @END
855
856
857 /* creates a new screen buffer on process' console */
858 @REQ(create_console_output)
859     obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
860     int          access;        /* wanted access rights */
861     int          share;         /* sharing credentials */
862     int          inherit;       /* inherit flag */
863 @REPLY
864     obj_handle_t handle_out;    /* handle to the screen buffer */
865 @END
866
867
868 /* Set info about a console (output only) */
869 @REQ(set_console_output_info)
870     obj_handle_t handle;        /* handle to the console */
871     int          mask;          /* setting mask (see below) */
872     short int    cursor_size;   /* size of cursor (percentage filled) */
873     short int    cursor_visible;/* cursor visibility flag */
874     short int    cursor_x;      /* position of cursor (x, y) */
875     short int    cursor_y;
876     short int    width;         /* width of the screen buffer */
877     short int    height;        /* height of the screen buffer */
878     short int    attr;          /* default attribute */
879     short int    win_left;      /* window actually displayed by renderer */
880     short int    win_top;       /* the rect area is expressed withing the */
881     short int    win_right;     /* boundaries of the screen buffer */
882     short int    win_bottom;
883     short int    max_width;     /* maximum size (width x height) for the window */
884     short int    max_height;
885 @END
886 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
887 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
888 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
889 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
890 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
891 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
892
893
894 /* Get info about a console (output only) */
895 @REQ(get_console_output_info)
896     obj_handle_t handle;        /* handle to the console */
897 @REPLY
898     short int    cursor_size;   /* size of cursor (percentage filled) */
899     short int    cursor_visible;/* cursor visibility flag */
900     short int    cursor_x;      /* position of cursor (x, y) */
901     short int    cursor_y;
902     short int    width;         /* width of the screen buffer */
903     short int    height;        /* height of the screen buffer */
904     short int    attr;          /* default attribute */
905     short int    win_left;      /* window actually displayed by renderer */
906     short int    win_top;       /* the rect area is expressed withing the */
907     short int    win_right;     /* boundaries of the screen buffer */
908     short int    win_bottom;
909     short int    max_width;     /* maximum size (width x height) for the window */
910     short int    max_height;
911 @END
912
913 /* Add input records to a console input queue */
914 @REQ(write_console_input)
915     obj_handle_t handle;        /* handle to the console input */
916     VARARG(rec,input_records);  /* input records */
917 @REPLY
918     int          written;       /* number of records written */
919 @END
920
921
922 /* Fetch input records from a console input queue */
923 @REQ(read_console_input)
924     obj_handle_t handle;        /* handle to the console input */
925     int          flush;         /* flush the retrieved records from the queue? */
926 @REPLY
927     int          read;          /* number of records read */
928     VARARG(rec,input_records);  /* input records */
929 @END
930
931
932 /* write data (chars and/or attributes) in a screen buffer */
933 @REQ(write_console_output)
934     obj_handle_t handle;        /* handle to the console output */
935     int          x;             /* position where to start writing */
936     int          y;
937     int          mode;          /* char info (see below) */
938     int          wrap;          /* wrap around at end of line? */
939     VARARG(data,bytes);         /* info to write */
940 @REPLY
941     int          written;       /* number of char infos actually written */
942     int          width;         /* width of screen buffer */
943     int          height;        /* height of screen buffer */
944 @END
945 enum char_info_mode
946 {
947     CHAR_INFO_MODE_TEXT,        /* characters only */
948     CHAR_INFO_MODE_ATTR,        /* attributes only */
949     CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
950     CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
951 };
952
953
954 /* fill a screen buffer with constant data (chars and/or attributes) */
955 @REQ(fill_console_output)
956     obj_handle_t handle;        /* handle to the console output */
957     int          x;             /* position where to start writing */
958     int          y;
959     int          mode;          /* char info mode */
960     int          count;         /* number to write */
961     int          wrap;          /* wrap around at end of line? */
962     char_info_t  data;          /* data to write */
963 @REPLY
964     int          written;       /* number of char infos actually written */
965 @END
966
967
968 /* read data (chars and/or attributes) from a screen buffer */
969 @REQ(read_console_output)
970     obj_handle_t handle;        /* handle to the console output */
971     int          x;             /* position (x,y) where to start reading */
972     int          y;
973     int          mode;          /* char info mode */
974     int          wrap;          /* wrap around at end of line? */
975 @REPLY
976     int          width;         /* width of screen buffer */
977     int          height;        /* height of screen buffer */
978     VARARG(data,bytes);
979 @END
980
981
982 /* move a rect (of data) in screen buffer content */
983 @REQ(move_console_output)
984     obj_handle_t handle;        /* handle to the console output */
985     short int    x_src;         /* position (x, y) of rect to start moving from */
986     short int    y_src;
987     short int    x_dst;         /* position (x, y) of rect to move to */
988     short int    y_dst;
989     short int    w;             /* size of the rect (width, height) to move */
990     short int    h;
991 @END
992
993
994 /* Sends a signal to a process group */
995 @REQ(send_console_signal)
996     int          signal;        /* the signal to send */
997     process_id_t group_id;      /* the group to send the signal to */
998 @END
999
1000
1001 /* Create a change notification */
1002 @REQ(create_change_notification)
1003     obj_handle_t handle;        /* handle to the directory */
1004     int          subtree;       /* watch all the subtree */
1005     unsigned int filter;        /* notification filter */
1006 @REPLY
1007     obj_handle_t handle;        /* handle to the change notification */
1008 @END
1009
1010
1011 /* Move to the next change notification */
1012 @REQ(next_change_notification)
1013     obj_handle_t handle;        /* handle to the change notification */
1014 @END
1015
1016 /* Create a file mapping */
1017 @REQ(create_mapping)
1018     int          size_high;     /* mapping size */
1019     int          size_low;      /* mapping size */
1020     int          protect;       /* protection flags (see below) */
1021     unsigned int access;        /* wanted access rights */
1022     int          inherit;       /* inherit flag */
1023     obj_handle_t file_handle;   /* file handle */
1024     VARARG(name,unicode_str);   /* object name */
1025 @REPLY
1026     obj_handle_t handle;        /* handle to the mapping */
1027 @END
1028 /* protection flags */
1029 #define VPROT_READ       0x01
1030 #define VPROT_WRITE      0x02
1031 #define VPROT_EXEC       0x04
1032 #define VPROT_WRITECOPY  0x08
1033 #define VPROT_GUARD      0x10
1034 #define VPROT_NOCACHE    0x20
1035 #define VPROT_COMMITTED  0x40
1036 #define VPROT_IMAGE      0x80
1037
1038
1039 /* Open a mapping */
1040 @REQ(open_mapping)
1041     unsigned int access;        /* wanted access rights */
1042     int          inherit;       /* inherit flag */
1043     VARARG(name,unicode_str);   /* object name */
1044 @REPLY
1045     obj_handle_t handle;        /* handle to the mapping */
1046 @END
1047
1048
1049 /* Get information about a file mapping */
1050 @REQ(get_mapping_info)
1051     obj_handle_t handle;        /* handle to the mapping */
1052 @REPLY
1053     int          size_high;     /* mapping size */
1054     int          size_low;      /* mapping size */
1055     int          protect;       /* protection flags */
1056     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
1057     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
1058     obj_handle_t shared_file;   /* shared mapping file handle */
1059     int          shared_size;   /* shared mapping size */
1060 @END
1061
1062
1063 #define SNAP_HEAPLIST   0x00000001
1064 #define SNAP_PROCESS    0x00000002
1065 #define SNAP_THREAD     0x00000004
1066 #define SNAP_MODULE     0x00000008
1067 /* Create a snapshot */
1068 @REQ(create_snapshot)
1069     int          inherit;       /* inherit flag */
1070     int          flags;         /* snapshot flags (SNAP_*) */
1071     process_id_t pid;           /* process id */
1072 @REPLY
1073     obj_handle_t handle;        /* handle to the snapshot */
1074 @END
1075
1076
1077 /* Get the next process from a snapshot */
1078 @REQ(next_process)
1079     obj_handle_t handle;        /* handle to the snapshot */
1080     int          reset;         /* reset snapshot position? */
1081 @REPLY
1082     int          count;         /* process usage count */
1083     process_id_t pid;           /* process id */
1084     process_id_t ppid;          /* parent process id */
1085     void*        heap;          /* heap base */
1086     void*        module;        /* main module */
1087     int          threads;       /* number of threads */
1088     int          priority;      /* process priority */
1089     int          handles;       /* number of handles */
1090     VARARG(filename,unicode_str); /* file name of main exe */
1091 @END
1092
1093
1094 /* Get the next thread from a snapshot */
1095 @REQ(next_thread)
1096     obj_handle_t handle;        /* handle to the snapshot */
1097     int          reset;         /* reset snapshot position? */
1098 @REPLY
1099     int          count;         /* thread usage count */
1100     process_id_t pid;           /* process id */
1101     thread_id_t  tid;           /* thread id */
1102     int          base_pri;      /* base priority */
1103     int          delta_pri;     /* delta priority */
1104 @END
1105
1106
1107 /* Get the next module from a snapshot */
1108 @REQ(next_module)
1109     obj_handle_t handle;        /* handle to the snapshot */
1110     int          reset;         /* reset snapshot position? */
1111 @REPLY
1112     process_id_t pid;           /* process id */
1113     void*        base;          /* module base address */
1114     size_t       size;          /* module size */
1115     VARARG(filename,unicode_str); /* file name of module */
1116 @END
1117
1118
1119 /* Wait for a debug event */
1120 @REQ(wait_debug_event)
1121     int           get_handle;  /* should we alloc a handle for waiting? */
1122 @REPLY
1123     process_id_t  pid;         /* process id */
1124     thread_id_t   tid;         /* thread id */
1125     obj_handle_t  wait;        /* wait handle if no event ready */
1126     VARARG(event,debug_event); /* debug event data */
1127 @END
1128
1129
1130 /* Queue an exception event */
1131 @REQ(queue_exception_event)
1132     int              first;    /* first chance exception? */
1133     VARARG(record,exc_event);  /* thread context followed by exception record */
1134 @REPLY
1135     obj_handle_t     handle;   /* handle to the queued event */
1136 @END
1137
1138
1139 /* Retrieve the status of an exception event */
1140 @REQ(get_exception_status)
1141     obj_handle_t     handle;   /* handle to the queued event */
1142 @REPLY
1143     int              status;   /* event continuation status */
1144     VARARG(context,context);   /* modified thread context */
1145 @END
1146
1147
1148 /* Send an output string to the debugger */
1149 @REQ(output_debug_string)
1150     void*         string;      /* string to display (in debugged process address space) */
1151     int           unicode;     /* is it Unicode? */
1152     int           length;      /* string length */
1153 @END
1154
1155
1156 /* Continue a debug event */
1157 @REQ(continue_debug_event)
1158     process_id_t pid;          /* process id to continue */
1159     thread_id_t  tid;          /* thread id to continue */
1160     int          status;       /* continuation status */
1161 @END
1162
1163
1164 /* Start/stop debugging an existing process */
1165 @REQ(debug_process)
1166     process_id_t pid;          /* id of the process to debug */
1167     int          attach;       /* 1=attaching / 0=detaching from the process */
1168 @END
1169
1170
1171 /* Simulate a breakpoint in a process */
1172 @REQ(debug_break)
1173     obj_handle_t handle;       /* process handle */
1174 @REPLY
1175     int          self;         /* was it the caller itself? */
1176 @END
1177
1178
1179 /* Set debugger kill on exit flag */
1180 @REQ(set_debugger_kill_on_exit)
1181     int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
1182 @END
1183
1184
1185 /* Read data from a process address space */
1186 @REQ(read_process_memory)
1187     obj_handle_t handle;       /* process handle */
1188     void*        addr;         /* addr to read from */
1189 @REPLY
1190     VARARG(data,bytes);        /* result data */
1191 @END
1192
1193
1194 /* Write data to a process address space */
1195 @REQ(write_process_memory)
1196     obj_handle_t handle;       /* process handle */
1197     void*        addr;         /* addr to write to (must be int-aligned) */
1198     unsigned int first_mask;   /* mask for first word */
1199     unsigned int last_mask;    /* mask for last word */
1200     VARARG(data,bytes);        /* data to write */
1201 @END
1202
1203
1204 /* Create a registry key */
1205 @REQ(create_key)
1206     obj_handle_t parent;       /* handle to the parent key */
1207     unsigned int access;       /* desired access rights */
1208     unsigned int options;      /* creation options */
1209     time_t       modif;        /* last modification time */
1210     size_t       namelen;      /* length of key name in bytes */
1211     VARARG(name,unicode_str,namelen);  /* key name */
1212     VARARG(class,unicode_str);         /* class name */
1213 @REPLY
1214     obj_handle_t hkey;         /* handle to the created key */
1215     int          created;      /* has it been newly created? */
1216 @END
1217
1218 /* Open a registry key */
1219 @REQ(open_key)
1220     obj_handle_t parent;       /* handle to the parent key */
1221     unsigned int access;       /* desired access rights */
1222     VARARG(name,unicode_str);  /* key name */
1223 @REPLY
1224     obj_handle_t hkey;         /* handle to the open key */
1225 @END
1226
1227
1228 /* Delete a registry key */
1229 @REQ(delete_key)
1230     obj_handle_t hkey;         /* handle to the key */
1231 @END
1232
1233
1234 /* Flush a registry key */
1235 @REQ(flush_key)
1236     obj_handle_t hkey;         /* handle to the key */
1237 @END
1238
1239
1240 /* Enumerate registry subkeys */
1241 @REQ(enum_key)
1242     obj_handle_t hkey;         /* handle to registry key */
1243     int          index;        /* index of subkey (or -1 for current key) */
1244     int          info_class;   /* requested information class */
1245 @REPLY
1246     int          subkeys;      /* number of subkeys */
1247     int          max_subkey;   /* longest subkey name */
1248     int          max_class;    /* longest class name */
1249     int          values;       /* number of values */
1250     int          max_value;    /* longest value name */
1251     int          max_data;     /* longest value data */
1252     time_t       modif;        /* last modification time */
1253     size_t       total;        /* total length needed for full name and class */
1254     size_t       namelen;      /* length of key name in bytes */
1255     VARARG(name,unicode_str,namelen);  /* key name */
1256     VARARG(class,unicode_str);         /* class name */
1257 @END
1258
1259
1260 /* Set a value of a registry key */
1261 @REQ(set_key_value)
1262     obj_handle_t hkey;         /* handle to registry key */
1263     int          type;         /* value type */
1264     size_t       namelen;      /* length of value name in bytes */
1265     VARARG(name,unicode_str,namelen);  /* value name */
1266     VARARG(data,bytes);                /* value data */
1267 @END
1268
1269
1270 /* Retrieve the value of a registry key */
1271 @REQ(get_key_value)
1272     obj_handle_t hkey;         /* handle to registry key */
1273     VARARG(name,unicode_str);  /* value name */
1274 @REPLY
1275     int          type;         /* value type */
1276     size_t       total;        /* total length needed for data */
1277     VARARG(data,bytes);        /* value data */
1278 @END
1279
1280
1281 /* Enumerate a value of a registry key */
1282 @REQ(enum_key_value)
1283     obj_handle_t hkey;         /* handle to registry key */
1284     int          index;        /* value index */
1285     int          info_class;   /* requested information class */
1286 @REPLY
1287     int          type;         /* value type */
1288     size_t       total;        /* total length needed for full name and data */
1289     size_t       namelen;      /* length of value name in bytes */
1290     VARARG(name,unicode_str,namelen);  /* value name */
1291     VARARG(data,bytes);                /* value data */
1292 @END
1293
1294
1295 /* Delete a value of a registry key */
1296 @REQ(delete_key_value)
1297     obj_handle_t hkey;         /* handle to registry key */
1298     VARARG(name,unicode_str);  /* value name */
1299 @END
1300
1301
1302 /* Load a registry branch from a file */
1303 @REQ(load_registry)
1304     obj_handle_t hkey;         /* root key to load to */
1305     obj_handle_t file;         /* file to load from */
1306     VARARG(name,unicode_str);  /* subkey name */
1307 @END
1308
1309
1310 /* UnLoad a registry branch from a file */
1311 @REQ(unload_registry)
1312     obj_handle_t hkey;         /* root key to unload to */
1313 @END
1314
1315
1316 /* Save a registry branch to a file */
1317 @REQ(save_registry)
1318     obj_handle_t hkey;         /* key to save */
1319     obj_handle_t file;         /* file to save to */
1320 @END
1321
1322
1323 /* Save a registry branch at server exit */
1324 @REQ(save_registry_atexit)
1325     obj_handle_t hkey;         /* key to save */
1326     VARARG(file,string);       /* file to save to */
1327 @END
1328
1329
1330 /* Set the current and saving level for the registry */
1331 @REQ(set_registry_levels)
1332     int          current;      /* new current level */
1333     int          saving;       /* new saving level */
1334     int          period;       /* duration between periodic saves (milliseconds) */
1335 @END
1336
1337
1338 @REQ(set_registry_notification)
1339     obj_handle_t hkey;         /* key to watch for changes */
1340     obj_handle_t event;        /* event to set */
1341     int          subtree;      /* should we watch the whole subtree? */
1342     unsigned int filter;       /* things to watch */
1343 @END
1344
1345
1346 /* Create a waitable timer */
1347 @REQ(create_timer)
1348     int          inherit;       /* inherit flag */
1349     int          manual;        /* manual reset */
1350     VARARG(name,unicode_str);   /* object name */
1351 @REPLY
1352     obj_handle_t handle;        /* handle to the timer */
1353 @END
1354
1355
1356 /* Open a waitable timer */
1357 @REQ(open_timer)
1358     unsigned int access;        /* wanted access rights */
1359     int          inherit;       /* inherit flag */
1360     VARARG(name,unicode_str);   /* object name */
1361 @REPLY
1362     obj_handle_t handle;        /* handle to the timer */
1363 @END
1364
1365 /* Set a waitable timer */
1366 @REQ(set_timer)
1367     obj_handle_t handle;        /* handle to the timer */
1368     abs_time_t   expire;        /* next expiration absolute time */
1369     int          period;        /* timer period in ms */
1370     void*        callback;      /* callback function */
1371     void*        arg;           /* callback argument */
1372 @REPLY
1373     int          signaled;      /* was the timer signaled before this call ? */
1374 @END
1375
1376 /* Cancel a waitable timer */
1377 @REQ(cancel_timer)
1378     obj_handle_t handle;        /* handle to the timer */
1379 @REPLY
1380      int         signaled;      /* was the timer signaled before this calltime ? */
1381 @END
1382
1383
1384 /* Retrieve the current context of a thread */
1385 @REQ(get_thread_context)
1386     obj_handle_t handle;       /* thread handle */
1387     unsigned int flags;        /* context flags */
1388 @REPLY
1389     VARARG(context,context);   /* thread context */
1390 @END
1391
1392
1393 /* Set the current context of a thread */
1394 @REQ(set_thread_context)
1395     obj_handle_t handle;       /* thread handle */
1396     unsigned int flags;        /* context flags */
1397     VARARG(context,context);   /* thread context */
1398 @END
1399
1400
1401 /* Fetch a selector entry for a thread */
1402 @REQ(get_selector_entry)
1403     obj_handle_t  handle;      /* thread handle */
1404     int           entry;       /* LDT entry */
1405 @REPLY
1406     unsigned int  base;        /* selector base */
1407     unsigned int  limit;       /* selector limit */
1408     unsigned char flags;       /* selector flags */
1409 @END
1410
1411
1412 /* Add an atom */
1413 @REQ(add_atom)
1414     int           local;       /* is atom in local process table? */
1415     VARARG(name,unicode_str);  /* atom name */
1416 @REPLY
1417     atom_t        atom;        /* resulting atom */
1418 @END
1419
1420
1421 /* Delete an atom */
1422 @REQ(delete_atom)
1423     atom_t        atom;        /* atom handle */
1424     int           local;       /* is atom in local process table? */
1425 @END
1426
1427
1428 /* Find an atom */
1429 @REQ(find_atom)
1430     int          local;        /* is atom in local process table? */
1431     VARARG(name,unicode_str);  /* atom name */
1432 @REPLY
1433     atom_t       atom;         /* atom handle */
1434 @END
1435
1436
1437 /* Get an atom name */
1438 @REQ(get_atom_name)
1439     atom_t       atom;         /* atom handle */
1440     int          local;        /* is atom in local process table? */
1441 @REPLY
1442     int          count;        /* atom lock count */
1443     VARARG(name,unicode_str);  /* atom name */
1444 @END
1445
1446
1447 /* Init the process atom table */
1448 @REQ(init_atom_table)
1449     int          entries;      /* number of entries */
1450 @END
1451
1452
1453 /* Get the message queue of the current thread */
1454 @REQ(get_msg_queue)
1455 @REPLY
1456     obj_handle_t handle;       /* handle to the queue */
1457 @END
1458
1459
1460 /* Set the current message queue wakeup mask */
1461 @REQ(set_queue_mask)
1462     unsigned int wake_mask;    /* wakeup bits mask */
1463     unsigned int changed_mask; /* changed bits mask */
1464     int          skip_wait;    /* will we skip waiting if signaled? */
1465 @REPLY
1466     unsigned int wake_bits;    /* current wake bits */
1467     unsigned int changed_bits; /* current changed bits */
1468 @END
1469
1470
1471 /* Get the current message queue status */
1472 @REQ(get_queue_status)
1473     int          clear;        /* should we clear the change bits? */
1474 @REPLY
1475     unsigned int wake_bits;    /* wake bits */
1476     unsigned int changed_bits; /* changed bits since last time */
1477 @END
1478
1479
1480 /* Wait for a process to start waiting on input */
1481 @REQ(wait_input_idle)
1482     obj_handle_t handle;       /* process handle */
1483     int          timeout;      /* timeout */
1484 @REPLY
1485     obj_handle_t event;        /* handle to idle event */
1486 @END
1487
1488
1489 /* Send a message to a thread queue */
1490 @REQ(send_message)
1491     thread_id_t     id;        /* thread id */
1492     int             type;      /* message type (see below) */
1493     int             flags;     /* message flags (see below) */
1494     user_handle_t   win;       /* window handle */
1495     unsigned int    msg;       /* message code */
1496     unsigned int    wparam;    /* parameters */
1497     unsigned int    lparam;    /* parameters */
1498     int             x;         /* x position */
1499     int             y;         /* y position */
1500     unsigned int    time;      /* message time */
1501     unsigned int    info;      /* extra info */
1502     int             timeout;   /* timeout for reply */
1503     void*           callback;  /* callback address */
1504     VARARG(data,bytes);        /* message data for sent messages */
1505 @END
1506
1507 enum message_type
1508 {
1509     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1510     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1511     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1512     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1513     MSG_CALLBACK_RESULT,/* result of a callback message */
1514     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1515     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1516     MSG_HARDWARE        /* hardware message */
1517 };
1518 #define SEND_MSG_ABORT_IF_HUNG  0x01
1519
1520
1521 /* Get a message from the current queue */
1522 @REQ(get_message)
1523     int             flags;     /* see below */
1524     user_handle_t   get_win;   /* window handle to get */
1525     unsigned int    get_first; /* first message code to get */
1526     unsigned int    get_last;  /* last message code to get */
1527 @REPLY
1528     int             type;      /* message type */
1529     user_handle_t   win;       /* window handle */
1530     unsigned int    msg;       /* message code */
1531     unsigned int    wparam;    /* parameters (callback function for MSG_CALLBACK_RESULT) */
1532     unsigned int    lparam;    /* parameters (result for MSG_CALLBACK_RESULT) */
1533     int             x;         /* x position */
1534     int             y;         /* y position */
1535     unsigned int    time;      /* message time */
1536     unsigned int    info;      /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1537     size_t          total;     /* total size of extra data */
1538     VARARG(data,bytes);        /* message data for sent messages */
1539 @END
1540 #define GET_MSG_REMOVE      1  /* remove the message */
1541 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1542
1543 /* Reply to a sent message */
1544 @REQ(reply_message)
1545     int             type;      /* type of original message */
1546     unsigned int    result;    /* message result */
1547     int             remove;    /* should we remove the message? */
1548     VARARG(data,bytes);        /* message data for sent messages */
1549 @END
1550
1551
1552 /* Retrieve the reply for the last message sent */
1553 @REQ(get_message_reply)
1554     int             cancel;    /* cancel message if not ready? */
1555 @REPLY
1556     unsigned int    result;    /* message result */
1557     VARARG(data,bytes);        /* message data for sent messages */
1558 @END
1559
1560
1561 /* Set a window timer */
1562 @REQ(set_win_timer)
1563     user_handle_t   win;       /* window handle */
1564     unsigned int    msg;       /* message to post */
1565     unsigned int    id;        /* timer id */
1566     unsigned int    rate;      /* timer rate in ms */
1567     unsigned int    lparam;    /* message lparam (callback proc) */
1568 @END
1569
1570
1571 /* Kill a window timer */
1572 @REQ(kill_win_timer)
1573     user_handle_t   win;       /* window handle */
1574     unsigned int    msg;       /* message to post */
1575     unsigned int    id;        /* timer id */
1576 @END
1577
1578
1579 /* Retrieve info about a serial port */
1580 @REQ(get_serial_info)
1581     obj_handle_t handle;       /* handle to comm port */
1582 @REPLY
1583     unsigned int readinterval;
1584     unsigned int readconst;
1585     unsigned int readmult;
1586     unsigned int writeconst;
1587     unsigned int writemult;
1588     unsigned int eventmask;
1589     unsigned int commerror;
1590 @END
1591
1592
1593 /* Set info about a serial port */
1594 @REQ(set_serial_info)
1595     obj_handle_t handle;       /* handle to comm port */
1596     int          flags;        /* bitmask to set values (see below) */
1597     unsigned int readinterval;
1598     unsigned int readconst;
1599     unsigned int readmult;
1600     unsigned int writeconst;
1601     unsigned int writemult;
1602     unsigned int eventmask;
1603     unsigned int commerror;
1604 @END
1605 #define SERIALINFO_SET_TIMEOUTS  0x01
1606 #define SERIALINFO_SET_MASK      0x02
1607 #define SERIALINFO_SET_ERROR     0x04
1608
1609
1610 /* Create / reschedule an async I/O */
1611 @REQ(register_async)
1612     obj_handle_t handle;  /* handle to comm port, socket or file */
1613     int          type;
1614     void*        overlapped;
1615     int          count;
1616     unsigned int status;
1617 @END
1618 #define ASYNC_TYPE_NONE  0x00
1619 #define ASYNC_TYPE_READ  0x01
1620 #define ASYNC_TYPE_WRITE 0x02
1621 #define ASYNC_TYPE_WAIT  0x03
1622
1623
1624 /* Create a named pipe */
1625 @REQ(create_named_pipe)
1626     unsigned int   openmode;
1627     unsigned int   pipemode;
1628     unsigned int   maxinstances;
1629     unsigned int   outsize;
1630     unsigned int   insize;
1631     unsigned int   timeout;
1632     int            inherit;      /* inherit flag */
1633     VARARG(name,unicode_str);    /* pipe name */
1634 @REPLY
1635     obj_handle_t   handle;       /* handle to the pipe */
1636 @END
1637
1638
1639 /* Open an existing named pipe */
1640 @REQ(open_named_pipe)
1641     unsigned int   access;
1642     int            inherit;      /* inherit flag */
1643     VARARG(name,unicode_str);    /* pipe name */
1644 @REPLY
1645     obj_handle_t   handle;       /* handle to the pipe */
1646 @END
1647
1648
1649 /* Connect to a named pipe */
1650 @REQ(connect_named_pipe)
1651     obj_handle_t   handle;
1652     void*          overlapped;
1653     void*          func;
1654 @END
1655
1656
1657 /* Wait for a named pipe */
1658 @REQ(wait_named_pipe)
1659     unsigned int   timeout;
1660     void*          overlapped;
1661     void*          func;
1662     VARARG(name,unicode_str);    /* pipe name */
1663 @END
1664
1665
1666 /* Disconnect a named pipe */
1667 @REQ(disconnect_named_pipe)
1668     obj_handle_t   handle;
1669 @REPLY
1670     int            fd;           /* associated fd to close */
1671 @END
1672
1673
1674 @REQ(get_named_pipe_info)
1675     obj_handle_t   handle;
1676 @REPLY
1677     unsigned int   flags;
1678     unsigned int   maxinstances;
1679     unsigned int   outsize;
1680     unsigned int   insize;
1681 @END
1682
1683
1684 @REQ(create_smb)
1685     int            fd;
1686     unsigned int   tree_id;
1687     unsigned int   user_id;
1688     unsigned int   file_id;
1689     unsigned int   dialect;
1690 @REPLY
1691     obj_handle_t   handle;
1692 @END
1693
1694
1695 @REQ(get_smb_info)
1696     obj_handle_t   handle;
1697     unsigned int   flags;
1698     unsigned int   offset;
1699 @REPLY
1700     unsigned int   tree_id;
1701     unsigned int   user_id;
1702     unsigned int   dialect;
1703     unsigned int   file_id;
1704     unsigned int   offset;
1705 @END
1706 #define SMBINFO_SET_OFFSET    0x01
1707
1708
1709 /* Create a window */
1710 @REQ(create_window)
1711     user_handle_t  parent;      /* parent window */
1712     user_handle_t  owner;       /* owner window */
1713     atom_t         atom;        /* class atom */
1714     void*          instance;    /* module instance */
1715 @REPLY
1716     user_handle_t  handle;      /* created window */
1717     int            extra;       /* number of extra bytes */
1718     void*          class_ptr;   /* pointer to class in client address space */
1719 @END
1720
1721
1722 /* Link a window into the tree */
1723 @REQ(link_window)
1724     user_handle_t  handle;      /* handle to the window */
1725     user_handle_t  parent;      /* handle to the parent */
1726     user_handle_t  previous;    /* previous child in Z-order */
1727 @REPLY
1728     user_handle_t  full_parent; /* full handle of new parent */
1729 @END
1730
1731
1732 /* Destroy a window */
1733 @REQ(destroy_window)
1734     user_handle_t  handle;      /* handle to the window */
1735 @END
1736
1737
1738 /* Set a window owner */
1739 @REQ(set_window_owner)
1740     user_handle_t  handle;      /* handle to the window */
1741     user_handle_t  owner;       /* new owner */
1742 @REPLY
1743     user_handle_t  full_owner;  /* full handle of new owner */
1744     user_handle_t  prev_owner;  /* full handle of previous owner */
1745 @END
1746
1747
1748 /* Get information from a window handle */
1749 @REQ(get_window_info)
1750     user_handle_t  handle;      /* handle to the window */
1751 @REPLY
1752     user_handle_t  full_handle; /* full 32-bit handle */
1753     user_handle_t  last_active; /* last active popup */
1754     process_id_t   pid;         /* process owning the window */
1755     thread_id_t    tid;         /* thread owning the window */
1756     atom_t         atom;        /* class atom */
1757 @END
1758
1759
1760 /* Set some information in a window */
1761 @REQ(set_window_info)
1762     user_handle_t  handle;        /* handle to the window */
1763     unsigned int   flags;         /* flags for fields to set (see below) */
1764     unsigned int   style;         /* window style */
1765     unsigned int   ex_style;      /* window extended style */
1766     unsigned int   id;            /* window id */
1767     void*          instance;      /* creator instance */
1768     void*          user_data;     /* user-specific data */
1769     int            extra_offset;  /* offset to set in extra bytes */
1770     size_t         extra_size;    /* size to set in extra bytes */
1771     unsigned int   extra_value;   /* value to set in extra bytes */
1772 @REPLY
1773     unsigned int   old_style;     /* old window style */
1774     unsigned int   old_ex_style;  /* old window extended style */
1775     unsigned int   old_id;        /* old window id */
1776     void*          old_instance;  /* old creator instance */
1777     void*          old_user_data; /* old user-specific data */
1778     unsigned int   old_extra_value; /* old value in extra bytes */
1779 @END
1780 #define SET_WIN_STYLE     0x01
1781 #define SET_WIN_EXSTYLE   0x02
1782 #define SET_WIN_ID        0x04
1783 #define SET_WIN_INSTANCE  0x08
1784 #define SET_WIN_USERDATA  0x10
1785 #define SET_WIN_EXTRA     0x20
1786
1787
1788 /* Get a list of the window parents, up to the root of the tree */
1789 @REQ(get_window_parents)
1790     user_handle_t  handle;        /* handle to the window */
1791 @REPLY
1792     int            count;         /* total count of parents */
1793     VARARG(parents,user_handles); /* parent handles */
1794 @END
1795
1796
1797 /* Get a list of the window children */
1798 @REQ(get_window_children)
1799     user_handle_t  parent;        /* parent window */
1800     atom_t         atom;          /* class atom for the listed children */
1801     thread_id_t    tid;           /* thread owning the listed children */
1802 @REPLY
1803     int            count;         /* total count of children */
1804     VARARG(children,user_handles); /* children handles */
1805 @END
1806
1807
1808 /* Get window tree information from a window handle */
1809 @REQ(get_window_tree)
1810     user_handle_t  handle;        /* handle to the window */
1811 @REPLY
1812     user_handle_t  parent;        /* parent window */
1813     user_handle_t  owner;         /* owner window */
1814     user_handle_t  next_sibling;  /* next sibling in Z-order */
1815     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1816     user_handle_t  first_sibling; /* first sibling in Z-order */
1817     user_handle_t  last_sibling;  /* last sibling in Z-order */
1818     user_handle_t  first_child;   /* first child */
1819     user_handle_t  last_child;    /* last child */
1820 @END
1821
1822 /* Set the window and client rectangles of a window */
1823 @REQ(set_window_rectangles)
1824     user_handle_t  handle;        /* handle to the window */
1825     rectangle_t    window;        /* window rectangle */
1826     rectangle_t    client;        /* client rectangle */
1827 @END
1828
1829
1830 /* Get the window and client rectangles of a window */
1831 @REQ(get_window_rectangles)
1832     user_handle_t  handle;        /* handle to the window */
1833 @REPLY
1834     rectangle_t    window;        /* window rectangle */
1835     rectangle_t    client;        /* client rectangle */
1836 @END
1837
1838
1839 /* Get the window text */
1840 @REQ(get_window_text)
1841     user_handle_t  handle;        /* handle to the window */
1842 @REPLY
1843     VARARG(text,unicode_str);     /* window text */
1844 @END
1845
1846
1847 /* Set the window text */
1848 @REQ(set_window_text)
1849     user_handle_t  handle;        /* handle to the window */
1850     VARARG(text,unicode_str);     /* window text */
1851 @END
1852
1853
1854 /* Increment the window paint count */
1855 @REQ(inc_window_paint_count)
1856     user_handle_t  handle;        /* handle to the window */
1857     int             incr;         /* increment (can be negative) */
1858 @END
1859
1860
1861 /* Get the coordinates offset between two windows */
1862 @REQ(get_windows_offset)
1863     user_handle_t  from;          /* handle to the first window */
1864     user_handle_t  to;            /* handle to the second window */
1865 @REPLY
1866     int            x;             /* x coordinate offset */
1867     int            y;             /* y coordinate offset */
1868 @END
1869
1870
1871 /* Set a window property */
1872 @REQ(set_window_property)
1873     user_handle_t  window;        /* handle to the window */
1874     atom_t         atom;          /* property atom (high-word set if it was a string) */
1875     int            string;        /* was atom a string originally? */
1876     obj_handle_t   handle;        /* handle to store */
1877 @END
1878
1879
1880 /* Remove a window property */
1881 @REQ(remove_window_property)
1882     user_handle_t  window;        /* handle to the window */
1883     atom_t         atom;          /* property atom */
1884 @REPLY
1885     obj_handle_t   handle;        /* handle stored in property */
1886 @END
1887
1888
1889 /* Get a window property */
1890 @REQ(get_window_property)
1891     user_handle_t  window;        /* handle to the window */
1892     atom_t         atom;          /* property atom */
1893 @REPLY
1894     obj_handle_t   handle;        /* handle stored in property */
1895 @END
1896
1897
1898 /* Get the list of properties of a window */
1899 @REQ(get_window_properties)
1900     user_handle_t  window;        /* handle to the window */
1901 @REPLY
1902     int            total;         /* total number of properties */
1903     VARARG(props,properties);     /* list of properties */
1904 @END
1905
1906
1907 /* Attach (or detach) thread inputs */
1908 @REQ(attach_thread_input)
1909     thread_id_t    tid_from;       /* thread to be attached */
1910     thread_id_t    tid_to;         /* thread to which tid_from should be attached */
1911     int            attach;         /* is it an attach? */
1912 @END
1913
1914
1915 /* Get input data for a given thread */
1916 @REQ(get_thread_input)
1917     thread_id_t    tid;           /* id of thread */
1918 @REPLY
1919     user_handle_t  focus;         /* handle to the focus window */
1920     user_handle_t  capture;       /* handle to the capture window */
1921     user_handle_t  active;        /* handle to the active window */
1922     user_handle_t  foreground;    /* handle to the global foreground window */
1923     user_handle_t  menu_owner;    /* handle to the menu owner */
1924     user_handle_t  move_size;     /* handle to the moving/resizing window */
1925     user_handle_t  caret;         /* handle to the caret window */
1926     rectangle_t    rect;          /* caret rectangle */
1927 @END
1928
1929 /* Retrieve queue keyboard state for a given thread */
1930 @REQ(get_key_state)
1931     thread_id_t    tid;           /* id of thread */
1932     int            key;           /* optional key code or -1 */
1933 @REPLY
1934     unsigned char  state;         /* state of specified key */
1935     VARARG(keystate,bytes);       /* state array for all the keys */
1936 @END
1937
1938 /* Set queue keyboard state for a given thread */
1939 @REQ(set_key_state)
1940     thread_id_t    tid;           /* id of thread */
1941     VARARG(keystate,bytes);       /* state array for all the keys */
1942 @END
1943
1944 /* Set the system foreground window */
1945 @REQ(set_foreground_window)
1946     user_handle_t  handle;        /* handle to the foreground window */
1947 @REPLY
1948     user_handle_t  previous;      /* handle to the previous foreground window */
1949     int            send_msg_old;  /* whether we have to send a msg to the old window */
1950     int            send_msg_new;  /* whether we have to send a msg to the new window */
1951 @END
1952
1953 /* Set the current thread focus window */
1954 @REQ(set_focus_window)
1955     user_handle_t  handle;        /* handle to the focus window */
1956 @REPLY
1957     user_handle_t  previous;      /* handle to the previous focus window */
1958 @END
1959
1960 /* Set the current thread active window */
1961 @REQ(set_active_window)
1962     user_handle_t  handle;        /* handle to the active window */
1963 @REPLY
1964     user_handle_t  previous;      /* handle to the previous active window */
1965 @END
1966
1967 /* Set the current thread capture window */
1968 @REQ(set_capture_window)
1969     user_handle_t  handle;        /* handle to the capture window */
1970     unsigned int   flags;         /* capture flags (see below) */
1971 @REPLY
1972     user_handle_t  previous;      /* handle to the previous capture window */
1973     user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
1974 @END
1975 #define CAPTURE_MENU     0x01  /* capture is for a menu */
1976 #define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */
1977
1978
1979 /* Set the current thread caret window */
1980 @REQ(set_caret_window)
1981     user_handle_t  handle;        /* handle to the caret window */
1982     int            width;         /* caret width */
1983     int            height;        /* caret height */
1984 @REPLY
1985     user_handle_t  previous;      /* handle to the previous caret window */
1986     rectangle_t    old_rect;      /* previous caret rectangle */
1987     int            old_hide;      /* previous hide count */
1988     int            old_state;     /* previous caret state (1=on, 0=off) */
1989 @END
1990
1991
1992 /* Set the current thread caret information */
1993 @REQ(set_caret_info)
1994     unsigned int   flags;         /* caret flags (see below) */
1995     user_handle_t  handle;        /* handle to the caret window */
1996     int            x;             /* caret x position */
1997     int            y;             /* caret y position */
1998     int            hide;          /* increment for hide count (can be negative to show it) */
1999     int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
2000 @REPLY
2001     user_handle_t  full_handle;   /* handle to the current caret window */
2002     rectangle_t    old_rect;      /* previous caret rectangle */
2003     int            old_hide;      /* previous hide count */
2004     int            old_state;     /* previous caret state (1=on, 0=off) */
2005 @END
2006 #define SET_CARET_POS        0x01  /* set the caret position from x,y */
2007 #define SET_CARET_HIDE       0x02  /* increment the caret hide count */
2008 #define SET_CARET_STATE      0x04  /* set the caret on/off state */
2009
2010
2011 /* Set a window hook */
2012 @REQ(set_hook)
2013     int            id;             /* id of the hook */
2014     thread_id_t    tid;            /* id of thread to set the hook into */
2015     void*          proc;           /* hook procedure */
2016     int            unicode;        /* is it a unicode hook? */
2017     VARARG(module,unicode_str);    /* module name */
2018 @REPLY
2019     user_handle_t  handle;         /* handle to the hook */
2020 @END
2021
2022
2023 /* Remove a window hook */
2024 @REQ(remove_hook)
2025     user_handle_t  handle;         /* handle to the hook */
2026     int            id;             /* id of the hook if handle is 0 */
2027     void*          proc;           /* hook procedure if handle is 0 */
2028 @END
2029
2030
2031 /* Start calling a hook chain */
2032 @REQ(start_hook_chain)
2033     int            id;             /* id of the hook */
2034 @REPLY
2035     user_handle_t  handle;         /* handle to the next hook */
2036     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2037     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2038     void*          proc;           /* hook procedure */
2039     int            unicode;        /* is it a unicode hook? */
2040     VARARG(module,unicode_str);    /* module name */
2041 @END
2042
2043
2044 /* Finished calling a hook chain */
2045 @REQ(finish_hook_chain)
2046     int            id;             /* id of the hook */
2047 @END
2048
2049
2050 /* Get the next hook to call */
2051 @REQ(get_next_hook)
2052     user_handle_t  handle;         /* handle to the current hook */
2053 @REPLY
2054     user_handle_t  next;           /* handle to the next hook */
2055     int            id;             /* id of the next hook */
2056     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2057     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2058     void*          proc;           /* next hook procedure */
2059     int            prev_unicode;   /* was the previous a unicode hook? */
2060     int            next_unicode;   /* is the next a unicode hook? */
2061     VARARG(module,unicode_str);    /* module name */
2062 @END
2063
2064
2065 /* Create a window class */
2066 @REQ(create_class)
2067     int            local;          /* is it a local class? */
2068     atom_t         atom;           /* class atom */
2069     unsigned int   style;          /* class style */
2070     void*          instance;       /* module instance */
2071     int            extra;          /* number of extra class bytes */
2072     int            win_extra;      /* number of window extra bytes */
2073     void*          client_ptr;     /* pointer to class in client address space */
2074 @END
2075
2076
2077 /* Destroy a window class */
2078 @REQ(destroy_class)
2079     atom_t         atom;           /* class atom */
2080     void*          instance;       /* module instance */
2081 @REPLY
2082     void*          client_ptr;     /* pointer to class in client address space */
2083 @END
2084
2085
2086 /* Set some information in a class */
2087 @REQ(set_class_info)
2088     user_handle_t  window;         /* handle to the window */
2089     unsigned int   flags;          /* flags for info to set (see below) */
2090     atom_t         atom;           /* class atom */
2091     unsigned int   style;          /* class style */
2092     int            win_extra;      /* number of window extra bytes */
2093     void*          instance;       /* module instance */
2094     int            extra_offset;   /* offset to set in extra bytes */
2095     size_t         extra_size;     /* size to set in extra bytes */
2096     unsigned int   extra_value;    /* value to set in extra bytes */
2097 @REPLY
2098     atom_t         old_atom;       /* previous class atom */
2099     unsigned int   old_style;      /* previous class style */
2100     int            old_extra;      /* previous number of class extra bytes */
2101     int            old_win_extra;  /* previous number of window extra bytes */
2102     void*          old_instance;   /* previous module instance */
2103     unsigned int   old_extra_value; /* old value in extra bytes */
2104 @END
2105 #define SET_CLASS_ATOM      0x0001
2106 #define SET_CLASS_STYLE     0x0002
2107 #define SET_CLASS_WINEXTRA  0x0004
2108 #define SET_CLASS_INSTANCE  0x0008
2109 #define SET_CLASS_EXTRA     0x0010
2110
2111
2112 /* Set/get clipboard information */
2113 @REQ(set_clipboard_info)
2114     unsigned int   flags;       /* flags for fields to set (see below) */
2115     user_handle_t  clipboard;   /* clipboard window */
2116     user_handle_t  owner;       /* clipboard owner */
2117     user_handle_t  viewer;      /* first clipboard viewer */
2118     unsigned int   seqno;       /* change sequence number */
2119 @REPLY
2120     unsigned int   flags;           /* status flags (see below) */
2121     user_handle_t  old_clipboard;   /* old clipboard window */
2122     user_handle_t  old_owner;       /* old clipboard owner */
2123     user_handle_t  old_viewer;      /* old clipboard viewer */
2124     unsigned int   seqno;           /* current sequence number */
2125 @END
2126
2127 #define SET_CB_OPEN      0x001
2128 #define SET_CB_OWNER     0x002
2129 #define SET_CB_VIEWER    0x004
2130 #define SET_CB_SEQNO     0x008
2131 #define SET_CB_RELOWNER  0x010
2132 #define SET_CB_CLOSE     0x020
2133 #define CB_OPEN          0x040
2134 #define CB_OWNER         0x080
2135
2136
2137 /* Open a security token */
2138 @REQ(open_token)
2139     obj_handle_t   handle;    /* handle to the thread or process */
2140     unsigned int   flags;     /* flags (see below) */
2141 @REPLY
2142     obj_handle_t   token;    /* handle to the token */
2143 @END
2144 #define OPEN_TOKEN_THREAD   1
2145 #define OPEN_TOKEN_AS_SELF  2
2146
2147
2148 /* Set/get the global windows */
2149 @REQ(set_global_windows)
2150     unsigned int   flags;               /* flags for fields to set (see below) */
2151     user_handle_t  shell_window;        /* handle to the new shell window */
2152     user_handle_t  shell_listview;      /* handle to the new shell listview window */
2153     user_handle_t  progman_window;      /* handle to the new program manager window */
2154     user_handle_t  taskman_window;      /* handle to the new task manager window */
2155 @REPLY
2156     user_handle_t  old_shell_window;    /* handle to the shell window */
2157     user_handle_t  old_shell_listview;  /* handle to the shell listview window */
2158     user_handle_t  old_progman_window;  /* handle to the new program manager window */
2159     user_handle_t  old_taskman_window;  /* handle to the new task manager window */
2160 @END
2161 #define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
2162 #define SET_GLOBAL_PROGMAN_WINDOW  0x02
2163 #define SET_GLOBAL_TASKMAN_WINDOW  0x04