- fix a couple tests and traces
[wine/dcerpc.git] / server / protocol.def
blob5d0f732a95578ba6d6c819796d5b8cbd15cda30b
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 int removable; /* is file on removable media? */
581 VARARG(filename,string); /* file name */
582 @REPLY
583 obj_handle_t handle; /* handle to the file */
584 @END
587 /* Allocate a file handle for a Unix fd */
588 @REQ(alloc_file_handle)
589 unsigned int access; /* wanted access rights */
590 int inherit; /* inherit flag */
591 int fd; /* file descriptor on the client side */
592 @REPLY
593 obj_handle_t handle; /* handle to the file */
594 @END
597 /* Get a Unix fd to access a file */
598 @REQ(get_handle_fd)
599 obj_handle_t handle; /* handle to the file */
600 unsigned int access; /* wanted access rights */
601 @REPLY
602 int fd; /* file descriptor */
603 int type; /* the type of file (see below) */
604 int flags; /* file read/write flags (see below) */
605 @END
606 enum fd_type
608 FD_TYPE_INVALID,
609 FD_TYPE_DEFAULT,
610 FD_TYPE_SOCKET,
611 FD_TYPE_SMB
613 #define FD_FLAG_OVERLAPPED 0x01
614 #define FD_FLAG_TIMEOUT 0x02
615 #define FD_FLAG_RECV_SHUTDOWN 0x04
616 #define FD_FLAG_SEND_SHUTDOWN 0x08
618 /* Set a file current position */
619 @REQ(set_file_pointer)
620 obj_handle_t handle; /* handle to the file */
621 int low; /* position low word */
622 int high; /* position high word */
623 int whence; /* whence to seek */
624 @REPLY
625 int new_low; /* new position low word */
626 int new_high; /* new position high word */
627 @END
630 /* Truncate (or extend) a file */
631 @REQ(truncate_file)
632 obj_handle_t handle; /* handle to the file */
633 @END
636 /* Flush a file buffers */
637 @REQ(flush_file)
638 obj_handle_t handle; /* handle to the file */
639 @REPLY
640 obj_handle_t event; /* event set when finished */
641 @END
644 /* Get information about a file */
645 @REQ(get_file_info)
646 obj_handle_t handle; /* handle to the file */
647 @REPLY
648 int type; /* file type */
649 int attr; /* file attributes */
650 time_t access_time; /* last access time */
651 time_t write_time; /* last write time */
652 time_t change_time; /* last change time */
653 int size_high; /* file size */
654 int size_low; /* file size */
655 int alloc_high; /* size used on disk */
656 int alloc_low; /* size used on disk */
657 int links; /* number of links */
658 int index_high; /* unique index */
659 int index_low; /* unique index */
660 unsigned int serial; /* volume serial number */
661 @END
664 /* Lock a region of a file */
665 @REQ(lock_file)
666 obj_handle_t handle; /* handle to the file */
667 unsigned int offset_low; /* offset of start of lock */
668 unsigned int offset_high; /* offset of start of lock */
669 unsigned int count_low; /* count of bytes to lock */
670 unsigned int count_high; /* count of bytes to lock */
671 int shared; /* shared or exclusive lock? */
672 int wait; /* do we want to wait? */
673 @REPLY
674 obj_handle_t handle; /* handle to wait on */
675 int overlapped; /* is it an overlapped I/O handle? */
676 @END
679 /* Unlock a region of a file */
680 @REQ(unlock_file)
681 obj_handle_t handle; /* handle to the file */
682 unsigned int offset_low; /* offset of start of unlock */
683 unsigned int offset_high; /* offset of start of unlock */
684 unsigned int count_low; /* count of bytes to unlock */
685 unsigned int count_high; /* count of bytes to unlock */
686 @END
689 /* Create a socket */
690 @REQ(create_socket)
691 unsigned int access; /* wanted access rights */
692 int inherit; /* inherit flag */
693 int family; /* family, see socket manpage */
694 int type; /* type, see socket manpage */
695 int protocol; /* protocol, see socket manpage */
696 unsigned int flags; /* socket flags */
697 @REPLY
698 obj_handle_t handle; /* handle to the new socket */
699 @END
702 /* Accept a socket */
703 @REQ(accept_socket)
704 obj_handle_t lhandle; /* handle to the listening socket */
705 unsigned int access; /* wanted access rights */
706 int inherit; /* inherit flag */
707 @REPLY
708 obj_handle_t handle; /* handle to the new socket */
709 @END
712 /* Set socket event parameters */
713 @REQ(set_socket_event)
714 obj_handle_t handle; /* handle to the socket */
715 unsigned int mask; /* event mask */
716 obj_handle_t event; /* event object */
717 user_handle_t window; /* window to send the message to */
718 unsigned int msg; /* message to send */
719 @END
722 /* Get socket event parameters */
723 @REQ(get_socket_event)
724 obj_handle_t handle; /* handle to the socket */
725 int service; /* clear pending? */
726 obj_handle_t c_event; /* event to clear */
727 @REPLY
728 unsigned int mask; /* event mask */
729 unsigned int pmask; /* pending events */
730 unsigned int state; /* status bits */
731 VARARG(errors,ints); /* event errors */
732 @END
735 /* Reenable pending socket events */
736 @REQ(enable_socket_event)
737 obj_handle_t handle; /* handle to the socket */
738 unsigned int mask; /* events to re-enable */
739 unsigned int sstate; /* status bits to set */
740 unsigned int cstate; /* status bits to clear */
741 @END
743 @REQ(set_socket_deferred)
744 obj_handle_t handle; /* handle to the socket */
745 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
746 @END
748 /* Allocate a console (only used by a console renderer) */
749 @REQ(alloc_console)
750 unsigned int access; /* wanted access rights */
751 int inherit; /* inherit flag */
752 process_id_t pid; /* pid of process which shall be attached to the console */
753 @REPLY
754 obj_handle_t handle_in; /* handle to console input */
755 obj_handle_t event; /* handle to renderer events change notification */
756 @END
759 /* Free the console of the current process */
760 @REQ(free_console)
761 @END
764 #define CONSOLE_RENDERER_NONE_EVENT 0x00
765 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
766 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
767 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
768 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
769 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
770 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
771 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
772 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
773 struct console_renderer_event
775 short event;
776 union
778 struct update
780 short top;
781 short bottom;
782 } update;
783 struct resize
785 short width;
786 short height;
787 } resize;
788 struct cursor_pos
790 short x;
791 short y;
792 } cursor_pos;
793 struct cursor_geom
795 short visible;
796 short size;
797 } cursor_geom;
798 struct display
800 short left;
801 short top;
802 short width;
803 short height;
804 } display;
805 } u;
808 /* retrieve console events for the renderer */
809 @REQ(get_console_renderer_events)
810 obj_handle_t handle; /* handle to console input events */
811 @REPLY
812 VARARG(data,bytes); /* the various console_renderer_events */
813 @END
816 /* Open a handle to the process console */
817 @REQ(open_console)
818 int from; /* 0 (resp 1) input (resp output) of current process console */
819 /* otherwise console_in handle to get active screen buffer? */
820 unsigned int access; /* wanted access rights */
821 int inherit; /* inherit flag */
822 int share; /* share mask (only for output handles) */
823 @REPLY
824 obj_handle_t handle; /* handle to the console */
825 @END
828 /* Get the input queue wait event */
829 @REQ(get_console_wait_event)
830 @REPLY
831 obj_handle_t handle;
832 @END
834 /* Get a console mode (input or output) */
835 @REQ(get_console_mode)
836 obj_handle_t handle; /* handle to the console */
837 @REPLY
838 int mode; /* console mode */
839 @END
842 /* Set a console mode (input or output) */
843 @REQ(set_console_mode)
844 obj_handle_t handle; /* handle to the console */
845 int mode; /* console mode */
846 @END
849 /* Set info about a console (input only) */
850 @REQ(set_console_input_info)
851 obj_handle_t handle; /* handle to console input, or 0 for process' console */
852 int mask; /* setting mask (see below) */
853 obj_handle_t active_sb; /* active screen buffer */
854 int history_mode; /* whether we duplicate lines in history */
855 int history_size; /* number of lines in history */
856 int edition_mode; /* index to the edition mode flavors */
857 VARARG(title,unicode_str); /* console title */
858 @END
859 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
860 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
861 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
862 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
863 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
866 /* Get info about a console (input only) */
867 @REQ(get_console_input_info)
868 obj_handle_t handle; /* handle to console input, or 0 for process' console */
869 @REPLY
870 int history_mode; /* whether we duplicate lines in history */
871 int history_size; /* number of lines in history */
872 int history_index; /* number of used lines in history */
873 int edition_mode; /* index to the edition mode flavors */
874 VARARG(title,unicode_str); /* console title */
875 @END
878 /* appends a string to console's history */
879 @REQ(append_console_input_history)
880 obj_handle_t handle; /* handle to console input, or 0 for process' console */
881 VARARG(line,unicode_str); /* line to add */
882 @END
885 /* appends a string to console's history */
886 @REQ(get_console_input_history)
887 obj_handle_t handle; /* handle to console input, or 0 for process' console */
888 int index; /* index to get line from */
889 @REPLY
890 int total; /* total length of line in Unicode chars */
891 VARARG(line,unicode_str); /* line to add */
892 @END
895 /* creates a new screen buffer on process' console */
896 @REQ(create_console_output)
897 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
898 int access; /* wanted access rights */
899 int share; /* sharing credentials */
900 int inherit; /* inherit flag */
901 @REPLY
902 obj_handle_t handle_out; /* handle to the screen buffer */
903 @END
906 /* Set info about a console (output only) */
907 @REQ(set_console_output_info)
908 obj_handle_t handle; /* handle to the console */
909 int mask; /* setting mask (see below) */
910 short int cursor_size; /* size of cursor (percentage filled) */
911 short int cursor_visible;/* cursor visibility flag */
912 short int cursor_x; /* position of cursor (x, y) */
913 short int cursor_y;
914 short int width; /* width of the screen buffer */
915 short int height; /* height of the screen buffer */
916 short int attr; /* default attribute */
917 short int win_left; /* window actually displayed by renderer */
918 short int win_top; /* the rect area is expressed withing the */
919 short int win_right; /* boundaries of the screen buffer */
920 short int win_bottom;
921 short int max_width; /* maximum size (width x height) for the window */
922 short int max_height;
923 @END
924 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
925 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
926 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
927 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
928 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
929 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
932 /* Get info about a console (output only) */
933 @REQ(get_console_output_info)
934 obj_handle_t handle; /* handle to the console */
935 @REPLY
936 short int cursor_size; /* size of cursor (percentage filled) */
937 short int cursor_visible;/* cursor visibility flag */
938 short int cursor_x; /* position of cursor (x, y) */
939 short int cursor_y;
940 short int width; /* width of the screen buffer */
941 short int height; /* height of the screen buffer */
942 short int attr; /* default attribute */
943 short int win_left; /* window actually displayed by renderer */
944 short int win_top; /* the rect area is expressed withing the */
945 short int win_right; /* boundaries of the screen buffer */
946 short int win_bottom;
947 short int max_width; /* maximum size (width x height) for the window */
948 short int max_height;
949 @END
951 /* Add input records to a console input queue */
952 @REQ(write_console_input)
953 obj_handle_t handle; /* handle to the console input */
954 VARARG(rec,input_records); /* input records */
955 @REPLY
956 int written; /* number of records written */
957 @END
960 /* Fetch input records from a console input queue */
961 @REQ(read_console_input)
962 obj_handle_t handle; /* handle to the console input */
963 int flush; /* flush the retrieved records from the queue? */
964 @REPLY
965 int read; /* number of records read */
966 VARARG(rec,input_records); /* input records */
967 @END
970 /* write data (chars and/or attributes) in a screen buffer */
971 @REQ(write_console_output)
972 obj_handle_t handle; /* handle to the console output */
973 int x; /* position where to start writing */
974 int y;
975 int mode; /* char info (see below) */
976 int wrap; /* wrap around at end of line? */
977 VARARG(data,bytes); /* info to write */
978 @REPLY
979 int written; /* number of char infos actually written */
980 int width; /* width of screen buffer */
981 int height; /* height of screen buffer */
982 @END
983 enum char_info_mode
985 CHAR_INFO_MODE_TEXT, /* characters only */
986 CHAR_INFO_MODE_ATTR, /* attributes only */
987 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
988 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
992 /* fill a screen buffer with constant data (chars and/or attributes) */
993 @REQ(fill_console_output)
994 obj_handle_t handle; /* handle to the console output */
995 int x; /* position where to start writing */
996 int y;
997 int mode; /* char info mode */
998 int count; /* number to write */
999 int wrap; /* wrap around at end of line? */
1000 char_info_t data; /* data to write */
1001 @REPLY
1002 int written; /* number of char infos actually written */
1003 @END
1006 /* read data (chars and/or attributes) from a screen buffer */
1007 @REQ(read_console_output)
1008 obj_handle_t handle; /* handle to the console output */
1009 int x; /* position (x,y) where to start reading */
1010 int y;
1011 int mode; /* char info mode */
1012 int wrap; /* wrap around at end of line? */
1013 @REPLY
1014 int width; /* width of screen buffer */
1015 int height; /* height of screen buffer */
1016 VARARG(data,bytes);
1017 @END
1020 /* move a rect (of data) in screen buffer content */
1021 @REQ(move_console_output)
1022 obj_handle_t handle; /* handle to the console output */
1023 short int x_src; /* position (x, y) of rect to start moving from */
1024 short int y_src;
1025 short int x_dst; /* position (x, y) of rect to move to */
1026 short int y_dst;
1027 short int w; /* size of the rect (width, height) to move */
1028 short int h;
1029 @END
1032 /* Sends a signal to a process group */
1033 @REQ(send_console_signal)
1034 int signal; /* the signal to send */
1035 process_id_t group_id; /* the group to send the signal to */
1036 @END
1039 /* Create a change notification */
1040 @REQ(create_change_notification)
1041 obj_handle_t handle; /* handle to the directory */
1042 int subtree; /* watch all the subtree */
1043 unsigned int filter; /* notification filter */
1044 @REPLY
1045 obj_handle_t handle; /* handle to the change notification */
1046 @END
1049 /* Move to the next change notification */
1050 @REQ(next_change_notification)
1051 obj_handle_t handle; /* handle to the change notification */
1052 @END
1054 /* Create a file mapping */
1055 @REQ(create_mapping)
1056 int size_high; /* mapping size */
1057 int size_low; /* mapping size */
1058 int protect; /* protection flags (see below) */
1059 unsigned int access; /* wanted access rights */
1060 int inherit; /* inherit flag */
1061 obj_handle_t file_handle; /* file handle */
1062 VARARG(name,unicode_str); /* object name */
1063 @REPLY
1064 obj_handle_t handle; /* handle to the mapping */
1065 @END
1066 /* protection flags */
1067 #define VPROT_READ 0x01
1068 #define VPROT_WRITE 0x02
1069 #define VPROT_EXEC 0x04
1070 #define VPROT_WRITECOPY 0x08
1071 #define VPROT_GUARD 0x10
1072 #define VPROT_NOCACHE 0x20
1073 #define VPROT_COMMITTED 0x40
1074 #define VPROT_IMAGE 0x80
1077 /* Open a mapping */
1078 @REQ(open_mapping)
1079 unsigned int access; /* wanted access rights */
1080 int inherit; /* inherit flag */
1081 VARARG(name,unicode_str); /* object name */
1082 @REPLY
1083 obj_handle_t handle; /* handle to the mapping */
1084 @END
1087 /* Get information about a file mapping */
1088 @REQ(get_mapping_info)
1089 obj_handle_t handle; /* handle to the mapping */
1090 @REPLY
1091 int size_high; /* mapping size */
1092 int size_low; /* mapping size */
1093 int protect; /* protection flags */
1094 int header_size; /* header size (for VPROT_IMAGE mapping) */
1095 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1096 obj_handle_t shared_file; /* shared mapping file handle */
1097 int shared_size; /* shared mapping size */
1098 int removable; /* is file on removable media? */
1099 @END
1102 #define SNAP_HEAPLIST 0x00000001
1103 #define SNAP_PROCESS 0x00000002
1104 #define SNAP_THREAD 0x00000004
1105 #define SNAP_MODULE 0x00000008
1106 /* Create a snapshot */
1107 @REQ(create_snapshot)
1108 int inherit; /* inherit flag */
1109 int flags; /* snapshot flags (SNAP_*) */
1110 process_id_t pid; /* process id */
1111 @REPLY
1112 obj_handle_t handle; /* handle to the snapshot */
1113 @END
1116 /* Get the next process from a snapshot */
1117 @REQ(next_process)
1118 obj_handle_t handle; /* handle to the snapshot */
1119 int reset; /* reset snapshot position? */
1120 @REPLY
1121 int count; /* process usage count */
1122 process_id_t pid; /* process id */
1123 process_id_t ppid; /* parent process id */
1124 void* heap; /* heap base */
1125 void* module; /* main module */
1126 int threads; /* number of threads */
1127 int priority; /* process priority */
1128 int handles; /* number of handles */
1129 VARARG(filename,unicode_str); /* file name of main exe */
1130 @END
1133 /* Get the next thread from a snapshot */
1134 @REQ(next_thread)
1135 obj_handle_t handle; /* handle to the snapshot */
1136 int reset; /* reset snapshot position? */
1137 @REPLY
1138 int count; /* thread usage count */
1139 process_id_t pid; /* process id */
1140 thread_id_t tid; /* thread id */
1141 int base_pri; /* base priority */
1142 int delta_pri; /* delta priority */
1143 @END
1146 /* Get the next module from a snapshot */
1147 @REQ(next_module)
1148 obj_handle_t handle; /* handle to the snapshot */
1149 int reset; /* reset snapshot position? */
1150 @REPLY
1151 process_id_t pid; /* process id */
1152 void* base; /* module base address */
1153 size_t size; /* module size */
1154 VARARG(filename,unicode_str); /* file name of module */
1155 @END
1158 /* Wait for a debug event */
1159 @REQ(wait_debug_event)
1160 int get_handle; /* should we alloc a handle for waiting? */
1161 @REPLY
1162 process_id_t pid; /* process id */
1163 thread_id_t tid; /* thread id */
1164 obj_handle_t wait; /* wait handle if no event ready */
1165 VARARG(event,debug_event); /* debug event data */
1166 @END
1169 /* Queue an exception event */
1170 @REQ(queue_exception_event)
1171 int first; /* first chance exception? */
1172 VARARG(record,exc_event); /* thread context followed by exception record */
1173 @REPLY
1174 obj_handle_t handle; /* handle to the queued event */
1175 @END
1178 /* Retrieve the status of an exception event */
1179 @REQ(get_exception_status)
1180 obj_handle_t handle; /* handle to the queued event */
1181 @REPLY
1182 int status; /* event continuation status */
1183 VARARG(context,context); /* modified thread context */
1184 @END
1187 /* Send an output string to the debugger */
1188 @REQ(output_debug_string)
1189 void* string; /* string to display (in debugged process address space) */
1190 int unicode; /* is it Unicode? */
1191 int length; /* string length */
1192 @END
1195 /* Continue a debug event */
1196 @REQ(continue_debug_event)
1197 process_id_t pid; /* process id to continue */
1198 thread_id_t tid; /* thread id to continue */
1199 int status; /* continuation status */
1200 @END
1203 /* Start/stop debugging an existing process */
1204 @REQ(debug_process)
1205 process_id_t pid; /* id of the process to debug */
1206 int attach; /* 1=attaching / 0=detaching from the process */
1207 @END
1210 /* Simulate a breakpoint in a process */
1211 @REQ(debug_break)
1212 obj_handle_t handle; /* process handle */
1213 @REPLY
1214 int self; /* was it the caller itself? */
1215 @END
1218 /* Set debugger kill on exit flag */
1219 @REQ(set_debugger_kill_on_exit)
1220 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1221 @END
1224 /* Read data from a process address space */
1225 @REQ(read_process_memory)
1226 obj_handle_t handle; /* process handle */
1227 void* addr; /* addr to read from */
1228 @REPLY
1229 VARARG(data,bytes); /* result data */
1230 @END
1233 /* Write data to a process address space */
1234 @REQ(write_process_memory)
1235 obj_handle_t handle; /* process handle */
1236 void* addr; /* addr to write to (must be int-aligned) */
1237 unsigned int first_mask; /* mask for first word */
1238 unsigned int last_mask; /* mask for last word */
1239 VARARG(data,bytes); /* data to write */
1240 @END
1243 /* Create a registry key */
1244 @REQ(create_key)
1245 obj_handle_t parent; /* handle to the parent key */
1246 unsigned int access; /* desired access rights */
1247 unsigned int options; /* creation options */
1248 time_t modif; /* last modification time */
1249 size_t namelen; /* length of key name in bytes */
1250 VARARG(name,unicode_str,namelen); /* key name */
1251 VARARG(class,unicode_str); /* class name */
1252 @REPLY
1253 obj_handle_t hkey; /* handle to the created key */
1254 int created; /* has it been newly created? */
1255 @END
1257 /* Open a registry key */
1258 @REQ(open_key)
1259 obj_handle_t parent; /* handle to the parent key */
1260 unsigned int access; /* desired access rights */
1261 VARARG(name,unicode_str); /* key name */
1262 @REPLY
1263 obj_handle_t hkey; /* handle to the open key */
1264 @END
1267 /* Delete a registry key */
1268 @REQ(delete_key)
1269 obj_handle_t hkey; /* handle to the key */
1270 @END
1273 /* Flush a registry key */
1274 @REQ(flush_key)
1275 obj_handle_t hkey; /* handle to the key */
1276 @END
1279 /* Enumerate registry subkeys */
1280 @REQ(enum_key)
1281 obj_handle_t hkey; /* handle to registry key */
1282 int index; /* index of subkey (or -1 for current key) */
1283 int info_class; /* requested information class */
1284 @REPLY
1285 int subkeys; /* number of subkeys */
1286 int max_subkey; /* longest subkey name */
1287 int max_class; /* longest class name */
1288 int values; /* number of values */
1289 int max_value; /* longest value name */
1290 int max_data; /* longest value data */
1291 time_t modif; /* last modification time */
1292 size_t total; /* total length needed for full name and class */
1293 size_t namelen; /* length of key name in bytes */
1294 VARARG(name,unicode_str,namelen); /* key name */
1295 VARARG(class,unicode_str); /* class name */
1296 @END
1299 /* Set a value of a registry key */
1300 @REQ(set_key_value)
1301 obj_handle_t hkey; /* handle to registry key */
1302 int type; /* value type */
1303 size_t namelen; /* length of value name in bytes */
1304 VARARG(name,unicode_str,namelen); /* value name */
1305 VARARG(data,bytes); /* value data */
1306 @END
1309 /* Retrieve the value of a registry key */
1310 @REQ(get_key_value)
1311 obj_handle_t hkey; /* handle to registry key */
1312 VARARG(name,unicode_str); /* value name */
1313 @REPLY
1314 int type; /* value type */
1315 size_t total; /* total length needed for data */
1316 VARARG(data,bytes); /* value data */
1317 @END
1320 /* Enumerate a value of a registry key */
1321 @REQ(enum_key_value)
1322 obj_handle_t hkey; /* handle to registry key */
1323 int index; /* value index */
1324 int info_class; /* requested information class */
1325 @REPLY
1326 int type; /* value type */
1327 size_t total; /* total length needed for full name and data */
1328 size_t namelen; /* length of value name in bytes */
1329 VARARG(name,unicode_str,namelen); /* value name */
1330 VARARG(data,bytes); /* value data */
1331 @END
1334 /* Delete a value of a registry key */
1335 @REQ(delete_key_value)
1336 obj_handle_t hkey; /* handle to registry key */
1337 VARARG(name,unicode_str); /* value name */
1338 @END
1341 /* Load a registry branch from a file */
1342 @REQ(load_registry)
1343 obj_handle_t hkey; /* root key to load to */
1344 obj_handle_t file; /* file to load from */
1345 VARARG(name,unicode_str); /* subkey name */
1346 @END
1349 /* UnLoad a registry branch from a file */
1350 @REQ(unload_registry)
1351 obj_handle_t hkey; /* root key to unload to */
1352 @END
1355 /* Save a registry branch to a file */
1356 @REQ(save_registry)
1357 obj_handle_t hkey; /* key to save */
1358 obj_handle_t file; /* file to save to */
1359 @END
1362 /* Save a registry branch at server exit */
1363 @REQ(save_registry_atexit)
1364 obj_handle_t hkey; /* key to save */
1365 VARARG(file,string); /* file to save to */
1366 @END
1369 /* Set the current and saving level for the registry */
1370 @REQ(set_registry_levels)
1371 int current; /* new current level */
1372 int saving; /* new saving level */
1373 int period; /* duration between periodic saves (milliseconds) */
1374 @END
1377 @REQ(set_registry_notification)
1378 obj_handle_t hkey; /* key to watch for changes */
1379 obj_handle_t event; /* event to set */
1380 int subtree; /* should we watch the whole subtree? */
1381 unsigned int filter; /* things to watch */
1382 @END
1385 /* Create a waitable timer */
1386 @REQ(create_timer)
1387 int inherit; /* inherit flag */
1388 int manual; /* manual reset */
1389 VARARG(name,unicode_str); /* object name */
1390 @REPLY
1391 obj_handle_t handle; /* handle to the timer */
1392 @END
1395 /* Open a waitable timer */
1396 @REQ(open_timer)
1397 unsigned int access; /* wanted access rights */
1398 int inherit; /* inherit flag */
1399 VARARG(name,unicode_str); /* object name */
1400 @REPLY
1401 obj_handle_t handle; /* handle to the timer */
1402 @END
1404 /* Set a waitable timer */
1405 @REQ(set_timer)
1406 obj_handle_t handle; /* handle to the timer */
1407 abs_time_t expire; /* next expiration absolute time */
1408 int period; /* timer period in ms */
1409 void* callback; /* callback function */
1410 void* arg; /* callback argument */
1411 @REPLY
1412 int signaled; /* was the timer signaled before this call ? */
1413 @END
1415 /* Cancel a waitable timer */
1416 @REQ(cancel_timer)
1417 obj_handle_t handle; /* handle to the timer */
1418 @REPLY
1419 int signaled; /* was the timer signaled before this calltime ? */
1420 @END
1423 /* Retrieve the current context of a thread */
1424 @REQ(get_thread_context)
1425 obj_handle_t handle; /* thread handle */
1426 unsigned int flags; /* context flags */
1427 @REPLY
1428 VARARG(context,context); /* thread context */
1429 @END
1432 /* Set the current context of a thread */
1433 @REQ(set_thread_context)
1434 obj_handle_t handle; /* thread handle */
1435 unsigned int flags; /* context flags */
1436 VARARG(context,context); /* thread context */
1437 @END
1440 /* Fetch a selector entry for a thread */
1441 @REQ(get_selector_entry)
1442 obj_handle_t handle; /* thread handle */
1443 int entry; /* LDT entry */
1444 @REPLY
1445 unsigned int base; /* selector base */
1446 unsigned int limit; /* selector limit */
1447 unsigned char flags; /* selector flags */
1448 @END
1451 /* Add an atom */
1452 @REQ(add_atom)
1453 int local; /* is atom in local process table? */
1454 VARARG(name,unicode_str); /* atom name */
1455 @REPLY
1456 atom_t atom; /* resulting atom */
1457 @END
1460 /* Delete an atom */
1461 @REQ(delete_atom)
1462 atom_t atom; /* atom handle */
1463 int local; /* is atom in local process table? */
1464 @END
1467 /* Find an atom */
1468 @REQ(find_atom)
1469 int local; /* is atom in local process table? */
1470 VARARG(name,unicode_str); /* atom name */
1471 @REPLY
1472 atom_t atom; /* atom handle */
1473 @END
1476 /* Get an atom name */
1477 @REQ(get_atom_name)
1478 atom_t atom; /* atom handle */
1479 int local; /* is atom in local process table? */
1480 @REPLY
1481 int count; /* atom lock count */
1482 VARARG(name,unicode_str); /* atom name */
1483 @END
1486 /* Init the process atom table */
1487 @REQ(init_atom_table)
1488 int entries; /* number of entries */
1489 @END
1492 /* Get the message queue of the current thread */
1493 @REQ(get_msg_queue)
1494 @REPLY
1495 obj_handle_t handle; /* handle to the queue */
1496 @END
1499 /* Set the current message queue wakeup mask */
1500 @REQ(set_queue_mask)
1501 unsigned int wake_mask; /* wakeup bits mask */
1502 unsigned int changed_mask; /* changed bits mask */
1503 int skip_wait; /* will we skip waiting if signaled? */
1504 @REPLY
1505 unsigned int wake_bits; /* current wake bits */
1506 unsigned int changed_bits; /* current changed bits */
1507 @END
1510 /* Get the current message queue status */
1511 @REQ(get_queue_status)
1512 int clear; /* should we clear the change bits? */
1513 @REPLY
1514 unsigned int wake_bits; /* wake bits */
1515 unsigned int changed_bits; /* changed bits since last time */
1516 @END
1519 /* Wait for a process to start waiting on input */
1520 @REQ(wait_input_idle)
1521 obj_handle_t handle; /* process handle */
1522 int timeout; /* timeout */
1523 @REPLY
1524 obj_handle_t event; /* handle to idle event */
1525 @END
1528 /* Send a message to a thread queue */
1529 @REQ(send_message)
1530 thread_id_t id; /* thread id */
1531 int type; /* message type (see below) */
1532 int flags; /* message flags (see below) */
1533 user_handle_t win; /* window handle */
1534 unsigned int msg; /* message code */
1535 unsigned int wparam; /* parameters */
1536 unsigned int lparam; /* parameters */
1537 int x; /* x position */
1538 int y; /* y position */
1539 unsigned int time; /* message time */
1540 unsigned int info; /* extra info */
1541 int timeout; /* timeout for reply */
1542 void* callback; /* callback address */
1543 VARARG(data,bytes); /* message data for sent messages */
1544 @END
1546 enum message_type
1548 MSG_ASCII, /* Ascii message (from SendMessageA) */
1549 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1550 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1551 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1552 MSG_CALLBACK_RESULT,/* result of a callback message */
1553 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1554 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1555 MSG_HARDWARE /* hardware message */
1557 #define SEND_MSG_ABORT_IF_HUNG 0x01
1560 /* Get a message from the current queue */
1561 @REQ(get_message)
1562 int flags; /* see below */
1563 user_handle_t get_win; /* window handle to get */
1564 unsigned int get_first; /* first message code to get */
1565 unsigned int get_last; /* last message code to get */
1566 @REPLY
1567 int type; /* message type */
1568 user_handle_t win; /* window handle */
1569 unsigned int msg; /* message code */
1570 unsigned int wparam; /* parameters (callback function for MSG_CALLBACK_RESULT) */
1571 unsigned int lparam; /* parameters (result for MSG_CALLBACK_RESULT) */
1572 int x; /* x position */
1573 int y; /* y position */
1574 unsigned int time; /* message time */
1575 unsigned int info; /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1576 size_t total; /* total size of extra data */
1577 VARARG(data,bytes); /* message data for sent messages */
1578 @END
1579 #define GET_MSG_REMOVE 1 /* remove the message */
1580 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1582 /* Reply to a sent message */
1583 @REQ(reply_message)
1584 int type; /* type of original message */
1585 unsigned int result; /* message result */
1586 int remove; /* should we remove the message? */
1587 VARARG(data,bytes); /* message data for sent messages */
1588 @END
1591 /* Retrieve the reply for the last message sent */
1592 @REQ(get_message_reply)
1593 int cancel; /* cancel message if not ready? */
1594 @REPLY
1595 unsigned int result; /* message result */
1596 VARARG(data,bytes); /* message data for sent messages */
1597 @END
1600 /* Set a window timer */
1601 @REQ(set_win_timer)
1602 user_handle_t win; /* window handle */
1603 unsigned int msg; /* message to post */
1604 unsigned int id; /* timer id */
1605 unsigned int rate; /* timer rate in ms */
1606 unsigned int lparam; /* message lparam (callback proc) */
1607 @END
1610 /* Kill a window timer */
1611 @REQ(kill_win_timer)
1612 user_handle_t win; /* window handle */
1613 unsigned int msg; /* message to post */
1614 unsigned int id; /* timer id */
1615 @END
1618 /* Retrieve info about a serial port */
1619 @REQ(get_serial_info)
1620 obj_handle_t handle; /* handle to comm port */
1621 @REPLY
1622 unsigned int readinterval;
1623 unsigned int readconst;
1624 unsigned int readmult;
1625 unsigned int writeconst;
1626 unsigned int writemult;
1627 unsigned int eventmask;
1628 unsigned int commerror;
1629 @END
1632 /* Set info about a serial port */
1633 @REQ(set_serial_info)
1634 obj_handle_t handle; /* handle to comm port */
1635 int flags; /* bitmask to set values (see below) */
1636 unsigned int readinterval;
1637 unsigned int readconst;
1638 unsigned int readmult;
1639 unsigned int writeconst;
1640 unsigned int writemult;
1641 unsigned int eventmask;
1642 unsigned int commerror;
1643 @END
1644 #define SERIALINFO_SET_TIMEOUTS 0x01
1645 #define SERIALINFO_SET_MASK 0x02
1646 #define SERIALINFO_SET_ERROR 0x04
1649 /* Create / reschedule an async I/O */
1650 @REQ(register_async)
1651 obj_handle_t handle; /* handle to comm port, socket or file */
1652 int type;
1653 void* overlapped;
1654 int count;
1655 unsigned int status;
1656 @END
1657 #define ASYNC_TYPE_NONE 0x00
1658 #define ASYNC_TYPE_READ 0x01
1659 #define ASYNC_TYPE_WRITE 0x02
1660 #define ASYNC_TYPE_WAIT 0x03
1663 /* Create a named pipe */
1664 @REQ(create_named_pipe)
1665 unsigned int openmode;
1666 unsigned int pipemode;
1667 unsigned int maxinstances;
1668 unsigned int outsize;
1669 unsigned int insize;
1670 unsigned int timeout;
1671 int inherit; /* inherit flag */
1672 VARARG(name,unicode_str); /* pipe name */
1673 @REPLY
1674 obj_handle_t handle; /* handle to the pipe */
1675 @END
1678 /* Open an existing named pipe */
1679 @REQ(open_named_pipe)
1680 unsigned int access;
1681 int inherit; /* inherit flag */
1682 VARARG(name,unicode_str); /* pipe name */
1683 @REPLY
1684 obj_handle_t handle; /* handle to the pipe */
1685 @END
1688 /* Connect to a named pipe */
1689 @REQ(connect_named_pipe)
1690 obj_handle_t handle;
1691 void* overlapped;
1692 void* func;
1693 @END
1696 /* Wait for a named pipe */
1697 @REQ(wait_named_pipe)
1698 unsigned int timeout;
1699 void* overlapped;
1700 void* func;
1701 VARARG(name,unicode_str); /* pipe name */
1702 @END
1705 /* Disconnect a named pipe */
1706 @REQ(disconnect_named_pipe)
1707 obj_handle_t handle;
1708 @REPLY
1709 int fd; /* associated fd to close */
1710 @END
1713 @REQ(get_named_pipe_info)
1714 obj_handle_t handle;
1715 @REPLY
1716 unsigned int flags;
1717 unsigned int maxinstances;
1718 unsigned int outsize;
1719 unsigned int insize;
1720 @END
1723 @REQ(create_smb)
1724 int fd;
1725 unsigned int tree_id;
1726 unsigned int user_id;
1727 unsigned int file_id;
1728 unsigned int dialect;
1729 @REPLY
1730 obj_handle_t handle;
1731 @END
1734 @REQ(get_smb_info)
1735 obj_handle_t handle;
1736 unsigned int flags;
1737 unsigned int offset;
1738 @REPLY
1739 unsigned int tree_id;
1740 unsigned int user_id;
1741 unsigned int dialect;
1742 unsigned int file_id;
1743 unsigned int offset;
1744 @END
1745 #define SMBINFO_SET_OFFSET 0x01
1748 /* Create a window */
1749 @REQ(create_window)
1750 user_handle_t parent; /* parent window */
1751 user_handle_t owner; /* owner window */
1752 atom_t atom; /* class atom */
1753 void* instance; /* module instance */
1754 @REPLY
1755 user_handle_t handle; /* created window */
1756 int extra; /* number of extra bytes */
1757 void* class_ptr; /* pointer to class in client address space */
1758 @END
1761 /* Link a window into the tree */
1762 @REQ(link_window)
1763 user_handle_t handle; /* handle to the window */
1764 user_handle_t parent; /* handle to the parent */
1765 user_handle_t previous; /* previous child in Z-order */
1766 @REPLY
1767 user_handle_t full_parent; /* full handle of new parent */
1768 @END
1771 /* Destroy a window */
1772 @REQ(destroy_window)
1773 user_handle_t handle; /* handle to the window */
1774 @END
1777 /* Set a window owner */
1778 @REQ(set_window_owner)
1779 user_handle_t handle; /* handle to the window */
1780 user_handle_t owner; /* new owner */
1781 @REPLY
1782 user_handle_t full_owner; /* full handle of new owner */
1783 user_handle_t prev_owner; /* full handle of previous owner */
1784 @END
1787 /* Get information from a window handle */
1788 @REQ(get_window_info)
1789 user_handle_t handle; /* handle to the window */
1790 @REPLY
1791 user_handle_t full_handle; /* full 32-bit handle */
1792 user_handle_t last_active; /* last active popup */
1793 process_id_t pid; /* process owning the window */
1794 thread_id_t tid; /* thread owning the window */
1795 atom_t atom; /* class atom */
1796 @END
1799 /* Set some information in a window */
1800 @REQ(set_window_info)
1801 user_handle_t handle; /* handle to the window */
1802 unsigned int flags; /* flags for fields to set (see below) */
1803 unsigned int style; /* window style */
1804 unsigned int ex_style; /* window extended style */
1805 unsigned int id; /* window id */
1806 void* instance; /* creator instance */
1807 void* user_data; /* user-specific data */
1808 int extra_offset; /* offset to set in extra bytes */
1809 size_t extra_size; /* size to set in extra bytes */
1810 unsigned int extra_value; /* value to set in extra bytes */
1811 @REPLY
1812 unsigned int old_style; /* old window style */
1813 unsigned int old_ex_style; /* old window extended style */
1814 unsigned int old_id; /* old window id */
1815 void* old_instance; /* old creator instance */
1816 void* old_user_data; /* old user-specific data */
1817 unsigned int old_extra_value; /* old value in extra bytes */
1818 @END
1819 #define SET_WIN_STYLE 0x01
1820 #define SET_WIN_EXSTYLE 0x02
1821 #define SET_WIN_ID 0x04
1822 #define SET_WIN_INSTANCE 0x08
1823 #define SET_WIN_USERDATA 0x10
1824 #define SET_WIN_EXTRA 0x20
1827 /* Get a list of the window parents, up to the root of the tree */
1828 @REQ(get_window_parents)
1829 user_handle_t handle; /* handle to the window */
1830 @REPLY
1831 int count; /* total count of parents */
1832 VARARG(parents,user_handles); /* parent handles */
1833 @END
1836 /* Get a list of the window children */
1837 @REQ(get_window_children)
1838 user_handle_t parent; /* parent window */
1839 atom_t atom; /* class atom for the listed children */
1840 thread_id_t tid; /* thread owning the listed children */
1841 @REPLY
1842 int count; /* total count of children */
1843 VARARG(children,user_handles); /* children handles */
1844 @END
1847 /* Get window tree information from a window handle */
1848 @REQ(get_window_tree)
1849 user_handle_t handle; /* handle to the window */
1850 @REPLY
1851 user_handle_t parent; /* parent window */
1852 user_handle_t owner; /* owner window */
1853 user_handle_t next_sibling; /* next sibling in Z-order */
1854 user_handle_t prev_sibling; /* prev sibling in Z-order */
1855 user_handle_t first_sibling; /* first sibling in Z-order */
1856 user_handle_t last_sibling; /* last sibling in Z-order */
1857 user_handle_t first_child; /* first child */
1858 user_handle_t last_child; /* last child */
1859 @END
1861 /* Set the window and client rectangles of a window */
1862 @REQ(set_window_rectangles)
1863 user_handle_t handle; /* handle to the window */
1864 rectangle_t window; /* window rectangle */
1865 rectangle_t client; /* client rectangle */
1866 @END
1869 /* Get the window and client rectangles of a window */
1870 @REQ(get_window_rectangles)
1871 user_handle_t handle; /* handle to the window */
1872 @REPLY
1873 rectangle_t window; /* window rectangle */
1874 rectangle_t client; /* client rectangle */
1875 @END
1878 /* Get the window text */
1879 @REQ(get_window_text)
1880 user_handle_t handle; /* handle to the window */
1881 @REPLY
1882 VARARG(text,unicode_str); /* window text */
1883 @END
1886 /* Set the window text */
1887 @REQ(set_window_text)
1888 user_handle_t handle; /* handle to the window */
1889 VARARG(text,unicode_str); /* window text */
1890 @END
1893 /* Increment the window paint count */
1894 @REQ(inc_window_paint_count)
1895 user_handle_t handle; /* handle to the window */
1896 int incr; /* increment (can be negative) */
1897 @END
1900 /* Get the coordinates offset between two windows */
1901 @REQ(get_windows_offset)
1902 user_handle_t from; /* handle to the first window */
1903 user_handle_t to; /* handle to the second window */
1904 @REPLY
1905 int x; /* x coordinate offset */
1906 int y; /* y coordinate offset */
1907 @END
1910 /* Set a window property */
1911 @REQ(set_window_property)
1912 user_handle_t window; /* handle to the window */
1913 atom_t atom; /* property atom (high-word set if it was a string) */
1914 int string; /* was atom a string originally? */
1915 obj_handle_t handle; /* handle to store */
1916 @END
1919 /* Remove a window property */
1920 @REQ(remove_window_property)
1921 user_handle_t window; /* handle to the window */
1922 atom_t atom; /* property atom */
1923 @REPLY
1924 obj_handle_t handle; /* handle stored in property */
1925 @END
1928 /* Get a window property */
1929 @REQ(get_window_property)
1930 user_handle_t window; /* handle to the window */
1931 atom_t atom; /* property atom */
1932 @REPLY
1933 obj_handle_t handle; /* handle stored in property */
1934 @END
1937 /* Get the list of properties of a window */
1938 @REQ(get_window_properties)
1939 user_handle_t window; /* handle to the window */
1940 @REPLY
1941 int total; /* total number of properties */
1942 VARARG(props,properties); /* list of properties */
1943 @END
1946 /* Attach (or detach) thread inputs */
1947 @REQ(attach_thread_input)
1948 thread_id_t tid_from; /* thread to be attached */
1949 thread_id_t tid_to; /* thread to which tid_from should be attached */
1950 int attach; /* is it an attach? */
1951 @END
1954 /* Get input data for a given thread */
1955 @REQ(get_thread_input)
1956 thread_id_t tid; /* id of thread */
1957 @REPLY
1958 user_handle_t focus; /* handle to the focus window */
1959 user_handle_t capture; /* handle to the capture window */
1960 user_handle_t active; /* handle to the active window */
1961 user_handle_t foreground; /* handle to the global foreground window */
1962 user_handle_t menu_owner; /* handle to the menu owner */
1963 user_handle_t move_size; /* handle to the moving/resizing window */
1964 user_handle_t caret; /* handle to the caret window */
1965 rectangle_t rect; /* caret rectangle */
1966 @END
1968 /* Retrieve queue keyboard state for a given thread */
1969 @REQ(get_key_state)
1970 thread_id_t tid; /* id of thread */
1971 int key; /* optional key code or -1 */
1972 @REPLY
1973 unsigned char state; /* state of specified key */
1974 VARARG(keystate,bytes); /* state array for all the keys */
1975 @END
1977 /* Set queue keyboard state for a given thread */
1978 @REQ(set_key_state)
1979 thread_id_t tid; /* id of thread */
1980 VARARG(keystate,bytes); /* state array for all the keys */
1981 @END
1983 /* Set the system foreground window */
1984 @REQ(set_foreground_window)
1985 user_handle_t handle; /* handle to the foreground window */
1986 @REPLY
1987 user_handle_t previous; /* handle to the previous foreground window */
1988 int send_msg_old; /* whether we have to send a msg to the old window */
1989 int send_msg_new; /* whether we have to send a msg to the new window */
1990 @END
1992 /* Set the current thread focus window */
1993 @REQ(set_focus_window)
1994 user_handle_t handle; /* handle to the focus window */
1995 @REPLY
1996 user_handle_t previous; /* handle to the previous focus window */
1997 @END
1999 /* Set the current thread active window */
2000 @REQ(set_active_window)
2001 user_handle_t handle; /* handle to the active window */
2002 @REPLY
2003 user_handle_t previous; /* handle to the previous active window */
2004 @END
2006 /* Set the current thread capture window */
2007 @REQ(set_capture_window)
2008 user_handle_t handle; /* handle to the capture window */
2009 unsigned int flags; /* capture flags (see below) */
2010 @REPLY
2011 user_handle_t previous; /* handle to the previous capture window */
2012 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2013 @END
2014 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2015 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2018 /* Set the current thread caret window */
2019 @REQ(set_caret_window)
2020 user_handle_t handle; /* handle to the caret window */
2021 int width; /* caret width */
2022 int height; /* caret height */
2023 @REPLY
2024 user_handle_t previous; /* handle to the previous caret window */
2025 rectangle_t old_rect; /* previous caret rectangle */
2026 int old_hide; /* previous hide count */
2027 int old_state; /* previous caret state (1=on, 0=off) */
2028 @END
2031 /* Set the current thread caret information */
2032 @REQ(set_caret_info)
2033 unsigned int flags; /* caret flags (see below) */
2034 user_handle_t handle; /* handle to the caret window */
2035 int x; /* caret x position */
2036 int y; /* caret y position */
2037 int hide; /* increment for hide count (can be negative to show it) */
2038 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2039 @REPLY
2040 user_handle_t full_handle; /* handle to the current caret window */
2041 rectangle_t old_rect; /* previous caret rectangle */
2042 int old_hide; /* previous hide count */
2043 int old_state; /* previous caret state (1=on, 0=off) */
2044 @END
2045 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2046 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2047 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2050 /* Set a window hook */
2051 @REQ(set_hook)
2052 int id; /* id of the hook */
2053 thread_id_t tid; /* id of thread to set the hook into */
2054 void* proc; /* hook procedure */
2055 int unicode; /* is it a unicode hook? */
2056 VARARG(module,unicode_str); /* module name */
2057 @REPLY
2058 user_handle_t handle; /* handle to the hook */
2059 @END
2062 /* Remove a window hook */
2063 @REQ(remove_hook)
2064 user_handle_t handle; /* handle to the hook */
2065 int id; /* id of the hook if handle is 0 */
2066 void* proc; /* hook procedure if handle is 0 */
2067 @END
2070 /* Start calling a hook chain */
2071 @REQ(start_hook_chain)
2072 int id; /* id of the hook */
2073 @REPLY
2074 user_handle_t handle; /* handle to the next hook */
2075 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2076 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2077 void* proc; /* hook procedure */
2078 int unicode; /* is it a unicode hook? */
2079 VARARG(module,unicode_str); /* module name */
2080 @END
2083 /* Finished calling a hook chain */
2084 @REQ(finish_hook_chain)
2085 int id; /* id of the hook */
2086 @END
2089 /* Get the next hook to call */
2090 @REQ(get_next_hook)
2091 user_handle_t handle; /* handle to the current hook */
2092 @REPLY
2093 user_handle_t next; /* handle to the next hook */
2094 int id; /* id of the next hook */
2095 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2096 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2097 void* proc; /* next hook procedure */
2098 int prev_unicode; /* was the previous a unicode hook? */
2099 int next_unicode; /* is the next a unicode hook? */
2100 VARARG(module,unicode_str); /* module name */
2101 @END
2104 /* Create a window class */
2105 @REQ(create_class)
2106 int local; /* is it a local class? */
2107 atom_t atom; /* class atom */
2108 unsigned int style; /* class style */
2109 void* instance; /* module instance */
2110 int extra; /* number of extra class bytes */
2111 int win_extra; /* number of window extra bytes */
2112 void* client_ptr; /* pointer to class in client address space */
2113 @END
2116 /* Destroy a window class */
2117 @REQ(destroy_class)
2118 atom_t atom; /* class atom */
2119 void* instance; /* module instance */
2120 @REPLY
2121 void* client_ptr; /* pointer to class in client address space */
2122 @END
2125 /* Set some information in a class */
2126 @REQ(set_class_info)
2127 user_handle_t window; /* handle to the window */
2128 unsigned int flags; /* flags for info to set (see below) */
2129 atom_t atom; /* class atom */
2130 unsigned int style; /* class style */
2131 int win_extra; /* number of window extra bytes */
2132 void* instance; /* module instance */
2133 int extra_offset; /* offset to set in extra bytes */
2134 size_t extra_size; /* size to set in extra bytes */
2135 unsigned int extra_value; /* value to set in extra bytes */
2136 @REPLY
2137 atom_t old_atom; /* previous class atom */
2138 unsigned int old_style; /* previous class style */
2139 int old_extra; /* previous number of class extra bytes */
2140 int old_win_extra; /* previous number of window extra bytes */
2141 void* old_instance; /* previous module instance */
2142 unsigned int old_extra_value; /* old value in extra bytes */
2143 @END
2144 #define SET_CLASS_ATOM 0x0001
2145 #define SET_CLASS_STYLE 0x0002
2146 #define SET_CLASS_WINEXTRA 0x0004
2147 #define SET_CLASS_INSTANCE 0x0008
2148 #define SET_CLASS_EXTRA 0x0010
2151 /* Set/get clipboard information */
2152 @REQ(set_clipboard_info)
2153 unsigned int flags; /* flags for fields to set (see below) */
2154 user_handle_t clipboard; /* clipboard window */
2155 user_handle_t owner; /* clipboard owner */
2156 user_handle_t viewer; /* first clipboard viewer */
2157 unsigned int seqno; /* change sequence number */
2158 @REPLY
2159 unsigned int flags; /* status flags (see below) */
2160 user_handle_t old_clipboard; /* old clipboard window */
2161 user_handle_t old_owner; /* old clipboard owner */
2162 user_handle_t old_viewer; /* old clipboard viewer */
2163 unsigned int seqno; /* current sequence number */
2164 @END
2166 #define SET_CB_OPEN 0x001
2167 #define SET_CB_OWNER 0x002
2168 #define SET_CB_VIEWER 0x004
2169 #define SET_CB_SEQNO 0x008
2170 #define SET_CB_RELOWNER 0x010
2171 #define SET_CB_CLOSE 0x020
2172 #define CB_OPEN 0x040
2173 #define CB_OWNER 0x080
2176 /* Open a security token */
2177 @REQ(open_token)
2178 obj_handle_t handle; /* handle to the thread or process */
2179 unsigned int flags; /* flags (see below) */
2180 @REPLY
2181 obj_handle_t token; /* handle to the token */
2182 @END
2183 #define OPEN_TOKEN_THREAD 1
2184 #define OPEN_TOKEN_AS_SELF 2
2187 /* Set/get the global windows */
2188 @REQ(set_global_windows)
2189 unsigned int flags; /* flags for fields to set (see below) */
2190 user_handle_t shell_window; /* handle to the new shell window */
2191 user_handle_t shell_listview; /* handle to the new shell listview window */
2192 user_handle_t progman_window; /* handle to the new program manager window */
2193 user_handle_t taskman_window; /* handle to the new task manager window */
2194 @REPLY
2195 user_handle_t old_shell_window; /* handle to the shell window */
2196 user_handle_t old_shell_listview; /* handle to the shell listview window */
2197 user_handle_t old_progman_window; /* handle to the new program manager window */
2198 user_handle_t old_taskman_window; /* handle to the new task manager window */
2199 @END
2200 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2201 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2202 #define SET_GLOBAL_TASKMAN_WINDOW 0x04