server: Remove no longer used create_flags from get_startup_info request.
[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 #define MAX_ACL_LEN 65535
182
183 struct security_descriptor
184 {
185     unsigned int control;       /* SE_ flags */
186     size_t owner_len;
187     size_t group_len;
188     size_t sacl_len;
189     size_t dacl_len;
190     /* VARARGS(owner,SID); */
191     /* VARARGS(group,SID); */
192     /* VARARGS(sacl,ACL); */
193     /* VARARGS(dacl,ACL); */
194 };
195
196 /****************************************************************/
197 /* Request declarations */
198
199 /* Create a new process from the context of the parent */
200 @REQ(new_process)
201     int          inherit_all;  /* inherit all handles from parent */
202     unsigned int create_flags; /* creation flags */
203     int          unix_pid;     /* Unix pid of new process */
204     obj_handle_t exe_file;     /* file handle for main exe */
205     obj_handle_t hstdin;       /* handle for stdin */
206     obj_handle_t hstdout;      /* handle for stdout */
207     obj_handle_t hstderr;      /* handle for stderr */
208     VARARG(info,startup_info); /* startup information */
209     VARARG(env,unicode_str);   /* environment for new process */
210 @REPLY
211     obj_handle_t info;         /* new process info handle */
212 @END
213
214
215 /* Retrieve information about a newly started process */
216 @REQ(get_new_process_info)
217     obj_handle_t info;           /* info handle returned from new_process_request */
218     unsigned int process_access; /* access rights for process object */
219     unsigned int process_attr;   /* attributes for process object */
220     unsigned int thread_access;  /* access rights for thread object */
221     unsigned int thread_attr;    /* attributes for thread object */
222 @REPLY
223     process_id_t pid;          /* process id */
224     obj_handle_t phandle;      /* process handle (in the current process) */
225     thread_id_t  tid;          /* thread id */
226     obj_handle_t thandle;      /* thread handle (in the current process) */
227     int          success;      /* did the process start successfully? */
228 @END
229
230
231 /* Create a new thread from the context of the parent */
232 @REQ(new_thread)
233     unsigned int access;       /* wanted access rights */
234     unsigned int attributes;   /* object attributes */
235     int          suspend;      /* new thread should be suspended on creation */
236     int          request_fd;   /* fd for request pipe */
237 @REPLY
238     thread_id_t  tid;          /* thread id */
239     obj_handle_t handle;       /* thread handle (in the current process) */
240 @END
241
242
243 /* Retrieve the new process startup info */
244 @REQ(get_startup_info)
245 @REPLY
246     obj_handle_t exe_file;     /* file handle for main exe */
247     obj_handle_t hstdin;       /* handle for stdin */
248     obj_handle_t hstdout;      /* handle for stdout */
249     obj_handle_t hstderr;      /* handle for stderr */
250     VARARG(info,startup_info); /* startup information */
251     VARARG(env,unicode_str);   /* environment */
252 @END
253
254
255 /* Signal the end of the process initialization */
256 @REQ(init_process_done)
257     void*        module;       /* main module base address */
258     size_t       module_size;  /* main module size */
259     void*        entry;        /* process entry point */
260     void*        name;         /* ptr to ptr to name (in process addr space) */
261     obj_handle_t exe_file;     /* file handle for main exe */
262     int          gui;          /* is it a GUI process? */
263     VARARG(filename,unicode_str); /* file name of main exe */
264 @END
265
266
267 /* Initialize a thread; called from the child after fork()/clone() */
268 @REQ(init_thread)
269     int          unix_pid;     /* Unix pid of new thread */
270     int          unix_tid;     /* Unix tid of new thread */
271     void*        teb;          /* TEB of new thread (in thread address space) */
272     void*        peb;          /* address of PEB (in thread address space) */
273     void*        entry;        /* thread entry point (in thread address space) */
274     void*        ldt_copy;     /* address of LDT copy (in thread address space) */
275     int          reply_fd;     /* fd for reply pipe */
276     int          wait_fd;      /* fd for blocking calls pipe */
277     int          debug_level;  /* new debug level */
278 @REPLY
279     process_id_t pid;          /* process id of the new thread's process */
280     thread_id_t  tid;          /* thread id of the new thread */
281     size_t       info_size;    /* total size of startup info */
282     time_t       server_start; /* server start time */
283     int          version;      /* protocol version */
284 @END
285
286
287 /* Terminate a process */
288 @REQ(terminate_process)
289     obj_handle_t handle;       /* process handle to terminate */
290     int          exit_code;    /* process exit code */
291 @REPLY
292     int          self;         /* suicide? */
293 @END
294
295
296 /* Terminate a thread */
297 @REQ(terminate_thread)
298     obj_handle_t handle;       /* thread handle to terminate */
299     int          exit_code;    /* thread exit code */
300 @REPLY
301     int          self;         /* suicide? */
302     int          last;         /* last thread in this process? */
303 @END
304
305
306 /* Retrieve information about a process */
307 @REQ(get_process_info)
308     obj_handle_t handle;           /* process handle */
309 @REPLY
310     process_id_t pid;              /* server process id */
311     process_id_t ppid;             /* server process id of parent */
312     int          exit_code;        /* process exit code */
313     int          priority;         /* priority class */
314     int          affinity;         /* process affinity mask */
315     void*        peb;              /* PEB address in process address space */
316 @END
317
318
319 /* Set a process informations */
320 @REQ(set_process_info)
321     obj_handle_t handle;       /* process handle */
322     int          mask;         /* setting mask (see below) */
323     int          priority;     /* priority class */
324     int          affinity;     /* affinity mask */
325 @END
326 #define SET_PROCESS_INFO_PRIORITY 0x01
327 #define SET_PROCESS_INFO_AFFINITY 0x02
328
329
330 /* Retrieve information about a thread */
331 @REQ(get_thread_info)
332     obj_handle_t handle;        /* thread handle */
333     thread_id_t  tid_in;        /* thread id (optional) */
334 @REPLY
335     process_id_t pid;           /* server process id */
336     thread_id_t  tid;           /* server thread id */
337     void*        teb;           /* thread teb pointer */
338     int          exit_code;     /* thread exit code */
339     int          priority;      /* thread priority level */
340     int          affinity;      /* thread affinity mask */
341     time_t       creation_time; /* thread creation time */
342     time_t       exit_time;     /* thread exit time */
343 @END
344
345
346 /* Set a thread informations */
347 @REQ(set_thread_info)
348     obj_handle_t handle;       /* thread handle */
349     int          mask;         /* setting mask (see below) */
350     int          priority;     /* priority class */
351     int          affinity;     /* affinity mask */
352     obj_handle_t token;        /* impersonation token */
353 @END
354 #define SET_THREAD_INFO_PRIORITY 0x01
355 #define SET_THREAD_INFO_AFFINITY 0x02
356 #define SET_THREAD_INFO_TOKEN    0x04
357
358
359 /* Retrieve information about a module */
360 @REQ(get_dll_info)
361     obj_handle_t handle;       /* process handle */
362     void*        base_address; /* base address of module */
363 @REPLY
364     size_t       size;          /* module size */
365     void*        entry_point;
366     VARARG(filename,unicode_str); /* file name of module */
367 @END
368
369
370 /* Suspend a thread */
371 @REQ(suspend_thread)
372     obj_handle_t handle;       /* thread handle */
373 @REPLY
374     int          count;        /* new suspend count */
375 @END
376
377
378 /* Resume a thread */
379 @REQ(resume_thread)
380     obj_handle_t handle;       /* thread handle */
381 @REPLY
382     int          count;        /* new suspend count */
383 @END
384
385
386 /* Notify the server that a dll has been loaded */
387 @REQ(load_dll)
388     obj_handle_t handle;       /* file handle */
389     void*        base;         /* base address */
390     size_t       size;         /* dll size */
391     int          dbg_offset;   /* debug info offset */
392     int          dbg_size;     /* debug info size */
393     void*        name;         /* ptr to ptr to name (in process addr space) */
394     VARARG(filename,unicode_str); /* file name of dll */
395 @END
396
397
398 /* Notify the server that a dll is being unloaded */
399 @REQ(unload_dll)
400     void*        base;         /* base address */
401 @END
402
403
404 /* Queue an APC for a thread */
405 @REQ(queue_apc)
406     obj_handle_t handle;       /* thread handle */
407     int          user;         /* user or system apc? */
408     void*        func;         /* function to call */
409     void*        arg1;         /* params for function to call */
410     void*        arg2;
411     void*        arg3;
412 @END
413
414
415 /* Get next APC to call */
416 @REQ(get_apc)
417     int          alertable;    /* is thread alertable? */
418 @REPLY
419     void*        func;         /* function to call */
420     int          type;         /* function type */
421     void*        arg1;         /* function arguments */
422     void*        arg2;
423     void*        arg3;
424 @END
425 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC_IO };
426
427
428 /* Close a handle for the current process */
429 @REQ(close_handle)
430     obj_handle_t handle;       /* handle to close */
431 @REPLY
432     int          fd;           /* associated fd to close */
433 @END
434
435
436 /* Set a handle information */
437 @REQ(set_handle_info)
438     obj_handle_t handle;       /* handle we are interested in */
439     int          flags;        /* new handle flags */
440     int          mask;         /* mask for flags to set */
441 @REPLY
442     int          old_flags;    /* old flag value */
443 @END
444
445
446 /* Duplicate a handle */
447 @REQ(dup_handle)
448     obj_handle_t src_process;  /* src process handle */
449     obj_handle_t src_handle;   /* src handle to duplicate */
450     obj_handle_t dst_process;  /* dst process handle */
451     unsigned int access;       /* wanted access rights */
452     unsigned int attributes;   /* object attributes */
453     unsigned int options;      /* duplicate options (see below) */
454 @REPLY
455     obj_handle_t handle;       /* duplicated handle in dst process */
456     int          fd;           /* associated fd to close */
457 @END
458 #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
459 #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
460 #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */
461
462
463 /* Open a handle to a process */
464 @REQ(open_process)
465     process_id_t pid;          /* process id to open */
466     unsigned int access;       /* wanted access rights */
467     unsigned int attributes;   /* object attributes */
468 @REPLY
469     obj_handle_t handle;       /* handle to the process */
470 @END
471
472
473 /* Open a handle to a thread */
474 @REQ(open_thread)
475     thread_id_t  tid;          /* thread id to open */
476     unsigned int access;       /* wanted access rights */
477     unsigned int attributes;   /* object attributes */
478 @REPLY
479     obj_handle_t handle;       /* handle to the thread */
480 @END
481
482
483 /* Wait for handles */
484 @REQ(select)
485     int          flags;        /* wait flags (see below) */
486     void*        cookie;       /* magic cookie to return to client */
487     obj_handle_t signal;       /* object to signal (0 if none) */
488     abs_time_t   timeout;      /* absolute timeout */
489     VARARG(handles,handles);   /* handles to select on */
490 @END
491 #define SELECT_ALL           1
492 #define SELECT_ALERTABLE     2
493 #define SELECT_INTERRUPTIBLE 4
494 #define SELECT_TIMEOUT       8
495
496
497 /* Create an event */
498 @REQ(create_event)
499     unsigned int access;        /* wanted access rights */
500     unsigned int attributes;    /* object attributes */
501     obj_handle_t rootdir;       /* root directory */
502     int          manual_reset;  /* manual reset event */
503     int          initial_state; /* initial state of the event */
504     VARARG(name,unicode_str);   /* object name */
505 @REPLY
506     obj_handle_t handle;        /* handle to the event */
507 @END
508
509 /* Event operation */
510 @REQ(event_op)
511     obj_handle_t  handle;       /* handle to event */
512     int           op;           /* event operation (see below) */
513 @END
514 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
515
516
517 /* Open an event */
518 @REQ(open_event)
519     unsigned int access;        /* wanted access rights */
520     unsigned int attributes;    /* object attributes */
521     obj_handle_t rootdir;       /* root directory */
522     VARARG(name,unicode_str);   /* object name */
523 @REPLY
524     obj_handle_t handle;        /* handle to the event */
525 @END
526
527
528 /* Create a mutex */
529 @REQ(create_mutex)
530     unsigned int access;        /* wanted access rights */
531     unsigned int attributes;    /* object attributes */
532     obj_handle_t rootdir;       /* root directory */
533     int          owned;         /* initially owned? */
534     VARARG(name,unicode_str);   /* object name */
535 @REPLY
536     obj_handle_t handle;        /* handle to the mutex */
537 @END
538
539
540 /* Release a mutex */
541 @REQ(release_mutex)
542     obj_handle_t handle;        /* handle to the mutex */
543 @REPLY
544     unsigned int prev_count;    /* value of internal counter, before release */
545 @END
546
547
548 /* Open a mutex */
549 @REQ(open_mutex)
550     unsigned int access;        /* wanted access rights */
551     unsigned int attributes;    /* object attributes */
552     obj_handle_t rootdir;       /* root directory */
553     VARARG(name,unicode_str);   /* object name */
554 @REPLY
555     obj_handle_t handle;        /* handle to the mutex */
556 @END
557
558
559 /* Create a semaphore */
560 @REQ(create_semaphore)
561     unsigned int access;        /* wanted access rights */
562     unsigned int attributes;    /* object attributes */
563     obj_handle_t rootdir;       /* root directory */
564     unsigned int initial;       /* initial count */
565     unsigned int max;           /* maximum count */
566     VARARG(name,unicode_str);   /* object name */
567 @REPLY
568     obj_handle_t handle;        /* handle to the semaphore */
569 @END
570
571
572 /* Release a semaphore */
573 @REQ(release_semaphore)
574     obj_handle_t handle;        /* handle to the semaphore */
575     unsigned int count;         /* count to add to semaphore */
576 @REPLY
577     unsigned int prev_count;    /* previous semaphore count */
578 @END
579
580
581 /* Open a semaphore */
582 @REQ(open_semaphore)
583     unsigned int access;        /* wanted access rights */
584     unsigned int attributes;    /* object attributes */
585     obj_handle_t rootdir;       /* root directory */
586     VARARG(name,unicode_str);   /* object name */
587 @REPLY
588     obj_handle_t handle;        /* handle to the semaphore */
589 @END
590
591
592 /* Create a file */
593 @REQ(create_file)
594     unsigned int access;        /* wanted access rights */
595     unsigned int attributes;    /* object attributes */
596     unsigned int sharing;       /* sharing flags */
597     int          create;        /* file create action */
598     unsigned int options;       /* file options */
599     unsigned int attrs;         /* file attributes for creation */
600     VARARG(filename,string);    /* file name */
601 @REPLY
602     obj_handle_t handle;        /* handle to the file */
603 @END
604
605
606 /* Open a file object */
607 @REQ(open_file_object)
608     unsigned int access;        /* wanted access rights */
609     unsigned int attributes;    /* open attributes */
610     obj_handle_t rootdir;       /* root directory */
611     unsigned int sharing;       /* sharing flags */
612     VARARG(filename,unicode_str); /* file name */
613 @REPLY
614     obj_handle_t handle;        /* handle to the file */
615 @END
616
617
618 /* Allocate a file handle for a Unix fd */
619 @REQ(alloc_file_handle)
620     unsigned int access;        /* wanted access rights */
621     unsigned int attributes;    /* object attributes */
622     int          fd;            /* file descriptor on the client side */
623 @REPLY
624     obj_handle_t handle;        /* handle to the file */
625 @END
626
627
628 /* Get a Unix fd to access a file */
629 @REQ(get_handle_fd)
630     obj_handle_t handle;        /* handle to the file */
631     unsigned int access;        /* wanted access rights */
632 @REPLY
633     int          fd;            /* file descriptor */
634     int          removable;     /* is device removable? (-1 if unknown) */
635     int          flags;         /* file read/write flags (see below) */
636 @END
637 #define FD_FLAG_OVERLAPPED         0x01 /* fd opened in overlapped mode */
638 #define FD_FLAG_TIMEOUT            0x02 /* read/write is synchronous */
639 #define FD_FLAG_RECV_SHUTDOWN      0x04
640 #define FD_FLAG_SEND_SHUTDOWN      0x08
641 #define FD_FLAG_AVAILABLE          0x10 /* in overlap read/write operation, 
642                                          * only handle available data (don't wait) */
643
644 /* Set the cached file descriptor of a handle */
645 @REQ(set_handle_fd)
646     obj_handle_t handle;       /* handle we are interested in */
647     int          fd;           /* file descriptor */
648     int          removable;    /* is device removable? (-1 if unknown) */
649 @REPLY
650     int          cur_fd;       /* current file descriptor */
651 @END
652
653
654 /* Flush a file buffers */
655 @REQ(flush_file)
656     obj_handle_t handle;        /* handle to the file */
657 @REPLY
658     obj_handle_t event;         /* event set when finished */
659 @END
660
661
662 /* Lock a region of a file */
663 @REQ(lock_file)
664     obj_handle_t handle;        /* handle to the file */
665     unsigned int offset_low;    /* offset of start of lock */
666     unsigned int offset_high;   /* offset of start of lock */
667     unsigned int count_low;     /* count of bytes to lock */
668     unsigned int count_high;    /* count of bytes to lock */
669     int          shared;        /* shared or exclusive lock? */
670     int          wait;          /* do we want to wait? */
671 @REPLY
672     obj_handle_t handle;        /* handle to wait on */
673     int          overlapped;    /* is it an overlapped I/O handle? */
674 @END
675
676
677 /* Unlock a region of a file */
678 @REQ(unlock_file)
679     obj_handle_t handle;        /* handle to the file */
680     unsigned int offset_low;    /* offset of start of unlock */
681     unsigned int offset_high;   /* offset of start of unlock */
682     unsigned int count_low;     /* count of bytes to unlock */
683     unsigned int count_high;    /* count of bytes to unlock */
684 @END
685
686
687 /* Get ready to unmount a Unix device */
688 @REQ(unmount_device)
689     obj_handle_t handle;        /* handle to a file on the device */
690 @END
691
692
693 /* Create a socket */
694 @REQ(create_socket)
695     unsigned int access;        /* wanted access rights */
696     unsigned int attributes;    /* object attributes */
697     int          family;        /* family, see socket manpage */
698     int          type;          /* type, see socket manpage */
699     int          protocol;      /* protocol, see socket manpage */
700     unsigned int flags;         /* socket flags */
701 @REPLY
702     obj_handle_t handle;        /* handle to the new socket */
703 @END
704
705
706 /* Accept a socket */
707 @REQ(accept_socket)
708     obj_handle_t lhandle;       /* handle to the listening socket */
709     unsigned int access;        /* wanted access rights */
710     unsigned int attributes;    /* object attributes */
711 @REPLY
712     obj_handle_t handle;        /* handle to the new socket */
713 @END
714
715
716 /* Set socket event parameters */
717 @REQ(set_socket_event)
718     obj_handle_t  handle;        /* handle to the socket */
719     unsigned int  mask;          /* event mask */
720     obj_handle_t  event;         /* event object */
721     user_handle_t window;        /* window to send the message to */
722     unsigned int  msg;           /* message to send */
723 @END
724
725
726 /* Get socket event parameters */
727 @REQ(get_socket_event)
728     obj_handle_t handle;        /* handle to the socket */
729     int          service;       /* clear pending? */
730     obj_handle_t c_event;       /* event to clear */
731 @REPLY
732     unsigned int mask;          /* event mask */
733     unsigned int pmask;         /* pending events */
734     unsigned int state;         /* status bits */
735     VARARG(errors,ints);        /* event errors */
736 @END
737
738
739 /* Reenable pending socket events */
740 @REQ(enable_socket_event)
741     obj_handle_t handle;        /* handle to the socket */
742     unsigned int mask;          /* events to re-enable */
743     unsigned int sstate;        /* status bits to set */
744     unsigned int cstate;        /* status bits to clear */
745 @END
746
747 @REQ(set_socket_deferred)
748     obj_handle_t handle;        /* handle to the socket */
749     obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
750 @END
751
752 /* Allocate a console (only used by a console renderer) */
753 @REQ(alloc_console)
754     unsigned int access;        /* wanted access rights */
755     unsigned int attributes;    /* object attributes */
756     process_id_t pid;           /* pid of process which shall be attached to the console */
757 @REPLY
758     obj_handle_t handle_in;     /* handle to console input */
759     obj_handle_t event;         /* handle to renderer events change notification */
760 @END
761
762
763 /* Free the console of the current process */
764 @REQ(free_console)
765 @END
766
767
768 #define CONSOLE_RENDERER_NONE_EVENT        0x00
769 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
770 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
771 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
772 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
773 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
774 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
775 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
776 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
777 struct console_renderer_event
778 {
779     short event;
780     union
781     {
782         struct update
783         {
784             short top;
785             short bottom;
786         } update;
787         struct resize
788         {
789             short width;
790             short height;
791         } resize;
792         struct cursor_pos
793         {
794             short x;
795             short y;
796         } cursor_pos;
797         struct cursor_geom
798         {
799             short visible;
800             short size;
801         } cursor_geom;
802         struct display
803         {
804             short left;
805             short top;
806             short width;
807             short height;
808         } display;
809     } u;
810 };
811
812 /* retrieve console events for the renderer */
813 @REQ(get_console_renderer_events)
814     obj_handle_t handle;        /* handle to console input events */
815 @REPLY
816     VARARG(data,bytes);         /* the various console_renderer_events */
817 @END
818
819
820 /* Open a handle to the process console */
821 @REQ(open_console)
822     int          from;          /* 0 (resp 1) input (resp output) of current process console */
823                                 /* otherwise console_in handle to get active screen buffer? */
824     unsigned int access;        /* wanted access rights */
825     unsigned int attributes;    /* object attributes */
826     int          share;         /* share mask (only for output handles) */
827 @REPLY
828     obj_handle_t handle;        /* handle to the console */
829 @END
830
831
832 /* Get the input queue wait event */
833 @REQ(get_console_wait_event)
834 @REPLY
835     obj_handle_t handle;
836 @END
837
838 /* Get a console mode (input or output) */
839 @REQ(get_console_mode)
840     obj_handle_t handle;        /* handle to the console */
841 @REPLY
842     int          mode;          /* console mode */
843 @END
844
845
846 /* Set a console mode (input or output) */
847 @REQ(set_console_mode)
848     obj_handle_t handle;        /* handle to the console */
849     int          mode;          /* console mode */
850 @END
851
852
853 /* Set info about a console (input only) */
854 @REQ(set_console_input_info)
855     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
856     int          mask;          /* setting mask (see below) */
857     obj_handle_t active_sb;     /* active screen buffer */
858     int          history_mode;  /* whether we duplicate lines in history */
859     int          history_size;  /* number of lines in history */
860     int          edition_mode;  /* index to the edition mode flavors */
861     VARARG(title,unicode_str);  /* console title */
862 @END
863 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
864 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
865 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
866 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
867 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10
868
869
870 /* Get info about a console (input only) */
871 @REQ(get_console_input_info)
872     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
873 @REPLY
874     int          history_mode;  /* whether we duplicate lines in history */
875     int          history_size;  /* number of lines in history */
876     int          history_index; /* number of used lines in history */
877     int          edition_mode;  /* index to the edition mode flavors */
878     VARARG(title,unicode_str);  /* console title */
879 @END
880
881
882 /* appends a string to console's history */
883 @REQ(append_console_input_history)
884     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
885     VARARG(line,unicode_str);   /* line to add */
886 @END
887
888
889 /* appends a string to console's history */
890 @REQ(get_console_input_history)
891     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
892     int          index;         /* index to get line from */
893 @REPLY
894     int          total;         /* total length of line in Unicode chars */
895     VARARG(line,unicode_str);   /* line to add */
896 @END
897
898
899 /* creates a new screen buffer on process' console */
900 @REQ(create_console_output)
901     obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
902     unsigned int access;        /* wanted access rights */
903     unsigned int attributes;    /* object attributes */
904     unsigned int share;         /* sharing credentials */
905 @REPLY
906     obj_handle_t handle_out;    /* handle to the screen buffer */
907 @END
908
909
910 /* Set info about a console (output only) */
911 @REQ(set_console_output_info)
912     obj_handle_t handle;        /* handle to the console */
913     int          mask;          /* setting mask (see below) */
914     short int    cursor_size;   /* size of cursor (percentage filled) */
915     short int    cursor_visible;/* cursor visibility flag */
916     short int    cursor_x;      /* position of cursor (x, y) */
917     short int    cursor_y;
918     short int    width;         /* width of the screen buffer */
919     short int    height;        /* height of the screen buffer */
920     short int    attr;          /* default attribute */
921     short int    win_left;      /* window actually displayed by renderer */
922     short int    win_top;       /* the rect area is expressed withing the */
923     short int    win_right;     /* boundaries of the screen buffer */
924     short int    win_bottom;
925     short int    max_width;     /* maximum size (width x height) for the window */
926     short int    max_height;
927 @END
928 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
929 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
930 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
931 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
932 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
933 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
934
935
936 /* Get info about a console (output only) */
937 @REQ(get_console_output_info)
938     obj_handle_t handle;        /* handle to the console */
939 @REPLY
940     short int    cursor_size;   /* size of cursor (percentage filled) */
941     short int    cursor_visible;/* cursor visibility flag */
942     short int    cursor_x;      /* position of cursor (x, y) */
943     short int    cursor_y;
944     short int    width;         /* width of the screen buffer */
945     short int    height;        /* height of the screen buffer */
946     short int    attr;          /* default attribute */
947     short int    win_left;      /* window actually displayed by renderer */
948     short int    win_top;       /* the rect area is expressed withing the */
949     short int    win_right;     /* boundaries of the screen buffer */
950     short int    win_bottom;
951     short int    max_width;     /* maximum size (width x height) for the window */
952     short int    max_height;
953 @END
954
955 /* Add input records to a console input queue */
956 @REQ(write_console_input)
957     obj_handle_t handle;        /* handle to the console input */
958     VARARG(rec,input_records);  /* input records */
959 @REPLY
960     int          written;       /* number of records written */
961 @END
962
963
964 /* Fetch input records from a console input queue */
965 @REQ(read_console_input)
966     obj_handle_t handle;        /* handle to the console input */
967     int          flush;         /* flush the retrieved records from the queue? */
968 @REPLY
969     int          read;          /* number of records read */
970     VARARG(rec,input_records);  /* input records */
971 @END
972
973
974 /* write data (chars and/or attributes) in a screen buffer */
975 @REQ(write_console_output)
976     obj_handle_t handle;        /* handle to the console output */
977     int          x;             /* position where to start writing */
978     int          y;
979     int          mode;          /* char info (see below) */
980     int          wrap;          /* wrap around at end of line? */
981     VARARG(data,bytes);         /* info to write */
982 @REPLY
983     int          written;       /* number of char infos actually written */
984     int          width;         /* width of screen buffer */
985     int          height;        /* height of screen buffer */
986 @END
987 enum char_info_mode
988 {
989     CHAR_INFO_MODE_TEXT,        /* characters only */
990     CHAR_INFO_MODE_ATTR,        /* attributes only */
991     CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
992     CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
993 };
994
995
996 /* fill a screen buffer with constant data (chars and/or attributes) */
997 @REQ(fill_console_output)
998     obj_handle_t handle;        /* handle to the console output */
999     int          x;             /* position where to start writing */
1000     int          y;
1001     int          mode;          /* char info mode */
1002     int          count;         /* number to write */
1003     int          wrap;          /* wrap around at end of line? */
1004     char_info_t  data;          /* data to write */
1005 @REPLY
1006     int          written;       /* number of char infos actually written */
1007 @END
1008
1009
1010 /* read data (chars and/or attributes) from a screen buffer */
1011 @REQ(read_console_output)
1012     obj_handle_t handle;        /* handle to the console output */
1013     int          x;             /* position (x,y) where to start reading */
1014     int          y;
1015     int          mode;          /* char info mode */
1016     int          wrap;          /* wrap around at end of line? */
1017 @REPLY
1018     int          width;         /* width of screen buffer */
1019     int          height;        /* height of screen buffer */
1020     VARARG(data,bytes);
1021 @END
1022
1023
1024 /* move a rect (of data) in screen buffer content */
1025 @REQ(move_console_output)
1026     obj_handle_t handle;        /* handle to the console output */
1027     short int    x_src;         /* position (x, y) of rect to start moving from */
1028     short int    y_src;
1029     short int    x_dst;         /* position (x, y) of rect to move to */
1030     short int    y_dst;
1031     short int    w;             /* size of the rect (width, height) to move */
1032     short int    h;
1033 @END
1034
1035
1036 /* Sends a signal to a process group */
1037 @REQ(send_console_signal)
1038     int          signal;        /* the signal to send */
1039     process_id_t group_id;      /* the group to send the signal to */
1040 @END
1041
1042
1043 /* enable directory change notifications */
1044 @REQ(read_directory_changes)
1045     obj_handle_t handle;        /* handle to the directory */
1046     obj_handle_t event;         /* handle to the event */
1047     unsigned int filter;        /* notification filter */
1048 @END
1049
1050
1051 /* Create a file mapping */
1052 @REQ(create_mapping)
1053     unsigned int access;        /* wanted access rights */
1054     unsigned int attributes;    /* object attributes */
1055     obj_handle_t rootdir;       /* root directory */
1056     int          size_high;     /* mapping size */
1057     int          size_low;      /* mapping size */
1058     int          protect;       /* protection flags (see below) */
1059     obj_handle_t file_handle;   /* file handle */
1060     VARARG(name,unicode_str);   /* object name */
1061 @REPLY
1062     obj_handle_t handle;        /* handle to the mapping */
1063 @END
1064 /* protection flags */
1065 #define VPROT_READ       0x01
1066 #define VPROT_WRITE      0x02
1067 #define VPROT_EXEC       0x04
1068 #define VPROT_WRITECOPY  0x08
1069 #define VPROT_GUARD      0x10
1070 #define VPROT_NOCACHE    0x20
1071 #define VPROT_COMMITTED  0x40
1072 #define VPROT_IMAGE      0x80
1073
1074
1075 /* Open a mapping */
1076 @REQ(open_mapping)
1077     unsigned int access;        /* wanted access rights */
1078     unsigned int attributes;    /* object attributes */
1079     obj_handle_t rootdir;       /* root directory */
1080     VARARG(name,unicode_str);   /* object name */
1081 @REPLY
1082     obj_handle_t handle;        /* handle to the mapping */
1083 @END
1084
1085
1086 /* Get information about a file mapping */
1087 @REQ(get_mapping_info)
1088     obj_handle_t handle;        /* handle to the mapping */
1089 @REPLY
1090     int          size_high;     /* mapping size */
1091     int          size_low;      /* mapping size */
1092     int          protect;       /* protection flags */
1093     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
1094     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
1095     obj_handle_t shared_file;   /* shared mapping file handle */
1096     int          shared_size;   /* shared mapping size */
1097 @END
1098
1099
1100 #define SNAP_HEAPLIST   0x00000001
1101 #define SNAP_PROCESS    0x00000002
1102 #define SNAP_THREAD     0x00000004
1103 #define SNAP_MODULE     0x00000008
1104 /* Create a snapshot */
1105 @REQ(create_snapshot)
1106     unsigned int attributes;    /* object attributes */
1107     int          flags;         /* snapshot flags (SNAP_*) */
1108     process_id_t pid;           /* process id */
1109 @REPLY
1110     obj_handle_t handle;        /* handle to the snapshot */
1111 @END
1112
1113
1114 /* Get the next process from a snapshot */
1115 @REQ(next_process)
1116     obj_handle_t handle;        /* handle to the snapshot */
1117     int          reset;         /* reset snapshot position? */
1118 @REPLY
1119     int          count;         /* process usage count */
1120     process_id_t pid;           /* process id */
1121     process_id_t ppid;          /* parent process id */
1122     void*        heap;          /* heap base */
1123     void*        module;        /* main module */
1124     int          threads;       /* number of threads */
1125     int          priority;      /* process priority */
1126     int          handles;       /* number of handles */
1127     VARARG(filename,unicode_str); /* file name of main exe */
1128 @END
1129
1130
1131 /* Get the next thread from a snapshot */
1132 @REQ(next_thread)
1133     obj_handle_t handle;        /* handle to the snapshot */
1134     int          reset;         /* reset snapshot position? */
1135 @REPLY
1136     int          count;         /* thread usage count */
1137     process_id_t pid;           /* process id */
1138     thread_id_t  tid;           /* thread id */
1139     int          base_pri;      /* base priority */
1140     int          delta_pri;     /* delta priority */
1141 @END
1142
1143
1144 /* Get the next module from a snapshot */
1145 @REQ(next_module)
1146     obj_handle_t handle;        /* handle to the snapshot */
1147     int          reset;         /* reset snapshot position? */
1148 @REPLY
1149     process_id_t pid;           /* process id */
1150     void*        base;          /* module base address */
1151     size_t       size;          /* module size */
1152     VARARG(filename,unicode_str); /* file name of module */
1153 @END
1154
1155
1156 /* Wait for a debug event */
1157 @REQ(wait_debug_event)
1158     int           get_handle;  /* should we alloc a handle for waiting? */
1159 @REPLY
1160     process_id_t  pid;         /* process id */
1161     thread_id_t   tid;         /* thread id */
1162     obj_handle_t  wait;        /* wait handle if no event ready */
1163     VARARG(event,debug_event); /* debug event data */
1164 @END
1165
1166
1167 /* Queue an exception event */
1168 @REQ(queue_exception_event)
1169     int              first;    /* first chance exception? */
1170     VARARG(record,exc_event);  /* thread context followed by exception record */
1171 @REPLY
1172     obj_handle_t     handle;   /* handle to the queued event */
1173 @END
1174
1175
1176 /* Retrieve the status of an exception event */
1177 @REQ(get_exception_status)
1178     obj_handle_t     handle;   /* handle to the queued event */
1179 @REPLY
1180     VARARG(context,context);   /* modified thread context */
1181 @END
1182
1183
1184 /* Send an output string to the debugger */
1185 @REQ(output_debug_string)
1186     void*         string;      /* string to display (in debugged process address space) */
1187     int           unicode;     /* is it Unicode? */
1188     int           length;      /* string length */
1189 @END
1190
1191
1192 /* Continue a debug event */
1193 @REQ(continue_debug_event)
1194     process_id_t pid;          /* process id to continue */
1195     thread_id_t  tid;          /* thread id to continue */
1196     int          status;       /* continuation status */
1197 @END
1198
1199
1200 /* Start/stop debugging an existing process */
1201 @REQ(debug_process)
1202     process_id_t pid;          /* id of the process to debug */
1203     int          attach;       /* 1=attaching / 0=detaching from the process */
1204 @END
1205
1206
1207 /* Simulate a breakpoint in a process */
1208 @REQ(debug_break)
1209     obj_handle_t handle;       /* process handle */
1210 @REPLY
1211     int          self;         /* was it the caller itself? */
1212 @END
1213
1214
1215 /* Set debugger kill on exit flag */
1216 @REQ(set_debugger_kill_on_exit)
1217     int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
1218 @END
1219
1220
1221 /* Read data from a process address space */
1222 @REQ(read_process_memory)
1223     obj_handle_t handle;       /* process handle */
1224     void*        addr;         /* addr to read from */
1225 @REPLY
1226     VARARG(data,bytes);        /* result data */
1227 @END
1228
1229
1230 /* Write data to a process address space */
1231 @REQ(write_process_memory)
1232     obj_handle_t handle;       /* process handle */
1233     void*        addr;         /* addr to write to (must be int-aligned) */
1234     unsigned int first_mask;   /* mask for first word */
1235     unsigned int last_mask;    /* mask for last word */
1236     VARARG(data,bytes);        /* data to write */
1237 @END
1238
1239
1240 /* Create a registry key */
1241 @REQ(create_key)
1242     obj_handle_t parent;       /* handle to the parent key */
1243     unsigned int access;       /* desired access rights */
1244     unsigned int attributes;   /* object attributes */
1245     unsigned int options;      /* creation options */
1246     time_t       modif;        /* last modification time */
1247     size_t       namelen;      /* length of key name in bytes */
1248     VARARG(name,unicode_str,namelen);  /* key name */
1249     VARARG(class,unicode_str);         /* class name */
1250 @REPLY
1251     obj_handle_t hkey;         /* handle to the created key */
1252     int          created;      /* has it been newly created? */
1253 @END
1254
1255 /* Open a registry key */
1256 @REQ(open_key)
1257     obj_handle_t parent;       /* handle to the parent key */
1258     unsigned int access;       /* desired access rights */
1259     unsigned int attributes;   /* object attributes */
1260     VARARG(name,unicode_str);  /* key name */
1261 @REPLY
1262     obj_handle_t hkey;         /* handle to the open key */
1263 @END
1264
1265
1266 /* Delete a registry key */
1267 @REQ(delete_key)
1268     obj_handle_t hkey;         /* handle to the key */
1269 @END
1270
1271
1272 /* Flush a registry key */
1273 @REQ(flush_key)
1274     obj_handle_t hkey;         /* handle to the key */
1275 @END
1276
1277
1278 /* Enumerate registry subkeys */
1279 @REQ(enum_key)
1280     obj_handle_t hkey;         /* handle to registry key */
1281     int          index;        /* index of subkey (or -1 for current key) */
1282     int          info_class;   /* requested information class */
1283 @REPLY
1284     int          subkeys;      /* number of subkeys */
1285     int          max_subkey;   /* longest subkey name */
1286     int          max_class;    /* longest class name */
1287     int          values;       /* number of values */
1288     int          max_value;    /* longest value name */
1289     int          max_data;     /* longest value data */
1290     time_t       modif;        /* last modification time */
1291     size_t       total;        /* total length needed for full name and class */
1292     size_t       namelen;      /* length of key name in bytes */
1293     VARARG(name,unicode_str,namelen);  /* key name */
1294     VARARG(class,unicode_str);         /* class name */
1295 @END
1296
1297
1298 /* Set a value of a registry key */
1299 @REQ(set_key_value)
1300     obj_handle_t hkey;         /* handle to registry key */
1301     int          type;         /* value type */
1302     size_t       namelen;      /* length of value name in bytes */
1303     VARARG(name,unicode_str,namelen);  /* value name */
1304     VARARG(data,bytes);                /* value data */
1305 @END
1306
1307
1308 /* Retrieve the value of a registry key */
1309 @REQ(get_key_value)
1310     obj_handle_t hkey;         /* handle to registry key */
1311     VARARG(name,unicode_str);  /* value name */
1312 @REPLY
1313     int          type;         /* value type */
1314     size_t       total;        /* total length needed for data */
1315     VARARG(data,bytes);        /* value data */
1316 @END
1317
1318
1319 /* Enumerate a value of a registry key */
1320 @REQ(enum_key_value)
1321     obj_handle_t hkey;         /* handle to registry key */
1322     int          index;        /* value index */
1323     int          info_class;   /* requested information class */
1324 @REPLY
1325     int          type;         /* value type */
1326     size_t       total;        /* total length needed for full name and data */
1327     size_t       namelen;      /* length of value name in bytes */
1328     VARARG(name,unicode_str,namelen);  /* value name */
1329     VARARG(data,bytes);                /* value data */
1330 @END
1331
1332
1333 /* Delete a value of a registry key */
1334 @REQ(delete_key_value)
1335     obj_handle_t hkey;         /* handle to registry key */
1336     VARARG(name,unicode_str);  /* value name */
1337 @END
1338
1339
1340 /* Load a registry branch from a file */
1341 @REQ(load_registry)
1342     obj_handle_t hkey;         /* root key to load to */
1343     obj_handle_t file;         /* file to load from */
1344     VARARG(name,unicode_str);  /* subkey name */
1345 @END
1346
1347
1348 /* UnLoad a registry branch from a file */
1349 @REQ(unload_registry)
1350     obj_handle_t hkey;         /* root key to unload to */
1351 @END
1352
1353
1354 /* Save a registry branch to a file */
1355 @REQ(save_registry)
1356     obj_handle_t hkey;         /* key to save */
1357     obj_handle_t file;         /* file to save to */
1358 @END
1359
1360
1361 /* Add a registry key change notification */
1362 @REQ(set_registry_notification)
1363     obj_handle_t hkey;         /* key to watch for changes */
1364     obj_handle_t event;        /* event to set */
1365     int          subtree;      /* should we watch the whole subtree? */
1366     unsigned int filter;       /* things to watch */
1367 @END
1368
1369
1370 /* Create a waitable timer */
1371 @REQ(create_timer)
1372     unsigned int access;        /* wanted access rights */
1373     unsigned int attributes;    /* object attributes */
1374     obj_handle_t rootdir;       /* root directory */
1375     int          manual;        /* manual reset */
1376     VARARG(name,unicode_str);   /* object name */
1377 @REPLY
1378     obj_handle_t handle;        /* handle to the timer */
1379 @END
1380
1381
1382 /* Open a waitable timer */
1383 @REQ(open_timer)
1384     unsigned int access;        /* wanted access rights */
1385     unsigned int attributes;    /* object attributes */
1386     obj_handle_t rootdir;       /* root directory */
1387     VARARG(name,unicode_str);   /* object name */
1388 @REPLY
1389     obj_handle_t handle;        /* handle to the timer */
1390 @END
1391
1392 /* Set a waitable timer */
1393 @REQ(set_timer)
1394     obj_handle_t handle;        /* handle to the timer */
1395     abs_time_t   expire;        /* next expiration absolute time */
1396     int          period;        /* timer period in ms */
1397     void*        callback;      /* callback function */
1398     void*        arg;           /* callback argument */
1399 @REPLY
1400     int          signaled;      /* was the timer signaled before this call ? */
1401 @END
1402
1403 /* Cancel a waitable timer */
1404 @REQ(cancel_timer)
1405     obj_handle_t handle;        /* handle to the timer */
1406 @REPLY
1407      int         signaled;      /* was the timer signaled before this calltime ? */
1408 @END
1409
1410 /* Get information on a waitable timer */
1411 @REQ(get_timer_info)
1412     obj_handle_t handle;        /* handle to the timer */
1413 @REPLY
1414     abs_time_t   when;          /* absolute time when the timer next expires */
1415     int          signaled;      /* is the timer signaled? */
1416 @END
1417
1418
1419 /* Retrieve the current context of a thread */
1420 @REQ(get_thread_context)
1421     obj_handle_t handle;       /* thread handle */
1422     unsigned int flags;        /* context flags */
1423     int          suspend;      /* if getting context during suspend */
1424 @REPLY
1425     int          self;         /* was it a handle to the current thread? */
1426     VARARG(context,context);   /* thread context */
1427 @END
1428
1429
1430 /* Set the current context of a thread */
1431 @REQ(set_thread_context)
1432     obj_handle_t handle;       /* thread handle */
1433     unsigned int flags;        /* context flags */
1434     int          suspend;      /* if setting context during suspend */
1435     VARARG(context,context);   /* thread context */
1436 @REPLY
1437     int          self;         /* was it a handle to the current thread? */
1438 @END
1439
1440
1441 /* Fetch a selector entry for a thread */
1442 @REQ(get_selector_entry)
1443     obj_handle_t  handle;      /* thread handle */
1444     int           entry;       /* LDT entry */
1445 @REPLY
1446     unsigned int  base;        /* selector base */
1447     unsigned int  limit;       /* selector limit */
1448     unsigned char flags;       /* selector flags */
1449 @END
1450
1451
1452 /* Add an atom */
1453 @REQ(add_atom)
1454     obj_handle_t  table;       /* which table to add atom to */
1455     VARARG(name,unicode_str);  /* atom name */
1456 @REPLY
1457     atom_t        atom;        /* resulting atom */
1458 @END
1459
1460
1461 /* Delete an atom */
1462 @REQ(delete_atom)
1463     obj_handle_t  table;       /* which table to delete atom from */
1464     atom_t        atom;        /* atom handle */
1465 @END
1466
1467
1468 /* Find an atom */
1469 @REQ(find_atom)
1470     obj_handle_t table;        /* which table to find atom from */
1471     VARARG(name,unicode_str);  /* atom name */
1472 @REPLY
1473     atom_t       atom;         /* atom handle */
1474 @END
1475
1476
1477 /* Get information about an atom */
1478 @REQ(get_atom_information)
1479     obj_handle_t table;        /* which table to find atom from */
1480     atom_t       atom;         /* atom handle */
1481 @REPLY
1482     int          count;        /* atom lock count */
1483     int          pinned;       /* whether the atom has been pinned */
1484     size_t       total;        /* actual length of atom name */
1485     VARARG(name,unicode_str);  /* atom name */
1486 @END
1487
1488
1489 /* Set information about an atom */
1490 @REQ(set_atom_information)
1491     obj_handle_t table;        /* which table to find atom from */
1492     atom_t       atom;         /* atom handle */
1493     int          pinned;       /* whether to bump atom information */
1494 @END
1495
1496
1497 /* Empty an atom table */
1498 @REQ(empty_atom_table)
1499     obj_handle_t table;        /* which table to find atom from */
1500     int          if_pinned;    /* whether to delete pinned atoms */
1501 @END
1502
1503
1504 /* Init an atom table */
1505 @REQ(init_atom_table)
1506     int          entries;      /* number of entries (only for local) */
1507 @REPLY
1508     obj_handle_t table;        /* handle to the atom table */
1509 @END
1510
1511
1512 /* Get the message queue of the current thread */
1513 @REQ(get_msg_queue)
1514 @REPLY
1515     obj_handle_t handle;       /* handle to the queue */
1516 @END
1517
1518
1519 /* Set the current message queue wakeup mask */
1520 @REQ(set_queue_mask)
1521     unsigned int wake_mask;    /* wakeup bits mask */
1522     unsigned int changed_mask; /* changed bits mask */
1523     int          skip_wait;    /* will we skip waiting if signaled? */
1524 @REPLY
1525     unsigned int wake_bits;    /* current wake bits */
1526     unsigned int changed_bits; /* current changed bits */
1527 @END
1528
1529
1530 /* Get the current message queue status */
1531 @REQ(get_queue_status)
1532     int          clear;        /* should we clear the change bits? */
1533 @REPLY
1534     unsigned int wake_bits;    /* wake bits */
1535     unsigned int changed_bits; /* changed bits since last time */
1536 @END
1537
1538
1539 /* Wait for a process to start waiting on input */
1540 @REQ(wait_input_idle)
1541     obj_handle_t handle;       /* process handle */
1542     int          timeout;      /* timeout */
1543 @REPLY
1544     obj_handle_t event;        /* handle to idle event */
1545 @END
1546
1547
1548 /* Send a message to a thread queue */
1549 @REQ(send_message)
1550     thread_id_t     id;        /* thread id */
1551     int             type;      /* message type (see below) */
1552     int             flags;     /* message flags (see below) */
1553     user_handle_t   win;       /* window handle */
1554     unsigned int    msg;       /* message code */
1555     unsigned int    wparam;    /* parameters */
1556     unsigned int    lparam;    /* parameters */
1557     int             x;         /* x position */
1558     int             y;         /* y position */
1559     unsigned int    time;      /* message time */
1560     unsigned int    info;      /* extra info */
1561     int             timeout;   /* timeout for reply */
1562     void*           callback;  /* callback address */
1563     VARARG(data,bytes);        /* message data for sent messages */
1564 @END
1565
1566 @REQ(post_quit_message)
1567     int             exit_code; /* exit code to return */
1568 @END
1569
1570 enum message_type
1571 {
1572     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1573     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1574     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1575     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1576     MSG_CALLBACK_RESULT,/* result of a callback message */
1577     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1578     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1579     MSG_HARDWARE,       /* hardware message */
1580     MSG_WINEVENT        /* winevent message */
1581 };
1582 #define SEND_MSG_ABORT_IF_HUNG  0x01
1583
1584
1585 /* Get a message from the current queue */
1586 @REQ(get_message)
1587     int             flags;     /* see below */
1588     user_handle_t   get_win;   /* window handle to get */
1589     unsigned int    get_first; /* first message code to get */
1590     unsigned int    get_last;  /* last message code to get */
1591     unsigned int    hw_id;     /* id of the previous hardware message (or 0) */
1592 @REPLY
1593     int             type;      /* message type */
1594     user_handle_t   win;       /* window handle */
1595     unsigned int    msg;       /* message code */
1596     unsigned int    wparam;    /* parameters (callback function for MSG_CALLBACK_RESULT) */
1597     unsigned int    lparam;    /* parameters (result for MSG_CALLBACK_RESULT) */
1598     int             x;         /* x position */
1599     int             y;         /* y position */
1600     user_handle_t   hook;      /* winevent hook handle */
1601     void*           hook_proc; /* winevent hook proc address */
1602     unsigned int    time;      /* message time */
1603     unsigned int    info;      /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1604     unsigned int    hw_id;     /* id if hardware message */
1605     unsigned int    active_hooks; /* active hooks bitmap */
1606     size_t          total;     /* total size of extra data */
1607     VARARG(data,bytes);        /* message data for sent messages */
1608 @END
1609 #define GET_MSG_REMOVE      1  /* remove the message */
1610 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1611
1612 /* Reply to a sent message */
1613 @REQ(reply_message)
1614     unsigned int    result;    /* message result */
1615     int             remove;    /* should we remove the message? */
1616     VARARG(data,bytes);        /* message data for sent messages */
1617 @END
1618
1619
1620 /* Accept the current hardware message */
1621 @REQ(accept_hardware_message)
1622     unsigned int    hw_id;     /* id of the hardware message */
1623     int             remove;    /* should we remove the message? */
1624     user_handle_t   new_win;   /* new destination window for current message */
1625 @END
1626
1627
1628 /* Retrieve the reply for the last message sent */
1629 @REQ(get_message_reply)
1630     int             cancel;    /* cancel message if not ready? */
1631 @REPLY
1632     unsigned int    result;    /* message result */
1633     VARARG(data,bytes);        /* message data for sent messages */
1634 @END
1635
1636
1637 /* Set a window timer */
1638 @REQ(set_win_timer)
1639     user_handle_t   win;       /* window handle */
1640     unsigned int    msg;       /* message to post */
1641     unsigned int    id;        /* timer id */
1642     unsigned int    rate;      /* timer rate in ms */
1643     unsigned int    lparam;    /* message lparam (callback proc) */
1644 @REPLY
1645     unsigned int    id;        /* timer id */
1646 @END
1647
1648
1649 /* Kill a window timer */
1650 @REQ(kill_win_timer)
1651     user_handle_t   win;       /* window handle */
1652     unsigned int    msg;       /* message to post */
1653     unsigned int    id;        /* timer id */
1654 @END
1655
1656
1657 /* Retrieve info about a serial port */
1658 @REQ(get_serial_info)
1659     obj_handle_t handle;       /* handle to comm port */
1660 @REPLY
1661     unsigned int readinterval;
1662     unsigned int readconst;
1663     unsigned int readmult;
1664     unsigned int writeconst;
1665     unsigned int writemult;
1666     unsigned int eventmask;
1667     unsigned int commerror;
1668 @END
1669
1670
1671 /* Set info about a serial port */
1672 @REQ(set_serial_info)
1673     obj_handle_t handle;       /* handle to comm port */
1674     int          flags;        /* bitmask to set values (see below) */
1675     unsigned int readinterval;
1676     unsigned int readconst;
1677     unsigned int readmult;
1678     unsigned int writeconst;
1679     unsigned int writemult;
1680     unsigned int eventmask;
1681     unsigned int commerror;
1682 @END
1683 #define SERIALINFO_SET_TIMEOUTS  0x01
1684 #define SERIALINFO_SET_MASK      0x02
1685 #define SERIALINFO_SET_ERROR     0x04
1686
1687
1688 /* Create an async I/O */
1689 @REQ(register_async)
1690     obj_handle_t handle;        /* handle to comm port, socket or file */
1691     int          type;          /* type of queue to look after */
1692     void*        io_apc;        /* APC routine to queue upon end of async */
1693     void*        io_sb;         /* I/O status block (unique across all async on this handle) */
1694     void*        io_user;       /* data to pass back to caller */
1695     int          count;         /* count - usually # of bytes to be read/written */
1696 @END
1697 #define ASYNC_TYPE_READ  0x01
1698 #define ASYNC_TYPE_WRITE 0x02
1699 #define ASYNC_TYPE_WAIT  0x03
1700
1701
1702 /* Cancel all async op on a fd */
1703 @REQ(cancel_async)
1704     obj_handle_t handle;        /* handle to comm port, socket or file */
1705 @END
1706
1707
1708 /* Create a named pipe */
1709 @REQ(create_named_pipe)
1710     unsigned int   access;
1711     unsigned int   attributes;   /* object attributes */
1712     obj_handle_t   rootdir;      /* root directory */
1713     unsigned int   options;
1714     unsigned int   flags;
1715     unsigned int   maxinstances;
1716     unsigned int   outsize;
1717     unsigned int   insize;
1718     unsigned int   timeout;
1719     VARARG(name,unicode_str);    /* pipe name */
1720 @REPLY
1721     obj_handle_t   handle;       /* handle to the pipe */
1722 @END
1723
1724 /* flags in create_named_pipe and get_named_pipe_info */
1725 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1726 #define NAMED_PIPE_MESSAGE_STREAM_READ  0x0002
1727 #define NAMED_PIPE_NONBLOCKING_MODE     0x0004
1728
1729
1730 /* Open an existing named pipe */
1731 @REQ(open_named_pipe)
1732     unsigned int   access;
1733     unsigned int   attributes;   /* object attributes */
1734     obj_handle_t   rootdir;      /* root directory */
1735     unsigned int   flags;        /* file flags */
1736     VARARG(name,unicode_str);    /* pipe name */
1737 @REPLY
1738     obj_handle_t   handle;       /* handle to the pipe */
1739 @END
1740
1741
1742 /* Connect to a named pipe */
1743 @REQ(connect_named_pipe)
1744     obj_handle_t   handle;
1745     obj_handle_t   event;
1746     void*          func;
1747 @END
1748
1749
1750 /* Wait for a named pipe */
1751 @REQ(wait_named_pipe)
1752     obj_handle_t   handle;
1753     unsigned int   timeout;
1754     obj_handle_t   event;
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 /* Create a window */
1779 @REQ(create_window)
1780     user_handle_t  parent;      /* parent window */
1781     user_handle_t  owner;       /* owner window */
1782     atom_t         atom;        /* class atom */
1783     void*          instance;    /* module instance */
1784 @REPLY
1785     user_handle_t  handle;      /* created window */
1786     int            extra;       /* number of extra bytes */
1787     void*          class_ptr;   /* pointer to class in client address space */
1788 @END
1789
1790
1791 /* Destroy a window */
1792 @REQ(destroy_window)
1793     user_handle_t  handle;      /* handle to the window */
1794 @END
1795
1796
1797 /* Retrieve the desktop window for the current thread */
1798 @REQ(get_desktop_window)
1799 @REPLY
1800     user_handle_t  handle;      /* handle to the desktop window */
1801 @END
1802
1803
1804 /* Set a window owner */
1805 @REQ(set_window_owner)
1806     user_handle_t  handle;      /* handle to the window */
1807     user_handle_t  owner;       /* new owner */
1808 @REPLY
1809     user_handle_t  full_owner;  /* full handle of new owner */
1810     user_handle_t  prev_owner;  /* full handle of previous owner */
1811 @END
1812
1813
1814 /* Get information from a window handle */
1815 @REQ(get_window_info)
1816     user_handle_t  handle;      /* handle to the window */
1817 @REPLY
1818     user_handle_t  full_handle; /* full 32-bit handle */
1819     user_handle_t  last_active; /* last active popup */
1820     process_id_t   pid;         /* process owning the window */
1821     thread_id_t    tid;         /* thread owning the window */
1822     atom_t         atom;        /* class atom */
1823     int            is_unicode;  /* ANSI or unicode */
1824 @END
1825
1826
1827 /* Set some information in a window */
1828 @REQ(set_window_info)
1829     user_handle_t  handle;        /* handle to the window */
1830     unsigned int   flags;         /* flags for fields to set (see below) */
1831     unsigned int   style;         /* window style */
1832     unsigned int   ex_style;      /* window extended style */
1833     unsigned int   id;            /* window id */
1834     void*          instance;      /* creator instance */
1835     int            is_unicode;    /* ANSI or unicode */
1836     void*          user_data;     /* user-specific data */
1837     int            extra_offset;  /* offset to set in extra bytes */
1838     size_t         extra_size;    /* size to set in extra bytes */
1839     unsigned int   extra_value;   /* value to set in extra bytes */
1840 @REPLY
1841     unsigned int   old_style;     /* old window style */
1842     unsigned int   old_ex_style;  /* old window extended style */
1843     unsigned int   old_id;        /* old window id */
1844     void*          old_instance;  /* old creator instance */
1845     void*          old_user_data; /* old user-specific data */
1846     unsigned int   old_extra_value; /* old value in extra bytes */
1847 @END
1848 #define SET_WIN_STYLE     0x01
1849 #define SET_WIN_EXSTYLE   0x02
1850 #define SET_WIN_ID        0x04
1851 #define SET_WIN_INSTANCE  0x08
1852 #define SET_WIN_USERDATA  0x10
1853 #define SET_WIN_EXTRA     0x20
1854 #define SET_WIN_UNICODE   0x40
1855
1856
1857 /* Set the parent of a window */
1858 @REQ(set_parent)
1859     user_handle_t  handle;      /* handle to the window */
1860     user_handle_t  parent;      /* handle to the parent */
1861 @REPLY
1862     user_handle_t  old_parent;  /* old parent window */
1863     user_handle_t  full_parent; /* full handle of new parent */
1864 @END
1865
1866
1867 /* Get a list of the window parents, up to the root of the tree */
1868 @REQ(get_window_parents)
1869     user_handle_t  handle;        /* handle to the window */
1870 @REPLY
1871     int            count;         /* total count of parents */
1872     VARARG(parents,user_handles); /* parent handles */
1873 @END
1874
1875
1876 /* Get a list of the window children */
1877 @REQ(get_window_children)
1878     user_handle_t  parent;        /* parent window */
1879     atom_t         atom;          /* class atom for the listed children */
1880     thread_id_t    tid;           /* thread owning the listed children */
1881 @REPLY
1882     int            count;         /* total count of children */
1883     VARARG(children,user_handles); /* children handles */
1884 @END
1885
1886
1887 /* Get a list of the window children that contain a given point */
1888 @REQ(get_window_children_from_point)
1889     user_handle_t  parent;        /* parent window */
1890     int            x;             /* point in parent coordinates */
1891     int            y;
1892 @REPLY
1893     int            count;         /* total count of children */
1894     VARARG(children,user_handles); /* children handles */
1895 @END
1896
1897
1898 /* Get window tree information from a window handle */
1899 @REQ(get_window_tree)
1900     user_handle_t  handle;        /* handle to the window */
1901 @REPLY
1902     user_handle_t  parent;        /* parent window */
1903     user_handle_t  owner;         /* owner window */
1904     user_handle_t  next_sibling;  /* next sibling in Z-order */
1905     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1906     user_handle_t  first_sibling; /* first sibling in Z-order */
1907     user_handle_t  last_sibling;  /* last sibling in Z-order */
1908     user_handle_t  first_child;   /* first child */
1909     user_handle_t  last_child;    /* last child */
1910 @END
1911
1912 /* Set the position and Z order of a window */
1913 @REQ(set_window_pos)
1914     user_handle_t  handle;        /* handle to the window */
1915     user_handle_t  previous;      /* previous window in Z order */
1916     unsigned int   flags;         /* SWP_* flags */
1917     rectangle_t    window;        /* window rectangle */
1918     rectangle_t    client;        /* client rectangle */
1919     VARARG(valid,rectangles);     /* valid rectangles from WM_NCCALCSIZE */
1920 @REPLY
1921     unsigned int   new_style;     /* new window style */
1922 @END
1923
1924
1925 /* Get the window and client rectangles of a window */
1926 @REQ(get_window_rectangles)
1927     user_handle_t  handle;        /* handle to the window */
1928 @REPLY
1929     rectangle_t    window;        /* window rectangle */
1930     rectangle_t    visible;       /* visible part of the window rectangle */
1931     rectangle_t    client;        /* client rectangle */
1932 @END
1933
1934
1935 /* Get the window text */
1936 @REQ(get_window_text)
1937     user_handle_t  handle;        /* handle to the window */
1938 @REPLY
1939     VARARG(text,unicode_str);     /* window text */
1940 @END
1941
1942
1943 /* Set the window text */
1944 @REQ(set_window_text)
1945     user_handle_t  handle;        /* handle to the window */
1946     VARARG(text,unicode_str);     /* window text */
1947 @END
1948
1949
1950 /* Get the coordinates offset between two windows */
1951 @REQ(get_windows_offset)
1952     user_handle_t  from;          /* handle to the first window */
1953     user_handle_t  to;            /* handle to the second window */
1954 @REPLY
1955     int            x;             /* x coordinate offset */
1956     int            y;             /* y coordinate offset */
1957 @END
1958
1959
1960 /* Get the visible region of a window */
1961 @REQ(get_visible_region)
1962     user_handle_t  window;        /* handle to the window */
1963     unsigned int   flags;         /* DCX flags */
1964 @REPLY
1965     user_handle_t  top_win;       /* top window to clip against */
1966     int            top_org_x;     /* top window visible rect origin in screen coords */
1967     int            top_org_y;
1968     int            win_org_x;     /* window rect origin in screen coords */
1969     int            win_org_y;
1970     size_t         total_size;    /* total size of the resulting region */
1971     VARARG(region,rectangles);    /* list of rectangles for the region (in screen coords) */
1972 @END
1973
1974
1975 /* Get the window region */
1976 @REQ(get_window_region)
1977     user_handle_t  window;        /* handle to the window */
1978 @REPLY
1979     size_t         total_size;    /* total size of the resulting region */
1980     VARARG(region,rectangles);    /* list of rectangles for the region */
1981 @END
1982
1983
1984 /* Set the window region */
1985 @REQ(set_window_region)
1986     user_handle_t  window;        /* handle to the window */
1987     VARARG(region,rectangles);    /* list of rectangles for the region */
1988 @END
1989
1990
1991 /* Get the window update region */
1992 @REQ(get_update_region)
1993     user_handle_t  window;        /* handle to the window */
1994     user_handle_t  from_child;    /* child to start searching from */
1995     unsigned int   flags;         /* update flags (see below) */
1996 @REPLY
1997     user_handle_t  child;         /* child to repaint (or window itself) */
1998     unsigned int   flags;         /* resulting update flags (see below) */
1999     size_t         total_size;    /* total size of the resulting region */
2000     VARARG(region,rectangles);    /* list of rectangles for the region */
2001 @END
2002 #define UPDATE_NONCLIENT       0x01  /* get region for repainting non-client area */
2003 #define UPDATE_ERASE           0x02  /* get region for erasing client area */
2004 #define UPDATE_PAINT           0x04  /* get region for painting client area */
2005 #define UPDATE_INTERNALPAINT   0x08  /* get region if internal paint is pending */
2006 #define UPDATE_ALLCHILDREN     0x10  /* force repaint of all children */
2007 #define UPDATE_NOCHILDREN      0x20  /* don't try to repaint any children */
2008 #define UPDATE_NOREGION        0x40  /* don't return a region, only the flags */
2009
2010
2011 /* Update the z order of a window so that a given rectangle is fully visible */
2012 @REQ(update_window_zorder)
2013     user_handle_t  window;        /* handle to the window */
2014     rectangle_t    rect;          /* rectangle that must be visible */
2015 @END
2016
2017
2018 /* Mark parts of a window as needing a redraw */
2019 @REQ(redraw_window)
2020     user_handle_t  window;        /* handle to the window */
2021     unsigned int   flags;         /* RDW_* flags */
2022     VARARG(region,rectangles);    /* list of rectangles for the region */
2023 @END
2024
2025
2026 /* Set a window property */
2027 @REQ(set_window_property)
2028     user_handle_t  window;        /* handle to the window */
2029     atom_t         atom;          /* property atom (if no name specified) */
2030     obj_handle_t   handle;        /* handle to store */
2031     VARARG(name,unicode_str);     /* property name */
2032 @END
2033
2034
2035 /* Remove a window property */
2036 @REQ(remove_window_property)
2037     user_handle_t  window;        /* handle to the window */
2038     atom_t         atom;          /* property atom (if no name specified) */
2039     VARARG(name,unicode_str);     /* property name */
2040 @REPLY
2041     obj_handle_t   handle;        /* handle stored in property */
2042 @END
2043
2044
2045 /* Get a window property */
2046 @REQ(get_window_property)
2047     user_handle_t  window;        /* handle to the window */
2048     atom_t         atom;          /* property atom (if no name specified) */
2049     VARARG(name,unicode_str);     /* property name */
2050 @REPLY
2051     obj_handle_t   handle;        /* handle stored in property */
2052 @END
2053
2054
2055 /* Get the list of properties of a window */
2056 @REQ(get_window_properties)
2057     user_handle_t  window;        /* handle to the window */
2058 @REPLY
2059     int            total;         /* total number of properties */
2060     VARARG(props,properties);     /* list of properties */
2061 @END
2062
2063
2064 /* Create a window station */
2065 @REQ(create_winstation)
2066     unsigned int flags;           /* window station flags */
2067     unsigned int access;          /* wanted access rights */
2068     unsigned int attributes;      /* object attributes */
2069     VARARG(name,unicode_str);     /* object name */
2070 @REPLY
2071     obj_handle_t handle;          /* handle to the window station */
2072 @END
2073
2074
2075 /* Open a handle to a window station */
2076 @REQ(open_winstation)
2077     unsigned int access;          /* wanted access rights */
2078     unsigned int attributes;      /* object attributes */
2079     VARARG(name,unicode_str);     /* object name */
2080 @REPLY
2081     obj_handle_t handle;          /* handle to the window station */
2082 @END
2083
2084
2085 /* Close a window station */
2086 @REQ(close_winstation)
2087     obj_handle_t handle;          /* handle to the window station */
2088 @END
2089
2090
2091 /* Get the process current window station */
2092 @REQ(get_process_winstation)
2093 @REPLY
2094     obj_handle_t handle;          /* handle to the window station */
2095 @END
2096
2097
2098 /* Set the process current window station */
2099 @REQ(set_process_winstation)
2100     obj_handle_t handle;          /* handle to the window station */
2101 @END
2102
2103
2104 /* Create a desktop */
2105 @REQ(create_desktop)
2106     unsigned int flags;           /* desktop flags */
2107     unsigned int access;          /* wanted access rights */
2108     unsigned int attributes;      /* object attributes */
2109     VARARG(name,unicode_str);     /* object name */
2110 @REPLY
2111     obj_handle_t handle;          /* handle to the desktop */
2112 @END
2113
2114
2115 /* Open a handle to a desktop */
2116 @REQ(open_desktop)
2117     unsigned int flags;           /* desktop flags */
2118     unsigned int access;          /* wanted access rights */
2119     unsigned int attributes;      /* object attributes */
2120     VARARG(name,unicode_str);     /* object name */
2121 @REPLY
2122     obj_handle_t handle;          /* handle to the desktop */
2123 @END
2124
2125
2126 /* Close a desktop */
2127 @REQ(close_desktop)
2128     obj_handle_t handle;          /* handle to the desktop */
2129 @END
2130
2131
2132 /* Get the thread current desktop */
2133 @REQ(get_thread_desktop)
2134     thread_id_t  tid;             /* thread id */
2135 @REPLY
2136     obj_handle_t handle;          /* handle to the desktop */
2137 @END
2138
2139
2140 /* Set the thread current desktop */
2141 @REQ(set_thread_desktop)
2142     obj_handle_t handle;          /* handle to the desktop */
2143 @END
2144
2145
2146 /* Get/set information about a user object (window station or desktop) */
2147 @REQ(set_user_object_info)
2148     obj_handle_t handle;          /* handle to the object */
2149     unsigned int flags;           /* information to set */
2150     unsigned int obj_flags;       /* new object flags */
2151 @REPLY
2152     int          is_desktop;      /* is object a desktop? */
2153     unsigned int old_obj_flags;   /* old object flags */
2154     VARARG(name,unicode_str);     /* object name */
2155 @END
2156 #define SET_USER_OBJECT_FLAGS 1
2157
2158
2159 /* Attach (or detach) thread inputs */
2160 @REQ(attach_thread_input)
2161     thread_id_t    tid_from;       /* thread to be attached */
2162     thread_id_t    tid_to;         /* thread to which tid_from should be attached */
2163     int            attach;         /* is it an attach? */
2164 @END
2165
2166
2167 /* Get input data for a given thread */
2168 @REQ(get_thread_input)
2169     thread_id_t    tid;           /* id of thread */
2170 @REPLY
2171     user_handle_t  focus;         /* handle to the focus window */
2172     user_handle_t  capture;       /* handle to the capture window */
2173     user_handle_t  active;        /* handle to the active window */
2174     user_handle_t  foreground;    /* handle to the global foreground window */
2175     user_handle_t  menu_owner;    /* handle to the menu owner */
2176     user_handle_t  move_size;     /* handle to the moving/resizing window */
2177     user_handle_t  caret;         /* handle to the caret window */
2178     rectangle_t    rect;          /* caret rectangle */
2179 @END
2180
2181
2182 /* Get the time of the last input event */
2183 @REQ(get_last_input_time)
2184 @REPLY
2185     unsigned int time;
2186 @END
2187
2188
2189 /* Retrieve queue keyboard state for a given thread */
2190 @REQ(get_key_state)
2191     thread_id_t    tid;           /* id of thread */
2192     int            key;           /* optional key code or -1 */
2193 @REPLY
2194     unsigned char  state;         /* state of specified key */
2195     VARARG(keystate,bytes);       /* state array for all the keys */
2196 @END
2197
2198 /* Set queue keyboard state for a given thread */
2199 @REQ(set_key_state)
2200     thread_id_t    tid;           /* id of thread */
2201     VARARG(keystate,bytes);       /* state array for all the keys */
2202 @END
2203
2204 /* Set the system foreground window */
2205 @REQ(set_foreground_window)
2206     user_handle_t  handle;        /* handle to the foreground window */
2207 @REPLY
2208     user_handle_t  previous;      /* handle to the previous foreground window */
2209     int            send_msg_old;  /* whether we have to send a msg to the old window */
2210     int            send_msg_new;  /* whether we have to send a msg to the new window */
2211 @END
2212
2213 /* Set the current thread focus window */
2214 @REQ(set_focus_window)
2215     user_handle_t  handle;        /* handle to the focus window */
2216 @REPLY
2217     user_handle_t  previous;      /* handle to the previous focus window */
2218 @END
2219
2220 /* Set the current thread active window */
2221 @REQ(set_active_window)
2222     user_handle_t  handle;        /* handle to the active window */
2223 @REPLY
2224     user_handle_t  previous;      /* handle to the previous active window */
2225 @END
2226
2227 /* Set the current thread capture window */
2228 @REQ(set_capture_window)
2229     user_handle_t  handle;        /* handle to the capture window */
2230     unsigned int   flags;         /* capture flags (see below) */
2231 @REPLY
2232     user_handle_t  previous;      /* handle to the previous capture window */
2233     user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
2234 @END
2235 #define CAPTURE_MENU     0x01  /* capture is for a menu */
2236 #define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */
2237
2238
2239 /* Set the current thread caret window */
2240 @REQ(set_caret_window)
2241     user_handle_t  handle;        /* handle to the caret window */
2242     int            width;         /* caret width */
2243     int            height;        /* caret height */
2244 @REPLY
2245     user_handle_t  previous;      /* handle to the previous caret window */
2246     rectangle_t    old_rect;      /* previous caret rectangle */
2247     int            old_hide;      /* previous hide count */
2248     int            old_state;     /* previous caret state (1=on, 0=off) */
2249 @END
2250
2251
2252 /* Set the current thread caret information */
2253 @REQ(set_caret_info)
2254     unsigned int   flags;         /* caret flags (see below) */
2255     user_handle_t  handle;        /* handle to the caret window */
2256     int            x;             /* caret x position */
2257     int            y;             /* caret y position */
2258     int            hide;          /* increment for hide count (can be negative to show it) */
2259     int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
2260 @REPLY
2261     user_handle_t  full_handle;   /* handle to the current caret window */
2262     rectangle_t    old_rect;      /* previous caret rectangle */
2263     int            old_hide;      /* previous hide count */
2264     int            old_state;     /* previous caret state (1=on, 0=off) */
2265 @END
2266 #define SET_CARET_POS        0x01  /* set the caret position from x,y */
2267 #define SET_CARET_HIDE       0x02  /* increment the caret hide count */
2268 #define SET_CARET_STATE      0x04  /* set the caret on/off state */
2269
2270
2271 /* Set a window hook */
2272 @REQ(set_hook)
2273     int            id;             /* id of the hook */
2274     process_id_t   pid;            /* id of process to set the hook into */
2275     thread_id_t    tid;            /* id of thread to set the hook into */
2276     int            event_min;
2277     int            event_max;
2278     int            flags;
2279     void*          proc;           /* hook procedure */
2280     int            unicode;        /* is it a unicode hook? */
2281     VARARG(module,unicode_str);    /* module name */
2282 @REPLY
2283     user_handle_t  handle;         /* handle to the hook */
2284     unsigned int   active_hooks;   /* active hooks bitmap */
2285 @END
2286
2287
2288 /* Remove a window hook */
2289 @REQ(remove_hook)
2290     user_handle_t  handle;         /* handle to the hook */
2291     int            id;             /* id of the hook if handle is 0 */
2292     void*          proc;           /* hook procedure if handle is 0 */
2293 @REPLY
2294     unsigned int   active_hooks;   /* active hooks bitmap */
2295 @END
2296
2297
2298 /* Start calling a hook chain */
2299 @REQ(start_hook_chain)
2300     int            id;             /* id of the hook */
2301     int            event;          /* signalled event */
2302     user_handle_t  window;         /* handle to the event window */
2303     int            object_id;      /* object id for out of context winevent */
2304     int            child_id;       /* child id for out of context winevent */
2305 @REPLY
2306     user_handle_t  handle;         /* handle to the next hook */
2307     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2308     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2309     void*          proc;           /* hook procedure */
2310     int            unicode;        /* is it a unicode hook? */
2311     unsigned int   active_hooks;   /* active hooks bitmap */
2312     VARARG(module,unicode_str);    /* module name */
2313 @END
2314
2315
2316 /* Finished calling a hook chain */
2317 @REQ(finish_hook_chain)
2318     int            id;             /* id of the hook */
2319 @END
2320
2321
2322 /* Get the next hook to call */
2323 @REQ(get_next_hook)
2324     user_handle_t  handle;         /* handle to the current hook */
2325     int            event;          /* signalled event */
2326     user_handle_t  window;         /* handle to the event window */
2327     int            object_id;      /* object id for out of context winevent */
2328     int            child_id;       /* child id for out of context winevent */
2329 @REPLY
2330     user_handle_t  next;           /* handle to the next hook */
2331     int            id;             /* id of the next hook */
2332     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2333     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2334     void*          proc;           /* next hook procedure */
2335     int            prev_unicode;   /* was the previous a unicode hook? */
2336     int            next_unicode;   /* is the next a unicode hook? */
2337     VARARG(module,unicode_str);    /* module name */
2338 @END
2339
2340
2341 /* Create a window class */
2342 @REQ(create_class)
2343     int            local;          /* is it a local class? */
2344     atom_t         atom;           /* class atom */
2345     unsigned int   style;          /* class style */
2346     void*          instance;       /* module instance */
2347     int            extra;          /* number of extra class bytes */
2348     int            win_extra;      /* number of window extra bytes */
2349     void*          client_ptr;     /* pointer to class in client address space */
2350 @END
2351
2352
2353 /* Destroy a window class */
2354 @REQ(destroy_class)
2355     atom_t         atom;           /* class atom */
2356     void*          instance;       /* module instance */
2357 @REPLY
2358     void*          client_ptr;     /* pointer to class in client address space */
2359 @END
2360
2361
2362 /* Set some information in a class */
2363 @REQ(set_class_info)
2364     user_handle_t  window;         /* handle to the window */
2365     unsigned int   flags;          /* flags for info to set (see below) */
2366     atom_t         atom;           /* class atom */
2367     unsigned int   style;          /* class style */
2368     int            win_extra;      /* number of window extra bytes */
2369     void*          instance;       /* module instance */
2370     int            extra_offset;   /* offset to set in extra bytes */
2371     size_t         extra_size;     /* size to set in extra bytes */
2372     unsigned int   extra_value;    /* value to set in extra bytes */
2373 @REPLY
2374     atom_t         old_atom;       /* previous class atom */
2375     unsigned int   old_style;      /* previous class style */
2376     int            old_extra;      /* previous number of class extra bytes */
2377     int            old_win_extra;  /* previous number of window extra bytes */
2378     void*          old_instance;   /* previous module instance */
2379     unsigned int   old_extra_value; /* old value in extra bytes */
2380 @END
2381 #define SET_CLASS_ATOM      0x0001
2382 #define SET_CLASS_STYLE     0x0002
2383 #define SET_CLASS_WINEXTRA  0x0004
2384 #define SET_CLASS_INSTANCE  0x0008
2385 #define SET_CLASS_EXTRA     0x0010
2386
2387
2388 /* Set/get clipboard information */
2389 @REQ(set_clipboard_info)
2390     unsigned int   flags;       /* flags for fields to set (see below) */
2391     user_handle_t  clipboard;   /* clipboard window */
2392     user_handle_t  owner;       /* clipboard owner */
2393     user_handle_t  viewer;      /* first clipboard viewer */
2394     unsigned int   seqno;       /* change sequence number */
2395 @REPLY
2396     unsigned int   flags;           /* status flags (see below) */
2397     user_handle_t  old_clipboard;   /* old clipboard window */
2398     user_handle_t  old_owner;       /* old clipboard owner */
2399     user_handle_t  old_viewer;      /* old clipboard viewer */
2400     unsigned int   seqno;           /* current sequence number */
2401 @END
2402
2403 #define SET_CB_OPEN      0x001
2404 #define SET_CB_OWNER     0x002
2405 #define SET_CB_VIEWER    0x004
2406 #define SET_CB_SEQNO     0x008
2407 #define SET_CB_RELOWNER  0x010
2408 #define SET_CB_CLOSE     0x020
2409 #define CB_OPEN          0x040
2410 #define CB_OWNER         0x080
2411 #define CB_PROCESS       0x100
2412
2413
2414 /* Open a security token */
2415 @REQ(open_token)
2416     obj_handle_t   handle;    /* handle to the thread or process */
2417     unsigned int   access;    /* access rights to the new token */
2418     unsigned int   attributes;/* object attributes */
2419     unsigned int   flags;     /* flags (see below) */
2420 @REPLY
2421     obj_handle_t   token;    /* handle to the token */
2422 @END
2423 #define OPEN_TOKEN_THREAD   1
2424 #define OPEN_TOKEN_AS_SELF  2
2425
2426
2427 /* Set/get the global windows */
2428 @REQ(set_global_windows)
2429     unsigned int   flags;               /* flags for fields to set (see below) */
2430     user_handle_t  shell_window;        /* handle to the new shell window */
2431     user_handle_t  shell_listview;      /* handle to the new shell listview window */
2432     user_handle_t  progman_window;      /* handle to the new program manager window */
2433     user_handle_t  taskman_window;      /* handle to the new task manager window */
2434 @REPLY
2435     user_handle_t  old_shell_window;    /* handle to the shell window */
2436     user_handle_t  old_shell_listview;  /* handle to the shell listview window */
2437     user_handle_t  old_progman_window;  /* handle to the new program manager window */
2438     user_handle_t  old_taskman_window;  /* handle to the new task manager window */
2439 @END
2440 #define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
2441 #define SET_GLOBAL_PROGMAN_WINDOW  0x02
2442 #define SET_GLOBAL_TASKMAN_WINDOW  0x04
2443
2444 /* Adjust the privileges held by a token */
2445 @REQ(adjust_token_privileges)
2446     obj_handle_t  handle; /* handle to the token */
2447     int           disable_all; /* disable all privileges? */
2448     int           get_modified_state; /* get modified privileges? */
2449     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2450 @REPLY
2451     unsigned int  len; /* total length in bytes required to store token privileges */
2452     VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2453 @END
2454
2455 /* Retrieves the set of privileges held by or available to a token */
2456 @REQ(get_token_privileges)
2457     obj_handle_t  handle; /* handle to the token */
2458 @REPLY
2459     unsigned int  len; /* total length in bytes required to store token privileges */
2460     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2461 @END
2462
2463 /* Check the token has the required privileges */
2464 @REQ(check_token_privileges)
2465     obj_handle_t  handle; /* handle to the token */
2466     int           all_required; /* are all the privileges required for the check to succeed? */
2467     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2468 @REPLY
2469     int           has_privileges; /* does the token have the required privileges? */
2470     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2471 @END
2472
2473 @REQ(duplicate_token)
2474     obj_handle_t  handle;        /* handle to the token to duplicate */
2475     unsigned int  access;        /* access rights to the new token */
2476     unsigned int  attributes;    /* object attributes */
2477     int           primary;       /* is the new token to be a primary one? */
2478     int           impersonation_level; /* impersonation level of the new token */
2479 @REPLY
2480     obj_handle_t  new_handle; /* duplicated handle */
2481 @END
2482
2483 @REQ(access_check)
2484     obj_handle_t    handle; /* handle to the token */
2485     unsigned int    desired_access; /* desired access to the object */
2486     unsigned int    mapping_read; /* mapping from generic read to specific rights */
2487     unsigned int    mapping_write; /* mapping from generic write to specific rights */
2488     unsigned int    mapping_execute; /* mapping from generic execute to specific rights */
2489     unsigned int    mapping_all; /* mapping from generic all to specific rights */
2490     VARARG(sd,security_descriptor); /* security descriptor to check */
2491 @REPLY
2492     unsigned int    access_granted; /* access rights actually granted */
2493     unsigned int    access_status; /* was access granted? */
2494     unsigned int    privileges_len; /* length needed to store privileges */
2495     VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2496 @END
2497
2498 @REQ(get_token_user)
2499     obj_handle_t    handle;       /* handle to the token */
2500 @REPLY
2501     size_t          user_len;     /* length needed to store user */
2502     VARARG(user,SID);             /* sid of the user the token represents */
2503 @END
2504
2505 /* Create a mailslot */
2506 @REQ(create_mailslot)
2507     unsigned int   access;        /* wanted access rights */
2508     unsigned int   attributes;    /* object attributes */
2509     obj_handle_t   rootdir;       /* root directory */
2510     unsigned int   max_msgsize;
2511     int            read_timeout;
2512     VARARG(name,unicode_str);     /* mailslot name */
2513 @REPLY
2514     obj_handle_t   handle;        /* handle to the mailslot */
2515 @END
2516
2517
2518 /* Open an existing mailslot */
2519 @REQ(open_mailslot)
2520     unsigned int   access;
2521     unsigned int   attributes;    /* object attributes */
2522     obj_handle_t   rootdir;       /* root directory */
2523     unsigned int   sharing;       /* sharing mode */
2524     VARARG(name,unicode_str);     /* mailslot name */
2525 @REPLY
2526     obj_handle_t   handle;        /* handle to the mailslot */
2527 @END
2528
2529
2530 /* Set mailslot information */
2531 @REQ(set_mailslot_info)
2532     obj_handle_t   handle;        /* handle to the mailslot */
2533     unsigned int   flags;
2534     int            read_timeout;
2535 @REPLY
2536     unsigned int   max_msgsize;
2537     int            read_timeout;
2538     unsigned int   msg_count;
2539     unsigned int   next_msgsize;
2540 @END
2541 #define MAILSLOT_SET_READ_TIMEOUT  1
2542
2543
2544 /* Create a directory object */
2545 @REQ(create_directory)
2546     unsigned int   access;        /* access flags */
2547     unsigned int   attributes;    /* object attributes */
2548     obj_handle_t   rootdir;       /* root directory */
2549     VARARG(directory_name,unicode_str); /* Directory name */
2550 @REPLY
2551     obj_handle_t   handle;        /* handle to the directory */
2552 @END
2553
2554
2555 /* Open a directory object */
2556 @REQ(open_directory)
2557     unsigned int   access;        /* access flags */
2558     unsigned int   attributes;    /* object attributes */
2559     obj_handle_t   rootdir;       /* root directory */
2560     VARARG(directory_name,unicode_str); /* Directory name */
2561 @REPLY
2562     obj_handle_t   handle;        /* handle to the directory */
2563 @END
2564
2565
2566 /* Create a symbolic link object */
2567 @REQ(create_symlink)
2568     unsigned int   access;        /* access flags */
2569     unsigned int   attributes;    /* object attributes */
2570     obj_handle_t   rootdir;       /* root directory */
2571     size_t         name_len;      /* length of the symlink name in bytes */
2572     VARARG(name,unicode_str,name_len); /* symlink name */
2573     VARARG(target_name,unicode_str);   /* target name */
2574 @REPLY
2575     obj_handle_t   handle;        /* handle to the symlink */
2576 @END
2577
2578
2579 /* Open a symbolic link object */
2580 @REQ(open_symlink)
2581     unsigned int   access;        /* access flags */
2582     unsigned int   attributes;    /* object attributes */
2583     obj_handle_t   rootdir;       /* root directory */
2584     VARARG(name,unicode_str);     /* symlink name */
2585 @REPLY
2586     obj_handle_t   handle;        /* handle to the symlink */
2587 @END
2588
2589
2590 /* Query a symbolic link object */
2591 @REQ(query_symlink)
2592     obj_handle_t   handle;        /* handle to the symlink */
2593 @REPLY
2594     VARARG(target_name,unicode_str); /* target name */
2595 @END