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
11 @HEADER /* start of C declarations */
19 int req; /* request code */
20 unsigned short var_offset; /* offset of the variable part of the request */
21 unsigned short var_size; /* size of the variable part of the request */
22 unsigned int error; /* error result */
27 unsigned int error; /* error result */
28 unsigned short var_offset; /* offset of the variable part of the request */
29 unsigned short var_size; /* size of the variable part of the request */
32 /* placeholder structure for the maximum allowed request size */
33 /* this is used to construct the generic_request union */
34 struct request_max_size
36 int pad[16]; /* the max request size is 16 ints */
39 /* max size of the variable part of a request */
40 #define REQUEST_MAX_VAR_SIZE 1024
43 typedef unsigned short atom_t;
44 typedef unsigned int user_handle_t;
46 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
47 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
50 /* definitions of the event data depending on the event code */
51 struct debug_event_exception
53 EXCEPTION_RECORD record; /* exception record */
54 int first; /* first chance exception? */
56 struct debug_event_create_thread
58 handle_t handle; /* handle to the new thread */
59 void *teb; /* thread teb (in debugged process address space) */
60 void *start; /* thread startup routine */
62 struct debug_event_create_process
64 handle_t file; /* handle to the process exe file */
65 handle_t process; /* handle to the new process */
66 handle_t thread; /* handle to the new thread */
67 void *base; /* base of executable image */
68 int dbg_offset; /* offset of debug info in file */
69 int dbg_size; /* size of debug info */
70 void *teb; /* thread teb (in debugged process address space) */
71 void *start; /* thread startup routine */
72 void *name; /* image name (optional) */
73 int unicode; /* is it Unicode? */
75 struct debug_event_exit
77 int exit_code; /* thread or process exit code */
79 struct debug_event_load_dll
81 handle_t handle; /* file handle for the dll */
82 void *base; /* base address of the dll */
83 int dbg_offset; /* offset of debug info in file */
84 int dbg_size; /* size of debug info */
85 void *name; /* image name (optional) */
86 int unicode; /* is it Unicode? */
88 struct debug_event_unload_dll
90 void *base; /* base address of the dll */
92 struct debug_event_output_string
94 void *string; /* string to display (in debugged process address space) */
95 int unicode; /* is it Unicode? */
96 int length; /* string length */
98 struct debug_event_rip_info
103 union debug_event_data
105 struct debug_event_exception exception;
106 struct debug_event_create_thread create_thread;
107 struct debug_event_create_process create_process;
108 struct debug_event_exit exit;
109 struct debug_event_load_dll load_dll;
110 struct debug_event_unload_dll unload_dll;
111 struct debug_event_output_string output_string;
112 struct debug_event_rip_info rip_info;
115 /* debug event data */
118 int code; /* event code */
119 union debug_event_data info; /* event information */
122 /* structure used in sending an fd from client to server */
125 void *tid; /* thread id */
126 int fd; /* file descriptor on client-side */
129 /* structure sent by the server on the wait fifo */
132 void *cookie; /* magic cookie that was passed in select_request */
133 int signaled; /* wait result */
136 /* structure returned in the list of window properties */
139 atom_t atom; /* property atom */
140 short string; /* was atom a string originally? */
141 handle_t handle; /* handle stored in property */
144 /* structure to specify window rectangles */
153 /****************************************************************/
154 /* Request declarations */
156 /* Create a new process from the context of the parent */
158 int inherit_all; /* inherit all handles from parent */
159 int create_flags; /* creation flags */
160 int start_flags; /* flags from startup info */
161 handle_t exe_file; /* file handle for main exe */
162 handle_t hstdin; /* handle for stdin */
163 handle_t hstdout; /* handle for stdout */
164 handle_t hstderr; /* handle for stderr */
165 int cmd_show; /* main window show mode */
166 VARARG(filename,string); /* file name of main exe */
168 handle_t info; /* new process info handle */
172 /* Retrieve information about a newly started process */
173 @REQ(get_new_process_info)
174 handle_t info; /* info handle returned from new_process_request */
175 int pinherit; /* process handle inherit flag */
176 int tinherit; /* thread handle inherit flag */
178 void* pid; /* process id */
179 handle_t phandle; /* process handle (in the current process) */
180 void* tid; /* thread id */
181 handle_t thandle; /* thread handle (in the current process) */
182 handle_t event; /* event handle to signal startup */
186 /* Create a new thread from the context of the parent */
188 int suspend; /* new thread should be suspended on creation */
189 int inherit; /* inherit flag */
190 int request_fd; /* fd for request pipe */
192 void* tid; /* thread id */
193 handle_t handle; /* thread handle (in the current process) */
197 /* Signal that we are finished booting on the client side */
199 int debug_level; /* new debug level */
203 /* Initialize a process; called from the new process context */
205 void* ldt_copy; /* addr of LDT copy */
206 int ppid; /* parent Unix pid */
208 int create_flags; /* creation flags */
209 int start_flags; /* flags from startup info */
210 unsigned int server_start; /* server start time (GetTickCount) */
211 handle_t exe_file; /* file handle for main exe */
212 handle_t hstdin; /* handle for stdin */
213 handle_t hstdout; /* handle for stdout */
214 handle_t hstderr; /* handle for stderr */
215 int cmd_show; /* main window show mode */
216 VARARG(filename,string); /* file name of main exe */
220 /* Signal the end of the process initialization */
221 @REQ(init_process_done)
222 void* module; /* main module base address */
223 void* entry; /* process entry point */
224 void* name; /* ptr to ptr to name (in process addr space) */
225 handle_t exe_file; /* file handle for main exe */
226 int gui; /* is it a GUI process? */
228 int debugged; /* being debugged? */
232 /* Initialize a thread; called from the child after fork()/clone() */
234 int unix_pid; /* Unix pid of new thread */
235 void* teb; /* TEB of new thread (in thread address space) */
236 void* entry; /* thread entry point (in thread address space) */
237 int reply_fd; /* fd for reply pipe */
238 int wait_fd; /* fd for blocking calls pipe */
240 void* pid; /* process id of the new thread's process */
241 void* tid; /* thread id of the new thread */
242 int boot; /* is this the boot thread? */
243 int version; /* protocol version */
247 /* Set the shared buffer for a thread */
248 @REQ(set_thread_buffer)
249 int fd; /* fd to mmap as shared buffer */
251 unsigned int offset; /* offset of buffer in file */
252 unsigned int size; /* size of buffer */
256 /* Terminate a process */
257 @REQ(terminate_process)
258 handle_t handle; /* process handle to terminate */
259 int exit_code; /* process exit code */
261 int self; /* suicide? */
265 /* Terminate a thread */
266 @REQ(terminate_thread)
267 handle_t handle; /* thread handle to terminate */
268 int exit_code; /* thread exit code */
270 int self; /* suicide? */
271 int last; /* last thread in this process? */
275 /* Retrieve information about a process */
276 @REQ(get_process_info)
277 handle_t handle; /* process handle */
279 void* pid; /* server process id */
280 int debugged; /* debugged? */
281 int exit_code; /* process exit code */
282 int priority; /* priority class */
283 int process_affinity; /* process affinity mask */
284 int system_affinity; /* system affinity mask */
288 /* Set a process informations */
289 @REQ(set_process_info)
290 handle_t handle; /* process handle */
291 int mask; /* setting mask (see below) */
292 int priority; /* priority class */
293 int affinity; /* affinity mask */
295 #define SET_PROCESS_INFO_PRIORITY 0x01
296 #define SET_PROCESS_INFO_AFFINITY 0x02
299 /* Retrieve information about a thread */
300 @REQ(get_thread_info)
301 handle_t handle; /* thread handle */
302 void* tid_in; /* thread id (optional) */
304 void* tid; /* server thread id */
305 void* teb; /* thread teb pointer */
306 int exit_code; /* thread exit code */
307 int priority; /* thread priority level */
311 /* Set a thread informations */
312 @REQ(set_thread_info)
313 handle_t handle; /* thread handle */
314 int mask; /* setting mask (see below) */
315 int priority; /* priority class */
316 int affinity; /* affinity mask */
318 #define SET_THREAD_INFO_PRIORITY 0x01
319 #define SET_THREAD_INFO_AFFINITY 0x02
322 /* Suspend a thread */
324 handle_t handle; /* thread handle */
326 int count; /* new suspend count */
330 /* Resume a thread */
332 handle_t handle; /* thread handle */
334 int count; /* new suspend count */
338 /* Notify the server that a dll has been loaded */
340 handle_t handle; /* file handle */
341 void* base; /* base address */
342 int dbg_offset; /* debug info offset */
343 int dbg_size; /* debug info size */
344 void* name; /* ptr to ptr to name (in process addr space) */
348 /* Notify the server that a dll is being unloaded */
350 void* base; /* base address */
354 /* Queue an APC for a thread */
356 handle_t handle; /* thread handle */
357 int user; /* user or system apc? */
358 void* func; /* function to call */
359 void* param; /* param for function to call */
363 /* Get next APC to call */
365 int alertable; /* is thread alertable? */
367 void* func; /* function to call */
368 int type; /* function type */
369 VARARG(args,ptrs); /* function arguments */
371 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
374 /* Close a handle for the current process */
376 handle_t handle; /* handle to close */
378 int fd; /* associated fd to close */
382 /* Set a handle information */
383 @REQ(set_handle_info)
384 handle_t handle; /* handle we are interested in */
385 int flags; /* new handle flags */
386 int mask; /* mask for flags to set */
387 int fd; /* file descriptor or -1 */
389 int old_flags; /* old flag value */
390 int cur_fd; /* current file descriptor */
394 /* Duplicate a handle */
396 handle_t src_process; /* src process handle */
397 handle_t src_handle; /* src handle to duplicate */
398 handle_t dst_process; /* dst process handle */
399 unsigned int access; /* wanted access rights */
400 int inherit; /* inherit flag */
401 int options; /* duplicate options (see below) */
403 handle_t handle; /* duplicated handle in dst process */
404 int fd; /* associated fd to close */
406 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
407 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
408 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
411 /* Open a handle to a process */
413 void* pid; /* process id to open */
414 unsigned int access; /* wanted access rights */
415 int inherit; /* inherit flag */
417 handle_t handle; /* handle to the process */
421 /* Wait for handles */
423 int flags; /* wait flags (see below) */
424 void* cookie; /* magic cookie to return to client */
425 int sec; /* absolute timeout */
426 int usec; /* absolute timeout */
427 VARARG(handles,handles); /* handles to select on */
430 #define SELECT_ALERTABLE 2
431 #define SELECT_INTERRUPTIBLE 4
432 #define SELECT_TIMEOUT 8
435 /* Create an event */
437 int manual_reset; /* manual reset event */
438 int initial_state; /* initial state of the event */
439 int inherit; /* inherit flag */
440 VARARG(name,unicode_str); /* object name */
442 handle_t handle; /* handle to the event */
445 /* Event operation */
447 handle_t handle; /* handle to event */
448 int op; /* event operation (see below) */
450 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
455 unsigned int access; /* wanted access rights */
456 int inherit; /* inherit flag */
457 VARARG(name,unicode_str); /* object name */
459 handle_t handle; /* handle to the event */
465 int owned; /* initially owned? */
466 int inherit; /* inherit flag */
467 VARARG(name,unicode_str); /* object name */
469 handle_t handle; /* handle to the mutex */
473 /* Release a mutex */
475 handle_t handle; /* handle to the mutex */
481 unsigned int access; /* wanted access rights */
482 int inherit; /* inherit flag */
483 VARARG(name,unicode_str); /* object name */
485 handle_t handle; /* handle to the mutex */
489 /* Create a semaphore */
490 @REQ(create_semaphore)
491 unsigned int initial; /* initial count */
492 unsigned int max; /* maximum count */
493 int inherit; /* inherit flag */
494 VARARG(name,unicode_str); /* object name */
496 handle_t handle; /* handle to the semaphore */
500 /* Release a semaphore */
501 @REQ(release_semaphore)
502 handle_t handle; /* handle to the semaphore */
503 unsigned int count; /* count to add to semaphore */
505 unsigned int prev_count; /* previous semaphore count */
509 /* Open a semaphore */
511 unsigned int access; /* wanted access rights */
512 int inherit; /* inherit flag */
513 VARARG(name,unicode_str); /* object name */
515 handle_t handle; /* handle to the semaphore */
521 unsigned int access; /* wanted access rights */
522 int inherit; /* inherit flag */
523 unsigned int sharing; /* sharing flags */
524 int create; /* file create action */
525 unsigned int attrs; /* file attributes for creation */
526 int drive_type; /* type of drive the file is on */
527 VARARG(filename,string); /* file name */
529 handle_t handle; /* handle to the file */
533 /* Allocate a file handle for a Unix fd */
534 @REQ(alloc_file_handle)
535 unsigned int access; /* wanted access rights */
536 int inherit; /* inherit flag */
537 int fd; /* file descriptor on the client side */
539 handle_t handle; /* handle to the file */
543 /* Get a Unix fd to access a file */
545 handle_t handle; /* handle to the file */
546 unsigned int access; /* wanted access rights */
548 int fd; /* file descriptor */
549 int type; /* the type of file */
551 #define FD_TYPE_INVALID 0
552 #define FD_TYPE_DEFAULT 1
553 #define FD_TYPE_CONSOLE 2
554 #define FD_TYPE_OVERLAPPED 3
555 #define FD_TYPE_TIMEOUT 4
558 /* Set a file current position */
559 @REQ(set_file_pointer)
560 handle_t handle; /* handle to the file */
561 int low; /* position low word */
562 int high; /* position high word */
563 int whence; /* whence to seek */
565 int new_low; /* new position low word */
566 int new_high; /* new position high word */
570 /* Truncate (or extend) a file */
572 handle_t handle; /* handle to the file */
576 /* Set a file access and modification times */
578 handle_t handle; /* handle to the file */
579 time_t access_time; /* last access time */
580 time_t write_time; /* last write time */
584 /* Flush a file buffers */
586 handle_t handle; /* handle to the file */
590 /* Get information about a file */
592 handle_t handle; /* handle to the file */
594 int type; /* file type */
595 int attr; /* file attributes */
596 time_t access_time; /* last access time */
597 time_t write_time; /* last write time */
598 int size_high; /* file size */
599 int size_low; /* file size */
600 int links; /* number of links */
601 int index_high; /* unique index */
602 int index_low; /* unique index */
603 unsigned int serial; /* volume serial number */
607 /* Lock a region of a file */
609 handle_t handle; /* handle to the file */
610 unsigned int offset_low; /* offset of start of lock */
611 unsigned int offset_high; /* offset of start of lock */
612 unsigned int count_low; /* count of bytes to lock */
613 unsigned int count_high; /* count of bytes to lock */
617 /* Unlock a region of a file */
619 handle_t handle; /* handle to the file */
620 unsigned int offset_low; /* offset of start of unlock */
621 unsigned int offset_high; /* offset of start of unlock */
622 unsigned int count_low; /* count of bytes to unlock */
623 unsigned int count_high; /* count of bytes to unlock */
627 /* Create an anonymous pipe */
629 int inherit; /* inherit flag */
631 handle_t handle_read; /* handle to the read-side of the pipe */
632 handle_t handle_write; /* handle to the write-side of the pipe */
636 /* Create a socket */
638 unsigned int access; /* wanted access rights */
639 int inherit; /* inherit flag */
640 int family; /* family, see socket manpage */
641 int type; /* type, see socket manpage */
642 int protocol; /* protocol, see socket manpage */
644 handle_t handle; /* handle to the new socket */
648 /* Accept a socket */
650 handle_t lhandle; /* handle to the listening socket */
651 unsigned int access; /* wanted access rights */
652 int inherit; /* inherit flag */
654 handle_t handle; /* handle to the new socket */
658 /* Set socket event parameters */
659 @REQ(set_socket_event)
660 handle_t handle; /* handle to the socket */
661 unsigned int mask; /* event mask */
662 handle_t event; /* event object */
666 /* Get socket event parameters */
667 @REQ(get_socket_event)
668 handle_t handle; /* handle to the socket */
669 int service; /* clear pending? */
670 handle_t s_event; /* "expected" event object */
671 handle_t c_event; /* event to clear */
673 unsigned int mask; /* event mask */
674 unsigned int pmask; /* pending events */
675 unsigned int state; /* status bits */
676 VARARG(errors,ints); /* event errors */
680 /* Reenable pending socket events */
681 @REQ(enable_socket_event)
682 handle_t handle; /* handle to the socket */
683 unsigned int mask; /* events to re-enable */
684 unsigned int sstate; /* status bits to set */
685 unsigned int cstate; /* status bits to clear */
689 /* Allocate a console (only used by a console renderer) */
691 unsigned int access; /* wanted access rights */
692 int inherit; /* inherit flag */
693 void* pid; /* pid of process which shall be attached to the console */
695 handle_t handle_in; /* handle to console input */
696 handle_t event; /* handle to renderer events change notification */
700 /* Free the console of the current process */
705 #define CONSOLE_RENDERER_NONE_EVENT 0x00
706 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
707 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
708 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
709 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
710 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
711 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
712 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
713 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
714 struct console_renderer_event
749 /* retrieve console events for the renderer */
750 @REQ(get_console_renderer_events)
751 handle_t handle; /* handle to console input events */
753 VARARG(data,bytes); /* the various console_renderer_events */
757 /* Open a handle to the process console */
759 int from; /* 0 (resp 1) input (resp output) of current process console */
760 /* otherwise console_in handle to get active screen buffer? */
761 unsigned int access; /* wanted access rights */
762 int inherit; /* inherit flag */
763 int share; /* share mask (only for output handles) */
765 handle_t handle; /* handle to the console */
769 /* Get a console mode (input or output) */
770 @REQ(get_console_mode)
771 handle_t handle; /* handle to the console */
773 int mode; /* console mode */
777 /* Set a console mode (input or output) */
778 @REQ(set_console_mode)
779 handle_t handle; /* handle to the console */
780 int mode; /* console mode */
784 /* Set info about a console (input only) */
785 @REQ(set_console_input_info)
786 handle_t handle; /* handle to console input, or 0 for process' console */
787 int mask; /* setting mask (see below) */
788 handle_t active_sb; /* active screen buffer */
789 int history_mode; /* whether we duplicate lines in history */
790 int history_size; /* number of lines in history */
791 VARARG(title,unicode_str); /* console title */
793 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
794 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
795 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
796 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
799 /* Get info about a console (input only) */
800 @REQ(get_console_input_info)
801 handle_t handle; /* handle to console input, or 0 for process' console */
803 int history_mode; /* whether we duplicate lines in history */
804 int history_size; /* number of lines in history */
805 int history_index; /* number of used lines in history */
806 VARARG(title,unicode_str); /* console title */
810 /* appends a string to console's history */
811 @REQ(append_console_input_history)
812 handle_t handle; /* handle to console input, or 0 for process' console */
813 VARARG(line,unicode_str); /* line to add */
817 /* appends a string to console's history */
818 @REQ(get_console_input_history)
819 handle_t handle; /* handle to console input, or 0 for process' console */
820 int index; /* index to get line from */
822 VARARG(line,unicode_str); /* line to add */
826 /* creates a new screen buffer on process' console */
827 @REQ(create_console_output)
828 handle_t handle_in; /* handle to console input, or 0 for process' console */
829 int access; /* wanted access rights */
830 int share; /* sharing credentials */
831 int inherit; /* inherit flag */
833 handle_t handle_out; /* handle to the screen buffer */
837 /* Set info about a console (output only) */
838 @REQ(set_console_output_info)
839 handle_t handle; /* handle to the console */
840 int mask; /* setting mask (see below) */
841 short int cursor_size; /* size of cursor (percentage filled) */
842 short int cursor_visible;/* cursor visibility flag */
843 short int cursor_x; /* position of cursor (x, y) */
845 short int width; /* width of the screen buffer */
846 short int height; /* height of the screen buffer */
847 short int attr; /* default attribute */
848 short int win_left; /* window actually displayed by renderer */
849 short int win_top; /* the rect area is expressed withing the */
850 short int win_right; /* boundaries of the screen buffer */
851 short int win_bottom;
852 short int max_width; /* maximum size (width x height) for the window */
853 short int max_height;
855 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
856 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
857 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
858 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
859 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
860 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
863 /* Get info about a console (output only) */
864 @REQ(get_console_output_info)
865 handle_t handle; /* handle to the console */
867 short int cursor_size; /* size of cursor (percentage filled) */
868 short int cursor_visible;/* cursor visibility flag */
869 short int cursor_x; /* position of cursor (x, y) */
871 short int width; /* width of the screen buffer */
872 short int height; /* height of the screen buffer */
873 short int attr; /* default attribute */
874 short int win_left; /* window actually displayed by renderer */
875 short int win_top; /* the rect area is expressed withing the */
876 short int win_right; /* boundaries of the screen buffer */
877 short int win_bottom;
878 short int max_width; /* maximum size (width x height) for the window */
879 short int max_height;
882 /* Add input records to a console input queue */
883 @REQ(write_console_input)
884 handle_t handle; /* handle to the console input */
885 VARARG(rec,input_records); /* input records */
887 int written; /* number of records written */
891 /* Fetch input records from a console input queue */
892 @REQ(read_console_input)
893 handle_t handle; /* handle to the console input */
894 int flush; /* flush the retrieved records from the queue? */
896 int read; /* number of records read */
897 VARARG(rec,input_records); /* input records */
901 /* write data (chars and/or attributes) in a screen buffer */
902 @REQ(write_console_output)
903 handle_t handle; /* handle to the console input */
904 int mode; /* 0 for text, 1, for attributes, 2 for both */
905 /* bit3 (4) set if uniform pattern in data */
906 short int x; /* position where to start writing */
908 VARARG(data,bytes); /* info to write */
910 int written; /* number of bytes actually written */
912 #define WRITE_CONSOLE_MODE_TEXT 0x00
913 #define WRITE_CONSOLE_MODE_ATTR 0x01
914 #define WRITE_CONSOLE_MODE_TEXTATTR 0x02
915 #define WRITE_CONSOLE_MODE_TEXTSTDATTR 0x03
916 #define WRITE_CONSOLE_MODE_UNIFORM 0x04
919 /* read data (chars and/or attrubutes) from a screen buffer */
920 @REQ(read_console_output)
921 handle_t handle; /* handle to the console input */
922 short int x; /* position (x,y) where to start reading from */
924 short int w; /* size of area to read from (width x height) */
927 short int eff_w; /* effective width read */
928 short int eff_h; /* effective height read */
932 /* move a rect (of data) in screen buffer content */
933 @REQ(move_console_output)
934 handle_t handle; /* handle to the console output */
935 short int x_src; /* position (x, y) of rect to start moving from */
937 short int x_dst; /* position (x, y) of rect to move to */
939 short int w; /* size of the rect (width, height) to move */
944 /* Create a change notification */
945 @REQ(create_change_notification)
946 int subtree; /* watch all the subtree */
947 int filter; /* notification filter */
949 handle_t handle; /* handle to the change notification */
953 /* Create a file mapping */
955 int size_high; /* mapping size */
956 int size_low; /* mapping size */
957 int protect; /* protection flags (see below) */
958 int inherit; /* inherit flag */
959 handle_t file_handle; /* file handle */
960 VARARG(name,unicode_str); /* object name */
962 handle_t handle; /* handle to the mapping */
964 /* protection flags */
965 #define VPROT_READ 0x01
966 #define VPROT_WRITE 0x02
967 #define VPROT_EXEC 0x04
968 #define VPROT_WRITECOPY 0x08
969 #define VPROT_GUARD 0x10
970 #define VPROT_NOCACHE 0x20
971 #define VPROT_COMMITTED 0x40
972 #define VPROT_IMAGE 0x80
977 unsigned int access; /* wanted access rights */
978 int inherit; /* inherit flag */
979 VARARG(name,unicode_str); /* object name */
981 handle_t handle; /* handle to the mapping */
985 /* Get information about a file mapping */
986 @REQ(get_mapping_info)
987 handle_t handle; /* handle to the mapping */
989 int size_high; /* mapping size */
990 int size_low; /* mapping size */
991 int protect; /* protection flags */
992 int header_size; /* header size (for VPROT_IMAGE mapping) */
993 void* base; /* default base addr (for VPROT_IMAGE mapping) */
994 handle_t shared_file; /* shared mapping file handle */
995 int shared_size; /* shared mapping size */
996 int drive_type; /* type of drive the file is on */
1000 /* Create a device */
1002 unsigned int access; /* wanted access rights */
1003 int inherit; /* inherit flag */
1004 int id; /* client private id */
1006 handle_t handle; /* handle to the device */
1010 /* Create a snapshot */
1011 @REQ(create_snapshot)
1012 int inherit; /* inherit flag */
1013 int flags; /* snapshot flags (TH32CS_*) */
1014 void* pid; /* process id */
1016 handle_t handle; /* handle to the snapshot */
1020 /* Get the next process from a snapshot */
1022 handle_t handle; /* handle to the snapshot */
1023 int reset; /* reset snapshot position? */
1025 int count; /* process usage count */
1026 void* pid; /* process id */
1027 int threads; /* number of threads */
1028 int priority; /* process priority */
1032 /* Get the next thread from a snapshot */
1034 handle_t handle; /* handle to the snapshot */
1035 int reset; /* reset snapshot position? */
1037 int count; /* thread usage count */
1038 void* pid; /* process id */
1039 void* tid; /* thread id */
1040 int base_pri; /* base priority */
1041 int delta_pri; /* delta priority */
1045 /* Get the next module from a snapshot */
1047 handle_t handle; /* handle to the snapshot */
1048 int reset; /* reset snapshot position? */
1050 void* pid; /* process id */
1051 void* base; /* module base address */
1055 /* Wait for a debug event */
1056 @REQ(wait_debug_event)
1057 int get_handle; /* should we alloc a handle for waiting? */
1059 void* pid; /* process id */
1060 void* tid; /* thread id */
1061 handle_t wait; /* wait handle if no event ready */
1062 VARARG(event,debug_event); /* debug event data */
1066 /* Queue an exception event */
1067 @REQ(queue_exception_event)
1068 int first; /* first chance exception? */
1069 VARARG(record,exc_event); /* thread context followed by exception record */
1071 handle_t handle; /* handle to the queued event */
1075 /* Retrieve the status of an exception event */
1076 @REQ(get_exception_status)
1078 handle_t handle; /* handle to the queued event */
1079 int status; /* event continuation status */
1080 VARARG(context,context); /* modified thread context */
1084 /* Send an output string to the debugger */
1085 @REQ(output_debug_string)
1086 void* string; /* string to display (in debugged process address space) */
1087 int unicode; /* is it Unicode? */
1088 int length; /* string length */
1092 /* Continue a debug event */
1093 @REQ(continue_debug_event)
1094 void* pid; /* process id to continue */
1095 void* tid; /* thread id to continue */
1096 int status; /* continuation status */
1100 /* Start debugging an existing process */
1102 void* pid; /* id of the process to debug */
1106 /* Read data from a process address space */
1107 @REQ(read_process_memory)
1108 handle_t handle; /* process handle */
1109 void* addr; /* addr to read from (must be int-aligned) */
1110 int len; /* number of ints to read */
1112 VARARG(data,bytes); /* result data */
1116 /* Write data to a process address space */
1117 @REQ(write_process_memory)
1118 handle_t handle; /* process handle */
1119 void* addr; /* addr to write to (must be int-aligned) */
1120 int len; /* number of ints to write */
1121 unsigned int first_mask; /* mask for first word */
1122 unsigned int last_mask; /* mask for last word */
1123 VARARG(data,bytes); /* result data */
1127 /* Create a registry key */
1129 handle_t parent; /* handle to the parent key */
1130 unsigned int access; /* desired access rights */
1131 unsigned int options; /* creation options */
1132 time_t modif; /* last modification time */
1133 VARARG(name,unicode_len_str); /* key name */
1134 VARARG(class,unicode_str); /* class name */
1136 handle_t hkey; /* handle to the created key */
1137 int created; /* has it been newly created? */
1140 /* Open a registry key */
1142 handle_t parent; /* handle to the parent key */
1143 unsigned int access; /* desired access rights */
1144 VARARG(name,unicode_str); /* key name */
1146 handle_t hkey; /* handle to the open key */
1150 /* Delete a registry key */
1152 handle_t hkey; /* handle to the key */
1156 /* Enumerate registry subkeys */
1158 handle_t hkey; /* handle to registry key */
1159 int index; /* index of subkey (or -1 for current key) */
1160 int full; /* return the full info? */
1162 int subkeys; /* number of subkeys */
1163 int max_subkey; /* longest subkey name */
1164 int max_class; /* longest class name */
1165 int values; /* number of values */
1166 int max_value; /* longest value name */
1167 int max_data; /* longest value data */
1168 time_t modif; /* last modification time */
1169 VARARG(name,unicode_len_str); /* key name */
1170 VARARG(class,unicode_str); /* class name */
1174 /* Set a value of a registry key */
1176 handle_t hkey; /* handle to registry key */
1177 int type; /* value type */
1178 unsigned int total; /* total value len */
1179 unsigned int offset; /* offset for setting data */
1180 VARARG(name,unicode_len_str); /* value name */
1181 VARARG(data,bytes); /* value data */
1185 /* Retrieve the value of a registry key */
1187 handle_t hkey; /* handle to registry key */
1188 unsigned int offset; /* offset for getting data */
1189 VARARG(name,unicode_len_str); /* value name */
1191 int type; /* value type */
1192 int len; /* value data len */
1193 VARARG(data,bytes); /* value data */
1197 /* Enumerate a value of a registry key */
1198 @REQ(enum_key_value)
1199 handle_t hkey; /* handle to registry key */
1200 int index; /* value index */
1201 unsigned int offset; /* offset for getting data */
1203 int type; /* value type */
1204 int len; /* value data len */
1205 VARARG(name,unicode_len_str); /* value name */
1206 VARARG(data,bytes); /* value data */
1210 /* Delete a value of a registry key */
1211 @REQ(delete_key_value)
1212 handle_t hkey; /* handle to registry key */
1213 VARARG(name,unicode_str); /* value name */
1217 /* Load a registry branch from a file */
1219 handle_t hkey; /* root key to load to */
1220 handle_t file; /* file to load from */
1221 VARARG(name,unicode_str); /* subkey name */
1225 /* Save a registry branch to a file */
1227 handle_t hkey; /* key to save */
1228 handle_t file; /* file to save to */
1232 /* Save a registry branch at server exit */
1233 @REQ(save_registry_atexit)
1234 handle_t hkey; /* key to save */
1235 VARARG(file,string); /* file to save to */
1239 /* Set the current and saving level for the registry */
1240 @REQ(set_registry_levels)
1241 int current; /* new current level */
1242 int saving; /* new saving level */
1243 int period; /* duration between periodic saves (milliseconds) */
1247 /* Create a waitable timer */
1249 int inherit; /* inherit flag */
1250 int manual; /* manual reset */
1251 VARARG(name,unicode_str); /* object name */
1253 handle_t handle; /* handle to the timer */
1257 /* Open a waitable timer */
1259 unsigned int access; /* wanted access rights */
1260 int inherit; /* inherit flag */
1261 VARARG(name,unicode_str); /* object name */
1263 handle_t handle; /* handle to the timer */
1266 /* Set a waitable timer */
1268 handle_t handle; /* handle to the timer */
1269 int sec; /* next expiration absolute time */
1270 int usec; /* next expiration absolute time */
1271 int period; /* timer period in ms */
1272 void* callback; /* callback function */
1273 void* arg; /* callback argument */
1276 /* Cancel a waitable timer */
1278 handle_t handle; /* handle to the timer */
1282 /* Retrieve the current context of a thread */
1283 @REQ(get_thread_context)
1284 handle_t handle; /* thread handle */
1285 unsigned int flags; /* context flags */
1287 VARARG(context,context); /* thread context */
1291 /* Set the current context of a thread */
1292 @REQ(set_thread_context)
1293 handle_t handle; /* thread handle */
1294 unsigned int flags; /* context flags */
1295 VARARG(context,context); /* thread context */
1299 /* Fetch a selector entry for a thread */
1300 @REQ(get_selector_entry)
1301 handle_t handle; /* thread handle */
1302 int entry; /* LDT entry */
1304 unsigned int base; /* selector base */
1305 unsigned int limit; /* selector limit */
1306 unsigned char flags; /* selector flags */
1312 int local; /* is atom in local process table? */
1313 VARARG(name,unicode_str); /* atom name */
1315 atom_t atom; /* resulting atom */
1319 /* Delete an atom */
1321 atom_t atom; /* atom handle */
1322 int local; /* is atom in local process table? */
1328 int local; /* is atom in local process table? */
1329 VARARG(name,unicode_str); /* atom name */
1331 atom_t atom; /* atom handle */
1335 /* Get an atom name */
1337 atom_t atom; /* atom handle */
1338 int local; /* is atom in local process table? */
1340 int count; /* atom lock count */
1341 VARARG(name,unicode_str); /* atom name */
1345 /* Init the process atom table */
1346 @REQ(init_atom_table)
1347 int entries; /* number of entries */
1351 /* Get the message queue of the current thread */
1354 handle_t handle; /* handle to the queue */
1358 /* Set the current message queue wakeup mask */
1359 @REQ(set_queue_mask)
1360 unsigned int wake_mask; /* wakeup bits mask */
1361 unsigned int changed_mask; /* changed bits mask */
1362 int skip_wait; /* will we skip waiting if signaled? */
1364 unsigned int wake_bits; /* current wake bits */
1365 unsigned int changed_bits; /* current changed bits */
1369 /* Get the current message queue status */
1370 @REQ(get_queue_status)
1371 int clear; /* should we clear the change bits? */
1373 unsigned int wake_bits; /* wake bits */
1374 unsigned int changed_bits; /* changed bits since last time */
1378 /* Wait for a process to start waiting on input */
1379 @REQ(wait_input_idle)
1380 handle_t handle; /* process handle */
1381 int timeout; /* timeout */
1383 handle_t event; /* handle to idle event */
1387 /* Send a message to a thread queue */
1389 void* id; /* thread id */
1390 int type; /* message type (see below) */
1391 user_handle_t win; /* window handle */
1392 unsigned int msg; /* message code */
1393 unsigned int wparam; /* parameters */
1394 unsigned int lparam; /* parameters */
1395 int x; /* x position */
1396 int y; /* y position */
1397 unsigned int time; /* message time */
1398 unsigned int info; /* extra info */
1399 int timeout; /* timeout for reply */
1400 VARARG(data,bytes); /* message data for sent messages */
1405 MSG_ASCII, /* Ascii message (from SendMessageA) */
1406 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1407 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1408 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1409 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1410 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1411 MSG_HARDWARE_RAW, /* raw hardware message */
1412 MSG_HARDWARE_COOKED /* cooked hardware message */
1416 /* Get a message from the current queue */
1418 int flags; /* see below */
1419 user_handle_t get_win; /* window handle to get */
1420 unsigned int get_first; /* first message code to get */
1421 unsigned int get_last; /* last message code to get */
1423 int type; /* message type */
1424 user_handle_t win; /* window handle */
1425 unsigned int msg; /* message code */
1426 unsigned int wparam; /* parameters */
1427 unsigned int lparam; /* parameters */
1428 int x; /* x position */
1429 int y; /* y position */
1430 unsigned int time; /* message time */
1431 unsigned int info; /* extra info */
1432 VARARG(data,bytes); /* message data for sent messages */
1434 #define GET_MSG_REMOVE 1 /* remove the message */
1435 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1436 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1438 /* Reply to a sent message */
1440 unsigned int result; /* message result */
1441 int remove; /* should we remove the message? */
1442 VARARG(data,bytes); /* message data for sent messages */
1446 /* Retrieve the reply for the last message sent */
1447 @REQ(get_message_reply)
1448 int cancel; /* cancel message if not ready? */
1450 unsigned int result; /* message result */
1451 VARARG(data,bytes); /* message data for sent messages */
1455 /* Set a window timer */
1457 user_handle_t win; /* window handle */
1458 unsigned int msg; /* message to post */
1459 unsigned int id; /* timer id */
1460 unsigned int rate; /* timer rate in ms */
1461 unsigned int lparam; /* message lparam (callback proc) */
1465 /* Kill a window timer */
1466 @REQ(kill_win_timer)
1467 user_handle_t win; /* window handle */
1468 unsigned int msg; /* message to post */
1469 unsigned int id; /* timer id */
1473 /* Open a serial port */
1475 unsigned int access; /* wanted access rights */
1476 int inherit; /* inherit flag */
1477 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1478 unsigned int sharing; /* sharing flags */
1479 VARARG(name,string); /* file name */
1481 handle_t handle; /* handle to the port */
1485 /* Retrieve info about a serial port */
1486 @REQ(get_serial_info)
1487 handle_t handle; /* handle to comm port */
1489 unsigned int readinterval;
1490 unsigned int readconst;
1491 unsigned int readmult;
1492 unsigned int writeconst;
1493 unsigned int writemult;
1494 unsigned int eventmask;
1495 unsigned int commerror;
1499 /* Set info about a serial port */
1500 @REQ(set_serial_info)
1501 handle_t handle; /* handle to comm port */
1502 int flags; /* bitmask to set values (see below) */
1503 unsigned int readinterval;
1504 unsigned int readconst;
1505 unsigned int readmult;
1506 unsigned int writeconst;
1507 unsigned int writemult;
1508 unsigned int eventmask;
1509 unsigned int commerror;
1511 #define SERIALINFO_SET_TIMEOUTS 0x01
1512 #define SERIALINFO_SET_MASK 0x02
1513 #define SERIALINFO_SET_ERROR 0x04
1516 /* Create an async I/O */
1518 handle_t file_handle; /* handle to comm port, socket or file */
1524 #define ASYNC_TYPE_READ 0x01
1525 #define ASYNC_TYPE_WRITE 0x02
1526 #define ASYNC_TYPE_WAIT 0x03
1529 /* Create a named pipe */
1530 @REQ(create_named_pipe)
1531 unsigned int openmode;
1532 unsigned int pipemode;
1533 unsigned int maxinstances;
1534 unsigned int outsize;
1535 unsigned int insize;
1536 unsigned int timeout;
1537 VARARG(filename,string); /* pipe name */
1539 handle_t handle; /* handle to the pipe */
1543 /* Open an existing named pipe */
1544 @REQ(open_named_pipe)
1545 unsigned int access;
1546 VARARG(filename,string); /* pipe name */
1548 handle_t handle; /* handle to the pipe */
1552 /* Connect to a named pipe */
1553 @REQ(connect_named_pipe)
1560 /* Wait for a named pipe */
1561 @REQ(wait_named_pipe)
1562 unsigned int timeout;
1565 VARARG(filename,string); /* pipe name */
1569 /* Disconnect a named pipe */
1570 @REQ(disconnect_named_pipe)
1575 @REQ(get_named_pipe_info)
1579 unsigned int maxinstances;
1580 unsigned int outsize;
1581 unsigned int insize;
1585 /* Create a window */
1587 user_handle_t parent; /* parent window */
1588 user_handle_t owner; /* owner window */
1589 atom_t atom; /* class atom */
1591 user_handle_t handle; /* created window */
1595 /* Link a window into the tree */
1597 user_handle_t handle; /* handle to the window */
1598 user_handle_t parent; /* handle to the parent */
1599 user_handle_t previous; /* previous child in Z-order */
1601 user_handle_t full_parent; /* full handle of new parent */
1605 /* Destroy a window */
1606 @REQ(destroy_window)
1607 user_handle_t handle; /* handle to the window */
1611 /* Set a window owner */
1612 @REQ(set_window_owner)
1613 user_handle_t handle; /* handle to the window */
1614 user_handle_t owner; /* new owner */
1616 user_handle_t full_owner; /* full handle of new owner */
1620 /* Get information from a window handle */
1621 @REQ(get_window_info)
1622 user_handle_t handle; /* handle to the window */
1624 user_handle_t full_handle; /* full 32-bit handle */
1625 void* pid; /* process owning the window */
1626 void* tid; /* thread owning the window */
1627 atom_t atom; /* class atom */
1631 /* Set some information in a window */
1632 @REQ(set_window_info)
1633 user_handle_t handle; /* handle to the window */
1634 unsigned int flags; /* flags for fields to set (see below) */
1635 unsigned int style; /* window style */
1636 unsigned int ex_style; /* window extended style */
1637 unsigned int id; /* window id */
1638 void* instance; /* creator instance */
1639 void* user_data; /* user-specific data */
1641 unsigned int old_style; /* old window style */
1642 unsigned int old_ex_style; /* old window extended style */
1643 unsigned int old_id; /* old window id */
1644 void* old_instance; /* old creator instance */
1645 void* old_user_data; /* old user-specific data */
1647 #define SET_WIN_STYLE 0x01
1648 #define SET_WIN_EXSTYLE 0x02
1649 #define SET_WIN_ID 0x04
1650 #define SET_WIN_INSTANCE 0x08
1651 #define SET_WIN_USERDATA 0x10
1654 /* Get a list of the window parents, up to the root of the tree */
1655 @REQ(get_window_parents)
1656 user_handle_t handle; /* handle to the window */
1658 int count; /* total count of parents */
1659 VARARG(parents,user_handles); /* parent handles */
1663 /* Get a list of the window children */
1664 @REQ(get_window_children)
1665 user_handle_t parent; /* parent window */
1666 atom_t atom; /* class atom for the listed children */
1667 void* tid; /* thread owning the listed children */
1669 int count; /* total count of children */
1670 VARARG(children,user_handles); /* children handles */
1674 /* Get window tree information from a window handle */
1675 @REQ(get_window_tree)
1676 user_handle_t handle; /* handle to the window */
1678 user_handle_t parent; /* parent window */
1679 user_handle_t owner; /* owner window */
1680 user_handle_t next_sibling; /* next sibling in Z-order */
1681 user_handle_t prev_sibling; /* prev sibling in Z-order */
1682 user_handle_t first_sibling; /* first sibling in Z-order */
1683 user_handle_t last_sibling; /* last sibling in Z-order */
1684 user_handle_t first_child; /* first child */
1685 user_handle_t last_child; /* last child */
1688 /* Set the window and client rectangles of a window */
1689 @REQ(set_window_rectangles)
1690 user_handle_t handle; /* handle to the window */
1691 rectangle_t window; /* window rectangle */
1692 rectangle_t client; /* client rectangle */
1696 /* Get the window and client rectangles of a window */
1697 @REQ(get_window_rectangles)
1698 user_handle_t handle; /* handle to the window */
1700 rectangle_t window; /* window rectangle */
1701 rectangle_t client; /* client rectangle */
1705 /* Get the window text */
1706 @REQ(get_window_text)
1707 user_handle_t handle; /* handle to the window */
1709 VARARG(text,unicode_str); /* window text */
1713 /* Set the window text */
1714 @REQ(set_window_text)
1715 user_handle_t handle; /* handle to the window */
1716 VARARG(text,unicode_str); /* window text */
1720 /* Increment the window paint count */
1721 @REQ(inc_window_paint_count)
1722 user_handle_t handle; /* handle to the window */
1723 int incr; /* increment (can be negative) */
1727 /* Get the coordinates offset between two windows */
1728 @REQ(get_windows_offset)
1729 user_handle_t from; /* handle to the first window */
1730 user_handle_t to; /* handle to the second window */
1732 int x; /* x coordinate offset */
1733 int y; /* y coordinate offset */
1737 /* Set a window property */
1738 @REQ(set_window_property)
1739 user_handle_t window; /* handle to the window */
1740 atom_t atom; /* property atom (high-word set if it was a string) */
1741 int string; /* was atom a string originally? */
1742 handle_t handle; /* handle to store */
1746 /* Remove a window property */
1747 @REQ(remove_window_property)
1748 user_handle_t window; /* handle to the window */
1749 atom_t atom; /* property atom */
1751 handle_t handle; /* handle stored in property */
1755 /* Get a window property */
1756 @REQ(get_window_property)
1757 user_handle_t window; /* handle to the window */
1758 atom_t atom; /* property atom */
1760 handle_t handle; /* handle stored in property */
1764 /* Get the list of properties of a window */
1765 @REQ(get_window_properties)
1766 user_handle_t window; /* handle to the window */
1768 VARARG(props,properties); /* list of properties */