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