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