Fixed include statements to match server_protocol.h (spotted by Eric
[wine/wine-kai.git] / server / protocol.def
blob6b510497f8c28bfae0ee207bbc952e97e0d11732
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 <stdarg.h>
28 #include <stdlib.h>
29 #include <time.h>
31 #include <windef.h>
32 #include <winbase.h>
34 struct request_header
36 int req; /* request code */
37 size_t request_size; /* request variable part size */
38 size_t reply_size; /* reply variable part maximum size */
41 struct reply_header
43 unsigned int error; /* error result */
44 size_t reply_size; /* reply variable part size */
47 /* placeholder structure for the maximum allowed request size */
48 /* this is used to construct the generic_request union */
49 struct request_max_size
51 int pad[16]; /* the max request size is 16 ints */
54 typedef void *obj_handle_t;
55 typedef void *user_handle_t;
56 typedef unsigned short atom_t;
57 typedef unsigned int process_id_t;
58 typedef unsigned int thread_id_t;
60 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
61 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
64 /* definitions of the event data depending on the event code */
65 struct debug_event_exception
67 EXCEPTION_RECORD record; /* exception record */
68 int first; /* first chance exception? */
70 struct debug_event_create_thread
72 obj_handle_t handle; /* handle to the new thread */
73 void *teb; /* thread teb (in debugged process address space) */
74 void *start; /* thread startup routine */
76 struct debug_event_create_process
78 obj_handle_t file; /* handle to the process exe file */
79 obj_handle_t process; /* handle to the new process */
80 obj_handle_t thread; /* handle to the new thread */
81 void *base; /* base of executable image */
82 int dbg_offset; /* offset of debug info in file */
83 int dbg_size; /* size of debug info */
84 void *teb; /* thread teb (in debugged process address space) */
85 void *start; /* thread startup routine */
86 void *name; /* image name (optional) */
87 int unicode; /* is it Unicode? */
89 struct debug_event_exit
91 int exit_code; /* thread or process exit code */
93 struct debug_event_load_dll
95 obj_handle_t handle; /* file handle for the dll */
96 void *base; /* base address of the dll */
97 int dbg_offset; /* offset of debug info in file */
98 int dbg_size; /* size of debug info */
99 void *name; /* image name (optional) */
100 int unicode; /* is it Unicode? */
102 struct debug_event_unload_dll
104 void *base; /* base address of the dll */
106 struct debug_event_output_string
108 void *string; /* string to display (in debugged process address space) */
109 int unicode; /* is it Unicode? */
110 int length; /* string length */
112 struct debug_event_rip_info
114 int error; /* ??? */
115 int type; /* ??? */
117 union debug_event_data
119 struct debug_event_exception exception;
120 struct debug_event_create_thread create_thread;
121 struct debug_event_create_process create_process;
122 struct debug_event_exit exit;
123 struct debug_event_load_dll load_dll;
124 struct debug_event_unload_dll unload_dll;
125 struct debug_event_output_string output_string;
126 struct debug_event_rip_info rip_info;
129 /* debug event data */
130 typedef struct
132 int code; /* event code */
133 union debug_event_data info; /* event information */
134 } debug_event_t;
136 /* structure used in sending an fd from client to server */
137 struct send_fd
139 thread_id_t tid; /* thread id */
140 int fd; /* file descriptor on client-side */
143 /* structure sent by the server on the wait fifo */
144 struct wake_up_reply
146 void *cookie; /* magic cookie that was passed in select_request */
147 int signaled; /* wait result */
150 /* structure for process startup info */
151 typedef struct
153 size_t size; /* size of this structure */
154 size_t filename_len; /* length of filename */
155 size_t cmdline_len; /* length of cmd line */
156 size_t desktop_len; /* length of desktop name */
157 size_t title_len; /* length of title */
158 int x; /* window position */
159 int y;
160 int cx; /* window size */
161 int cy;
162 int x_chars; /* console size */
163 int y_chars;
164 int attribute; /* console attributes */
165 int cmd_show; /* main window show mode */
166 unsigned int flags; /* info flags */
167 /* char filename[...]; */
168 /* char cmdline[...]; */
169 /* char desktop[...]; */
170 /* char title[...]; */
171 } startup_info_t;
173 /* structure for absolute timeouts */
174 typedef struct
176 int sec; /* seconds since Unix epoch */
177 int usec; /* microseconds */
178 } abs_time_t;
180 /* structure returned in the list of window properties */
181 typedef struct
183 atom_t atom; /* property atom */
184 short string; /* was atom a string originally? */
185 obj_handle_t handle; /* handle stored in property */
186 } property_data_t;
188 /* structure to specify window rectangles */
189 typedef struct
191 int left;
192 int top;
193 int right;
194 int bottom;
195 } rectangle_t;
197 /* structure for console char/attribute info */
198 typedef struct
200 WCHAR ch;
201 unsigned short attr;
202 } char_info_t;
204 /****************************************************************/
205 /* Request declarations */
207 /* Create a new process from the context of the parent */
208 @REQ(new_process)
209 int inherit_all; /* inherit all handles from parent */
210 int create_flags; /* creation flags */
211 int unix_pid; /* Unix pid of new process */
212 obj_handle_t exe_file; /* file handle for main exe */
213 obj_handle_t hstdin; /* handle for stdin */
214 obj_handle_t hstdout; /* handle for stdout */
215 obj_handle_t hstderr; /* handle for stderr */
216 VARARG(info,startup_info); /* startup information */
217 @REPLY
218 obj_handle_t info; /* new process info handle */
219 @END
222 /* Retrieve information about a newly started process */
223 @REQ(get_new_process_info)
224 obj_handle_t info; /* info handle returned from new_process_request */
225 int pinherit; /* process handle inherit flag */
226 int tinherit; /* thread handle inherit flag */
227 @REPLY
228 process_id_t pid; /* process id */
229 obj_handle_t phandle; /* process handle (in the current process) */
230 thread_id_t tid; /* thread id */
231 obj_handle_t thandle; /* thread handle (in the current process) */
232 int success; /* did the process start successfully? */
233 @END
236 /* Create a new thread from the context of the parent */
237 @REQ(new_thread)
238 int suspend; /* new thread should be suspended on creation */
239 int inherit; /* inherit flag */
240 int request_fd; /* fd for request pipe */
241 @REPLY
242 thread_id_t tid; /* thread id */
243 obj_handle_t handle; /* thread handle (in the current process) */
244 @END
247 /* Signal that we are finished booting on the client side */
248 @REQ(boot_done)
249 int debug_level; /* new debug level */
250 @END
253 /* Initialize a process; called from the new process context */
254 @REQ(init_process)
255 void* ldt_copy; /* addr of LDT copy */
256 @REPLY
257 int create_flags; /* creation flags */
258 unsigned int server_start; /* server start time (GetTickCount) */
259 size_t info_size; /* total size of startup info */
260 obj_handle_t exe_file; /* file handle for main exe */
261 obj_handle_t hstdin; /* handle for stdin */
262 obj_handle_t hstdout; /* handle for stdout */
263 obj_handle_t hstderr; /* handle for stderr */
264 @END
267 /* Retrieve the new process startup info */
268 @REQ(get_startup_info)
269 @REPLY
270 VARARG(info,startup_info); /* startup information */
271 @END
274 /* Signal the end of the process initialization */
275 @REQ(init_process_done)
276 void* module; /* main module base address */
277 size_t module_size; /* main module size */
278 void* entry; /* process entry point */
279 void* name; /* ptr to ptr to name (in process addr space) */
280 obj_handle_t exe_file; /* file handle for main exe */
281 int gui; /* is it a GUI process? */
282 VARARG(filename,string); /* file name of main exe */
283 @REPLY
284 int debugged; /* being debugged? */
285 @END
288 /* Initialize a thread; called from the child after fork()/clone() */
289 @REQ(init_thread)
290 int unix_pid; /* Unix pid of new thread */
291 int unix_tid; /* Unix tid of new thread */
292 void* teb; /* TEB of new thread (in thread address space) */
293 void* entry; /* thread entry point (in thread address space) */
294 int reply_fd; /* fd for reply pipe */
295 int wait_fd; /* fd for blocking calls pipe */
296 @REPLY
297 process_id_t pid; /* process id of the new thread's process */
298 thread_id_t tid; /* thread id of the new thread */
299 int boot; /* is this the boot thread? */
300 int version; /* protocol version */
301 @END
304 /* Terminate a process */
305 @REQ(terminate_process)
306 obj_handle_t handle; /* process handle to terminate */
307 int exit_code; /* process exit code */
308 @REPLY
309 int self; /* suicide? */
310 @END
313 /* Terminate a thread */
314 @REQ(terminate_thread)
315 obj_handle_t handle; /* thread handle to terminate */
316 int exit_code; /* thread exit code */
317 @REPLY
318 int self; /* suicide? */
319 int last; /* last thread in this process? */
320 @END
323 /* Retrieve information about a process */
324 @REQ(get_process_info)
325 obj_handle_t handle; /* process handle */
326 @REPLY
327 process_id_t pid; /* server process id */
328 int debugged; /* debugged? */
329 int exit_code; /* process exit code */
330 int priority; /* priority class */
331 int process_affinity; /* process affinity mask */
332 int system_affinity; /* system affinity mask */
333 @END
336 /* Set a process informations */
337 @REQ(set_process_info)
338 obj_handle_t handle; /* process handle */
339 int mask; /* setting mask (see below) */
340 int priority; /* priority class */
341 int affinity; /* affinity mask */
342 @END
343 #define SET_PROCESS_INFO_PRIORITY 0x01
344 #define SET_PROCESS_INFO_AFFINITY 0x02
347 /* Retrieve information about a thread */
348 @REQ(get_thread_info)
349 obj_handle_t handle; /* thread handle */
350 thread_id_t tid_in; /* thread id (optional) */
351 @REPLY
352 process_id_t pid; /* server process id */
353 thread_id_t tid; /* server thread id */
354 void* teb; /* thread teb pointer */
355 int exit_code; /* thread exit code */
356 int priority; /* thread priority level */
357 int affinity; /* thread affinity mask */
358 time_t creation_time; /* thread creation time */
359 time_t exit_time; /* thread exit time */
360 @END
363 /* Set a thread informations */
364 @REQ(set_thread_info)
365 obj_handle_t handle; /* thread handle */
366 int mask; /* setting mask (see below) */
367 int priority; /* priority class */
368 int affinity; /* affinity mask */
369 @END
370 #define SET_THREAD_INFO_PRIORITY 0x01
371 #define SET_THREAD_INFO_AFFINITY 0x02
374 /* Retrieve information about a module */
375 @REQ(get_dll_info)
376 obj_handle_t handle; /* process handle */
377 void* base_address; /* base address of module */
378 @REPLY
379 size_t size; /* module size */
380 void* entry_point;
381 VARARG(filename,string); /* file name of module */
382 @END
385 /* Suspend a thread */
386 @REQ(suspend_thread)
387 obj_handle_t handle; /* thread handle */
388 @REPLY
389 int count; /* new suspend count */
390 @END
393 /* Resume a thread */
394 @REQ(resume_thread)
395 obj_handle_t handle; /* thread handle */
396 @REPLY
397 int count; /* new suspend count */
398 @END
401 /* Notify the server that a dll has been loaded */
402 @REQ(load_dll)
403 obj_handle_t handle; /* file handle */
404 void* base; /* base address */
405 size_t size; /* dll size */
406 int dbg_offset; /* debug info offset */
407 int dbg_size; /* debug info size */
408 void* name; /* ptr to ptr to name (in process addr space) */
409 VARARG(filename,string); /* file name of dll */
410 @END
413 /* Notify the server that a dll is being unloaded */
414 @REQ(unload_dll)
415 void* base; /* base address */
416 @END
419 /* Queue an APC for a thread */
420 @REQ(queue_apc)
421 obj_handle_t handle; /* thread handle */
422 int user; /* user or system apc? */
423 void* func; /* function to call */
424 void* arg1; /* params for function to call */
425 void* arg2;
426 void* arg3;
427 @END
430 /* Get next APC to call */
431 @REQ(get_apc)
432 int alertable; /* is thread alertable? */
433 @REPLY
434 void* func; /* function to call */
435 int type; /* function type */
436 void* arg1; /* function arguments */
437 void* arg2;
438 void* arg3;
439 @END
440 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
443 /* Close a handle for the current process */
444 @REQ(close_handle)
445 obj_handle_t handle; /* handle to close */
446 @REPLY
447 int fd; /* associated fd to close */
448 @END
451 /* Set a handle information */
452 @REQ(set_handle_info)
453 obj_handle_t handle; /* handle we are interested in */
454 int flags; /* new handle flags */
455 int mask; /* mask for flags to set */
456 int fd; /* file descriptor or -1 */
457 @REPLY
458 int old_flags; /* old flag value */
459 int cur_fd; /* current file descriptor */
460 @END
463 /* Duplicate a handle */
464 @REQ(dup_handle)
465 obj_handle_t src_process; /* src process handle */
466 obj_handle_t src_handle; /* src handle to duplicate */
467 obj_handle_t dst_process; /* dst process handle */
468 unsigned int access; /* wanted access rights */
469 int inherit; /* inherit flag */
470 int options; /* duplicate options (see below) */
471 @REPLY
472 obj_handle_t handle; /* duplicated handle in dst process */
473 int fd; /* associated fd to close */
474 @END
475 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
476 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
477 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
480 /* Open a handle to a process */
481 @REQ(open_process)
482 process_id_t pid; /* process id to open */
483 unsigned int access; /* wanted access rights */
484 int inherit; /* inherit flag */
485 @REPLY
486 obj_handle_t handle; /* handle to the process */
487 @END
490 /* Open a handle to a thread */
491 @REQ(open_thread)
492 thread_id_t tid; /* thread id to open */
493 unsigned int access; /* wanted access rights */
494 int inherit; /* inherit flag */
495 @REPLY
496 obj_handle_t handle; /* handle to the thread */
497 @END
500 /* Wait for handles */
501 @REQ(select)
502 int flags; /* wait flags (see below) */
503 void* cookie; /* magic cookie to return to client */
504 abs_time_t timeout; /* absolute timeout */
505 VARARG(handles,handles); /* handles to select on */
506 @END
507 #define SELECT_ALL 1
508 #define SELECT_ALERTABLE 2
509 #define SELECT_INTERRUPTIBLE 4
510 #define SELECT_TIMEOUT 8
513 /* Create an event */
514 @REQ(create_event)
515 int manual_reset; /* manual reset event */
516 int initial_state; /* initial state of the event */
517 int inherit; /* inherit flag */
518 VARARG(name,unicode_str); /* object name */
519 @REPLY
520 obj_handle_t handle; /* handle to the event */
521 @END
523 /* Event operation */
524 @REQ(event_op)
525 obj_handle_t handle; /* handle to event */
526 int op; /* event operation (see below) */
527 @END
528 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
531 /* Open an event */
532 @REQ(open_event)
533 unsigned int access; /* wanted access rights */
534 int inherit; /* inherit flag */
535 VARARG(name,unicode_str); /* object name */
536 @REPLY
537 obj_handle_t handle; /* handle to the event */
538 @END
541 /* Create a mutex */
542 @REQ(create_mutex)
543 int owned; /* initially owned? */
544 int inherit; /* inherit flag */
545 VARARG(name,unicode_str); /* object name */
546 @REPLY
547 obj_handle_t handle; /* handle to the mutex */
548 @END
551 /* Release a mutex */
552 @REQ(release_mutex)
553 obj_handle_t handle; /* handle to the mutex */
554 @END
557 /* Open a mutex */
558 @REQ(open_mutex)
559 unsigned int access; /* wanted access rights */
560 int inherit; /* inherit flag */
561 VARARG(name,unicode_str); /* object name */
562 @REPLY
563 obj_handle_t handle; /* handle to the mutex */
564 @END
567 /* Create a semaphore */
568 @REQ(create_semaphore)
569 unsigned int initial; /* initial count */
570 unsigned int max; /* maximum count */
571 int inherit; /* inherit flag */
572 VARARG(name,unicode_str); /* object name */
573 @REPLY
574 obj_handle_t handle; /* handle to the semaphore */
575 @END
578 /* Release a semaphore */
579 @REQ(release_semaphore)
580 obj_handle_t handle; /* handle to the semaphore */
581 unsigned int count; /* count to add to semaphore */
582 @REPLY
583 unsigned int prev_count; /* previous semaphore count */
584 @END
587 /* Open a semaphore */
588 @REQ(open_semaphore)
589 unsigned int access; /* wanted access rights */
590 int inherit; /* inherit flag */
591 VARARG(name,unicode_str); /* object name */
592 @REPLY
593 obj_handle_t handle; /* handle to the semaphore */
594 @END
597 /* Create a file */
598 @REQ(create_file)
599 unsigned int access; /* wanted access rights */
600 int inherit; /* inherit flag */
601 unsigned int sharing; /* sharing flags */
602 int create; /* file create action */
603 unsigned int attrs; /* file attributes for creation */
604 int drive_type; /* type of drive the file is on */
605 VARARG(filename,string); /* file name */
606 @REPLY
607 obj_handle_t handle; /* handle to the file */
608 @END
611 /* Allocate a file handle for a Unix fd */
612 @REQ(alloc_file_handle)
613 unsigned int access; /* wanted access rights */
614 int inherit; /* inherit flag */
615 int fd; /* file descriptor on the client side */
616 @REPLY
617 obj_handle_t handle; /* handle to the file */
618 @END
621 /* Get a Unix fd to access a file */
622 @REQ(get_handle_fd)
623 obj_handle_t handle; /* handle to the file */
624 unsigned int access; /* wanted access rights */
625 @REPLY
626 int fd; /* file descriptor */
627 int type; /* the type of file (see below) */
628 int flags; /* file read/write flags (see below) */
629 @END
630 enum fd_type
632 FD_TYPE_INVALID,
633 FD_TYPE_DEFAULT,
634 FD_TYPE_SOCKET,
635 FD_TYPE_SMB
637 #define FD_FLAG_OVERLAPPED 0x01
638 #define FD_FLAG_TIMEOUT 0x02
639 #define FD_FLAG_RECV_SHUTDOWN 0x04
640 #define FD_FLAG_SEND_SHUTDOWN 0x08
642 /* Set a file current position */
643 @REQ(set_file_pointer)
644 obj_handle_t handle; /* handle to the file */
645 int low; /* position low word */
646 int high; /* position high word */
647 int whence; /* whence to seek */
648 @REPLY
649 int new_low; /* new position low word */
650 int new_high; /* new position high word */
651 @END
654 /* Truncate (or extend) a file */
655 @REQ(truncate_file)
656 obj_handle_t handle; /* handle to the file */
657 @END
660 /* Set a file access and modification times */
661 @REQ(set_file_time)
662 obj_handle_t handle; /* handle to the file */
663 time_t access_time; /* last access time */
664 time_t write_time; /* last write time */
665 @END
668 /* Flush a file buffers */
669 @REQ(flush_file)
670 obj_handle_t handle; /* handle to the file */
671 @REPLY
672 obj_handle_t event; /* event set when finished */
673 @END
676 /* Get information about a file */
677 @REQ(get_file_info)
678 obj_handle_t handle; /* handle to the file */
679 @REPLY
680 int type; /* file type */
681 int attr; /* file attributes */
682 time_t access_time; /* last access time */
683 time_t write_time; /* last write time */
684 time_t change_time; /* last change time */
685 int size_high; /* file size */
686 int size_low; /* file size */
687 int alloc_high; /* size used on disk */
688 int alloc_low; /* size used on disk */
689 int links; /* number of links */
690 int index_high; /* unique index */
691 int index_low; /* unique index */
692 unsigned int serial; /* volume serial number */
693 @END
696 /* Lock a region of a file */
697 @REQ(lock_file)
698 obj_handle_t handle; /* handle to the file */
699 unsigned int offset_low; /* offset of start of lock */
700 unsigned int offset_high; /* offset of start of lock */
701 unsigned int count_low; /* count of bytes to lock */
702 unsigned int count_high; /* count of bytes to lock */
703 int shared; /* shared or exclusive lock? */
704 int wait; /* do we want to wait? */
705 @REPLY
706 obj_handle_t handle; /* handle to wait on */
707 int overlapped; /* is it an overlapped I/O handle? */
708 @END
711 /* Unlock a region of a file */
712 @REQ(unlock_file)
713 obj_handle_t handle; /* handle to the file */
714 unsigned int offset_low; /* offset of start of unlock */
715 unsigned int offset_high; /* offset of start of unlock */
716 unsigned int count_low; /* count of bytes to unlock */
717 unsigned int count_high; /* count of bytes to unlock */
718 @END
721 /* Create a socket */
722 @REQ(create_socket)
723 unsigned int access; /* wanted access rights */
724 int inherit; /* inherit flag */
725 int family; /* family, see socket manpage */
726 int type; /* type, see socket manpage */
727 int protocol; /* protocol, see socket manpage */
728 unsigned int flags; /* socket flags */
729 @REPLY
730 obj_handle_t handle; /* handle to the new socket */
731 @END
734 /* Accept a socket */
735 @REQ(accept_socket)
736 obj_handle_t lhandle; /* handle to the listening socket */
737 unsigned int access; /* wanted access rights */
738 int inherit; /* inherit flag */
739 @REPLY
740 obj_handle_t handle; /* handle to the new socket */
741 @END
744 /* Set socket event parameters */
745 @REQ(set_socket_event)
746 obj_handle_t handle; /* handle to the socket */
747 unsigned int mask; /* event mask */
748 obj_handle_t event; /* event object */
749 user_handle_t window; /* window to send the message to */
750 unsigned int msg; /* message to send */
751 @END
754 /* Get socket event parameters */
755 @REQ(get_socket_event)
756 obj_handle_t handle; /* handle to the socket */
757 int service; /* clear pending? */
758 obj_handle_t c_event; /* event to clear */
759 @REPLY
760 unsigned int mask; /* event mask */
761 unsigned int pmask; /* pending events */
762 unsigned int state; /* status bits */
763 VARARG(errors,ints); /* event errors */
764 @END
767 /* Reenable pending socket events */
768 @REQ(enable_socket_event)
769 obj_handle_t handle; /* handle to the socket */
770 unsigned int mask; /* events to re-enable */
771 unsigned int sstate; /* status bits to set */
772 unsigned int cstate; /* status bits to clear */
773 @END
775 @REQ(set_socket_deferred)
776 obj_handle_t handle; /* handle to the socket */
777 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
778 @END
780 /* Allocate a console (only used by a console renderer) */
781 @REQ(alloc_console)
782 unsigned int access; /* wanted access rights */
783 int inherit; /* inherit flag */
784 process_id_t pid; /* pid of process which shall be attached to the console */
785 @REPLY
786 obj_handle_t handle_in; /* handle to console input */
787 obj_handle_t event; /* handle to renderer events change notification */
788 @END
791 /* Free the console of the current process */
792 @REQ(free_console)
793 @END
796 #define CONSOLE_RENDERER_NONE_EVENT 0x00
797 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
798 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
799 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
800 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
801 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
802 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
803 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
804 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
805 struct console_renderer_event
807 short event;
808 union
810 struct update
812 short top;
813 short bottom;
814 } update;
815 struct resize
817 short width;
818 short height;
819 } resize;
820 struct cursor_pos
822 short x;
823 short y;
824 } cursor_pos;
825 struct cursor_geom
827 short visible;
828 short size;
829 } cursor_geom;
830 struct display
832 short left;
833 short top;
834 short width;
835 short height;
836 } display;
837 } u;
840 /* retrieve console events for the renderer */
841 @REQ(get_console_renderer_events)
842 obj_handle_t handle; /* handle to console input events */
843 @REPLY
844 VARARG(data,bytes); /* the various console_renderer_events */
845 @END
848 /* Open a handle to the process console */
849 @REQ(open_console)
850 int from; /* 0 (resp 1) input (resp output) of current process console */
851 /* otherwise console_in handle to get active screen buffer? */
852 unsigned int access; /* wanted access rights */
853 int inherit; /* inherit flag */
854 int share; /* share mask (only for output handles) */
855 @REPLY
856 obj_handle_t handle; /* handle to the console */
857 @END
860 /* Get the input queue wait event */
861 @REQ(get_console_wait_event)
862 @REPLY
863 obj_handle_t handle;
864 @END
866 /* Get a console mode (input or output) */
867 @REQ(get_console_mode)
868 obj_handle_t handle; /* handle to the console */
869 @REPLY
870 int mode; /* console mode */
871 @END
874 /* Set a console mode (input or output) */
875 @REQ(set_console_mode)
876 obj_handle_t handle; /* handle to the console */
877 int mode; /* console mode */
878 @END
881 /* Set info about a console (input only) */
882 @REQ(set_console_input_info)
883 obj_handle_t handle; /* handle to console input, or 0 for process' console */
884 int mask; /* setting mask (see below) */
885 obj_handle_t active_sb; /* active screen buffer */
886 int history_mode; /* whether we duplicate lines in history */
887 int history_size; /* number of lines in history */
888 int edition_mode; /* index to the edition mode flavors */
889 VARARG(title,unicode_str); /* console title */
890 @END
891 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
892 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
893 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
894 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
895 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
898 /* Get info about a console (input only) */
899 @REQ(get_console_input_info)
900 obj_handle_t handle; /* handle to console input, or 0 for process' console */
901 @REPLY
902 int history_mode; /* whether we duplicate lines in history */
903 int history_size; /* number of lines in history */
904 int history_index; /* number of used lines in history */
905 int edition_mode; /* index to the edition mode flavors */
906 VARARG(title,unicode_str); /* console title */
907 @END
910 /* appends a string to console's history */
911 @REQ(append_console_input_history)
912 obj_handle_t handle; /* handle to console input, or 0 for process' console */
913 VARARG(line,unicode_str); /* line to add */
914 @END
917 /* appends a string to console's history */
918 @REQ(get_console_input_history)
919 obj_handle_t handle; /* handle to console input, or 0 for process' console */
920 int index; /* index to get line from */
921 @REPLY
922 int total; /* total length of line in Unicode chars */
923 VARARG(line,unicode_str); /* line to add */
924 @END
927 /* creates a new screen buffer on process' console */
928 @REQ(create_console_output)
929 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
930 int access; /* wanted access rights */
931 int share; /* sharing credentials */
932 int inherit; /* inherit flag */
933 @REPLY
934 obj_handle_t handle_out; /* handle to the screen buffer */
935 @END
938 /* Set info about a console (output only) */
939 @REQ(set_console_output_info)
940 obj_handle_t handle; /* handle to the console */
941 int mask; /* setting mask (see below) */
942 short int cursor_size; /* size of cursor (percentage filled) */
943 short int cursor_visible;/* cursor visibility flag */
944 short int cursor_x; /* position of cursor (x, y) */
945 short int cursor_y;
946 short int width; /* width of the screen buffer */
947 short int height; /* height of the screen buffer */
948 short int attr; /* default attribute */
949 short int win_left; /* window actually displayed by renderer */
950 short int win_top; /* the rect area is expressed withing the */
951 short int win_right; /* boundaries of the screen buffer */
952 short int win_bottom;
953 short int max_width; /* maximum size (width x height) for the window */
954 short int max_height;
955 @END
956 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
957 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
958 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
959 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
960 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
961 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
964 /* Get info about a console (output only) */
965 @REQ(get_console_output_info)
966 obj_handle_t handle; /* handle to the console */
967 @REPLY
968 short int cursor_size; /* size of cursor (percentage filled) */
969 short int cursor_visible;/* cursor visibility flag */
970 short int cursor_x; /* position of cursor (x, y) */
971 short int cursor_y;
972 short int width; /* width of the screen buffer */
973 short int height; /* height of the screen buffer */
974 short int attr; /* default attribute */
975 short int win_left; /* window actually displayed by renderer */
976 short int win_top; /* the rect area is expressed withing the */
977 short int win_right; /* boundaries of the screen buffer */
978 short int win_bottom;
979 short int max_width; /* maximum size (width x height) for the window */
980 short int max_height;
981 @END
983 /* Add input records to a console input queue */
984 @REQ(write_console_input)
985 obj_handle_t handle; /* handle to the console input */
986 VARARG(rec,input_records); /* input records */
987 @REPLY
988 int written; /* number of records written */
989 @END
992 /* Fetch input records from a console input queue */
993 @REQ(read_console_input)
994 obj_handle_t handle; /* handle to the console input */
995 int flush; /* flush the retrieved records from the queue? */
996 @REPLY
997 int read; /* number of records read */
998 VARARG(rec,input_records); /* input records */
999 @END
1002 /* write data (chars and/or attributes) in a screen buffer */
1003 @REQ(write_console_output)
1004 obj_handle_t handle; /* handle to the console output */
1005 int x; /* position where to start writing */
1006 int y;
1007 int mode; /* char info (see below) */
1008 int wrap; /* wrap around at end of line? */
1009 VARARG(data,bytes); /* info to write */
1010 @REPLY
1011 int written; /* number of char infos actually written */
1012 int width; /* width of screen buffer */
1013 int height; /* height of screen buffer */
1014 @END
1015 enum char_info_mode
1017 CHAR_INFO_MODE_TEXT, /* characters only */
1018 CHAR_INFO_MODE_ATTR, /* attributes only */
1019 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1020 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1024 /* fill a screen buffer with constant data (chars and/or attributes) */
1025 @REQ(fill_console_output)
1026 obj_handle_t handle; /* handle to the console output */
1027 int x; /* position where to start writing */
1028 int y;
1029 int mode; /* char info mode */
1030 int count; /* number to write */
1031 int wrap; /* wrap around at end of line? */
1032 char_info_t data; /* data to write */
1033 @REPLY
1034 int written; /* number of char infos actually written */
1035 @END
1038 /* read data (chars and/or attributes) from a screen buffer */
1039 @REQ(read_console_output)
1040 obj_handle_t handle; /* handle to the console output */
1041 int x; /* position (x,y) where to start reading */
1042 int y;
1043 int mode; /* char info mode */
1044 int wrap; /* wrap around at end of line? */
1045 @REPLY
1046 int width; /* width of screen buffer */
1047 int height; /* height of screen buffer */
1048 VARARG(data,bytes);
1049 @END
1052 /* move a rect (of data) in screen buffer content */
1053 @REQ(move_console_output)
1054 obj_handle_t handle; /* handle to the console output */
1055 short int x_src; /* position (x, y) of rect to start moving from */
1056 short int y_src;
1057 short int x_dst; /* position (x, y) of rect to move to */
1058 short int y_dst;
1059 short int w; /* size of the rect (width, height) to move */
1060 short int h;
1061 @END
1064 /* Sends a signal to a process group */
1065 @REQ(send_console_signal)
1066 int signal; /* the signal to send */
1067 process_id_t group_id; /* the group to send the signal to */
1068 @END
1071 /* Create a change notification */
1072 @REQ(create_change_notification)
1073 obj_handle_t handle; /* handle to the directory */
1074 int subtree; /* watch all the subtree */
1075 unsigned int filter; /* notification filter */
1076 @REPLY
1077 obj_handle_t handle; /* handle to the change notification */
1078 @END
1081 /* Move to the next change notification */
1082 @REQ(next_change_notification)
1083 obj_handle_t handle; /* handle to the change notification */
1084 @END
1086 /* Create a file mapping */
1087 @REQ(create_mapping)
1088 int size_high; /* mapping size */
1089 int size_low; /* mapping size */
1090 int protect; /* protection flags (see below) */
1091 unsigned int access; /* wanted access rights */
1092 int inherit; /* inherit flag */
1093 obj_handle_t file_handle; /* file handle */
1094 VARARG(name,unicode_str); /* object name */
1095 @REPLY
1096 obj_handle_t handle; /* handle to the mapping */
1097 @END
1098 /* protection flags */
1099 #define VPROT_READ 0x01
1100 #define VPROT_WRITE 0x02
1101 #define VPROT_EXEC 0x04
1102 #define VPROT_WRITECOPY 0x08
1103 #define VPROT_GUARD 0x10
1104 #define VPROT_NOCACHE 0x20
1105 #define VPROT_COMMITTED 0x40
1106 #define VPROT_IMAGE 0x80
1109 /* Open a mapping */
1110 @REQ(open_mapping)
1111 unsigned int access; /* wanted access rights */
1112 int inherit; /* inherit flag */
1113 VARARG(name,unicode_str); /* object name */
1114 @REPLY
1115 obj_handle_t handle; /* handle to the mapping */
1116 @END
1119 /* Get information about a file mapping */
1120 @REQ(get_mapping_info)
1121 obj_handle_t handle; /* handle to the mapping */
1122 @REPLY
1123 int size_high; /* mapping size */
1124 int size_low; /* mapping size */
1125 int protect; /* protection flags */
1126 int header_size; /* header size (for VPROT_IMAGE mapping) */
1127 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1128 obj_handle_t shared_file; /* shared mapping file handle */
1129 int shared_size; /* shared mapping size */
1130 int drive_type; /* type of drive the file is on */
1131 @END
1134 /* Create a device */
1135 @REQ(create_device)
1136 unsigned int access; /* wanted access rights */
1137 int inherit; /* inherit flag */
1138 int id; /* client private id */
1139 @REPLY
1140 obj_handle_t handle; /* handle to the device */
1141 @END
1144 /* Retrieve the client private id for a device */
1145 @REQ(get_device_id)
1146 obj_handle_t handle; /* handle to the device */
1147 @REPLY
1148 int id; /* client private id */
1149 @END
1152 #define SNAP_HEAPLIST 0x00000001
1153 #define SNAP_PROCESS 0x00000002
1154 #define SNAP_THREAD 0x00000004
1155 #define SNAP_MODULE 0x00000008
1156 /* Create a snapshot */
1157 @REQ(create_snapshot)
1158 int inherit; /* inherit flag */
1159 int flags; /* snapshot flags (SNAP_*) */
1160 process_id_t pid; /* process id */
1161 @REPLY
1162 obj_handle_t handle; /* handle to the snapshot */
1163 @END
1166 /* Get the next process from a snapshot */
1167 @REQ(next_process)
1168 obj_handle_t handle; /* handle to the snapshot */
1169 int reset; /* reset snapshot position? */
1170 @REPLY
1171 int count; /* process usage count */
1172 process_id_t pid; /* process id */
1173 process_id_t ppid; /* parent process id */
1174 void* heap; /* heap base */
1175 void* module; /* main module */
1176 int threads; /* number of threads */
1177 int priority; /* process priority */
1178 VARARG(filename,string); /* file name of main exe */
1179 @END
1182 /* Get the next thread from a snapshot */
1183 @REQ(next_thread)
1184 obj_handle_t handle; /* handle to the snapshot */
1185 int reset; /* reset snapshot position? */
1186 @REPLY
1187 int count; /* thread usage count */
1188 process_id_t pid; /* process id */
1189 thread_id_t tid; /* thread id */
1190 int base_pri; /* base priority */
1191 int delta_pri; /* delta priority */
1192 @END
1195 /* Get the next module from a snapshot */
1196 @REQ(next_module)
1197 obj_handle_t handle; /* handle to the snapshot */
1198 int reset; /* reset snapshot position? */
1199 @REPLY
1200 process_id_t pid; /* process id */
1201 void* base; /* module base address */
1202 size_t size; /* module size */
1203 VARARG(filename,string); /* file name of module */
1204 @END
1207 /* Wait for a debug event */
1208 @REQ(wait_debug_event)
1209 int get_handle; /* should we alloc a handle for waiting? */
1210 @REPLY
1211 process_id_t pid; /* process id */
1212 thread_id_t tid; /* thread id */
1213 obj_handle_t wait; /* wait handle if no event ready */
1214 VARARG(event,debug_event); /* debug event data */
1215 @END
1218 /* Queue an exception event */
1219 @REQ(queue_exception_event)
1220 int first; /* first chance exception? */
1221 VARARG(record,exc_event); /* thread context followed by exception record */
1222 @REPLY
1223 obj_handle_t handle; /* handle to the queued event */
1224 @END
1227 /* Retrieve the status of an exception event */
1228 @REQ(get_exception_status)
1229 obj_handle_t handle; /* handle to the queued event */
1230 @REPLY
1231 int status; /* event continuation status */
1232 VARARG(context,context); /* modified thread context */
1233 @END
1236 /* Send an output string to the debugger */
1237 @REQ(output_debug_string)
1238 void* string; /* string to display (in debugged process address space) */
1239 int unicode; /* is it Unicode? */
1240 int length; /* string length */
1241 @END
1244 /* Continue a debug event */
1245 @REQ(continue_debug_event)
1246 process_id_t pid; /* process id to continue */
1247 thread_id_t tid; /* thread id to continue */
1248 int status; /* continuation status */
1249 @END
1252 /* Start/stop debugging an existing process */
1253 @REQ(debug_process)
1254 process_id_t pid; /* id of the process to debug */
1255 int attach; /* 1=attaching / 0=detaching from the process */
1256 @END
1259 /* Simulate a breakpoint in a process */
1260 @REQ(debug_break)
1261 obj_handle_t handle; /* process handle */
1262 @REPLY
1263 int self; /* was it the caller itself? */
1264 @END
1267 /* Set debugger kill on exit flag */
1268 @REQ(set_debugger_kill_on_exit)
1269 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1270 @END
1273 /* Read data from a process address space */
1274 @REQ(read_process_memory)
1275 obj_handle_t handle; /* process handle */
1276 void* addr; /* addr to read from */
1277 @REPLY
1278 VARARG(data,bytes); /* result data */
1279 @END
1282 /* Write data to a process address space */
1283 @REQ(write_process_memory)
1284 obj_handle_t handle; /* process handle */
1285 void* addr; /* addr to write to (must be int-aligned) */
1286 unsigned int first_mask; /* mask for first word */
1287 unsigned int last_mask; /* mask for last word */
1288 VARARG(data,bytes); /* data to write */
1289 @END
1292 /* Create a registry key */
1293 @REQ(create_key)
1294 obj_handle_t parent; /* handle to the parent key */
1295 unsigned int access; /* desired access rights */
1296 unsigned int options; /* creation options */
1297 time_t modif; /* last modification time */
1298 size_t namelen; /* length of key name in bytes */
1299 VARARG(name,unicode_str,namelen); /* key name */
1300 VARARG(class,unicode_str); /* class name */
1301 @REPLY
1302 obj_handle_t hkey; /* handle to the created key */
1303 int created; /* has it been newly created? */
1304 @END
1306 /* Open a registry key */
1307 @REQ(open_key)
1308 obj_handle_t parent; /* handle to the parent key */
1309 unsigned int access; /* desired access rights */
1310 VARARG(name,unicode_str); /* key name */
1311 @REPLY
1312 obj_handle_t hkey; /* handle to the open key */
1313 @END
1316 /* Delete a registry key */
1317 @REQ(delete_key)
1318 obj_handle_t hkey; /* handle to the key */
1319 @END
1322 /* Enumerate registry subkeys */
1323 @REQ(enum_key)
1324 obj_handle_t hkey; /* handle to registry key */
1325 int index; /* index of subkey (or -1 for current key) */
1326 int info_class; /* requested information class */
1327 @REPLY
1328 int subkeys; /* number of subkeys */
1329 int max_subkey; /* longest subkey name */
1330 int max_class; /* longest class name */
1331 int values; /* number of values */
1332 int max_value; /* longest value name */
1333 int max_data; /* longest value data */
1334 time_t modif; /* last modification time */
1335 size_t total; /* total length needed for full name and class */
1336 size_t namelen; /* length of key name in bytes */
1337 VARARG(name,unicode_str,namelen); /* key name */
1338 VARARG(class,unicode_str); /* class name */
1339 @END
1342 /* Set a value of a registry key */
1343 @REQ(set_key_value)
1344 obj_handle_t hkey; /* handle to registry key */
1345 int type; /* value type */
1346 size_t namelen; /* length of value name in bytes */
1347 VARARG(name,unicode_str,namelen); /* value name */
1348 VARARG(data,bytes); /* value data */
1349 @END
1352 /* Retrieve the value of a registry key */
1353 @REQ(get_key_value)
1354 obj_handle_t hkey; /* handle to registry key */
1355 VARARG(name,unicode_str); /* value name */
1356 @REPLY
1357 int type; /* value type */
1358 size_t total; /* total length needed for data */
1359 VARARG(data,bytes); /* value data */
1360 @END
1363 /* Enumerate a value of a registry key */
1364 @REQ(enum_key_value)
1365 obj_handle_t hkey; /* handle to registry key */
1366 int index; /* value index */
1367 int info_class; /* requested information class */
1368 @REPLY
1369 int type; /* value type */
1370 size_t total; /* total length needed for full name and data */
1371 size_t namelen; /* length of value name in bytes */
1372 VARARG(name,unicode_str,namelen); /* value name */
1373 VARARG(data,bytes); /* value data */
1374 @END
1377 /* Delete a value of a registry key */
1378 @REQ(delete_key_value)
1379 obj_handle_t hkey; /* handle to registry key */
1380 VARARG(name,unicode_str); /* value name */
1381 @END
1384 /* Load a registry branch from a file */
1385 @REQ(load_registry)
1386 obj_handle_t hkey; /* root key to load to */
1387 obj_handle_t file; /* file to load from */
1388 VARARG(name,unicode_str); /* subkey name */
1389 @END
1392 /* UnLoad a registry branch from a file */
1393 @REQ(unload_registry)
1394 obj_handle_t hkey; /* root key to unload to */
1395 @END
1398 /* Save a registry branch to a file */
1399 @REQ(save_registry)
1400 obj_handle_t hkey; /* key to save */
1401 obj_handle_t file; /* file to save to */
1402 @END
1405 /* Save a registry branch at server exit */
1406 @REQ(save_registry_atexit)
1407 obj_handle_t hkey; /* key to save */
1408 VARARG(file,string); /* file to save to */
1409 @END
1412 /* Set the current and saving level for the registry */
1413 @REQ(set_registry_levels)
1414 int current; /* new current level */
1415 int saving; /* new saving level */
1416 int period; /* duration between periodic saves (milliseconds) */
1417 @END
1420 @REQ(set_registry_notification)
1421 obj_handle_t hkey; /* key to watch for changes */
1422 obj_handle_t event; /* event to set */
1423 int subtree; /* should we watch the whole subtree? */
1424 unsigned int filter; /* things to watch */
1425 @END
1428 /* Create a waitable timer */
1429 @REQ(create_timer)
1430 int inherit; /* inherit flag */
1431 int manual; /* manual reset */
1432 VARARG(name,unicode_str); /* object name */
1433 @REPLY
1434 obj_handle_t handle; /* handle to the timer */
1435 @END
1438 /* Open a waitable timer */
1439 @REQ(open_timer)
1440 unsigned int access; /* wanted access rights */
1441 int inherit; /* inherit flag */
1442 VARARG(name,unicode_str); /* object name */
1443 @REPLY
1444 obj_handle_t handle; /* handle to the timer */
1445 @END
1447 /* Set a waitable timer */
1448 @REQ(set_timer)
1449 obj_handle_t handle; /* handle to the timer */
1450 abs_time_t expire; /* next expiration absolute time */
1451 int period; /* timer period in ms */
1452 void* callback; /* callback function */
1453 void* arg; /* callback argument */
1454 @REPLY
1455 int signaled; /* was the timer signaled before this call ? */
1456 @END
1458 /* Cancel a waitable timer */
1459 @REQ(cancel_timer)
1460 obj_handle_t handle; /* handle to the timer */
1461 @REPLY
1462 int signaled; /* was the timer signaled before this calltime ? */
1463 @END
1466 /* Retrieve the current context of a thread */
1467 @REQ(get_thread_context)
1468 obj_handle_t handle; /* thread handle */
1469 unsigned int flags; /* context flags */
1470 @REPLY
1471 VARARG(context,context); /* thread context */
1472 @END
1475 /* Set the current context of a thread */
1476 @REQ(set_thread_context)
1477 obj_handle_t handle; /* thread handle */
1478 unsigned int flags; /* context flags */
1479 VARARG(context,context); /* thread context */
1480 @END
1483 /* Fetch a selector entry for a thread */
1484 @REQ(get_selector_entry)
1485 obj_handle_t handle; /* thread handle */
1486 int entry; /* LDT entry */
1487 @REPLY
1488 unsigned int base; /* selector base */
1489 unsigned int limit; /* selector limit */
1490 unsigned char flags; /* selector flags */
1491 @END
1494 /* Add an atom */
1495 @REQ(add_atom)
1496 int local; /* is atom in local process table? */
1497 VARARG(name,unicode_str); /* atom name */
1498 @REPLY
1499 atom_t atom; /* resulting atom */
1500 @END
1503 /* Delete an atom */
1504 @REQ(delete_atom)
1505 atom_t atom; /* atom handle */
1506 int local; /* is atom in local process table? */
1507 @END
1510 /* Find an atom */
1511 @REQ(find_atom)
1512 int local; /* is atom in local process table? */
1513 VARARG(name,unicode_str); /* atom name */
1514 @REPLY
1515 atom_t atom; /* atom handle */
1516 @END
1519 /* Get an atom name */
1520 @REQ(get_atom_name)
1521 atom_t atom; /* atom handle */
1522 int local; /* is atom in local process table? */
1523 @REPLY
1524 int count; /* atom lock count */
1525 VARARG(name,unicode_str); /* atom name */
1526 @END
1529 /* Init the process atom table */
1530 @REQ(init_atom_table)
1531 int entries; /* number of entries */
1532 @END
1535 /* Get the message queue of the current thread */
1536 @REQ(get_msg_queue)
1537 @REPLY
1538 obj_handle_t handle; /* handle to the queue */
1539 @END
1542 /* Set the current message queue wakeup mask */
1543 @REQ(set_queue_mask)
1544 unsigned int wake_mask; /* wakeup bits mask */
1545 unsigned int changed_mask; /* changed bits mask */
1546 int skip_wait; /* will we skip waiting if signaled? */
1547 @REPLY
1548 unsigned int wake_bits; /* current wake bits */
1549 unsigned int changed_bits; /* current changed bits */
1550 @END
1553 /* Get the current message queue status */
1554 @REQ(get_queue_status)
1555 int clear; /* should we clear the change bits? */
1556 @REPLY
1557 unsigned int wake_bits; /* wake bits */
1558 unsigned int changed_bits; /* changed bits since last time */
1559 @END
1562 /* Wait for a process to start waiting on input */
1563 @REQ(wait_input_idle)
1564 obj_handle_t handle; /* process handle */
1565 int timeout; /* timeout */
1566 @REPLY
1567 obj_handle_t event; /* handle to idle event */
1568 @END
1571 /* Send a message to a thread queue */
1572 @REQ(send_message)
1573 thread_id_t id; /* thread id */
1574 int type; /* message type (see below) */
1575 int flags; /* message flags (see below) */
1576 user_handle_t win; /* window handle */
1577 unsigned int msg; /* message code */
1578 unsigned int wparam; /* parameters */
1579 unsigned int lparam; /* parameters */
1580 int x; /* x position */
1581 int y; /* y position */
1582 unsigned int time; /* message time */
1583 unsigned int info; /* extra info */
1584 int timeout; /* timeout for reply */
1585 void* callback; /* callback address */
1586 VARARG(data,bytes); /* message data for sent messages */
1587 @END
1589 enum message_type
1591 MSG_ASCII, /* Ascii message (from SendMessageA) */
1592 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1593 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1594 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1595 MSG_CALLBACK_RESULT,/* result of a callback message */
1596 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1597 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1598 MSG_HARDWARE /* hardware message */
1600 #define SEND_MSG_ABORT_IF_HUNG 0x01
1603 /* Get a message from the current queue */
1604 @REQ(get_message)
1605 int flags; /* see below */
1606 user_handle_t get_win; /* window handle to get */
1607 unsigned int get_first; /* first message code to get */
1608 unsigned int get_last; /* last message code to get */
1609 @REPLY
1610 int type; /* message type */
1611 user_handle_t win; /* window handle */
1612 unsigned int msg; /* message code */
1613 unsigned int wparam; /* parameters (callback function for MSG_CALLBACK_RESULT) */
1614 unsigned int lparam; /* parameters (result for MSG_CALLBACK_RESULT) */
1615 int x; /* x position */
1616 int y; /* y position */
1617 unsigned int time; /* message time */
1618 unsigned int info; /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1619 size_t total; /* total size of extra data */
1620 VARARG(data,bytes); /* message data for sent messages */
1621 @END
1622 #define GET_MSG_REMOVE 1 /* remove the message */
1623 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1625 /* Reply to a sent message */
1626 @REQ(reply_message)
1627 int type; /* type of original message */
1628 unsigned int result; /* message result */
1629 int remove; /* should we remove the message? */
1630 VARARG(data,bytes); /* message data for sent messages */
1631 @END
1634 /* Retrieve the reply for the last message sent */
1635 @REQ(get_message_reply)
1636 int cancel; /* cancel message if not ready? */
1637 @REPLY
1638 unsigned int result; /* message result */
1639 VARARG(data,bytes); /* message data for sent messages */
1640 @END
1643 /* Set a window timer */
1644 @REQ(set_win_timer)
1645 user_handle_t win; /* window handle */
1646 unsigned int msg; /* message to post */
1647 unsigned int id; /* timer id */
1648 unsigned int rate; /* timer rate in ms */
1649 unsigned int lparam; /* message lparam (callback proc) */
1650 @END
1653 /* Kill a window timer */
1654 @REQ(kill_win_timer)
1655 user_handle_t win; /* window handle */
1656 unsigned int msg; /* message to post */
1657 unsigned int id; /* timer id */
1658 @END
1661 /* Open a serial port */
1662 @REQ(create_serial)
1663 unsigned int access; /* wanted access rights */
1664 int inherit; /* inherit flag */
1665 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1666 unsigned int sharing; /* sharing flags */
1667 VARARG(name,string); /* file name */
1668 @REPLY
1669 obj_handle_t handle; /* handle to the port */
1670 @END
1673 /* Retrieve info about a serial port */
1674 @REQ(get_serial_info)
1675 obj_handle_t handle; /* handle to comm port */
1676 @REPLY
1677 unsigned int readinterval;
1678 unsigned int readconst;
1679 unsigned int readmult;
1680 unsigned int writeconst;
1681 unsigned int writemult;
1682 unsigned int eventmask;
1683 unsigned int commerror;
1684 @END
1687 /* Set info about a serial port */
1688 @REQ(set_serial_info)
1689 obj_handle_t handle; /* handle to comm port */
1690 int flags; /* bitmask to set values (see below) */
1691 unsigned int readinterval;
1692 unsigned int readconst;
1693 unsigned int readmult;
1694 unsigned int writeconst;
1695 unsigned int writemult;
1696 unsigned int eventmask;
1697 unsigned int commerror;
1698 @END
1699 #define SERIALINFO_SET_TIMEOUTS 0x01
1700 #define SERIALINFO_SET_MASK 0x02
1701 #define SERIALINFO_SET_ERROR 0x04
1704 /* Create / reschedule an async I/O */
1705 @REQ(register_async)
1706 obj_handle_t handle; /* handle to comm port, socket or file */
1707 int type;
1708 void* overlapped;
1709 int count;
1710 unsigned int status;
1711 @END
1712 #define ASYNC_TYPE_NONE 0x00
1713 #define ASYNC_TYPE_READ 0x01
1714 #define ASYNC_TYPE_WRITE 0x02
1715 #define ASYNC_TYPE_WAIT 0x03
1718 /* Create a named pipe */
1719 @REQ(create_named_pipe)
1720 unsigned int openmode;
1721 unsigned int pipemode;
1722 unsigned int maxinstances;
1723 unsigned int outsize;
1724 unsigned int insize;
1725 unsigned int timeout;
1726 VARARG(name,unicode_str); /* pipe name */
1727 @REPLY
1728 obj_handle_t handle; /* handle to the pipe */
1729 @END
1732 /* Open an existing named pipe */
1733 @REQ(open_named_pipe)
1734 unsigned int access;
1735 int inherit; /* inherit flag */
1736 VARARG(name,unicode_str); /* pipe name */
1737 @REPLY
1738 obj_handle_t handle; /* handle to the pipe */
1739 @END
1742 /* Connect to a named pipe */
1743 @REQ(connect_named_pipe)
1744 obj_handle_t handle;
1745 void* overlapped;
1746 void* func;
1747 @END
1750 /* Wait for a named pipe */
1751 @REQ(wait_named_pipe)
1752 unsigned int timeout;
1753 void* overlapped;
1754 void* func;
1755 VARARG(name,unicode_str); /* pipe name */
1756 @END
1759 /* Disconnect a named pipe */
1760 @REQ(disconnect_named_pipe)
1761 obj_handle_t handle;
1762 @REPLY
1763 int fd; /* associated fd to close */
1764 @END
1767 @REQ(get_named_pipe_info)
1768 obj_handle_t handle;
1769 @REPLY
1770 unsigned int flags;
1771 unsigned int maxinstances;
1772 unsigned int outsize;
1773 unsigned int insize;
1774 @END
1777 @REQ(create_smb)
1778 int fd;
1779 unsigned int tree_id;
1780 unsigned int user_id;
1781 unsigned int file_id;
1782 unsigned int dialect;
1783 @REPLY
1784 obj_handle_t handle;
1785 @END
1788 @REQ(get_smb_info)
1789 obj_handle_t handle;
1790 unsigned int flags;
1791 unsigned int offset;
1792 @REPLY
1793 unsigned int tree_id;
1794 unsigned int user_id;
1795 unsigned int dialect;
1796 unsigned int file_id;
1797 unsigned int offset;
1798 @END
1799 #define SMBINFO_SET_OFFSET 0x01
1802 /* Create a window */
1803 @REQ(create_window)
1804 user_handle_t parent; /* parent window */
1805 user_handle_t owner; /* owner window */
1806 atom_t atom; /* class atom */
1807 @REPLY
1808 user_handle_t handle; /* created window */
1809 @END
1812 /* Link a window into the tree */
1813 @REQ(link_window)
1814 user_handle_t handle; /* handle to the window */
1815 user_handle_t parent; /* handle to the parent */
1816 user_handle_t previous; /* previous child in Z-order */
1817 @REPLY
1818 user_handle_t full_parent; /* full handle of new parent */
1819 @END
1822 /* Destroy a window */
1823 @REQ(destroy_window)
1824 user_handle_t handle; /* handle to the window */
1825 @END
1828 /* Set a window owner */
1829 @REQ(set_window_owner)
1830 user_handle_t handle; /* handle to the window */
1831 user_handle_t owner; /* new owner */
1832 @REPLY
1833 user_handle_t full_owner; /* full handle of new owner */
1834 user_handle_t prev_owner; /* full handle of previous owner */
1835 @END
1838 /* Get information from a window handle */
1839 @REQ(get_window_info)
1840 user_handle_t handle; /* handle to the window */
1841 @REPLY
1842 user_handle_t full_handle; /* full 32-bit handle */
1843 user_handle_t last_active; /* last active popup */
1844 process_id_t pid; /* process owning the window */
1845 thread_id_t tid; /* thread owning the window */
1846 atom_t atom; /* class atom */
1847 @END
1850 /* Set some information in a window */
1851 @REQ(set_window_info)
1852 user_handle_t handle; /* handle to the window */
1853 unsigned int flags; /* flags for fields to set (see below) */
1854 unsigned int style; /* window style */
1855 unsigned int ex_style; /* window extended style */
1856 unsigned int id; /* window id */
1857 void* instance; /* creator instance */
1858 void* user_data; /* user-specific data */
1859 @REPLY
1860 unsigned int old_style; /* old window style */
1861 unsigned int old_ex_style; /* old window extended style */
1862 unsigned int old_id; /* old window id */
1863 void* old_instance; /* old creator instance */
1864 void* old_user_data; /* old user-specific data */
1865 @END
1866 #define SET_WIN_STYLE 0x01
1867 #define SET_WIN_EXSTYLE 0x02
1868 #define SET_WIN_ID 0x04
1869 #define SET_WIN_INSTANCE 0x08
1870 #define SET_WIN_USERDATA 0x10
1873 /* Get a list of the window parents, up to the root of the tree */
1874 @REQ(get_window_parents)
1875 user_handle_t handle; /* handle to the window */
1876 @REPLY
1877 int count; /* total count of parents */
1878 VARARG(parents,user_handles); /* parent handles */
1879 @END
1882 /* Get a list of the window children */
1883 @REQ(get_window_children)
1884 user_handle_t parent; /* parent window */
1885 atom_t atom; /* class atom for the listed children */
1886 thread_id_t tid; /* thread owning the listed children */
1887 @REPLY
1888 int count; /* total count of children */
1889 VARARG(children,user_handles); /* children handles */
1890 @END
1893 /* Get window tree information from a window handle */
1894 @REQ(get_window_tree)
1895 user_handle_t handle; /* handle to the window */
1896 @REPLY
1897 user_handle_t parent; /* parent window */
1898 user_handle_t owner; /* owner window */
1899 user_handle_t next_sibling; /* next sibling in Z-order */
1900 user_handle_t prev_sibling; /* prev sibling in Z-order */
1901 user_handle_t first_sibling; /* first sibling in Z-order */
1902 user_handle_t last_sibling; /* last sibling in Z-order */
1903 user_handle_t first_child; /* first child */
1904 user_handle_t last_child; /* last child */
1905 @END
1907 /* Set the window and client rectangles of a window */
1908 @REQ(set_window_rectangles)
1909 user_handle_t handle; /* handle to the window */
1910 rectangle_t window; /* window rectangle */
1911 rectangle_t client; /* client rectangle */
1912 @END
1915 /* Get the window and client rectangles of a window */
1916 @REQ(get_window_rectangles)
1917 user_handle_t handle; /* handle to the window */
1918 @REPLY
1919 rectangle_t window; /* window rectangle */
1920 rectangle_t client; /* client rectangle */
1921 @END
1924 /* Get the window text */
1925 @REQ(get_window_text)
1926 user_handle_t handle; /* handle to the window */
1927 @REPLY
1928 VARARG(text,unicode_str); /* window text */
1929 @END
1932 /* Set the window text */
1933 @REQ(set_window_text)
1934 user_handle_t handle; /* handle to the window */
1935 VARARG(text,unicode_str); /* window text */
1936 @END
1939 /* Increment the window paint count */
1940 @REQ(inc_window_paint_count)
1941 user_handle_t handle; /* handle to the window */
1942 int incr; /* increment (can be negative) */
1943 @END
1946 /* Get the coordinates offset between two windows */
1947 @REQ(get_windows_offset)
1948 user_handle_t from; /* handle to the first window */
1949 user_handle_t to; /* handle to the second window */
1950 @REPLY
1951 int x; /* x coordinate offset */
1952 int y; /* y coordinate offset */
1953 @END
1956 /* Set a window property */
1957 @REQ(set_window_property)
1958 user_handle_t window; /* handle to the window */
1959 atom_t atom; /* property atom (high-word set if it was a string) */
1960 int string; /* was atom a string originally? */
1961 obj_handle_t handle; /* handle to store */
1962 @END
1965 /* Remove a window property */
1966 @REQ(remove_window_property)
1967 user_handle_t window; /* handle to the window */
1968 atom_t atom; /* property atom */
1969 @REPLY
1970 obj_handle_t handle; /* handle stored in property */
1971 @END
1974 /* Get a window property */
1975 @REQ(get_window_property)
1976 user_handle_t window; /* handle to the window */
1977 atom_t atom; /* property atom */
1978 @REPLY
1979 obj_handle_t handle; /* handle stored in property */
1980 @END
1983 /* Get the list of properties of a window */
1984 @REQ(get_window_properties)
1985 user_handle_t window; /* handle to the window */
1986 @REPLY
1987 int total; /* total number of properties */
1988 VARARG(props,properties); /* list of properties */
1989 @END
1992 /* Attach (or detach) thread inputs */
1993 @REQ(attach_thread_input)
1994 thread_id_t tid_from; /* thread to be attached */
1995 thread_id_t tid_to; /* thread to which tid_from should be attached */
1996 int attach; /* is it an attach? */
1997 @END
2000 /* Get input data for a given thread */
2001 @REQ(get_thread_input)
2002 thread_id_t tid; /* id of thread */
2003 @REPLY
2004 user_handle_t focus; /* handle to the focus window */
2005 user_handle_t capture; /* handle to the capture window */
2006 user_handle_t active; /* handle to the active window */
2007 user_handle_t foreground; /* handle to the global foreground window */
2008 user_handle_t menu_owner; /* handle to the menu owner */
2009 user_handle_t move_size; /* handle to the moving/resizing window */
2010 user_handle_t caret; /* handle to the caret window */
2011 rectangle_t rect; /* caret rectangle */
2012 @END
2014 /* Retrieve queue keyboard state for a given thread */
2015 @REQ(get_key_state)
2016 thread_id_t tid; /* id of thread */
2017 int key; /* optional key code or -1 */
2018 @REPLY
2019 unsigned char state; /* state of specified key */
2020 VARARG(keystate,bytes); /* state array for all the keys */
2021 @END
2023 /* Set queue keyboard state for a given thread */
2024 @REQ(set_key_state)
2025 thread_id_t tid; /* id of thread */
2026 VARARG(keystate,bytes); /* state array for all the keys */
2027 @END
2029 /* Set the system foreground window */
2030 @REQ(set_foreground_window)
2031 user_handle_t handle; /* handle to the foreground window */
2032 @REPLY
2033 user_handle_t previous; /* handle to the previous foreground window */
2034 int send_msg_old; /* whether we have to send a msg to the old window */
2035 int send_msg_new; /* whether we have to send a msg to the new window */
2036 @END
2038 /* Set the current thread focus window */
2039 @REQ(set_focus_window)
2040 user_handle_t handle; /* handle to the focus window */
2041 @REPLY
2042 user_handle_t previous; /* handle to the previous focus window */
2043 @END
2045 /* Set the current thread active window */
2046 @REQ(set_active_window)
2047 user_handle_t handle; /* handle to the active window */
2048 @REPLY
2049 user_handle_t previous; /* handle to the previous active window */
2050 @END
2052 /* Set the current thread capture window */
2053 @REQ(set_capture_window)
2054 user_handle_t handle; /* handle to the capture window */
2055 unsigned int flags; /* capture flags (see below) */
2056 @REPLY
2057 user_handle_t previous; /* handle to the previous capture window */
2058 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2059 @END
2060 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2061 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2064 /* Set the current thread caret window */
2065 @REQ(set_caret_window)
2066 user_handle_t handle; /* handle to the caret window */
2067 int width; /* caret width */
2068 int height; /* caret height */
2069 @REPLY
2070 user_handle_t previous; /* handle to the previous caret window */
2071 rectangle_t old_rect; /* previous caret rectangle */
2072 int old_hide; /* previous hide count */
2073 int old_state; /* previous caret state (1=on, 0=off) */
2074 @END
2077 /* Set the current thread caret information */
2078 @REQ(set_caret_info)
2079 unsigned int flags; /* caret flags (see below) */
2080 user_handle_t handle; /* handle to the caret window */
2081 int x; /* caret x position */
2082 int y; /* caret y position */
2083 int hide; /* increment for hide count (can be negative to show it) */
2084 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2085 @REPLY
2086 user_handle_t full_handle; /* handle to the current caret window */
2087 rectangle_t old_rect; /* previous caret rectangle */
2088 int old_hide; /* previous hide count */
2089 int old_state; /* previous caret state (1=on, 0=off) */
2090 @END
2091 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2092 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2093 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2096 /* Set a window hook */
2097 @REQ(set_hook)
2098 int id; /* id of the hook */
2099 thread_id_t tid; /* id of thread to set the hook into */
2100 void* proc; /* hook procedure */
2101 int unicode; /* is it a unicode hook? */
2102 VARARG(module,unicode_str); /* module name */
2103 @REPLY
2104 user_handle_t handle; /* handle to the hook */
2105 @END
2108 /* Remove a window hook */
2109 @REQ(remove_hook)
2110 user_handle_t handle; /* handle to the hook */
2111 int id; /* id of the hook if handle is 0 */
2112 void* proc; /* hook procedure if handle is 0 */
2113 @END
2116 /* Start calling a hook chain */
2117 @REQ(start_hook_chain)
2118 int id; /* id of the hook */
2119 @REPLY
2120 user_handle_t handle; /* handle to the next hook */
2121 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2122 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2123 void* proc; /* hook procedure */
2124 int unicode; /* is it a unicode hook? */
2125 VARARG(module,unicode_str); /* module name */
2126 @END
2129 /* Finished calling a hook chain */
2130 @REQ(finish_hook_chain)
2131 int id; /* id of the hook */
2132 @END
2135 /* Get the next hook to call */
2136 @REQ(get_next_hook)
2137 user_handle_t handle; /* handle to the current hook */
2138 @REPLY
2139 user_handle_t next; /* handle to the next hook */
2140 int id; /* id of the next hook */
2141 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2142 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2143 void* proc; /* next hook procedure */
2144 int prev_unicode; /* was the previous a unicode hook? */
2145 int next_unicode; /* is the next a unicode hook? */
2146 VARARG(module,unicode_str); /* module name */
2147 @END
2150 /* Set/get clipboard information */
2151 @REQ(set_clipboard_info)
2152 unsigned int flags; /* flags for fields to set (see below) */
2153 user_handle_t clipboard; /* clipboard window */
2154 user_handle_t owner; /* clipboard owner */
2155 user_handle_t viewer; /* first clipboard viewer */
2156 unsigned int seqno; /* change sequence number */
2157 @REPLY
2158 unsigned int flags; /* status flags (see below) */
2159 user_handle_t old_clipboard; /* old clipboard window */
2160 user_handle_t old_owner; /* old clipboard owner */
2161 user_handle_t old_viewer; /* old clipboard viewer */
2162 unsigned int seqno; /* current sequence number */
2163 @END
2165 #define SET_CB_OPEN 0x001
2166 #define SET_CB_OWNER 0x002
2167 #define SET_CB_VIEWER 0x004
2168 #define SET_CB_SEQNO 0x008
2169 #define SET_CB_RELOWNER 0x010
2170 #define SET_CB_CLOSE 0x020
2171 #define CB_OPEN 0x040
2172 #define CB_OWNER 0x080
2175 /* Open a security token */
2176 @REQ(open_token)
2177 obj_handle_t handle; /* handle to the thread or process */
2178 unsigned int flags; /* flags (see below) */
2179 @REPLY
2180 obj_handle_t token; /* handle to the token */
2181 @END
2182 #define OPEN_TOKEN_THREAD 1
2183 #define OPEN_TOKEN_AS_SELF 2