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