- no longer depend on toolhelp definitions for generating snapshots
[wine/hacks.git] / server / protocol.def
blobbc53ab645ccba843913076252f9c026d290585aa
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 returned in the list of window properties */
171 typedef struct
173 atom_t atom; /* property atom */
174 short string; /* was atom a string originally? */
175 obj_handle_t handle; /* handle stored in property */
176 } property_data_t;
178 /* structure to specify window rectangles */
179 typedef struct
181 int left;
182 int top;
183 int right;
184 int bottom;
185 } rectangle_t;
187 /* structure for console char/attribute info */
188 typedef struct
190 WCHAR ch;
191 unsigned short attr;
192 } char_info_t;
194 /****************************************************************/
195 /* Request declarations */
197 /* Create a new process from the context of the parent */
198 @REQ(new_process)
199 int inherit_all; /* inherit all handles from parent */
200 int use_handles; /* use stdio handles */
201 int create_flags; /* creation flags */
202 obj_handle_t exe_file; /* file handle for main exe */
203 obj_handle_t hstdin; /* handle for stdin */
204 obj_handle_t hstdout; /* handle for stdout */
205 obj_handle_t hstderr; /* handle for stderr */
206 VARARG(info,startup_info); /* startup information */
207 @REPLY
208 obj_handle_t info; /* new process info handle */
209 @END
212 /* Retrieve information about a newly started process */
213 @REQ(get_new_process_info)
214 obj_handle_t info; /* info handle returned from new_process_request */
215 int pinherit; /* process handle inherit flag */
216 int tinherit; /* thread handle inherit flag */
217 @REPLY
218 process_id_t pid; /* process id */
219 obj_handle_t phandle; /* process handle (in the current process) */
220 thread_id_t tid; /* thread id */
221 obj_handle_t thandle; /* thread handle (in the current process) */
222 int success; /* did the process start successfully? */
223 @END
226 /* Create a new thread from the context of the parent */
227 @REQ(new_thread)
228 int suspend; /* new thread should be suspended on creation */
229 int inherit; /* inherit flag */
230 int request_fd; /* fd for request pipe */
231 @REPLY
232 thread_id_t tid; /* thread id */
233 obj_handle_t handle; /* thread handle (in the current process) */
234 @END
237 /* Signal that we are finished booting on the client side */
238 @REQ(boot_done)
239 int debug_level; /* new debug level */
240 @END
243 /* Initialize a process; called from the new process context */
244 @REQ(init_process)
245 void* ldt_copy; /* addr of LDT copy */
246 int ppid; /* parent Unix pid */
247 @REPLY
248 int create_flags; /* creation flags */
249 unsigned int server_start; /* server start time (GetTickCount) */
250 size_t info_size; /* total size of startup info */
251 obj_handle_t exe_file; /* file handle for main exe */
252 obj_handle_t hstdin; /* handle for stdin */
253 obj_handle_t hstdout; /* handle for stdout */
254 obj_handle_t hstderr; /* handle for stderr */
255 @END
258 /* Retrieve the new process startup info */
259 @REQ(get_startup_info)
260 @REPLY
261 VARARG(info,startup_info); /* startup information */
262 @END
265 /* Signal the end of the process initialization */
266 @REQ(init_process_done)
267 void* module; /* main module base address */
268 size_t module_size; /* main module size */
269 void* entry; /* process entry point */
270 void* name; /* ptr to ptr to name (in process addr space) */
271 obj_handle_t exe_file; /* file handle for main exe */
272 int gui; /* is it a GUI process? */
273 VARARG(filename,string); /* file name of main exe */
274 @REPLY
275 int debugged; /* being debugged? */
276 @END
279 /* Initialize a thread; called from the child after fork()/clone() */
280 @REQ(init_thread)
281 int unix_pid; /* Unix pid of new thread */
282 void* teb; /* TEB of new thread (in thread address space) */
283 void* entry; /* thread entry point (in thread address space) */
284 int reply_fd; /* fd for reply pipe */
285 int wait_fd; /* fd for blocking calls pipe */
286 @REPLY
287 process_id_t pid; /* process id of the new thread's process */
288 thread_id_t tid; /* thread id of the new thread */
289 int boot; /* is this the boot thread? */
290 int version; /* protocol version */
291 @END
294 /* Terminate a process */
295 @REQ(terminate_process)
296 obj_handle_t handle; /* process handle to terminate */
297 int exit_code; /* process exit code */
298 @REPLY
299 int self; /* suicide? */
300 @END
303 /* Terminate a thread */
304 @REQ(terminate_thread)
305 obj_handle_t handle; /* thread handle to terminate */
306 int exit_code; /* thread exit code */
307 @REPLY
308 int self; /* suicide? */
309 int last; /* last thread in this process? */
310 @END
313 /* Retrieve information about a process */
314 @REQ(get_process_info)
315 obj_handle_t handle; /* process handle */
316 @REPLY
317 process_id_t pid; /* server process id */
318 int debugged; /* debugged? */
319 int exit_code; /* process exit code */
320 int priority; /* priority class */
321 int process_affinity; /* process affinity mask */
322 int system_affinity; /* system affinity mask */
323 @END
326 /* Set a process informations */
327 @REQ(set_process_info)
328 obj_handle_t handle; /* process handle */
329 int mask; /* setting mask (see below) */
330 int priority; /* priority class */
331 int affinity; /* affinity mask */
332 @END
333 #define SET_PROCESS_INFO_PRIORITY 0x01
334 #define SET_PROCESS_INFO_AFFINITY 0x02
337 /* Retrieve information about a thread */
338 @REQ(get_thread_info)
339 obj_handle_t handle; /* thread handle */
340 thread_id_t tid_in; /* thread id (optional) */
341 @REPLY
342 thread_id_t tid; /* server thread id */
343 void* teb; /* thread teb pointer */
344 int exit_code; /* thread exit code */
345 int priority; /* thread priority level */
346 time_t creation_time; /* thread creation time */
347 time_t exit_time; /* thread exit time */
348 @END
351 /* Set a thread informations */
352 @REQ(set_thread_info)
353 obj_handle_t handle; /* thread handle */
354 int mask; /* setting mask (see below) */
355 int priority; /* priority class */
356 int affinity; /* affinity mask */
357 @END
358 #define SET_THREAD_INFO_PRIORITY 0x01
359 #define SET_THREAD_INFO_AFFINITY 0x02
362 /* Retrieve information about a module */
363 @REQ(get_dll_info)
364 obj_handle_t handle; /* process handle */
365 void* base_address; /* base address of module */
366 @REPLY
367 size_t size; /* module size */
368 void* entry_point;
369 VARARG(filename,string); /* file name of module */
370 @END
373 /* Suspend a thread */
374 @REQ(suspend_thread)
375 obj_handle_t handle; /* thread handle */
376 @REPLY
377 int count; /* new suspend count */
378 @END
381 /* Resume a thread */
382 @REQ(resume_thread)
383 obj_handle_t handle; /* thread handle */
384 @REPLY
385 int count; /* new suspend count */
386 @END
389 /* Notify the server that a dll has been loaded */
390 @REQ(load_dll)
391 obj_handle_t handle; /* file handle */
392 void* base; /* base address */
393 size_t size; /* dll size */
394 int dbg_offset; /* debug info offset */
395 int dbg_size; /* debug info size */
396 void* name; /* ptr to ptr to name (in process addr space) */
397 VARARG(filename,string); /* file name of dll */
398 @END
401 /* Notify the server that a dll is being unloaded */
402 @REQ(unload_dll)
403 void* base; /* base address */
404 @END
407 /* Queue an APC for a thread */
408 @REQ(queue_apc)
409 obj_handle_t handle; /* thread handle */
410 int user; /* user or system apc? */
411 void* func; /* function to call */
412 void* param; /* param for function to call */
413 @END
416 /* Get next APC to call */
417 @REQ(get_apc)
418 int alertable; /* is thread alertable? */
419 @REPLY
420 void* func; /* function to call */
421 int type; /* function type */
422 VARARG(args,ptrs); /* function arguments */
423 @END
424 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
427 /* Close a handle for the current process */
428 @REQ(close_handle)
429 obj_handle_t handle; /* handle to close */
430 @REPLY
431 int fd; /* associated fd to close */
432 @END
435 /* Set a handle information */
436 @REQ(set_handle_info)
437 obj_handle_t handle; /* handle we are interested in */
438 int flags; /* new handle flags */
439 int mask; /* mask for flags to set */
440 int fd; /* file descriptor or -1 */
441 @REPLY
442 int old_flags; /* old flag value */
443 int cur_fd; /* current file descriptor */
444 @END
447 /* Duplicate a handle */
448 @REQ(dup_handle)
449 obj_handle_t src_process; /* src process handle */
450 obj_handle_t src_handle; /* src handle to duplicate */
451 obj_handle_t dst_process; /* dst process handle */
452 unsigned int access; /* wanted access rights */
453 int inherit; /* inherit flag */
454 int options; /* duplicate options (see below) */
455 @REPLY
456 obj_handle_t handle; /* duplicated handle in dst process */
457 int fd; /* associated fd to close */
458 @END
459 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
460 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
461 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
464 /* Open a handle to a process */
465 @REQ(open_process)
466 process_id_t pid; /* process id to open */
467 unsigned int access; /* wanted access rights */
468 int inherit; /* inherit flag */
469 @REPLY
470 obj_handle_t handle; /* handle to the process */
471 @END
474 /* Open a handle to a thread */
475 @REQ(open_thread)
476 thread_id_t tid; /* thread id to open */
477 unsigned int access; /* wanted access rights */
478 int inherit; /* inherit flag */
479 @REPLY
480 obj_handle_t handle; /* handle to the thread */
481 @END
484 /* Wait for handles */
485 @REQ(select)
486 int flags; /* wait flags (see below) */
487 void* cookie; /* magic cookie to return to client */
488 int sec; /* absolute timeout */
489 int usec; /* absolute timeout */
490 VARARG(handles,handles); /* handles to select on */
491 @END
492 #define SELECT_ALL 1
493 #define SELECT_ALERTABLE 2
494 #define SELECT_INTERRUPTIBLE 4
495 #define SELECT_TIMEOUT 8
498 /* Create an event */
499 @REQ(create_event)
500 int manual_reset; /* manual reset event */
501 int initial_state; /* initial state of the event */
502 int inherit; /* inherit flag */
503 VARARG(name,unicode_str); /* object name */
504 @REPLY
505 obj_handle_t handle; /* handle to the event */
506 @END
508 /* Event operation */
509 @REQ(event_op)
510 obj_handle_t handle; /* handle to event */
511 int op; /* event operation (see below) */
512 @END
513 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
516 /* Open an event */
517 @REQ(open_event)
518 unsigned int access; /* wanted access rights */
519 int inherit; /* inherit flag */
520 VARARG(name,unicode_str); /* object name */
521 @REPLY
522 obj_handle_t handle; /* handle to the event */
523 @END
526 /* Create a mutex */
527 @REQ(create_mutex)
528 int owned; /* initially owned? */
529 int inherit; /* inherit flag */
530 VARARG(name,unicode_str); /* object name */
531 @REPLY
532 obj_handle_t handle; /* handle to the mutex */
533 @END
536 /* Release a mutex */
537 @REQ(release_mutex)
538 obj_handle_t handle; /* handle to the mutex */
539 @END
542 /* Open a mutex */
543 @REQ(open_mutex)
544 unsigned int access; /* wanted access rights */
545 int inherit; /* inherit flag */
546 VARARG(name,unicode_str); /* object name */
547 @REPLY
548 obj_handle_t handle; /* handle to the mutex */
549 @END
552 /* Create a semaphore */
553 @REQ(create_semaphore)
554 unsigned int initial; /* initial count */
555 unsigned int max; /* maximum count */
556 int inherit; /* inherit flag */
557 VARARG(name,unicode_str); /* object name */
558 @REPLY
559 obj_handle_t handle; /* handle to the semaphore */
560 @END
563 /* Release a semaphore */
564 @REQ(release_semaphore)
565 obj_handle_t handle; /* handle to the semaphore */
566 unsigned int count; /* count to add to semaphore */
567 @REPLY
568 unsigned int prev_count; /* previous semaphore count */
569 @END
572 /* Open a semaphore */
573 @REQ(open_semaphore)
574 unsigned int access; /* wanted access rights */
575 int inherit; /* inherit flag */
576 VARARG(name,unicode_str); /* object name */
577 @REPLY
578 obj_handle_t handle; /* handle to the semaphore */
579 @END
582 /* Create a file */
583 @REQ(create_file)
584 unsigned int access; /* wanted access rights */
585 int inherit; /* inherit flag */
586 unsigned int sharing; /* sharing flags */
587 int create; /* file create action */
588 unsigned int attrs; /* file attributes for creation */
589 int drive_type; /* type of drive the file is on */
590 VARARG(filename,string); /* file name */
591 @REPLY
592 obj_handle_t handle; /* handle to the file */
593 @END
596 /* Allocate a file handle for a Unix fd */
597 @REQ(alloc_file_handle)
598 unsigned int access; /* wanted access rights */
599 int inherit; /* inherit flag */
600 int fd; /* file descriptor on the client side */
601 @REPLY
602 obj_handle_t handle; /* handle to the file */
603 @END
606 /* Get a Unix fd to access a file */
607 @REQ(get_handle_fd)
608 obj_handle_t handle; /* handle to the file */
609 unsigned int access; /* wanted access rights */
610 @REPLY
611 int fd; /* file descriptor */
612 int type; /* the type of file (see below) */
613 int flags; /* file read/write flags (see below) */
614 @END
615 enum fd_type
617 FD_TYPE_INVALID,
618 FD_TYPE_DEFAULT,
619 FD_TYPE_CONSOLE,
620 FD_TYPE_SOCKET,
621 FD_TYPE_SMB
623 #define FD_FLAG_OVERLAPPED 0x01
624 #define FD_FLAG_TIMEOUT 0x02
625 #define FD_FLAG_RECV_SHUTDOWN 0x04
626 #define FD_FLAG_SEND_SHUTDOWN 0x08
628 /* Set a file current position */
629 @REQ(set_file_pointer)
630 obj_handle_t handle; /* handle to the file */
631 int low; /* position low word */
632 int high; /* position high word */
633 int whence; /* whence to seek */
634 @REPLY
635 int new_low; /* new position low word */
636 int new_high; /* new position high word */
637 @END
640 /* Truncate (or extend) a file */
641 @REQ(truncate_file)
642 obj_handle_t handle; /* handle to the file */
643 @END
646 /* Set a file access and modification times */
647 @REQ(set_file_time)
648 obj_handle_t handle; /* handle to the file */
649 time_t access_time; /* last access time */
650 time_t write_time; /* last write time */
651 @END
654 /* Flush a file buffers */
655 @REQ(flush_file)
656 obj_handle_t handle; /* handle to the file */
657 @END
660 /* Get information about a file */
661 @REQ(get_file_info)
662 obj_handle_t handle; /* handle to the file */
663 @REPLY
664 int type; /* file type */
665 int attr; /* file attributes */
666 time_t access_time; /* last access time */
667 time_t write_time; /* last write time */
668 int size_high; /* file size */
669 int size_low; /* file size */
670 int links; /* number of links */
671 int index_high; /* unique index */
672 int index_low; /* unique index */
673 unsigned int serial; /* volume serial number */
674 @END
677 /* Lock a region of a file */
678 @REQ(lock_file)
679 obj_handle_t handle; /* handle to the file */
680 unsigned int offset_low; /* offset of start of lock */
681 unsigned int offset_high; /* offset of start of lock */
682 unsigned int count_low; /* count of bytes to lock */
683 unsigned int count_high; /* count of bytes to lock */
684 @END
687 /* Unlock a region of a file */
688 @REQ(unlock_file)
689 obj_handle_t handle; /* handle to the file */
690 unsigned int offset_low; /* offset of start of unlock */
691 unsigned int offset_high; /* offset of start of unlock */
692 unsigned int count_low; /* count of bytes to unlock */
693 unsigned int count_high; /* count of bytes to unlock */
694 @END
697 /* Create an anonymous pipe */
698 @REQ(create_pipe)
699 int inherit; /* inherit flag */
700 @REPLY
701 obj_handle_t handle_read; /* handle to the read-side of the pipe */
702 obj_handle_t handle_write; /* handle to the write-side of the pipe */
703 @END
706 /* Create a socket */
707 @REQ(create_socket)
708 unsigned int access; /* wanted access rights */
709 int inherit; /* inherit flag */
710 int family; /* family, see socket manpage */
711 int type; /* type, see socket manpage */
712 int protocol; /* protocol, see socket manpage */
713 unsigned int flags; /* socket flags */
714 @REPLY
715 obj_handle_t handle; /* handle to the new socket */
716 @END
719 /* Accept a socket */
720 @REQ(accept_socket)
721 obj_handle_t lhandle; /* handle to the listening socket */
722 unsigned int access; /* wanted access rights */
723 int inherit; /* inherit flag */
724 @REPLY
725 obj_handle_t handle; /* handle to the new socket */
726 @END
729 /* Set socket event parameters */
730 @REQ(set_socket_event)
731 obj_handle_t handle; /* handle to the socket */
732 unsigned int mask; /* event mask */
733 obj_handle_t event; /* event object */
734 user_handle_t window; /* window to send the message to */
735 unsigned int msg; /* message to send */
736 @END
739 /* Get socket event parameters */
740 @REQ(get_socket_event)
741 obj_handle_t handle; /* handle to the socket */
742 int service; /* clear pending? */
743 obj_handle_t c_event; /* event to clear */
744 @REPLY
745 unsigned int mask; /* event mask */
746 unsigned int pmask; /* pending events */
747 unsigned int state; /* status bits */
748 VARARG(errors,ints); /* event errors */
749 @END
752 /* Reenable pending socket events */
753 @REQ(enable_socket_event)
754 obj_handle_t handle; /* handle to the socket */
755 unsigned int mask; /* events to re-enable */
756 unsigned int sstate; /* status bits to set */
757 unsigned int cstate; /* status bits to clear */
758 @END
760 @REQ(set_socket_deferred)
761 obj_handle_t handle; /* handle to the socket */
762 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
763 @END
765 /* Allocate a console (only used by a console renderer) */
766 @REQ(alloc_console)
767 unsigned int access; /* wanted access rights */
768 int inherit; /* inherit flag */
769 process_id_t pid; /* pid of process which shall be attached to the console */
770 @REPLY
771 obj_handle_t handle_in; /* handle to console input */
772 obj_handle_t event; /* handle to renderer events change notification */
773 @END
776 /* Free the console of the current process */
777 @REQ(free_console)
778 @END
781 #define CONSOLE_RENDERER_NONE_EVENT 0x00
782 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
783 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
784 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
785 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
786 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
787 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
788 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
789 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
790 struct console_renderer_event
792 short event;
793 union
795 struct update
797 short top;
798 short bottom;
799 } update;
800 struct resize
802 short width;
803 short height;
804 } resize;
805 struct cursor_pos
807 short x;
808 short y;
809 } cursor_pos;
810 struct cursor_geom
812 short visible;
813 short size;
814 } cursor_geom;
815 struct display
817 short left;
818 short top;
819 short width;
820 short height;
821 } display;
822 } u;
825 /* retrieve console events for the renderer */
826 @REQ(get_console_renderer_events)
827 obj_handle_t handle; /* handle to console input events */
828 @REPLY
829 VARARG(data,bytes); /* the various console_renderer_events */
830 @END
833 /* Open a handle to the process console */
834 @REQ(open_console)
835 int from; /* 0 (resp 1) input (resp output) of current process console */
836 /* otherwise console_in handle to get active screen buffer? */
837 unsigned int access; /* wanted access rights */
838 int inherit; /* inherit flag */
839 int share; /* share mask (only for output handles) */
840 @REPLY
841 obj_handle_t handle; /* handle to the console */
842 @END
845 /* Get a console mode (input or output) */
846 @REQ(get_console_mode)
847 obj_handle_t handle; /* handle to the console */
848 @REPLY
849 int mode; /* console mode */
850 @END
853 /* Set a console mode (input or output) */
854 @REQ(set_console_mode)
855 obj_handle_t handle; /* handle to the console */
856 int mode; /* console mode */
857 @END
860 /* Set info about a console (input only) */
861 @REQ(set_console_input_info)
862 obj_handle_t handle; /* handle to console input, or 0 for process' console */
863 int mask; /* setting mask (see below) */
864 obj_handle_t active_sb; /* active screen buffer */
865 int history_mode; /* whether we duplicate lines in history */
866 int history_size; /* number of lines in history */
867 VARARG(title,unicode_str); /* console title */
868 @END
869 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
870 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
871 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
872 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
875 /* Get info about a console (input only) */
876 @REQ(get_console_input_info)
877 obj_handle_t handle; /* handle to console input, or 0 for process' console */
878 @REPLY
879 int history_mode; /* whether we duplicate lines in history */
880 int history_size; /* number of lines in history */
881 int history_index; /* number of used lines in history */
882 VARARG(title,unicode_str); /* console title */
883 @END
886 /* appends a string to console's history */
887 @REQ(append_console_input_history)
888 obj_handle_t handle; /* handle to console input, or 0 for process' console */
889 VARARG(line,unicode_str); /* line to add */
890 @END
893 /* appends a string to console's history */
894 @REQ(get_console_input_history)
895 obj_handle_t handle; /* handle to console input, or 0 for process' console */
896 int index; /* index to get line from */
897 @REPLY
898 int total; /* total length of line in Unicode chars */
899 VARARG(line,unicode_str); /* line to add */
900 @END
903 /* creates a new screen buffer on process' console */
904 @REQ(create_console_output)
905 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
906 int access; /* wanted access rights */
907 int share; /* sharing credentials */
908 int inherit; /* inherit flag */
909 @REPLY
910 obj_handle_t handle_out; /* handle to the screen buffer */
911 @END
914 /* Set info about a console (output only) */
915 @REQ(set_console_output_info)
916 obj_handle_t handle; /* handle to the console */
917 int mask; /* setting mask (see below) */
918 short int cursor_size; /* size of cursor (percentage filled) */
919 short int cursor_visible;/* cursor visibility flag */
920 short int cursor_x; /* position of cursor (x, y) */
921 short int cursor_y;
922 short int width; /* width of the screen buffer */
923 short int height; /* height of the screen buffer */
924 short int attr; /* default attribute */
925 short int win_left; /* window actually displayed by renderer */
926 short int win_top; /* the rect area is expressed withing the */
927 short int win_right; /* boundaries of the screen buffer */
928 short int win_bottom;
929 short int max_width; /* maximum size (width x height) for the window */
930 short int max_height;
931 @END
932 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
933 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
934 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
935 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
936 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
937 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
940 /* Get info about a console (output only) */
941 @REQ(get_console_output_info)
942 obj_handle_t handle; /* handle to the console */
943 @REPLY
944 short int cursor_size; /* size of cursor (percentage filled) */
945 short int cursor_visible;/* cursor visibility flag */
946 short int cursor_x; /* position of cursor (x, y) */
947 short int cursor_y;
948 short int width; /* width of the screen buffer */
949 short int height; /* height of the screen buffer */
950 short int attr; /* default attribute */
951 short int win_left; /* window actually displayed by renderer */
952 short int win_top; /* the rect area is expressed withing the */
953 short int win_right; /* boundaries of the screen buffer */
954 short int win_bottom;
955 short int max_width; /* maximum size (width x height) for the window */
956 short int max_height;
957 @END
959 /* Add input records to a console input queue */
960 @REQ(write_console_input)
961 obj_handle_t handle; /* handle to the console input */
962 VARARG(rec,input_records); /* input records */
963 @REPLY
964 int written; /* number of records written */
965 @END
968 /* Fetch input records from a console input queue */
969 @REQ(read_console_input)
970 obj_handle_t handle; /* handle to the console input */
971 int flush; /* flush the retrieved records from the queue? */
972 @REPLY
973 int read; /* number of records read */
974 VARARG(rec,input_records); /* input records */
975 @END
978 /* write data (chars and/or attributes) in a screen buffer */
979 @REQ(write_console_output)
980 obj_handle_t handle; /* handle to the console output */
981 int x; /* position where to start writing */
982 int y;
983 int mode; /* char info (see below) */
984 int wrap; /* wrap around at end of line? */
985 VARARG(data,bytes); /* info to write */
986 @REPLY
987 int written; /* number of char infos actually written */
988 int width; /* width of screen buffer */
989 int height; /* height of screen buffer */
990 @END
991 enum char_info_mode
993 CHAR_INFO_MODE_TEXT, /* characters only */
994 CHAR_INFO_MODE_ATTR, /* attributes only */
995 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
996 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1000 /* fill a screen buffer with constant data (chars and/or attributes) */
1001 @REQ(fill_console_output)
1002 obj_handle_t handle; /* handle to the console output */
1003 int x; /* position where to start writing */
1004 int y;
1005 int mode; /* char info mode */
1006 int count; /* number to write */
1007 int wrap; /* wrap around at end of line? */
1008 char_info_t data; /* data to write */
1009 @REPLY
1010 int written; /* number of char infos actually written */
1011 @END
1014 /* read data (chars and/or attributes) from a screen buffer */
1015 @REQ(read_console_output)
1016 obj_handle_t handle; /* handle to the console output */
1017 int x; /* position (x,y) where to start reading */
1018 int y;
1019 int mode; /* char info mode */
1020 int wrap; /* wrap around at end of line? */
1021 @REPLY
1022 int width; /* width of screen buffer */
1023 int height; /* height of screen buffer */
1024 VARARG(data,bytes);
1025 @END
1028 /* move a rect (of data) in screen buffer content */
1029 @REQ(move_console_output)
1030 obj_handle_t handle; /* handle to the console output */
1031 short int x_src; /* position (x, y) of rect to start moving from */
1032 short int y_src;
1033 short int x_dst; /* position (x, y) of rect to move to */
1034 short int y_dst;
1035 short int w; /* size of the rect (width, height) to move */
1036 short int h;
1037 @END
1040 /* Sends a signal to a process group */
1041 @REQ(send_console_signal)
1042 int signal; /* the signal to send */
1043 process_id_t group_id; /* the group to send the signal to */
1044 @END
1047 /* Create a change notification */
1048 @REQ(create_change_notification)
1049 int subtree; /* watch all the subtree */
1050 int filter; /* notification filter */
1051 @REPLY
1052 obj_handle_t handle; /* handle to the change notification */
1053 @END
1056 /* Create a file mapping */
1057 @REQ(create_mapping)
1058 int size_high; /* mapping size */
1059 int size_low; /* mapping size */
1060 int protect; /* protection flags (see below) */
1061 unsigned int access; /* wanted access rights */
1062 int inherit; /* inherit flag */
1063 obj_handle_t file_handle; /* file handle */
1064 VARARG(name,unicode_str); /* object name */
1065 @REPLY
1066 obj_handle_t handle; /* handle to the mapping */
1067 @END
1068 /* protection flags */
1069 #define VPROT_READ 0x01
1070 #define VPROT_WRITE 0x02
1071 #define VPROT_EXEC 0x04
1072 #define VPROT_WRITECOPY 0x08
1073 #define VPROT_GUARD 0x10
1074 #define VPROT_NOCACHE 0x20
1075 #define VPROT_COMMITTED 0x40
1076 #define VPROT_IMAGE 0x80
1079 /* Open a mapping */
1080 @REQ(open_mapping)
1081 unsigned int access; /* wanted access rights */
1082 int inherit; /* inherit flag */
1083 VARARG(name,unicode_str); /* object name */
1084 @REPLY
1085 obj_handle_t handle; /* handle to the mapping */
1086 @END
1089 /* Get information about a file mapping */
1090 @REQ(get_mapping_info)
1091 obj_handle_t handle; /* handle to the mapping */
1092 @REPLY
1093 int size_high; /* mapping size */
1094 int size_low; /* mapping size */
1095 int protect; /* protection flags */
1096 int header_size; /* header size (for VPROT_IMAGE mapping) */
1097 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1098 obj_handle_t shared_file; /* shared mapping file handle */
1099 int shared_size; /* shared mapping size */
1100 int drive_type; /* type of drive the file is on */
1101 @END
1104 /* Create a device */
1105 @REQ(create_device)
1106 unsigned int access; /* wanted access rights */
1107 int inherit; /* inherit flag */
1108 int id; /* client private id */
1109 @REPLY
1110 obj_handle_t handle; /* handle to the device */
1111 @END
1114 #define SNAP_HEAPLIST 0x00000001
1115 #define SNAP_PROCESS 0x00000002
1116 #define SNAP_THREAD 0x00000004
1117 #define SNAP_MODULE 0x00000008
1118 /* Create a snapshot */
1119 @REQ(create_snapshot)
1120 int inherit; /* inherit flag */
1121 int flags; /* snapshot flags (SNAP_*) */
1122 process_id_t pid; /* process id */
1123 @REPLY
1124 obj_handle_t handle; /* handle to the snapshot */
1125 @END
1128 /* Get the next process from a snapshot */
1129 @REQ(next_process)
1130 obj_handle_t handle; /* handle to the snapshot */
1131 int reset; /* reset snapshot position? */
1132 @REPLY
1133 int count; /* process usage count */
1134 process_id_t pid; /* process id */
1135 process_id_t ppid; /* parent process id */
1136 void* heap; /* heap base */
1137 void* module; /* main module */
1138 int threads; /* number of threads */
1139 int priority; /* process priority */
1140 VARARG(filename,string); /* file name of main exe */
1141 @END
1144 /* Get the next thread from a snapshot */
1145 @REQ(next_thread)
1146 obj_handle_t handle; /* handle to the snapshot */
1147 int reset; /* reset snapshot position? */
1148 @REPLY
1149 int count; /* thread usage count */
1150 process_id_t pid; /* process id */
1151 thread_id_t tid; /* thread id */
1152 int base_pri; /* base priority */
1153 int delta_pri; /* delta priority */
1154 @END
1157 /* Get the next module from a snapshot */
1158 @REQ(next_module)
1159 obj_handle_t handle; /* handle to the snapshot */
1160 int reset; /* reset snapshot position? */
1161 @REPLY
1162 process_id_t pid; /* process id */
1163 void* base; /* module base address */
1164 size_t size; /* module size */
1165 VARARG(filename,string); /* file name of module */
1166 @END
1169 /* Wait for a debug event */
1170 @REQ(wait_debug_event)
1171 int get_handle; /* should we alloc a handle for waiting? */
1172 @REPLY
1173 process_id_t pid; /* process id */
1174 thread_id_t tid; /* thread id */
1175 obj_handle_t wait; /* wait handle if no event ready */
1176 VARARG(event,debug_event); /* debug event data */
1177 @END
1180 /* Queue an exception event */
1181 @REQ(queue_exception_event)
1182 int first; /* first chance exception? */
1183 VARARG(record,exc_event); /* thread context followed by exception record */
1184 @REPLY
1185 obj_handle_t handle; /* handle to the queued event */
1186 @END
1189 /* Retrieve the status of an exception event */
1190 @REQ(get_exception_status)
1191 obj_handle_t handle; /* handle to the queued event */
1192 @REPLY
1193 int status; /* event continuation status */
1194 VARARG(context,context); /* modified thread context */
1195 @END
1198 /* Send an output string to the debugger */
1199 @REQ(output_debug_string)
1200 void* string; /* string to display (in debugged process address space) */
1201 int unicode; /* is it Unicode? */
1202 int length; /* string length */
1203 @END
1206 /* Continue a debug event */
1207 @REQ(continue_debug_event)
1208 process_id_t pid; /* process id to continue */
1209 thread_id_t tid; /* thread id to continue */
1210 int status; /* continuation status */
1211 @END
1214 /* Start/stop debugging an existing process */
1215 @REQ(debug_process)
1216 process_id_t pid; /* id of the process to debug */
1217 int attach; /* 1=attaching / 0=detaching from the process */
1218 @END
1221 /* Simulate a breakpoint in a process */
1222 @REQ(debug_break)
1223 obj_handle_t handle; /* process handle */
1224 @REPLY
1225 int self; /* was it the caller itself? */
1226 @END
1229 /* Set debugger kill on exit flag */
1230 @REQ(set_debugger_kill_on_exit)
1231 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1232 @END
1235 /* Read data from a process address space */
1236 @REQ(read_process_memory)
1237 obj_handle_t handle; /* process handle */
1238 void* addr; /* addr to read from */
1239 @REPLY
1240 VARARG(data,bytes); /* result data */
1241 @END
1244 /* Write data to a process address space */
1245 @REQ(write_process_memory)
1246 obj_handle_t handle; /* process handle */
1247 void* addr; /* addr to write to (must be int-aligned) */
1248 unsigned int first_mask; /* mask for first word */
1249 unsigned int last_mask; /* mask for last word */
1250 VARARG(data,bytes); /* data to write */
1251 @END
1254 /* Create a registry key */
1255 @REQ(create_key)
1256 obj_handle_t parent; /* handle to the parent key */
1257 unsigned int access; /* desired access rights */
1258 unsigned int options; /* creation options */
1259 time_t modif; /* last modification time */
1260 size_t namelen; /* length of key name in bytes */
1261 VARARG(name,unicode_str,namelen); /* key name */
1262 VARARG(class,unicode_str); /* class name */
1263 @REPLY
1264 obj_handle_t hkey; /* handle to the created key */
1265 int created; /* has it been newly created? */
1266 @END
1268 /* Open a registry key */
1269 @REQ(open_key)
1270 obj_handle_t parent; /* handle to the parent key */
1271 unsigned int access; /* desired access rights */
1272 VARARG(name,unicode_str); /* key name */
1273 @REPLY
1274 obj_handle_t hkey; /* handle to the open key */
1275 @END
1278 /* Delete a registry key */
1279 @REQ(delete_key)
1280 obj_handle_t hkey; /* handle to the key */
1281 @END
1284 /* Enumerate registry subkeys */
1285 @REQ(enum_key)
1286 obj_handle_t hkey; /* handle to registry key */
1287 int index; /* index of subkey (or -1 for current key) */
1288 int info_class; /* requested information class */
1289 @REPLY
1290 int subkeys; /* number of subkeys */
1291 int max_subkey; /* longest subkey name */
1292 int max_class; /* longest class name */
1293 int values; /* number of values */
1294 int max_value; /* longest value name */
1295 int max_data; /* longest value data */
1296 time_t modif; /* last modification time */
1297 size_t total; /* total length needed for full name and class */
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 @END
1304 /* Set a value of a registry key */
1305 @REQ(set_key_value)
1306 obj_handle_t hkey; /* handle to registry key */
1307 int type; /* value type */
1308 size_t namelen; /* length of value name in bytes */
1309 VARARG(name,unicode_str,namelen); /* value name */
1310 VARARG(data,bytes); /* value data */
1311 @END
1314 /* Retrieve the value of a registry key */
1315 @REQ(get_key_value)
1316 obj_handle_t hkey; /* handle to registry key */
1317 VARARG(name,unicode_str); /* value name */
1318 @REPLY
1319 int type; /* value type */
1320 size_t total; /* total length needed for data */
1321 VARARG(data,bytes); /* value data */
1322 @END
1325 /* Enumerate a value of a registry key */
1326 @REQ(enum_key_value)
1327 obj_handle_t hkey; /* handle to registry key */
1328 int index; /* value index */
1329 int info_class; /* requested information class */
1330 @REPLY
1331 int type; /* value type */
1332 size_t total; /* total length needed for full name and data */
1333 size_t namelen; /* length of value name in bytes */
1334 VARARG(name,unicode_str,namelen); /* value name */
1335 VARARG(data,bytes); /* value data */
1336 @END
1339 /* Delete a value of a registry key */
1340 @REQ(delete_key_value)
1341 obj_handle_t hkey; /* handle to registry key */
1342 VARARG(name,unicode_str); /* value name */
1343 @END
1346 /* Load a registry branch from a file */
1347 @REQ(load_registry)
1348 obj_handle_t hkey; /* root key to load to */
1349 obj_handle_t file; /* file to load from */
1350 VARARG(name,unicode_str); /* subkey name */
1351 @END
1354 /* Save a registry branch to a file */
1355 @REQ(save_registry)
1356 obj_handle_t hkey; /* key to save */
1357 obj_handle_t file; /* file to save to */
1358 @END
1361 /* Save a registry branch at server exit */
1362 @REQ(save_registry_atexit)
1363 obj_handle_t hkey; /* key to save */
1364 VARARG(file,string); /* file to save to */
1365 @END
1368 /* Set the current and saving level for the registry */
1369 @REQ(set_registry_levels)
1370 int current; /* new current level */
1371 int saving; /* new saving level */
1372 int period; /* duration between periodic saves (milliseconds) */
1373 @END
1376 @REQ(set_registry_notification)
1377 obj_handle_t hkey; /* key to watch for changes */
1378 obj_handle_t event; /* event to set */
1379 int subtree; /* should we watch the whole subtree? */
1380 unsigned int filter; /* things to watch */
1381 @END
1384 /* Create a waitable timer */
1385 @REQ(create_timer)
1386 int inherit; /* inherit flag */
1387 int manual; /* manual reset */
1388 VARARG(name,unicode_str); /* object name */
1389 @REPLY
1390 obj_handle_t handle; /* handle to the timer */
1391 @END
1394 /* Open a waitable timer */
1395 @REQ(open_timer)
1396 unsigned int access; /* wanted access rights */
1397 int inherit; /* inherit flag */
1398 VARARG(name,unicode_str); /* object name */
1399 @REPLY
1400 obj_handle_t handle; /* handle to the timer */
1401 @END
1403 /* Set a waitable timer */
1404 @REQ(set_timer)
1405 obj_handle_t handle; /* handle to the timer */
1406 int sec; /* next expiration absolute time */
1407 int usec; /* next expiration absolute time */
1408 int period; /* timer period in ms */
1409 void* callback; /* callback function */
1410 void* arg; /* callback argument */
1411 @END
1413 /* Cancel a waitable timer */
1414 @REQ(cancel_timer)
1415 obj_handle_t handle; /* handle to the timer */
1416 @END
1419 /* Retrieve the current context of a thread */
1420 @REQ(get_thread_context)
1421 obj_handle_t handle; /* thread handle */
1422 unsigned int flags; /* context flags */
1423 @REPLY
1424 VARARG(context,context); /* thread context */
1425 @END
1428 /* Set the current context of a thread */
1429 @REQ(set_thread_context)
1430 obj_handle_t handle; /* thread handle */
1431 unsigned int flags; /* context flags */
1432 VARARG(context,context); /* thread context */
1433 @END
1436 /* Fetch a selector entry for a thread */
1437 @REQ(get_selector_entry)
1438 obj_handle_t handle; /* thread handle */
1439 int entry; /* LDT entry */
1440 @REPLY
1441 unsigned int base; /* selector base */
1442 unsigned int limit; /* selector limit */
1443 unsigned char flags; /* selector flags */
1444 @END
1447 /* Add an atom */
1448 @REQ(add_atom)
1449 int local; /* is atom in local process table? */
1450 VARARG(name,unicode_str); /* atom name */
1451 @REPLY
1452 atom_t atom; /* resulting atom */
1453 @END
1456 /* Delete an atom */
1457 @REQ(delete_atom)
1458 atom_t atom; /* atom handle */
1459 int local; /* is atom in local process table? */
1460 @END
1463 /* Find an atom */
1464 @REQ(find_atom)
1465 int local; /* is atom in local process table? */
1466 VARARG(name,unicode_str); /* atom name */
1467 @REPLY
1468 atom_t atom; /* atom handle */
1469 @END
1472 /* Get an atom name */
1473 @REQ(get_atom_name)
1474 atom_t atom; /* atom handle */
1475 int local; /* is atom in local process table? */
1476 @REPLY
1477 int count; /* atom lock count */
1478 VARARG(name,unicode_str); /* atom name */
1479 @END
1482 /* Init the process atom table */
1483 @REQ(init_atom_table)
1484 int entries; /* number of entries */
1485 @END
1488 /* Get the message queue of the current thread */
1489 @REQ(get_msg_queue)
1490 @REPLY
1491 obj_handle_t handle; /* handle to the queue */
1492 @END
1495 /* Set the current message queue wakeup mask */
1496 @REQ(set_queue_mask)
1497 unsigned int wake_mask; /* wakeup bits mask */
1498 unsigned int changed_mask; /* changed bits mask */
1499 int skip_wait; /* will we skip waiting if signaled? */
1500 @REPLY
1501 unsigned int wake_bits; /* current wake bits */
1502 unsigned int changed_bits; /* current changed bits */
1503 @END
1506 /* Get the current message queue status */
1507 @REQ(get_queue_status)
1508 int clear; /* should we clear the change bits? */
1509 @REPLY
1510 unsigned int wake_bits; /* wake bits */
1511 unsigned int changed_bits; /* changed bits since last time */
1512 @END
1515 /* Wait for a process to start waiting on input */
1516 @REQ(wait_input_idle)
1517 obj_handle_t handle; /* process handle */
1518 int timeout; /* timeout */
1519 @REPLY
1520 obj_handle_t event; /* handle to idle event */
1521 @END
1524 /* Send a message to a thread queue */
1525 @REQ(send_message)
1526 thread_id_t id; /* thread id */
1527 int type; /* message type (see below) */
1528 user_handle_t win; /* window handle */
1529 unsigned int msg; /* message code */
1530 unsigned int wparam; /* parameters */
1531 unsigned int lparam; /* parameters */
1532 int x; /* x position */
1533 int y; /* y position */
1534 unsigned int time; /* message time */
1535 unsigned int info; /* extra info */
1536 int timeout; /* timeout for reply */
1537 VARARG(data,bytes); /* message data for sent messages */
1538 @END
1540 enum message_type
1542 MSG_ASCII, /* Ascii message (from SendMessageA) */
1543 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1544 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1545 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1546 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1547 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1548 MSG_HARDWARE /* hardware message */
1552 /* Get a message from the current queue */
1553 @REQ(get_message)
1554 int flags; /* see below */
1555 user_handle_t get_win; /* window handle to get */
1556 unsigned int get_first; /* first message code to get */
1557 unsigned int get_last; /* last message code to get */
1558 @REPLY
1559 int type; /* message type */
1560 user_handle_t win; /* window handle */
1561 unsigned int msg; /* message code */
1562 unsigned int wparam; /* parameters */
1563 unsigned int lparam; /* parameters */
1564 int x; /* x position */
1565 int y; /* y position */
1566 unsigned int time; /* message time */
1567 unsigned int info; /* extra info */
1568 size_t total; /* total size of extra data */
1569 VARARG(data,bytes); /* message data for sent messages */
1570 @END
1571 #define GET_MSG_REMOVE 1 /* remove the message */
1572 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1574 /* Reply to a sent message */
1575 @REQ(reply_message)
1576 unsigned int result; /* message result */
1577 int remove; /* should we remove the message? */
1578 VARARG(data,bytes); /* message data for sent messages */
1579 @END
1582 /* Retrieve the reply for the last message sent */
1583 @REQ(get_message_reply)
1584 int cancel; /* cancel message if not ready? */
1585 @REPLY
1586 unsigned int result; /* message result */
1587 VARARG(data,bytes); /* message data for sent messages */
1588 @END
1591 /* Set a window timer */
1592 @REQ(set_win_timer)
1593 user_handle_t win; /* window handle */
1594 unsigned int msg; /* message to post */
1595 unsigned int id; /* timer id */
1596 unsigned int rate; /* timer rate in ms */
1597 unsigned int lparam; /* message lparam (callback proc) */
1598 @END
1601 /* Kill a window timer */
1602 @REQ(kill_win_timer)
1603 user_handle_t win; /* window handle */
1604 unsigned int msg; /* message to post */
1605 unsigned int id; /* timer id */
1606 @END
1609 /* Open a serial port */
1610 @REQ(create_serial)
1611 unsigned int access; /* wanted access rights */
1612 int inherit; /* inherit flag */
1613 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1614 unsigned int sharing; /* sharing flags */
1615 VARARG(name,string); /* file name */
1616 @REPLY
1617 obj_handle_t handle; /* handle to the port */
1618 @END
1621 /* Retrieve info about a serial port */
1622 @REQ(get_serial_info)
1623 obj_handle_t handle; /* handle to comm port */
1624 @REPLY
1625 unsigned int readinterval;
1626 unsigned int readconst;
1627 unsigned int readmult;
1628 unsigned int writeconst;
1629 unsigned int writemult;
1630 unsigned int eventmask;
1631 unsigned int commerror;
1632 @END
1635 /* Set info about a serial port */
1636 @REQ(set_serial_info)
1637 obj_handle_t handle; /* handle to comm port */
1638 int flags; /* bitmask to set values (see below) */
1639 unsigned int readinterval;
1640 unsigned int readconst;
1641 unsigned int readmult;
1642 unsigned int writeconst;
1643 unsigned int writemult;
1644 unsigned int eventmask;
1645 unsigned int commerror;
1646 @END
1647 #define SERIALINFO_SET_TIMEOUTS 0x01
1648 #define SERIALINFO_SET_MASK 0x02
1649 #define SERIALINFO_SET_ERROR 0x04
1652 /* Create / reschedule an async I/O */
1653 @REQ(register_async)
1654 obj_handle_t handle; /* handle to comm port, socket or file */
1655 int type;
1656 void* overlapped;
1657 int count;
1658 unsigned int status;
1659 @END
1660 #define ASYNC_TYPE_NONE 0x00
1661 #define ASYNC_TYPE_READ 0x01
1662 #define ASYNC_TYPE_WRITE 0x02
1663 #define ASYNC_TYPE_WAIT 0x03
1666 /* Create a named pipe */
1667 @REQ(create_named_pipe)
1668 unsigned int openmode;
1669 unsigned int pipemode;
1670 unsigned int maxinstances;
1671 unsigned int outsize;
1672 unsigned int insize;
1673 unsigned int timeout;
1674 VARARG(name,unicode_str); /* pipe name */
1675 @REPLY
1676 obj_handle_t handle; /* handle to the pipe */
1677 @END
1680 /* Open an existing named pipe */
1681 @REQ(open_named_pipe)
1682 unsigned int access;
1683 VARARG(name,unicode_str); /* pipe name */
1684 @REPLY
1685 obj_handle_t handle; /* handle to the pipe */
1686 @END
1689 /* Connect to a named pipe */
1690 @REQ(connect_named_pipe)
1691 obj_handle_t handle;
1692 void* overlapped;
1693 void* func;
1694 @END
1697 /* Wait for a named pipe */
1698 @REQ(wait_named_pipe)
1699 unsigned int timeout;
1700 void* overlapped;
1701 void* func;
1702 VARARG(name,unicode_str); /* pipe name */
1703 @END
1706 /* Disconnect a named pipe */
1707 @REQ(disconnect_named_pipe)
1708 obj_handle_t handle;
1709 @END
1712 @REQ(get_named_pipe_info)
1713 obj_handle_t handle;
1714 @REPLY
1715 unsigned int flags;
1716 unsigned int maxinstances;
1717 unsigned int outsize;
1718 unsigned int insize;
1719 @END
1722 @REQ(create_smb)
1723 int fd;
1724 unsigned int tree_id;
1725 unsigned int user_id;
1726 unsigned int file_id;
1727 unsigned int dialect;
1728 @REPLY
1729 obj_handle_t handle;
1730 @END
1733 @REQ(get_smb_info)
1734 obj_handle_t handle;
1735 unsigned int flags;
1736 unsigned int offset;
1737 @REPLY
1738 unsigned int tree_id;
1739 unsigned int user_id;
1740 unsigned int dialect;
1741 unsigned int file_id;
1742 unsigned int offset;
1743 @END
1744 #define SMBINFO_SET_OFFSET 0x01
1747 /* Create a window */
1748 @REQ(create_window)
1749 user_handle_t parent; /* parent window */
1750 user_handle_t owner; /* owner window */
1751 atom_t atom; /* class atom */
1752 @REPLY
1753 user_handle_t handle; /* created window */
1754 @END
1757 /* Link a window into the tree */
1758 @REQ(link_window)
1759 user_handle_t handle; /* handle to the window */
1760 user_handle_t parent; /* handle to the parent */
1761 user_handle_t previous; /* previous child in Z-order */
1762 @REPLY
1763 user_handle_t full_parent; /* full handle of new parent */
1764 @END
1767 /* Destroy a window */
1768 @REQ(destroy_window)
1769 user_handle_t handle; /* handle to the window */
1770 @END
1773 /* Set a window owner */
1774 @REQ(set_window_owner)
1775 user_handle_t handle; /* handle to the window */
1776 user_handle_t owner; /* new owner */
1777 @REPLY
1778 user_handle_t full_owner; /* full handle of new owner */
1779 user_handle_t prev_owner; /* full handle of previous owner */
1780 @END
1783 /* Get information from a window handle */
1784 @REQ(get_window_info)
1785 user_handle_t handle; /* handle to the window */
1786 @REPLY
1787 user_handle_t full_handle; /* full 32-bit handle */
1788 user_handle_t last_active; /* last active popup */
1789 process_id_t pid; /* process owning the window */
1790 thread_id_t tid; /* thread owning the window */
1791 atom_t atom; /* class atom */
1792 @END
1795 /* Set some information in a window */
1796 @REQ(set_window_info)
1797 user_handle_t handle; /* handle to the window */
1798 unsigned int flags; /* flags for fields to set (see below) */
1799 unsigned int style; /* window style */
1800 unsigned int ex_style; /* window extended style */
1801 unsigned int id; /* window id */
1802 void* instance; /* creator instance */
1803 void* user_data; /* user-specific data */
1804 @REPLY
1805 unsigned int old_style; /* old window style */
1806 unsigned int old_ex_style; /* old window extended style */
1807 unsigned int old_id; /* old window id */
1808 void* old_instance; /* old creator instance */
1809 void* old_user_data; /* old user-specific data */
1810 @END
1811 #define SET_WIN_STYLE 0x01
1812 #define SET_WIN_EXSTYLE 0x02
1813 #define SET_WIN_ID 0x04
1814 #define SET_WIN_INSTANCE 0x08
1815 #define SET_WIN_USERDATA 0x10
1818 /* Get a list of the window parents, up to the root of the tree */
1819 @REQ(get_window_parents)
1820 user_handle_t handle; /* handle to the window */
1821 @REPLY
1822 int count; /* total count of parents */
1823 VARARG(parents,user_handles); /* parent handles */
1824 @END
1827 /* Get a list of the window children */
1828 @REQ(get_window_children)
1829 user_handle_t parent; /* parent window */
1830 atom_t atom; /* class atom for the listed children */
1831 thread_id_t tid; /* thread owning the listed children */
1832 @REPLY
1833 int count; /* total count of children */
1834 VARARG(children,user_handles); /* children handles */
1835 @END
1838 /* Get window tree information from a window handle */
1839 @REQ(get_window_tree)
1840 user_handle_t handle; /* handle to the window */
1841 @REPLY
1842 user_handle_t parent; /* parent window */
1843 user_handle_t owner; /* owner window */
1844 user_handle_t next_sibling; /* next sibling in Z-order */
1845 user_handle_t prev_sibling; /* prev sibling in Z-order */
1846 user_handle_t first_sibling; /* first sibling in Z-order */
1847 user_handle_t last_sibling; /* last sibling in Z-order */
1848 user_handle_t first_child; /* first child */
1849 user_handle_t last_child; /* last child */
1850 @END
1852 /* Set the window and client rectangles of a window */
1853 @REQ(set_window_rectangles)
1854 user_handle_t handle; /* handle to the window */
1855 rectangle_t window; /* window rectangle */
1856 rectangle_t client; /* client rectangle */
1857 @END
1860 /* Get the window and client rectangles of a window */
1861 @REQ(get_window_rectangles)
1862 user_handle_t handle; /* handle to the window */
1863 @REPLY
1864 rectangle_t window; /* window rectangle */
1865 rectangle_t client; /* client rectangle */
1866 @END
1869 /* Get the window text */
1870 @REQ(get_window_text)
1871 user_handle_t handle; /* handle to the window */
1872 @REPLY
1873 VARARG(text,unicode_str); /* window text */
1874 @END
1877 /* Set the window text */
1878 @REQ(set_window_text)
1879 user_handle_t handle; /* handle to the window */
1880 VARARG(text,unicode_str); /* window text */
1881 @END
1884 /* Increment the window paint count */
1885 @REQ(inc_window_paint_count)
1886 user_handle_t handle; /* handle to the window */
1887 int incr; /* increment (can be negative) */
1888 @END
1891 /* Get the coordinates offset between two windows */
1892 @REQ(get_windows_offset)
1893 user_handle_t from; /* handle to the first window */
1894 user_handle_t to; /* handle to the second window */
1895 @REPLY
1896 int x; /* x coordinate offset */
1897 int y; /* y coordinate offset */
1898 @END
1901 /* Set a window property */
1902 @REQ(set_window_property)
1903 user_handle_t window; /* handle to the window */
1904 atom_t atom; /* property atom (high-word set if it was a string) */
1905 int string; /* was atom a string originally? */
1906 obj_handle_t handle; /* handle to store */
1907 @END
1910 /* Remove a window property */
1911 @REQ(remove_window_property)
1912 user_handle_t window; /* handle to the window */
1913 atom_t atom; /* property atom */
1914 @REPLY
1915 obj_handle_t handle; /* handle stored in property */
1916 @END
1919 /* Get a window property */
1920 @REQ(get_window_property)
1921 user_handle_t window; /* handle to the window */
1922 atom_t atom; /* property atom */
1923 @REPLY
1924 obj_handle_t handle; /* handle stored in property */
1925 @END
1928 /* Get the list of properties of a window */
1929 @REQ(get_window_properties)
1930 user_handle_t window; /* handle to the window */
1931 @REPLY
1932 int total; /* total number of properties */
1933 VARARG(props,properties); /* list of properties */
1934 @END
1937 /* Attach (or detach) thread inputs */
1938 @REQ(attach_thread_input)
1939 thread_id_t tid_from; /* thread to be attached */
1940 thread_id_t tid_to; /* thread to which tid_from should be attached */
1941 int attach; /* is it an attach? */
1942 @END
1945 /* Get input data for a given thread */
1946 @REQ(get_thread_input)
1947 thread_id_t tid; /* id of thread */
1948 @REPLY
1949 user_handle_t focus; /* handle to the focus window */
1950 user_handle_t capture; /* handle to the capture window */
1951 user_handle_t active; /* handle to the active window */
1952 user_handle_t foreground; /* handle to the global foreground window */
1953 user_handle_t menu_owner; /* handle to the menu owner */
1954 user_handle_t move_size; /* handle to the moving/resizing window */
1955 user_handle_t caret; /* handle to the caret window */
1956 rectangle_t rect; /* caret rectangle */
1957 @END
1959 /* Retrieve queue keyboard state for a given thread */
1960 @REQ(get_key_state)
1961 thread_id_t tid; /* id of thread */
1962 int key; /* optional key code or -1 */
1963 @REPLY
1964 unsigned char state; /* state of specified key */
1965 VARARG(keystate,bytes); /* state array for all the keys */
1966 @END
1968 /* Set queue keyboard state for a given thread */
1969 @REQ(set_key_state)
1970 thread_id_t tid; /* id of thread */
1971 VARARG(keystate,bytes); /* state array for all the keys */
1972 @END
1974 /* Set the system foreground window */
1975 @REQ(set_foreground_window)
1976 user_handle_t handle; /* handle to the foreground window */
1977 @REPLY
1978 user_handle_t previous; /* handle to the previous foreground window */
1979 int send_msg_old; /* whether we have to send a msg to the old window */
1980 int send_msg_new; /* whether we have to send a msg to the new window */
1981 @END
1983 /* Set the current thread focus window */
1984 @REQ(set_focus_window)
1985 user_handle_t handle; /* handle to the focus window */
1986 @REPLY
1987 user_handle_t previous; /* handle to the previous focus window */
1988 @END
1990 /* Set the current thread active window */
1991 @REQ(set_active_window)
1992 user_handle_t handle; /* handle to the active window */
1993 @REPLY
1994 user_handle_t previous; /* handle to the previous active window */
1995 @END
1997 /* Set the current thread capture window */
1998 @REQ(set_capture_window)
1999 user_handle_t handle; /* handle to the capture window */
2000 unsigned int flags; /* capture flags (see below) */
2001 @REPLY
2002 user_handle_t previous; /* handle to the previous capture window */
2003 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2004 @END
2005 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2006 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2009 /* Set the current thread caret window */
2010 @REQ(set_caret_window)
2011 user_handle_t handle; /* handle to the caret window */
2012 int width; /* caret width */
2013 int height; /* caret height */
2014 @REPLY
2015 user_handle_t previous; /* handle to the previous caret window */
2016 rectangle_t old_rect; /* previous caret rectangle */
2017 int old_hide; /* previous hide count */
2018 int old_state; /* previous caret state (1=on, 0=off) */
2019 @END
2022 /* Set the current thread caret information */
2023 @REQ(set_caret_info)
2024 unsigned int flags; /* caret flags (see below) */
2025 user_handle_t handle; /* handle to the caret window */
2026 int x; /* caret x position */
2027 int y; /* caret y position */
2028 int hide; /* increment for hide count (can be negative to show it) */
2029 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2030 @REPLY
2031 user_handle_t full_handle; /* handle to the current caret window */
2032 rectangle_t old_rect; /* previous caret rectangle */
2033 int old_hide; /* previous hide count */
2034 int old_state; /* previous caret state (1=on, 0=off) */
2035 @END
2036 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2037 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2038 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2041 /* Set a window hook */
2042 @REQ(set_hook)
2043 int id; /* id of the hook */
2044 thread_id_t tid; /* id of thread to set the hook into */
2045 void* proc; /* hook procedure */
2046 int unicode; /* is it a unicode hook? */
2047 VARARG(module,unicode_str); /* module name */
2048 @REPLY
2049 user_handle_t handle; /* handle to the hook */
2050 @END
2053 /* Remove a window hook */
2054 @REQ(remove_hook)
2055 user_handle_t handle; /* handle to the hook */
2056 int id; /* id of the hook if handle is 0 */
2057 void* proc; /* hook procedure if handle is 0 */
2058 @END
2061 /* Start calling a hook chain */
2062 @REQ(start_hook_chain)
2063 int id; /* id of the hook */
2064 @REPLY
2065 user_handle_t handle; /* handle to the next hook */
2066 void* proc; /* hook procedure */
2067 int unicode; /* is it a unicode hook? */
2068 VARARG(module,unicode_str); /* module name */
2069 @END
2072 /* Finished calling a hook chain */
2073 @REQ(finish_hook_chain)
2074 int id; /* id of the hook */
2075 @END
2078 /* Get the next hook to call */
2079 @REQ(get_next_hook)
2080 user_handle_t handle; /* handle to the current hook */
2081 @REPLY
2082 user_handle_t next; /* handle to the next hook */
2083 int id; /* id of the next hook */
2084 void* proc; /* next hook procedure */
2085 int prev_unicode; /* was the previous a unicode hook? */
2086 int next_unicode; /* is the next a unicode hook? */
2087 VARARG(module,unicode_str); /* module name */
2088 @END