Added speaker config macros.
[wine/hacks.git] / server / protocol.def
blob20b87db5d5b9d56a6ed1dcafe439a485f7aea645
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 create_flags; /* creation flags */
208 int unix_pid; /* Unix pid of new process */
209 obj_handle_t exe_file; /* file handle for main exe */
210 obj_handle_t hstdin; /* handle for stdin */
211 obj_handle_t hstdout; /* handle for stdout */
212 obj_handle_t hstderr; /* handle for stderr */
213 VARARG(info,startup_info); /* startup information */
214 @REPLY
215 obj_handle_t info; /* new process info handle */
216 @END
219 /* Retrieve information about a newly started process */
220 @REQ(get_new_process_info)
221 obj_handle_t info; /* info handle returned from new_process_request */
222 int pinherit; /* process handle inherit flag */
223 int tinherit; /* thread handle inherit flag */
224 @REPLY
225 process_id_t pid; /* process id */
226 obj_handle_t phandle; /* process handle (in the current process) */
227 thread_id_t tid; /* thread id */
228 obj_handle_t thandle; /* thread handle (in the current process) */
229 int success; /* did the process start successfully? */
230 @END
233 /* Create a new thread from the context of the parent */
234 @REQ(new_thread)
235 int suspend; /* new thread should be suspended on creation */
236 int inherit; /* inherit flag */
237 int request_fd; /* fd for request pipe */
238 @REPLY
239 thread_id_t tid; /* thread id */
240 obj_handle_t handle; /* thread handle (in the current process) */
241 @END
244 /* Signal that we are finished booting on the client side */
245 @REQ(boot_done)
246 int debug_level; /* new debug level */
247 @END
250 /* Initialize a process; called from the new process context */
251 @REQ(init_process)
252 void* ldt_copy; /* addr of LDT copy */
253 @REPLY
254 int create_flags; /* creation flags */
255 unsigned int server_start; /* server start time (GetTickCount) */
256 size_t info_size; /* total size of startup info */
257 obj_handle_t exe_file; /* file handle for main exe */
258 obj_handle_t hstdin; /* handle for stdin */
259 obj_handle_t hstdout; /* handle for stdout */
260 obj_handle_t hstderr; /* handle for stderr */
261 @END
264 /* Retrieve the new process startup info */
265 @REQ(get_startup_info)
266 @REPLY
267 VARARG(info,startup_info); /* startup information */
268 @END
271 /* Signal the end of the process initialization */
272 @REQ(init_process_done)
273 void* module; /* main module base address */
274 size_t module_size; /* main module size */
275 void* entry; /* process entry point */
276 void* name; /* ptr to ptr to name (in process addr space) */
277 obj_handle_t exe_file; /* file handle for main exe */
278 int gui; /* is it a GUI process? */
279 VARARG(filename,string); /* file name of main exe */
280 @REPLY
281 int debugged; /* being debugged? */
282 @END
285 /* Initialize a thread; called from the child after fork()/clone() */
286 @REQ(init_thread)
287 int unix_pid; /* Unix pid of new thread */
288 int unix_tid; /* Unix tid of new thread */
289 void* teb; /* TEB of new thread (in thread address space) */
290 void* entry; /* thread entry point (in thread address space) */
291 int reply_fd; /* fd for reply pipe */
292 int wait_fd; /* fd for blocking calls pipe */
293 @REPLY
294 process_id_t pid; /* process id of the new thread's process */
295 thread_id_t tid; /* thread id of the new thread */
296 int boot; /* is this the boot thread? */
297 int version; /* protocol version */
298 @END
301 /* Terminate a process */
302 @REQ(terminate_process)
303 obj_handle_t handle; /* process handle to terminate */
304 int exit_code; /* process exit code */
305 @REPLY
306 int self; /* suicide? */
307 @END
310 /* Terminate a thread */
311 @REQ(terminate_thread)
312 obj_handle_t handle; /* thread handle to terminate */
313 int exit_code; /* thread exit code */
314 @REPLY
315 int self; /* suicide? */
316 int last; /* last thread in this process? */
317 @END
320 /* Retrieve information about a process */
321 @REQ(get_process_info)
322 obj_handle_t handle; /* process handle */
323 @REPLY
324 process_id_t pid; /* server process id */
325 int debugged; /* debugged? */
326 int exit_code; /* process exit code */
327 int priority; /* priority class */
328 int process_affinity; /* process affinity mask */
329 int system_affinity; /* system affinity mask */
330 @END
333 /* Set a process informations */
334 @REQ(set_process_info)
335 obj_handle_t handle; /* process handle */
336 int mask; /* setting mask (see below) */
337 int priority; /* priority class */
338 int affinity; /* affinity mask */
339 @END
340 #define SET_PROCESS_INFO_PRIORITY 0x01
341 #define SET_PROCESS_INFO_AFFINITY 0x02
344 /* Retrieve information about a thread */
345 @REQ(get_thread_info)
346 obj_handle_t handle; /* thread handle */
347 thread_id_t tid_in; /* thread id (optional) */
348 @REPLY
349 process_id_t pid; /* server process id */
350 thread_id_t tid; /* server thread id */
351 void* teb; /* thread teb pointer */
352 int exit_code; /* thread exit code */
353 int priority; /* thread priority level */
354 int affinity; /* thread affinity mask */
355 time_t creation_time; /* thread creation time */
356 time_t exit_time; /* thread exit time */
357 @END
360 /* Set a thread informations */
361 @REQ(set_thread_info)
362 obj_handle_t handle; /* thread handle */
363 int mask; /* setting mask (see below) */
364 int priority; /* priority class */
365 int affinity; /* affinity mask */
366 @END
367 #define SET_THREAD_INFO_PRIORITY 0x01
368 #define SET_THREAD_INFO_AFFINITY 0x02
371 /* Retrieve information about a module */
372 @REQ(get_dll_info)
373 obj_handle_t handle; /* process handle */
374 void* base_address; /* base address of module */
375 @REPLY
376 size_t size; /* module size */
377 void* entry_point;
378 VARARG(filename,string); /* file name of module */
379 @END
382 /* Suspend a thread */
383 @REQ(suspend_thread)
384 obj_handle_t handle; /* thread handle */
385 @REPLY
386 int count; /* new suspend count */
387 @END
390 /* Resume a thread */
391 @REQ(resume_thread)
392 obj_handle_t handle; /* thread handle */
393 @REPLY
394 int count; /* new suspend count */
395 @END
398 /* Notify the server that a dll has been loaded */
399 @REQ(load_dll)
400 obj_handle_t handle; /* file handle */
401 void* base; /* base address */
402 size_t size; /* dll size */
403 int dbg_offset; /* debug info offset */
404 int dbg_size; /* debug info size */
405 void* name; /* ptr to ptr to name (in process addr space) */
406 VARARG(filename,string); /* file name of dll */
407 @END
410 /* Notify the server that a dll is being unloaded */
411 @REQ(unload_dll)
412 void* base; /* base address */
413 @END
416 /* Queue an APC for a thread */
417 @REQ(queue_apc)
418 obj_handle_t handle; /* thread handle */
419 int user; /* user or system apc? */
420 void* func; /* function to call */
421 void* arg1; /* params for function to call */
422 void* arg2;
423 void* arg3;
424 @END
427 /* Get next APC to call */
428 @REQ(get_apc)
429 int alertable; /* is thread alertable? */
430 @REPLY
431 void* func; /* function to call */
432 int type; /* function type */
433 void* arg1; /* function arguments */
434 void* arg2;
435 void* arg3;
436 @END
437 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
440 /* Close a handle for the current process */
441 @REQ(close_handle)
442 obj_handle_t handle; /* handle to close */
443 @REPLY
444 int fd; /* associated fd to close */
445 @END
448 /* Set a handle information */
449 @REQ(set_handle_info)
450 obj_handle_t handle; /* handle we are interested in */
451 int flags; /* new handle flags */
452 int mask; /* mask for flags to set */
453 int fd; /* file descriptor or -1 */
454 @REPLY
455 int old_flags; /* old flag value */
456 int cur_fd; /* current file descriptor */
457 @END
460 /* Duplicate a handle */
461 @REQ(dup_handle)
462 obj_handle_t src_process; /* src process handle */
463 obj_handle_t src_handle; /* src handle to duplicate */
464 obj_handle_t dst_process; /* dst process handle */
465 unsigned int access; /* wanted access rights */
466 int inherit; /* inherit flag */
467 int options; /* duplicate options (see below) */
468 @REPLY
469 obj_handle_t handle; /* duplicated handle in dst process */
470 int fd; /* associated fd to close */
471 @END
472 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
473 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
474 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
477 /* Open a handle to a process */
478 @REQ(open_process)
479 process_id_t pid; /* process id to open */
480 unsigned int access; /* wanted access rights */
481 int inherit; /* inherit flag */
482 @REPLY
483 obj_handle_t handle; /* handle to the process */
484 @END
487 /* Open a handle to a thread */
488 @REQ(open_thread)
489 thread_id_t tid; /* thread id to open */
490 unsigned int access; /* wanted access rights */
491 int inherit; /* inherit flag */
492 @REPLY
493 obj_handle_t handle; /* handle to the thread */
494 @END
497 /* Wait for handles */
498 @REQ(select)
499 int flags; /* wait flags (see below) */
500 void* cookie; /* magic cookie to return to client */
501 abs_time_t timeout; /* absolute timeout */
502 VARARG(handles,handles); /* handles to select on */
503 @END
504 #define SELECT_ALL 1
505 #define SELECT_ALERTABLE 2
506 #define SELECT_INTERRUPTIBLE 4
507 #define SELECT_TIMEOUT 8
510 /* Create an event */
511 @REQ(create_event)
512 int manual_reset; /* manual reset event */
513 int initial_state; /* initial state of the event */
514 int inherit; /* inherit flag */
515 VARARG(name,unicode_str); /* object name */
516 @REPLY
517 obj_handle_t handle; /* handle to the event */
518 @END
520 /* Event operation */
521 @REQ(event_op)
522 obj_handle_t handle; /* handle to event */
523 int op; /* event operation (see below) */
524 @END
525 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
528 /* Open an event */
529 @REQ(open_event)
530 unsigned int access; /* wanted access rights */
531 int inherit; /* inherit flag */
532 VARARG(name,unicode_str); /* object name */
533 @REPLY
534 obj_handle_t handle; /* handle to the event */
535 @END
538 /* Create a mutex */
539 @REQ(create_mutex)
540 int owned; /* initially owned? */
541 int inherit; /* inherit flag */
542 VARARG(name,unicode_str); /* object name */
543 @REPLY
544 obj_handle_t handle; /* handle to the mutex */
545 @END
548 /* Release a mutex */
549 @REQ(release_mutex)
550 obj_handle_t handle; /* handle to the mutex */
551 @END
554 /* Open a mutex */
555 @REQ(open_mutex)
556 unsigned int access; /* wanted access rights */
557 int inherit; /* inherit flag */
558 VARARG(name,unicode_str); /* object name */
559 @REPLY
560 obj_handle_t handle; /* handle to the mutex */
561 @END
564 /* Create a semaphore */
565 @REQ(create_semaphore)
566 unsigned int initial; /* initial count */
567 unsigned int max; /* maximum count */
568 int inherit; /* inherit flag */
569 VARARG(name,unicode_str); /* object name */
570 @REPLY
571 obj_handle_t handle; /* handle to the semaphore */
572 @END
575 /* Release a semaphore */
576 @REQ(release_semaphore)
577 obj_handle_t handle; /* handle to the semaphore */
578 unsigned int count; /* count to add to semaphore */
579 @REPLY
580 unsigned int prev_count; /* previous semaphore count */
581 @END
584 /* Open a semaphore */
585 @REQ(open_semaphore)
586 unsigned int access; /* wanted access rights */
587 int inherit; /* inherit flag */
588 VARARG(name,unicode_str); /* object name */
589 @REPLY
590 obj_handle_t handle; /* handle to the semaphore */
591 @END
594 /* Create a file */
595 @REQ(create_file)
596 unsigned int access; /* wanted access rights */
597 int inherit; /* inherit flag */
598 unsigned int sharing; /* sharing flags */
599 int create; /* file create action */
600 unsigned int attrs; /* file attributes for creation */
601 int drive_type; /* type of drive the file is on */
602 VARARG(filename,string); /* file name */
603 @REPLY
604 obj_handle_t handle; /* handle to the file */
605 @END
608 /* Allocate a file handle for a Unix fd */
609 @REQ(alloc_file_handle)
610 unsigned int access; /* wanted access rights */
611 int inherit; /* inherit flag */
612 int fd; /* file descriptor on the client side */
613 @REPLY
614 obj_handle_t handle; /* handle to the file */
615 @END
618 /* Get a Unix fd to access a file */
619 @REQ(get_handle_fd)
620 obj_handle_t handle; /* handle to the file */
621 unsigned int access; /* wanted access rights */
622 @REPLY
623 int fd; /* file descriptor */
624 int type; /* the type of file (see below) */
625 int flags; /* file read/write flags (see below) */
626 @END
627 enum fd_type
629 FD_TYPE_INVALID,
630 FD_TYPE_DEFAULT,
631 FD_TYPE_SOCKET,
632 FD_TYPE_SMB
634 #define FD_FLAG_OVERLAPPED 0x01
635 #define FD_FLAG_TIMEOUT 0x02
636 #define FD_FLAG_RECV_SHUTDOWN 0x04
637 #define FD_FLAG_SEND_SHUTDOWN 0x08
639 /* Set a file current position */
640 @REQ(set_file_pointer)
641 obj_handle_t handle; /* handle to the file */
642 int low; /* position low word */
643 int high; /* position high word */
644 int whence; /* whence to seek */
645 @REPLY
646 int new_low; /* new position low word */
647 int new_high; /* new position high word */
648 @END
651 /* Truncate (or extend) a file */
652 @REQ(truncate_file)
653 obj_handle_t handle; /* handle to the file */
654 @END
657 /* Set a file access and modification times */
658 @REQ(set_file_time)
659 obj_handle_t handle; /* handle to the file */
660 time_t access_time; /* last access time */
661 time_t write_time; /* last write time */
662 @END
665 /* Flush a file buffers */
666 @REQ(flush_file)
667 obj_handle_t handle; /* handle to the file */
668 @REPLY
669 obj_handle_t event; /* event set when finished */
670 @END
673 /* Get information about a file */
674 @REQ(get_file_info)
675 obj_handle_t handle; /* handle to the file */
676 @REPLY
677 int type; /* file type */
678 int attr; /* file attributes */
679 time_t access_time; /* last access time */
680 time_t write_time; /* last write time */
681 time_t change_time; /* last change time */
682 int size_high; /* file size */
683 int size_low; /* file size */
684 int alloc_high; /* size used on disk */
685 int alloc_low; /* size used on disk */
686 int links; /* number of links */
687 int index_high; /* unique index */
688 int index_low; /* unique index */
689 unsigned int serial; /* volume serial number */
690 @END
693 /* Lock a region of a file */
694 @REQ(lock_file)
695 obj_handle_t handle; /* handle to the file */
696 unsigned int offset_low; /* offset of start of lock */
697 unsigned int offset_high; /* offset of start of lock */
698 unsigned int count_low; /* count of bytes to lock */
699 unsigned int count_high; /* count of bytes to lock */
700 int shared; /* shared or exclusive lock? */
701 int wait; /* do we want to wait? */
702 @REPLY
703 obj_handle_t handle; /* handle to wait on */
704 int overlapped; /* is it an overlapped I/O handle? */
705 @END
708 /* Unlock a region of a file */
709 @REQ(unlock_file)
710 obj_handle_t handle; /* handle to the file */
711 unsigned int offset_low; /* offset of start of unlock */
712 unsigned int offset_high; /* offset of start of unlock */
713 unsigned int count_low; /* count of bytes to unlock */
714 unsigned int count_high; /* count of bytes to unlock */
715 @END
718 /* Create a socket */
719 @REQ(create_socket)
720 unsigned int access; /* wanted access rights */
721 int inherit; /* inherit flag */
722 int family; /* family, see socket manpage */
723 int type; /* type, see socket manpage */
724 int protocol; /* protocol, see socket manpage */
725 unsigned int flags; /* socket flags */
726 @REPLY
727 obj_handle_t handle; /* handle to the new socket */
728 @END
731 /* Accept a socket */
732 @REQ(accept_socket)
733 obj_handle_t lhandle; /* handle to the listening socket */
734 unsigned int access; /* wanted access rights */
735 int inherit; /* inherit flag */
736 @REPLY
737 obj_handle_t handle; /* handle to the new socket */
738 @END
741 /* Set socket event parameters */
742 @REQ(set_socket_event)
743 obj_handle_t handle; /* handle to the socket */
744 unsigned int mask; /* event mask */
745 obj_handle_t event; /* event object */
746 user_handle_t window; /* window to send the message to */
747 unsigned int msg; /* message to send */
748 @END
751 /* Get socket event parameters */
752 @REQ(get_socket_event)
753 obj_handle_t handle; /* handle to the socket */
754 int service; /* clear pending? */
755 obj_handle_t c_event; /* event to clear */
756 @REPLY
757 unsigned int mask; /* event mask */
758 unsigned int pmask; /* pending events */
759 unsigned int state; /* status bits */
760 VARARG(errors,ints); /* event errors */
761 @END
764 /* Reenable pending socket events */
765 @REQ(enable_socket_event)
766 obj_handle_t handle; /* handle to the socket */
767 unsigned int mask; /* events to re-enable */
768 unsigned int sstate; /* status bits to set */
769 unsigned int cstate; /* status bits to clear */
770 @END
772 @REQ(set_socket_deferred)
773 obj_handle_t handle; /* handle to the socket */
774 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
775 @END
777 /* Allocate a console (only used by a console renderer) */
778 @REQ(alloc_console)
779 unsigned int access; /* wanted access rights */
780 int inherit; /* inherit flag */
781 process_id_t pid; /* pid of process which shall be attached to the console */
782 @REPLY
783 obj_handle_t handle_in; /* handle to console input */
784 obj_handle_t event; /* handle to renderer events change notification */
785 @END
788 /* Free the console of the current process */
789 @REQ(free_console)
790 @END
793 #define CONSOLE_RENDERER_NONE_EVENT 0x00
794 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
795 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
796 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
797 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
798 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
799 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
800 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
801 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
802 struct console_renderer_event
804 short event;
805 union
807 struct update
809 short top;
810 short bottom;
811 } update;
812 struct resize
814 short width;
815 short height;
816 } resize;
817 struct cursor_pos
819 short x;
820 short y;
821 } cursor_pos;
822 struct cursor_geom
824 short visible;
825 short size;
826 } cursor_geom;
827 struct display
829 short left;
830 short top;
831 short width;
832 short height;
833 } display;
834 } u;
837 /* retrieve console events for the renderer */
838 @REQ(get_console_renderer_events)
839 obj_handle_t handle; /* handle to console input events */
840 @REPLY
841 VARARG(data,bytes); /* the various console_renderer_events */
842 @END
845 /* Open a handle to the process console */
846 @REQ(open_console)
847 int from; /* 0 (resp 1) input (resp output) of current process console */
848 /* otherwise console_in handle to get active screen buffer? */
849 unsigned int access; /* wanted access rights */
850 int inherit; /* inherit flag */
851 int share; /* share mask (only for output handles) */
852 @REPLY
853 obj_handle_t handle; /* handle to the console */
854 @END
857 /* Get the input queue wait event */
858 @REQ(get_console_wait_event)
859 @REPLY
860 obj_handle_t handle;
861 @END
863 /* Get a console mode (input or output) */
864 @REQ(get_console_mode)
865 obj_handle_t handle; /* handle to the console */
866 @REPLY
867 int mode; /* console mode */
868 @END
871 /* Set a console mode (input or output) */
872 @REQ(set_console_mode)
873 obj_handle_t handle; /* handle to the console */
874 int mode; /* console mode */
875 @END
878 /* Set info about a console (input only) */
879 @REQ(set_console_input_info)
880 obj_handle_t handle; /* handle to console input, or 0 for process' console */
881 int mask; /* setting mask (see below) */
882 obj_handle_t active_sb; /* active screen buffer */
883 int history_mode; /* whether we duplicate lines in history */
884 int history_size; /* number of lines in history */
885 int edition_mode; /* index to the edition mode flavors */
886 VARARG(title,unicode_str); /* console title */
887 @END
888 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
889 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
890 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
891 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
892 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
895 /* Get info about a console (input only) */
896 @REQ(get_console_input_info)
897 obj_handle_t handle; /* handle to console input, or 0 for process' console */
898 @REPLY
899 int history_mode; /* whether we duplicate lines in history */
900 int history_size; /* number of lines in history */
901 int history_index; /* number of used lines in history */
902 int edition_mode; /* index to the edition mode flavors */
903 VARARG(title,unicode_str); /* console title */
904 @END
907 /* appends a string to console's history */
908 @REQ(append_console_input_history)
909 obj_handle_t handle; /* handle to console input, or 0 for process' console */
910 VARARG(line,unicode_str); /* line to add */
911 @END
914 /* appends a string to console's history */
915 @REQ(get_console_input_history)
916 obj_handle_t handle; /* handle to console input, or 0 for process' console */
917 int index; /* index to get line from */
918 @REPLY
919 int total; /* total length of line in Unicode chars */
920 VARARG(line,unicode_str); /* line to add */
921 @END
924 /* creates a new screen buffer on process' console */
925 @REQ(create_console_output)
926 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
927 int access; /* wanted access rights */
928 int share; /* sharing credentials */
929 int inherit; /* inherit flag */
930 @REPLY
931 obj_handle_t handle_out; /* handle to the screen buffer */
932 @END
935 /* Set info about a console (output only) */
936 @REQ(set_console_output_info)
937 obj_handle_t handle; /* handle to the console */
938 int mask; /* setting mask (see below) */
939 short int cursor_size; /* size of cursor (percentage filled) */
940 short int cursor_visible;/* cursor visibility flag */
941 short int cursor_x; /* position of cursor (x, y) */
942 short int cursor_y;
943 short int width; /* width of the screen buffer */
944 short int height; /* height of the screen buffer */
945 short int attr; /* default attribute */
946 short int win_left; /* window actually displayed by renderer */
947 short int win_top; /* the rect area is expressed withing the */
948 short int win_right; /* boundaries of the screen buffer */
949 short int win_bottom;
950 short int max_width; /* maximum size (width x height) for the window */
951 short int max_height;
952 @END
953 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
954 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
955 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
956 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
957 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
958 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
961 /* Get info about a console (output only) */
962 @REQ(get_console_output_info)
963 obj_handle_t handle; /* handle to the console */
964 @REPLY
965 short int cursor_size; /* size of cursor (percentage filled) */
966 short int cursor_visible;/* cursor visibility flag */
967 short int cursor_x; /* position of cursor (x, y) */
968 short int cursor_y;
969 short int width; /* width of the screen buffer */
970 short int height; /* height of the screen buffer */
971 short int attr; /* default attribute */
972 short int win_left; /* window actually displayed by renderer */
973 short int win_top; /* the rect area is expressed withing the */
974 short int win_right; /* boundaries of the screen buffer */
975 short int win_bottom;
976 short int max_width; /* maximum size (width x height) for the window */
977 short int max_height;
978 @END
980 /* Add input records to a console input queue */
981 @REQ(write_console_input)
982 obj_handle_t handle; /* handle to the console input */
983 VARARG(rec,input_records); /* input records */
984 @REPLY
985 int written; /* number of records written */
986 @END
989 /* Fetch input records from a console input queue */
990 @REQ(read_console_input)
991 obj_handle_t handle; /* handle to the console input */
992 int flush; /* flush the retrieved records from the queue? */
993 @REPLY
994 int read; /* number of records read */
995 VARARG(rec,input_records); /* input records */
996 @END
999 /* write data (chars and/or attributes) in a screen buffer */
1000 @REQ(write_console_output)
1001 obj_handle_t handle; /* handle to the console output */
1002 int x; /* position where to start writing */
1003 int y;
1004 int mode; /* char info (see below) */
1005 int wrap; /* wrap around at end of line? */
1006 VARARG(data,bytes); /* info to write */
1007 @REPLY
1008 int written; /* number of char infos actually written */
1009 int width; /* width of screen buffer */
1010 int height; /* height of screen buffer */
1011 @END
1012 enum char_info_mode
1014 CHAR_INFO_MODE_TEXT, /* characters only */
1015 CHAR_INFO_MODE_ATTR, /* attributes only */
1016 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1017 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1021 /* fill a screen buffer with constant data (chars and/or attributes) */
1022 @REQ(fill_console_output)
1023 obj_handle_t handle; /* handle to the console output */
1024 int x; /* position where to start writing */
1025 int y;
1026 int mode; /* char info mode */
1027 int count; /* number to write */
1028 int wrap; /* wrap around at end of line? */
1029 char_info_t data; /* data to write */
1030 @REPLY
1031 int written; /* number of char infos actually written */
1032 @END
1035 /* read data (chars and/or attributes) from a screen buffer */
1036 @REQ(read_console_output)
1037 obj_handle_t handle; /* handle to the console output */
1038 int x; /* position (x,y) where to start reading */
1039 int y;
1040 int mode; /* char info mode */
1041 int wrap; /* wrap around at end of line? */
1042 @REPLY
1043 int width; /* width of screen buffer */
1044 int height; /* height of screen buffer */
1045 VARARG(data,bytes);
1046 @END
1049 /* move a rect (of data) in screen buffer content */
1050 @REQ(move_console_output)
1051 obj_handle_t handle; /* handle to the console output */
1052 short int x_src; /* position (x, y) of rect to start moving from */
1053 short int y_src;
1054 short int x_dst; /* position (x, y) of rect to move to */
1055 short int y_dst;
1056 short int w; /* size of the rect (width, height) to move */
1057 short int h;
1058 @END
1061 /* Sends a signal to a process group */
1062 @REQ(send_console_signal)
1063 int signal; /* the signal to send */
1064 process_id_t group_id; /* the group to send the signal to */
1065 @END
1068 /* Create a change notification */
1069 @REQ(create_change_notification)
1070 obj_handle_t handle; /* handle to the directory */
1071 int subtree; /* watch all the subtree */
1072 unsigned int filter; /* notification filter */
1073 @REPLY
1074 obj_handle_t handle; /* handle to the change notification */
1075 @END
1078 /* Move to the next change notification */
1079 @REQ(next_change_notification)
1080 obj_handle_t handle; /* handle to the change notification */
1081 @END
1083 /* Create a file mapping */
1084 @REQ(create_mapping)
1085 int size_high; /* mapping size */
1086 int size_low; /* mapping size */
1087 int protect; /* protection flags (see below) */
1088 unsigned int access; /* wanted access rights */
1089 int inherit; /* inherit flag */
1090 obj_handle_t file_handle; /* file handle */
1091 VARARG(name,unicode_str); /* object name */
1092 @REPLY
1093 obj_handle_t handle; /* handle to the mapping */
1094 @END
1095 /* protection flags */
1096 #define VPROT_READ 0x01
1097 #define VPROT_WRITE 0x02
1098 #define VPROT_EXEC 0x04
1099 #define VPROT_WRITECOPY 0x08
1100 #define VPROT_GUARD 0x10
1101 #define VPROT_NOCACHE 0x20
1102 #define VPROT_COMMITTED 0x40
1103 #define VPROT_IMAGE 0x80
1106 /* Open a mapping */
1107 @REQ(open_mapping)
1108 unsigned int access; /* wanted access rights */
1109 int inherit; /* inherit flag */
1110 VARARG(name,unicode_str); /* object name */
1111 @REPLY
1112 obj_handle_t handle; /* handle to the mapping */
1113 @END
1116 /* Get information about a file mapping */
1117 @REQ(get_mapping_info)
1118 obj_handle_t handle; /* handle to the mapping */
1119 @REPLY
1120 int size_high; /* mapping size */
1121 int size_low; /* mapping size */
1122 int protect; /* protection flags */
1123 int header_size; /* header size (for VPROT_IMAGE mapping) */
1124 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1125 obj_handle_t shared_file; /* shared mapping file handle */
1126 int shared_size; /* shared mapping size */
1127 int drive_type; /* type of drive the file is on */
1128 @END
1131 /* Create a device */
1132 @REQ(create_device)
1133 unsigned int access; /* wanted access rights */
1134 int inherit; /* inherit flag */
1135 int id; /* client private id */
1136 @REPLY
1137 obj_handle_t handle; /* handle to the device */
1138 @END
1141 /* Retrieve the client private id for a device */
1142 @REQ(get_device_id)
1143 obj_handle_t handle; /* handle to the device */
1144 @REPLY
1145 int id; /* client private id */
1146 @END
1149 #define SNAP_HEAPLIST 0x00000001
1150 #define SNAP_PROCESS 0x00000002
1151 #define SNAP_THREAD 0x00000004
1152 #define SNAP_MODULE 0x00000008
1153 /* Create a snapshot */
1154 @REQ(create_snapshot)
1155 int inherit; /* inherit flag */
1156 int flags; /* snapshot flags (SNAP_*) */
1157 process_id_t pid; /* process id */
1158 @REPLY
1159 obj_handle_t handle; /* handle to the snapshot */
1160 @END
1163 /* Get the next process from a snapshot */
1164 @REQ(next_process)
1165 obj_handle_t handle; /* handle to the snapshot */
1166 int reset; /* reset snapshot position? */
1167 @REPLY
1168 int count; /* process usage count */
1169 process_id_t pid; /* process id */
1170 process_id_t ppid; /* parent process id */
1171 void* heap; /* heap base */
1172 void* module; /* main module */
1173 int threads; /* number of threads */
1174 int priority; /* process priority */
1175 VARARG(filename,string); /* file name of main exe */
1176 @END
1179 /* Get the next thread from a snapshot */
1180 @REQ(next_thread)
1181 obj_handle_t handle; /* handle to the snapshot */
1182 int reset; /* reset snapshot position? */
1183 @REPLY
1184 int count; /* thread usage count */
1185 process_id_t pid; /* process id */
1186 thread_id_t tid; /* thread id */
1187 int base_pri; /* base priority */
1188 int delta_pri; /* delta priority */
1189 @END
1192 /* Get the next module from a snapshot */
1193 @REQ(next_module)
1194 obj_handle_t handle; /* handle to the snapshot */
1195 int reset; /* reset snapshot position? */
1196 @REPLY
1197 process_id_t pid; /* process id */
1198 void* base; /* module base address */
1199 size_t size; /* module size */
1200 VARARG(filename,string); /* file name of module */
1201 @END
1204 /* Wait for a debug event */
1205 @REQ(wait_debug_event)
1206 int get_handle; /* should we alloc a handle for waiting? */
1207 @REPLY
1208 process_id_t pid; /* process id */
1209 thread_id_t tid; /* thread id */
1210 obj_handle_t wait; /* wait handle if no event ready */
1211 VARARG(event,debug_event); /* debug event data */
1212 @END
1215 /* Queue an exception event */
1216 @REQ(queue_exception_event)
1217 int first; /* first chance exception? */
1218 VARARG(record,exc_event); /* thread context followed by exception record */
1219 @REPLY
1220 obj_handle_t handle; /* handle to the queued event */
1221 @END
1224 /* Retrieve the status of an exception event */
1225 @REQ(get_exception_status)
1226 obj_handle_t handle; /* handle to the queued event */
1227 @REPLY
1228 int status; /* event continuation status */
1229 VARARG(context,context); /* modified thread context */
1230 @END
1233 /* Send an output string to the debugger */
1234 @REQ(output_debug_string)
1235 void* string; /* string to display (in debugged process address space) */
1236 int unicode; /* is it Unicode? */
1237 int length; /* string length */
1238 @END
1241 /* Continue a debug event */
1242 @REQ(continue_debug_event)
1243 process_id_t pid; /* process id to continue */
1244 thread_id_t tid; /* thread id to continue */
1245 int status; /* continuation status */
1246 @END
1249 /* Start/stop debugging an existing process */
1250 @REQ(debug_process)
1251 process_id_t pid; /* id of the process to debug */
1252 int attach; /* 1=attaching / 0=detaching from the process */
1253 @END
1256 /* Simulate a breakpoint in a process */
1257 @REQ(debug_break)
1258 obj_handle_t handle; /* process handle */
1259 @REPLY
1260 int self; /* was it the caller itself? */
1261 @END
1264 /* Set debugger kill on exit flag */
1265 @REQ(set_debugger_kill_on_exit)
1266 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1267 @END
1270 /* Read data from a process address space */
1271 @REQ(read_process_memory)
1272 obj_handle_t handle; /* process handle */
1273 void* addr; /* addr to read from */
1274 @REPLY
1275 VARARG(data,bytes); /* result data */
1276 @END
1279 /* Write data to a process address space */
1280 @REQ(write_process_memory)
1281 obj_handle_t handle; /* process handle */
1282 void* addr; /* addr to write to (must be int-aligned) */
1283 unsigned int first_mask; /* mask for first word */
1284 unsigned int last_mask; /* mask for last word */
1285 VARARG(data,bytes); /* data to write */
1286 @END
1289 /* Create a registry key */
1290 @REQ(create_key)
1291 obj_handle_t parent; /* handle to the parent key */
1292 unsigned int access; /* desired access rights */
1293 unsigned int options; /* creation options */
1294 time_t modif; /* last modification time */
1295 size_t namelen; /* length of key name in bytes */
1296 VARARG(name,unicode_str,namelen); /* key name */
1297 VARARG(class,unicode_str); /* class name */
1298 @REPLY
1299 obj_handle_t hkey; /* handle to the created key */
1300 int created; /* has it been newly created? */
1301 @END
1303 /* Open a registry key */
1304 @REQ(open_key)
1305 obj_handle_t parent; /* handle to the parent key */
1306 unsigned int access; /* desired access rights */
1307 VARARG(name,unicode_str); /* key name */
1308 @REPLY
1309 obj_handle_t hkey; /* handle to the open key */
1310 @END
1313 /* Delete a registry key */
1314 @REQ(delete_key)
1315 obj_handle_t hkey; /* handle to the key */
1316 @END
1319 /* Enumerate registry subkeys */
1320 @REQ(enum_key)
1321 obj_handle_t hkey; /* handle to registry key */
1322 int index; /* index of subkey (or -1 for current key) */
1323 int info_class; /* requested information class */
1324 @REPLY
1325 int subkeys; /* number of subkeys */
1326 int max_subkey; /* longest subkey name */
1327 int max_class; /* longest class name */
1328 int values; /* number of values */
1329 int max_value; /* longest value name */
1330 int max_data; /* longest value data */
1331 time_t modif; /* last modification time */
1332 size_t total; /* total length needed for full name and class */
1333 size_t namelen; /* length of key name in bytes */
1334 VARARG(name,unicode_str,namelen); /* key name */
1335 VARARG(class,unicode_str); /* class name */
1336 @END
1339 /* Set a value of a registry key */
1340 @REQ(set_key_value)
1341 obj_handle_t hkey; /* handle to registry key */
1342 int type; /* value type */
1343 size_t namelen; /* length of value name in bytes */
1344 VARARG(name,unicode_str,namelen); /* value name */
1345 VARARG(data,bytes); /* value data */
1346 @END
1349 /* Retrieve the value of a registry key */
1350 @REQ(get_key_value)
1351 obj_handle_t hkey; /* handle to registry key */
1352 VARARG(name,unicode_str); /* value name */
1353 @REPLY
1354 int type; /* value type */
1355 size_t total; /* total length needed for data */
1356 VARARG(data,bytes); /* value data */
1357 @END
1360 /* Enumerate a value of a registry key */
1361 @REQ(enum_key_value)
1362 obj_handle_t hkey; /* handle to registry key */
1363 int index; /* value index */
1364 int info_class; /* requested information class */
1365 @REPLY
1366 int type; /* value type */
1367 size_t total; /* total length needed for full name and data */
1368 size_t namelen; /* length of value name in bytes */
1369 VARARG(name,unicode_str,namelen); /* value name */
1370 VARARG(data,bytes); /* value data */
1371 @END
1374 /* Delete a value of a registry key */
1375 @REQ(delete_key_value)
1376 obj_handle_t hkey; /* handle to registry key */
1377 VARARG(name,unicode_str); /* value name */
1378 @END
1381 /* Load a registry branch from a file */
1382 @REQ(load_registry)
1383 obj_handle_t hkey; /* root key to load to */
1384 obj_handle_t file; /* file to load from */
1385 VARARG(name,unicode_str); /* subkey name */
1386 @END
1389 /* UnLoad a registry branch from a file */
1390 @REQ(unload_registry)
1391 obj_handle_t hkey; /* root key to unload to */
1392 @END
1395 /* Save a registry branch to a file */
1396 @REQ(save_registry)
1397 obj_handle_t hkey; /* key to save */
1398 obj_handle_t file; /* file to save to */
1399 @END
1402 /* Save a registry branch at server exit */
1403 @REQ(save_registry_atexit)
1404 obj_handle_t hkey; /* key to save */
1405 VARARG(file,string); /* file to save to */
1406 @END
1409 /* Set the current and saving level for the registry */
1410 @REQ(set_registry_levels)
1411 int current; /* new current level */
1412 int saving; /* new saving level */
1413 int period; /* duration between periodic saves (milliseconds) */
1414 @END
1417 @REQ(set_registry_notification)
1418 obj_handle_t hkey; /* key to watch for changes */
1419 obj_handle_t event; /* event to set */
1420 int subtree; /* should we watch the whole subtree? */
1421 unsigned int filter; /* things to watch */
1422 @END
1425 /* Create a waitable timer */
1426 @REQ(create_timer)
1427 int inherit; /* inherit flag */
1428 int manual; /* manual reset */
1429 VARARG(name,unicode_str); /* object name */
1430 @REPLY
1431 obj_handle_t handle; /* handle to the timer */
1432 @END
1435 /* Open a waitable timer */
1436 @REQ(open_timer)
1437 unsigned int access; /* wanted access rights */
1438 int inherit; /* inherit flag */
1439 VARARG(name,unicode_str); /* object name */
1440 @REPLY
1441 obj_handle_t handle; /* handle to the timer */
1442 @END
1444 /* Set a waitable timer */
1445 @REQ(set_timer)
1446 obj_handle_t handle; /* handle to the timer */
1447 abs_time_t expire; /* next expiration absolute time */
1448 int period; /* timer period in ms */
1449 void* callback; /* callback function */
1450 void* arg; /* callback argument */
1451 @REPLY
1452 int signaled; /* was the timer signaled before this call ? */
1453 @END
1455 /* Cancel a waitable timer */
1456 @REQ(cancel_timer)
1457 obj_handle_t handle; /* handle to the timer */
1458 @REPLY
1459 int signaled; /* was the timer signaled before this calltime ? */
1460 @END
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 @REPLY
1468 VARARG(context,context); /* thread context */
1469 @END
1472 /* Set the current context of a thread */
1473 @REQ(set_thread_context)
1474 obj_handle_t handle; /* thread handle */
1475 unsigned int flags; /* context flags */
1476 VARARG(context,context); /* thread context */
1477 @END
1480 /* Fetch a selector entry for a thread */
1481 @REQ(get_selector_entry)
1482 obj_handle_t handle; /* thread handle */
1483 int entry; /* LDT entry */
1484 @REPLY
1485 unsigned int base; /* selector base */
1486 unsigned int limit; /* selector limit */
1487 unsigned char flags; /* selector flags */
1488 @END
1491 /* Add an atom */
1492 @REQ(add_atom)
1493 int local; /* is atom in local process table? */
1494 VARARG(name,unicode_str); /* atom name */
1495 @REPLY
1496 atom_t atom; /* resulting atom */
1497 @END
1500 /* Delete an atom */
1501 @REQ(delete_atom)
1502 atom_t atom; /* atom handle */
1503 int local; /* is atom in local process table? */
1504 @END
1507 /* Find an atom */
1508 @REQ(find_atom)
1509 int local; /* is atom in local process table? */
1510 VARARG(name,unicode_str); /* atom name */
1511 @REPLY
1512 atom_t atom; /* atom handle */
1513 @END
1516 /* Get an atom name */
1517 @REQ(get_atom_name)
1518 atom_t atom; /* atom handle */
1519 int local; /* is atom in local process table? */
1520 @REPLY
1521 int count; /* atom lock count */
1522 VARARG(name,unicode_str); /* atom name */
1523 @END
1526 /* Init the process atom table */
1527 @REQ(init_atom_table)
1528 int entries; /* number of entries */
1529 @END
1532 /* Get the message queue of the current thread */
1533 @REQ(get_msg_queue)
1534 @REPLY
1535 obj_handle_t handle; /* handle to the queue */
1536 @END
1539 /* Set the current message queue wakeup mask */
1540 @REQ(set_queue_mask)
1541 unsigned int wake_mask; /* wakeup bits mask */
1542 unsigned int changed_mask; /* changed bits mask */
1543 int skip_wait; /* will we skip waiting if signaled? */
1544 @REPLY
1545 unsigned int wake_bits; /* current wake bits */
1546 unsigned int changed_bits; /* current changed bits */
1547 @END
1550 /* Get the current message queue status */
1551 @REQ(get_queue_status)
1552 int clear; /* should we clear the change bits? */
1553 @REPLY
1554 unsigned int wake_bits; /* wake bits */
1555 unsigned int changed_bits; /* changed bits since last time */
1556 @END
1559 /* Wait for a process to start waiting on input */
1560 @REQ(wait_input_idle)
1561 obj_handle_t handle; /* process handle */
1562 int timeout; /* timeout */
1563 @REPLY
1564 obj_handle_t event; /* handle to idle event */
1565 @END
1568 /* Send a message to a thread queue */
1569 @REQ(send_message)
1570 thread_id_t id; /* thread id */
1571 int type; /* message type (see below) */
1572 int flags; /* message flags (see below) */
1573 user_handle_t win; /* window handle */
1574 unsigned int msg; /* message code */
1575 unsigned int wparam; /* parameters */
1576 unsigned int lparam; /* parameters */
1577 int x; /* x position */
1578 int y; /* y position */
1579 unsigned int time; /* message time */
1580 unsigned int info; /* extra info */
1581 int timeout; /* timeout for reply */
1582 void* callback; /* callback address */
1583 VARARG(data,bytes); /* message data for sent messages */
1584 @END
1586 enum message_type
1588 MSG_ASCII, /* Ascii message (from SendMessageA) */
1589 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1590 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1591 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1592 MSG_CALLBACK_RESULT,/* result of a callback message */
1593 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1594 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1595 MSG_HARDWARE /* hardware message */
1597 #define SEND_MSG_ABORT_IF_HUNG 0x01
1600 /* Get a message from the current queue */
1601 @REQ(get_message)
1602 int flags; /* see below */
1603 user_handle_t get_win; /* window handle to get */
1604 unsigned int get_first; /* first message code to get */
1605 unsigned int get_last; /* last message code to get */
1606 @REPLY
1607 int type; /* message type */
1608 user_handle_t win; /* window handle */
1609 unsigned int msg; /* message code */
1610 unsigned int wparam; /* parameters (callback function for MSG_CALLBACK_RESULT) */
1611 unsigned int lparam; /* parameters (result for MSG_CALLBACK_RESULT) */
1612 int x; /* x position */
1613 int y; /* y position */
1614 unsigned int time; /* message time */
1615 unsigned int info; /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1616 size_t total; /* total size of extra data */
1617 VARARG(data,bytes); /* message data for sent messages */
1618 @END
1619 #define GET_MSG_REMOVE 1 /* remove the message */
1620 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1622 /* Reply to a sent message */
1623 @REQ(reply_message)
1624 int type; /* type of original message */
1625 unsigned int result; /* message result */
1626 int remove; /* should we remove the message? */
1627 VARARG(data,bytes); /* message data for sent messages */
1628 @END
1631 /* Retrieve the reply for the last message sent */
1632 @REQ(get_message_reply)
1633 int cancel; /* cancel message if not ready? */
1634 @REPLY
1635 unsigned int result; /* message result */
1636 VARARG(data,bytes); /* message data for sent messages */
1637 @END
1640 /* Set a window timer */
1641 @REQ(set_win_timer)
1642 user_handle_t win; /* window handle */
1643 unsigned int msg; /* message to post */
1644 unsigned int id; /* timer id */
1645 unsigned int rate; /* timer rate in ms */
1646 unsigned int lparam; /* message lparam (callback proc) */
1647 @END
1650 /* Kill a window timer */
1651 @REQ(kill_win_timer)
1652 user_handle_t win; /* window handle */
1653 unsigned int msg; /* message to post */
1654 unsigned int id; /* timer id */
1655 @END
1658 /* Open a serial port */
1659 @REQ(create_serial)
1660 unsigned int access; /* wanted access rights */
1661 int inherit; /* inherit flag */
1662 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1663 unsigned int sharing; /* sharing flags */
1664 VARARG(name,string); /* file name */
1665 @REPLY
1666 obj_handle_t handle; /* handle to the port */
1667 @END
1670 /* Retrieve info about a serial port */
1671 @REQ(get_serial_info)
1672 obj_handle_t handle; /* handle to comm port */
1673 @REPLY
1674 unsigned int readinterval;
1675 unsigned int readconst;
1676 unsigned int readmult;
1677 unsigned int writeconst;
1678 unsigned int writemult;
1679 unsigned int eventmask;
1680 unsigned int commerror;
1681 @END
1684 /* Set info about a serial port */
1685 @REQ(set_serial_info)
1686 obj_handle_t handle; /* handle to comm port */
1687 int flags; /* bitmask to set values (see below) */
1688 unsigned int readinterval;
1689 unsigned int readconst;
1690 unsigned int readmult;
1691 unsigned int writeconst;
1692 unsigned int writemult;
1693 unsigned int eventmask;
1694 unsigned int commerror;
1695 @END
1696 #define SERIALINFO_SET_TIMEOUTS 0x01
1697 #define SERIALINFO_SET_MASK 0x02
1698 #define SERIALINFO_SET_ERROR 0x04
1701 /* Create / reschedule an async I/O */
1702 @REQ(register_async)
1703 obj_handle_t handle; /* handle to comm port, socket or file */
1704 int type;
1705 void* overlapped;
1706 int count;
1707 unsigned int status;
1708 @END
1709 #define ASYNC_TYPE_NONE 0x00
1710 #define ASYNC_TYPE_READ 0x01
1711 #define ASYNC_TYPE_WRITE 0x02
1712 #define ASYNC_TYPE_WAIT 0x03
1715 /* Create a named pipe */
1716 @REQ(create_named_pipe)
1717 unsigned int openmode;
1718 unsigned int pipemode;
1719 unsigned int maxinstances;
1720 unsigned int outsize;
1721 unsigned int insize;
1722 unsigned int timeout;
1723 VARARG(name,unicode_str); /* pipe name */
1724 @REPLY
1725 obj_handle_t handle; /* handle to the pipe */
1726 @END
1729 /* Open an existing named pipe */
1730 @REQ(open_named_pipe)
1731 unsigned int access;
1732 int inherit; /* inherit flag */
1733 VARARG(name,unicode_str); /* pipe name */
1734 @REPLY
1735 obj_handle_t handle; /* handle to the pipe */
1736 @END
1739 /* Connect to a named pipe */
1740 @REQ(connect_named_pipe)
1741 obj_handle_t handle;
1742 void* overlapped;
1743 void* func;
1744 @END
1747 /* Wait for a named pipe */
1748 @REQ(wait_named_pipe)
1749 unsigned int timeout;
1750 void* overlapped;
1751 void* func;
1752 VARARG(name,unicode_str); /* pipe name */
1753 @END
1756 /* Disconnect a named pipe */
1757 @REQ(disconnect_named_pipe)
1758 obj_handle_t handle;
1759 @REPLY
1760 int fd; /* associated fd to close */
1761 @END
1764 @REQ(get_named_pipe_info)
1765 obj_handle_t handle;
1766 @REPLY
1767 unsigned int flags;
1768 unsigned int maxinstances;
1769 unsigned int outsize;
1770 unsigned int insize;
1771 @END
1774 @REQ(create_smb)
1775 int fd;
1776 unsigned int tree_id;
1777 unsigned int user_id;
1778 unsigned int file_id;
1779 unsigned int dialect;
1780 @REPLY
1781 obj_handle_t handle;
1782 @END
1785 @REQ(get_smb_info)
1786 obj_handle_t handle;
1787 unsigned int flags;
1788 unsigned int offset;
1789 @REPLY
1790 unsigned int tree_id;
1791 unsigned int user_id;
1792 unsigned int dialect;
1793 unsigned int file_id;
1794 unsigned int offset;
1795 @END
1796 #define SMBINFO_SET_OFFSET 0x01
1799 /* Create a window */
1800 @REQ(create_window)
1801 user_handle_t parent; /* parent window */
1802 user_handle_t owner; /* owner window */
1803 atom_t atom; /* class atom */
1804 @REPLY
1805 user_handle_t handle; /* created window */
1806 @END
1809 /* Link a window into the tree */
1810 @REQ(link_window)
1811 user_handle_t handle; /* handle to the window */
1812 user_handle_t parent; /* handle to the parent */
1813 user_handle_t previous; /* previous child in Z-order */
1814 @REPLY
1815 user_handle_t full_parent; /* full handle of new parent */
1816 @END
1819 /* Destroy a window */
1820 @REQ(destroy_window)
1821 user_handle_t handle; /* handle to the window */
1822 @END
1825 /* Set a window owner */
1826 @REQ(set_window_owner)
1827 user_handle_t handle; /* handle to the window */
1828 user_handle_t owner; /* new owner */
1829 @REPLY
1830 user_handle_t full_owner; /* full handle of new owner */
1831 user_handle_t prev_owner; /* full handle of previous owner */
1832 @END
1835 /* Get information from a window handle */
1836 @REQ(get_window_info)
1837 user_handle_t handle; /* handle to the window */
1838 @REPLY
1839 user_handle_t full_handle; /* full 32-bit handle */
1840 user_handle_t last_active; /* last active popup */
1841 process_id_t pid; /* process owning the window */
1842 thread_id_t tid; /* thread owning the window */
1843 atom_t atom; /* class atom */
1844 @END
1847 /* Set some information in a window */
1848 @REQ(set_window_info)
1849 user_handle_t handle; /* handle to the window */
1850 unsigned int flags; /* flags for fields to set (see below) */
1851 unsigned int style; /* window style */
1852 unsigned int ex_style; /* window extended style */
1853 unsigned int id; /* window id */
1854 void* instance; /* creator instance */
1855 void* user_data; /* user-specific data */
1856 @REPLY
1857 unsigned int old_style; /* old window style */
1858 unsigned int old_ex_style; /* old window extended style */
1859 unsigned int old_id; /* old window id */
1860 void* old_instance; /* old creator instance */
1861 void* old_user_data; /* old user-specific data */
1862 @END
1863 #define SET_WIN_STYLE 0x01
1864 #define SET_WIN_EXSTYLE 0x02
1865 #define SET_WIN_ID 0x04
1866 #define SET_WIN_INSTANCE 0x08
1867 #define SET_WIN_USERDATA 0x10
1870 /* Get a list of the window parents, up to the root of the tree */
1871 @REQ(get_window_parents)
1872 user_handle_t handle; /* handle to the window */
1873 @REPLY
1874 int count; /* total count of parents */
1875 VARARG(parents,user_handles); /* parent handles */
1876 @END
1879 /* Get a list of the window children */
1880 @REQ(get_window_children)
1881 user_handle_t parent; /* parent window */
1882 atom_t atom; /* class atom for the listed children */
1883 thread_id_t tid; /* thread owning the listed children */
1884 @REPLY
1885 int count; /* total count of children */
1886 VARARG(children,user_handles); /* children handles */
1887 @END
1890 /* Get window tree information from a window handle */
1891 @REQ(get_window_tree)
1892 user_handle_t handle; /* handle to the window */
1893 @REPLY
1894 user_handle_t parent; /* parent window */
1895 user_handle_t owner; /* owner window */
1896 user_handle_t next_sibling; /* next sibling in Z-order */
1897 user_handle_t prev_sibling; /* prev sibling in Z-order */
1898 user_handle_t first_sibling; /* first sibling in Z-order */
1899 user_handle_t last_sibling; /* last sibling in Z-order */
1900 user_handle_t first_child; /* first child */
1901 user_handle_t last_child; /* last child */
1902 @END
1904 /* Set the window and client rectangles of a window */
1905 @REQ(set_window_rectangles)
1906 user_handle_t handle; /* handle to the window */
1907 rectangle_t window; /* window rectangle */
1908 rectangle_t client; /* client rectangle */
1909 @END
1912 /* Get the window and client rectangles of a window */
1913 @REQ(get_window_rectangles)
1914 user_handle_t handle; /* handle to the window */
1915 @REPLY
1916 rectangle_t window; /* window rectangle */
1917 rectangle_t client; /* client rectangle */
1918 @END
1921 /* Get the window text */
1922 @REQ(get_window_text)
1923 user_handle_t handle; /* handle to the window */
1924 @REPLY
1925 VARARG(text,unicode_str); /* window text */
1926 @END
1929 /* Set the window text */
1930 @REQ(set_window_text)
1931 user_handle_t handle; /* handle to the window */
1932 VARARG(text,unicode_str); /* window text */
1933 @END
1936 /* Increment the window paint count */
1937 @REQ(inc_window_paint_count)
1938 user_handle_t handle; /* handle to the window */
1939 int incr; /* increment (can be negative) */
1940 @END
1943 /* Get the coordinates offset between two windows */
1944 @REQ(get_windows_offset)
1945 user_handle_t from; /* handle to the first window */
1946 user_handle_t to; /* handle to the second window */
1947 @REPLY
1948 int x; /* x coordinate offset */
1949 int y; /* y coordinate offset */
1950 @END
1953 /* Set a window property */
1954 @REQ(set_window_property)
1955 user_handle_t window; /* handle to the window */
1956 atom_t atom; /* property atom (high-word set if it was a string) */
1957 int string; /* was atom a string originally? */
1958 obj_handle_t handle; /* handle to store */
1959 @END
1962 /* Remove a window property */
1963 @REQ(remove_window_property)
1964 user_handle_t window; /* handle to the window */
1965 atom_t atom; /* property atom */
1966 @REPLY
1967 obj_handle_t handle; /* handle stored in property */
1968 @END
1971 /* Get a window property */
1972 @REQ(get_window_property)
1973 user_handle_t window; /* handle to the window */
1974 atom_t atom; /* property atom */
1975 @REPLY
1976 obj_handle_t handle; /* handle stored in property */
1977 @END
1980 /* Get the list of properties of a window */
1981 @REQ(get_window_properties)
1982 user_handle_t window; /* handle to the window */
1983 @REPLY
1984 int total; /* total number of properties */
1985 VARARG(props,properties); /* list of properties */
1986 @END
1989 /* Attach (or detach) thread inputs */
1990 @REQ(attach_thread_input)
1991 thread_id_t tid_from; /* thread to be attached */
1992 thread_id_t tid_to; /* thread to which tid_from should be attached */
1993 int attach; /* is it an attach? */
1994 @END
1997 /* Get input data for a given thread */
1998 @REQ(get_thread_input)
1999 thread_id_t tid; /* id of thread */
2000 @REPLY
2001 user_handle_t focus; /* handle to the focus window */
2002 user_handle_t capture; /* handle to the capture window */
2003 user_handle_t active; /* handle to the active window */
2004 user_handle_t foreground; /* handle to the global foreground window */
2005 user_handle_t menu_owner; /* handle to the menu owner */
2006 user_handle_t move_size; /* handle to the moving/resizing window */
2007 user_handle_t caret; /* handle to the caret window */
2008 rectangle_t rect; /* caret rectangle */
2009 @END
2011 /* Retrieve queue keyboard state for a given thread */
2012 @REQ(get_key_state)
2013 thread_id_t tid; /* id of thread */
2014 int key; /* optional key code or -1 */
2015 @REPLY
2016 unsigned char state; /* state of specified key */
2017 VARARG(keystate,bytes); /* state array for all the keys */
2018 @END
2020 /* Set queue keyboard state for a given thread */
2021 @REQ(set_key_state)
2022 thread_id_t tid; /* id of thread */
2023 VARARG(keystate,bytes); /* state array for all the keys */
2024 @END
2026 /* Set the system foreground window */
2027 @REQ(set_foreground_window)
2028 user_handle_t handle; /* handle to the foreground window */
2029 @REPLY
2030 user_handle_t previous; /* handle to the previous foreground window */
2031 int send_msg_old; /* whether we have to send a msg to the old window */
2032 int send_msg_new; /* whether we have to send a msg to the new window */
2033 @END
2035 /* Set the current thread focus window */
2036 @REQ(set_focus_window)
2037 user_handle_t handle; /* handle to the focus window */
2038 @REPLY
2039 user_handle_t previous; /* handle to the previous focus window */
2040 @END
2042 /* Set the current thread active window */
2043 @REQ(set_active_window)
2044 user_handle_t handle; /* handle to the active window */
2045 @REPLY
2046 user_handle_t previous; /* handle to the previous active window */
2047 @END
2049 /* Set the current thread capture window */
2050 @REQ(set_capture_window)
2051 user_handle_t handle; /* handle to the capture window */
2052 unsigned int flags; /* capture flags (see below) */
2053 @REPLY
2054 user_handle_t previous; /* handle to the previous capture window */
2055 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2056 @END
2057 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2058 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2061 /* Set the current thread caret window */
2062 @REQ(set_caret_window)
2063 user_handle_t handle; /* handle to the caret window */
2064 int width; /* caret width */
2065 int height; /* caret height */
2066 @REPLY
2067 user_handle_t previous; /* handle to the previous caret window */
2068 rectangle_t old_rect; /* previous caret rectangle */
2069 int old_hide; /* previous hide count */
2070 int old_state; /* previous caret state (1=on, 0=off) */
2071 @END
2074 /* Set the current thread caret information */
2075 @REQ(set_caret_info)
2076 unsigned int flags; /* caret flags (see below) */
2077 user_handle_t handle; /* handle to the caret window */
2078 int x; /* caret x position */
2079 int y; /* caret y position */
2080 int hide; /* increment for hide count (can be negative to show it) */
2081 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2082 @REPLY
2083 user_handle_t full_handle; /* handle to the current caret window */
2084 rectangle_t old_rect; /* previous caret rectangle */
2085 int old_hide; /* previous hide count */
2086 int old_state; /* previous caret state (1=on, 0=off) */
2087 @END
2088 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2089 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2090 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2093 /* Set a window hook */
2094 @REQ(set_hook)
2095 int id; /* id of the hook */
2096 thread_id_t tid; /* id of thread to set the hook into */
2097 void* proc; /* hook procedure */
2098 int unicode; /* is it a unicode hook? */
2099 VARARG(module,unicode_str); /* module name */
2100 @REPLY
2101 user_handle_t handle; /* handle to the hook */
2102 @END
2105 /* Remove a window hook */
2106 @REQ(remove_hook)
2107 user_handle_t handle; /* handle to the hook */
2108 int id; /* id of the hook if handle is 0 */
2109 void* proc; /* hook procedure if handle is 0 */
2110 @END
2113 /* Start calling a hook chain */
2114 @REQ(start_hook_chain)
2115 int id; /* id of the hook */
2116 @REPLY
2117 user_handle_t handle; /* handle to the next hook */
2118 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2119 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2120 void* proc; /* hook procedure */
2121 int unicode; /* is it a unicode hook? */
2122 VARARG(module,unicode_str); /* module name */
2123 @END
2126 /* Finished calling a hook chain */
2127 @REQ(finish_hook_chain)
2128 int id; /* id of the hook */
2129 @END
2132 /* Get the next hook to call */
2133 @REQ(get_next_hook)
2134 user_handle_t handle; /* handle to the current hook */
2135 @REPLY
2136 user_handle_t next; /* handle to the next hook */
2137 int id; /* id of the next hook */
2138 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2139 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2140 void* proc; /* next hook procedure */
2141 int prev_unicode; /* was the previous a unicode hook? */
2142 int next_unicode; /* is the next a unicode hook? */
2143 VARARG(module,unicode_str); /* module name */
2144 @END
2147 /* Set/get clipboard information */
2148 @REQ(set_clipboard_info)
2149 unsigned int flags; /* flags for fields to set (see below) */
2150 user_handle_t clipboard; /* clipboard window */
2151 user_handle_t owner; /* clipboard owner */
2152 user_handle_t viewer; /* first clipboard viewer */
2153 unsigned int seqno; /* change sequence number */
2154 @REPLY
2155 unsigned int flags; /* status flags (see below) */
2156 user_handle_t old_clipboard; /* old clipboard window */
2157 user_handle_t old_owner; /* old clipboard owner */
2158 user_handle_t old_viewer; /* old clipboard viewer */
2159 unsigned int seqno; /* current sequence number */
2160 @END
2162 #define SET_CB_OPEN 0x001
2163 #define SET_CB_OWNER 0x002
2164 #define SET_CB_VIEWER 0x004
2165 #define SET_CB_SEQNO 0x008
2166 #define SET_CB_RELOWNER 0x010
2167 #define SET_CB_CLOSE 0x020
2168 #define CB_OPEN 0x040
2169 #define CB_OWNER 0x080
2172 /* Open a security token */
2173 @REQ(open_token)
2174 obj_handle_t handle; /* handle to the thread or process */
2175 unsigned int flags; /* flags (see below) */
2176 @REPLY
2177 obj_handle_t token; /* handle to the token */
2178 @END
2179 #define OPEN_TOKEN_THREAD 1
2180 #define OPEN_TOKEN_AS_SELF 2