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 */
33 int req; /* request code */
34 size_t request_size; /* request variable part size */
35 size_t reply_size; /* reply variable part maximum size */
40 unsigned int error; /* error result */
41 size_t reply_size; /* reply variable part size */
44 /* placeholder structure for the maximum allowed request size */
45 /* this is used to construct the generic_request union */
46 struct request_max_size
48 int pad[16]; /* the max request size is 16 ints */
51 /* max size of the variable part of a request */
52 #define REQUEST_MAX_VAR_SIZE 1024
55 typedef unsigned short atom_t;
56 typedef unsigned int user_handle_t;
58 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
59 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
62 /* definitions of the event data depending on the event code */
63 struct debug_event_exception
65 EXCEPTION_RECORD record; /* exception record */
66 int first; /* first chance exception? */
68 struct debug_event_create_thread
70 handle_t handle; /* handle to the new thread */
71 void *teb; /* thread teb (in debugged process address space) */
72 void *start; /* thread startup routine */
74 struct debug_event_create_process
76 handle_t file; /* handle to the process exe file */
77 handle_t process; /* handle to the new process */
78 handle_t thread; /* handle to the new thread */
79 void *base; /* base of executable image */
80 int dbg_offset; /* offset of debug info in file */
81 int dbg_size; /* size of debug info */
82 void *teb; /* thread teb (in debugged process address space) */
83 void *start; /* thread startup routine */
84 void *name; /* image name (optional) */
85 int unicode; /* is it Unicode? */
87 struct debug_event_exit
89 int exit_code; /* thread or process exit code */
91 struct debug_event_load_dll
93 handle_t handle; /* file handle for the dll */
94 void *base; /* base address of the dll */
95 int dbg_offset; /* offset of debug info in file */
96 int dbg_size; /* size of debug info */
97 void *name; /* image name (optional) */
98 int unicode; /* is it Unicode? */
100 struct debug_event_unload_dll
102 void *base; /* base address of the dll */
104 struct debug_event_output_string
106 void *string; /* string to display (in debugged process address space) */
107 int unicode; /* is it Unicode? */
108 int length; /* string length */
110 struct debug_event_rip_info
115 union debug_event_data
117 struct debug_event_exception exception;
118 struct debug_event_create_thread create_thread;
119 struct debug_event_create_process create_process;
120 struct debug_event_exit exit;
121 struct debug_event_load_dll load_dll;
122 struct debug_event_unload_dll unload_dll;
123 struct debug_event_output_string output_string;
124 struct debug_event_rip_info rip_info;
127 /* debug event data */
130 int code; /* event code */
131 union debug_event_data info; /* event information */
134 /* structure used in sending an fd from client to server */
137 void *tid; /* thread id */
138 int fd; /* file descriptor on client-side */
141 /* structure sent by the server on the wait fifo */
144 void *cookie; /* magic cookie that was passed in select_request */
145 int signaled; /* wait result */
148 /* structure returned in the list of window properties */
151 atom_t atom; /* property atom */
152 short string; /* was atom a string originally? */
153 handle_t handle; /* handle stored in property */
156 /* structure to specify window rectangles */
165 /* structure for console char/attribute info */
172 /****************************************************************/
173 /* Request declarations */
175 /* Create a new process from the context of the parent */
177 int inherit_all; /* inherit all handles from parent */
178 int create_flags; /* creation flags */
179 int start_flags; /* flags from startup info */
180 handle_t exe_file; /* file handle for main exe */
181 handle_t hstdin; /* handle for stdin */
182 handle_t hstdout; /* handle for stdout */
183 handle_t hstderr; /* handle for stderr */
184 int cmd_show; /* main window show mode */
185 VARARG(filename,string); /* file name of main exe */
187 handle_t info; /* new process info handle */
191 /* Retrieve information about a newly started process */
192 @REQ(get_new_process_info)
193 handle_t info; /* info handle returned from new_process_request */
194 int pinherit; /* process handle inherit flag */
195 int tinherit; /* thread handle inherit flag */
197 void* pid; /* process id */
198 handle_t phandle; /* process handle (in the current process) */
199 void* tid; /* thread id */
200 handle_t thandle; /* thread handle (in the current process) */
201 handle_t event; /* event handle to signal startup */
205 /* Create a new thread from the context of the parent */
207 int suspend; /* new thread should be suspended on creation */
208 int inherit; /* inherit flag */
209 int request_fd; /* fd for request pipe */
211 void* tid; /* thread id */
212 handle_t handle; /* thread handle (in the current process) */
216 /* Signal that we are finished booting on the client side */
218 int debug_level; /* new debug level */
222 /* Initialize a process; called from the new process context */
224 void* ldt_copy; /* addr of LDT copy */
225 int ppid; /* parent Unix pid */
227 int create_flags; /* creation flags */
228 int start_flags; /* flags from startup info */
229 unsigned int server_start; /* server start time (GetTickCount) */
230 handle_t exe_file; /* file handle for main exe */
231 handle_t hstdin; /* handle for stdin */
232 handle_t hstdout; /* handle for stdout */
233 handle_t hstderr; /* handle for stderr */
234 int cmd_show; /* main window show mode */
235 VARARG(filename,string); /* file name of main exe */
239 /* Signal the end of the process initialization */
240 @REQ(init_process_done)
241 void* module; /* main module base address */
242 void* entry; /* process entry point */
243 void* name; /* ptr to ptr to name (in process addr space) */
244 handle_t exe_file; /* file handle for main exe */
245 int gui; /* is it a GUI process? */
247 int debugged; /* being debugged? */
251 /* Initialize a thread; called from the child after fork()/clone() */
253 int unix_pid; /* Unix pid of new thread */
254 void* teb; /* TEB of new thread (in thread address space) */
255 void* entry; /* thread entry point (in thread address space) */
256 int reply_fd; /* fd for reply pipe */
257 int wait_fd; /* fd for blocking calls pipe */
259 void* pid; /* process id of the new thread's process */
260 void* tid; /* thread id of the new thread */
261 int boot; /* is this the boot thread? */
262 int version; /* protocol version */
266 /* Terminate a process */
267 @REQ(terminate_process)
268 handle_t handle; /* process handle to terminate */
269 int exit_code; /* process exit code */
271 int self; /* suicide? */
275 /* Terminate a thread */
276 @REQ(terminate_thread)
277 handle_t handle; /* thread handle to terminate */
278 int exit_code; /* thread exit code */
280 int self; /* suicide? */
281 int last; /* last thread in this process? */
285 /* Retrieve information about a process */
286 @REQ(get_process_info)
287 handle_t handle; /* process handle */
289 void* pid; /* server process id */
290 int debugged; /* debugged? */
291 int exit_code; /* process exit code */
292 int priority; /* priority class */
293 int process_affinity; /* process affinity mask */
294 int system_affinity; /* system affinity mask */
298 /* Set a process informations */
299 @REQ(set_process_info)
300 handle_t handle; /* process handle */
301 int mask; /* setting mask (see below) */
302 int priority; /* priority class */
303 int affinity; /* affinity mask */
305 #define SET_PROCESS_INFO_PRIORITY 0x01
306 #define SET_PROCESS_INFO_AFFINITY 0x02
309 /* Retrieve information about a thread */
310 @REQ(get_thread_info)
311 handle_t handle; /* thread handle */
312 void* tid_in; /* thread id (optional) */
314 void* tid; /* server thread id */
315 void* teb; /* thread teb pointer */
316 int exit_code; /* thread exit code */
317 int priority; /* thread priority level */
321 /* Set a thread informations */
322 @REQ(set_thread_info)
323 handle_t handle; /* thread handle */
324 int mask; /* setting mask (see below) */
325 int priority; /* priority class */
326 int affinity; /* affinity mask */
328 #define SET_THREAD_INFO_PRIORITY 0x01
329 #define SET_THREAD_INFO_AFFINITY 0x02
332 /* Suspend a thread */
334 handle_t handle; /* thread handle */
336 int count; /* new suspend count */
340 /* Resume a thread */
342 handle_t handle; /* thread handle */
344 int count; /* new suspend count */
348 /* Notify the server that a dll has been loaded */
350 handle_t handle; /* file handle */
351 void* base; /* base address */
352 int dbg_offset; /* debug info offset */
353 int dbg_size; /* debug info size */
354 void* name; /* ptr to ptr to name (in process addr space) */
358 /* Notify the server that a dll is being unloaded */
360 void* base; /* base address */
364 /* Queue an APC for a thread */
366 handle_t handle; /* thread handle */
367 int user; /* user or system apc? */
368 void* func; /* function to call */
369 void* param; /* param for function to call */
373 /* Get next APC to call */
375 int alertable; /* is thread alertable? */
377 void* func; /* function to call */
378 int type; /* function type */
379 VARARG(args,ptrs); /* function arguments */
381 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
384 /* Close a handle for the current process */
386 handle_t handle; /* handle to close */
388 int fd; /* associated fd to close */
392 /* Set a handle information */
393 @REQ(set_handle_info)
394 handle_t handle; /* handle we are interested in */
395 int flags; /* new handle flags */
396 int mask; /* mask for flags to set */
397 int fd; /* file descriptor or -1 */
399 int old_flags; /* old flag value */
400 int cur_fd; /* current file descriptor */
404 /* Duplicate a handle */
406 handle_t src_process; /* src process handle */
407 handle_t src_handle; /* src handle to duplicate */
408 handle_t dst_process; /* dst process handle */
409 unsigned int access; /* wanted access rights */
410 int inherit; /* inherit flag */
411 int options; /* duplicate options (see below) */
413 handle_t handle; /* duplicated handle in dst process */
414 int fd; /* associated fd to close */
416 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
417 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
418 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
421 /* Open a handle to a process */
423 void* pid; /* process id to open */
424 unsigned int access; /* wanted access rights */
425 int inherit; /* inherit flag */
427 handle_t handle; /* handle to the process */
431 /* Wait for handles */
433 int flags; /* wait flags (see below) */
434 void* cookie; /* magic cookie to return to client */
435 int sec; /* absolute timeout */
436 int usec; /* absolute timeout */
437 VARARG(handles,handles); /* handles to select on */
440 #define SELECT_ALERTABLE 2
441 #define SELECT_INTERRUPTIBLE 4
442 #define SELECT_TIMEOUT 8
445 /* Create an event */
447 int manual_reset; /* manual reset event */
448 int initial_state; /* initial state of the event */
449 int inherit; /* inherit flag */
450 VARARG(name,unicode_str); /* object name */
452 handle_t handle; /* handle to the event */
455 /* Event operation */
457 handle_t handle; /* handle to event */
458 int op; /* event operation (see below) */
460 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
465 unsigned int access; /* wanted access rights */
466 int inherit; /* inherit flag */
467 VARARG(name,unicode_str); /* object name */
469 handle_t handle; /* handle to the event */
475 int owned; /* initially owned? */
476 int inherit; /* inherit flag */
477 VARARG(name,unicode_str); /* object name */
479 handle_t handle; /* handle to the mutex */
483 /* Release a mutex */
485 handle_t handle; /* handle to the mutex */
491 unsigned int access; /* wanted access rights */
492 int inherit; /* inherit flag */
493 VARARG(name,unicode_str); /* object name */
495 handle_t handle; /* handle to the mutex */
499 /* Create a semaphore */
500 @REQ(create_semaphore)
501 unsigned int initial; /* initial count */
502 unsigned int max; /* maximum count */
503 int inherit; /* inherit flag */
504 VARARG(name,unicode_str); /* object name */
506 handle_t handle; /* handle to the semaphore */
510 /* Release a semaphore */
511 @REQ(release_semaphore)
512 handle_t handle; /* handle to the semaphore */
513 unsigned int count; /* count to add to semaphore */
515 unsigned int prev_count; /* previous semaphore count */
519 /* Open a semaphore */
521 unsigned int access; /* wanted access rights */
522 int inherit; /* inherit flag */
523 VARARG(name,unicode_str); /* object name */
525 handle_t handle; /* handle to the semaphore */
531 unsigned int access; /* wanted access rights */
532 int inherit; /* inherit flag */
533 unsigned int sharing; /* sharing flags */
534 int create; /* file create action */
535 unsigned int attrs; /* file attributes for creation */
536 int drive_type; /* type of drive the file is on */
537 VARARG(filename,string); /* file name */
539 handle_t handle; /* handle to the file */
543 /* Allocate a file handle for a Unix fd */
544 @REQ(alloc_file_handle)
545 unsigned int access; /* wanted access rights */
546 int inherit; /* inherit flag */
547 int fd; /* file descriptor on the client side */
549 handle_t handle; /* handle to the file */
553 /* Get a Unix fd to access a file */
555 handle_t handle; /* handle to the file */
556 unsigned int access; /* wanted access rights */
558 int fd; /* file descriptor */
559 int type; /* the type of file (see below) */
560 int flags; /* file read/write flags (see below) */
568 #define FD_FLAG_OVERLAPPED 0x01
569 #define FD_FLAG_TIMEOUT 0x02
572 /* Set a file current position */
573 @REQ(set_file_pointer)
574 handle_t handle; /* handle to the file */
575 int low; /* position low word */
576 int high; /* position high word */
577 int whence; /* whence to seek */
579 int new_low; /* new position low word */
580 int new_high; /* new position high word */
584 /* Truncate (or extend) a file */
586 handle_t handle; /* handle to the file */
590 /* Set a file access and modification times */
592 handle_t handle; /* handle to the file */
593 time_t access_time; /* last access time */
594 time_t write_time; /* last write time */
598 /* Flush a file buffers */
600 handle_t handle; /* handle to the file */
604 /* Get information about a file */
606 handle_t handle; /* handle to the file */
608 int type; /* file type */
609 int attr; /* file attributes */
610 time_t access_time; /* last access time */
611 time_t write_time; /* last write time */
612 int size_high; /* file size */
613 int size_low; /* file size */
614 int links; /* number of links */
615 int index_high; /* unique index */
616 int index_low; /* unique index */
617 unsigned int serial; /* volume serial number */
621 /* Lock a region of a file */
623 handle_t handle; /* handle to the file */
624 unsigned int offset_low; /* offset of start of lock */
625 unsigned int offset_high; /* offset of start of lock */
626 unsigned int count_low; /* count of bytes to lock */
627 unsigned int count_high; /* count of bytes to lock */
631 /* Unlock a region of a file */
633 handle_t handle; /* handle to the file */
634 unsigned int offset_low; /* offset of start of unlock */
635 unsigned int offset_high; /* offset of start of unlock */
636 unsigned int count_low; /* count of bytes to unlock */
637 unsigned int count_high; /* count of bytes to unlock */
641 /* Create an anonymous pipe */
643 int inherit; /* inherit flag */
645 handle_t handle_read; /* handle to the read-side of the pipe */
646 handle_t handle_write; /* handle to the write-side of the pipe */
650 /* Create a socket */
652 unsigned int access; /* wanted access rights */
653 int inherit; /* inherit flag */
654 int family; /* family, see socket manpage */
655 int type; /* type, see socket manpage */
656 int protocol; /* protocol, see socket manpage */
657 unsigned int flags; /* socket flags */
659 handle_t handle; /* handle to the new socket */
663 /* Accept a socket */
665 handle_t lhandle; /* handle to the listening socket */
666 unsigned int access; /* wanted access rights */
667 int inherit; /* inherit flag */
669 handle_t handle; /* handle to the new socket */
673 /* Set socket event parameters */
674 @REQ(set_socket_event)
675 handle_t handle; /* handle to the socket */
676 unsigned int mask; /* event mask */
677 handle_t event; /* event object */
681 /* Get socket event parameters */
682 @REQ(get_socket_event)
683 handle_t handle; /* handle to the socket */
684 int service; /* clear pending? */
685 handle_t s_event; /* "expected" event object */
686 handle_t c_event; /* event to clear */
688 unsigned int mask; /* event mask */
689 unsigned int pmask; /* pending events */
690 unsigned int state; /* status bits */
691 VARARG(errors,ints); /* event errors */
695 /* Reenable pending socket events */
696 @REQ(enable_socket_event)
697 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 */
704 /* Allocate a console (only used by a console renderer) */
706 unsigned int access; /* wanted access rights */
707 int inherit; /* inherit flag */
708 void* pid; /* pid of process which shall be attached to the console */
710 handle_t handle_in; /* handle to console input */
711 handle_t event; /* handle to renderer events change notification */
715 /* Free the console of the current process */
720 #define CONSOLE_RENDERER_NONE_EVENT 0x00
721 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
722 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
723 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
724 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
725 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
726 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
727 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
728 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
729 struct console_renderer_event
764 /* retrieve console events for the renderer */
765 @REQ(get_console_renderer_events)
766 handle_t handle; /* handle to console input events */
768 VARARG(data,bytes); /* the various console_renderer_events */
772 /* Open a handle to the process console */
774 int from; /* 0 (resp 1) input (resp output) of current process console */
775 /* otherwise console_in handle to get active screen buffer? */
776 unsigned int access; /* wanted access rights */
777 int inherit; /* inherit flag */
778 int share; /* share mask (only for output handles) */
780 handle_t handle; /* handle to the console */
784 /* Get a console mode (input or output) */
785 @REQ(get_console_mode)
786 handle_t handle; /* handle to the console */
788 int mode; /* console mode */
792 /* Set a console mode (input or output) */
793 @REQ(set_console_mode)
794 handle_t handle; /* handle to the console */
795 int mode; /* console mode */
799 /* Set info about a console (input only) */
800 @REQ(set_console_input_info)
801 handle_t handle; /* handle to console input, or 0 for process' console */
802 int mask; /* setting mask (see below) */
803 handle_t active_sb; /* active screen buffer */
804 int history_mode; /* whether we duplicate lines in history */
805 int history_size; /* number of lines in history */
806 VARARG(title,unicode_str); /* console title */
808 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
809 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
810 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
811 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
814 /* Get info about a console (input only) */
815 @REQ(get_console_input_info)
816 handle_t handle; /* handle to console input, or 0 for process' console */
818 int history_mode; /* whether we duplicate lines in history */
819 int history_size; /* number of lines in history */
820 int history_index; /* number of used lines in history */
821 VARARG(title,unicode_str); /* console title */
825 /* appends a string to console's history */
826 @REQ(append_console_input_history)
827 handle_t handle; /* handle to console input, or 0 for process' console */
828 VARARG(line,unicode_str); /* line to add */
832 /* appends a string to console's history */
833 @REQ(get_console_input_history)
834 handle_t handle; /* handle to console input, or 0 for process' console */
835 int index; /* index to get line from */
837 int total; /* total length of line in Unicode chars */
838 VARARG(line,unicode_str); /* line to add */
842 /* creates a new screen buffer on process' console */
843 @REQ(create_console_output)
844 handle_t handle_in; /* handle to console input, or 0 for process' console */
845 int access; /* wanted access rights */
846 int share; /* sharing credentials */
847 int inherit; /* inherit flag */
849 handle_t handle_out; /* handle to the screen buffer */
853 /* Set info about a console (output only) */
854 @REQ(set_console_output_info)
855 handle_t handle; /* handle to the console */
856 int mask; /* setting mask (see below) */
857 short int cursor_size; /* size of cursor (percentage filled) */
858 short int cursor_visible;/* cursor visibility flag */
859 short int cursor_x; /* position of cursor (x, y) */
861 short int width; /* width of the screen buffer */
862 short int height; /* height of the screen buffer */
863 short int attr; /* default attribute */
864 short int win_left; /* window actually displayed by renderer */
865 short int win_top; /* the rect area is expressed withing the */
866 short int win_right; /* boundaries of the screen buffer */
867 short int win_bottom;
868 short int max_width; /* maximum size (width x height) for the window */
869 short int max_height;
871 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
872 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
873 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
874 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
875 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
876 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
879 /* Get info about a console (output only) */
880 @REQ(get_console_output_info)
881 handle_t handle; /* handle to the console */
883 short int cursor_size; /* size of cursor (percentage filled) */
884 short int cursor_visible;/* cursor visibility flag */
885 short int cursor_x; /* position of cursor (x, y) */
887 short int width; /* width of the screen buffer */
888 short int height; /* height of the screen buffer */
889 short int attr; /* default attribute */
890 short int win_left; /* window actually displayed by renderer */
891 short int win_top; /* the rect area is expressed withing the */
892 short int win_right; /* boundaries of the screen buffer */
893 short int win_bottom;
894 short int max_width; /* maximum size (width x height) for the window */
895 short int max_height;
898 /* Add input records to a console input queue */
899 @REQ(write_console_input)
900 handle_t handle; /* handle to the console input */
901 VARARG(rec,input_records); /* input records */
903 int written; /* number of records written */
907 /* Fetch input records from a console input queue */
908 @REQ(read_console_input)
909 handle_t handle; /* handle to the console input */
910 int flush; /* flush the retrieved records from the queue? */
912 int read; /* number of records read */
913 VARARG(rec,input_records); /* input records */
917 /* write data (chars and/or attributes) in a screen buffer */
918 @REQ(write_console_output)
919 handle_t handle; /* handle to the console output */
920 int x; /* position where to start writing */
922 int mode; /* char info (see below) */
923 int wrap; /* wrap around at end of line? */
924 VARARG(data,bytes); /* info to write */
926 int written; /* number of char infos actually written */
927 int width; /* width of screen buffer */
928 int height; /* height of screen buffer */
932 CHAR_INFO_MODE_TEXT, /* characters only */
933 CHAR_INFO_MODE_ATTR, /* attributes only */
934 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
935 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
939 /* fill a screen buffer with constant data (chars and/or attributes) */
940 @REQ(fill_console_output)
941 handle_t handle; /* handle to the console output */
942 int x; /* position where to start writing */
944 int mode; /* char info mode */
945 int count; /* number to write */
946 int wrap; /* wrap around at end of line? */
947 char_info_t data; /* data to write */
949 int written; /* number of char infos actually written */
953 /* read data (chars and/or attributes) from a screen buffer */
954 @REQ(read_console_output)
955 handle_t handle; /* handle to the console output */
956 int x; /* position (x,y) where to start reading */
958 int mode; /* char info mode */
959 int wrap; /* wrap around at end of line? */
961 int width; /* width of screen buffer */
962 int height; /* height of screen buffer */
966 /* move a rect (of data) in screen buffer content */
967 @REQ(move_console_output)
968 handle_t handle; /* handle to the console output */
969 short int x_src; /* position (x, y) of rect to start moving from */
971 short int x_dst; /* position (x, y) of rect to move to */
973 short int w; /* size of the rect (width, height) to move */
978 /* Create a change notification */
979 @REQ(create_change_notification)
980 int subtree; /* watch all the subtree */
981 int filter; /* notification filter */
983 handle_t handle; /* handle to the change notification */
987 /* Create a file mapping */
989 int size_high; /* mapping size */
990 int size_low; /* mapping size */
991 int protect; /* protection flags (see below) */
992 int inherit; /* inherit flag */
993 handle_t file_handle; /* file handle */
994 VARARG(name,unicode_str); /* object name */
996 handle_t handle; /* handle to the mapping */
998 /* protection flags */
999 #define VPROT_READ 0x01
1000 #define VPROT_WRITE 0x02
1001 #define VPROT_EXEC 0x04
1002 #define VPROT_WRITECOPY 0x08
1003 #define VPROT_GUARD 0x10
1004 #define VPROT_NOCACHE 0x20
1005 #define VPROT_COMMITTED 0x40
1006 #define VPROT_IMAGE 0x80
1009 /* Open a mapping */
1011 unsigned int access; /* wanted access rights */
1012 int inherit; /* inherit flag */
1013 VARARG(name,unicode_str); /* object name */
1015 handle_t handle; /* handle to the mapping */
1019 /* Get information about a file mapping */
1020 @REQ(get_mapping_info)
1021 handle_t handle; /* handle to the mapping */
1023 int size_high; /* mapping size */
1024 int size_low; /* mapping size */
1025 int protect; /* protection flags */
1026 int header_size; /* header size (for VPROT_IMAGE mapping) */
1027 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1028 handle_t shared_file; /* shared mapping file handle */
1029 int shared_size; /* shared mapping size */
1030 int drive_type; /* type of drive the file is on */
1034 /* Create a device */
1036 unsigned int access; /* wanted access rights */
1037 int inherit; /* inherit flag */
1038 int id; /* client private id */
1040 handle_t handle; /* handle to the device */
1044 /* Create a snapshot */
1045 @REQ(create_snapshot)
1046 int inherit; /* inherit flag */
1047 int flags; /* snapshot flags (TH32CS_*) */
1048 void* pid; /* process id */
1050 handle_t handle; /* handle to the snapshot */
1054 /* Get the next process from a snapshot */
1056 handle_t handle; /* handle to the snapshot */
1057 int reset; /* reset snapshot position? */
1059 int count; /* process usage count */
1060 void* pid; /* process id */
1061 int threads; /* number of threads */
1062 int priority; /* process priority */
1066 /* Get the next thread from a snapshot */
1068 handle_t handle; /* handle to the snapshot */
1069 int reset; /* reset snapshot position? */
1071 int count; /* thread usage count */
1072 void* pid; /* process id */
1073 void* tid; /* thread id */
1074 int base_pri; /* base priority */
1075 int delta_pri; /* delta priority */
1079 /* Get the next module from a snapshot */
1081 handle_t handle; /* handle to the snapshot */
1082 int reset; /* reset snapshot position? */
1084 void* pid; /* process id */
1085 void* base; /* module base address */
1089 /* Wait for a debug event */
1090 @REQ(wait_debug_event)
1091 int get_handle; /* should we alloc a handle for waiting? */
1093 void* pid; /* process id */
1094 void* tid; /* thread id */
1095 handle_t wait; /* wait handle if no event ready */
1096 VARARG(event,debug_event); /* debug event data */
1100 /* Queue an exception event */
1101 @REQ(queue_exception_event)
1102 int first; /* first chance exception? */
1103 VARARG(record,exc_event); /* thread context followed by exception record */
1105 handle_t handle; /* handle to the queued event */
1109 /* Retrieve the status of an exception event */
1110 @REQ(get_exception_status)
1111 handle_t handle; /* handle to the queued event */
1113 int status; /* event continuation status */
1114 VARARG(context,context); /* modified thread context */
1118 /* Send an output string to the debugger */
1119 @REQ(output_debug_string)
1120 void* string; /* string to display (in debugged process address space) */
1121 int unicode; /* is it Unicode? */
1122 int length; /* string length */
1126 /* Continue a debug event */
1127 @REQ(continue_debug_event)
1128 void* pid; /* process id to continue */
1129 void* tid; /* thread id to continue */
1130 int status; /* continuation status */
1134 /* Start/stop debugging an existing process */
1136 void* pid; /* id of the process to debug */
1137 int attach; /* 1=attaching / 0=detaching from the process */
1141 /* Simulate a breakpoint in a process */
1143 handle_t handle; /* process handle */
1145 int self; /* was it the caller itself? */
1149 /* Set debugger kill on exit flag */
1150 @REQ(set_debugger_kill_on_exit)
1151 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1155 /* Read data from a process address space */
1156 @REQ(read_process_memory)
1157 handle_t handle; /* process handle */
1158 void* addr; /* addr to read from */
1160 VARARG(data,bytes); /* result data */
1164 /* Write data to a process address space */
1165 @REQ(write_process_memory)
1166 handle_t handle; /* process handle */
1167 void* addr; /* addr to write to (must be int-aligned) */
1168 unsigned int first_mask; /* mask for first word */
1169 unsigned int last_mask; /* mask for last word */
1170 VARARG(data,bytes); /* data to write */
1174 /* Create a registry key */
1176 handle_t parent; /* handle to the parent key */
1177 unsigned int access; /* desired access rights */
1178 unsigned int options; /* creation options */
1179 time_t modif; /* last modification time */
1180 size_t namelen; /* length of key name in bytes */
1181 VARARG(name,unicode_str,namelen); /* key name */
1182 VARARG(class,unicode_str); /* class name */
1184 handle_t hkey; /* handle to the created key */
1185 int created; /* has it been newly created? */
1188 /* Open a registry key */
1190 handle_t parent; /* handle to the parent key */
1191 unsigned int access; /* desired access rights */
1192 VARARG(name,unicode_str); /* key name */
1194 handle_t hkey; /* handle to the open key */
1198 /* Delete a registry key */
1200 handle_t hkey; /* handle to the key */
1204 /* Enumerate registry subkeys */
1206 handle_t hkey; /* handle to registry key */
1207 int index; /* index of subkey (or -1 for current key) */
1208 int info_class; /* requested information class */
1210 int subkeys; /* number of subkeys */
1211 int max_subkey; /* longest subkey name */
1212 int max_class; /* longest class name */
1213 int values; /* number of values */
1214 int max_value; /* longest value name */
1215 int max_data; /* longest value data */
1216 time_t modif; /* last modification time */
1217 size_t total; /* total length needed for full name and class */
1218 size_t namelen; /* length of key name in bytes */
1219 VARARG(name,unicode_str,namelen); /* key name */
1220 VARARG(class,unicode_str); /* class name */
1224 /* Set a value of a registry key */
1226 handle_t hkey; /* handle to registry key */
1227 int type; /* value type */
1228 size_t namelen; /* length of value name in bytes */
1229 VARARG(name,unicode_str,namelen); /* value name */
1230 VARARG(data,bytes); /* value data */
1234 /* Retrieve the value of a registry key */
1236 handle_t hkey; /* handle to registry key */
1237 VARARG(name,unicode_str); /* value name */
1239 int type; /* value type */
1240 size_t total; /* total length needed for data */
1241 VARARG(data,bytes); /* value data */
1245 /* Enumerate a value of a registry key */
1246 @REQ(enum_key_value)
1247 handle_t hkey; /* handle to registry key */
1248 int index; /* value index */
1249 int info_class; /* requested information class */
1251 int type; /* value type */
1252 size_t total; /* total length needed for full name and data */
1253 size_t namelen; /* length of value name in bytes */
1254 VARARG(name,unicode_str,namelen); /* value name */
1255 VARARG(data,bytes); /* value data */
1259 /* Delete a value of a registry key */
1260 @REQ(delete_key_value)
1261 handle_t hkey; /* handle to registry key */
1262 VARARG(name,unicode_str); /* value name */
1266 /* Load a registry branch from a file */
1268 handle_t hkey; /* root key to load to */
1269 handle_t file; /* file to load from */
1270 VARARG(name,unicode_str); /* subkey name */
1274 /* Save a registry branch to a file */
1276 handle_t hkey; /* key to save */
1277 handle_t file; /* file to save to */
1281 /* Save a registry branch at server exit */
1282 @REQ(save_registry_atexit)
1283 handle_t hkey; /* key to save */
1284 VARARG(file,string); /* file to save to */
1288 /* Set the current and saving level for the registry */
1289 @REQ(set_registry_levels)
1290 int current; /* new current level */
1291 int saving; /* new saving level */
1292 int period; /* duration between periodic saves (milliseconds) */
1296 /* Create a waitable timer */
1298 int inherit; /* inherit flag */
1299 int manual; /* manual reset */
1300 VARARG(name,unicode_str); /* object name */
1302 handle_t handle; /* handle to the timer */
1306 /* Open a waitable timer */
1308 unsigned int access; /* wanted access rights */
1309 int inherit; /* inherit flag */
1310 VARARG(name,unicode_str); /* object name */
1312 handle_t handle; /* handle to the timer */
1315 /* Set a waitable timer */
1317 handle_t handle; /* handle to the timer */
1318 int sec; /* next expiration absolute time */
1319 int usec; /* next expiration absolute time */
1320 int period; /* timer period in ms */
1321 void* callback; /* callback function */
1322 void* arg; /* callback argument */
1325 /* Cancel a waitable timer */
1327 handle_t handle; /* handle to the timer */
1331 /* Retrieve the current context of a thread */
1332 @REQ(get_thread_context)
1333 handle_t handle; /* thread handle */
1334 unsigned int flags; /* context flags */
1336 VARARG(context,context); /* thread context */
1340 /* Set the current context of a thread */
1341 @REQ(set_thread_context)
1342 handle_t handle; /* thread handle */
1343 unsigned int flags; /* context flags */
1344 VARARG(context,context); /* thread context */
1348 /* Fetch a selector entry for a thread */
1349 @REQ(get_selector_entry)
1350 handle_t handle; /* thread handle */
1351 int entry; /* LDT entry */
1353 unsigned int base; /* selector base */
1354 unsigned int limit; /* selector limit */
1355 unsigned char flags; /* selector flags */
1361 int local; /* is atom in local process table? */
1362 VARARG(name,unicode_str); /* atom name */
1364 atom_t atom; /* resulting atom */
1368 /* Delete an atom */
1370 atom_t atom; /* atom handle */
1371 int local; /* is atom in local process table? */
1377 int local; /* is atom in local process table? */
1378 VARARG(name,unicode_str); /* atom name */
1380 atom_t atom; /* atom handle */
1384 /* Get an atom name */
1386 atom_t atom; /* atom handle */
1387 int local; /* is atom in local process table? */
1389 int count; /* atom lock count */
1390 VARARG(name,unicode_str); /* atom name */
1394 /* Init the process atom table */
1395 @REQ(init_atom_table)
1396 int entries; /* number of entries */
1400 /* Get the message queue of the current thread */
1403 handle_t handle; /* handle to the queue */
1407 /* Set the current message queue wakeup mask */
1408 @REQ(set_queue_mask)
1409 unsigned int wake_mask; /* wakeup bits mask */
1410 unsigned int changed_mask; /* changed bits mask */
1411 int skip_wait; /* will we skip waiting if signaled? */
1413 unsigned int wake_bits; /* current wake bits */
1414 unsigned int changed_bits; /* current changed bits */
1418 /* Get the current message queue status */
1419 @REQ(get_queue_status)
1420 int clear; /* should we clear the change bits? */
1422 unsigned int wake_bits; /* wake bits */
1423 unsigned int changed_bits; /* changed bits since last time */
1427 /* Wait for a process to start waiting on input */
1428 @REQ(wait_input_idle)
1429 handle_t handle; /* process handle */
1430 int timeout; /* timeout */
1432 handle_t event; /* handle to idle event */
1436 /* Send a message to a thread queue */
1438 void* id; /* thread id */
1439 int type; /* message type (see below) */
1440 user_handle_t win; /* window handle */
1441 unsigned int msg; /* message code */
1442 unsigned int wparam; /* parameters */
1443 unsigned int lparam; /* parameters */
1444 int x; /* x position */
1445 int y; /* y position */
1446 unsigned int time; /* message time */
1447 unsigned int info; /* extra info */
1448 int timeout; /* timeout for reply */
1449 VARARG(data,bytes); /* message data for sent messages */
1454 MSG_ASCII, /* Ascii message (from SendMessageA) */
1455 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1456 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1457 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1458 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1459 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1460 MSG_HARDWARE_RAW, /* raw hardware message */
1461 MSG_HARDWARE_COOKED /* cooked hardware message */
1465 /* Get a message from the current queue */
1467 int flags; /* see below */
1468 user_handle_t get_win; /* window handle to get */
1469 unsigned int get_first; /* first message code to get */
1470 unsigned int get_last; /* last message code to get */
1472 int type; /* message type */
1473 user_handle_t win; /* window handle */
1474 unsigned int msg; /* message code */
1475 unsigned int wparam; /* parameters */
1476 unsigned int lparam; /* parameters */
1477 int x; /* x position */
1478 int y; /* y position */
1479 unsigned int time; /* message time */
1480 unsigned int info; /* extra info */
1481 size_t total; /* total size of extra data */
1482 VARARG(data,bytes); /* message data for sent messages */
1484 #define GET_MSG_REMOVE 1 /* remove the message */
1485 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1486 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1488 /* Reply to a sent message */
1490 unsigned int result; /* message result */
1491 int remove; /* should we remove the message? */
1492 VARARG(data,bytes); /* message data for sent messages */
1496 /* Retrieve the reply for the last message sent */
1497 @REQ(get_message_reply)
1498 int cancel; /* cancel message if not ready? */
1500 unsigned int result; /* message result */
1501 VARARG(data,bytes); /* message data for sent messages */
1505 /* Set a window timer */
1507 user_handle_t win; /* window handle */
1508 unsigned int msg; /* message to post */
1509 unsigned int id; /* timer id */
1510 unsigned int rate; /* timer rate in ms */
1511 unsigned int lparam; /* message lparam (callback proc) */
1515 /* Kill a window timer */
1516 @REQ(kill_win_timer)
1517 user_handle_t win; /* window handle */
1518 unsigned int msg; /* message to post */
1519 unsigned int id; /* timer id */
1523 /* Open a serial port */
1525 unsigned int access; /* wanted access rights */
1526 int inherit; /* inherit flag */
1527 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1528 unsigned int sharing; /* sharing flags */
1529 VARARG(name,string); /* file name */
1531 handle_t handle; /* handle to the port */
1535 /* Retrieve info about a serial port */
1536 @REQ(get_serial_info)
1537 handle_t handle; /* handle to comm port */
1539 unsigned int readinterval;
1540 unsigned int readconst;
1541 unsigned int readmult;
1542 unsigned int writeconst;
1543 unsigned int writemult;
1544 unsigned int eventmask;
1545 unsigned int commerror;
1549 /* Set info about a serial port */
1550 @REQ(set_serial_info)
1551 handle_t handle; /* handle to comm port */
1552 int flags; /* bitmask to set values (see below) */
1553 unsigned int readinterval;
1554 unsigned int readconst;
1555 unsigned int readmult;
1556 unsigned int writeconst;
1557 unsigned int writemult;
1558 unsigned int eventmask;
1559 unsigned int commerror;
1561 #define SERIALINFO_SET_TIMEOUTS 0x01
1562 #define SERIALINFO_SET_MASK 0x02
1563 #define SERIALINFO_SET_ERROR 0x04
1566 /* Create/Destroy an async I/O */
1567 @REQ(register_async)
1568 handle_t handle; /* handle to comm port, socket or file */
1573 unsigned int status;
1575 #define ASYNC_TYPE_NONE 0x00
1576 #define ASYNC_TYPE_READ 0x01
1577 #define ASYNC_TYPE_WRITE 0x02
1578 #define ASYNC_TYPE_WAIT 0x03
1581 /* Create a named pipe */
1582 @REQ(create_named_pipe)
1583 unsigned int openmode;
1584 unsigned int pipemode;
1585 unsigned int maxinstances;
1586 unsigned int outsize;
1587 unsigned int insize;
1588 unsigned int timeout;
1589 VARARG(name,unicode_str); /* pipe name */
1591 handle_t handle; /* handle to the pipe */
1595 /* Open an existing named pipe */
1596 @REQ(open_named_pipe)
1597 unsigned int access;
1598 VARARG(name,unicode_str); /* pipe name */
1600 handle_t handle; /* handle to the pipe */
1604 /* Connect to a named pipe */
1605 @REQ(connect_named_pipe)
1612 /* Wait for a named pipe */
1613 @REQ(wait_named_pipe)
1614 unsigned int timeout;
1617 VARARG(name,unicode_str); /* pipe name */
1621 /* Disconnect a named pipe */
1622 @REQ(disconnect_named_pipe)
1627 @REQ(get_named_pipe_info)
1631 unsigned int maxinstances;
1632 unsigned int outsize;
1633 unsigned int insize;
1637 /* Create a window */
1639 user_handle_t parent; /* parent window */
1640 user_handle_t owner; /* owner window */
1641 atom_t atom; /* class atom */
1643 user_handle_t handle; /* created window */
1647 /* Link a window into the tree */
1649 user_handle_t handle; /* handle to the window */
1650 user_handle_t parent; /* handle to the parent */
1651 user_handle_t previous; /* previous child in Z-order */
1653 user_handle_t full_parent; /* full handle of new parent */
1657 /* Destroy a window */
1658 @REQ(destroy_window)
1659 user_handle_t handle; /* handle to the window */
1663 /* Set a window owner */
1664 @REQ(set_window_owner)
1665 user_handle_t handle; /* handle to the window */
1666 user_handle_t owner; /* new owner */
1668 user_handle_t full_owner; /* full handle of new owner */
1672 /* Get information from a window handle */
1673 @REQ(get_window_info)
1674 user_handle_t handle; /* handle to the window */
1676 user_handle_t full_handle; /* full 32-bit handle */
1677 void* pid; /* process owning the window */
1678 void* tid; /* thread owning the window */
1679 atom_t atom; /* class atom */
1683 /* Set some information in a window */
1684 @REQ(set_window_info)
1685 user_handle_t handle; /* handle to the window */
1686 unsigned int flags; /* flags for fields to set (see below) */
1687 unsigned int style; /* window style */
1688 unsigned int ex_style; /* window extended style */
1689 unsigned int id; /* window id */
1690 void* instance; /* creator instance */
1691 void* user_data; /* user-specific data */
1693 unsigned int old_style; /* old window style */
1694 unsigned int old_ex_style; /* old window extended style */
1695 unsigned int old_id; /* old window id */
1696 void* old_instance; /* old creator instance */
1697 void* old_user_data; /* old user-specific data */
1699 #define SET_WIN_STYLE 0x01
1700 #define SET_WIN_EXSTYLE 0x02
1701 #define SET_WIN_ID 0x04
1702 #define SET_WIN_INSTANCE 0x08
1703 #define SET_WIN_USERDATA 0x10
1706 /* Get a list of the window parents, up to the root of the tree */
1707 @REQ(get_window_parents)
1708 user_handle_t handle; /* handle to the window */
1710 int count; /* total count of parents */
1711 VARARG(parents,user_handles); /* parent handles */
1715 /* Get a list of the window children */
1716 @REQ(get_window_children)
1717 user_handle_t parent; /* parent window */
1718 atom_t atom; /* class atom for the listed children */
1719 void* tid; /* thread owning the listed children */
1721 int count; /* total count of children */
1722 VARARG(children,user_handles); /* children handles */
1726 /* Get window tree information from a window handle */
1727 @REQ(get_window_tree)
1728 user_handle_t handle; /* handle to the window */
1730 user_handle_t parent; /* parent window */
1731 user_handle_t owner; /* owner window */
1732 user_handle_t next_sibling; /* next sibling in Z-order */
1733 user_handle_t prev_sibling; /* prev sibling in Z-order */
1734 user_handle_t first_sibling; /* first sibling in Z-order */
1735 user_handle_t last_sibling; /* last sibling in Z-order */
1736 user_handle_t first_child; /* first child */
1737 user_handle_t last_child; /* last child */
1740 /* Set the window and client rectangles of a window */
1741 @REQ(set_window_rectangles)
1742 user_handle_t handle; /* handle to the window */
1743 rectangle_t window; /* window rectangle */
1744 rectangle_t client; /* client rectangle */
1748 /* Get the window and client rectangles of a window */
1749 @REQ(get_window_rectangles)
1750 user_handle_t handle; /* handle to the window */
1752 rectangle_t window; /* window rectangle */
1753 rectangle_t client; /* client rectangle */
1757 /* Get the window text */
1758 @REQ(get_window_text)
1759 user_handle_t handle; /* handle to the window */
1761 VARARG(text,unicode_str); /* window text */
1765 /* Set the window text */
1766 @REQ(set_window_text)
1767 user_handle_t handle; /* handle to the window */
1768 VARARG(text,unicode_str); /* window text */
1772 /* Increment the window paint count */
1773 @REQ(inc_window_paint_count)
1774 user_handle_t handle; /* handle to the window */
1775 int incr; /* increment (can be negative) */
1779 /* Get the coordinates offset between two windows */
1780 @REQ(get_windows_offset)
1781 user_handle_t from; /* handle to the first window */
1782 user_handle_t to; /* handle to the second window */
1784 int x; /* x coordinate offset */
1785 int y; /* y coordinate offset */
1789 /* Set a window property */
1790 @REQ(set_window_property)
1791 user_handle_t window; /* handle to the window */
1792 atom_t atom; /* property atom (high-word set if it was a string) */
1793 int string; /* was atom a string originally? */
1794 handle_t handle; /* handle to store */
1798 /* Remove a window property */
1799 @REQ(remove_window_property)
1800 user_handle_t window; /* handle to the window */
1801 atom_t atom; /* property atom */
1803 handle_t handle; /* handle stored in property */
1807 /* Get a window property */
1808 @REQ(get_window_property)
1809 user_handle_t window; /* handle to the window */
1810 atom_t atom; /* property atom */
1812 handle_t handle; /* handle stored in property */
1816 /* Get the list of properties of a window */
1817 @REQ(get_window_properties)
1818 user_handle_t window; /* handle to the window */
1820 int total; /* total number of properties */
1821 VARARG(props,properties); /* list of properties */