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