3 * Wine server protocol definition
5 * Copyright (C) 2001 Alexandre Julliard
7 * This file is used by tools/make_requests to build the
8 * protocol structures in include/wine/server_protocol.h
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 @HEADER /* start of C declarations */
33 int req; /* request code */
34 size_t request_size; /* request variable part size */
35 size_t reply_size; /* reply variable part maximum size */
40 unsigned int error; /* error result */
41 size_t reply_size; /* reply variable part size */
44 /* placeholder structure for the maximum allowed request size */
45 /* this is used to construct the generic_request union */
46 struct request_max_size
48 int pad[16]; /* the max request size is 16 ints */
51 /* max size of the variable part of a request */
52 #define REQUEST_MAX_VAR_SIZE 1024
55 typedef unsigned short atom_t;
56 typedef unsigned int user_handle_t;
58 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
59 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
62 /* definitions of the event data depending on the event code */
63 struct debug_event_exception
65 EXCEPTION_RECORD record; /* exception record */
66 int first; /* first chance exception? */
68 struct debug_event_create_thread
70 handle_t handle; /* handle to the new thread */
71 void *teb; /* thread teb (in debugged process address space) */
72 void *start; /* thread startup routine */
74 struct debug_event_create_process
76 handle_t file; /* handle to the process exe file */
77 handle_t process; /* handle to the new process */
78 handle_t thread; /* handle to the new thread */
79 void *base; /* base of executable image */
80 int dbg_offset; /* offset of debug info in file */
81 int dbg_size; /* size of debug info */
82 void *teb; /* thread teb (in debugged process address space) */
83 void *start; /* thread startup routine */
84 void *name; /* image name (optional) */
85 int unicode; /* is it Unicode? */
87 struct debug_event_exit
89 int exit_code; /* thread or process exit code */
91 struct debug_event_load_dll
93 handle_t handle; /* file handle for the dll */
94 void *base; /* base address of the dll */
95 int dbg_offset; /* offset of debug info in file */
96 int dbg_size; /* size of debug info */
97 void *name; /* image name (optional) */
98 int unicode; /* is it Unicode? */
100 struct debug_event_unload_dll
102 void *base; /* base address of the dll */
104 struct debug_event_output_string
106 void *string; /* string to display (in debugged process address space) */
107 int unicode; /* is it Unicode? */
108 int length; /* string length */
110 struct debug_event_rip_info
115 union debug_event_data
117 struct debug_event_exception exception;
118 struct debug_event_create_thread create_thread;
119 struct debug_event_create_process create_process;
120 struct debug_event_exit exit;
121 struct debug_event_load_dll load_dll;
122 struct debug_event_unload_dll unload_dll;
123 struct debug_event_output_string output_string;
124 struct debug_event_rip_info rip_info;
127 /* debug event data */
130 int code; /* event code */
131 union debug_event_data info; /* event information */
134 /* structure used in sending an fd from client to server */
137 void *tid; /* thread id */
138 int fd; /* file descriptor on client-side */
141 /* structure sent by the server on the wait fifo */
144 void *cookie; /* magic cookie that was passed in select_request */
145 int signaled; /* wait result */
148 /* structure returned in the list of window properties */
151 atom_t atom; /* property atom */
152 short string; /* was atom a string originally? */
153 handle_t handle; /* handle stored in property */
156 /* structure to specify window rectangles */
165 /* structure for console char/attribute info */
172 /****************************************************************/
173 /* Request declarations */
175 /* Create a new process from the context of the parent */
177 int inherit_all; /* inherit all handles from parent */
178 int create_flags; /* creation flags */
179 int start_flags; /* flags from startup info */
180 handle_t exe_file; /* file handle for main exe */
181 handle_t hstdin; /* handle for stdin */
182 handle_t hstdout; /* handle for stdout */
183 handle_t hstderr; /* handle for stderr */
184 int cmd_show; /* main window show mode */
185 VARARG(filename,string); /* file name of main exe */
187 handle_t info; /* new process info handle */
191 /* Retrieve information about a newly started process */
192 @REQ(get_new_process_info)
193 handle_t info; /* info handle returned from new_process_request */
194 int pinherit; /* process handle inherit flag */
195 int tinherit; /* thread handle inherit flag */
197 void* pid; /* process id */
198 handle_t phandle; /* process handle (in the current process) */
199 void* tid; /* thread id */
200 handle_t thandle; /* thread handle (in the current process) */
201 handle_t event; /* event handle to signal startup */
205 /* Create a new thread from the context of the parent */
207 int suspend; /* new thread should be suspended on creation */
208 int inherit; /* inherit flag */
209 int request_fd; /* fd for request pipe */
211 void* tid; /* thread id */
212 handle_t handle; /* thread handle (in the current process) */
216 /* Signal that we are finished booting on the client side */
218 int debug_level; /* new debug level */
222 /* Initialize a process; called from the new process context */
224 void* ldt_copy; /* addr of LDT copy */
225 int ppid; /* parent Unix pid */
227 int create_flags; /* creation flags */
228 int start_flags; /* flags from startup info */
229 unsigned int server_start; /* server start time (GetTickCount) */
230 handle_t exe_file; /* file handle for main exe */
231 handle_t hstdin; /* handle for stdin */
232 handle_t hstdout; /* handle for stdout */
233 handle_t hstderr; /* handle for stderr */
234 int cmd_show; /* main window show mode */
235 VARARG(filename,string); /* file name of main exe */
239 /* Signal the end of the process initialization */
240 @REQ(init_process_done)
241 void* module; /* main module base address */
242 size_t module_size; /* main module size */
243 void* entry; /* process entry point */
244 void* name; /* ptr to ptr to name (in process addr space) */
245 handle_t exe_file; /* file handle for main exe */
246 int gui; /* is it a GUI process? */
247 VARARG(filename,string); /* file name of main exe */
249 int debugged; /* being debugged? */
253 /* Initialize a thread; called from the child after fork()/clone() */
255 int unix_pid; /* Unix pid of new thread */
256 void* teb; /* TEB of new thread (in thread address space) */
257 void* entry; /* thread entry point (in thread address space) */
258 int reply_fd; /* fd for reply pipe */
259 int wait_fd; /* fd for blocking calls pipe */
261 void* pid; /* process id of the new thread's process */
262 void* tid; /* thread id of the new thread */
263 int boot; /* is this the boot thread? */
264 int version; /* protocol version */
268 /* Terminate a process */
269 @REQ(terminate_process)
270 handle_t handle; /* process handle to terminate */
271 int exit_code; /* process exit code */
273 int self; /* suicide? */
277 /* Terminate a thread */
278 @REQ(terminate_thread)
279 handle_t handle; /* thread handle to terminate */
280 int exit_code; /* thread exit code */
282 int self; /* suicide? */
283 int last; /* last thread in this process? */
287 /* Retrieve information about a process */
288 @REQ(get_process_info)
289 handle_t handle; /* process handle */
291 void* pid; /* server process id */
292 int debugged; /* debugged? */
293 int exit_code; /* process exit code */
294 int priority; /* priority class */
295 int process_affinity; /* process affinity mask */
296 int system_affinity; /* system affinity mask */
300 /* Set a process informations */
301 @REQ(set_process_info)
302 handle_t handle; /* process handle */
303 int mask; /* setting mask (see below) */
304 int priority; /* priority class */
305 int affinity; /* affinity mask */
307 #define SET_PROCESS_INFO_PRIORITY 0x01
308 #define SET_PROCESS_INFO_AFFINITY 0x02
311 /* Retrieve information about a thread */
312 @REQ(get_thread_info)
313 handle_t handle; /* thread handle */
314 void* tid_in; /* thread id (optional) */
316 void* tid; /* server thread id */
317 void* teb; /* thread teb pointer */
318 int exit_code; /* thread exit code */
319 int priority; /* thread priority level */
323 /* Set a thread informations */
324 @REQ(set_thread_info)
325 handle_t handle; /* thread handle */
326 int mask; /* setting mask (see below) */
327 int priority; /* priority class */
328 int affinity; /* affinity mask */
330 #define SET_THREAD_INFO_PRIORITY 0x01
331 #define SET_THREAD_INFO_AFFINITY 0x02
334 /* Suspend a thread */
336 handle_t handle; /* thread handle */
338 int count; /* new suspend count */
342 /* Resume a thread */
344 handle_t handle; /* thread handle */
346 int count; /* new suspend count */
350 /* Notify the server that a dll has been loaded */
352 handle_t handle; /* file handle */
353 void* base; /* base address */
354 size_t size; /* dll size */
355 int dbg_offset; /* debug info offset */
356 int dbg_size; /* debug info size */
357 void* name; /* ptr to ptr to name (in process addr space) */
358 VARARG(filename,string); /* file name of dll */
362 /* Notify the server that a dll is being unloaded */
364 void* base; /* base address */
368 /* Queue an APC for a thread */
370 handle_t handle; /* thread handle */
371 int user; /* user or system apc? */
372 void* func; /* function to call */
373 void* param; /* param for function to call */
377 /* Get next APC to call */
379 int alertable; /* is thread alertable? */
381 void* func; /* function to call */
382 int type; /* function type */
383 VARARG(args,ptrs); /* function arguments */
385 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
388 /* Close a handle for the current process */
390 handle_t handle; /* handle to close */
392 int fd; /* associated fd to close */
396 /* Set a handle information */
397 @REQ(set_handle_info)
398 handle_t handle; /* handle we are interested in */
399 int flags; /* new handle flags */
400 int mask; /* mask for flags to set */
401 int fd; /* file descriptor or -1 */
403 int old_flags; /* old flag value */
404 int cur_fd; /* current file descriptor */
408 /* Duplicate a handle */
410 handle_t src_process; /* src process handle */
411 handle_t src_handle; /* src handle to duplicate */
412 handle_t dst_process; /* dst process handle */
413 unsigned int access; /* wanted access rights */
414 int inherit; /* inherit flag */
415 int options; /* duplicate options (see below) */
417 handle_t handle; /* duplicated handle in dst process */
418 int fd; /* associated fd to close */
420 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
421 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
422 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
425 /* Open a handle to a process */
427 void* pid; /* process id to open */
428 unsigned int access; /* wanted access rights */
429 int inherit; /* inherit flag */
431 handle_t handle; /* handle to the process */
435 /* Wait for handles */
437 int flags; /* wait flags (see below) */
438 void* cookie; /* magic cookie to return to client */
439 int sec; /* absolute timeout */
440 int usec; /* absolute timeout */
441 VARARG(handles,handles); /* handles to select on */
444 #define SELECT_ALERTABLE 2
445 #define SELECT_INTERRUPTIBLE 4
446 #define SELECT_TIMEOUT 8
449 /* Create an event */
451 int manual_reset; /* manual reset event */
452 int initial_state; /* initial state of the event */
453 int inherit; /* inherit flag */
454 VARARG(name,unicode_str); /* object name */
456 handle_t handle; /* handle to the event */
459 /* Event operation */
461 handle_t handle; /* handle to event */
462 int op; /* event operation (see below) */
464 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
469 unsigned int access; /* wanted access rights */
470 int inherit; /* inherit flag */
471 VARARG(name,unicode_str); /* object name */
473 handle_t handle; /* handle to the event */
479 int owned; /* initially owned? */
480 int inherit; /* inherit flag */
481 VARARG(name,unicode_str); /* object name */
483 handle_t handle; /* handle to the mutex */
487 /* Release a mutex */
489 handle_t handle; /* handle to the mutex */
495 unsigned int access; /* wanted access rights */
496 int inherit; /* inherit flag */
497 VARARG(name,unicode_str); /* object name */
499 handle_t handle; /* handle to the mutex */
503 /* Create a semaphore */
504 @REQ(create_semaphore)
505 unsigned int initial; /* initial count */
506 unsigned int max; /* maximum count */
507 int inherit; /* inherit flag */
508 VARARG(name,unicode_str); /* object name */
510 handle_t handle; /* handle to the semaphore */
514 /* Release a semaphore */
515 @REQ(release_semaphore)
516 handle_t handle; /* handle to the semaphore */
517 unsigned int count; /* count to add to semaphore */
519 unsigned int prev_count; /* previous semaphore count */
523 /* Open a semaphore */
525 unsigned int access; /* wanted access rights */
526 int inherit; /* inherit flag */
527 VARARG(name,unicode_str); /* object name */
529 handle_t handle; /* handle to the semaphore */
535 unsigned int access; /* wanted access rights */
536 int inherit; /* inherit flag */
537 unsigned int sharing; /* sharing flags */
538 int create; /* file create action */
539 unsigned int attrs; /* file attributes for creation */
540 int drive_type; /* type of drive the file is on */
541 VARARG(filename,string); /* file name */
543 handle_t handle; /* handle to the file */
547 /* Allocate a file handle for a Unix fd */
548 @REQ(alloc_file_handle)
549 unsigned int access; /* wanted access rights */
550 int inherit; /* inherit flag */
551 int fd; /* file descriptor on the client side */
553 handle_t handle; /* handle to the file */
557 /* Get a Unix fd to access a file */
559 handle_t handle; /* handle to the file */
560 unsigned int access; /* wanted access rights */
562 int fd; /* file descriptor */
563 int type; /* the type of file (see below) */
564 int flags; /* file read/write flags (see below) */
573 #define FD_FLAG_OVERLAPPED 0x01
574 #define FD_FLAG_TIMEOUT 0x02
577 /* Set a file current position */
578 @REQ(set_file_pointer)
579 handle_t handle; /* handle to the file */
580 int low; /* position low word */
581 int high; /* position high word */
582 int whence; /* whence to seek */
584 int new_low; /* new position low word */
585 int new_high; /* new position high word */
589 /* Truncate (or extend) a file */
591 handle_t handle; /* handle to the file */
595 /* Set a file access and modification times */
597 handle_t handle; /* handle to the file */
598 time_t access_time; /* last access time */
599 time_t write_time; /* last write time */
603 /* Flush a file buffers */
605 handle_t handle; /* handle to the file */
609 /* Get information about a file */
611 handle_t handle; /* handle to the file */
613 int type; /* file type */
614 int attr; /* file attributes */
615 time_t access_time; /* last access time */
616 time_t write_time; /* last write time */
617 int size_high; /* file size */
618 int size_low; /* file size */
619 int links; /* number of links */
620 int index_high; /* unique index */
621 int index_low; /* unique index */
622 unsigned int serial; /* volume serial number */
626 /* Lock a region of a file */
628 handle_t handle; /* handle to the file */
629 unsigned int offset_low; /* offset of start of lock */
630 unsigned int offset_high; /* offset of start of lock */
631 unsigned int count_low; /* count of bytes to lock */
632 unsigned int count_high; /* count of bytes to lock */
636 /* Unlock a region of a file */
638 handle_t handle; /* handle to the file */
639 unsigned int offset_low; /* offset of start of unlock */
640 unsigned int offset_high; /* offset of start of unlock */
641 unsigned int count_low; /* count of bytes to unlock */
642 unsigned int count_high; /* count of bytes to unlock */
646 /* Create an anonymous pipe */
648 int inherit; /* inherit flag */
650 handle_t handle_read; /* handle to the read-side of the pipe */
651 handle_t handle_write; /* handle to the write-side of the pipe */
655 /* Create a socket */
657 unsigned int access; /* wanted access rights */
658 int inherit; /* inherit flag */
659 int family; /* family, see socket manpage */
660 int type; /* type, see socket manpage */
661 int protocol; /* protocol, see socket manpage */
662 unsigned int flags; /* socket flags */
664 handle_t handle; /* handle to the new socket */
668 /* Accept a socket */
670 handle_t lhandle; /* handle to the listening socket */
671 unsigned int access; /* wanted access rights */
672 int inherit; /* inherit flag */
674 handle_t handle; /* handle to the new socket */
678 /* Set socket event parameters */
679 @REQ(set_socket_event)
680 handle_t handle; /* handle to the socket */
681 unsigned int mask; /* event mask */
682 handle_t event; /* event object */
683 user_handle_t window; /* window to send the message to */
684 unsigned int msg; /* message to send */
688 /* Get socket event parameters */
689 @REQ(get_socket_event)
690 handle_t handle; /* handle to the socket */
691 int service; /* clear pending? */
692 handle_t c_event; /* event to clear */
694 unsigned int mask; /* event mask */
695 unsigned int pmask; /* pending events */
696 unsigned int state; /* status bits */
697 VARARG(errors,ints); /* event errors */
701 /* Reenable pending socket events */
702 @REQ(enable_socket_event)
703 handle_t handle; /* handle to the socket */
704 unsigned int mask; /* events to re-enable */
705 unsigned int sstate; /* status bits to set */
706 unsigned int cstate; /* status bits to clear */
710 /* Allocate a console (only used by a console renderer) */
712 unsigned int access; /* wanted access rights */
713 int inherit; /* inherit flag */
714 void* pid; /* pid of process which shall be attached to the console */
716 handle_t handle_in; /* handle to console input */
717 handle_t event; /* handle to renderer events change notification */
721 /* Free the console of the current process */
726 #define CONSOLE_RENDERER_NONE_EVENT 0x00
727 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
728 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
729 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
730 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
731 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
732 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
733 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
734 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
735 struct console_renderer_event
770 /* retrieve console events for the renderer */
771 @REQ(get_console_renderer_events)
772 handle_t handle; /* handle to console input events */
774 VARARG(data,bytes); /* the various console_renderer_events */
778 /* Open a handle to the process console */
780 int from; /* 0 (resp 1) input (resp output) of current process console */
781 /* otherwise console_in handle to get active screen buffer? */
782 unsigned int access; /* wanted access rights */
783 int inherit; /* inherit flag */
784 int share; /* share mask (only for output handles) */
786 handle_t handle; /* handle to the console */
790 /* Get a console mode (input or output) */
791 @REQ(get_console_mode)
792 handle_t handle; /* handle to the console */
794 int mode; /* console mode */
798 /* Set a console mode (input or output) */
799 @REQ(set_console_mode)
800 handle_t handle; /* handle to the console */
801 int mode; /* console mode */
805 /* Set info about a console (input only) */
806 @REQ(set_console_input_info)
807 handle_t handle; /* handle to console input, or 0 for process' console */
808 int mask; /* setting mask (see below) */
809 handle_t active_sb; /* active screen buffer */
810 int history_mode; /* whether we duplicate lines in history */
811 int history_size; /* number of lines in history */
812 VARARG(title,unicode_str); /* console title */
814 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
815 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
816 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
817 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
820 /* Get info about a console (input only) */
821 @REQ(get_console_input_info)
822 handle_t handle; /* handle to console input, or 0 for process' console */
824 int history_mode; /* whether we duplicate lines in history */
825 int history_size; /* number of lines in history */
826 int history_index; /* number of used lines in history */
827 VARARG(title,unicode_str); /* console title */
831 /* appends a string to console's history */
832 @REQ(append_console_input_history)
833 handle_t handle; /* handle to console input, or 0 for process' console */
834 VARARG(line,unicode_str); /* line to add */
838 /* appends a string to console's history */
839 @REQ(get_console_input_history)
840 handle_t handle; /* handle to console input, or 0 for process' console */
841 int index; /* index to get line from */
843 int total; /* total length of line in Unicode chars */
844 VARARG(line,unicode_str); /* line to add */
848 /* creates a new screen buffer on process' console */
849 @REQ(create_console_output)
850 handle_t handle_in; /* handle to console input, or 0 for process' console */
851 int access; /* wanted access rights */
852 int share; /* sharing credentials */
853 int inherit; /* inherit flag */
855 handle_t handle_out; /* handle to the screen buffer */
859 /* Set info about a console (output only) */
860 @REQ(set_console_output_info)
861 handle_t handle; /* handle to the console */
862 int mask; /* setting mask (see below) */
863 short int cursor_size; /* size of cursor (percentage filled) */
864 short int cursor_visible;/* cursor visibility flag */
865 short int cursor_x; /* position of cursor (x, y) */
867 short int width; /* width of the screen buffer */
868 short int height; /* height of the screen buffer */
869 short int attr; /* default attribute */
870 short int win_left; /* window actually displayed by renderer */
871 short int win_top; /* the rect area is expressed withing the */
872 short int win_right; /* boundaries of the screen buffer */
873 short int win_bottom;
874 short int max_width; /* maximum size (width x height) for the window */
875 short int max_height;
877 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
878 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
879 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
880 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
881 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
882 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
885 /* Get info about a console (output only) */
886 @REQ(get_console_output_info)
887 handle_t handle; /* handle to the console */
889 short int cursor_size; /* size of cursor (percentage filled) */
890 short int cursor_visible;/* cursor visibility flag */
891 short int cursor_x; /* position of cursor (x, y) */
893 short int width; /* width of the screen buffer */
894 short int height; /* height of the screen buffer */
895 short int attr; /* default attribute */
896 short int win_left; /* window actually displayed by renderer */
897 short int win_top; /* the rect area is expressed withing the */
898 short int win_right; /* boundaries of the screen buffer */
899 short int win_bottom;
900 short int max_width; /* maximum size (width x height) for the window */
901 short int max_height;
904 /* Add input records to a console input queue */
905 @REQ(write_console_input)
906 handle_t handle; /* handle to the console input */
907 VARARG(rec,input_records); /* input records */
909 int written; /* number of records written */
913 /* Fetch input records from a console input queue */
914 @REQ(read_console_input)
915 handle_t handle; /* handle to the console input */
916 int flush; /* flush the retrieved records from the queue? */
918 int read; /* number of records read */
919 VARARG(rec,input_records); /* input records */
923 /* write data (chars and/or attributes) in a screen buffer */
924 @REQ(write_console_output)
925 handle_t handle; /* handle to the console output */
926 int x; /* position where to start writing */
928 int mode; /* char info (see below) */
929 int wrap; /* wrap around at end of line? */
930 VARARG(data,bytes); /* info to write */
932 int written; /* number of char infos actually written */
933 int width; /* width of screen buffer */
934 int height; /* height of screen buffer */
938 CHAR_INFO_MODE_TEXT, /* characters only */
939 CHAR_INFO_MODE_ATTR, /* attributes only */
940 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
941 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
945 /* fill a screen buffer with constant data (chars and/or attributes) */
946 @REQ(fill_console_output)
947 handle_t handle; /* handle to the console output */
948 int x; /* position where to start writing */
950 int mode; /* char info mode */
951 int count; /* number to write */
952 int wrap; /* wrap around at end of line? */
953 char_info_t data; /* data to write */
955 int written; /* number of char infos actually written */
959 /* read data (chars and/or attributes) from a screen buffer */
960 @REQ(read_console_output)
961 handle_t handle; /* handle to the console output */
962 int x; /* position (x,y) where to start reading */
964 int mode; /* char info mode */
965 int wrap; /* wrap around at end of line? */
967 int width; /* width of screen buffer */
968 int height; /* height of screen buffer */
972 /* move a rect (of data) in screen buffer content */
973 @REQ(move_console_output)
974 handle_t handle; /* handle to the console output */
975 short int x_src; /* position (x, y) of rect to start moving from */
977 short int x_dst; /* position (x, y) of rect to move to */
979 short int w; /* size of the rect (width, height) to move */
984 /* Create a change notification */
985 @REQ(create_change_notification)
986 int subtree; /* watch all the subtree */
987 int filter; /* notification filter */
989 handle_t handle; /* handle to the change notification */
993 /* Create a file mapping */
995 int size_high; /* mapping size */
996 int size_low; /* mapping size */
997 int protect; /* protection flags (see below) */
998 int inherit; /* inherit flag */
999 handle_t file_handle; /* file handle */
1000 VARARG(name,unicode_str); /* object name */
1002 handle_t handle; /* handle to the mapping */
1004 /* protection flags */
1005 #define VPROT_READ 0x01
1006 #define VPROT_WRITE 0x02
1007 #define VPROT_EXEC 0x04
1008 #define VPROT_WRITECOPY 0x08
1009 #define VPROT_GUARD 0x10
1010 #define VPROT_NOCACHE 0x20
1011 #define VPROT_COMMITTED 0x40
1012 #define VPROT_IMAGE 0x80
1015 /* Open a mapping */
1017 unsigned int access; /* wanted access rights */
1018 int inherit; /* inherit flag */
1019 VARARG(name,unicode_str); /* object name */
1021 handle_t handle; /* handle to the mapping */
1025 /* Get information about a file mapping */
1026 @REQ(get_mapping_info)
1027 handle_t handle; /* handle to the mapping */
1029 int size_high; /* mapping size */
1030 int size_low; /* mapping size */
1031 int protect; /* protection flags */
1032 int header_size; /* header size (for VPROT_IMAGE mapping) */
1033 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1034 handle_t shared_file; /* shared mapping file handle */
1035 int shared_size; /* shared mapping size */
1036 int drive_type; /* type of drive the file is on */
1040 /* Create a device */
1042 unsigned int access; /* wanted access rights */
1043 int inherit; /* inherit flag */
1044 int id; /* client private id */
1046 handle_t handle; /* handle to the device */
1050 /* Create a snapshot */
1051 @REQ(create_snapshot)
1052 int inherit; /* inherit flag */
1053 int flags; /* snapshot flags (TH32CS_*) */
1054 void* pid; /* process id */
1056 handle_t handle; /* handle to the snapshot */
1060 /* Get the next process from a snapshot */
1062 handle_t handle; /* handle to the snapshot */
1063 int reset; /* reset snapshot position? */
1065 int count; /* process usage count */
1066 void* pid; /* process id */
1067 void* ppid; /* parent process id */
1068 void* heap; /* heap base */
1069 void* module; /* main module */
1070 int threads; /* number of threads */
1071 int priority; /* process priority */
1072 VARARG(filename,string); /* file name of main exe */
1076 /* Get the next thread from a snapshot */
1078 handle_t handle; /* handle to the snapshot */
1079 int reset; /* reset snapshot position? */
1081 int count; /* thread usage count */
1082 void* pid; /* process id */
1083 void* tid; /* thread id */
1084 int base_pri; /* base priority */
1085 int delta_pri; /* delta priority */
1089 /* Get the next module from a snapshot */
1091 handle_t handle; /* handle to the snapshot */
1092 int reset; /* reset snapshot position? */
1094 void* pid; /* process id */
1095 void* base; /* module base address */
1096 size_t size; /* module size */
1097 VARARG(filename,string); /* file name of module */
1101 /* Wait for a debug event */
1102 @REQ(wait_debug_event)
1103 int get_handle; /* should we alloc a handle for waiting? */
1105 void* pid; /* process id */
1106 void* tid; /* thread id */
1107 handle_t wait; /* wait handle if no event ready */
1108 VARARG(event,debug_event); /* debug event data */
1112 /* Queue an exception event */
1113 @REQ(queue_exception_event)
1114 int first; /* first chance exception? */
1115 VARARG(record,exc_event); /* thread context followed by exception record */
1117 handle_t handle; /* handle to the queued event */
1121 /* Retrieve the status of an exception event */
1122 @REQ(get_exception_status)
1123 handle_t handle; /* handle to the queued event */
1125 int status; /* event continuation status */
1126 VARARG(context,context); /* modified thread context */
1130 /* Send an output string to the debugger */
1131 @REQ(output_debug_string)
1132 void* string; /* string to display (in debugged process address space) */
1133 int unicode; /* is it Unicode? */
1134 int length; /* string length */
1138 /* Continue a debug event */
1139 @REQ(continue_debug_event)
1140 void* pid; /* process id to continue */
1141 void* tid; /* thread id to continue */
1142 int status; /* continuation status */
1146 /* Start/stop debugging an existing process */
1148 void* pid; /* id of the process to debug */
1149 int attach; /* 1=attaching / 0=detaching from the process */
1153 /* Simulate a breakpoint in a process */
1155 handle_t handle; /* process handle */
1157 int self; /* was it the caller itself? */
1161 /* Set debugger kill on exit flag */
1162 @REQ(set_debugger_kill_on_exit)
1163 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1167 /* Read data from a process address space */
1168 @REQ(read_process_memory)
1169 handle_t handle; /* process handle */
1170 void* addr; /* addr to read from */
1172 VARARG(data,bytes); /* result data */
1176 /* Write data to a process address space */
1177 @REQ(write_process_memory)
1178 handle_t handle; /* process handle */
1179 void* addr; /* addr to write to (must be int-aligned) */
1180 unsigned int first_mask; /* mask for first word */
1181 unsigned int last_mask; /* mask for last word */
1182 VARARG(data,bytes); /* data to write */
1186 /* Create a registry key */
1188 handle_t parent; /* handle to the parent key */
1189 unsigned int access; /* desired access rights */
1190 unsigned int options; /* creation options */
1191 time_t modif; /* last modification time */
1192 size_t namelen; /* length of key name in bytes */
1193 VARARG(name,unicode_str,namelen); /* key name */
1194 VARARG(class,unicode_str); /* class name */
1196 handle_t hkey; /* handle to the created key */
1197 int created; /* has it been newly created? */
1200 /* Open a registry key */
1202 handle_t parent; /* handle to the parent key */
1203 unsigned int access; /* desired access rights */
1204 VARARG(name,unicode_str); /* key name */
1206 handle_t hkey; /* handle to the open key */
1210 /* Delete a registry key */
1212 handle_t hkey; /* handle to the key */
1216 /* Enumerate registry subkeys */
1218 handle_t hkey; /* handle to registry key */
1219 int index; /* index of subkey (or -1 for current key) */
1220 int info_class; /* requested information class */
1222 int subkeys; /* number of subkeys */
1223 int max_subkey; /* longest subkey name */
1224 int max_class; /* longest class name */
1225 int values; /* number of values */
1226 int max_value; /* longest value name */
1227 int max_data; /* longest value data */
1228 time_t modif; /* last modification time */
1229 size_t total; /* total length needed for full name and class */
1230 size_t namelen; /* length of key name in bytes */
1231 VARARG(name,unicode_str,namelen); /* key name */
1232 VARARG(class,unicode_str); /* class name */
1236 /* Set a value of a registry key */
1238 handle_t hkey; /* handle to registry key */
1239 int type; /* value type */
1240 size_t namelen; /* length of value name in bytes */
1241 VARARG(name,unicode_str,namelen); /* value name */
1242 VARARG(data,bytes); /* value data */
1246 /* Retrieve the value of a registry key */
1248 handle_t hkey; /* handle to registry key */
1249 VARARG(name,unicode_str); /* value name */
1251 int type; /* value type */
1252 size_t total; /* total length needed for data */
1253 VARARG(data,bytes); /* value data */
1257 /* Enumerate a value of a registry key */
1258 @REQ(enum_key_value)
1259 handle_t hkey; /* handle to registry key */
1260 int index; /* value index */
1261 int info_class; /* requested information class */
1263 int type; /* value type */
1264 size_t total; /* total length needed for full name and data */
1265 size_t namelen; /* length of value name in bytes */
1266 VARARG(name,unicode_str,namelen); /* value name */
1267 VARARG(data,bytes); /* value data */
1271 /* Delete a value of a registry key */
1272 @REQ(delete_key_value)
1273 handle_t hkey; /* handle to registry key */
1274 VARARG(name,unicode_str); /* value name */
1278 /* Load a registry branch from a file */
1280 handle_t hkey; /* root key to load to */
1281 handle_t file; /* file to load from */
1282 VARARG(name,unicode_str); /* subkey name */
1286 /* Save a registry branch to a file */
1288 handle_t hkey; /* key to save */
1289 handle_t file; /* file to save to */
1293 /* Save a registry branch at server exit */
1294 @REQ(save_registry_atexit)
1295 handle_t hkey; /* key to save */
1296 VARARG(file,string); /* file to save to */
1300 /* Set the current and saving level for the registry */
1301 @REQ(set_registry_levels)
1302 int current; /* new current level */
1303 int saving; /* new saving level */
1304 int period; /* duration between periodic saves (milliseconds) */
1308 /* Create a waitable timer */
1310 int inherit; /* inherit flag */
1311 int manual; /* manual reset */
1312 VARARG(name,unicode_str); /* object name */
1314 handle_t handle; /* handle to the timer */
1318 /* Open a waitable timer */
1320 unsigned int access; /* wanted access rights */
1321 int inherit; /* inherit flag */
1322 VARARG(name,unicode_str); /* object name */
1324 handle_t handle; /* handle to the timer */
1327 /* Set a waitable timer */
1329 handle_t handle; /* handle to the timer */
1330 int sec; /* next expiration absolute time */
1331 int usec; /* next expiration absolute time */
1332 int period; /* timer period in ms */
1333 void* callback; /* callback function */
1334 void* arg; /* callback argument */
1337 /* Cancel a waitable timer */
1339 handle_t handle; /* handle to the timer */
1343 /* Retrieve the current context of a thread */
1344 @REQ(get_thread_context)
1345 handle_t handle; /* thread handle */
1346 unsigned int flags; /* context flags */
1348 VARARG(context,context); /* thread context */
1352 /* Set the current context of a thread */
1353 @REQ(set_thread_context)
1354 handle_t handle; /* thread handle */
1355 unsigned int flags; /* context flags */
1356 VARARG(context,context); /* thread context */
1360 /* Fetch a selector entry for a thread */
1361 @REQ(get_selector_entry)
1362 handle_t handle; /* thread handle */
1363 int entry; /* LDT entry */
1365 unsigned int base; /* selector base */
1366 unsigned int limit; /* selector limit */
1367 unsigned char flags; /* selector flags */
1373 int local; /* is atom in local process table? */
1374 VARARG(name,unicode_str); /* atom name */
1376 atom_t atom; /* resulting atom */
1380 /* Delete an atom */
1382 atom_t atom; /* atom handle */
1383 int local; /* is atom in local process table? */
1389 int local; /* is atom in local process table? */
1390 VARARG(name,unicode_str); /* atom name */
1392 atom_t atom; /* atom handle */
1396 /* Get an atom name */
1398 atom_t atom; /* atom handle */
1399 int local; /* is atom in local process table? */
1401 int count; /* atom lock count */
1402 VARARG(name,unicode_str); /* atom name */
1406 /* Init the process atom table */
1407 @REQ(init_atom_table)
1408 int entries; /* number of entries */
1412 /* Get the message queue of the current thread */
1415 handle_t handle; /* handle to the queue */
1419 /* Set the current message queue wakeup mask */
1420 @REQ(set_queue_mask)
1421 unsigned int wake_mask; /* wakeup bits mask */
1422 unsigned int changed_mask; /* changed bits mask */
1423 int skip_wait; /* will we skip waiting if signaled? */
1425 unsigned int wake_bits; /* current wake bits */
1426 unsigned int changed_bits; /* current changed bits */
1430 /* Get the current message queue status */
1431 @REQ(get_queue_status)
1432 int clear; /* should we clear the change bits? */
1434 unsigned int wake_bits; /* wake bits */
1435 unsigned int changed_bits; /* changed bits since last time */
1439 /* Wait for a process to start waiting on input */
1440 @REQ(wait_input_idle)
1441 handle_t handle; /* process handle */
1442 int timeout; /* timeout */
1444 handle_t event; /* handle to idle event */
1448 /* Send a message to a thread queue */
1450 void* id; /* thread id */
1451 int type; /* message type (see below) */
1452 user_handle_t win; /* window handle */
1453 unsigned int msg; /* message code */
1454 unsigned int wparam; /* parameters */
1455 unsigned int lparam; /* parameters */
1456 int x; /* x position */
1457 int y; /* y position */
1458 unsigned int time; /* message time */
1459 unsigned int info; /* extra info */
1460 int timeout; /* timeout for reply */
1461 VARARG(data,bytes); /* message data for sent messages */
1466 MSG_ASCII, /* Ascii message (from SendMessageA) */
1467 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1468 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1469 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1470 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1471 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1472 MSG_HARDWARE_RAW, /* raw hardware message */
1473 MSG_HARDWARE_COOKED /* cooked hardware message */
1477 /* Get a message from the current queue */
1479 int flags; /* see below */
1480 user_handle_t get_win; /* window handle to get */
1481 unsigned int get_first; /* first message code to get */
1482 unsigned int get_last; /* last message code to get */
1484 int type; /* message type */
1485 user_handle_t win; /* window handle */
1486 unsigned int msg; /* message code */
1487 unsigned int wparam; /* parameters */
1488 unsigned int lparam; /* parameters */
1489 int x; /* x position */
1490 int y; /* y position */
1491 unsigned int time; /* message time */
1492 unsigned int info; /* extra info */
1493 size_t total; /* total size of extra data */
1494 VARARG(data,bytes); /* message data for sent messages */
1496 #define GET_MSG_REMOVE 1 /* remove the message */
1497 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1498 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1500 /* Reply to a sent message */
1502 unsigned int result; /* message result */
1503 int remove; /* should we remove the message? */
1504 VARARG(data,bytes); /* message data for sent messages */
1508 /* Retrieve the reply for the last message sent */
1509 @REQ(get_message_reply)
1510 int cancel; /* cancel message if not ready? */
1512 unsigned int result; /* message result */
1513 VARARG(data,bytes); /* message data for sent messages */
1517 /* Set a window timer */
1519 user_handle_t win; /* window handle */
1520 unsigned int msg; /* message to post */
1521 unsigned int id; /* timer id */
1522 unsigned int rate; /* timer rate in ms */
1523 unsigned int lparam; /* message lparam (callback proc) */
1527 /* Kill a window timer */
1528 @REQ(kill_win_timer)
1529 user_handle_t win; /* window handle */
1530 unsigned int msg; /* message to post */
1531 unsigned int id; /* timer id */
1535 /* Open a serial port */
1537 unsigned int access; /* wanted access rights */
1538 int inherit; /* inherit flag */
1539 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1540 unsigned int sharing; /* sharing flags */
1541 VARARG(name,string); /* file name */
1543 handle_t handle; /* handle to the port */
1547 /* Retrieve info about a serial port */
1548 @REQ(get_serial_info)
1549 handle_t handle; /* handle to comm port */
1551 unsigned int readinterval;
1552 unsigned int readconst;
1553 unsigned int readmult;
1554 unsigned int writeconst;
1555 unsigned int writemult;
1556 unsigned int eventmask;
1557 unsigned int commerror;
1561 /* Set info about a serial port */
1562 @REQ(set_serial_info)
1563 handle_t handle; /* handle to comm port */
1564 int flags; /* bitmask to set values (see below) */
1565 unsigned int readinterval;
1566 unsigned int readconst;
1567 unsigned int readmult;
1568 unsigned int writeconst;
1569 unsigned int writemult;
1570 unsigned int eventmask;
1571 unsigned int commerror;
1573 #define SERIALINFO_SET_TIMEOUTS 0x01
1574 #define SERIALINFO_SET_MASK 0x02
1575 #define SERIALINFO_SET_ERROR 0x04
1578 /* Create/Destroy an async I/O */
1579 @REQ(register_async)
1580 handle_t handle; /* handle to comm port, socket or file */
1585 unsigned int status;
1587 #define ASYNC_TYPE_NONE 0x00
1588 #define ASYNC_TYPE_READ 0x01
1589 #define ASYNC_TYPE_WRITE 0x02
1590 #define ASYNC_TYPE_WAIT 0x03
1593 /* Create a named pipe */
1594 @REQ(create_named_pipe)
1595 unsigned int openmode;
1596 unsigned int pipemode;
1597 unsigned int maxinstances;
1598 unsigned int outsize;
1599 unsigned int insize;
1600 unsigned int timeout;
1601 VARARG(name,unicode_str); /* pipe name */
1603 handle_t handle; /* handle to the pipe */
1607 /* Open an existing named pipe */
1608 @REQ(open_named_pipe)
1609 unsigned int access;
1610 VARARG(name,unicode_str); /* pipe name */
1612 handle_t handle; /* handle to the pipe */
1616 /* Connect to a named pipe */
1617 @REQ(connect_named_pipe)
1624 /* Wait for a named pipe */
1625 @REQ(wait_named_pipe)
1626 unsigned int timeout;
1629 VARARG(name,unicode_str); /* pipe name */
1633 /* Disconnect a named pipe */
1634 @REQ(disconnect_named_pipe)
1639 @REQ(get_named_pipe_info)
1643 unsigned int maxinstances;
1644 unsigned int outsize;
1645 unsigned int insize;
1651 unsigned int tree_id;
1652 unsigned int user_id;
1653 unsigned int file_id;
1654 unsigned int dialect;
1663 unsigned int offset;
1665 unsigned int tree_id;
1666 unsigned int user_id;
1667 unsigned int dialect;
1668 unsigned int file_id;
1669 unsigned int offset;
1671 #define SMBINFO_SET_OFFSET 0x01
1674 /* Create a window */
1676 user_handle_t parent; /* parent window */
1677 user_handle_t owner; /* owner window */
1678 atom_t atom; /* class atom */
1680 user_handle_t handle; /* created window */
1684 /* Link a window into the tree */
1686 user_handle_t handle; /* handle to the window */
1687 user_handle_t parent; /* handle to the parent */
1688 user_handle_t previous; /* previous child in Z-order */
1690 user_handle_t full_parent; /* full handle of new parent */
1694 /* Destroy a window */
1695 @REQ(destroy_window)
1696 user_handle_t handle; /* handle to the window */
1700 /* Set a window owner */
1701 @REQ(set_window_owner)
1702 user_handle_t handle; /* handle to the window */
1703 user_handle_t owner; /* new owner */
1705 user_handle_t full_owner; /* full handle of new owner */
1709 /* Get information from a window handle */
1710 @REQ(get_window_info)
1711 user_handle_t handle; /* handle to the window */
1713 user_handle_t full_handle; /* full 32-bit handle */
1714 void* pid; /* process owning the window */
1715 void* tid; /* thread owning the window */
1716 atom_t atom; /* class atom */
1720 /* Set some information in a window */
1721 @REQ(set_window_info)
1722 user_handle_t handle; /* handle to the window */
1723 unsigned int flags; /* flags for fields to set (see below) */
1724 unsigned int style; /* window style */
1725 unsigned int ex_style; /* window extended style */
1726 unsigned int id; /* window id */
1727 void* instance; /* creator instance */
1728 void* user_data; /* user-specific data */
1730 unsigned int old_style; /* old window style */
1731 unsigned int old_ex_style; /* old window extended style */
1732 unsigned int old_id; /* old window id */
1733 void* old_instance; /* old creator instance */
1734 void* old_user_data; /* old user-specific data */
1736 #define SET_WIN_STYLE 0x01
1737 #define SET_WIN_EXSTYLE 0x02
1738 #define SET_WIN_ID 0x04
1739 #define SET_WIN_INSTANCE 0x08
1740 #define SET_WIN_USERDATA 0x10
1743 /* Get a list of the window parents, up to the root of the tree */
1744 @REQ(get_window_parents)
1745 user_handle_t handle; /* handle to the window */
1747 int count; /* total count of parents */
1748 VARARG(parents,user_handles); /* parent handles */
1752 /* Get a list of the window children */
1753 @REQ(get_window_children)
1754 user_handle_t parent; /* parent window */
1755 atom_t atom; /* class atom for the listed children */
1756 void* tid; /* thread owning the listed children */
1758 int count; /* total count of children */
1759 VARARG(children,user_handles); /* children handles */
1763 /* Get window tree information from a window handle */
1764 @REQ(get_window_tree)
1765 user_handle_t handle; /* handle to the window */
1767 user_handle_t parent; /* parent window */
1768 user_handle_t owner; /* owner window */
1769 user_handle_t next_sibling; /* next sibling in Z-order */
1770 user_handle_t prev_sibling; /* prev sibling in Z-order */
1771 user_handle_t first_sibling; /* first sibling in Z-order */
1772 user_handle_t last_sibling; /* last sibling in Z-order */
1773 user_handle_t first_child; /* first child */
1774 user_handle_t last_child; /* last child */
1777 /* Set the window and client rectangles of a window */
1778 @REQ(set_window_rectangles)
1779 user_handle_t handle; /* handle to the window */
1780 rectangle_t window; /* window rectangle */
1781 rectangle_t client; /* client rectangle */
1785 /* Get the window and client rectangles of a window */
1786 @REQ(get_window_rectangles)
1787 user_handle_t handle; /* handle to the window */
1789 rectangle_t window; /* window rectangle */
1790 rectangle_t client; /* client rectangle */
1794 /* Get the window text */
1795 @REQ(get_window_text)
1796 user_handle_t handle; /* handle to the window */
1798 VARARG(text,unicode_str); /* window text */
1802 /* Set the window text */
1803 @REQ(set_window_text)
1804 user_handle_t handle; /* handle to the window */
1805 VARARG(text,unicode_str); /* window text */
1809 /* Increment the window paint count */
1810 @REQ(inc_window_paint_count)
1811 user_handle_t handle; /* handle to the window */
1812 int incr; /* increment (can be negative) */
1816 /* Get the coordinates offset between two windows */
1817 @REQ(get_windows_offset)
1818 user_handle_t from; /* handle to the first window */
1819 user_handle_t to; /* handle to the second window */
1821 int x; /* x coordinate offset */
1822 int y; /* y coordinate offset */
1826 /* Set a window property */
1827 @REQ(set_window_property)
1828 user_handle_t window; /* handle to the window */
1829 atom_t atom; /* property atom (high-word set if it was a string) */
1830 int string; /* was atom a string originally? */
1831 handle_t handle; /* handle to store */
1835 /* Remove a window property */
1836 @REQ(remove_window_property)
1837 user_handle_t window; /* handle to the window */
1838 atom_t atom; /* property atom */
1840 handle_t handle; /* handle stored in property */
1844 /* Get a window property */
1845 @REQ(get_window_property)
1846 user_handle_t window; /* handle to the window */
1847 atom_t atom; /* property atom */
1849 handle_t handle; /* handle stored in property */
1853 /* Get the list of properties of a window */
1854 @REQ(get_window_properties)
1855 user_handle_t window; /* handle to the window */
1857 int total; /* total number of properties */
1858 VARARG(props,properties); /* list of properties */