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 size_t request_size; /* request variable part size */
21 size_t reply_size; /* reply variable part maximum size */
26 unsigned int error; /* error result */
27 size_t reply_size; /* reply variable part size */
30 /* placeholder structure for the maximum allowed request size */
31 /* this is used to construct the generic_request union */
32 struct request_max_size
34 int pad[16]; /* the max request size is 16 ints */
37 /* max size of the variable part of a request */
38 #define REQUEST_MAX_VAR_SIZE 1024
41 typedef unsigned short atom_t;
42 typedef unsigned int user_handle_t;
44 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
45 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
48 /* definitions of the event data depending on the event code */
49 struct debug_event_exception
51 EXCEPTION_RECORD record; /* exception record */
52 int first; /* first chance exception? */
54 struct debug_event_create_thread
56 handle_t handle; /* handle to the new thread */
57 void *teb; /* thread teb (in debugged process address space) */
58 void *start; /* thread startup routine */
60 struct debug_event_create_process
62 handle_t file; /* handle to the process exe file */
63 handle_t process; /* handle to the new process */
64 handle_t thread; /* handle to the new thread */
65 void *base; /* base of executable image */
66 int dbg_offset; /* offset of debug info in file */
67 int dbg_size; /* size of debug info */
68 void *teb; /* thread teb (in debugged process address space) */
69 void *start; /* thread startup routine */
70 void *name; /* image name (optional) */
71 int unicode; /* is it Unicode? */
73 struct debug_event_exit
75 int exit_code; /* thread or process exit code */
77 struct debug_event_load_dll
79 handle_t handle; /* file handle for the dll */
80 void *base; /* base address of the dll */
81 int dbg_offset; /* offset of debug info in file */
82 int dbg_size; /* size of debug info */
83 void *name; /* image name (optional) */
84 int unicode; /* is it Unicode? */
86 struct debug_event_unload_dll
88 void *base; /* base address of the dll */
90 struct debug_event_output_string
92 void *string; /* string to display (in debugged process address space) */
93 int unicode; /* is it Unicode? */
94 int length; /* string length */
96 struct debug_event_rip_info
101 union debug_event_data
103 struct debug_event_exception exception;
104 struct debug_event_create_thread create_thread;
105 struct debug_event_create_process create_process;
106 struct debug_event_exit exit;
107 struct debug_event_load_dll load_dll;
108 struct debug_event_unload_dll unload_dll;
109 struct debug_event_output_string output_string;
110 struct debug_event_rip_info rip_info;
113 /* debug event data */
116 int code; /* event code */
117 union debug_event_data info; /* event information */
120 /* structure used in sending an fd from client to server */
123 void *tid; /* thread id */
124 int fd; /* file descriptor on client-side */
127 /* structure sent by the server on the wait fifo */
130 void *cookie; /* magic cookie that was passed in select_request */
131 int signaled; /* wait result */
134 /* structure returned in the list of window properties */
137 atom_t atom; /* property atom */
138 short string; /* was atom a string originally? */
139 handle_t handle; /* handle stored in property */
142 /* structure to specify window rectangles */
151 /* structure for console char/attribute info */
158 /****************************************************************/
159 /* Request declarations */
161 /* Create a new process from the context of the parent */
163 int inherit_all; /* inherit all handles from parent */
164 int create_flags; /* creation flags */
165 int start_flags; /* flags from startup info */
166 handle_t exe_file; /* file handle for main exe */
167 handle_t hstdin; /* handle for stdin */
168 handle_t hstdout; /* handle for stdout */
169 handle_t hstderr; /* handle for stderr */
170 int cmd_show; /* main window show mode */
171 VARARG(filename,string); /* file name of main exe */
173 handle_t info; /* new process info handle */
177 /* Retrieve information about a newly started process */
178 @REQ(get_new_process_info)
179 handle_t info; /* info handle returned from new_process_request */
180 int pinherit; /* process handle inherit flag */
181 int tinherit; /* thread handle inherit flag */
183 void* pid; /* process id */
184 handle_t phandle; /* process handle (in the current process) */
185 void* tid; /* thread id */
186 handle_t thandle; /* thread handle (in the current process) */
187 handle_t event; /* event handle to signal startup */
191 /* Create a new thread from the context of the parent */
193 int suspend; /* new thread should be suspended on creation */
194 int inherit; /* inherit flag */
195 int request_fd; /* fd for request pipe */
197 void* tid; /* thread id */
198 handle_t handle; /* thread handle (in the current process) */
202 /* Signal that we are finished booting on the client side */
204 int debug_level; /* new debug level */
208 /* Initialize a process; called from the new process context */
210 void* ldt_copy; /* addr of LDT copy */
211 int ppid; /* parent Unix pid */
213 int create_flags; /* creation flags */
214 int start_flags; /* flags from startup info */
215 unsigned int server_start; /* server start time (GetTickCount) */
216 handle_t exe_file; /* file handle for main exe */
217 handle_t hstdin; /* handle for stdin */
218 handle_t hstdout; /* handle for stdout */
219 handle_t hstderr; /* handle for stderr */
220 int cmd_show; /* main window show mode */
221 VARARG(filename,string); /* file name of main exe */
225 /* Signal the end of the process initialization */
226 @REQ(init_process_done)
227 void* module; /* main module base address */
228 void* entry; /* process entry point */
229 void* name; /* ptr to ptr to name (in process addr space) */
230 handle_t exe_file; /* file handle for main exe */
231 int gui; /* is it a GUI process? */
233 int debugged; /* being debugged? */
237 /* Initialize a thread; called from the child after fork()/clone() */
239 int unix_pid; /* Unix pid of new thread */
240 void* teb; /* TEB of new thread (in thread address space) */
241 void* entry; /* thread entry point (in thread address space) */
242 int reply_fd; /* fd for reply pipe */
243 int wait_fd; /* fd for blocking calls pipe */
245 void* pid; /* process id of the new thread's process */
246 void* tid; /* thread id of the new thread */
247 int boot; /* is this the boot thread? */
248 int version; /* protocol version */
252 /* Terminate a process */
253 @REQ(terminate_process)
254 handle_t handle; /* process handle to terminate */
255 int exit_code; /* process exit code */
257 int self; /* suicide? */
261 /* Terminate a thread */
262 @REQ(terminate_thread)
263 handle_t handle; /* thread handle to terminate */
264 int exit_code; /* thread exit code */
266 int self; /* suicide? */
267 int last; /* last thread in this process? */
271 /* Retrieve information about a process */
272 @REQ(get_process_info)
273 handle_t handle; /* process handle */
275 void* pid; /* server process id */
276 int debugged; /* debugged? */
277 int exit_code; /* process exit code */
278 int priority; /* priority class */
279 int process_affinity; /* process affinity mask */
280 int system_affinity; /* system affinity mask */
284 /* Set a process informations */
285 @REQ(set_process_info)
286 handle_t handle; /* process handle */
287 int mask; /* setting mask (see below) */
288 int priority; /* priority class */
289 int affinity; /* affinity mask */
291 #define SET_PROCESS_INFO_PRIORITY 0x01
292 #define SET_PROCESS_INFO_AFFINITY 0x02
295 /* Retrieve information about a thread */
296 @REQ(get_thread_info)
297 handle_t handle; /* thread handle */
298 void* tid_in; /* thread id (optional) */
300 void* tid; /* server thread id */
301 void* teb; /* thread teb pointer */
302 int exit_code; /* thread exit code */
303 int priority; /* thread priority level */
307 /* Set a thread informations */
308 @REQ(set_thread_info)
309 handle_t handle; /* thread handle */
310 int mask; /* setting mask (see below) */
311 int priority; /* priority class */
312 int affinity; /* affinity mask */
314 #define SET_THREAD_INFO_PRIORITY 0x01
315 #define SET_THREAD_INFO_AFFINITY 0x02
318 /* Suspend a thread */
320 handle_t handle; /* thread handle */
322 int count; /* new suspend count */
326 /* Resume a thread */
328 handle_t handle; /* thread handle */
330 int count; /* new suspend count */
334 /* Notify the server that a dll has been loaded */
336 handle_t handle; /* file handle */
337 void* base; /* base address */
338 int dbg_offset; /* debug info offset */
339 int dbg_size; /* debug info size */
340 void* name; /* ptr to ptr to name (in process addr space) */
344 /* Notify the server that a dll is being unloaded */
346 void* base; /* base address */
350 /* Queue an APC for a thread */
352 handle_t handle; /* thread handle */
353 int user; /* user or system apc? */
354 void* func; /* function to call */
355 void* param; /* param for function to call */
359 /* Get next APC to call */
361 int alertable; /* is thread alertable? */
363 void* func; /* function to call */
364 int type; /* function type */
365 VARARG(args,ptrs); /* function arguments */
367 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
370 /* Close a handle for the current process */
372 handle_t handle; /* handle to close */
374 int fd; /* associated fd to close */
378 /* Set a handle information */
379 @REQ(set_handle_info)
380 handle_t handle; /* handle we are interested in */
381 int flags; /* new handle flags */
382 int mask; /* mask for flags to set */
383 int fd; /* file descriptor or -1 */
385 int old_flags; /* old flag value */
386 int cur_fd; /* current file descriptor */
390 /* Duplicate a handle */
392 handle_t src_process; /* src process handle */
393 handle_t src_handle; /* src handle to duplicate */
394 handle_t dst_process; /* dst process handle */
395 unsigned int access; /* wanted access rights */
396 int inherit; /* inherit flag */
397 int options; /* duplicate options (see below) */
399 handle_t handle; /* duplicated handle in dst process */
400 int fd; /* associated fd to close */
402 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
403 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
404 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
407 /* Open a handle to a process */
409 void* pid; /* process id to open */
410 unsigned int access; /* wanted access rights */
411 int inherit; /* inherit flag */
413 handle_t handle; /* handle to the process */
417 /* Wait for handles */
419 int flags; /* wait flags (see below) */
420 void* cookie; /* magic cookie to return to client */
421 int sec; /* absolute timeout */
422 int usec; /* absolute timeout */
423 VARARG(handles,handles); /* handles to select on */
426 #define SELECT_ALERTABLE 2
427 #define SELECT_INTERRUPTIBLE 4
428 #define SELECT_TIMEOUT 8
431 /* Create an event */
433 int manual_reset; /* manual reset event */
434 int initial_state; /* initial state of the event */
435 int inherit; /* inherit flag */
436 VARARG(name,unicode_str); /* object name */
438 handle_t handle; /* handle to the event */
441 /* Event operation */
443 handle_t handle; /* handle to event */
444 int op; /* event operation (see below) */
446 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
451 unsigned int access; /* wanted access rights */
452 int inherit; /* inherit flag */
453 VARARG(name,unicode_str); /* object name */
455 handle_t handle; /* handle to the event */
461 int owned; /* initially owned? */
462 int inherit; /* inherit flag */
463 VARARG(name,unicode_str); /* object name */
465 handle_t handle; /* handle to the mutex */
469 /* Release a mutex */
471 handle_t handle; /* handle to the mutex */
477 unsigned int access; /* wanted access rights */
478 int inherit; /* inherit flag */
479 VARARG(name,unicode_str); /* object name */
481 handle_t handle; /* handle to the mutex */
485 /* Create a semaphore */
486 @REQ(create_semaphore)
487 unsigned int initial; /* initial count */
488 unsigned int max; /* maximum count */
489 int inherit; /* inherit flag */
490 VARARG(name,unicode_str); /* object name */
492 handle_t handle; /* handle to the semaphore */
496 /* Release a semaphore */
497 @REQ(release_semaphore)
498 handle_t handle; /* handle to the semaphore */
499 unsigned int count; /* count to add to semaphore */
501 unsigned int prev_count; /* previous semaphore count */
505 /* Open a semaphore */
507 unsigned int access; /* wanted access rights */
508 int inherit; /* inherit flag */
509 VARARG(name,unicode_str); /* object name */
511 handle_t handle; /* handle to the semaphore */
517 unsigned int access; /* wanted access rights */
518 int inherit; /* inherit flag */
519 unsigned int sharing; /* sharing flags */
520 int create; /* file create action */
521 unsigned int attrs; /* file attributes for creation */
522 int drive_type; /* type of drive the file is on */
523 VARARG(filename,string); /* file name */
525 handle_t handle; /* handle to the file */
529 /* Allocate a file handle for a Unix fd */
530 @REQ(alloc_file_handle)
531 unsigned int access; /* wanted access rights */
532 int inherit; /* inherit flag */
533 int fd; /* file descriptor on the client side */
535 handle_t handle; /* handle to the file */
539 /* Get a Unix fd to access a file */
541 handle_t handle; /* handle to the file */
542 unsigned int access; /* wanted access rights */
544 int fd; /* file descriptor */
545 int type; /* the type of file */
547 #define FD_TYPE_INVALID 0
548 #define FD_TYPE_DEFAULT 1
549 #define FD_TYPE_CONSOLE 2
550 #define FD_TYPE_OVERLAPPED 3
551 #define FD_TYPE_TIMEOUT 4
554 /* Set a file current position */
555 @REQ(set_file_pointer)
556 handle_t handle; /* handle to the file */
557 int low; /* position low word */
558 int high; /* position high word */
559 int whence; /* whence to seek */
561 int new_low; /* new position low word */
562 int new_high; /* new position high word */
566 /* Truncate (or extend) a file */
568 handle_t handle; /* handle to the file */
572 /* Set a file access and modification times */
574 handle_t handle; /* handle to the file */
575 time_t access_time; /* last access time */
576 time_t write_time; /* last write time */
580 /* Flush a file buffers */
582 handle_t handle; /* handle to the file */
586 /* Get information about a file */
588 handle_t handle; /* handle to the file */
590 int type; /* file type */
591 int attr; /* file attributes */
592 time_t access_time; /* last access time */
593 time_t write_time; /* last write time */
594 int size_high; /* file size */
595 int size_low; /* file size */
596 int links; /* number of links */
597 int index_high; /* unique index */
598 int index_low; /* unique index */
599 unsigned int serial; /* volume serial number */
603 /* Lock a region of a file */
605 handle_t handle; /* handle to the file */
606 unsigned int offset_low; /* offset of start of lock */
607 unsigned int offset_high; /* offset of start of lock */
608 unsigned int count_low; /* count of bytes to lock */
609 unsigned int count_high; /* count of bytes to lock */
613 /* Unlock a region of a file */
615 handle_t handle; /* handle to the file */
616 unsigned int offset_low; /* offset of start of unlock */
617 unsigned int offset_high; /* offset of start of unlock */
618 unsigned int count_low; /* count of bytes to unlock */
619 unsigned int count_high; /* count of bytes to unlock */
623 /* Create an anonymous pipe */
625 int inherit; /* inherit flag */
627 handle_t handle_read; /* handle to the read-side of the pipe */
628 handle_t handle_write; /* handle to the write-side of the pipe */
632 /* Create a socket */
634 unsigned int access; /* wanted access rights */
635 int inherit; /* inherit flag */
636 int family; /* family, see socket manpage */
637 int type; /* type, see socket manpage */
638 int protocol; /* protocol, see socket manpage */
640 handle_t handle; /* handle to the new socket */
644 /* Accept a socket */
646 handle_t lhandle; /* handle to the listening socket */
647 unsigned int access; /* wanted access rights */
648 int inherit; /* inherit flag */
650 handle_t handle; /* handle to the new socket */
654 /* Set socket event parameters */
655 @REQ(set_socket_event)
656 handle_t handle; /* handle to the socket */
657 unsigned int mask; /* event mask */
658 handle_t event; /* event object */
662 /* Get socket event parameters */
663 @REQ(get_socket_event)
664 handle_t handle; /* handle to the socket */
665 int service; /* clear pending? */
666 handle_t s_event; /* "expected" event object */
667 handle_t c_event; /* event to clear */
669 unsigned int mask; /* event mask */
670 unsigned int pmask; /* pending events */
671 unsigned int state; /* status bits */
672 VARARG(errors,ints); /* event errors */
676 /* Reenable pending socket events */
677 @REQ(enable_socket_event)
678 handle_t handle; /* handle to the socket */
679 unsigned int mask; /* events to re-enable */
680 unsigned int sstate; /* status bits to set */
681 unsigned int cstate; /* status bits to clear */
685 /* Allocate a console (only used by a console renderer) */
687 unsigned int access; /* wanted access rights */
688 int inherit; /* inherit flag */
689 void* pid; /* pid of process which shall be attached to the console */
691 handle_t handle_in; /* handle to console input */
692 handle_t event; /* handle to renderer events change notification */
696 /* Free the console of the current process */
701 #define CONSOLE_RENDERER_NONE_EVENT 0x00
702 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
703 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
704 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
705 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
706 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
707 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
708 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
709 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
710 struct console_renderer_event
745 /* retrieve console events for the renderer */
746 @REQ(get_console_renderer_events)
747 handle_t handle; /* handle to console input events */
749 VARARG(data,bytes); /* the various console_renderer_events */
753 /* Open a handle to the process console */
755 int from; /* 0 (resp 1) input (resp output) of current process console */
756 /* otherwise console_in handle to get active screen buffer? */
757 unsigned int access; /* wanted access rights */
758 int inherit; /* inherit flag */
759 int share; /* share mask (only for output handles) */
761 handle_t handle; /* handle to the console */
765 /* Get a console mode (input or output) */
766 @REQ(get_console_mode)
767 handle_t handle; /* handle to the console */
769 int mode; /* console mode */
773 /* Set a console mode (input or output) */
774 @REQ(set_console_mode)
775 handle_t handle; /* handle to the console */
776 int mode; /* console mode */
780 /* Set info about a console (input only) */
781 @REQ(set_console_input_info)
782 handle_t handle; /* handle to console input, or 0 for process' console */
783 int mask; /* setting mask (see below) */
784 handle_t active_sb; /* active screen buffer */
785 int history_mode; /* whether we duplicate lines in history */
786 int history_size; /* number of lines in history */
787 VARARG(title,unicode_str); /* console title */
789 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
790 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
791 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
792 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
795 /* Get info about a console (input only) */
796 @REQ(get_console_input_info)
797 handle_t handle; /* handle to console input, or 0 for process' console */
799 int history_mode; /* whether we duplicate lines in history */
800 int history_size; /* number of lines in history */
801 int history_index; /* number of used lines in history */
802 VARARG(title,unicode_str); /* console title */
806 /* appends a string to console's history */
807 @REQ(append_console_input_history)
808 handle_t handle; /* handle to console input, or 0 for process' console */
809 VARARG(line,unicode_str); /* line to add */
813 /* appends a string to console's history */
814 @REQ(get_console_input_history)
815 handle_t handle; /* handle to console input, or 0 for process' console */
816 int index; /* index to get line from */
818 int total; /* total length of line in Unicode chars */
819 VARARG(line,unicode_str); /* line to add */
823 /* creates a new screen buffer on process' console */
824 @REQ(create_console_output)
825 handle_t handle_in; /* handle to console input, or 0 for process' console */
826 int access; /* wanted access rights */
827 int share; /* sharing credentials */
828 int inherit; /* inherit flag */
830 handle_t handle_out; /* handle to the screen buffer */
834 /* Set info about a console (output only) */
835 @REQ(set_console_output_info)
836 handle_t handle; /* handle to the console */
837 int mask; /* setting mask (see below) */
838 short int cursor_size; /* size of cursor (percentage filled) */
839 short int cursor_visible;/* cursor visibility flag */
840 short int cursor_x; /* position of cursor (x, y) */
842 short int width; /* width of the screen buffer */
843 short int height; /* height of the screen buffer */
844 short int attr; /* default attribute */
845 short int win_left; /* window actually displayed by renderer */
846 short int win_top; /* the rect area is expressed withing the */
847 short int win_right; /* boundaries of the screen buffer */
848 short int win_bottom;
849 short int max_width; /* maximum size (width x height) for the window */
850 short int max_height;
852 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
853 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
854 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
855 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
856 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
857 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
860 /* Get info about a console (output only) */
861 @REQ(get_console_output_info)
862 handle_t handle; /* handle to the console */
864 short int cursor_size; /* size of cursor (percentage filled) */
865 short int cursor_visible;/* cursor visibility flag */
866 short int cursor_x; /* position of cursor (x, y) */
868 short int width; /* width of the screen buffer */
869 short int height; /* height of the screen buffer */
870 short int attr; /* default attribute */
871 short int win_left; /* window actually displayed by renderer */
872 short int win_top; /* the rect area is expressed withing the */
873 short int win_right; /* boundaries of the screen buffer */
874 short int win_bottom;
875 short int max_width; /* maximum size (width x height) for the window */
876 short int max_height;
879 /* Add input records to a console input queue */
880 @REQ(write_console_input)
881 handle_t handle; /* handle to the console input */
882 VARARG(rec,input_records); /* input records */
884 int written; /* number of records written */
888 /* Fetch input records from a console input queue */
889 @REQ(read_console_input)
890 handle_t handle; /* handle to the console input */
891 int flush; /* flush the retrieved records from the queue? */
893 int read; /* number of records read */
894 VARARG(rec,input_records); /* input records */
898 /* write data (chars and/or attributes) in a screen buffer */
899 @REQ(write_console_output)
900 handle_t handle; /* handle to the console output */
901 int x; /* position where to start writing */
903 int mode; /* char info (see below) */
904 int wrap; /* wrap around at end of line? */
905 VARARG(data,bytes); /* info to write */
907 int written; /* number of char infos actually written */
908 int width; /* width of screen buffer */
909 int height; /* height of screen buffer */
913 CHAR_INFO_MODE_TEXT, /* characters only */
914 CHAR_INFO_MODE_ATTR, /* attributes only */
915 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
916 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
920 /* fill a screen buffer with constant data (chars and/or attributes) */
921 @REQ(fill_console_output)
922 handle_t handle; /* handle to the console output */
923 int x; /* position where to start writing */
925 int mode; /* char info mode */
926 int count; /* number to write */
927 int wrap; /* wrap around at end of line? */
928 char_info_t data; /* data to write */
930 int written; /* number of char infos actually written */
934 /* read data (chars and/or attributes) from a screen buffer */
935 @REQ(read_console_output)
936 handle_t handle; /* handle to the console output */
937 int x; /* position (x,y) where to start reading */
939 int mode; /* char info mode */
940 int wrap; /* wrap around at end of line? */
942 int width; /* width of screen buffer */
943 int height; /* height of screen buffer */
947 /* move a rect (of data) in screen buffer content */
948 @REQ(move_console_output)
949 handle_t handle; /* handle to the console output */
950 short int x_src; /* position (x, y) of rect to start moving from */
952 short int x_dst; /* position (x, y) of rect to move to */
954 short int w; /* size of the rect (width, height) to move */
959 /* Create a change notification */
960 @REQ(create_change_notification)
961 int subtree; /* watch all the subtree */
962 int filter; /* notification filter */
964 handle_t handle; /* handle to the change notification */
968 /* Create a file mapping */
970 int size_high; /* mapping size */
971 int size_low; /* mapping size */
972 int protect; /* protection flags (see below) */
973 int inherit; /* inherit flag */
974 handle_t file_handle; /* file handle */
975 VARARG(name,unicode_str); /* object name */
977 handle_t handle; /* handle to the mapping */
979 /* protection flags */
980 #define VPROT_READ 0x01
981 #define VPROT_WRITE 0x02
982 #define VPROT_EXEC 0x04
983 #define VPROT_WRITECOPY 0x08
984 #define VPROT_GUARD 0x10
985 #define VPROT_NOCACHE 0x20
986 #define VPROT_COMMITTED 0x40
987 #define VPROT_IMAGE 0x80
992 unsigned int access; /* wanted access rights */
993 int inherit; /* inherit flag */
994 VARARG(name,unicode_str); /* object name */
996 handle_t handle; /* handle to the mapping */
1000 /* Get information about a file mapping */
1001 @REQ(get_mapping_info)
1002 handle_t handle; /* handle to the mapping */
1004 int size_high; /* mapping size */
1005 int size_low; /* mapping size */
1006 int protect; /* protection flags */
1007 int header_size; /* header size (for VPROT_IMAGE mapping) */
1008 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1009 handle_t shared_file; /* shared mapping file handle */
1010 int shared_size; /* shared mapping size */
1011 int drive_type; /* type of drive the file is on */
1015 /* Create a device */
1017 unsigned int access; /* wanted access rights */
1018 int inherit; /* inherit flag */
1019 int id; /* client private id */
1021 handle_t handle; /* handle to the device */
1025 /* Create a snapshot */
1026 @REQ(create_snapshot)
1027 int inherit; /* inherit flag */
1028 int flags; /* snapshot flags (TH32CS_*) */
1029 void* pid; /* process id */
1031 handle_t handle; /* handle to the snapshot */
1035 /* Get the next process from a snapshot */
1037 handle_t handle; /* handle to the snapshot */
1038 int reset; /* reset snapshot position? */
1040 int count; /* process usage count */
1041 void* pid; /* process id */
1042 int threads; /* number of threads */
1043 int priority; /* process priority */
1047 /* Get the next thread from a snapshot */
1049 handle_t handle; /* handle to the snapshot */
1050 int reset; /* reset snapshot position? */
1052 int count; /* thread usage count */
1053 void* pid; /* process id */
1054 void* tid; /* thread id */
1055 int base_pri; /* base priority */
1056 int delta_pri; /* delta priority */
1060 /* Get the next module from a snapshot */
1062 handle_t handle; /* handle to the snapshot */
1063 int reset; /* reset snapshot position? */
1065 void* pid; /* process id */
1066 void* base; /* module base address */
1070 /* Wait for a debug event */
1071 @REQ(wait_debug_event)
1072 int get_handle; /* should we alloc a handle for waiting? */
1074 void* pid; /* process id */
1075 void* tid; /* thread id */
1076 handle_t wait; /* wait handle if no event ready */
1077 VARARG(event,debug_event); /* debug event data */
1081 /* Queue an exception event */
1082 @REQ(queue_exception_event)
1083 int first; /* first chance exception? */
1084 VARARG(record,exc_event); /* thread context followed by exception record */
1086 handle_t handle; /* handle to the queued event */
1090 /* Retrieve the status of an exception event */
1091 @REQ(get_exception_status)
1092 handle_t handle; /* handle to the queued event */
1094 int status; /* event continuation status */
1095 VARARG(context,context); /* modified thread context */
1099 /* Send an output string to the debugger */
1100 @REQ(output_debug_string)
1101 void* string; /* string to display (in debugged process address space) */
1102 int unicode; /* is it Unicode? */
1103 int length; /* string length */
1107 /* Continue a debug event */
1108 @REQ(continue_debug_event)
1109 void* pid; /* process id to continue */
1110 void* tid; /* thread id to continue */
1111 int status; /* continuation status */
1115 /* Start debugging an existing process */
1117 void* pid; /* id of the process to debug */
1121 /* Read data from a process address space */
1122 @REQ(read_process_memory)
1123 handle_t handle; /* process handle */
1124 void* addr; /* addr to read from */
1126 VARARG(data,bytes); /* result data */
1130 /* Write data to a process address space */
1131 @REQ(write_process_memory)
1132 handle_t handle; /* process handle */
1133 void* addr; /* addr to write to (must be int-aligned) */
1134 unsigned int first_mask; /* mask for first word */
1135 unsigned int last_mask; /* mask for last word */
1136 VARARG(data,bytes); /* data to write */
1140 /* Create a registry key */
1142 handle_t parent; /* handle to the parent key */
1143 unsigned int access; /* desired access rights */
1144 unsigned int options; /* creation options */
1145 time_t modif; /* last modification time */
1146 size_t namelen; /* length of key name in bytes */
1147 VARARG(name,unicode_str,namelen); /* key name */
1148 VARARG(class,unicode_str); /* class name */
1150 handle_t hkey; /* handle to the created key */
1151 int created; /* has it been newly created? */
1154 /* Open a registry key */
1156 handle_t parent; /* handle to the parent key */
1157 unsigned int access; /* desired access rights */
1158 VARARG(name,unicode_str); /* key name */
1160 handle_t hkey; /* handle to the open key */
1164 /* Delete a registry key */
1166 handle_t hkey; /* handle to the key */
1170 /* Enumerate registry subkeys */
1172 handle_t hkey; /* handle to registry key */
1173 int index; /* index of subkey (or -1 for current key) */
1174 int info_class; /* requested information class */
1176 int subkeys; /* number of subkeys */
1177 int max_subkey; /* longest subkey name */
1178 int max_class; /* longest class name */
1179 int values; /* number of values */
1180 int max_value; /* longest value name */
1181 int max_data; /* longest value data */
1182 time_t modif; /* last modification time */
1183 size_t total; /* total length needed for full name and class */
1184 size_t namelen; /* length of key name in bytes */
1185 VARARG(name,unicode_str,namelen); /* key name */
1186 VARARG(class,unicode_str); /* class name */
1190 /* Set a value of a registry key */
1192 handle_t hkey; /* handle to registry key */
1193 int type; /* value type */
1194 size_t namelen; /* length of value name in bytes */
1195 VARARG(name,unicode_str,namelen); /* value name */
1196 VARARG(data,bytes); /* value data */
1200 /* Retrieve the value of a registry key */
1202 handle_t hkey; /* handle to registry key */
1203 VARARG(name,unicode_str); /* value name */
1205 int type; /* value type */
1206 size_t total; /* total length needed for data */
1207 VARARG(data,bytes); /* value data */
1211 /* Enumerate a value of a registry key */
1212 @REQ(enum_key_value)
1213 handle_t hkey; /* handle to registry key */
1214 int index; /* value index */
1215 int info_class; /* requested information class */
1217 int type; /* value type */
1218 size_t total; /* total length needed for full name and data */
1219 size_t namelen; /* length of value name in bytes */
1220 VARARG(name,unicode_str,namelen); /* value name */
1221 VARARG(data,bytes); /* value data */
1225 /* Delete a value of a registry key */
1226 @REQ(delete_key_value)
1227 handle_t hkey; /* handle to registry key */
1228 VARARG(name,unicode_str); /* value name */
1232 /* Load a registry branch from a file */
1234 handle_t hkey; /* root key to load to */
1235 handle_t file; /* file to load from */
1236 VARARG(name,unicode_str); /* subkey name */
1240 /* Save a registry branch to a file */
1242 handle_t hkey; /* key to save */
1243 handle_t file; /* file to save to */
1247 /* Save a registry branch at server exit */
1248 @REQ(save_registry_atexit)
1249 handle_t hkey; /* key to save */
1250 VARARG(file,string); /* file to save to */
1254 /* Set the current and saving level for the registry */
1255 @REQ(set_registry_levels)
1256 int current; /* new current level */
1257 int saving; /* new saving level */
1258 int period; /* duration between periodic saves (milliseconds) */
1262 /* Create a waitable timer */
1264 int inherit; /* inherit flag */
1265 int manual; /* manual reset */
1266 VARARG(name,unicode_str); /* object name */
1268 handle_t handle; /* handle to the timer */
1272 /* Open a waitable timer */
1274 unsigned int access; /* wanted access rights */
1275 int inherit; /* inherit flag */
1276 VARARG(name,unicode_str); /* object name */
1278 handle_t handle; /* handle to the timer */
1281 /* Set a waitable timer */
1283 handle_t handle; /* handle to the timer */
1284 int sec; /* next expiration absolute time */
1285 int usec; /* next expiration absolute time */
1286 int period; /* timer period in ms */
1287 void* callback; /* callback function */
1288 void* arg; /* callback argument */
1291 /* Cancel a waitable timer */
1293 handle_t handle; /* handle to the timer */
1297 /* Retrieve the current context of a thread */
1298 @REQ(get_thread_context)
1299 handle_t handle; /* thread handle */
1300 unsigned int flags; /* context flags */
1302 VARARG(context,context); /* thread context */
1306 /* Set the current context of a thread */
1307 @REQ(set_thread_context)
1308 handle_t handle; /* thread handle */
1309 unsigned int flags; /* context flags */
1310 VARARG(context,context); /* thread context */
1314 /* Fetch a selector entry for a thread */
1315 @REQ(get_selector_entry)
1316 handle_t handle; /* thread handle */
1317 int entry; /* LDT entry */
1319 unsigned int base; /* selector base */
1320 unsigned int limit; /* selector limit */
1321 unsigned char flags; /* selector flags */
1327 int local; /* is atom in local process table? */
1328 VARARG(name,unicode_str); /* atom name */
1330 atom_t atom; /* resulting atom */
1334 /* Delete an atom */
1336 atom_t atom; /* atom handle */
1337 int local; /* is atom in local process table? */
1343 int local; /* is atom in local process table? */
1344 VARARG(name,unicode_str); /* atom name */
1346 atom_t atom; /* atom handle */
1350 /* Get an atom name */
1352 atom_t atom; /* atom handle */
1353 int local; /* is atom in local process table? */
1355 int count; /* atom lock count */
1356 VARARG(name,unicode_str); /* atom name */
1360 /* Init the process atom table */
1361 @REQ(init_atom_table)
1362 int entries; /* number of entries */
1366 /* Get the message queue of the current thread */
1369 handle_t handle; /* handle to the queue */
1373 /* Set the current message queue wakeup mask */
1374 @REQ(set_queue_mask)
1375 unsigned int wake_mask; /* wakeup bits mask */
1376 unsigned int changed_mask; /* changed bits mask */
1377 int skip_wait; /* will we skip waiting if signaled? */
1379 unsigned int wake_bits; /* current wake bits */
1380 unsigned int changed_bits; /* current changed bits */
1384 /* Get the current message queue status */
1385 @REQ(get_queue_status)
1386 int clear; /* should we clear the change bits? */
1388 unsigned int wake_bits; /* wake bits */
1389 unsigned int changed_bits; /* changed bits since last time */
1393 /* Wait for a process to start waiting on input */
1394 @REQ(wait_input_idle)
1395 handle_t handle; /* process handle */
1396 int timeout; /* timeout */
1398 handle_t event; /* handle to idle event */
1402 /* Send a message to a thread queue */
1404 void* id; /* thread id */
1405 int type; /* message type (see below) */
1406 user_handle_t win; /* window handle */
1407 unsigned int msg; /* message code */
1408 unsigned int wparam; /* parameters */
1409 unsigned int lparam; /* parameters */
1410 int x; /* x position */
1411 int y; /* y position */
1412 unsigned int time; /* message time */
1413 unsigned int info; /* extra info */
1414 int timeout; /* timeout for reply */
1415 VARARG(data,bytes); /* message data for sent messages */
1420 MSG_ASCII, /* Ascii message (from SendMessageA) */
1421 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1422 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1423 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1424 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1425 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1426 MSG_HARDWARE_RAW, /* raw hardware message */
1427 MSG_HARDWARE_COOKED /* cooked hardware message */
1431 /* Get a message from the current queue */
1433 int flags; /* see below */
1434 user_handle_t get_win; /* window handle to get */
1435 unsigned int get_first; /* first message code to get */
1436 unsigned int get_last; /* last message code to get */
1438 int type; /* message type */
1439 user_handle_t win; /* window handle */
1440 unsigned int msg; /* message code */
1441 unsigned int wparam; /* parameters */
1442 unsigned int lparam; /* parameters */
1443 int x; /* x position */
1444 int y; /* y position */
1445 unsigned int time; /* message time */
1446 unsigned int info; /* extra info */
1447 size_t total; /* total size of extra data */
1448 VARARG(data,bytes); /* message data for sent messages */
1450 #define GET_MSG_REMOVE 1 /* remove the message */
1451 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1452 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1454 /* Reply to a sent message */
1456 unsigned int result; /* message result */
1457 int remove; /* should we remove the message? */
1458 VARARG(data,bytes); /* message data for sent messages */
1462 /* Retrieve the reply for the last message sent */
1463 @REQ(get_message_reply)
1464 int cancel; /* cancel message if not ready? */
1466 unsigned int result; /* message result */
1467 VARARG(data,bytes); /* message data for sent messages */
1471 /* Set a window timer */
1473 user_handle_t win; /* window handle */
1474 unsigned int msg; /* message to post */
1475 unsigned int id; /* timer id */
1476 unsigned int rate; /* timer rate in ms */
1477 unsigned int lparam; /* message lparam (callback proc) */
1481 /* Kill a window timer */
1482 @REQ(kill_win_timer)
1483 user_handle_t win; /* window handle */
1484 unsigned int msg; /* message to post */
1485 unsigned int id; /* timer id */
1489 /* Open a serial port */
1491 unsigned int access; /* wanted access rights */
1492 int inherit; /* inherit flag */
1493 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1494 unsigned int sharing; /* sharing flags */
1495 VARARG(name,string); /* file name */
1497 handle_t handle; /* handle to the port */
1501 /* Retrieve info about a serial port */
1502 @REQ(get_serial_info)
1503 handle_t handle; /* handle to comm port */
1505 unsigned int readinterval;
1506 unsigned int readconst;
1507 unsigned int readmult;
1508 unsigned int writeconst;
1509 unsigned int writemult;
1510 unsigned int eventmask;
1511 unsigned int commerror;
1515 /* Set info about a serial port */
1516 @REQ(set_serial_info)
1517 handle_t handle; /* handle to comm port */
1518 int flags; /* bitmask to set values (see below) */
1519 unsigned int readinterval;
1520 unsigned int readconst;
1521 unsigned int readmult;
1522 unsigned int writeconst;
1523 unsigned int writemult;
1524 unsigned int eventmask;
1525 unsigned int commerror;
1527 #define SERIALINFO_SET_TIMEOUTS 0x01
1528 #define SERIALINFO_SET_MASK 0x02
1529 #define SERIALINFO_SET_ERROR 0x04
1532 /* Create/Destroy an async I/O */
1533 @REQ(register_async)
1534 handle_t handle; /* handle to comm port, socket or file */
1539 unsigned int status;
1541 #define ASYNC_TYPE_NONE 0x00
1542 #define ASYNC_TYPE_READ 0x01
1543 #define ASYNC_TYPE_WRITE 0x02
1544 #define ASYNC_TYPE_WAIT 0x03
1547 /* Create a named pipe */
1548 @REQ(create_named_pipe)
1549 unsigned int openmode;
1550 unsigned int pipemode;
1551 unsigned int maxinstances;
1552 unsigned int outsize;
1553 unsigned int insize;
1554 unsigned int timeout;
1555 VARARG(name,unicode_str); /* pipe name */
1557 handle_t handle; /* handle to the pipe */
1561 /* Open an existing named pipe */
1562 @REQ(open_named_pipe)
1563 unsigned int access;
1564 VARARG(name,unicode_str); /* pipe name */
1566 handle_t handle; /* handle to the pipe */
1570 /* Connect to a named pipe */
1571 @REQ(connect_named_pipe)
1578 /* Wait for a named pipe */
1579 @REQ(wait_named_pipe)
1580 unsigned int timeout;
1583 VARARG(name,unicode_str); /* pipe name */
1587 /* Disconnect a named pipe */
1588 @REQ(disconnect_named_pipe)
1593 @REQ(get_named_pipe_info)
1597 unsigned int maxinstances;
1598 unsigned int outsize;
1599 unsigned int insize;
1603 /* Create a window */
1605 user_handle_t parent; /* parent window */
1606 user_handle_t owner; /* owner window */
1607 atom_t atom; /* class atom */
1609 user_handle_t handle; /* created window */
1613 /* Link a window into the tree */
1615 user_handle_t handle; /* handle to the window */
1616 user_handle_t parent; /* handle to the parent */
1617 user_handle_t previous; /* previous child in Z-order */
1619 user_handle_t full_parent; /* full handle of new parent */
1623 /* Destroy a window */
1624 @REQ(destroy_window)
1625 user_handle_t handle; /* handle to the window */
1629 /* Set a window owner */
1630 @REQ(set_window_owner)
1631 user_handle_t handle; /* handle to the window */
1632 user_handle_t owner; /* new owner */
1634 user_handle_t full_owner; /* full handle of new owner */
1638 /* Get information from a window handle */
1639 @REQ(get_window_info)
1640 user_handle_t handle; /* handle to the window */
1642 user_handle_t full_handle; /* full 32-bit handle */
1643 void* pid; /* process owning the window */
1644 void* tid; /* thread owning the window */
1645 atom_t atom; /* class atom */
1649 /* Set some information in a window */
1650 @REQ(set_window_info)
1651 user_handle_t handle; /* handle to the window */
1652 unsigned int flags; /* flags for fields to set (see below) */
1653 unsigned int style; /* window style */
1654 unsigned int ex_style; /* window extended style */
1655 unsigned int id; /* window id */
1656 void* instance; /* creator instance */
1657 void* user_data; /* user-specific data */
1659 unsigned int old_style; /* old window style */
1660 unsigned int old_ex_style; /* old window extended style */
1661 unsigned int old_id; /* old window id */
1662 void* old_instance; /* old creator instance */
1663 void* old_user_data; /* old user-specific data */
1665 #define SET_WIN_STYLE 0x01
1666 #define SET_WIN_EXSTYLE 0x02
1667 #define SET_WIN_ID 0x04
1668 #define SET_WIN_INSTANCE 0x08
1669 #define SET_WIN_USERDATA 0x10
1672 /* Get a list of the window parents, up to the root of the tree */
1673 @REQ(get_window_parents)
1674 user_handle_t handle; /* handle to the window */
1676 int count; /* total count of parents */
1677 VARARG(parents,user_handles); /* parent handles */
1681 /* Get a list of the window children */
1682 @REQ(get_window_children)
1683 user_handle_t parent; /* parent window */
1684 atom_t atom; /* class atom for the listed children */
1685 void* tid; /* thread owning the listed children */
1687 int count; /* total count of children */
1688 VARARG(children,user_handles); /* children handles */
1692 /* Get window tree information from a window handle */
1693 @REQ(get_window_tree)
1694 user_handle_t handle; /* handle to the window */
1696 user_handle_t parent; /* parent window */
1697 user_handle_t owner; /* owner window */
1698 user_handle_t next_sibling; /* next sibling in Z-order */
1699 user_handle_t prev_sibling; /* prev sibling in Z-order */
1700 user_handle_t first_sibling; /* first sibling in Z-order */
1701 user_handle_t last_sibling; /* last sibling in Z-order */
1702 user_handle_t first_child; /* first child */
1703 user_handle_t last_child; /* last child */
1706 /* Set the window and client rectangles of a window */
1707 @REQ(set_window_rectangles)
1708 user_handle_t handle; /* handle to the window */
1709 rectangle_t window; /* window rectangle */
1710 rectangle_t client; /* client rectangle */
1714 /* Get the window and client rectangles of a window */
1715 @REQ(get_window_rectangles)
1716 user_handle_t handle; /* handle to the window */
1718 rectangle_t window; /* window rectangle */
1719 rectangle_t client; /* client rectangle */
1723 /* Get the window text */
1724 @REQ(get_window_text)
1725 user_handle_t handle; /* handle to the window */
1727 VARARG(text,unicode_str); /* window text */
1731 /* Set the window text */
1732 @REQ(set_window_text)
1733 user_handle_t handle; /* handle to the window */
1734 VARARG(text,unicode_str); /* window text */
1738 /* Increment the window paint count */
1739 @REQ(inc_window_paint_count)
1740 user_handle_t handle; /* handle to the window */
1741 int incr; /* increment (can be negative) */
1745 /* Get the coordinates offset between two windows */
1746 @REQ(get_windows_offset)
1747 user_handle_t from; /* handle to the first window */
1748 user_handle_t to; /* handle to the second window */
1750 int x; /* x coordinate offset */
1751 int y; /* y coordinate offset */
1755 /* Set a window property */
1756 @REQ(set_window_property)
1757 user_handle_t window; /* handle to the window */
1758 atom_t atom; /* property atom (high-word set if it was a string) */
1759 int string; /* was atom a string originally? */
1760 handle_t handle; /* handle to store */
1764 /* Remove a window property */
1765 @REQ(remove_window_property)
1766 user_handle_t window; /* handle to the window */
1767 atom_t atom; /* property atom */
1769 handle_t handle; /* handle stored in property */
1773 /* Get a window property */
1774 @REQ(get_window_property)
1775 user_handle_t window; /* handle to the window */
1776 atom_t atom; /* property atom */
1778 handle_t handle; /* handle stored in property */
1782 /* Get the list of properties of a window */
1783 @REQ(get_window_properties)
1784 user_handle_t window; /* handle to the window */
1786 int total; /* total number of properties */
1787 VARARG(props,properties); /* list of properties */