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