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