Moved more GDI definitions to gdi_private.h.
[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 attrs;         /* file attributes for creation */
579     int          removable;     /* is file on removable media? */
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 /* Set a file current position */
618 @REQ(set_file_pointer)
619     obj_handle_t handle;        /* handle to the file */
620     int          low;           /* position low word */
621     int          high;          /* position high word */
622     int          whence;        /* whence to seek */
623 @REPLY
624     int          new_low;       /* new position low word */
625     int          new_high;      /* new position high word */
626 @END
627
628
629 /* Truncate (or extend) a file */
630 @REQ(truncate_file)
631     obj_handle_t handle;        /* handle to the file */
632 @END
633
634
635 /* Set a file access and modification times */
636 @REQ(set_file_time)
637     obj_handle_t handle;        /* handle to the file */
638     time_t       access_time;   /* last access time */
639     time_t       write_time;    /* last write time */
640 @END
641
642
643 /* Flush a file buffers */
644 @REQ(flush_file)
645     obj_handle_t handle;        /* handle to the file */
646 @REPLY
647     obj_handle_t event;         /* event set when finished */
648 @END
649
650
651 /* Get information about a file */
652 @REQ(get_file_info)
653     obj_handle_t handle;        /* handle to the file */
654 @REPLY
655     int          type;          /* file type */
656     int          attr;          /* file attributes */
657     time_t       access_time;   /* last access time */
658     time_t       write_time;    /* last write time */
659     time_t       change_time;   /* last change time */
660     int          size_high;     /* file size */
661     int          size_low;      /* file size */
662     int          alloc_high;    /* size used on disk */
663     int          alloc_low;     /* size used on disk */
664     int          links;         /* number of links */
665     int          index_high;    /* unique index */
666     int          index_low;     /* unique index */
667     unsigned int serial;        /* volume serial number */
668 @END
669
670
671 /* Lock a region of a file */
672 @REQ(lock_file)
673     obj_handle_t handle;        /* handle to the file */
674     unsigned int offset_low;    /* offset of start of lock */
675     unsigned int offset_high;   /* offset of start of lock */
676     unsigned int count_low;     /* count of bytes to lock */
677     unsigned int count_high;    /* count of bytes to lock */
678     int          shared;        /* shared or exclusive lock? */
679     int          wait;          /* do we want to wait? */
680 @REPLY
681     obj_handle_t handle;        /* handle to wait on */
682     int          overlapped;    /* is it an overlapped I/O handle? */
683 @END
684
685
686 /* Unlock a region of a file */
687 @REQ(unlock_file)
688     obj_handle_t handle;        /* handle to the file */
689     unsigned int offset_low;    /* offset of start of unlock */
690     unsigned int offset_high;   /* offset of start of unlock */
691     unsigned int count_low;     /* count of bytes to unlock */
692     unsigned int count_high;    /* count of bytes to unlock */
693 @END
694
695
696 /* Create a socket */
697 @REQ(create_socket)
698     unsigned int access;        /* wanted access rights */
699     int          inherit;       /* inherit flag */
700     int          family;        /* family, see socket manpage */
701     int          type;          /* type, see socket manpage */
702     int          protocol;      /* protocol, see socket manpage */
703     unsigned int flags;         /* socket flags */
704 @REPLY
705     obj_handle_t handle;        /* handle to the new socket */
706 @END
707
708
709 /* Accept a socket */
710 @REQ(accept_socket)
711     obj_handle_t lhandle;       /* handle to the listening socket */
712     unsigned int access;        /* wanted access rights */
713     int          inherit;       /* inherit flag */
714 @REPLY
715     obj_handle_t handle;        /* handle to the new socket */
716 @END
717
718
719 /* Set socket event parameters */
720 @REQ(set_socket_event)
721     obj_handle_t  handle;        /* handle to the socket */
722     unsigned int  mask;          /* event mask */
723     obj_handle_t  event;         /* event object */
724     user_handle_t window;        /* window to send the message to */
725     unsigned int  msg;           /* message to send */
726 @END
727
728
729 /* Get socket event parameters */
730 @REQ(get_socket_event)
731     obj_handle_t handle;        /* handle to the socket */
732     int          service;       /* clear pending? */
733     obj_handle_t c_event;       /* event to clear */
734 @REPLY
735     unsigned int mask;          /* event mask */
736     unsigned int pmask;         /* pending events */
737     unsigned int state;         /* status bits */
738     VARARG(errors,ints);        /* event errors */
739 @END
740
741
742 /* Reenable pending socket events */
743 @REQ(enable_socket_event)
744     obj_handle_t handle;        /* handle to the socket */
745     unsigned int mask;          /* events to re-enable */
746     unsigned int sstate;        /* status bits to set */
747     unsigned int cstate;        /* status bits to clear */
748 @END
749
750 @REQ(set_socket_deferred)
751     obj_handle_t handle;        /* handle to the socket */
752     obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
753 @END
754
755 /* Allocate a console (only used by a console renderer) */
756 @REQ(alloc_console)
757     unsigned int access;        /* wanted access rights */
758     int          inherit;       /* inherit flag */
759     process_id_t pid;           /* pid of process which shall be attached to the console */
760 @REPLY
761     obj_handle_t handle_in;     /* handle to console input */
762     obj_handle_t event;         /* handle to renderer events change notification */
763 @END
764
765
766 /* Free the console of the current process */
767 @REQ(free_console)
768 @END
769
770
771 #define CONSOLE_RENDERER_NONE_EVENT        0x00
772 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
773 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
774 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
775 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
776 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
777 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
778 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
779 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
780 struct console_renderer_event
781 {
782     short event;
783     union
784     {
785         struct update
786         {
787             short top;
788             short bottom;
789         } update;
790         struct resize
791         {
792             short width;
793             short height;
794         } resize;
795         struct cursor_pos
796         {
797             short x;
798             short y;
799         } cursor_pos;
800         struct cursor_geom
801         {
802             short visible;
803             short size;
804         } cursor_geom;
805         struct display
806         {
807             short left;
808             short top;
809             short width;
810             short height;
811         } display;
812     } u;
813 };
814
815 /* retrieve console events for the renderer */
816 @REQ(get_console_renderer_events)
817     obj_handle_t handle;        /* handle to console input events */
818 @REPLY
819     VARARG(data,bytes);         /* the various console_renderer_events */
820 @END
821
822
823 /* Open a handle to the process console */
824 @REQ(open_console)
825     int          from;          /* 0 (resp 1) input (resp output) of current process console */
826                                 /* otherwise console_in handle to get active screen buffer? */
827     unsigned int access;        /* wanted access rights */
828     int          inherit;       /* inherit flag */
829     int          share;         /* share mask (only for output handles) */
830 @REPLY
831     obj_handle_t handle;        /* handle to the console */
832 @END
833
834
835 /* Get the input queue wait event */
836 @REQ(get_console_wait_event)
837 @REPLY
838     obj_handle_t handle;
839 @END
840
841 /* Get a console mode (input or output) */
842 @REQ(get_console_mode)
843     obj_handle_t handle;        /* handle to the console */
844 @REPLY
845     int          mode;          /* console mode */
846 @END
847
848
849 /* Set a console mode (input or output) */
850 @REQ(set_console_mode)
851     obj_handle_t handle;        /* handle to the console */
852     int          mode;          /* console mode */
853 @END
854
855
856 /* Set info about a console (input only) */
857 @REQ(set_console_input_info)
858     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
859     int          mask;          /* setting mask (see below) */
860     obj_handle_t active_sb;     /* active screen buffer */
861     int          history_mode;  /* whether we duplicate lines in history */
862     int          history_size;  /* number of lines in history */
863     int          edition_mode;  /* index to the edition mode flavors */
864     VARARG(title,unicode_str);  /* console title */
865 @END
866 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
867 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
868 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
869 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
870 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10
871
872
873 /* Get info about a console (input only) */
874 @REQ(get_console_input_info)
875     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
876 @REPLY
877     int          history_mode;  /* whether we duplicate lines in history */
878     int          history_size;  /* number of lines in history */
879     int          history_index; /* number of used lines in history */
880     int          edition_mode;  /* index to the edition mode flavors */
881     VARARG(title,unicode_str);  /* console title */
882 @END
883
884
885 /* appends a string to console's history */
886 @REQ(append_console_input_history)
887     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
888     VARARG(line,unicode_str);   /* line to add */
889 @END
890
891
892 /* appends a string to console's history */
893 @REQ(get_console_input_history)
894     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
895     int          index;         /* index to get line from */
896 @REPLY
897     int          total;         /* total length of line in Unicode chars */
898     VARARG(line,unicode_str);   /* line to add */
899 @END
900
901
902 /* creates a new screen buffer on process' console */
903 @REQ(create_console_output)
904     obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
905     int          access;        /* wanted access rights */
906     int          share;         /* sharing credentials */
907     int          inherit;       /* inherit flag */
908 @REPLY
909     obj_handle_t handle_out;    /* handle to the screen buffer */
910 @END
911
912
913 /* Set info about a console (output only) */
914 @REQ(set_console_output_info)
915     obj_handle_t handle;        /* handle to the console */
916     int          mask;          /* setting mask (see below) */
917     short int    cursor_size;   /* size of cursor (percentage filled) */
918     short int    cursor_visible;/* cursor visibility flag */
919     short int    cursor_x;      /* position of cursor (x, y) */
920     short int    cursor_y;
921     short int    width;         /* width of the screen buffer */
922     short int    height;        /* height of the screen buffer */
923     short int    attr;          /* default attribute */
924     short int    win_left;      /* window actually displayed by renderer */
925     short int    win_top;       /* the rect area is expressed withing the */
926     short int    win_right;     /* boundaries of the screen buffer */
927     short int    win_bottom;
928     short int    max_width;     /* maximum size (width x height) for the window */
929     short int    max_height;
930 @END
931 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
932 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
933 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
934 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
935 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
936 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
937
938
939 /* Get info about a console (output only) */
940 @REQ(get_console_output_info)
941     obj_handle_t handle;        /* handle to the console */
942 @REPLY
943     short int    cursor_size;   /* size of cursor (percentage filled) */
944     short int    cursor_visible;/* cursor visibility flag */
945     short int    cursor_x;      /* position of cursor (x, y) */
946     short int    cursor_y;
947     short int    width;         /* width of the screen buffer */
948     short int    height;        /* height of the screen buffer */
949     short int    attr;          /* default attribute */
950     short int    win_left;      /* window actually displayed by renderer */
951     short int    win_top;       /* the rect area is expressed withing the */
952     short int    win_right;     /* boundaries of the screen buffer */
953     short int    win_bottom;
954     short int    max_width;     /* maximum size (width x height) for the window */
955     short int    max_height;
956 @END
957
958 /* Add input records to a console input queue */
959 @REQ(write_console_input)
960     obj_handle_t handle;        /* handle to the console input */
961     VARARG(rec,input_records);  /* input records */
962 @REPLY
963     int          written;       /* number of records written */
964 @END
965
966
967 /* Fetch input records from a console input queue */
968 @REQ(read_console_input)
969     obj_handle_t handle;        /* handle to the console input */
970     int          flush;         /* flush the retrieved records from the queue? */
971 @REPLY
972     int          read;          /* number of records read */
973     VARARG(rec,input_records);  /* input records */
974 @END
975
976
977 /* write data (chars and/or attributes) in a screen buffer */
978 @REQ(write_console_output)
979     obj_handle_t handle;        /* handle to the console output */
980     int          x;             /* position where to start writing */
981     int          y;
982     int          mode;          /* char info (see below) */
983     int          wrap;          /* wrap around at end of line? */
984     VARARG(data,bytes);         /* info to write */
985 @REPLY
986     int          written;       /* number of char infos actually written */
987     int          width;         /* width of screen buffer */
988     int          height;        /* height of screen buffer */
989 @END
990 enum char_info_mode
991 {
992     CHAR_INFO_MODE_TEXT,        /* characters only */
993     CHAR_INFO_MODE_ATTR,        /* attributes only */
994     CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
995     CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
996 };
997
998
999 /* fill a screen buffer with constant data (chars and/or attributes) */
1000 @REQ(fill_console_output)
1001     obj_handle_t handle;        /* handle to the console output */
1002     int          x;             /* position where to start writing */
1003     int          y;
1004     int          mode;          /* char info mode */
1005     int          count;         /* number to write */
1006     int          wrap;          /* wrap around at end of line? */
1007     char_info_t  data;          /* data to write */
1008 @REPLY
1009     int          written;       /* number of char infos actually written */
1010 @END
1011
1012
1013 /* read data (chars and/or attributes) from a screen buffer */
1014 @REQ(read_console_output)
1015     obj_handle_t handle;        /* handle to the console output */
1016     int          x;             /* position (x,y) where to start reading */
1017     int          y;
1018     int          mode;          /* char info mode */
1019     int          wrap;          /* wrap around at end of line? */
1020 @REPLY
1021     int          width;         /* width of screen buffer */
1022     int          height;        /* height of screen buffer */
1023     VARARG(data,bytes);
1024 @END
1025
1026
1027 /* move a rect (of data) in screen buffer content */
1028 @REQ(move_console_output)
1029     obj_handle_t handle;        /* handle to the console output */
1030     short int    x_src;         /* position (x, y) of rect to start moving from */
1031     short int    y_src;
1032     short int    x_dst;         /* position (x, y) of rect to move to */
1033     short int    y_dst;
1034     short int    w;             /* size of the rect (width, height) to move */
1035     short int    h;
1036 @END
1037
1038
1039 /* Sends a signal to a process group */
1040 @REQ(send_console_signal)
1041     int          signal;        /* the signal to send */
1042     process_id_t group_id;      /* the group to send the signal to */
1043 @END
1044
1045
1046 /* Create a change notification */
1047 @REQ(create_change_notification)
1048     obj_handle_t handle;        /* handle to the directory */
1049     int          subtree;       /* watch all the subtree */
1050     unsigned int filter;        /* notification filter */
1051 @REPLY
1052     obj_handle_t handle;        /* handle to the change notification */
1053 @END
1054
1055
1056 /* Move to the next change notification */
1057 @REQ(next_change_notification)
1058     obj_handle_t handle;        /* handle to the change notification */
1059 @END
1060
1061 /* Create a file mapping */
1062 @REQ(create_mapping)
1063     int          size_high;     /* mapping size */
1064     int          size_low;      /* mapping size */
1065     int          protect;       /* protection flags (see below) */
1066     unsigned int access;        /* wanted access rights */
1067     int          inherit;       /* inherit flag */
1068     obj_handle_t file_handle;   /* file handle */
1069     VARARG(name,unicode_str);   /* object name */
1070 @REPLY
1071     obj_handle_t handle;        /* handle to the mapping */
1072 @END
1073 /* protection flags */
1074 #define VPROT_READ       0x01
1075 #define VPROT_WRITE      0x02
1076 #define VPROT_EXEC       0x04
1077 #define VPROT_WRITECOPY  0x08
1078 #define VPROT_GUARD      0x10
1079 #define VPROT_NOCACHE    0x20
1080 #define VPROT_COMMITTED  0x40
1081 #define VPROT_IMAGE      0x80
1082
1083
1084 /* Open a mapping */
1085 @REQ(open_mapping)
1086     unsigned int access;        /* wanted access rights */
1087     int          inherit;       /* inherit flag */
1088     VARARG(name,unicode_str);   /* object name */
1089 @REPLY
1090     obj_handle_t handle;        /* handle to the mapping */
1091 @END
1092
1093
1094 /* Get information about a file mapping */
1095 @REQ(get_mapping_info)
1096     obj_handle_t handle;        /* handle to the mapping */
1097 @REPLY
1098     int          size_high;     /* mapping size */
1099     int          size_low;      /* mapping size */
1100     int          protect;       /* protection flags */
1101     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
1102     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
1103     obj_handle_t shared_file;   /* shared mapping file handle */
1104     int          shared_size;   /* shared mapping size */
1105     int          removable;     /* is file on removable media? */
1106 @END
1107
1108
1109 /* Create a device */
1110 @REQ(create_device)
1111     unsigned int access;        /* wanted access rights */
1112     int          inherit;       /* inherit flag */
1113     int          id;            /* client private id */
1114 @REPLY
1115     obj_handle_t handle;        /* handle to the device */
1116 @END
1117
1118
1119 /* Retrieve the client private id for a device */
1120 @REQ(get_device_id)
1121     obj_handle_t handle;        /* handle to the device */
1122 @REPLY
1123     int          id;            /* client private id */
1124 @END
1125
1126
1127 #define SNAP_HEAPLIST   0x00000001
1128 #define SNAP_PROCESS    0x00000002
1129 #define SNAP_THREAD     0x00000004
1130 #define SNAP_MODULE     0x00000008
1131 /* Create a snapshot */
1132 @REQ(create_snapshot)
1133     int          inherit;       /* inherit flag */
1134     int          flags;         /* snapshot flags (SNAP_*) */
1135     process_id_t pid;           /* process id */
1136 @REPLY
1137     obj_handle_t handle;        /* handle to the snapshot */
1138 @END
1139
1140
1141 /* Get the next process from a snapshot */
1142 @REQ(next_process)
1143     obj_handle_t handle;        /* handle to the snapshot */
1144     int          reset;         /* reset snapshot position? */
1145 @REPLY
1146     int          count;         /* process usage count */
1147     process_id_t pid;           /* process id */
1148     process_id_t ppid;          /* parent process id */
1149     void*        heap;          /* heap base */
1150     void*        module;        /* main module */
1151     int          threads;       /* number of threads */
1152     int          priority;      /* process priority */
1153     int          handles;       /* number of handles */
1154     VARARG(filename,unicode_str); /* file name of main exe */
1155 @END
1156
1157
1158 /* Get the next thread from a snapshot */
1159 @REQ(next_thread)
1160     obj_handle_t handle;        /* handle to the snapshot */
1161     int          reset;         /* reset snapshot position? */
1162 @REPLY
1163     int          count;         /* thread usage count */
1164     process_id_t pid;           /* process id */
1165     thread_id_t  tid;           /* thread id */
1166     int          base_pri;      /* base priority */
1167     int          delta_pri;     /* delta priority */
1168 @END
1169
1170
1171 /* Get the next module from a snapshot */
1172 @REQ(next_module)
1173     obj_handle_t handle;        /* handle to the snapshot */
1174     int          reset;         /* reset snapshot position? */
1175 @REPLY
1176     process_id_t pid;           /* process id */
1177     void*        base;          /* module base address */
1178     size_t       size;          /* module size */
1179     VARARG(filename,unicode_str); /* file name of module */
1180 @END
1181
1182
1183 /* Wait for a debug event */
1184 @REQ(wait_debug_event)
1185     int           get_handle;  /* should we alloc a handle for waiting? */
1186 @REPLY
1187     process_id_t  pid;         /* process id */
1188     thread_id_t   tid;         /* thread id */
1189     obj_handle_t  wait;        /* wait handle if no event ready */
1190     VARARG(event,debug_event); /* debug event data */
1191 @END
1192
1193
1194 /* Queue an exception event */
1195 @REQ(queue_exception_event)
1196     int              first;    /* first chance exception? */
1197     VARARG(record,exc_event);  /* thread context followed by exception record */
1198 @REPLY
1199     obj_handle_t     handle;   /* handle to the queued event */
1200 @END
1201
1202
1203 /* Retrieve the status of an exception event */
1204 @REQ(get_exception_status)
1205     obj_handle_t     handle;   /* handle to the queued event */
1206 @REPLY
1207     int              status;   /* event continuation status */
1208     VARARG(context,context);   /* modified thread context */
1209 @END
1210
1211
1212 /* Send an output string to the debugger */
1213 @REQ(output_debug_string)
1214     void*         string;      /* string to display (in debugged process address space) */
1215     int           unicode;     /* is it Unicode? */
1216     int           length;      /* string length */
1217 @END
1218
1219
1220 /* Continue a debug event */
1221 @REQ(continue_debug_event)
1222     process_id_t pid;          /* process id to continue */
1223     thread_id_t  tid;          /* thread id to continue */
1224     int          status;       /* continuation status */
1225 @END
1226
1227
1228 /* Start/stop debugging an existing process */
1229 @REQ(debug_process)
1230     process_id_t pid;          /* id of the process to debug */
1231     int          attach;       /* 1=attaching / 0=detaching from the process */
1232 @END
1233
1234
1235 /* Simulate a breakpoint in a process */
1236 @REQ(debug_break)
1237     obj_handle_t handle;       /* process handle */
1238 @REPLY
1239     int          self;         /* was it the caller itself? */
1240 @END
1241
1242
1243 /* Set debugger kill on exit flag */
1244 @REQ(set_debugger_kill_on_exit)
1245     int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
1246 @END
1247
1248
1249 /* Read data from a process address space */
1250 @REQ(read_process_memory)
1251     obj_handle_t handle;       /* process handle */
1252     void*        addr;         /* addr to read from */
1253 @REPLY
1254     VARARG(data,bytes);        /* result data */
1255 @END
1256
1257
1258 /* Write data to a process address space */
1259 @REQ(write_process_memory)
1260     obj_handle_t handle;       /* process handle */
1261     void*        addr;         /* addr to write to (must be int-aligned) */
1262     unsigned int first_mask;   /* mask for first word */
1263     unsigned int last_mask;    /* mask for last word */
1264     VARARG(data,bytes);        /* data to write */
1265 @END
1266
1267
1268 /* Create a registry key */
1269 @REQ(create_key)
1270     obj_handle_t parent;       /* handle to the parent key */
1271     unsigned int access;       /* desired access rights */
1272     unsigned int options;      /* creation options */
1273     time_t       modif;        /* last modification time */
1274     size_t       namelen;      /* length of key name in bytes */
1275     VARARG(name,unicode_str,namelen);  /* key name */
1276     VARARG(class,unicode_str);         /* class name */
1277 @REPLY
1278     obj_handle_t hkey;         /* handle to the created key */
1279     int          created;      /* has it been newly created? */
1280 @END
1281
1282 /* Open a registry key */
1283 @REQ(open_key)
1284     obj_handle_t parent;       /* handle to the parent key */
1285     unsigned int access;       /* desired access rights */
1286     VARARG(name,unicode_str);  /* key name */
1287 @REPLY
1288     obj_handle_t hkey;         /* handle to the open key */
1289 @END
1290
1291
1292 /* Delete a registry key */
1293 @REQ(delete_key)
1294     obj_handle_t hkey;         /* handle to the key */
1295 @END
1296
1297
1298 /* Flush a registry key */
1299 @REQ(flush_key)
1300     obj_handle_t hkey;         /* handle to the key */
1301 @END
1302
1303
1304 /* Enumerate registry subkeys */
1305 @REQ(enum_key)
1306     obj_handle_t hkey;         /* handle to registry key */
1307     int          index;        /* index of subkey (or -1 for current key) */
1308     int          info_class;   /* requested information class */
1309 @REPLY
1310     int          subkeys;      /* number of subkeys */
1311     int          max_subkey;   /* longest subkey name */
1312     int          max_class;    /* longest class name */
1313     int          values;       /* number of values */
1314     int          max_value;    /* longest value name */
1315     int          max_data;     /* longest value data */
1316     time_t       modif;        /* last modification time */
1317     size_t       total;        /* total length needed for full name and class */
1318     size_t       namelen;      /* length of key name in bytes */
1319     VARARG(name,unicode_str,namelen);  /* key name */
1320     VARARG(class,unicode_str);         /* class name */
1321 @END
1322
1323
1324 /* Set a value of a registry key */
1325 @REQ(set_key_value)
1326     obj_handle_t hkey;         /* handle to registry key */
1327     int          type;         /* value type */
1328     size_t       namelen;      /* length of value name in bytes */
1329     VARARG(name,unicode_str,namelen);  /* value name */
1330     VARARG(data,bytes);                /* value data */
1331 @END
1332
1333
1334 /* Retrieve the value of a registry key */
1335 @REQ(get_key_value)
1336     obj_handle_t hkey;         /* handle to registry key */
1337     VARARG(name,unicode_str);  /* value name */
1338 @REPLY
1339     int          type;         /* value type */
1340     size_t       total;        /* total length needed for data */
1341     VARARG(data,bytes);        /* value data */
1342 @END
1343
1344
1345 /* Enumerate a value of a registry key */
1346 @REQ(enum_key_value)
1347     obj_handle_t hkey;         /* handle to registry key */
1348     int          index;        /* value index */
1349     int          info_class;   /* requested information class */
1350 @REPLY
1351     int          type;         /* value type */
1352     size_t       total;        /* total length needed for full name and data */
1353     size_t       namelen;      /* length of value name in bytes */
1354     VARARG(name,unicode_str,namelen);  /* value name */
1355     VARARG(data,bytes);                /* value data */
1356 @END
1357
1358
1359 /* Delete a value of a registry key */
1360 @REQ(delete_key_value)
1361     obj_handle_t hkey;         /* handle to registry key */
1362     VARARG(name,unicode_str);  /* value name */
1363 @END
1364
1365
1366 /* Load a registry branch from a file */
1367 @REQ(load_registry)
1368     obj_handle_t hkey;         /* root key to load to */
1369     obj_handle_t file;         /* file to load from */
1370     VARARG(name,unicode_str);  /* subkey name */
1371 @END
1372
1373
1374 /* UnLoad a registry branch from a file */
1375 @REQ(unload_registry)
1376     obj_handle_t hkey;         /* root key to unload to */
1377 @END
1378
1379
1380 /* Save a registry branch to a file */
1381 @REQ(save_registry)
1382     obj_handle_t hkey;         /* key to save */
1383     obj_handle_t file;         /* file to save to */
1384 @END
1385
1386
1387 /* Save a registry branch at server exit */
1388 @REQ(save_registry_atexit)
1389     obj_handle_t hkey;         /* key to save */
1390     VARARG(file,string);       /* file to save to */
1391 @END
1392
1393
1394 /* Set the current and saving level for the registry */
1395 @REQ(set_registry_levels)
1396     int          current;      /* new current level */
1397     int          saving;       /* new saving level */
1398     int          period;       /* duration between periodic saves (milliseconds) */
1399 @END
1400
1401
1402 @REQ(set_registry_notification)
1403     obj_handle_t hkey;         /* key to watch for changes */
1404     obj_handle_t event;        /* event to set */
1405     int          subtree;      /* should we watch the whole subtree? */
1406     unsigned int filter;       /* things to watch */
1407 @END
1408
1409
1410 /* Create a waitable timer */
1411 @REQ(create_timer)
1412     int          inherit;       /* inherit flag */
1413     int          manual;        /* manual reset */
1414     VARARG(name,unicode_str);   /* object name */
1415 @REPLY
1416     obj_handle_t handle;        /* handle to the timer */
1417 @END
1418
1419
1420 /* Open a waitable timer */
1421 @REQ(open_timer)
1422     unsigned int access;        /* wanted access rights */
1423     int          inherit;       /* inherit flag */
1424     VARARG(name,unicode_str);   /* object name */
1425 @REPLY
1426     obj_handle_t handle;        /* handle to the timer */
1427 @END
1428
1429 /* Set a waitable timer */
1430 @REQ(set_timer)
1431     obj_handle_t handle;        /* handle to the timer */
1432     abs_time_t   expire;        /* next expiration absolute time */
1433     int          period;        /* timer period in ms */
1434     void*        callback;      /* callback function */
1435     void*        arg;           /* callback argument */
1436 @REPLY
1437     int          signaled;      /* was the timer signaled before this call ? */
1438 @END
1439
1440 /* Cancel a waitable timer */
1441 @REQ(cancel_timer)
1442     obj_handle_t handle;        /* handle to the timer */
1443 @REPLY
1444      int         signaled;      /* was the timer signaled before this calltime ? */
1445 @END
1446
1447
1448 /* Retrieve the current context of a thread */
1449 @REQ(get_thread_context)
1450     obj_handle_t handle;       /* thread handle */
1451     unsigned int flags;        /* context flags */
1452 @REPLY
1453     VARARG(context,context);   /* thread context */
1454 @END
1455
1456
1457 /* Set the current context of a thread */
1458 @REQ(set_thread_context)
1459     obj_handle_t handle;       /* thread handle */
1460     unsigned int flags;        /* context flags */
1461     VARARG(context,context);   /* thread context */
1462 @END
1463
1464
1465 /* Fetch a selector entry for a thread */
1466 @REQ(get_selector_entry)
1467     obj_handle_t  handle;      /* thread handle */
1468     int           entry;       /* LDT entry */
1469 @REPLY
1470     unsigned int  base;        /* selector base */
1471     unsigned int  limit;       /* selector limit */
1472     unsigned char flags;       /* selector flags */
1473 @END
1474
1475
1476 /* Add an atom */
1477 @REQ(add_atom)
1478     int           local;       /* is atom in local process table? */
1479     VARARG(name,unicode_str);  /* atom name */
1480 @REPLY
1481     atom_t        atom;        /* resulting atom */
1482 @END
1483
1484
1485 /* Delete an atom */
1486 @REQ(delete_atom)
1487     atom_t        atom;        /* atom handle */
1488     int           local;       /* is atom in local process table? */
1489 @END
1490
1491
1492 /* Find an atom */
1493 @REQ(find_atom)
1494     int          local;        /* is atom in local process table? */
1495     VARARG(name,unicode_str);  /* atom name */
1496 @REPLY
1497     atom_t       atom;         /* atom handle */
1498 @END
1499
1500
1501 /* Get an atom name */
1502 @REQ(get_atom_name)
1503     atom_t       atom;         /* atom handle */
1504     int          local;        /* is atom in local process table? */
1505 @REPLY
1506     int          count;        /* atom lock count */
1507     VARARG(name,unicode_str);  /* atom name */
1508 @END
1509
1510
1511 /* Init the process atom table */
1512 @REQ(init_atom_table)
1513     int          entries;      /* number of entries */
1514 @END
1515
1516
1517 /* Get the message queue of the current thread */
1518 @REQ(get_msg_queue)
1519 @REPLY
1520     obj_handle_t handle;       /* handle to the queue */
1521 @END
1522
1523
1524 /* Set the current message queue wakeup mask */
1525 @REQ(set_queue_mask)
1526     unsigned int wake_mask;    /* wakeup bits mask */
1527     unsigned int changed_mask; /* changed bits mask */
1528     int          skip_wait;    /* will we skip waiting if signaled? */
1529 @REPLY
1530     unsigned int wake_bits;    /* current wake bits */
1531     unsigned int changed_bits; /* current changed bits */
1532 @END
1533
1534
1535 /* Get the current message queue status */
1536 @REQ(get_queue_status)
1537     int          clear;        /* should we clear the change bits? */
1538 @REPLY
1539     unsigned int wake_bits;    /* wake bits */
1540     unsigned int changed_bits; /* changed bits since last time */
1541 @END
1542
1543
1544 /* Wait for a process to start waiting on input */
1545 @REQ(wait_input_idle)
1546     obj_handle_t handle;       /* process handle */
1547     int          timeout;      /* timeout */
1548 @REPLY
1549     obj_handle_t event;        /* handle to idle event */
1550 @END
1551
1552
1553 /* Send a message to a thread queue */
1554 @REQ(send_message)
1555     thread_id_t     id;        /* thread id */
1556     int             type;      /* message type (see below) */
1557     int             flags;     /* message flags (see below) */
1558     user_handle_t   win;       /* window handle */
1559     unsigned int    msg;       /* message code */
1560     unsigned int    wparam;    /* parameters */
1561     unsigned int    lparam;    /* parameters */
1562     int             x;         /* x position */
1563     int             y;         /* y position */
1564     unsigned int    time;      /* message time */
1565     unsigned int    info;      /* extra info */
1566     int             timeout;   /* timeout for reply */
1567     void*           callback;  /* callback address */
1568     VARARG(data,bytes);        /* message data for sent messages */
1569 @END
1570
1571 enum message_type
1572 {
1573     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1574     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1575     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1576     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1577     MSG_CALLBACK_RESULT,/* result of a callback message */
1578     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1579     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1580     MSG_HARDWARE        /* hardware message */
1581 };
1582 #define SEND_MSG_ABORT_IF_HUNG  0x01
1583
1584
1585 /* Get a message from the current queue */
1586 @REQ(get_message)
1587     int             flags;     /* see below */
1588     user_handle_t   get_win;   /* window handle to get */
1589     unsigned int    get_first; /* first message code to get */
1590     unsigned int    get_last;  /* last message code to get */
1591 @REPLY
1592     int             type;      /* message type */
1593     user_handle_t   win;       /* window handle */
1594     unsigned int    msg;       /* message code */
1595     unsigned int    wparam;    /* parameters (callback function for MSG_CALLBACK_RESULT) */
1596     unsigned int    lparam;    /* parameters (result for MSG_CALLBACK_RESULT) */
1597     int             x;         /* x position */
1598     int             y;         /* y position */
1599     unsigned int    time;      /* message time */
1600     unsigned int    info;      /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1601     size_t          total;     /* total size of extra data */
1602     VARARG(data,bytes);        /* message data for sent messages */
1603 @END
1604 #define GET_MSG_REMOVE      1  /* remove the message */
1605 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1606
1607 /* Reply to a sent message */
1608 @REQ(reply_message)
1609     int             type;      /* type of original message */
1610     unsigned int    result;    /* message result */
1611     int             remove;    /* should we remove the message? */
1612     VARARG(data,bytes);        /* message data for sent messages */
1613 @END
1614
1615
1616 /* Retrieve the reply for the last message sent */
1617 @REQ(get_message_reply)
1618     int             cancel;    /* cancel message if not ready? */
1619 @REPLY
1620     unsigned int    result;    /* message result */
1621     VARARG(data,bytes);        /* message data for sent messages */
1622 @END
1623
1624
1625 /* Set a window timer */
1626 @REQ(set_win_timer)
1627     user_handle_t   win;       /* window handle */
1628     unsigned int    msg;       /* message to post */
1629     unsigned int    id;        /* timer id */
1630     unsigned int    rate;      /* timer rate in ms */
1631     unsigned int    lparam;    /* message lparam (callback proc) */
1632 @END
1633
1634
1635 /* Kill a window timer */
1636 @REQ(kill_win_timer)
1637     user_handle_t   win;       /* window handle */
1638     unsigned int    msg;       /* message to post */
1639     unsigned int    id;        /* timer id */
1640 @END
1641
1642
1643 /* Open a serial port */
1644 @REQ(create_serial)
1645     unsigned int access;       /* wanted access rights */
1646     int          inherit;      /* inherit flag */
1647     unsigned int attributes;   /* eg. FILE_FLAG_OVERLAPPED */
1648     unsigned int sharing;      /* sharing flags */
1649     VARARG(name,string);       /* file name */
1650 @REPLY
1651     obj_handle_t handle;       /* handle to the port */
1652 @END
1653
1654
1655 /* Retrieve info about a serial port */
1656 @REQ(get_serial_info)
1657     obj_handle_t handle;       /* handle to comm port */
1658 @REPLY
1659     unsigned int readinterval;
1660     unsigned int readconst;
1661     unsigned int readmult;
1662     unsigned int writeconst;
1663     unsigned int writemult;
1664     unsigned int eventmask;
1665     unsigned int commerror;
1666 @END
1667
1668
1669 /* Set info about a serial port */
1670 @REQ(set_serial_info)
1671     obj_handle_t handle;       /* handle to comm port */
1672     int          flags;        /* bitmask to set values (see below) */
1673     unsigned int readinterval;
1674     unsigned int readconst;
1675     unsigned int readmult;
1676     unsigned int writeconst;
1677     unsigned int writemult;
1678     unsigned int eventmask;
1679     unsigned int commerror;
1680 @END
1681 #define SERIALINFO_SET_TIMEOUTS  0x01
1682 #define SERIALINFO_SET_MASK      0x02
1683 #define SERIALINFO_SET_ERROR     0x04
1684
1685
1686 /* Create / reschedule an async I/O */
1687 @REQ(register_async)
1688     obj_handle_t handle;  /* handle to comm port, socket or file */
1689     int          type;
1690     void*        overlapped;
1691     int          count;
1692     unsigned int status;
1693 @END
1694 #define ASYNC_TYPE_NONE  0x00
1695 #define ASYNC_TYPE_READ  0x01
1696 #define ASYNC_TYPE_WRITE 0x02
1697 #define ASYNC_TYPE_WAIT  0x03
1698
1699
1700 /* Create a named pipe */
1701 @REQ(create_named_pipe)
1702     unsigned int   openmode;
1703     unsigned int   pipemode;
1704     unsigned int   maxinstances;
1705     unsigned int   outsize;
1706     unsigned int   insize;
1707     unsigned int   timeout;
1708     int            inherit;      /* inherit flag */
1709     VARARG(name,unicode_str);    /* pipe name */
1710 @REPLY
1711     obj_handle_t   handle;       /* handle to the pipe */
1712 @END
1713
1714
1715 /* Open an existing named pipe */
1716 @REQ(open_named_pipe)
1717     unsigned int   access;
1718     int            inherit;      /* inherit flag */
1719     VARARG(name,unicode_str);    /* pipe name */
1720 @REPLY
1721     obj_handle_t   handle;       /* handle to the pipe */
1722 @END
1723
1724
1725 /* Connect to a named pipe */
1726 @REQ(connect_named_pipe)
1727     obj_handle_t   handle;
1728     void*          overlapped;
1729     void*          func;
1730 @END
1731
1732
1733 /* Wait for a named pipe */
1734 @REQ(wait_named_pipe)
1735     unsigned int   timeout;
1736     void*          overlapped;
1737     void*          func;
1738     VARARG(name,unicode_str);    /* pipe name */
1739 @END
1740
1741
1742 /* Disconnect a named pipe */
1743 @REQ(disconnect_named_pipe)
1744     obj_handle_t   handle;
1745 @REPLY
1746     int            fd;           /* associated fd to close */
1747 @END
1748
1749
1750 @REQ(get_named_pipe_info)
1751     obj_handle_t   handle;
1752 @REPLY
1753     unsigned int   flags;
1754     unsigned int   maxinstances;
1755     unsigned int   outsize;
1756     unsigned int   insize;
1757 @END
1758
1759
1760 @REQ(create_smb)
1761     int            fd;
1762     unsigned int   tree_id;
1763     unsigned int   user_id;
1764     unsigned int   file_id;
1765     unsigned int   dialect;
1766 @REPLY
1767     obj_handle_t   handle;
1768 @END
1769
1770
1771 @REQ(get_smb_info)
1772     obj_handle_t   handle;
1773     unsigned int   flags;
1774     unsigned int   offset;
1775 @REPLY
1776     unsigned int   tree_id;
1777     unsigned int   user_id;
1778     unsigned int   dialect;
1779     unsigned int   file_id;
1780     unsigned int   offset;
1781 @END
1782 #define SMBINFO_SET_OFFSET    0x01
1783
1784
1785 /* Create a window */
1786 @REQ(create_window)
1787     user_handle_t  parent;      /* parent window */
1788     user_handle_t  owner;       /* owner window */
1789     atom_t         atom;        /* class atom */
1790     void*          instance;    /* module instance */
1791 @REPLY
1792     user_handle_t  handle;      /* created window */
1793     int            extra;       /* number of extra bytes */
1794     void*          class_ptr;   /* pointer to class in client address space */
1795 @END
1796
1797
1798 /* Link a window into the tree */
1799 @REQ(link_window)
1800     user_handle_t  handle;      /* handle to the window */
1801     user_handle_t  parent;      /* handle to the parent */
1802     user_handle_t  previous;    /* previous child in Z-order */
1803 @REPLY
1804     user_handle_t  full_parent; /* full handle of new parent */
1805 @END
1806
1807
1808 /* Destroy a window */
1809 @REQ(destroy_window)
1810     user_handle_t  handle;      /* handle to the window */
1811 @END
1812
1813
1814 /* Set a window owner */
1815 @REQ(set_window_owner)
1816     user_handle_t  handle;      /* handle to the window */
1817     user_handle_t  owner;       /* new owner */
1818 @REPLY
1819     user_handle_t  full_owner;  /* full handle of new owner */
1820     user_handle_t  prev_owner;  /* full handle of previous owner */
1821 @END
1822
1823
1824 /* Get information from a window handle */
1825 @REQ(get_window_info)
1826     user_handle_t  handle;      /* handle to the window */
1827 @REPLY
1828     user_handle_t  full_handle; /* full 32-bit handle */
1829     user_handle_t  last_active; /* last active popup */
1830     process_id_t   pid;         /* process owning the window */
1831     thread_id_t    tid;         /* thread owning the window */
1832     atom_t         atom;        /* class atom */
1833 @END
1834
1835
1836 /* Set some information in a window */
1837 @REQ(set_window_info)
1838     user_handle_t  handle;        /* handle to the window */
1839     unsigned int   flags;         /* flags for fields to set (see below) */
1840     unsigned int   style;         /* window style */
1841     unsigned int   ex_style;      /* window extended style */
1842     unsigned int   id;            /* window id */
1843     void*          instance;      /* creator instance */
1844     void*          user_data;     /* user-specific data */
1845     int            extra_offset;  /* offset to set in extra bytes */
1846     size_t         extra_size;    /* size to set in extra bytes */
1847     unsigned int   extra_value;   /* value to set in extra bytes */
1848 @REPLY
1849     unsigned int   old_style;     /* old window style */
1850     unsigned int   old_ex_style;  /* old window extended style */
1851     unsigned int   old_id;        /* old window id */
1852     void*          old_instance;  /* old creator instance */
1853     void*          old_user_data; /* old user-specific data */
1854     unsigned int   old_extra_value; /* old value in extra bytes */
1855 @END
1856 #define SET_WIN_STYLE     0x01
1857 #define SET_WIN_EXSTYLE   0x02
1858 #define SET_WIN_ID        0x04
1859 #define SET_WIN_INSTANCE  0x08
1860 #define SET_WIN_USERDATA  0x10
1861 #define SET_WIN_EXTRA     0x20
1862
1863
1864 /* Get a list of the window parents, up to the root of the tree */
1865 @REQ(get_window_parents)
1866     user_handle_t  handle;        /* handle to the window */
1867 @REPLY
1868     int            count;         /* total count of parents */
1869     VARARG(parents,user_handles); /* parent handles */
1870 @END
1871
1872
1873 /* Get a list of the window children */
1874 @REQ(get_window_children)
1875     user_handle_t  parent;        /* parent window */
1876     atom_t         atom;          /* class atom for the listed children */
1877     thread_id_t    tid;           /* thread owning the listed children */
1878 @REPLY
1879     int            count;         /* total count of children */
1880     VARARG(children,user_handles); /* children handles */
1881 @END
1882
1883
1884 /* Get window tree information from a window handle */
1885 @REQ(get_window_tree)
1886     user_handle_t  handle;        /* handle to the window */
1887 @REPLY
1888     user_handle_t  parent;        /* parent window */
1889     user_handle_t  owner;         /* owner window */
1890     user_handle_t  next_sibling;  /* next sibling in Z-order */
1891     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1892     user_handle_t  first_sibling; /* first sibling in Z-order */
1893     user_handle_t  last_sibling;  /* last sibling in Z-order */
1894     user_handle_t  first_child;   /* first child */
1895     user_handle_t  last_child;    /* last child */
1896 @END
1897
1898 /* Set the window and client rectangles of a window */
1899 @REQ(set_window_rectangles)
1900     user_handle_t  handle;        /* handle to the window */
1901     rectangle_t    window;        /* window rectangle */
1902     rectangle_t    client;        /* client rectangle */
1903 @END
1904
1905
1906 /* Get the window and client rectangles of a window */
1907 @REQ(get_window_rectangles)
1908     user_handle_t  handle;        /* handle to the window */
1909 @REPLY
1910     rectangle_t    window;        /* window rectangle */
1911     rectangle_t    client;        /* client rectangle */
1912 @END
1913
1914
1915 /* Get the window text */
1916 @REQ(get_window_text)
1917     user_handle_t  handle;        /* handle to the window */
1918 @REPLY
1919     VARARG(text,unicode_str);     /* window text */
1920 @END
1921
1922
1923 /* Set the window text */
1924 @REQ(set_window_text)
1925     user_handle_t  handle;        /* handle to the window */
1926     VARARG(text,unicode_str);     /* window text */
1927 @END
1928
1929
1930 /* Increment the window paint count */
1931 @REQ(inc_window_paint_count)
1932     user_handle_t  handle;        /* handle to the window */
1933     int             incr;         /* increment (can be negative) */
1934 @END
1935
1936
1937 /* Get the coordinates offset between two windows */
1938 @REQ(get_windows_offset)
1939     user_handle_t  from;          /* handle to the first window */
1940     user_handle_t  to;            /* handle to the second window */
1941 @REPLY
1942     int            x;             /* x coordinate offset */
1943     int            y;             /* y coordinate offset */
1944 @END
1945
1946
1947 /* Set a window property */
1948 @REQ(set_window_property)
1949     user_handle_t  window;        /* handle to the window */
1950     atom_t         atom;          /* property atom (high-word set if it was a string) */
1951     int            string;        /* was atom a string originally? */
1952     obj_handle_t   handle;        /* handle to store */
1953 @END
1954
1955
1956 /* Remove a window property */
1957 @REQ(remove_window_property)
1958     user_handle_t  window;        /* handle to the window */
1959     atom_t         atom;          /* property atom */
1960 @REPLY
1961     obj_handle_t   handle;        /* handle stored in property */
1962 @END
1963
1964
1965 /* Get a window property */
1966 @REQ(get_window_property)
1967     user_handle_t  window;        /* handle to the window */
1968     atom_t         atom;          /* property atom */
1969 @REPLY
1970     obj_handle_t   handle;        /* handle stored in property */
1971 @END
1972
1973
1974 /* Get the list of properties of a window */
1975 @REQ(get_window_properties)
1976     user_handle_t  window;        /* handle to the window */
1977 @REPLY
1978     int            total;         /* total number of properties */
1979     VARARG(props,properties);     /* list of properties */
1980 @END
1981
1982
1983 /* Attach (or detach) thread inputs */
1984 @REQ(attach_thread_input)
1985     thread_id_t    tid_from;       /* thread to be attached */
1986     thread_id_t    tid_to;         /* thread to which tid_from should be attached */
1987     int            attach;         /* is it an attach? */
1988 @END
1989
1990
1991 /* Get input data for a given thread */
1992 @REQ(get_thread_input)
1993     thread_id_t    tid;           /* id of thread */
1994 @REPLY
1995     user_handle_t  focus;         /* handle to the focus window */
1996     user_handle_t  capture;       /* handle to the capture window */
1997     user_handle_t  active;        /* handle to the active window */
1998     user_handle_t  foreground;    /* handle to the global foreground window */
1999     user_handle_t  menu_owner;    /* handle to the menu owner */
2000     user_handle_t  move_size;     /* handle to the moving/resizing window */
2001     user_handle_t  caret;         /* handle to the caret window */
2002     rectangle_t    rect;          /* caret rectangle */
2003 @END
2004
2005 /* Retrieve queue keyboard state for a given thread */
2006 @REQ(get_key_state)
2007     thread_id_t    tid;           /* id of thread */
2008     int            key;           /* optional key code or -1 */
2009 @REPLY
2010     unsigned char  state;         /* state of specified key */
2011     VARARG(keystate,bytes);       /* state array for all the keys */
2012 @END
2013
2014 /* Set queue keyboard state for a given thread */
2015 @REQ(set_key_state)
2016     thread_id_t    tid;           /* id of thread */
2017     VARARG(keystate,bytes);       /* state array for all the keys */
2018 @END
2019
2020 /* Set the system foreground window */
2021 @REQ(set_foreground_window)
2022     user_handle_t  handle;        /* handle to the foreground window */
2023 @REPLY
2024     user_handle_t  previous;      /* handle to the previous foreground window */
2025     int            send_msg_old;  /* whether we have to send a msg to the old window */
2026     int            send_msg_new;  /* whether we have to send a msg to the new window */
2027 @END
2028
2029 /* Set the current thread focus window */
2030 @REQ(set_focus_window)
2031     user_handle_t  handle;        /* handle to the focus window */
2032 @REPLY
2033     user_handle_t  previous;      /* handle to the previous focus window */
2034 @END
2035
2036 /* Set the current thread active window */
2037 @REQ(set_active_window)
2038     user_handle_t  handle;        /* handle to the active window */
2039 @REPLY
2040     user_handle_t  previous;      /* handle to the previous active window */
2041 @END
2042
2043 /* Set the current thread capture window */
2044 @REQ(set_capture_window)
2045     user_handle_t  handle;        /* handle to the capture window */
2046     unsigned int   flags;         /* capture flags (see below) */
2047 @REPLY
2048     user_handle_t  previous;      /* handle to the previous capture window */
2049     user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
2050 @END
2051 #define CAPTURE_MENU     0x01  /* capture is for a menu */
2052 #define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */
2053
2054
2055 /* Set the current thread caret window */
2056 @REQ(set_caret_window)
2057     user_handle_t  handle;        /* handle to the caret window */
2058     int            width;         /* caret width */
2059     int            height;        /* caret height */
2060 @REPLY
2061     user_handle_t  previous;      /* handle to the previous caret window */
2062     rectangle_t    old_rect;      /* previous caret rectangle */
2063     int            old_hide;      /* previous hide count */
2064     int            old_state;     /* previous caret state (1=on, 0=off) */
2065 @END
2066
2067
2068 /* Set the current thread caret information */
2069 @REQ(set_caret_info)
2070     unsigned int   flags;         /* caret flags (see below) */
2071     user_handle_t  handle;        /* handle to the caret window */
2072     int            x;             /* caret x position */
2073     int            y;             /* caret y position */
2074     int            hide;          /* increment for hide count (can be negative to show it) */
2075     int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
2076 @REPLY
2077     user_handle_t  full_handle;   /* handle to the current caret window */
2078     rectangle_t    old_rect;      /* previous caret rectangle */
2079     int            old_hide;      /* previous hide count */
2080     int            old_state;     /* previous caret state (1=on, 0=off) */
2081 @END
2082 #define SET_CARET_POS        0x01  /* set the caret position from x,y */
2083 #define SET_CARET_HIDE       0x02  /* increment the caret hide count */
2084 #define SET_CARET_STATE      0x04  /* set the caret on/off state */
2085
2086
2087 /* Set a window hook */
2088 @REQ(set_hook)
2089     int            id;             /* id of the hook */
2090     thread_id_t    tid;            /* id of thread to set the hook into */
2091     void*          proc;           /* hook procedure */
2092     int            unicode;        /* is it a unicode hook? */
2093     VARARG(module,unicode_str);    /* module name */
2094 @REPLY
2095     user_handle_t  handle;         /* handle to the hook */
2096 @END
2097
2098
2099 /* Remove a window hook */
2100 @REQ(remove_hook)
2101     user_handle_t  handle;         /* handle to the hook */
2102     int            id;             /* id of the hook if handle is 0 */
2103     void*          proc;           /* hook procedure if handle is 0 */
2104 @END
2105
2106
2107 /* Start calling a hook chain */
2108 @REQ(start_hook_chain)
2109     int            id;             /* id of the hook */
2110 @REPLY
2111     user_handle_t  handle;         /* handle to the next hook */
2112     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2113     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2114     void*          proc;           /* hook procedure */
2115     int            unicode;        /* is it a unicode hook? */
2116     VARARG(module,unicode_str);    /* module name */
2117 @END
2118
2119
2120 /* Finished calling a hook chain */
2121 @REQ(finish_hook_chain)
2122     int            id;             /* id of the hook */
2123 @END
2124
2125
2126 /* Get the next hook to call */
2127 @REQ(get_next_hook)
2128     user_handle_t  handle;         /* handle to the current hook */
2129 @REPLY
2130     user_handle_t  next;           /* handle to the next hook */
2131     int            id;             /* id of the next hook */
2132     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2133     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2134     void*          proc;           /* next hook procedure */
2135     int            prev_unicode;   /* was the previous a unicode hook? */
2136     int            next_unicode;   /* is the next a unicode hook? */
2137     VARARG(module,unicode_str);    /* module name */
2138 @END
2139
2140
2141 /* Create a window class */
2142 @REQ(create_class)
2143     int            local;          /* is it a local class? */
2144     atom_t         atom;           /* class atom */
2145     unsigned int   style;          /* class style */
2146     void*          instance;       /* module instance */
2147     int            extra;          /* number of extra class bytes */
2148     int            win_extra;      /* number of window extra bytes */
2149     void*          client_ptr;     /* pointer to class in client address space */
2150 @END
2151
2152
2153 /* Destroy a window class */
2154 @REQ(destroy_class)
2155     atom_t         atom;           /* class atom */
2156     void*          instance;       /* module instance */
2157 @REPLY
2158     void*          client_ptr;     /* pointer to class in client address space */
2159 @END
2160
2161
2162 /* Set some information in a class */
2163 @REQ(set_class_info)
2164     user_handle_t  window;         /* handle to the window */
2165     unsigned int   flags;          /* flags for info to set (see below) */
2166     atom_t         atom;           /* class atom */
2167     unsigned int   style;          /* class style */
2168     int            win_extra;      /* number of window extra bytes */
2169     void*          instance;       /* module instance */
2170     int            extra_offset;   /* offset to set in extra bytes */
2171     size_t         extra_size;     /* size to set in extra bytes */
2172     unsigned int   extra_value;    /* value to set in extra bytes */
2173 @REPLY
2174     atom_t         old_atom;       /* previous class atom */
2175     unsigned int   old_style;      /* previous class style */
2176     int            old_extra;      /* previous number of class extra bytes */
2177     int            old_win_extra;  /* previous number of window extra bytes */
2178     void*          old_instance;   /* previous module instance */
2179     unsigned int   old_extra_value; /* old value in extra bytes */
2180 @END
2181 #define SET_CLASS_ATOM      0x0001
2182 #define SET_CLASS_STYLE     0x0002
2183 #define SET_CLASS_WINEXTRA  0x0004
2184 #define SET_CLASS_INSTANCE  0x0008
2185 #define SET_CLASS_EXTRA     0x0010
2186
2187
2188 /* Set/get clipboard information */
2189 @REQ(set_clipboard_info)
2190     unsigned int   flags;       /* flags for fields to set (see below) */
2191     user_handle_t  clipboard;   /* clipboard window */
2192     user_handle_t  owner;       /* clipboard owner */
2193     user_handle_t  viewer;      /* first clipboard viewer */
2194     unsigned int   seqno;       /* change sequence number */
2195 @REPLY
2196     unsigned int   flags;           /* status flags (see below) */
2197     user_handle_t  old_clipboard;   /* old clipboard window */
2198     user_handle_t  old_owner;       /* old clipboard owner */
2199     user_handle_t  old_viewer;      /* old clipboard viewer */
2200     unsigned int   seqno;           /* current sequence number */
2201 @END
2202
2203 #define SET_CB_OPEN      0x001
2204 #define SET_CB_OWNER     0x002
2205 #define SET_CB_VIEWER    0x004
2206 #define SET_CB_SEQNO     0x008
2207 #define SET_CB_RELOWNER  0x010
2208 #define SET_CB_CLOSE     0x020
2209 #define CB_OPEN          0x040
2210 #define CB_OWNER         0x080
2211
2212
2213 /* Open a security token */
2214 @REQ(open_token)
2215     obj_handle_t   handle;    /* handle to the thread or process */
2216     unsigned int   flags;     /* flags (see below) */
2217 @REPLY
2218     obj_handle_t   token;    /* handle to the token */
2219 @END
2220 #define OPEN_TOKEN_THREAD   1
2221 #define OPEN_TOKEN_AS_SELF  2
2222
2223
2224 /* Set/get the global windows */
2225 @REQ(set_global_windows)
2226     unsigned int   flags;               /* flags for fields to set (see below) */
2227     user_handle_t  shell_window;        /* handle to the new shell window */
2228     user_handle_t  shell_listview;      /* handle to the new shell listview window */
2229     user_handle_t  progman_window;      /* handle to the new program manager window */
2230     user_handle_t  taskman_window;      /* handle to the new task manager window */
2231 @REPLY
2232     user_handle_t  old_shell_window;    /* handle to the shell window */
2233     user_handle_t  old_shell_listview;  /* handle to the shell listview window */
2234     user_handle_t  old_progman_window;  /* handle to the new program manager window */
2235     user_handle_t  old_taskman_window;  /* handle to the new task manager window */
2236 @END
2237 #define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
2238 #define SET_GLOBAL_PROGMAN_WINDOW  0x02
2239 #define SET_GLOBAL_TASKMAN_WINDOW  0x04