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