Move the FPS computation from the D3D code to the common code.
[wine/multimedia.git] / server / protocol.def
blobe8a757cd4c8aeeada89442cd059e3d046bf2372b
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 absolute timeouts */
151 typedef struct
153 int sec; /* seconds since Unix epoch */
154 int usec; /* microseconds */
155 } abs_time_t;
157 /* structure returned in the list of window properties */
158 typedef struct
160 atom_t atom; /* property atom */
161 short string; /* was atom a string originally? */
162 obj_handle_t handle; /* handle stored in property */
163 } property_data_t;
165 /* structure to specify window rectangles */
166 typedef struct
168 int left;
169 int top;
170 int right;
171 int bottom;
172 } rectangle_t;
174 /* structure for console char/attribute info */
175 typedef struct
177 WCHAR ch;
178 unsigned short attr;
179 } char_info_t;
181 /****************************************************************/
182 /* Request declarations */
184 /* Create a new process from the context of the parent */
185 @REQ(new_process)
186 int inherit_all; /* inherit all handles from parent */
187 int create_flags; /* creation flags */
188 int unix_pid; /* Unix pid of new process */
189 obj_handle_t exe_file; /* file handle for main exe */
190 obj_handle_t hstdin; /* handle for stdin */
191 obj_handle_t hstdout; /* handle for stdout */
192 obj_handle_t hstderr; /* handle for stderr */
193 VARARG(info,startup_info); /* startup information */
194 @REPLY
195 obj_handle_t info; /* new process info handle */
196 @END
199 /* Retrieve information about a newly started process */
200 @REQ(get_new_process_info)
201 obj_handle_t info; /* info handle returned from new_process_request */
202 int pinherit; /* process handle inherit flag */
203 int tinherit; /* thread handle inherit flag */
204 @REPLY
205 process_id_t pid; /* process id */
206 obj_handle_t phandle; /* process handle (in the current process) */
207 thread_id_t tid; /* thread id */
208 obj_handle_t thandle; /* thread handle (in the current process) */
209 int success; /* did the process start successfully? */
210 @END
213 /* Create a new thread from the context of the parent */
214 @REQ(new_thread)
215 int suspend; /* new thread should be suspended on creation */
216 int inherit; /* inherit flag */
217 int request_fd; /* fd for request pipe */
218 @REPLY
219 thread_id_t tid; /* thread id */
220 obj_handle_t handle; /* thread handle (in the current process) */
221 @END
224 /* Signal that we are finished booting on the client side */
225 @REQ(boot_done)
226 int debug_level; /* new debug level */
227 @END
230 /* Initialize a process; called from the new process context */
231 @REQ(init_process)
232 void* peb; /* addr of PEB */
233 void* ldt_copy; /* addr of LDT copy */
234 @REPLY
235 int create_flags; /* creation flags */
236 unsigned int server_start; /* server start time (GetTickCount) */
237 size_t info_size; /* total size of startup info */
238 obj_handle_t exe_file; /* file handle for main exe */
239 obj_handle_t hstdin; /* handle for stdin */
240 obj_handle_t hstdout; /* handle for stdout */
241 obj_handle_t hstderr; /* handle for stderr */
242 @END
245 /* Retrieve the new process startup info */
246 @REQ(get_startup_info)
247 @REPLY
248 VARARG(info,startup_info); /* startup information */
249 @END
252 /* Signal the end of the process initialization */
253 @REQ(init_process_done)
254 void* module; /* main module base address */
255 size_t module_size; /* main module size */
256 void* entry; /* process entry point */
257 void* name; /* ptr to ptr to name (in process addr space) */
258 obj_handle_t exe_file; /* file handle for main exe */
259 int gui; /* is it a GUI process? */
260 VARARG(filename,unicode_str); /* file name of main exe */
261 @END
264 /* Initialize a thread; called from the child after fork()/clone() */
265 @REQ(init_thread)
266 int unix_pid; /* Unix pid of new thread */
267 int unix_tid; /* Unix tid of new thread */
268 void* teb; /* TEB of new thread (in thread address space) */
269 void* entry; /* thread entry point (in thread address space) */
270 int reply_fd; /* fd for reply pipe */
271 int wait_fd; /* fd for blocking calls pipe */
272 @REPLY
273 process_id_t pid; /* process id of the new thread's process */
274 thread_id_t tid; /* thread id of the new thread */
275 int boot; /* is this the boot thread? */
276 int version; /* protocol version */
277 @END
280 /* Terminate a process */
281 @REQ(terminate_process)
282 obj_handle_t handle; /* process handle to terminate */
283 int exit_code; /* process exit code */
284 @REPLY
285 int self; /* suicide? */
286 @END
289 /* Terminate a thread */
290 @REQ(terminate_thread)
291 obj_handle_t handle; /* thread handle to terminate */
292 int exit_code; /* thread exit code */
293 @REPLY
294 int self; /* suicide? */
295 int last; /* last thread in this process? */
296 @END
299 /* Retrieve information about a process */
300 @REQ(get_process_info)
301 obj_handle_t handle; /* process handle */
302 @REPLY
303 process_id_t pid; /* server process id */
304 int exit_code; /* process exit code */
305 int priority; /* priority class */
306 int process_affinity; /* process affinity mask */
307 int system_affinity; /* system affinity mask */
308 @END
311 /* Set a process informations */
312 @REQ(set_process_info)
313 obj_handle_t handle; /* process handle */
314 int mask; /* setting mask (see below) */
315 int priority; /* priority class */
316 int affinity; /* affinity mask */
317 @END
318 #define SET_PROCESS_INFO_PRIORITY 0x01
319 #define SET_PROCESS_INFO_AFFINITY 0x02
322 /* Retrieve information about a thread */
323 @REQ(get_thread_info)
324 obj_handle_t handle; /* thread handle */
325 thread_id_t tid_in; /* thread id (optional) */
326 @REPLY
327 process_id_t pid; /* server process id */
328 thread_id_t tid; /* server thread id */
329 void* teb; /* thread teb pointer */
330 int exit_code; /* thread exit code */
331 int priority; /* thread priority level */
332 int affinity; /* thread affinity mask */
333 time_t creation_time; /* thread creation time */
334 time_t exit_time; /* thread exit time */
335 @END
338 /* Set a thread informations */
339 @REQ(set_thread_info)
340 obj_handle_t handle; /* thread handle */
341 int mask; /* setting mask (see below) */
342 int priority; /* priority class */
343 int affinity; /* affinity mask */
344 @END
345 #define SET_THREAD_INFO_PRIORITY 0x01
346 #define SET_THREAD_INFO_AFFINITY 0x02
349 /* Retrieve information about a module */
350 @REQ(get_dll_info)
351 obj_handle_t handle; /* process handle */
352 void* base_address; /* base address of module */
353 @REPLY
354 size_t size; /* module size */
355 void* entry_point;
356 VARARG(filename,unicode_str); /* file name of module */
357 @END
360 /* Suspend a thread */
361 @REQ(suspend_thread)
362 obj_handle_t handle; /* thread handle */
363 @REPLY
364 int count; /* new suspend count */
365 @END
368 /* Resume a thread */
369 @REQ(resume_thread)
370 obj_handle_t handle; /* thread handle */
371 @REPLY
372 int count; /* new suspend count */
373 @END
376 /* Notify the server that a dll has been loaded */
377 @REQ(load_dll)
378 obj_handle_t handle; /* file handle */
379 void* base; /* base address */
380 size_t size; /* dll size */
381 int dbg_offset; /* debug info offset */
382 int dbg_size; /* debug info size */
383 void* name; /* ptr to ptr to name (in process addr space) */
384 VARARG(filename,unicode_str); /* file name of dll */
385 @END
388 /* Notify the server that a dll is being unloaded */
389 @REQ(unload_dll)
390 void* base; /* base address */
391 @END
394 /* Queue an APC for a thread */
395 @REQ(queue_apc)
396 obj_handle_t handle; /* thread handle */
397 int user; /* user or system apc? */
398 void* func; /* function to call */
399 void* arg1; /* params for function to call */
400 void* arg2;
401 void* arg3;
402 @END
405 /* Get next APC to call */
406 @REQ(get_apc)
407 int alertable; /* is thread alertable? */
408 @REPLY
409 void* func; /* function to call */
410 int type; /* function type */
411 void* arg1; /* function arguments */
412 void* arg2;
413 void* arg3;
414 @END
415 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
418 /* Close a handle for the current process */
419 @REQ(close_handle)
420 obj_handle_t handle; /* handle to close */
421 @REPLY
422 int fd; /* associated fd to close */
423 @END
426 /* Set a handle information */
427 @REQ(set_handle_info)
428 obj_handle_t handle; /* handle we are interested in */
429 int flags; /* new handle flags */
430 int mask; /* mask for flags to set */
431 int fd; /* file descriptor or -1 */
432 @REPLY
433 int old_flags; /* old flag value */
434 int cur_fd; /* current file descriptor */
435 @END
438 /* Duplicate a handle */
439 @REQ(dup_handle)
440 obj_handle_t src_process; /* src process handle */
441 obj_handle_t src_handle; /* src handle to duplicate */
442 obj_handle_t dst_process; /* dst process handle */
443 unsigned int access; /* wanted access rights */
444 int inherit; /* inherit flag */
445 int options; /* duplicate options (see below) */
446 @REPLY
447 obj_handle_t handle; /* duplicated handle in dst process */
448 int fd; /* associated fd to close */
449 @END
450 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
451 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
452 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
455 /* Open a handle to a process */
456 @REQ(open_process)
457 process_id_t pid; /* process id to open */
458 unsigned int access; /* wanted access rights */
459 int inherit; /* inherit flag */
460 @REPLY
461 obj_handle_t handle; /* handle to the process */
462 @END
465 /* Open a handle to a thread */
466 @REQ(open_thread)
467 thread_id_t tid; /* thread id to open */
468 unsigned int access; /* wanted access rights */
469 int inherit; /* inherit flag */
470 @REPLY
471 obj_handle_t handle; /* handle to the thread */
472 @END
475 /* Wait for handles */
476 @REQ(select)
477 int flags; /* wait flags (see below) */
478 void* cookie; /* magic cookie to return to client */
479 abs_time_t timeout; /* absolute timeout */
480 VARARG(handles,handles); /* handles to select on */
481 @END
482 #define SELECT_ALL 1
483 #define SELECT_ALERTABLE 2
484 #define SELECT_INTERRUPTIBLE 4
485 #define SELECT_TIMEOUT 8
488 /* Create an event */
489 @REQ(create_event)
490 int manual_reset; /* manual reset event */
491 int initial_state; /* initial state of the event */
492 int inherit; /* inherit flag */
493 VARARG(name,unicode_str); /* object name */
494 @REPLY
495 obj_handle_t handle; /* handle to the event */
496 @END
498 /* Event operation */
499 @REQ(event_op)
500 obj_handle_t handle; /* handle to event */
501 int op; /* event operation (see below) */
502 @END
503 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
506 /* Open an event */
507 @REQ(open_event)
508 unsigned int access; /* wanted access rights */
509 int inherit; /* inherit flag */
510 VARARG(name,unicode_str); /* object name */
511 @REPLY
512 obj_handle_t handle; /* handle to the event */
513 @END
516 /* Create a mutex */
517 @REQ(create_mutex)
518 int owned; /* initially owned? */
519 int inherit; /* inherit flag */
520 VARARG(name,unicode_str); /* object name */
521 @REPLY
522 obj_handle_t handle; /* handle to the mutex */
523 @END
526 /* Release a mutex */
527 @REQ(release_mutex)
528 obj_handle_t handle; /* handle to the mutex */
529 @END
532 /* Open a mutex */
533 @REQ(open_mutex)
534 unsigned int access; /* wanted access rights */
535 int inherit; /* inherit flag */
536 VARARG(name,unicode_str); /* object name */
537 @REPLY
538 obj_handle_t handle; /* handle to the mutex */
539 @END
542 /* Create a semaphore */
543 @REQ(create_semaphore)
544 unsigned int initial; /* initial count */
545 unsigned int max; /* maximum count */
546 int inherit; /* inherit flag */
547 VARARG(name,unicode_str); /* object name */
548 @REPLY
549 obj_handle_t handle; /* handle to the semaphore */
550 @END
553 /* Release a semaphore */
554 @REQ(release_semaphore)
555 obj_handle_t handle; /* handle to the semaphore */
556 unsigned int count; /* count to add to semaphore */
557 @REPLY
558 unsigned int prev_count; /* previous semaphore count */
559 @END
562 /* Open a semaphore */
563 @REQ(open_semaphore)
564 unsigned int access; /* wanted access rights */
565 int inherit; /* inherit flag */
566 VARARG(name,unicode_str); /* object name */
567 @REPLY
568 obj_handle_t handle; /* handle to the semaphore */
569 @END
572 /* Create a file */
573 @REQ(create_file)
574 unsigned int access; /* wanted access rights */
575 int inherit; /* inherit flag */
576 unsigned int sharing; /* sharing flags */
577 int create; /* file create action */
578 unsigned int options; /* file options */
579 unsigned int attrs; /* file attributes for creation */
580 VARARG(filename,string); /* file name */
581 @REPLY
582 obj_handle_t handle; /* handle to the file */
583 @END
586 /* Allocate a file handle for a Unix fd */
587 @REQ(alloc_file_handle)
588 unsigned int access; /* wanted access rights */
589 int inherit; /* inherit flag */
590 int fd; /* file descriptor on the client side */
591 @REPLY
592 obj_handle_t handle; /* handle to the file */
593 @END
596 /* Get a Unix fd to access a file */
597 @REQ(get_handle_fd)
598 obj_handle_t handle; /* handle to the file */
599 unsigned int access; /* wanted access rights */
600 @REPLY
601 int fd; /* file descriptor */
602 int type; /* the type of file (see below) */
603 int flags; /* file read/write flags (see below) */
604 @END
605 enum fd_type
607 FD_TYPE_INVALID,
608 FD_TYPE_DEFAULT,
609 FD_TYPE_SOCKET
611 #define FD_FLAG_OVERLAPPED 0x01
612 #define FD_FLAG_TIMEOUT 0x02
613 #define FD_FLAG_RECV_SHUTDOWN 0x04
614 #define FD_FLAG_SEND_SHUTDOWN 0x08
617 /* Flush a file buffers */
618 @REQ(flush_file)
619 obj_handle_t handle; /* handle to the file */
620 @REPLY
621 obj_handle_t event; /* event set when finished */
622 @END
625 /* Lock a region of a file */
626 @REQ(lock_file)
627 obj_handle_t handle; /* handle to the file */
628 unsigned int offset_low; /* offset of start of lock */
629 unsigned int offset_high; /* offset of start of lock */
630 unsigned int count_low; /* count of bytes to lock */
631 unsigned int count_high; /* count of bytes to lock */
632 int shared; /* shared or exclusive lock? */
633 int wait; /* do we want to wait? */
634 @REPLY
635 obj_handle_t handle; /* handle to wait on */
636 int overlapped; /* is it an overlapped I/O handle? */
637 @END
640 /* Unlock a region of a file */
641 @REQ(unlock_file)
642 obj_handle_t handle; /* handle to the file */
643 unsigned int offset_low; /* offset of start of unlock */
644 unsigned int offset_high; /* offset of start of unlock */
645 unsigned int count_low; /* count of bytes to unlock */
646 unsigned int count_high; /* count of bytes to unlock */
647 @END
650 /* Create a socket */
651 @REQ(create_socket)
652 unsigned int access; /* wanted access rights */
653 int inherit; /* inherit flag */
654 int family; /* family, see socket manpage */
655 int type; /* type, see socket manpage */
656 int protocol; /* protocol, see socket manpage */
657 unsigned int flags; /* socket flags */
658 @REPLY
659 obj_handle_t handle; /* handle to the new socket */
660 @END
663 /* Accept a socket */
664 @REQ(accept_socket)
665 obj_handle_t lhandle; /* handle to the listening socket */
666 unsigned int access; /* wanted access rights */
667 int inherit; /* inherit flag */
668 @REPLY
669 obj_handle_t handle; /* handle to the new socket */
670 @END
673 /* Set socket event parameters */
674 @REQ(set_socket_event)
675 obj_handle_t handle; /* handle to the socket */
676 unsigned int mask; /* event mask */
677 obj_handle_t event; /* event object */
678 user_handle_t window; /* window to send the message to */
679 unsigned int msg; /* message to send */
680 @END
683 /* Get socket event parameters */
684 @REQ(get_socket_event)
685 obj_handle_t handle; /* handle to the socket */
686 int service; /* clear pending? */
687 obj_handle_t c_event; /* event to clear */
688 @REPLY
689 unsigned int mask; /* event mask */
690 unsigned int pmask; /* pending events */
691 unsigned int state; /* status bits */
692 VARARG(errors,ints); /* event errors */
693 @END
696 /* Reenable pending socket events */
697 @REQ(enable_socket_event)
698 obj_handle_t handle; /* handle to the socket */
699 unsigned int mask; /* events to re-enable */
700 unsigned int sstate; /* status bits to set */
701 unsigned int cstate; /* status bits to clear */
702 @END
704 @REQ(set_socket_deferred)
705 obj_handle_t handle; /* handle to the socket */
706 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
707 @END
709 /* Allocate a console (only used by a console renderer) */
710 @REQ(alloc_console)
711 unsigned int access; /* wanted access rights */
712 int inherit; /* inherit flag */
713 process_id_t pid; /* pid of process which shall be attached to the console */
714 @REPLY
715 obj_handle_t handle_in; /* handle to console input */
716 obj_handle_t event; /* handle to renderer events change notification */
717 @END
720 /* Free the console of the current process */
721 @REQ(free_console)
722 @END
725 #define CONSOLE_RENDERER_NONE_EVENT 0x00
726 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
727 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
728 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
729 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
730 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
731 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
732 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
733 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
734 struct console_renderer_event
736 short event;
737 union
739 struct update
741 short top;
742 short bottom;
743 } update;
744 struct resize
746 short width;
747 short height;
748 } resize;
749 struct cursor_pos
751 short x;
752 short y;
753 } cursor_pos;
754 struct cursor_geom
756 short visible;
757 short size;
758 } cursor_geom;
759 struct display
761 short left;
762 short top;
763 short width;
764 short height;
765 } display;
766 } u;
769 /* retrieve console events for the renderer */
770 @REQ(get_console_renderer_events)
771 obj_handle_t handle; /* handle to console input events */
772 @REPLY
773 VARARG(data,bytes); /* the various console_renderer_events */
774 @END
777 /* Open a handle to the process console */
778 @REQ(open_console)
779 int from; /* 0 (resp 1) input (resp output) of current process console */
780 /* otherwise console_in handle to get active screen buffer? */
781 unsigned int access; /* wanted access rights */
782 int inherit; /* inherit flag */
783 int share; /* share mask (only for output handles) */
784 @REPLY
785 obj_handle_t handle; /* handle to the console */
786 @END
789 /* Get the input queue wait event */
790 @REQ(get_console_wait_event)
791 @REPLY
792 obj_handle_t handle;
793 @END
795 /* Get a console mode (input or output) */
796 @REQ(get_console_mode)
797 obj_handle_t handle; /* handle to the console */
798 @REPLY
799 int mode; /* console mode */
800 @END
803 /* Set a console mode (input or output) */
804 @REQ(set_console_mode)
805 obj_handle_t handle; /* handle to the console */
806 int mode; /* console mode */
807 @END
810 /* Set info about a console (input only) */
811 @REQ(set_console_input_info)
812 obj_handle_t handle; /* handle to console input, or 0 for process' console */
813 int mask; /* setting mask (see below) */
814 obj_handle_t active_sb; /* active screen buffer */
815 int history_mode; /* whether we duplicate lines in history */
816 int history_size; /* number of lines in history */
817 int edition_mode; /* index to the edition mode flavors */
818 VARARG(title,unicode_str); /* console title */
819 @END
820 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
821 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
822 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
823 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
824 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
827 /* Get info about a console (input only) */
828 @REQ(get_console_input_info)
829 obj_handle_t handle; /* handle to console input, or 0 for process' console */
830 @REPLY
831 int history_mode; /* whether we duplicate lines in history */
832 int history_size; /* number of lines in history */
833 int history_index; /* number of used lines in history */
834 int edition_mode; /* index to the edition mode flavors */
835 VARARG(title,unicode_str); /* console title */
836 @END
839 /* appends a string to console's history */
840 @REQ(append_console_input_history)
841 obj_handle_t handle; /* handle to console input, or 0 for process' console */
842 VARARG(line,unicode_str); /* line to add */
843 @END
846 /* appends a string to console's history */
847 @REQ(get_console_input_history)
848 obj_handle_t handle; /* handle to console input, or 0 for process' console */
849 int index; /* index to get line from */
850 @REPLY
851 int total; /* total length of line in Unicode chars */
852 VARARG(line,unicode_str); /* line to add */
853 @END
856 /* creates a new screen buffer on process' console */
857 @REQ(create_console_output)
858 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
859 int access; /* wanted access rights */
860 int share; /* sharing credentials */
861 int inherit; /* inherit flag */
862 @REPLY
863 obj_handle_t handle_out; /* handle to the screen buffer */
864 @END
867 /* Set info about a console (output only) */
868 @REQ(set_console_output_info)
869 obj_handle_t handle; /* handle to the console */
870 int mask; /* setting mask (see below) */
871 short int cursor_size; /* size of cursor (percentage filled) */
872 short int cursor_visible;/* cursor visibility flag */
873 short int cursor_x; /* position of cursor (x, y) */
874 short int cursor_y;
875 short int width; /* width of the screen buffer */
876 short int height; /* height of the screen buffer */
877 short int attr; /* default attribute */
878 short int win_left; /* window actually displayed by renderer */
879 short int win_top; /* the rect area is expressed withing the */
880 short int win_right; /* boundaries of the screen buffer */
881 short int win_bottom;
882 short int max_width; /* maximum size (width x height) for the window */
883 short int max_height;
884 @END
885 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
886 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
887 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
888 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
889 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
890 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
893 /* Get info about a console (output only) */
894 @REQ(get_console_output_info)
895 obj_handle_t handle; /* handle to the console */
896 @REPLY
897 short int cursor_size; /* size of cursor (percentage filled) */
898 short int cursor_visible;/* cursor visibility flag */
899 short int cursor_x; /* position of cursor (x, y) */
900 short int cursor_y;
901 short int width; /* width of the screen buffer */
902 short int height; /* height of the screen buffer */
903 short int attr; /* default attribute */
904 short int win_left; /* window actually displayed by renderer */
905 short int win_top; /* the rect area is expressed withing the */
906 short int win_right; /* boundaries of the screen buffer */
907 short int win_bottom;
908 short int max_width; /* maximum size (width x height) for the window */
909 short int max_height;
910 @END
912 /* Add input records to a console input queue */
913 @REQ(write_console_input)
914 obj_handle_t handle; /* handle to the console input */
915 VARARG(rec,input_records); /* input records */
916 @REPLY
917 int written; /* number of records written */
918 @END
921 /* Fetch input records from a console input queue */
922 @REQ(read_console_input)
923 obj_handle_t handle; /* handle to the console input */
924 int flush; /* flush the retrieved records from the queue? */
925 @REPLY
926 int read; /* number of records read */
927 VARARG(rec,input_records); /* input records */
928 @END
931 /* write data (chars and/or attributes) in a screen buffer */
932 @REQ(write_console_output)
933 obj_handle_t handle; /* handle to the console output */
934 int x; /* position where to start writing */
935 int y;
936 int mode; /* char info (see below) */
937 int wrap; /* wrap around at end of line? */
938 VARARG(data,bytes); /* info to write */
939 @REPLY
940 int written; /* number of char infos actually written */
941 int width; /* width of screen buffer */
942 int height; /* height of screen buffer */
943 @END
944 enum char_info_mode
946 CHAR_INFO_MODE_TEXT, /* characters only */
947 CHAR_INFO_MODE_ATTR, /* attributes only */
948 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
949 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
953 /* fill a screen buffer with constant data (chars and/or attributes) */
954 @REQ(fill_console_output)
955 obj_handle_t handle; /* handle to the console output */
956 int x; /* position where to start writing */
957 int y;
958 int mode; /* char info mode */
959 int count; /* number to write */
960 int wrap; /* wrap around at end of line? */
961 char_info_t data; /* data to write */
962 @REPLY
963 int written; /* number of char infos actually written */
964 @END
967 /* read data (chars and/or attributes) from a screen buffer */
968 @REQ(read_console_output)
969 obj_handle_t handle; /* handle to the console output */
970 int x; /* position (x,y) where to start reading */
971 int y;
972 int mode; /* char info mode */
973 int wrap; /* wrap around at end of line? */
974 @REPLY
975 int width; /* width of screen buffer */
976 int height; /* height of screen buffer */
977 VARARG(data,bytes);
978 @END
981 /* move a rect (of data) in screen buffer content */
982 @REQ(move_console_output)
983 obj_handle_t handle; /* handle to the console output */
984 short int x_src; /* position (x, y) of rect to start moving from */
985 short int y_src;
986 short int x_dst; /* position (x, y) of rect to move to */
987 short int y_dst;
988 short int w; /* size of the rect (width, height) to move */
989 short int h;
990 @END
993 /* Sends a signal to a process group */
994 @REQ(send_console_signal)
995 int signal; /* the signal to send */
996 process_id_t group_id; /* the group to send the signal to */
997 @END
1000 /* Create a change notification */
1001 @REQ(create_change_notification)
1002 obj_handle_t handle; /* handle to the directory */
1003 int subtree; /* watch all the subtree */
1004 unsigned int filter; /* notification filter */
1005 @REPLY
1006 obj_handle_t handle; /* handle to the change notification */
1007 @END
1010 /* Move to the next change notification */
1011 @REQ(next_change_notification)
1012 obj_handle_t handle; /* handle to the change notification */
1013 @END
1015 /* Create a file mapping */
1016 @REQ(create_mapping)
1017 int size_high; /* mapping size */
1018 int size_low; /* mapping size */
1019 int protect; /* protection flags (see below) */
1020 unsigned int access; /* wanted access rights */
1021 int inherit; /* inherit flag */
1022 obj_handle_t file_handle; /* file handle */
1023 VARARG(name,unicode_str); /* object name */
1024 @REPLY
1025 obj_handle_t handle; /* handle to the mapping */
1026 @END
1027 /* protection flags */
1028 #define VPROT_READ 0x01
1029 #define VPROT_WRITE 0x02
1030 #define VPROT_EXEC 0x04
1031 #define VPROT_WRITECOPY 0x08
1032 #define VPROT_GUARD 0x10
1033 #define VPROT_NOCACHE 0x20
1034 #define VPROT_COMMITTED 0x40
1035 #define VPROT_IMAGE 0x80
1038 /* Open a mapping */
1039 @REQ(open_mapping)
1040 unsigned int access; /* wanted access rights */
1041 int inherit; /* inherit flag */
1042 VARARG(name,unicode_str); /* object name */
1043 @REPLY
1044 obj_handle_t handle; /* handle to the mapping */
1045 @END
1048 /* Get information about a file mapping */
1049 @REQ(get_mapping_info)
1050 obj_handle_t handle; /* handle to the mapping */
1051 @REPLY
1052 int size_high; /* mapping size */
1053 int size_low; /* mapping size */
1054 int protect; /* protection flags */
1055 int header_size; /* header size (for VPROT_IMAGE mapping) */
1056 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1057 obj_handle_t shared_file; /* shared mapping file handle */
1058 int shared_size; /* shared mapping size */
1059 @END
1062 #define SNAP_HEAPLIST 0x00000001
1063 #define SNAP_PROCESS 0x00000002
1064 #define SNAP_THREAD 0x00000004
1065 #define SNAP_MODULE 0x00000008
1066 /* Create a snapshot */
1067 @REQ(create_snapshot)
1068 int inherit; /* inherit flag */
1069 int flags; /* snapshot flags (SNAP_*) */
1070 process_id_t pid; /* process id */
1071 @REPLY
1072 obj_handle_t handle; /* handle to the snapshot */
1073 @END
1076 /* Get the next process from a snapshot */
1077 @REQ(next_process)
1078 obj_handle_t handle; /* handle to the snapshot */
1079 int reset; /* reset snapshot position? */
1080 @REPLY
1081 int count; /* process usage count */
1082 process_id_t pid; /* process id */
1083 process_id_t ppid; /* parent process id */
1084 void* heap; /* heap base */
1085 void* module; /* main module */
1086 int threads; /* number of threads */
1087 int priority; /* process priority */
1088 int handles; /* number of handles */
1089 VARARG(filename,unicode_str); /* file name of main exe */
1090 @END
1093 /* Get the next thread from a snapshot */
1094 @REQ(next_thread)
1095 obj_handle_t handle; /* handle to the snapshot */
1096 int reset; /* reset snapshot position? */
1097 @REPLY
1098 int count; /* thread usage count */
1099 process_id_t pid; /* process id */
1100 thread_id_t tid; /* thread id */
1101 int base_pri; /* base priority */
1102 int delta_pri; /* delta priority */
1103 @END
1106 /* Get the next module from a snapshot */
1107 @REQ(next_module)
1108 obj_handle_t handle; /* handle to the snapshot */
1109 int reset; /* reset snapshot position? */
1110 @REPLY
1111 process_id_t pid; /* process id */
1112 void* base; /* module base address */
1113 size_t size; /* module size */
1114 VARARG(filename,unicode_str); /* file name of module */
1115 @END
1118 /* Wait for a debug event */
1119 @REQ(wait_debug_event)
1120 int get_handle; /* should we alloc a handle for waiting? */
1121 @REPLY
1122 process_id_t pid; /* process id */
1123 thread_id_t tid; /* thread id */
1124 obj_handle_t wait; /* wait handle if no event ready */
1125 VARARG(event,debug_event); /* debug event data */
1126 @END
1129 /* Queue an exception event */
1130 @REQ(queue_exception_event)
1131 int first; /* first chance exception? */
1132 VARARG(record,exc_event); /* thread context followed by exception record */
1133 @REPLY
1134 obj_handle_t handle; /* handle to the queued event */
1135 @END
1138 /* Retrieve the status of an exception event */
1139 @REQ(get_exception_status)
1140 obj_handle_t handle; /* handle to the queued event */
1141 @REPLY
1142 int status; /* event continuation status */
1143 VARARG(context,context); /* modified thread context */
1144 @END
1147 /* Send an output string to the debugger */
1148 @REQ(output_debug_string)
1149 void* string; /* string to display (in debugged process address space) */
1150 int unicode; /* is it Unicode? */
1151 int length; /* string length */
1152 @END
1155 /* Continue a debug event */
1156 @REQ(continue_debug_event)
1157 process_id_t pid; /* process id to continue */
1158 thread_id_t tid; /* thread id to continue */
1159 int status; /* continuation status */
1160 @END
1163 /* Start/stop debugging an existing process */
1164 @REQ(debug_process)
1165 process_id_t pid; /* id of the process to debug */
1166 int attach; /* 1=attaching / 0=detaching from the process */
1167 @END
1170 /* Simulate a breakpoint in a process */
1171 @REQ(debug_break)
1172 obj_handle_t handle; /* process handle */
1173 @REPLY
1174 int self; /* was it the caller itself? */
1175 @END
1178 /* Set debugger kill on exit flag */
1179 @REQ(set_debugger_kill_on_exit)
1180 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1181 @END
1184 /* Read data from a process address space */
1185 @REQ(read_process_memory)
1186 obj_handle_t handle; /* process handle */
1187 void* addr; /* addr to read from */
1188 @REPLY
1189 VARARG(data,bytes); /* result data */
1190 @END
1193 /* Write data to a process address space */
1194 @REQ(write_process_memory)
1195 obj_handle_t handle; /* process handle */
1196 void* addr; /* addr to write to (must be int-aligned) */
1197 unsigned int first_mask; /* mask for first word */
1198 unsigned int last_mask; /* mask for last word */
1199 VARARG(data,bytes); /* data to write */
1200 @END
1203 /* Create a registry key */
1204 @REQ(create_key)
1205 obj_handle_t parent; /* handle to the parent key */
1206 unsigned int access; /* desired access rights */
1207 unsigned int options; /* creation options */
1208 time_t modif; /* last modification time */
1209 size_t namelen; /* length of key name in bytes */
1210 VARARG(name,unicode_str,namelen); /* key name */
1211 VARARG(class,unicode_str); /* class name */
1212 @REPLY
1213 obj_handle_t hkey; /* handle to the created key */
1214 int created; /* has it been newly created? */
1215 @END
1217 /* Open a registry key */
1218 @REQ(open_key)
1219 obj_handle_t parent; /* handle to the parent key */
1220 unsigned int access; /* desired access rights */
1221 VARARG(name,unicode_str); /* key name */
1222 @REPLY
1223 obj_handle_t hkey; /* handle to the open key */
1224 @END
1227 /* Delete a registry key */
1228 @REQ(delete_key)
1229 obj_handle_t hkey; /* handle to the key */
1230 @END
1233 /* Flush a registry key */
1234 @REQ(flush_key)
1235 obj_handle_t hkey; /* handle to the key */
1236 @END
1239 /* Enumerate registry subkeys */
1240 @REQ(enum_key)
1241 obj_handle_t hkey; /* handle to registry key */
1242 int index; /* index of subkey (or -1 for current key) */
1243 int info_class; /* requested information class */
1244 @REPLY
1245 int subkeys; /* number of subkeys */
1246 int max_subkey; /* longest subkey name */
1247 int max_class; /* longest class name */
1248 int values; /* number of values */
1249 int max_value; /* longest value name */
1250 int max_data; /* longest value data */
1251 time_t modif; /* last modification time */
1252 size_t total; /* total length needed for full name and class */
1253 size_t namelen; /* length of key name in bytes */
1254 VARARG(name,unicode_str,namelen); /* key name */
1255 VARARG(class,unicode_str); /* class name */
1256 @END
1259 /* Set a value of a registry key */
1260 @REQ(set_key_value)
1261 obj_handle_t hkey; /* handle to registry key */
1262 int type; /* value type */
1263 size_t namelen; /* length of value name in bytes */
1264 VARARG(name,unicode_str,namelen); /* value name */
1265 VARARG(data,bytes); /* value data */
1266 @END
1269 /* Retrieve the value of a registry key */
1270 @REQ(get_key_value)
1271 obj_handle_t hkey; /* handle to registry key */
1272 VARARG(name,unicode_str); /* value name */
1273 @REPLY
1274 int type; /* value type */
1275 size_t total; /* total length needed for data */
1276 VARARG(data,bytes); /* value data */
1277 @END
1280 /* Enumerate a value of a registry key */
1281 @REQ(enum_key_value)
1282 obj_handle_t hkey; /* handle to registry key */
1283 int index; /* value index */
1284 int info_class; /* requested information class */
1285 @REPLY
1286 int type; /* value type */
1287 size_t total; /* total length needed for full name and data */
1288 size_t namelen; /* length of value name in bytes */
1289 VARARG(name,unicode_str,namelen); /* value name */
1290 VARARG(data,bytes); /* value data */
1291 @END
1294 /* Delete a value of a registry key */
1295 @REQ(delete_key_value)
1296 obj_handle_t hkey; /* handle to registry key */
1297 VARARG(name,unicode_str); /* value name */
1298 @END
1301 /* Load a registry branch from a file */
1302 @REQ(load_registry)
1303 obj_handle_t hkey; /* root key to load to */
1304 obj_handle_t file; /* file to load from */
1305 VARARG(name,unicode_str); /* subkey name */
1306 @END
1309 /* UnLoad a registry branch from a file */
1310 @REQ(unload_registry)
1311 obj_handle_t hkey; /* root key to unload to */
1312 @END
1315 /* Save a registry branch to a file */
1316 @REQ(save_registry)
1317 obj_handle_t hkey; /* key to save */
1318 obj_handle_t file; /* file to save to */
1319 @END
1322 /* Load the user registry files */
1323 @REQ(load_user_registries)
1324 obj_handle_t hkey; /* key for HKCU */
1325 int saving; /* new saving level */
1326 int period; /* duration between periodic saves (milliseconds) */
1327 @END
1330 /* Add a registry key change notification */
1331 @REQ(set_registry_notification)
1332 obj_handle_t hkey; /* key to watch for changes */
1333 obj_handle_t event; /* event to set */
1334 int subtree; /* should we watch the whole subtree? */
1335 unsigned int filter; /* things to watch */
1336 @END
1339 /* Create a waitable timer */
1340 @REQ(create_timer)
1341 int inherit; /* inherit flag */
1342 int manual; /* manual reset */
1343 VARARG(name,unicode_str); /* object name */
1344 @REPLY
1345 obj_handle_t handle; /* handle to the timer */
1346 @END
1349 /* Open a waitable timer */
1350 @REQ(open_timer)
1351 unsigned int access; /* wanted access rights */
1352 int inherit; /* inherit flag */
1353 VARARG(name,unicode_str); /* object name */
1354 @REPLY
1355 obj_handle_t handle; /* handle to the timer */
1356 @END
1358 /* Set a waitable timer */
1359 @REQ(set_timer)
1360 obj_handle_t handle; /* handle to the timer */
1361 abs_time_t expire; /* next expiration absolute time */
1362 int period; /* timer period in ms */
1363 void* callback; /* callback function */
1364 void* arg; /* callback argument */
1365 @REPLY
1366 int signaled; /* was the timer signaled before this call ? */
1367 @END
1369 /* Cancel a waitable timer */
1370 @REQ(cancel_timer)
1371 obj_handle_t handle; /* handle to the timer */
1372 @REPLY
1373 int signaled; /* was the timer signaled before this calltime ? */
1374 @END
1377 /* Retrieve the current context of a thread */
1378 @REQ(get_thread_context)
1379 obj_handle_t handle; /* thread handle */
1380 unsigned int flags; /* context flags */
1381 @REPLY
1382 VARARG(context,context); /* thread context */
1383 @END
1386 /* Set the current context of a thread */
1387 @REQ(set_thread_context)
1388 obj_handle_t handle; /* thread handle */
1389 unsigned int flags; /* context flags */
1390 VARARG(context,context); /* thread context */
1391 @END
1394 /* Fetch a selector entry for a thread */
1395 @REQ(get_selector_entry)
1396 obj_handle_t handle; /* thread handle */
1397 int entry; /* LDT entry */
1398 @REPLY
1399 unsigned int base; /* selector base */
1400 unsigned int limit; /* selector limit */
1401 unsigned char flags; /* selector flags */
1402 @END
1405 /* Add an atom */
1406 @REQ(add_atom)
1407 int local; /* is atom in local process table? */
1408 VARARG(name,unicode_str); /* atom name */
1409 @REPLY
1410 atom_t atom; /* resulting atom */
1411 @END
1414 /* Delete an atom */
1415 @REQ(delete_atom)
1416 atom_t atom; /* atom handle */
1417 int local; /* is atom in local process table? */
1418 @END
1421 /* Find an atom */
1422 @REQ(find_atom)
1423 int local; /* is atom in local process table? */
1424 VARARG(name,unicode_str); /* atom name */
1425 @REPLY
1426 atom_t atom; /* atom handle */
1427 @END
1430 /* Get an atom name */
1431 @REQ(get_atom_name)
1432 atom_t atom; /* atom handle */
1433 int local; /* is atom in local process table? */
1434 @REPLY
1435 int count; /* atom lock count */
1436 VARARG(name,unicode_str); /* atom name */
1437 @END
1440 /* Init the process atom table */
1441 @REQ(init_atom_table)
1442 int entries; /* number of entries */
1443 @END
1446 /* Get the message queue of the current thread */
1447 @REQ(get_msg_queue)
1448 @REPLY
1449 obj_handle_t handle; /* handle to the queue */
1450 @END
1453 /* Set the current message queue wakeup mask */
1454 @REQ(set_queue_mask)
1455 unsigned int wake_mask; /* wakeup bits mask */
1456 unsigned int changed_mask; /* changed bits mask */
1457 int skip_wait; /* will we skip waiting if signaled? */
1458 @REPLY
1459 unsigned int wake_bits; /* current wake bits */
1460 unsigned int changed_bits; /* current changed bits */
1461 @END
1464 /* Get the current message queue status */
1465 @REQ(get_queue_status)
1466 int clear; /* should we clear the change bits? */
1467 @REPLY
1468 unsigned int wake_bits; /* wake bits */
1469 unsigned int changed_bits; /* changed bits since last time */
1470 @END
1473 /* Wait for a process to start waiting on input */
1474 @REQ(wait_input_idle)
1475 obj_handle_t handle; /* process handle */
1476 int timeout; /* timeout */
1477 @REPLY
1478 obj_handle_t event; /* handle to idle event */
1479 @END
1482 /* Send a message to a thread queue */
1483 @REQ(send_message)
1484 thread_id_t id; /* thread id */
1485 int type; /* message type (see below) */
1486 int flags; /* message flags (see below) */
1487 user_handle_t win; /* window handle */
1488 unsigned int msg; /* message code */
1489 unsigned int wparam; /* parameters */
1490 unsigned int lparam; /* parameters */
1491 int x; /* x position */
1492 int y; /* y position */
1493 unsigned int time; /* message time */
1494 unsigned int info; /* extra info */
1495 int timeout; /* timeout for reply */
1496 void* callback; /* callback address */
1497 VARARG(data,bytes); /* message data for sent messages */
1498 @END
1500 enum message_type
1502 MSG_ASCII, /* Ascii message (from SendMessageA) */
1503 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1504 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1505 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1506 MSG_CALLBACK_RESULT,/* result of a callback message */
1507 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1508 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1509 MSG_HARDWARE /* hardware message */
1511 #define SEND_MSG_ABORT_IF_HUNG 0x01
1514 /* Get a message from the current queue */
1515 @REQ(get_message)
1516 int flags; /* see below */
1517 user_handle_t get_win; /* window handle to get */
1518 unsigned int get_first; /* first message code to get */
1519 unsigned int get_last; /* last message code to get */
1520 @REPLY
1521 int type; /* message type */
1522 user_handle_t win; /* window handle */
1523 unsigned int msg; /* message code */
1524 unsigned int wparam; /* parameters (callback function for MSG_CALLBACK_RESULT) */
1525 unsigned int lparam; /* parameters (result for MSG_CALLBACK_RESULT) */
1526 int x; /* x position */
1527 int y; /* y position */
1528 unsigned int time; /* message time */
1529 unsigned int info; /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1530 size_t total; /* total size of extra data */
1531 VARARG(data,bytes); /* message data for sent messages */
1532 @END
1533 #define GET_MSG_REMOVE 1 /* remove the message */
1534 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1536 /* Reply to a sent message */
1537 @REQ(reply_message)
1538 int type; /* type of original message */
1539 unsigned int result; /* message result */
1540 int remove; /* should we remove the message? */
1541 VARARG(data,bytes); /* message data for sent messages */
1542 @END
1545 /* Retrieve the reply for the last message sent */
1546 @REQ(get_message_reply)
1547 int cancel; /* cancel message if not ready? */
1548 @REPLY
1549 unsigned int result; /* message result */
1550 VARARG(data,bytes); /* message data for sent messages */
1551 @END
1554 /* Set a window timer */
1555 @REQ(set_win_timer)
1556 user_handle_t win; /* window handle */
1557 unsigned int msg; /* message to post */
1558 unsigned int id; /* timer id */
1559 unsigned int rate; /* timer rate in ms */
1560 unsigned int lparam; /* message lparam (callback proc) */
1561 @END
1564 /* Kill a window timer */
1565 @REQ(kill_win_timer)
1566 user_handle_t win; /* window handle */
1567 unsigned int msg; /* message to post */
1568 unsigned int id; /* timer id */
1569 @END
1572 /* Retrieve info about a serial port */
1573 @REQ(get_serial_info)
1574 obj_handle_t handle; /* handle to comm port */
1575 @REPLY
1576 unsigned int readinterval;
1577 unsigned int readconst;
1578 unsigned int readmult;
1579 unsigned int writeconst;
1580 unsigned int writemult;
1581 unsigned int eventmask;
1582 unsigned int commerror;
1583 @END
1586 /* Set info about a serial port */
1587 @REQ(set_serial_info)
1588 obj_handle_t handle; /* handle to comm port */
1589 int flags; /* bitmask to set values (see below) */
1590 unsigned int readinterval;
1591 unsigned int readconst;
1592 unsigned int readmult;
1593 unsigned int writeconst;
1594 unsigned int writemult;
1595 unsigned int eventmask;
1596 unsigned int commerror;
1597 @END
1598 #define SERIALINFO_SET_TIMEOUTS 0x01
1599 #define SERIALINFO_SET_MASK 0x02
1600 #define SERIALINFO_SET_ERROR 0x04
1603 /* Create / reschedule an async I/O */
1604 @REQ(register_async)
1605 obj_handle_t handle; /* handle to comm port, socket or file */
1606 int type;
1607 void* overlapped;
1608 int count;
1609 unsigned int status;
1610 @END
1611 #define ASYNC_TYPE_NONE 0x00
1612 #define ASYNC_TYPE_READ 0x01
1613 #define ASYNC_TYPE_WRITE 0x02
1614 #define ASYNC_TYPE_WAIT 0x03
1617 /* Create a named pipe */
1618 @REQ(create_named_pipe)
1619 unsigned int openmode;
1620 unsigned int pipemode;
1621 unsigned int maxinstances;
1622 unsigned int outsize;
1623 unsigned int insize;
1624 unsigned int timeout;
1625 int inherit; /* inherit flag */
1626 VARARG(name,unicode_str); /* pipe name */
1627 @REPLY
1628 obj_handle_t handle; /* handle to the pipe */
1629 @END
1632 /* Open an existing named pipe */
1633 @REQ(open_named_pipe)
1634 unsigned int access;
1635 int inherit; /* inherit flag */
1636 VARARG(name,unicode_str); /* pipe name */
1637 @REPLY
1638 obj_handle_t handle; /* handle to the pipe */
1639 @END
1642 /* Connect to a named pipe */
1643 @REQ(connect_named_pipe)
1644 obj_handle_t handle;
1645 void* overlapped;
1646 void* func;
1647 @END
1650 /* Wait for a named pipe */
1651 @REQ(wait_named_pipe)
1652 unsigned int timeout;
1653 void* overlapped;
1654 void* func;
1655 VARARG(name,unicode_str); /* pipe name */
1656 @END
1659 /* Disconnect a named pipe */
1660 @REQ(disconnect_named_pipe)
1661 obj_handle_t handle;
1662 @REPLY
1663 int fd; /* associated fd to close */
1664 @END
1667 @REQ(get_named_pipe_info)
1668 obj_handle_t handle;
1669 @REPLY
1670 unsigned int flags;
1671 unsigned int maxinstances;
1672 unsigned int outsize;
1673 unsigned int insize;
1674 @END
1677 /* Create a window */
1678 @REQ(create_window)
1679 user_handle_t parent; /* parent window */
1680 user_handle_t owner; /* owner window */
1681 atom_t atom; /* class atom */
1682 void* instance; /* module instance */
1683 @REPLY
1684 user_handle_t handle; /* created window */
1685 int extra; /* number of extra bytes */
1686 void* class_ptr; /* pointer to class in client address space */
1687 @END
1690 /* Link a window into the tree */
1691 @REQ(link_window)
1692 user_handle_t handle; /* handle to the window */
1693 user_handle_t parent; /* handle to the parent */
1694 user_handle_t previous; /* previous child in Z-order */
1695 @REPLY
1696 user_handle_t full_parent; /* full handle of new parent */
1697 @END
1700 /* Destroy a window */
1701 @REQ(destroy_window)
1702 user_handle_t handle; /* handle to the window */
1703 @END
1706 /* Set a window owner */
1707 @REQ(set_window_owner)
1708 user_handle_t handle; /* handle to the window */
1709 user_handle_t owner; /* new owner */
1710 @REPLY
1711 user_handle_t full_owner; /* full handle of new owner */
1712 user_handle_t prev_owner; /* full handle of previous owner */
1713 @END
1716 /* Get information from a window handle */
1717 @REQ(get_window_info)
1718 user_handle_t handle; /* handle to the window */
1719 @REPLY
1720 user_handle_t full_handle; /* full 32-bit handle */
1721 user_handle_t last_active; /* last active popup */
1722 process_id_t pid; /* process owning the window */
1723 thread_id_t tid; /* thread owning the window */
1724 atom_t atom; /* class atom */
1725 @END
1728 /* Set some information in a window */
1729 @REQ(set_window_info)
1730 user_handle_t handle; /* handle to the window */
1731 unsigned int flags; /* flags for fields to set (see below) */
1732 unsigned int style; /* window style */
1733 unsigned int ex_style; /* window extended style */
1734 unsigned int id; /* window id */
1735 void* instance; /* creator instance */
1736 void* user_data; /* user-specific data */
1737 int extra_offset; /* offset to set in extra bytes */
1738 size_t extra_size; /* size to set in extra bytes */
1739 unsigned int extra_value; /* value to set in extra bytes */
1740 @REPLY
1741 unsigned int old_style; /* old window style */
1742 unsigned int old_ex_style; /* old window extended style */
1743 unsigned int old_id; /* old window id */
1744 void* old_instance; /* old creator instance */
1745 void* old_user_data; /* old user-specific data */
1746 unsigned int old_extra_value; /* old value in extra bytes */
1747 @END
1748 #define SET_WIN_STYLE 0x01
1749 #define SET_WIN_EXSTYLE 0x02
1750 #define SET_WIN_ID 0x04
1751 #define SET_WIN_INSTANCE 0x08
1752 #define SET_WIN_USERDATA 0x10
1753 #define SET_WIN_EXTRA 0x20
1756 /* Get a list of the window parents, up to the root of the tree */
1757 @REQ(get_window_parents)
1758 user_handle_t handle; /* handle to the window */
1759 @REPLY
1760 int count; /* total count of parents */
1761 VARARG(parents,user_handles); /* parent handles */
1762 @END
1765 /* Get a list of the window children */
1766 @REQ(get_window_children)
1767 user_handle_t parent; /* parent window */
1768 atom_t atom; /* class atom for the listed children */
1769 thread_id_t tid; /* thread owning the listed children */
1770 @REPLY
1771 int count; /* total count of children */
1772 VARARG(children,user_handles); /* children handles */
1773 @END
1776 /* Get window tree information from a window handle */
1777 @REQ(get_window_tree)
1778 user_handle_t handle; /* handle to the window */
1779 @REPLY
1780 user_handle_t parent; /* parent window */
1781 user_handle_t owner; /* owner window */
1782 user_handle_t next_sibling; /* next sibling in Z-order */
1783 user_handle_t prev_sibling; /* prev sibling in Z-order */
1784 user_handle_t first_sibling; /* first sibling in Z-order */
1785 user_handle_t last_sibling; /* last sibling in Z-order */
1786 user_handle_t first_child; /* first child */
1787 user_handle_t last_child; /* last child */
1788 @END
1790 /* Set the window and client rectangles of a window */
1791 @REQ(set_window_rectangles)
1792 user_handle_t handle; /* handle to the window */
1793 rectangle_t window; /* window rectangle */
1794 rectangle_t client; /* client rectangle */
1795 @END
1798 /* Get the window and client rectangles of a window */
1799 @REQ(get_window_rectangles)
1800 user_handle_t handle; /* handle to the window */
1801 @REPLY
1802 rectangle_t window; /* window rectangle */
1803 rectangle_t client; /* client rectangle */
1804 @END
1807 /* Get the window text */
1808 @REQ(get_window_text)
1809 user_handle_t handle; /* handle to the window */
1810 @REPLY
1811 VARARG(text,unicode_str); /* window text */
1812 @END
1815 /* Set the window text */
1816 @REQ(set_window_text)
1817 user_handle_t handle; /* handle to the window */
1818 VARARG(text,unicode_str); /* window text */
1819 @END
1822 /* Increment the window paint count */
1823 @REQ(inc_window_paint_count)
1824 user_handle_t handle; /* handle to the window */
1825 int incr; /* increment (can be negative) */
1826 @END
1829 /* Get the coordinates offset between two windows */
1830 @REQ(get_windows_offset)
1831 user_handle_t from; /* handle to the first window */
1832 user_handle_t to; /* handle to the second window */
1833 @REPLY
1834 int x; /* x coordinate offset */
1835 int y; /* y coordinate offset */
1836 @END
1839 /* Set a window property */
1840 @REQ(set_window_property)
1841 user_handle_t window; /* handle to the window */
1842 atom_t atom; /* property atom (high-word set if it was a string) */
1843 int string; /* was atom a string originally? */
1844 obj_handle_t handle; /* handle to store */
1845 @END
1848 /* Remove a window property */
1849 @REQ(remove_window_property)
1850 user_handle_t window; /* handle to the window */
1851 atom_t atom; /* property atom */
1852 @REPLY
1853 obj_handle_t handle; /* handle stored in property */
1854 @END
1857 /* Get a window property */
1858 @REQ(get_window_property)
1859 user_handle_t window; /* handle to the window */
1860 atom_t atom; /* property atom */
1861 @REPLY
1862 obj_handle_t handle; /* handle stored in property */
1863 @END
1866 /* Get the list of properties of a window */
1867 @REQ(get_window_properties)
1868 user_handle_t window; /* handle to the window */
1869 @REPLY
1870 int total; /* total number of properties */
1871 VARARG(props,properties); /* list of properties */
1872 @END
1875 /* Attach (or detach) thread inputs */
1876 @REQ(attach_thread_input)
1877 thread_id_t tid_from; /* thread to be attached */
1878 thread_id_t tid_to; /* thread to which tid_from should be attached */
1879 int attach; /* is it an attach? */
1880 @END
1883 /* Get input data for a given thread */
1884 @REQ(get_thread_input)
1885 thread_id_t tid; /* id of thread */
1886 @REPLY
1887 user_handle_t focus; /* handle to the focus window */
1888 user_handle_t capture; /* handle to the capture window */
1889 user_handle_t active; /* handle to the active window */
1890 user_handle_t foreground; /* handle to the global foreground window */
1891 user_handle_t menu_owner; /* handle to the menu owner */
1892 user_handle_t move_size; /* handle to the moving/resizing window */
1893 user_handle_t caret; /* handle to the caret window */
1894 rectangle_t rect; /* caret rectangle */
1895 @END
1897 /* Retrieve queue keyboard state for a given thread */
1898 @REQ(get_key_state)
1899 thread_id_t tid; /* id of thread */
1900 int key; /* optional key code or -1 */
1901 @REPLY
1902 unsigned char state; /* state of specified key */
1903 VARARG(keystate,bytes); /* state array for all the keys */
1904 @END
1906 /* Set queue keyboard state for a given thread */
1907 @REQ(set_key_state)
1908 thread_id_t tid; /* id of thread */
1909 VARARG(keystate,bytes); /* state array for all the keys */
1910 @END
1912 /* Set the system foreground window */
1913 @REQ(set_foreground_window)
1914 user_handle_t handle; /* handle to the foreground window */
1915 @REPLY
1916 user_handle_t previous; /* handle to the previous foreground window */
1917 int send_msg_old; /* whether we have to send a msg to the old window */
1918 int send_msg_new; /* whether we have to send a msg to the new window */
1919 @END
1921 /* Set the current thread focus window */
1922 @REQ(set_focus_window)
1923 user_handle_t handle; /* handle to the focus window */
1924 @REPLY
1925 user_handle_t previous; /* handle to the previous focus window */
1926 @END
1928 /* Set the current thread active window */
1929 @REQ(set_active_window)
1930 user_handle_t handle; /* handle to the active window */
1931 @REPLY
1932 user_handle_t previous; /* handle to the previous active window */
1933 @END
1935 /* Set the current thread capture window */
1936 @REQ(set_capture_window)
1937 user_handle_t handle; /* handle to the capture window */
1938 unsigned int flags; /* capture flags (see below) */
1939 @REPLY
1940 user_handle_t previous; /* handle to the previous capture window */
1941 user_handle_t full_handle; /* full 32-bit handle of new capture window */
1942 @END
1943 #define CAPTURE_MENU 0x01 /* capture is for a menu */
1944 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
1947 /* Set the current thread caret window */
1948 @REQ(set_caret_window)
1949 user_handle_t handle; /* handle to the caret window */
1950 int width; /* caret width */
1951 int height; /* caret height */
1952 @REPLY
1953 user_handle_t previous; /* handle to the previous caret window */
1954 rectangle_t old_rect; /* previous caret rectangle */
1955 int old_hide; /* previous hide count */
1956 int old_state; /* previous caret state (1=on, 0=off) */
1957 @END
1960 /* Set the current thread caret information */
1961 @REQ(set_caret_info)
1962 unsigned int flags; /* caret flags (see below) */
1963 user_handle_t handle; /* handle to the caret window */
1964 int x; /* caret x position */
1965 int y; /* caret y position */
1966 int hide; /* increment for hide count (can be negative to show it) */
1967 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
1968 @REPLY
1969 user_handle_t full_handle; /* handle to the current caret window */
1970 rectangle_t old_rect; /* previous caret rectangle */
1971 int old_hide; /* previous hide count */
1972 int old_state; /* previous caret state (1=on, 0=off) */
1973 @END
1974 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
1975 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
1976 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
1979 /* Set a window hook */
1980 @REQ(set_hook)
1981 int id; /* id of the hook */
1982 thread_id_t tid; /* id of thread to set the hook into */
1983 void* proc; /* hook procedure */
1984 int unicode; /* is it a unicode hook? */
1985 VARARG(module,unicode_str); /* module name */
1986 @REPLY
1987 user_handle_t handle; /* handle to the hook */
1988 @END
1991 /* Remove a window hook */
1992 @REQ(remove_hook)
1993 user_handle_t handle; /* handle to the hook */
1994 int id; /* id of the hook if handle is 0 */
1995 void* proc; /* hook procedure if handle is 0 */
1996 @END
1999 /* Start calling a hook chain */
2000 @REQ(start_hook_chain)
2001 int id; /* id of the hook */
2002 @REPLY
2003 user_handle_t handle; /* handle to the next hook */
2004 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2005 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2006 void* proc; /* hook procedure */
2007 int unicode; /* is it a unicode hook? */
2008 VARARG(module,unicode_str); /* module name */
2009 @END
2012 /* Finished calling a hook chain */
2013 @REQ(finish_hook_chain)
2014 int id; /* id of the hook */
2015 @END
2018 /* Get the next hook to call */
2019 @REQ(get_next_hook)
2020 user_handle_t handle; /* handle to the current hook */
2021 @REPLY
2022 user_handle_t next; /* handle to the next hook */
2023 int id; /* id of the next hook */
2024 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2025 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2026 void* proc; /* next hook procedure */
2027 int prev_unicode; /* was the previous a unicode hook? */
2028 int next_unicode; /* is the next a unicode hook? */
2029 VARARG(module,unicode_str); /* module name */
2030 @END
2033 /* Create a window class */
2034 @REQ(create_class)
2035 int local; /* is it a local class? */
2036 atom_t atom; /* class atom */
2037 unsigned int style; /* class style */
2038 void* instance; /* module instance */
2039 int extra; /* number of extra class bytes */
2040 int win_extra; /* number of window extra bytes */
2041 void* client_ptr; /* pointer to class in client address space */
2042 @END
2045 /* Destroy a window class */
2046 @REQ(destroy_class)
2047 atom_t atom; /* class atom */
2048 void* instance; /* module instance */
2049 @REPLY
2050 void* client_ptr; /* pointer to class in client address space */
2051 @END
2054 /* Set some information in a class */
2055 @REQ(set_class_info)
2056 user_handle_t window; /* handle to the window */
2057 unsigned int flags; /* flags for info to set (see below) */
2058 atom_t atom; /* class atom */
2059 unsigned int style; /* class style */
2060 int win_extra; /* number of window extra bytes */
2061 void* instance; /* module instance */
2062 int extra_offset; /* offset to set in extra bytes */
2063 size_t extra_size; /* size to set in extra bytes */
2064 unsigned int extra_value; /* value to set in extra bytes */
2065 @REPLY
2066 atom_t old_atom; /* previous class atom */
2067 unsigned int old_style; /* previous class style */
2068 int old_extra; /* previous number of class extra bytes */
2069 int old_win_extra; /* previous number of window extra bytes */
2070 void* old_instance; /* previous module instance */
2071 unsigned int old_extra_value; /* old value in extra bytes */
2072 @END
2073 #define SET_CLASS_ATOM 0x0001
2074 #define SET_CLASS_STYLE 0x0002
2075 #define SET_CLASS_WINEXTRA 0x0004
2076 #define SET_CLASS_INSTANCE 0x0008
2077 #define SET_CLASS_EXTRA 0x0010
2080 /* Set/get clipboard information */
2081 @REQ(set_clipboard_info)
2082 unsigned int flags; /* flags for fields to set (see below) */
2083 user_handle_t clipboard; /* clipboard window */
2084 user_handle_t owner; /* clipboard owner */
2085 user_handle_t viewer; /* first clipboard viewer */
2086 unsigned int seqno; /* change sequence number */
2087 @REPLY
2088 unsigned int flags; /* status flags (see below) */
2089 user_handle_t old_clipboard; /* old clipboard window */
2090 user_handle_t old_owner; /* old clipboard owner */
2091 user_handle_t old_viewer; /* old clipboard viewer */
2092 unsigned int seqno; /* current sequence number */
2093 @END
2095 #define SET_CB_OPEN 0x001
2096 #define SET_CB_OWNER 0x002
2097 #define SET_CB_VIEWER 0x004
2098 #define SET_CB_SEQNO 0x008
2099 #define SET_CB_RELOWNER 0x010
2100 #define SET_CB_CLOSE 0x020
2101 #define CB_OPEN 0x040
2102 #define CB_OWNER 0x080
2105 /* Open a security token */
2106 @REQ(open_token)
2107 obj_handle_t handle; /* handle to the thread or process */
2108 unsigned int flags; /* flags (see below) */
2109 @REPLY
2110 obj_handle_t token; /* handle to the token */
2111 @END
2112 #define OPEN_TOKEN_THREAD 1
2113 #define OPEN_TOKEN_AS_SELF 2
2116 /* Set/get the global windows */
2117 @REQ(set_global_windows)
2118 unsigned int flags; /* flags for fields to set (see below) */
2119 user_handle_t shell_window; /* handle to the new shell window */
2120 user_handle_t shell_listview; /* handle to the new shell listview window */
2121 user_handle_t progman_window; /* handle to the new program manager window */
2122 user_handle_t taskman_window; /* handle to the new task manager window */
2123 @REPLY
2124 user_handle_t old_shell_window; /* handle to the shell window */
2125 user_handle_t old_shell_listview; /* handle to the shell listview window */
2126 user_handle_t old_progman_window; /* handle to the new program manager window */
2127 user_handle_t old_taskman_window; /* handle to the new task manager window */
2128 @END
2129 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2130 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2131 #define SET_GLOBAL_TASKMAN_WINDOW 0x04