2 * Wine server definitions
4 * Copyright (C) 1998 Alexandre Julliard
7 #ifndef __WINE_SERVER_H
8 #define __WINE_SERVER_H
14 /* Request structures */
16 /* Following are the definitions of all the client<->server */
17 /* communication format; if you make any change in this file, */
18 /* you must run tools/make_requests again. */
21 /* These empty macros are used by tools/make_requests */
22 /* to generate the request/reply tracing functions */
23 #define IN /*nothing*/
24 #define OUT /*nothing*/
25 #define VARARG(name,func) /*nothing*/
29 IN int req; /* request code */
30 IN unsigned short var_offset; /* offset of the variable part of the request */
31 IN unsigned short var_size; /* size of the variable part of the request */
32 OUT unsigned int error; /* error result */
34 #define REQUEST_HEADER struct request_header header
37 /* placeholder structure for the maximum allowed request size */
38 /* this is used to construct the generic_request union */
39 struct request_max_size
41 int pad[16]; /* the max request size is 16 ints */
44 /* max size of the variable part of a request */
45 #define REQUEST_MAX_VAR_SIZE 1024
49 /* definitions of the event data depending on the event code */
50 struct debug_event_exception
52 EXCEPTION_RECORD record; /* exception record */
53 int first; /* first chance exception? */
55 struct debug_event_create_thread
57 handle_t handle; /* handle to the new thread */
58 void *teb; /* thread teb (in debugged process address space) */
59 void *start; /* thread startup routine */
61 struct debug_event_create_process
63 handle_t file; /* handle to the process exe file */
64 handle_t process; /* handle to the new process */
65 handle_t thread; /* handle to the new thread */
66 void *base; /* base of executable image */
67 int dbg_offset; /* offset of debug info in file */
68 int dbg_size; /* size of debug info */
69 void *teb; /* thread teb (in debugged process address space) */
70 void *start; /* thread startup routine */
71 void *name; /* image name (optional) */
72 int unicode; /* is it Unicode? */
74 struct debug_event_exit
76 int exit_code; /* thread or process exit code */
78 struct debug_event_load_dll
80 handle_t handle; /* file handle for the dll */
81 void *base; /* base address of the dll */
82 int dbg_offset; /* offset of debug info in file */
83 int dbg_size; /* size of debug info */
84 void *name; /* image name (optional) */
85 int unicode; /* is it Unicode? */
87 struct debug_event_unload_dll
89 void *base; /* base address of the dll */
91 struct debug_event_output_string
93 void *string; /* string to display (in debugged process address space) */
94 int unicode; /* is it Unicode? */
95 int length; /* string length */
97 struct debug_event_rip_info
102 union debug_event_data
104 struct debug_event_exception exception;
105 struct debug_event_create_thread create_thread;
106 struct debug_event_create_process create_process;
107 struct debug_event_exit exit;
108 struct debug_event_load_dll load_dll;
109 struct debug_event_unload_dll unload_dll;
110 struct debug_event_output_string output_string;
111 struct debug_event_rip_info rip_info;
114 /* debug event data */
117 int code; /* event code */
118 union debug_event_data info; /* event information */
121 /* structure used in sending an fd from client to server */
124 void *tid; /* thread id */
125 int fd; /* file descriptor on client-side */
128 /* structure sent by the server on the wait fifo */
131 void *cookie; /* magic cookie that was passed in select_request */
132 int signaled; /* wait result */
135 /* Create a new process from the context of the parent */
136 struct new_process_request
138 REQUEST_HEADER; /* request header */
139 IN int inherit_all; /* inherit all handles from parent */
140 IN int create_flags; /* creation flags */
141 IN int start_flags; /* flags from startup info */
142 IN handle_t exe_file; /* file handle for main exe */
143 IN handle_t hstdin; /* handle for stdin */
144 IN handle_t hstdout; /* handle for stdout */
145 IN handle_t hstderr; /* handle for stderr */
146 IN int cmd_show; /* main window show mode */
147 OUT handle_t info; /* new process info handle */
148 IN VARARG(filename,string); /* file name of main exe */
152 /* Retrieve information about a newly started process */
153 struct get_new_process_info_request
155 REQUEST_HEADER; /* request header */
156 IN handle_t info; /* info handle returned from new_process_request */
157 IN int pinherit; /* process handle inherit flag */
158 IN int tinherit; /* thread handle inherit flag */
159 OUT void* pid; /* process id */
160 OUT handle_t phandle; /* process handle (in the current process) */
161 OUT void* tid; /* thread id */
162 OUT handle_t thandle; /* thread handle (in the current process) */
163 OUT handle_t event; /* event handle to signal startup */
167 /* Create a new thread from the context of the parent */
168 struct new_thread_request
170 REQUEST_HEADER; /* request header */
171 IN int suspend; /* new thread should be suspended on creation */
172 IN int inherit; /* inherit flag */
173 IN int request_fd; /* fd for request pipe */
174 OUT void* tid; /* thread id */
175 OUT handle_t handle; /* thread handle (in the current process) */
179 /* Signal that we are finished booting on the client side */
180 struct boot_done_request
182 REQUEST_HEADER; /* request header */
183 IN int debug_level; /* new debug level */
187 /* Initialize a process; called from the new process context */
188 struct init_process_request
190 REQUEST_HEADER; /* request header */
191 IN void* ldt_copy; /* addr of LDT copy */
192 IN int ppid; /* parent Unix pid */
193 OUT int create_flags; /* creation flags */
194 OUT int start_flags; /* flags from startup info */
195 OUT unsigned int server_start; /* server start time (GetTickCount) */
196 OUT handle_t exe_file; /* file handle for main exe */
197 OUT handle_t hstdin; /* handle for stdin */
198 OUT handle_t hstdout; /* handle for stdout */
199 OUT handle_t hstderr; /* handle for stderr */
200 OUT int cmd_show; /* main window show mode */
201 OUT VARARG(filename,string); /* file name of main exe */
205 /* Signal the end of the process initialization */
206 struct init_process_done_request
208 REQUEST_HEADER; /* request header */
209 IN void* module; /* main module base address */
210 IN void* entry; /* process entry point */
211 IN void* name; /* ptr to ptr to name (in process addr space) */
212 IN handle_t exe_file; /* file handle for main exe */
213 IN int gui; /* is it a GUI process? */
214 OUT int debugged; /* being debugged? */
218 /* Initialize a thread; called from the child after fork()/clone() */
219 struct init_thread_request
221 REQUEST_HEADER; /* request header */
222 IN int unix_pid; /* Unix pid of new thread */
223 IN void* teb; /* TEB of new thread (in thread address space) */
224 IN void* entry; /* thread entry point (in thread address space) */
225 IN int reply_fd; /* fd for reply pipe */
226 IN int wait_fd; /* fd for blocking calls pipe */
227 OUT void* pid; /* process id of the new thread's process */
228 OUT void* tid; /* thread id of the new thread */
229 OUT int boot; /* is this the boot thread? */
230 OUT int version; /* protocol version */
234 /* Set the shared buffer for a thread */
235 struct set_thread_buffer_request
238 IN int fd; /* fd to mmap as shared buffer */
239 OUT unsigned int offset; /* offset of buffer in file */
240 OUT unsigned int size; /* size of buffer */
244 /* Terminate a process */
245 struct terminate_process_request
247 REQUEST_HEADER; /* request header */
248 IN handle_t handle; /* process handle to terminate */
249 IN int exit_code; /* process exit code */
250 OUT int self; /* suicide? */
254 /* Terminate a thread */
255 struct terminate_thread_request
257 REQUEST_HEADER; /* request header */
258 IN handle_t handle; /* thread handle to terminate */
259 IN int exit_code; /* thread exit code */
260 OUT int self; /* suicide? */
261 OUT int last; /* last thread in this process? */
265 /* Retrieve information about a process */
266 struct get_process_info_request
268 REQUEST_HEADER; /* request header */
269 IN handle_t handle; /* process handle */
270 OUT void* pid; /* server process id */
271 OUT int debugged; /* debugged? */
272 OUT int exit_code; /* process exit code */
273 OUT int priority; /* priority class */
274 OUT int process_affinity; /* process affinity mask */
275 OUT int system_affinity; /* system affinity mask */
279 /* Set a process informations */
280 struct set_process_info_request
282 REQUEST_HEADER; /* request header */
283 IN handle_t handle; /* process handle */
284 IN int mask; /* setting mask (see below) */
285 IN int priority; /* priority class */
286 IN int affinity; /* affinity mask */
288 #define SET_PROCESS_INFO_PRIORITY 0x01
289 #define SET_PROCESS_INFO_AFFINITY 0x02
292 /* Retrieve information about a thread */
293 struct get_thread_info_request
295 REQUEST_HEADER; /* request header */
296 IN handle_t handle; /* thread handle */
297 IN void* tid_in; /* thread id (optional) */
298 OUT void* tid; /* server thread id */
299 OUT void* teb; /* thread teb pointer */
300 OUT int exit_code; /* thread exit code */
301 OUT int priority; /* thread priority level */
305 /* Set a thread informations */
306 struct set_thread_info_request
308 REQUEST_HEADER; /* request header */
309 IN handle_t handle; /* thread handle */
310 IN int mask; /* setting mask (see below) */
311 IN int priority; /* priority class */
312 IN int affinity; /* affinity mask */
314 #define SET_THREAD_INFO_PRIORITY 0x01
315 #define SET_THREAD_INFO_AFFINITY 0x02
318 /* Suspend a thread */
319 struct suspend_thread_request
321 REQUEST_HEADER; /* request header */
322 IN handle_t handle; /* thread handle */
323 OUT int count; /* new suspend count */
327 /* Resume a thread */
328 struct resume_thread_request
330 REQUEST_HEADER; /* request header */
331 IN handle_t handle; /* thread handle */
332 OUT int count; /* new suspend count */
336 /* Notify the server that a dll has been loaded */
337 struct load_dll_request
339 REQUEST_HEADER; /* request header */
340 IN handle_t handle; /* file handle */
341 IN void* base; /* base address */
342 IN int dbg_offset; /* debug info offset */
343 IN int dbg_size; /* debug info size */
344 IN void* name; /* ptr to ptr to name (in process addr space) */
348 /* Notify the server that a dll is being unloaded */
349 struct unload_dll_request
351 REQUEST_HEADER; /* request header */
352 IN void* base; /* base address */
356 /* Queue an APC for a thread */
357 struct queue_apc_request
359 REQUEST_HEADER; /* request header */
360 IN handle_t handle; /* thread handle */
361 IN int user; /* user or system apc? */
362 IN void* func; /* function to call */
363 IN void* param; /* param for function to call */
367 /* Get next APC to call */
368 struct get_apc_request
370 REQUEST_HEADER; /* request header */
371 IN int alertable; /* is thread alertable? */
372 OUT void* func; /* function to call */
373 OUT int type; /* function type */
374 OUT VARARG(args,ptrs); /* function arguments */
376 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
379 /* Close a handle for the current process */
380 struct close_handle_request
382 REQUEST_HEADER; /* request header */
383 IN handle_t handle; /* handle to close */
384 OUT int fd; /* associated fd to close */
388 /* Set a handle information */
389 struct set_handle_info_request
391 REQUEST_HEADER; /* request header */
392 IN handle_t handle; /* handle we are interested in */
393 IN int flags; /* new handle flags */
394 IN int mask; /* mask for flags to set */
395 IN int fd; /* file descriptor or -1 */
396 OUT int old_flags; /* old flag value */
397 OUT int cur_fd; /* current file descriptor */
401 /* Duplicate a handle */
402 struct dup_handle_request
404 REQUEST_HEADER; /* request header */
405 IN handle_t src_process; /* src process handle */
406 IN handle_t src_handle; /* src handle to duplicate */
407 IN handle_t dst_process; /* dst process handle */
408 IN unsigned int access; /* wanted access rights */
409 IN int inherit; /* inherit flag */
410 IN int options; /* duplicate options (see below) */
411 OUT handle_t handle; /* duplicated handle in dst process */
412 OUT int fd; /* associated fd to close */
414 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
415 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
416 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
419 /* Open a handle to a process */
420 struct open_process_request
422 REQUEST_HEADER; /* request header */
423 IN void* pid; /* process id to open */
424 IN unsigned int access; /* wanted access rights */
425 IN int inherit; /* inherit flag */
426 OUT handle_t handle; /* handle to the process */
430 /* Wait for handles */
431 struct select_request
433 REQUEST_HEADER; /* request header */
434 IN int flags; /* wait flags (see below) */
435 IN void* cookie; /* magic cookie to return to client */
436 IN int sec; /* absolute timeout */
437 IN int usec; /* absolute timeout */
438 IN VARARG(handles,handles); /* handles to select on */
441 #define SELECT_ALERTABLE 2
442 #define SELECT_INTERRUPTIBLE 4
443 #define SELECT_TIMEOUT 8
446 /* Create an event */
447 struct create_event_request
449 REQUEST_HEADER; /* request header */
450 IN int manual_reset; /* manual reset event */
451 IN int initial_state; /* initial state of the event */
452 IN int inherit; /* inherit flag */
453 OUT handle_t handle; /* handle to the event */
454 IN VARARG(name,unicode_str); /* object name */
457 /* Event operation */
458 struct event_op_request
460 REQUEST_HEADER; /* request header */
461 IN handle_t handle; /* handle to event */
462 IN int op; /* event operation (see below) */
464 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
468 struct open_event_request
470 REQUEST_HEADER; /* request header */
471 IN unsigned int access; /* wanted access rights */
472 IN int inherit; /* inherit flag */
473 OUT handle_t handle; /* handle to the event */
474 IN VARARG(name,unicode_str); /* object name */
479 struct create_mutex_request
481 REQUEST_HEADER; /* request header */
482 IN int owned; /* initially owned? */
483 IN int inherit; /* inherit flag */
484 OUT handle_t handle; /* handle to the mutex */
485 IN VARARG(name,unicode_str); /* object name */
489 /* Release a mutex */
490 struct release_mutex_request
492 REQUEST_HEADER; /* request header */
493 IN handle_t handle; /* handle to the mutex */
498 struct open_mutex_request
500 REQUEST_HEADER; /* request header */
501 IN unsigned int access; /* wanted access rights */
502 IN int inherit; /* inherit flag */
503 OUT handle_t handle; /* handle to the mutex */
504 IN VARARG(name,unicode_str); /* object name */
508 /* Create a semaphore */
509 struct create_semaphore_request
511 REQUEST_HEADER; /* request header */
512 IN unsigned int initial; /* initial count */
513 IN unsigned int max; /* maximum count */
514 IN int inherit; /* inherit flag */
515 OUT handle_t handle; /* handle to the semaphore */
516 IN VARARG(name,unicode_str); /* object name */
520 /* Release a semaphore */
521 struct release_semaphore_request
523 REQUEST_HEADER; /* request header */
524 IN handle_t handle; /* handle to the semaphore */
525 IN unsigned int count; /* count to add to semaphore */
526 OUT unsigned int prev_count; /* previous semaphore count */
530 /* Open a semaphore */
531 struct open_semaphore_request
533 REQUEST_HEADER; /* request header */
534 IN unsigned int access; /* wanted access rights */
535 IN int inherit; /* inherit flag */
536 OUT handle_t handle; /* handle to the semaphore */
537 IN VARARG(name,unicode_str); /* object name */
542 struct create_file_request
544 REQUEST_HEADER; /* request header */
545 IN unsigned int access; /* wanted access rights */
546 IN int inherit; /* inherit flag */
547 IN unsigned int sharing; /* sharing flags */
548 IN int create; /* file create action */
549 IN unsigned int attrs; /* file attributes for creation */
550 OUT handle_t handle; /* handle to the file */
551 IN VARARG(filename,string); /* file name */
555 /* Allocate a file handle for a Unix fd */
556 struct alloc_file_handle_request
558 REQUEST_HEADER; /* request header */
559 IN unsigned int access; /* wanted access rights */
560 IN int fd; /* file descriptor on the client side */
561 OUT handle_t handle; /* handle to the file */
565 /* Get a Unix fd to access a file */
566 struct get_handle_fd_request
568 REQUEST_HEADER; /* request header */
569 IN handle_t handle; /* handle to the file */
570 IN unsigned int access; /* wanted access rights */
571 OUT int fd; /* file descriptor */
575 /* Set a file current position */
576 struct set_file_pointer_request
578 REQUEST_HEADER; /* request header */
579 IN handle_t handle; /* handle to the file */
580 IN int low; /* position low word */
581 IN int high; /* position high word */
582 IN int whence; /* whence to seek */
583 OUT int new_low; /* new position low word */
584 OUT int new_high; /* new position high word */
588 /* Truncate (or extend) a file */
589 struct truncate_file_request
591 REQUEST_HEADER; /* request header */
592 IN handle_t handle; /* handle to the file */
596 /* Set a file access and modification times */
597 struct set_file_time_request
599 REQUEST_HEADER; /* request header */
600 IN handle_t handle; /* handle to the file */
601 IN time_t access_time; /* last access time */
602 IN time_t write_time; /* last write time */
606 /* Flush a file buffers */
607 struct flush_file_request
609 REQUEST_HEADER; /* request header */
610 IN handle_t handle; /* handle to the file */
614 /* Get information about a file */
615 struct get_file_info_request
617 REQUEST_HEADER; /* request header */
618 IN handle_t handle; /* handle to the file */
619 OUT int type; /* file type */
620 OUT int attr; /* file attributes */
621 OUT time_t access_time; /* last access time */
622 OUT time_t write_time; /* last write time */
623 OUT int size_high; /* file size */
624 OUT int size_low; /* file size */
625 OUT int links; /* number of links */
626 OUT int index_high; /* unique index */
627 OUT int index_low; /* unique index */
628 OUT unsigned int serial; /* volume serial number */
632 /* Lock a region of a file */
633 struct lock_file_request
635 REQUEST_HEADER; /* request header */
636 IN handle_t handle; /* handle to the file */
637 IN unsigned int offset_low; /* offset of start of lock */
638 IN unsigned int offset_high; /* offset of start of lock */
639 IN unsigned int count_low; /* count of bytes to lock */
640 IN unsigned int count_high; /* count of bytes to lock */
644 /* Unlock a region of a file */
645 struct unlock_file_request
647 REQUEST_HEADER; /* request header */
648 IN handle_t handle; /* handle to the file */
649 IN unsigned int offset_low; /* offset of start of unlock */
650 IN unsigned int offset_high; /* offset of start of unlock */
651 IN unsigned int count_low; /* count of bytes to unlock */
652 IN unsigned int count_high; /* count of bytes to unlock */
656 /* Create an anonymous pipe */
657 struct create_pipe_request
659 REQUEST_HEADER; /* request header */
660 IN int inherit; /* inherit flag */
661 OUT handle_t handle_read; /* handle to the read-side of the pipe */
662 OUT handle_t handle_write; /* handle to the write-side of the pipe */
666 /* Create a socket */
667 struct create_socket_request
669 REQUEST_HEADER; /* request header */
670 IN unsigned int access; /* wanted access rights */
671 IN int inherit; /* inherit flag */
672 IN int family; /* family, see socket manpage */
673 IN int type; /* type, see socket manpage */
674 IN int protocol; /* protocol, see socket manpage */
675 OUT handle_t handle; /* handle to the new socket */
679 /* Accept a socket */
680 struct accept_socket_request
682 REQUEST_HEADER; /* request header */
683 IN handle_t lhandle; /* handle to the listening socket */
684 IN unsigned int access; /* wanted access rights */
685 IN int inherit; /* inherit flag */
686 OUT handle_t handle; /* handle to the new socket */
690 /* Set socket event parameters */
691 struct set_socket_event_request
693 REQUEST_HEADER; /* request header */
694 IN handle_t handle; /* handle to the socket */
695 IN unsigned int mask; /* event mask */
696 IN handle_t event; /* event object */
700 /* Get socket event parameters */
701 struct get_socket_event_request
703 REQUEST_HEADER; /* request header */
704 IN handle_t handle; /* handle to the socket */
705 IN int service; /* clear pending? */
706 IN handle_t s_event; /* "expected" event object */
707 IN handle_t c_event; /* event to clear */
708 OUT unsigned int mask; /* event mask */
709 OUT unsigned int pmask; /* pending events */
710 OUT unsigned int state; /* status bits */
711 OUT VARARG(errors,ints); /* event errors */
715 /* Reenable pending socket events */
716 struct enable_socket_event_request
718 REQUEST_HEADER; /* request header */
719 IN handle_t handle; /* handle to the socket */
720 IN unsigned int mask; /* events to re-enable */
721 IN unsigned int sstate; /* status bits to set */
722 IN unsigned int cstate; /* status bits to clear */
726 /* Allocate a console for the current process */
727 struct alloc_console_request
729 REQUEST_HEADER; /* request header */
730 IN unsigned int access; /* wanted access rights */
731 IN int inherit; /* inherit flag */
732 OUT handle_t handle_in; /* handle to console input */
733 OUT handle_t handle_out; /* handle to console output */
737 /* Free the console of the current process */
738 struct free_console_request
740 REQUEST_HEADER; /* request header */
744 /* Open a handle to the process console */
745 struct open_console_request
747 REQUEST_HEADER; /* request header */
748 IN int output; /* input or output? */
749 IN unsigned int access; /* wanted access rights */
750 IN int inherit; /* inherit flag */
751 OUT handle_t handle; /* handle to the console */
755 /* Set a console file descriptor */
756 struct set_console_fd_request
758 REQUEST_HEADER; /* request header */
759 IN handle_t handle; /* handle to the console */
760 IN int fd_in; /* file descriptor to use as input */
761 IN int fd_out; /* file descriptor to use as output */
762 IN int pid; /* pid of xterm (hack) */
766 /* Get a console mode (input or output) */
767 struct get_console_mode_request
769 REQUEST_HEADER; /* request header */
770 IN handle_t handle; /* handle to the console */
771 OUT int mode; /* console mode */
775 /* Set a console mode (input or output) */
776 struct set_console_mode_request
778 REQUEST_HEADER; /* request header */
779 IN handle_t handle; /* handle to the console */
780 IN int mode; /* console mode */
784 /* Set info about a console (output only) */
785 struct set_console_info_request
787 REQUEST_HEADER; /* request header */
788 IN handle_t handle; /* handle to the console */
789 IN int mask; /* setting mask (see below) */
790 IN int cursor_size; /* size of cursor (percentage filled) */
791 IN int cursor_visible;/* cursor visibility flag */
792 IN VARARG(title,string); /* console title */
794 #define SET_CONSOLE_INFO_CURSOR 0x01
795 #define SET_CONSOLE_INFO_TITLE 0x02
797 /* Get info about a console (output only) */
798 struct get_console_info_request
800 REQUEST_HEADER; /* request header */
801 IN handle_t handle; /* handle to the console */
802 OUT int cursor_size; /* size of cursor (percentage filled) */
803 OUT int cursor_visible;/* cursor visibility flag */
804 OUT int pid; /* pid of xterm (hack) */
805 OUT VARARG(title,string); /* console title */
809 /* Add input records to a console input queue */
810 struct write_console_input_request
812 REQUEST_HEADER; /* request header */
813 IN handle_t handle; /* handle to the console input */
814 OUT int written; /* number of records written */
815 IN VARARG(rec,input_records); /* input records */
818 /* Fetch input records from a console input queue */
819 struct read_console_input_request
821 REQUEST_HEADER; /* request header */
822 IN handle_t handle; /* handle to the console input */
823 IN int flush; /* flush the retrieved records from the queue? */
824 OUT int read; /* number of records read */
825 OUT VARARG(rec,input_records); /* input records */
829 /* Create a change notification */
830 struct create_change_notification_request
832 REQUEST_HEADER; /* request header */
833 IN int subtree; /* watch all the subtree */
834 IN int filter; /* notification filter */
835 OUT handle_t handle; /* handle to the change notification */
839 /* Create a file mapping */
840 struct create_mapping_request
842 REQUEST_HEADER; /* request header */
843 IN int size_high; /* mapping size */
844 IN int size_low; /* mapping size */
845 IN int protect; /* protection flags (see below) */
846 IN int inherit; /* inherit flag */
847 IN handle_t file_handle; /* file handle */
848 OUT handle_t handle; /* handle to the mapping */
849 IN VARARG(name,unicode_str); /* object name */
851 /* protection flags */
852 #define VPROT_READ 0x01
853 #define VPROT_WRITE 0x02
854 #define VPROT_EXEC 0x04
855 #define VPROT_WRITECOPY 0x08
856 #define VPROT_GUARD 0x10
857 #define VPROT_NOCACHE 0x20
858 #define VPROT_COMMITTED 0x40
859 #define VPROT_IMAGE 0x80
863 struct open_mapping_request
865 REQUEST_HEADER; /* request header */
866 IN unsigned int access; /* wanted access rights */
867 IN int inherit; /* inherit flag */
868 OUT handle_t handle; /* handle to the mapping */
869 IN VARARG(name,unicode_str); /* object name */
873 /* Get information about a file mapping */
874 struct get_mapping_info_request
876 REQUEST_HEADER; /* request header */
877 IN handle_t handle; /* handle to the mapping */
878 OUT int size_high; /* mapping size */
879 OUT int size_low; /* mapping size */
880 OUT int protect; /* protection flags */
881 OUT int header_size; /* header size (for VPROT_IMAGE mapping) */
882 OUT void* base; /* default base addr (for VPROT_IMAGE mapping) */
883 OUT handle_t shared_file; /* shared mapping file handle */
884 OUT int shared_size; /* shared mapping size */
888 /* Create a device */
889 struct create_device_request
891 REQUEST_HEADER; /* request header */
892 IN unsigned int access; /* wanted access rights */
893 IN int inherit; /* inherit flag */
894 IN int id; /* client private id */
895 OUT handle_t handle; /* handle to the device */
899 /* Create a snapshot */
900 struct create_snapshot_request
902 REQUEST_HEADER; /* request header */
903 IN int inherit; /* inherit flag */
904 IN int flags; /* snapshot flags (TH32CS_*) */
905 IN void* pid; /* process id */
906 OUT handle_t handle; /* handle to the snapshot */
910 /* Get the next process from a snapshot */
911 struct next_process_request
913 REQUEST_HEADER; /* request header */
914 IN handle_t handle; /* handle to the snapshot */
915 IN int reset; /* reset snapshot position? */
916 OUT int count; /* process usage count */
917 OUT void* pid; /* process id */
918 OUT int threads; /* number of threads */
919 OUT int priority; /* process priority */
923 /* Get the next thread from a snapshot */
924 struct next_thread_request
926 REQUEST_HEADER; /* request header */
927 IN handle_t handle; /* handle to the snapshot */
928 IN int reset; /* reset snapshot position? */
929 OUT int count; /* thread usage count */
930 OUT void* pid; /* process id */
931 OUT void* tid; /* thread id */
932 OUT int base_pri; /* base priority */
933 OUT int delta_pri; /* delta priority */
937 /* Get the next module from a snapshot */
938 struct next_module_request
940 REQUEST_HEADER; /* request header */
941 IN handle_t handle; /* handle to the snapshot */
942 IN int reset; /* reset snapshot position? */
943 OUT void* pid; /* process id */
944 OUT void* base; /* module base address */
948 /* Wait for a debug event */
949 struct wait_debug_event_request
951 REQUEST_HEADER; /* request header */
952 IN int get_handle; /* should we alloc a handle for waiting? */
953 OUT void* pid; /* process id */
954 OUT void* tid; /* thread id */
955 OUT handle_t wait; /* wait handle if no event ready */
956 OUT VARARG(event,debug_event); /* debug event data */
960 /* Queue an exception event */
961 struct queue_exception_event_request
963 REQUEST_HEADER; /* request header */
964 IN int first; /* first chance exception? */
965 OUT handle_t handle; /* handle to the queued event */
966 IN VARARG(record,exc_event); /* thread context followed by exception record */
970 /* Retrieve the status of an exception event */
971 struct get_exception_status_request
973 REQUEST_HEADER; /* request header */
974 OUT handle_t handle; /* handle to the queued event */
975 OUT int status; /* event continuation status */
976 OUT VARARG(context,context); /* modified thread context */
980 /* Send an output string to the debugger */
981 struct output_debug_string_request
983 REQUEST_HEADER; /* request header */
984 IN void* string; /* string to display (in debugged process address space) */
985 IN int unicode; /* is it Unicode? */
986 IN int length; /* string length */
990 /* Continue a debug event */
991 struct continue_debug_event_request
993 REQUEST_HEADER; /* request header */
994 IN void* pid; /* process id to continue */
995 IN void* tid; /* thread id to continue */
996 IN int status; /* continuation status */
1000 /* Start debugging an existing process */
1001 struct debug_process_request
1003 REQUEST_HEADER; /* request header */
1004 IN void* pid; /* id of the process to debug */
1008 /* Read data from a process address space */
1009 struct read_process_memory_request
1011 REQUEST_HEADER; /* request header */
1012 IN handle_t handle; /* process handle */
1013 IN void* addr; /* addr to read from (must be int-aligned) */
1014 IN int len; /* number of ints to read */
1015 OUT VARARG(data,bytes); /* result data */
1019 /* Write data to a process address space */
1020 struct write_process_memory_request
1022 REQUEST_HEADER; /* request header */
1023 IN handle_t handle; /* process handle */
1024 IN void* addr; /* addr to write to (must be int-aligned) */
1025 IN int len; /* number of ints to write */
1026 IN unsigned int first_mask; /* mask for first word */
1027 IN unsigned int last_mask; /* mask for last word */
1028 IN VARARG(data,bytes); /* result data */
1032 /* Create a registry key */
1033 struct create_key_request
1035 REQUEST_HEADER; /* request header */
1036 IN handle_t parent; /* handle to the parent key */
1037 IN unsigned int access; /* desired access rights */
1038 IN unsigned int options; /* creation options */
1039 IN time_t modif; /* last modification time */
1040 OUT handle_t hkey; /* handle to the created key */
1041 OUT int created; /* has it been newly created? */
1042 IN VARARG(name,unicode_len_str); /* key name */
1043 IN VARARG(class,unicode_str); /* class name */
1046 /* Open a registry key */
1047 struct open_key_request
1049 REQUEST_HEADER; /* request header */
1050 IN handle_t parent; /* handle to the parent key */
1051 IN unsigned int access; /* desired access rights */
1052 OUT handle_t hkey; /* handle to the open key */
1053 IN VARARG(name,unicode_str); /* key name */
1057 /* Delete a registry key */
1058 struct delete_key_request
1060 REQUEST_HEADER; /* request header */
1061 IN handle_t hkey; /* handle to the key */
1065 /* Enumerate registry subkeys */
1066 struct enum_key_request
1068 REQUEST_HEADER; /* request header */
1069 IN handle_t hkey; /* handle to registry key */
1070 IN int index; /* index of subkey (or -1 for current key) */
1071 IN int full; /* return the full info? */
1072 OUT int subkeys; /* number of subkeys */
1073 OUT int max_subkey; /* longest subkey name */
1074 OUT int max_class; /* longest class name */
1075 OUT int values; /* number of values */
1076 OUT int max_value; /* longest value name */
1077 OUT int max_data; /* longest value data */
1078 OUT time_t modif; /* last modification time */
1079 OUT VARARG(name,unicode_len_str); /* key name */
1080 OUT VARARG(class,unicode_str); /* class name */
1084 /* Set a value of a registry key */
1085 struct set_key_value_request
1087 REQUEST_HEADER; /* request header */
1088 IN handle_t hkey; /* handle to registry key */
1089 IN int type; /* value type */
1090 IN unsigned int total; /* total value len */
1091 IN unsigned int offset; /* offset for setting data */
1092 IN VARARG(name,unicode_len_str); /* value name */
1093 IN VARARG(data,bytes); /* value data */
1097 /* Retrieve the value of a registry key */
1098 struct get_key_value_request
1100 REQUEST_HEADER; /* request header */
1101 IN handle_t hkey; /* handle to registry key */
1102 IN unsigned int offset; /* offset for getting data */
1103 OUT int type; /* value type */
1104 OUT int len; /* value data len */
1105 IN VARARG(name,unicode_len_str); /* value name */
1106 OUT VARARG(data,bytes); /* value data */
1110 /* Enumerate a value of a registry key */
1111 struct enum_key_value_request
1113 REQUEST_HEADER; /* request header */
1114 IN handle_t hkey; /* handle to registry key */
1115 IN int index; /* value index */
1116 IN unsigned int offset; /* offset for getting data */
1117 OUT int type; /* value type */
1118 OUT int len; /* value data len */
1119 OUT VARARG(name,unicode_len_str); /* value name */
1120 OUT VARARG(data,bytes); /* value data */
1124 /* Delete a value of a registry key */
1125 struct delete_key_value_request
1127 REQUEST_HEADER; /* request header */
1128 IN handle_t hkey; /* handle to registry key */
1129 IN VARARG(name,unicode_str); /* value name */
1133 /* Load a registry branch from a file */
1134 struct load_registry_request
1136 REQUEST_HEADER; /* request header */
1137 IN handle_t hkey; /* root key to load to */
1138 IN handle_t file; /* file to load from */
1139 IN VARARG(name,unicode_str); /* subkey name */
1143 /* Save a registry branch to a file */
1144 struct save_registry_request
1146 REQUEST_HEADER; /* request header */
1147 IN handle_t hkey; /* key to save */
1148 IN handle_t file; /* file to save to */
1152 /* Save a registry branch at server exit */
1153 struct save_registry_atexit_request
1155 REQUEST_HEADER; /* request header */
1156 IN handle_t hkey; /* key to save */
1157 IN VARARG(file,string); /* file to save to */
1161 /* Set the current and saving level for the registry */
1162 struct set_registry_levels_request
1164 REQUEST_HEADER; /* request header */
1165 IN int current; /* new current level */
1166 IN int saving; /* new saving level */
1167 IN int period; /* duration between periodic saves (milliseconds) */
1171 /* Create a waitable timer */
1172 struct create_timer_request
1174 REQUEST_HEADER; /* request header */
1175 IN int inherit; /* inherit flag */
1176 IN int manual; /* manual reset */
1177 OUT handle_t handle; /* handle to the timer */
1178 IN VARARG(name,unicode_str); /* object name */
1182 /* Open a waitable timer */
1183 struct open_timer_request
1185 REQUEST_HEADER; /* request header */
1186 IN unsigned int access; /* wanted access rights */
1187 IN int inherit; /* inherit flag */
1188 OUT handle_t handle; /* handle to the timer */
1189 IN VARARG(name,unicode_str); /* object name */
1192 /* Set a waitable timer */
1193 struct set_timer_request
1195 REQUEST_HEADER; /* request header */
1196 IN handle_t handle; /* handle to the timer */
1197 IN int sec; /* next expiration absolute time */
1198 IN int usec; /* next expiration absolute time */
1199 IN int period; /* timer period in ms */
1200 IN void* callback; /* callback function */
1201 IN void* arg; /* callback argument */
1204 /* Cancel a waitable timer */
1205 struct cancel_timer_request
1207 REQUEST_HEADER; /* request header */
1208 IN handle_t handle; /* handle to the timer */
1212 /* Retrieve the current context of a thread */
1213 struct get_thread_context_request
1215 REQUEST_HEADER; /* request header */
1216 IN handle_t handle; /* thread handle */
1217 IN unsigned int flags; /* context flags */
1218 OUT VARARG(context,context); /* thread context */
1222 /* Set the current context of a thread */
1223 struct set_thread_context_request
1225 REQUEST_HEADER; /* request header */
1226 IN handle_t handle; /* thread handle */
1227 IN unsigned int flags; /* context flags */
1228 IN VARARG(context,context); /* thread context */
1232 /* Fetch a selector entry for a thread */
1233 struct get_selector_entry_request
1235 REQUEST_HEADER; /* request header */
1236 IN handle_t handle; /* thread handle */
1237 IN int entry; /* LDT entry */
1238 OUT unsigned int base; /* selector base */
1239 OUT unsigned int limit; /* selector limit */
1240 OUT unsigned char flags; /* selector flags */
1245 struct add_atom_request
1247 REQUEST_HEADER; /* request header */
1248 IN int local; /* is atom in local process table? */
1249 OUT int atom; /* resulting atom */
1250 IN VARARG(name,unicode_str); /* atom name */
1254 /* Delete an atom */
1255 struct delete_atom_request
1257 REQUEST_HEADER; /* request header */
1258 IN int atom; /* atom handle */
1259 IN int local; /* is atom in local process table? */
1264 struct find_atom_request
1266 REQUEST_HEADER; /* request header */
1267 IN int local; /* is atom in local process table? */
1268 OUT int atom; /* atom handle */
1269 IN VARARG(name,unicode_str); /* atom name */
1273 /* Get an atom name */
1274 struct get_atom_name_request
1276 REQUEST_HEADER; /* request header */
1277 IN int atom; /* atom handle */
1278 IN int local; /* is atom in local process table? */
1279 OUT int count; /* atom lock count */
1280 OUT VARARG(name,unicode_str); /* atom name */
1284 /* Init the process atom table */
1285 struct init_atom_table_request
1287 REQUEST_HEADER; /* request header */
1288 IN int entries; /* number of entries */
1292 /* Get the message queue of the current thread */
1293 struct get_msg_queue_request
1295 REQUEST_HEADER; /* request header */
1296 OUT handle_t handle; /* handle to the queue */
1300 /* Set the message queue wake bits */
1301 struct set_queue_bits_request
1303 REQUEST_HEADER; /* request header */
1304 IN handle_t handle; /* handle to the queue */
1305 IN unsigned int set; /* wake bits to set */
1306 IN unsigned int clear; /* wake bits to clear */
1307 IN unsigned int mask_cond; /* mask for conditional bit setting */
1308 OUT unsigned int changed_mask; /* changed bits wake mask */
1312 /* Set the current message queue wakeup mask */
1313 struct set_queue_mask_request
1315 REQUEST_HEADER; /* request header */
1316 IN unsigned int wake_mask; /* wakeup bits mask */
1317 IN unsigned int changed_mask; /* changed bits mask */
1318 IN int skip_wait; /* will we skip waiting if signaled? */
1319 OUT unsigned int wake_bits; /* current wake bits */
1320 OUT unsigned int changed_bits; /* current changed bits */
1324 /* Get the current message queue status */
1325 struct get_queue_status_request
1327 REQUEST_HEADER; /* request header */
1328 IN int clear; /* should we clear the change bits? */
1329 OUT unsigned int wake_bits; /* wake bits */
1330 OUT unsigned int changed_bits; /* changed bits since last time */
1334 /* Wait for a process to start waiting on input */
1335 struct wait_input_idle_request
1337 REQUEST_HEADER; /* request header */
1338 IN handle_t handle; /* process handle */
1339 IN int timeout; /* timeout */
1340 OUT handle_t event; /* handle to idle event */
1344 /* Send a message to a thread queue */
1345 struct send_message_request
1347 REQUEST_HEADER; /* request header */
1348 IN int posted; /* posted instead of sent message? */
1349 IN void* id; /* thread id */
1350 IN int type; /* message type */
1351 IN handle_t win; /* window handle */
1352 IN unsigned int msg; /* message code */
1353 IN unsigned int wparam; /* parameters */
1354 IN unsigned int lparam; /* parameters */
1355 IN unsigned int info; /* extra info */
1359 /* Get a message from the current queue */
1360 struct get_message_request
1362 REQUEST_HEADER; /* request header */
1363 IN int remove; /* remove it? */
1364 IN int posted; /* check posted messages too? */
1365 IN handle_t get_win; /* window handle to get */
1366 IN unsigned int get_first; /* first message code to get */
1367 IN unsigned int get_last; /* last message code to get */
1368 OUT int sent; /* it is a sent message */
1369 OUT int type; /* message type */
1370 OUT handle_t win; /* window handle */
1371 OUT unsigned int msg; /* message code */
1372 OUT unsigned int wparam; /* parameters */
1373 OUT unsigned int lparam; /* parameters */
1374 OUT unsigned int info; /* extra info */
1378 /* Reply to a sent message */
1379 struct reply_message_request
1381 REQUEST_HEADER; /* request header */
1382 IN unsigned int result; /* message result */
1383 IN int remove; /* should we remove the message? */
1387 /* Retrieve the reply for the last message sent */
1388 struct get_message_reply_request
1390 REQUEST_HEADER; /* request header */
1391 IN int cancel; /* cancel message if not ready? */
1392 OUT unsigned int result; /* message result */
1396 /* Check if we are processing a sent message */
1397 struct in_send_message_request
1399 REQUEST_HEADER; /* request header */
1400 OUT int flags; /* ISMEX_* flags */
1404 /* Cleanup a queue when a window is deleted */
1405 struct cleanup_window_queue_request
1407 REQUEST_HEADER; /* request header */
1408 IN handle_t win; /* window handle */
1412 /* Set a window timer */
1413 struct set_win_timer_request
1415 REQUEST_HEADER; /* request header */
1416 IN handle_t win; /* window handle */
1417 IN unsigned int msg; /* message to post */
1418 IN unsigned int id; /* timer id */
1419 IN unsigned int rate; /* timer rate in ms */
1420 IN unsigned int lparam; /* message lparam (callback proc) */
1424 /* Kill a window timer */
1425 struct kill_win_timer_request
1427 REQUEST_HEADER; /* request header */
1428 IN handle_t win; /* window handle */
1429 IN unsigned int msg; /* message to post */
1430 IN unsigned int id; /* timer id */
1434 struct create_serial_request
1436 REQUEST_HEADER; /* request header */
1437 IN unsigned int access; /* wanted access rights */
1438 IN int inherit; /* inherit flag */
1439 IN unsigned int sharing; /* sharing flags */
1440 OUT handle_t handle; /* handle to the port */
1441 IN VARARG(name,string); /* file name */
1444 struct get_serial_info_request
1446 REQUEST_HEADER; /* request header */
1447 IN handle_t handle; /* handle to comm port */
1448 OUT unsigned int readinterval;
1449 OUT unsigned int readconst;
1450 OUT unsigned int readmult;
1451 OUT unsigned int writeconst;
1452 OUT unsigned int writemult;
1453 OUT unsigned int eventmask;
1454 OUT unsigned int commerror;
1457 struct set_serial_info_request
1459 REQUEST_HEADER; /* request header */
1460 IN handle_t handle; /* handle to comm port */
1461 IN int flags; /* bitmask to set values (see below) */
1462 IN unsigned int readinterval;
1463 IN unsigned int readconst;
1464 IN unsigned int readmult;
1465 IN unsigned int writeconst;
1466 IN unsigned int writemult;
1467 IN unsigned int eventmask;
1468 IN unsigned int commerror;
1470 #define SERIALINFO_SET_TIMEOUTS 0x01
1471 #define SERIALINFO_SET_MASK 0x02
1472 #define SERIALINFO_SET_ERROR 0x04
1474 struct create_async_request
1476 REQUEST_HEADER; /* request header */
1477 IN handle_t file_handle; /* handle to comm port, socket or file */
1482 #define ASYNC_TYPE_READ 0x01
1483 #define ASYNC_TYPE_WRITE 0x02
1484 #define ASYNC_TYPE_WAIT 0x03
1487 /* Everything below this line is generated automatically by tools/make_requests */
1488 /* ### make_requests begin ### */
1493 REQ_get_new_process_info,
1497 REQ_init_process_done,
1499 REQ_set_thread_buffer,
1500 REQ_terminate_process,
1501 REQ_terminate_thread,
1502 REQ_get_process_info,
1503 REQ_set_process_info,
1504 REQ_get_thread_info,
1505 REQ_set_thread_info,
1513 REQ_set_handle_info,
1523 REQ_create_semaphore,
1524 REQ_release_semaphore,
1527 REQ_alloc_file_handle,
1529 REQ_set_file_pointer,
1539 REQ_set_socket_event,
1540 REQ_get_socket_event,
1541 REQ_enable_socket_event,
1546 REQ_get_console_mode,
1547 REQ_set_console_mode,
1548 REQ_set_console_info,
1549 REQ_get_console_info,
1550 REQ_write_console_input,
1551 REQ_read_console_input,
1552 REQ_create_change_notification,
1555 REQ_get_mapping_info,
1557 REQ_create_snapshot,
1561 REQ_wait_debug_event,
1562 REQ_queue_exception_event,
1563 REQ_get_exception_status,
1564 REQ_output_debug_string,
1565 REQ_continue_debug_event,
1567 REQ_read_process_memory,
1568 REQ_write_process_memory,
1576 REQ_delete_key_value,
1579 REQ_save_registry_atexit,
1580 REQ_set_registry_levels,
1585 REQ_get_thread_context,
1586 REQ_set_thread_context,
1587 REQ_get_selector_entry,
1592 REQ_init_atom_table,
1596 REQ_get_queue_status,
1597 REQ_wait_input_idle,
1601 REQ_get_message_reply,
1602 REQ_in_send_message,
1603 REQ_cleanup_window_queue,
1607 REQ_get_serial_info,
1608 REQ_set_serial_info,
1613 union generic_request
1615 struct request_max_size max_size;
1616 struct request_header header;
1617 struct new_process_request new_process;
1618 struct get_new_process_info_request get_new_process_info;
1619 struct new_thread_request new_thread;
1620 struct boot_done_request boot_done;
1621 struct init_process_request init_process;
1622 struct init_process_done_request init_process_done;
1623 struct init_thread_request init_thread;
1624 struct set_thread_buffer_request set_thread_buffer;
1625 struct terminate_process_request terminate_process;
1626 struct terminate_thread_request terminate_thread;
1627 struct get_process_info_request get_process_info;
1628 struct set_process_info_request set_process_info;
1629 struct get_thread_info_request get_thread_info;
1630 struct set_thread_info_request set_thread_info;
1631 struct suspend_thread_request suspend_thread;
1632 struct resume_thread_request resume_thread;
1633 struct load_dll_request load_dll;
1634 struct unload_dll_request unload_dll;
1635 struct queue_apc_request queue_apc;
1636 struct get_apc_request get_apc;
1637 struct close_handle_request close_handle;
1638 struct set_handle_info_request set_handle_info;
1639 struct dup_handle_request dup_handle;
1640 struct open_process_request open_process;
1641 struct select_request select;
1642 struct create_event_request create_event;
1643 struct event_op_request event_op;
1644 struct open_event_request open_event;
1645 struct create_mutex_request create_mutex;
1646 struct release_mutex_request release_mutex;
1647 struct open_mutex_request open_mutex;
1648 struct create_semaphore_request create_semaphore;
1649 struct release_semaphore_request release_semaphore;
1650 struct open_semaphore_request open_semaphore;
1651 struct create_file_request create_file;
1652 struct alloc_file_handle_request alloc_file_handle;
1653 struct get_handle_fd_request get_handle_fd;
1654 struct set_file_pointer_request set_file_pointer;
1655 struct truncate_file_request truncate_file;
1656 struct set_file_time_request set_file_time;
1657 struct flush_file_request flush_file;
1658 struct get_file_info_request get_file_info;
1659 struct lock_file_request lock_file;
1660 struct unlock_file_request unlock_file;
1661 struct create_pipe_request create_pipe;
1662 struct create_socket_request create_socket;
1663 struct accept_socket_request accept_socket;
1664 struct set_socket_event_request set_socket_event;
1665 struct get_socket_event_request get_socket_event;
1666 struct enable_socket_event_request enable_socket_event;
1667 struct alloc_console_request alloc_console;
1668 struct free_console_request free_console;
1669 struct open_console_request open_console;
1670 struct set_console_fd_request set_console_fd;
1671 struct get_console_mode_request get_console_mode;
1672 struct set_console_mode_request set_console_mode;
1673 struct set_console_info_request set_console_info;
1674 struct get_console_info_request get_console_info;
1675 struct write_console_input_request write_console_input;
1676 struct read_console_input_request read_console_input;
1677 struct create_change_notification_request create_change_notification;
1678 struct create_mapping_request create_mapping;
1679 struct open_mapping_request open_mapping;
1680 struct get_mapping_info_request get_mapping_info;
1681 struct create_device_request create_device;
1682 struct create_snapshot_request create_snapshot;
1683 struct next_process_request next_process;
1684 struct next_thread_request next_thread;
1685 struct next_module_request next_module;
1686 struct wait_debug_event_request wait_debug_event;
1687 struct queue_exception_event_request queue_exception_event;
1688 struct get_exception_status_request get_exception_status;
1689 struct output_debug_string_request output_debug_string;
1690 struct continue_debug_event_request continue_debug_event;
1691 struct debug_process_request debug_process;
1692 struct read_process_memory_request read_process_memory;
1693 struct write_process_memory_request write_process_memory;
1694 struct create_key_request create_key;
1695 struct open_key_request open_key;
1696 struct delete_key_request delete_key;
1697 struct enum_key_request enum_key;
1698 struct set_key_value_request set_key_value;
1699 struct get_key_value_request get_key_value;
1700 struct enum_key_value_request enum_key_value;
1701 struct delete_key_value_request delete_key_value;
1702 struct load_registry_request load_registry;
1703 struct save_registry_request save_registry;
1704 struct save_registry_atexit_request save_registry_atexit;
1705 struct set_registry_levels_request set_registry_levels;
1706 struct create_timer_request create_timer;
1707 struct open_timer_request open_timer;
1708 struct set_timer_request set_timer;
1709 struct cancel_timer_request cancel_timer;
1710 struct get_thread_context_request get_thread_context;
1711 struct set_thread_context_request set_thread_context;
1712 struct get_selector_entry_request get_selector_entry;
1713 struct add_atom_request add_atom;
1714 struct delete_atom_request delete_atom;
1715 struct find_atom_request find_atom;
1716 struct get_atom_name_request get_atom_name;
1717 struct init_atom_table_request init_atom_table;
1718 struct get_msg_queue_request get_msg_queue;
1719 struct set_queue_bits_request set_queue_bits;
1720 struct set_queue_mask_request set_queue_mask;
1721 struct get_queue_status_request get_queue_status;
1722 struct wait_input_idle_request wait_input_idle;
1723 struct send_message_request send_message;
1724 struct get_message_request get_message;
1725 struct reply_message_request reply_message;
1726 struct get_message_reply_request get_message_reply;
1727 struct in_send_message_request in_send_message;
1728 struct cleanup_window_queue_request cleanup_window_queue;
1729 struct set_win_timer_request set_win_timer;
1730 struct kill_win_timer_request kill_win_timer;
1731 struct create_serial_request create_serial;
1732 struct get_serial_info_request get_serial_info;
1733 struct set_serial_info_request set_serial_info;
1734 struct create_async_request create_async;
1737 #define SERVER_PROTOCOL_VERSION 45
1739 /* ### make_requests end ### */
1740 /* Everything above this line is generated automatically by tools/make_requests */
1742 #undef REQUEST_HEADER
1745 /* client-side functions */
1747 #ifndef __WINE_SERVER__
1751 #include "wine/exception.h"
1753 /* client communication functions */
1755 extern unsigned int wine_server_call( union generic_request *req, size_t size );
1756 extern void server_protocol_error( const char *err, ... ) WINE_NORETURN;
1757 extern void server_protocol_perror( const char *err ) WINE_NORETURN;
1758 extern void wine_server_alloc_req( union generic_request *req, size_t size );
1759 extern void wine_server_send_fd( int fd );
1760 extern int wine_server_recv_fd( handle_t handle );
1761 extern const char *get_config_dir(void);
1763 /* do a server call and set the last error code */
1764 inline static unsigned int __server_call_err( union generic_request *req, size_t size )
1766 unsigned int res = wine_server_call( req, size );
1767 if (res) SetLastError( RtlNtStatusToDosError(res) );
1771 /* get a pointer to the variable part of the request */
1772 inline static void *server_data_ptr( const void *req )
1774 return (char *)NtCurrentTeb()->buffer + ((struct request_header *)req)->var_offset;
1777 /* get the size of the variable part of the request */
1778 inline static size_t server_data_size( const void *req )
1780 return ((struct request_header *)req)->var_size;
1784 /* exception support for server calls */
1786 extern DWORD __wine_server_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
1787 CONTEXT *context, EXCEPTION_FRAME **pdispatcher );
1789 struct __server_exception_frame
1791 EXCEPTION_FRAME frame;
1792 unsigned int buffer_pos; /* saved buffer position */
1796 /* macros for server requests */
1798 #define SERVER_START_REQ(type) \
1800 union generic_request __req; \
1801 struct type##_request * const req = &__req.type; \
1802 __req.header.req = REQ_##type; \
1803 __req.header.var_size = 0; \
1806 #define SERVER_END_REQ \
1810 #define SERVER_START_VAR_REQ(type,size) \
1812 struct __server_exception_frame __f; \
1813 union generic_request __req; \
1814 struct type##_request * const req = &__req.type; \
1815 __f.frame.Handler = __wine_server_exception_handler; \
1816 __f.buffer_pos = NtCurrentTeb()->buffer_pos; \
1817 __wine_push_frame( &__f.frame ); \
1818 __req.header.req = REQ_##type; \
1819 wine_server_alloc_req( &__req, (size) ); \
1822 #define SERVER_END_VAR_REQ \
1824 NtCurrentTeb()->buffer_pos = __f.buffer_pos; \
1825 __wine_pop_frame( &__f.frame ); \
1828 #define SERVER_CALL() (wine_server_call( &__req, sizeof(*req) ))
1829 #define SERVER_CALL_ERR() (__server_call_err( &__req, sizeof(*req) ))
1832 extern void CLIENT_InitServer(void);
1833 extern void CLIENT_InitThread(void);
1834 extern void CLIENT_BootDone( int debug_level );
1835 extern int CLIENT_IsBootThread(void);
1836 #endif /* __WINE_SERVER__ */
1838 #endif /* __WINE_SERVER_H */