Pass the stdin/stdout handles on startup to use as console (based on a
[wine/multimedia.git] / include / server.h
blob858131c5c4a90b03194286135b785b33566d3cad
1 /*
2 * Wine server definitions
4 * Copyright (C) 1998 Alexandre Julliard
5 */
7 #ifndef __WINE_SERVER_H
8 #define __WINE_SERVER_H
10 #include <stdlib.h>
11 #include <time.h>
12 #include "winbase.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*/
27 struct request_header
29 IN int req; /* request code */
30 IN unsigned short fixed_size; /* size of the fixed 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
47 typedef int handle_t;
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
99 int error; /* ??? */
100 int type; /* ??? */
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 */
115 typedef struct
117 int code; /* event code */
118 union debug_event_data info; /* event information */
119 } debug_event_t;
122 /* Create a new process from the context of the parent */
123 struct new_process_request
125 REQUEST_HEADER; /* request header */
126 IN int inherit_all; /* inherit all handles from parent */
127 IN int create_flags; /* creation flags */
128 IN int start_flags; /* flags from startup info */
129 IN handle_t exe_file; /* file handle for main exe */
130 IN handle_t hstdin; /* handle for stdin */
131 IN handle_t hstdout; /* handle for stdout */
132 IN handle_t hstderr; /* handle for stderr */
133 IN int cmd_show; /* main window show mode */
134 OUT handle_t info; /* new process info handle */
135 IN VARARG(filename,string); /* file name of main exe */
139 /* Retrieve information about a newly started process */
140 struct get_new_process_info_request
142 REQUEST_HEADER; /* request header */
143 IN handle_t info; /* info handle returned from new_process_request */
144 IN int pinherit; /* process handle inherit flag */
145 IN int tinherit; /* thread handle inherit flag */
146 OUT void* pid; /* process id */
147 OUT handle_t phandle; /* process handle (in the current process) */
148 OUT void* tid; /* thread id */
149 OUT handle_t thandle; /* thread handle (in the current process) */
150 OUT handle_t event; /* event handle to signal startup */
154 /* Create a new thread from the context of the parent */
155 struct new_thread_request
157 REQUEST_HEADER; /* request header */
158 IN int suspend; /* new thread should be suspended on creation */
159 IN int inherit; /* inherit flag */
160 OUT void* tid; /* thread id */
161 OUT handle_t handle; /* thread handle (in the current process) */
165 /* Signal that we are finished booting on the client side */
166 struct boot_done_request
168 REQUEST_HEADER; /* request header */
169 IN int debug_level; /* new debug level */
173 /* Initialize a process; called from the new process context */
174 struct init_process_request
176 REQUEST_HEADER; /* request header */
177 IN void* ldt_copy; /* addr of LDT copy */
178 IN int ppid; /* parent Unix pid */
179 OUT int create_flags; /* creation flags */
180 OUT int start_flags; /* flags from startup info */
181 OUT unsigned int server_start; /* server start time (GetTickCount) */
182 OUT handle_t exe_file; /* file handle for main exe */
183 OUT handle_t hstdin; /* handle for stdin */
184 OUT handle_t hstdout; /* handle for stdout */
185 OUT handle_t hstderr; /* handle for stderr */
186 OUT int cmd_show; /* main window show mode */
187 OUT VARARG(filename,string); /* file name of main exe */
191 /* Signal the end of the process initialization */
192 struct init_process_done_request
194 REQUEST_HEADER; /* request header */
195 IN void* module; /* main module base address */
196 IN void* entry; /* process entry point */
197 IN void* name; /* ptr to ptr to name (in process addr space) */
198 IN handle_t exe_file; /* file handle for main exe */
199 IN int gui; /* is it a GUI process? */
200 OUT int debugged; /* being debugged? */
204 /* Initialize a thread; called from the child after fork()/clone() */
205 struct init_thread_request
207 REQUEST_HEADER; /* request header */
208 IN int unix_pid; /* Unix pid of new thread */
209 IN void* teb; /* TEB of new thread (in thread address space) */
210 IN void* entry; /* thread entry point (in thread address space) */
214 /* Retrieve the thread buffer file descriptor */
215 /* The reply to this request is the first thing a newly */
216 /* created thread gets (without having to request it) */
217 struct get_thread_buffer_request
219 REQUEST_HEADER; /* request header */
220 OUT void* pid; /* process id of the new thread's process */
221 OUT void* tid; /* thread id of the new thread */
222 OUT int boot; /* is this the boot thread? */
223 OUT int version; /* protocol version */
227 /* Terminate a process */
228 struct terminate_process_request
230 REQUEST_HEADER; /* request header */
231 IN handle_t handle; /* process handle to terminate */
232 IN int exit_code; /* process exit code */
233 OUT int self; /* suicide? */
237 /* Terminate a thread */
238 struct terminate_thread_request
240 REQUEST_HEADER; /* request header */
241 IN handle_t handle; /* thread handle to terminate */
242 IN int exit_code; /* thread exit code */
243 OUT int self; /* suicide? */
244 OUT int last; /* last thread in this process? */
248 /* Retrieve information about a process */
249 struct get_process_info_request
251 REQUEST_HEADER; /* request header */
252 IN handle_t handle; /* process handle */
253 OUT void* pid; /* server process id */
254 OUT int debugged; /* debugged? */
255 OUT int exit_code; /* process exit code */
256 OUT int priority; /* priority class */
257 OUT int process_affinity; /* process affinity mask */
258 OUT int system_affinity; /* system affinity mask */
262 /* Set a process informations */
263 struct set_process_info_request
265 REQUEST_HEADER; /* request header */
266 IN handle_t handle; /* process handle */
267 IN int mask; /* setting mask (see below) */
268 IN int priority; /* priority class */
269 IN int affinity; /* affinity mask */
271 #define SET_PROCESS_INFO_PRIORITY 0x01
272 #define SET_PROCESS_INFO_AFFINITY 0x02
275 /* Retrieve information about a thread */
276 struct get_thread_info_request
278 REQUEST_HEADER; /* request header */
279 IN handle_t handle; /* thread handle */
280 IN void* tid_in; /* thread id (optional) */
281 OUT void* tid; /* server thread id */
282 OUT void* teb; /* thread teb pointer */
283 OUT int exit_code; /* thread exit code */
284 OUT int priority; /* thread priority level */
288 /* Set a thread informations */
289 struct set_thread_info_request
291 REQUEST_HEADER; /* request header */
292 IN handle_t handle; /* thread handle */
293 IN int mask; /* setting mask (see below) */
294 IN int priority; /* priority class */
295 IN int affinity; /* affinity mask */
297 #define SET_THREAD_INFO_PRIORITY 0x01
298 #define SET_THREAD_INFO_AFFINITY 0x02
301 /* Suspend a thread */
302 struct suspend_thread_request
304 REQUEST_HEADER; /* request header */
305 IN handle_t handle; /* thread handle */
306 OUT int count; /* new suspend count */
310 /* Resume a thread */
311 struct resume_thread_request
313 REQUEST_HEADER; /* request header */
314 IN handle_t handle; /* thread handle */
315 OUT int count; /* new suspend count */
319 /* Notify the server that a dll has been loaded */
320 struct load_dll_request
322 REQUEST_HEADER; /* request header */
323 IN handle_t handle; /* file handle */
324 IN void* base; /* base address */
325 IN int dbg_offset; /* debug info offset */
326 IN int dbg_size; /* debug info size */
327 IN void* name; /* ptr to ptr to name (in process addr space) */
331 /* Notify the server that a dll is being unloaded */
332 struct unload_dll_request
334 REQUEST_HEADER; /* request header */
335 IN void* base; /* base address */
339 /* Queue an APC for a thread */
340 struct queue_apc_request
342 REQUEST_HEADER; /* request header */
343 IN handle_t handle; /* thread handle */
344 IN int user; /* user or system apc? */
345 IN void* func; /* function to call */
346 IN void* param; /* param for function to call */
350 /* Get next APC to call */
351 struct get_apc_request
353 REQUEST_HEADER; /* request header */
354 IN int alertable; /* is thread alertable? */
355 OUT void* func; /* function to call */
356 OUT int type; /* function type */
357 OUT VARARG(args,ptrs); /* function arguments */
359 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
362 /* Close a handle for the current process */
363 struct close_handle_request
365 REQUEST_HEADER; /* request header */
366 IN handle_t handle; /* handle to close */
367 OUT int fd; /* associated fd to close */
371 /* Set a handle information */
372 struct set_handle_info_request
374 REQUEST_HEADER; /* request header */
375 IN handle_t handle; /* handle we are interested in */
376 IN int flags; /* new handle flags */
377 IN int mask; /* mask for flags to set */
378 IN int fd; /* file descriptor or -1 */
379 OUT int old_flags; /* old flag value */
380 OUT int cur_fd; /* current file descriptor */
384 /* Duplicate a handle */
385 struct dup_handle_request
387 REQUEST_HEADER; /* request header */
388 IN handle_t src_process; /* src process handle */
389 IN handle_t src_handle; /* src handle to duplicate */
390 IN handle_t dst_process; /* dst process handle */
391 IN unsigned int access; /* wanted access rights */
392 IN int inherit; /* inherit flag */
393 IN int options; /* duplicate options (see below) */
394 OUT handle_t handle; /* duplicated handle in dst process */
395 OUT int fd; /* associated fd to close */
397 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
398 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
399 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
402 /* Open a handle to a process */
403 struct open_process_request
405 REQUEST_HEADER; /* request header */
406 IN void* pid; /* process id to open */
407 IN unsigned int access; /* wanted access rights */
408 IN int inherit; /* inherit flag */
409 OUT handle_t handle; /* handle to the process */
413 /* Wait for handles */
414 struct select_request
416 REQUEST_HEADER; /* request header */
417 IN int flags; /* wait flags (see below) */
418 IN int sec; /* absolute timeout */
419 IN int usec; /* absolute timeout */
420 OUT int signaled; /* signaled handle */
421 IN VARARG(handles,handles); /* handles to select on */
423 #define SELECT_ALL 1
424 #define SELECT_ALERTABLE 2
425 #define SELECT_INTERRUPTIBLE 4
426 #define SELECT_TIMEOUT 8
429 /* Create an event */
430 struct create_event_request
432 REQUEST_HEADER; /* request header */
433 IN int manual_reset; /* manual reset event */
434 IN int initial_state; /* initial state of the event */
435 IN int inherit; /* inherit flag */
436 OUT handle_t handle; /* handle to the event */
437 IN VARARG(name,unicode_str); /* object name */
440 /* Event operation */
441 struct event_op_request
443 REQUEST_HEADER; /* request header */
444 IN handle_t handle; /* handle to event */
445 IN int op; /* event operation (see below) */
447 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
450 /* Open an event */
451 struct open_event_request
453 REQUEST_HEADER; /* request header */
454 IN unsigned int access; /* wanted access rights */
455 IN int inherit; /* inherit flag */
456 OUT handle_t handle; /* handle to the event */
457 IN VARARG(name,unicode_str); /* object name */
461 /* Create a mutex */
462 struct create_mutex_request
464 REQUEST_HEADER; /* request header */
465 IN int owned; /* initially owned? */
466 IN int inherit; /* inherit flag */
467 OUT handle_t handle; /* handle to the mutex */
468 IN VARARG(name,unicode_str); /* object name */
472 /* Release a mutex */
473 struct release_mutex_request
475 REQUEST_HEADER; /* request header */
476 IN handle_t handle; /* handle to the mutex */
480 /* Open a mutex */
481 struct open_mutex_request
483 REQUEST_HEADER; /* request header */
484 IN unsigned int access; /* wanted access rights */
485 IN int inherit; /* inherit flag */
486 OUT handle_t handle; /* handle to the mutex */
487 IN VARARG(name,unicode_str); /* object name */
491 /* Create a semaphore */
492 struct create_semaphore_request
494 REQUEST_HEADER; /* request header */
495 IN unsigned int initial; /* initial count */
496 IN unsigned int max; /* maximum count */
497 IN int inherit; /* inherit flag */
498 OUT handle_t handle; /* handle to the semaphore */
499 IN VARARG(name,unicode_str); /* object name */
503 /* Release a semaphore */
504 struct release_semaphore_request
506 REQUEST_HEADER; /* request header */
507 IN handle_t handle; /* handle to the semaphore */
508 IN unsigned int count; /* count to add to semaphore */
509 OUT unsigned int prev_count; /* previous semaphore count */
513 /* Open a semaphore */
514 struct open_semaphore_request
516 REQUEST_HEADER; /* request header */
517 IN unsigned int access; /* wanted access rights */
518 IN int inherit; /* inherit flag */
519 OUT handle_t handle; /* handle to the semaphore */
520 IN VARARG(name,unicode_str); /* object name */
524 /* Create a file */
525 struct create_file_request
527 REQUEST_HEADER; /* request header */
528 IN unsigned int access; /* wanted access rights */
529 IN int inherit; /* inherit flag */
530 IN unsigned int sharing; /* sharing flags */
531 IN int create; /* file create action */
532 IN unsigned int attrs; /* file attributes for creation */
533 OUT handle_t handle; /* handle to the file */
534 IN VARARG(filename,string); /* file name */
538 /* Allocate a file handle for a Unix fd */
539 struct alloc_file_handle_request
541 REQUEST_HEADER; /* request header */
542 IN unsigned int access; /* wanted access rights */
543 OUT handle_t handle; /* handle to the file */
547 /* Get a Unix fd to access a file */
548 struct get_handle_fd_request
550 REQUEST_HEADER; /* request header */
551 IN handle_t handle; /* handle to the file */
552 IN unsigned int access; /* wanted access rights */
553 OUT int fd; /* file descriptor */
557 /* Set a file current position */
558 struct set_file_pointer_request
560 REQUEST_HEADER; /* request header */
561 IN handle_t handle; /* handle to the file */
562 IN int low; /* position low word */
563 IN int high; /* position high word */
564 IN int whence; /* whence to seek */
565 OUT int new_low; /* new position low word */
566 OUT int new_high; /* new position high word */
570 /* Truncate (or extend) a file */
571 struct truncate_file_request
573 REQUEST_HEADER; /* request header */
574 IN handle_t handle; /* handle to the file */
578 /* Set a file access and modification times */
579 struct set_file_time_request
581 REQUEST_HEADER; /* request header */
582 IN handle_t handle; /* handle to the file */
583 IN time_t access_time; /* last access time */
584 IN time_t write_time; /* last write time */
588 /* Flush a file buffers */
589 struct flush_file_request
591 REQUEST_HEADER; /* request header */
592 IN handle_t handle; /* handle to the file */
596 /* Get information about a file */
597 struct get_file_info_request
599 REQUEST_HEADER; /* request header */
600 IN handle_t handle; /* handle to the file */
601 OUT int type; /* file type */
602 OUT int attr; /* file attributes */
603 OUT time_t access_time; /* last access time */
604 OUT time_t write_time; /* last write time */
605 OUT int size_high; /* file size */
606 OUT int size_low; /* file size */
607 OUT int links; /* number of links */
608 OUT int index_high; /* unique index */
609 OUT int index_low; /* unique index */
610 OUT unsigned int serial; /* volume serial number */
614 /* Lock a region of a file */
615 struct lock_file_request
617 REQUEST_HEADER; /* request header */
618 IN handle_t handle; /* handle to the file */
619 IN unsigned int offset_low; /* offset of start of lock */
620 IN unsigned int offset_high; /* offset of start of lock */
621 IN unsigned int count_low; /* count of bytes to lock */
622 IN unsigned int count_high; /* count of bytes to lock */
626 /* Unlock a region of a file */
627 struct unlock_file_request
629 REQUEST_HEADER; /* request header */
630 IN handle_t handle; /* handle to the file */
631 IN unsigned int offset_low; /* offset of start of unlock */
632 IN unsigned int offset_high; /* offset of start of unlock */
633 IN unsigned int count_low; /* count of bytes to unlock */
634 IN unsigned int count_high; /* count of bytes to unlock */
638 /* Create an anonymous pipe */
639 struct create_pipe_request
641 REQUEST_HEADER; /* request header */
642 IN int inherit; /* inherit flag */
643 OUT handle_t handle_read; /* handle to the read-side of the pipe */
644 OUT handle_t handle_write; /* handle to the write-side of the pipe */
648 /* Create a socket */
649 struct create_socket_request
651 REQUEST_HEADER; /* request header */
652 IN unsigned int access; /* wanted access rights */
653 IN int inherit; /* inherit flag */
654 IN int family; /* family, see socket manpage */
655 IN int type; /* type, see socket manpage */
656 IN int protocol; /* protocol, see socket manpage */
657 OUT handle_t handle; /* handle to the new socket */
661 /* Accept a socket */
662 struct accept_socket_request
664 REQUEST_HEADER; /* request header */
665 IN handle_t lhandle; /* handle to the listening socket */
666 IN unsigned int access; /* wanted access rights */
667 IN int inherit; /* inherit flag */
668 OUT handle_t handle; /* handle to the new socket */
672 /* Set socket event parameters */
673 struct set_socket_event_request
675 REQUEST_HEADER; /* request header */
676 IN handle_t handle; /* handle to the socket */
677 IN unsigned int mask; /* event mask */
678 IN handle_t event; /* event object */
682 /* Get socket event parameters */
683 struct get_socket_event_request
685 REQUEST_HEADER; /* request header */
686 IN handle_t handle; /* handle to the socket */
687 IN int service; /* clear pending? */
688 IN handle_t s_event; /* "expected" event object */
689 IN handle_t c_event; /* event to clear */
690 OUT unsigned int mask; /* event mask */
691 OUT unsigned int pmask; /* pending events */
692 OUT unsigned int state; /* status bits */
693 OUT VARARG(errors,ints); /* event errors */
697 /* Reenable pending socket events */
698 struct enable_socket_event_request
700 REQUEST_HEADER; /* request header */
701 IN handle_t handle; /* handle to the socket */
702 IN unsigned int mask; /* events to re-enable */
703 IN unsigned int sstate; /* status bits to set */
704 IN unsigned int cstate; /* status bits to clear */
708 /* Allocate a console for the current process */
709 struct alloc_console_request
711 REQUEST_HEADER; /* request header */
712 IN unsigned int access; /* wanted access rights */
713 IN int inherit; /* inherit flag */
714 OUT handle_t handle_in; /* handle to console input */
715 OUT handle_t handle_out; /* handle to console output */
719 /* Free the console of the current process */
720 struct free_console_request
722 REQUEST_HEADER; /* request header */
726 /* Open a handle to the process console */
727 struct open_console_request
729 REQUEST_HEADER; /* request header */
730 IN int output; /* input or output? */
731 IN unsigned int access; /* wanted access rights */
732 IN int inherit; /* inherit flag */
733 OUT handle_t handle; /* handle to the console */
737 /* Set a console file descriptor */
738 struct set_console_fd_request
740 REQUEST_HEADER; /* request header */
741 IN handle_t handle; /* handle to the console */
742 IN handle_t handle_in; /* handle of file to use as input */
743 IN handle_t handle_out; /* handle of file to use as output */
744 IN int pid; /* pid of xterm (hack) */
748 /* Get a console mode (input or output) */
749 struct get_console_mode_request
751 REQUEST_HEADER; /* request header */
752 IN handle_t handle; /* handle to the console */
753 OUT int mode; /* console mode */
757 /* Set a console mode (input or output) */
758 struct set_console_mode_request
760 REQUEST_HEADER; /* request header */
761 IN handle_t handle; /* handle to the console */
762 IN int mode; /* console mode */
766 /* Set info about a console (output only) */
767 struct set_console_info_request
769 REQUEST_HEADER; /* request header */
770 IN handle_t handle; /* handle to the console */
771 IN int mask; /* setting mask (see below) */
772 IN int cursor_size; /* size of cursor (percentage filled) */
773 IN int cursor_visible;/* cursor visibility flag */
774 IN VARARG(title,string); /* console title */
776 #define SET_CONSOLE_INFO_CURSOR 0x01
777 #define SET_CONSOLE_INFO_TITLE 0x02
779 /* Get info about a console (output only) */
780 struct get_console_info_request
782 REQUEST_HEADER; /* request header */
783 IN handle_t handle; /* handle to the console */
784 OUT int cursor_size; /* size of cursor (percentage filled) */
785 OUT int cursor_visible;/* cursor visibility flag */
786 OUT int pid; /* pid of xterm (hack) */
787 OUT VARARG(title,string); /* console title */
791 /* Add input records to a console input queue */
792 struct write_console_input_request
794 REQUEST_HEADER; /* request header */
795 IN handle_t handle; /* handle to the console input */
796 OUT int written; /* number of records written */
797 IN VARARG(rec,input_records); /* input records */
800 /* Fetch input records from a console input queue */
801 struct read_console_input_request
803 REQUEST_HEADER; /* request header */
804 IN handle_t handle; /* handle to the console input */
805 IN int flush; /* flush the retrieved records from the queue? */
806 OUT int read; /* number of records read */
807 OUT VARARG(rec,input_records); /* input records */
811 /* Create a change notification */
812 struct create_change_notification_request
814 REQUEST_HEADER; /* request header */
815 IN int subtree; /* watch all the subtree */
816 IN int filter; /* notification filter */
817 OUT handle_t handle; /* handle to the change notification */
821 /* Create a file mapping */
822 struct create_mapping_request
824 REQUEST_HEADER; /* request header */
825 IN int size_high; /* mapping size */
826 IN int size_low; /* mapping size */
827 IN int protect; /* protection flags (see below) */
828 IN int inherit; /* inherit flag */
829 IN handle_t file_handle; /* file handle */
830 OUT handle_t handle; /* handle to the mapping */
831 IN VARARG(name,unicode_str); /* object name */
833 /* protection flags */
834 #define VPROT_READ 0x01
835 #define VPROT_WRITE 0x02
836 #define VPROT_EXEC 0x04
837 #define VPROT_WRITECOPY 0x08
838 #define VPROT_GUARD 0x10
839 #define VPROT_NOCACHE 0x20
840 #define VPROT_COMMITTED 0x40
841 #define VPROT_IMAGE 0x80
844 /* Open a mapping */
845 struct open_mapping_request
847 REQUEST_HEADER; /* request header */
848 IN unsigned int access; /* wanted access rights */
849 IN int inherit; /* inherit flag */
850 OUT handle_t handle; /* handle to the mapping */
851 IN VARARG(name,unicode_str); /* object name */
855 /* Get information about a file mapping */
856 struct get_mapping_info_request
858 REQUEST_HEADER; /* request header */
859 IN handle_t handle; /* handle to the mapping */
860 OUT int size_high; /* mapping size */
861 OUT int size_low; /* mapping size */
862 OUT int protect; /* protection flags */
863 OUT int header_size; /* header size (for VPROT_IMAGE mapping) */
864 OUT void* base; /* default base addr (for VPROT_IMAGE mapping) */
865 OUT handle_t shared_file; /* shared mapping file handle */
866 OUT int shared_size; /* shared mapping size */
867 OUT int anonymous; /* anonymous mapping? */
871 /* Create a device */
872 struct create_device_request
874 REQUEST_HEADER; /* request header */
875 IN unsigned int access; /* wanted access rights */
876 IN int inherit; /* inherit flag */
877 IN int id; /* client private id */
878 OUT handle_t handle; /* handle to the device */
882 /* Create a snapshot */
883 struct create_snapshot_request
885 REQUEST_HEADER; /* request header */
886 IN int inherit; /* inherit flag */
887 IN int flags; /* snapshot flags (TH32CS_*) */
888 IN void* pid; /* process id */
889 OUT handle_t handle; /* handle to the snapshot */
893 /* Get the next process from a snapshot */
894 struct next_process_request
896 REQUEST_HEADER; /* request header */
897 IN handle_t handle; /* handle to the snapshot */
898 IN int reset; /* reset snapshot position? */
899 OUT int count; /* process usage count */
900 OUT void* pid; /* process id */
901 OUT int threads; /* number of threads */
902 OUT int priority; /* process priority */
906 /* Get the next thread from a snapshot */
907 struct next_thread_request
909 REQUEST_HEADER; /* request header */
910 IN handle_t handle; /* handle to the snapshot */
911 IN int reset; /* reset snapshot position? */
912 OUT int count; /* thread usage count */
913 OUT void* pid; /* process id */
914 OUT void* tid; /* thread id */
915 OUT int base_pri; /* base priority */
916 OUT int delta_pri; /* delta priority */
920 /* Get the next module from a snapshot */
921 struct next_module_request
923 REQUEST_HEADER; /* request header */
924 IN handle_t handle; /* handle to the snapshot */
925 IN int reset; /* reset snapshot position? */
926 OUT void* pid; /* process id */
927 OUT void* base; /* module base address */
931 /* Wait for a debug event */
932 struct wait_debug_event_request
934 REQUEST_HEADER; /* request header */
935 IN int get_handle; /* should we alloc a handle for waiting? */
936 OUT void* pid; /* process id */
937 OUT void* tid; /* thread id */
938 OUT handle_t wait; /* wait handle if no event ready */
939 OUT VARARG(event,debug_event); /* debug event data */
943 /* Queue an exception event */
944 struct queue_exception_event_request
946 REQUEST_HEADER; /* request header */
947 IN int first; /* first chance exception? */
948 OUT handle_t handle; /* handle to the queued event */
949 IN VARARG(record,exc_event); /* thread context followed by exception record */
953 /* Retrieve the status of an exception event */
954 struct get_exception_status_request
956 REQUEST_HEADER; /* request header */
957 OUT handle_t handle; /* handle to the queued event */
958 OUT int status; /* event continuation status */
959 OUT VARARG(context,context); /* modified thread context */
963 /* Send an output string to the debugger */
964 struct output_debug_string_request
966 REQUEST_HEADER; /* request header */
967 IN void* string; /* string to display (in debugged process address space) */
968 IN int unicode; /* is it Unicode? */
969 IN int length; /* string length */
973 /* Continue a debug event */
974 struct continue_debug_event_request
976 REQUEST_HEADER; /* request header */
977 IN void* pid; /* process id to continue */
978 IN void* tid; /* thread id to continue */
979 IN int status; /* continuation status */
983 /* Start debugging an existing process */
984 struct debug_process_request
986 REQUEST_HEADER; /* request header */
987 IN void* pid; /* id of the process to debug */
991 /* Read data from a process address space */
992 struct read_process_memory_request
994 REQUEST_HEADER; /* request header */
995 IN handle_t handle; /* process handle */
996 IN void* addr; /* addr to read from (must be int-aligned) */
997 IN int len; /* number of ints to read */
998 OUT VARARG(data,bytes); /* result data */
1002 /* Write data to a process address space */
1003 struct write_process_memory_request
1005 REQUEST_HEADER; /* request header */
1006 IN handle_t handle; /* process handle */
1007 IN void* addr; /* addr to write to (must be int-aligned) */
1008 IN int len; /* number of ints to write */
1009 IN unsigned int first_mask; /* mask for first word */
1010 IN unsigned int last_mask; /* mask for last word */
1011 IN VARARG(data,bytes); /* result data */
1015 /* Create a registry key */
1016 struct create_key_request
1018 REQUEST_HEADER; /* request header */
1019 IN handle_t parent; /* handle to the parent key */
1020 IN unsigned int access; /* desired access rights */
1021 IN unsigned int options; /* creation options */
1022 IN time_t modif; /* last modification time */
1023 OUT handle_t hkey; /* handle to the created key */
1024 OUT int created; /* has it been newly created? */
1025 IN VARARG(name,unicode_len_str); /* key name */
1026 IN VARARG(class,unicode_str); /* class name */
1029 /* Open a registry key */
1030 struct open_key_request
1032 REQUEST_HEADER; /* request header */
1033 IN handle_t parent; /* handle to the parent key */
1034 IN unsigned int access; /* desired access rights */
1035 OUT handle_t hkey; /* handle to the open key */
1036 IN VARARG(name,unicode_str); /* key name */
1040 /* Delete a registry key */
1041 struct delete_key_request
1043 REQUEST_HEADER; /* request header */
1044 IN handle_t hkey; /* handle to the key */
1048 /* Enumerate registry subkeys */
1049 struct enum_key_request
1051 REQUEST_HEADER; /* request header */
1052 IN handle_t hkey; /* handle to registry key */
1053 IN int index; /* index of subkey (or -1 for current key) */
1054 IN int full; /* return the full info? */
1055 OUT int subkeys; /* number of subkeys */
1056 OUT int max_subkey; /* longest subkey name */
1057 OUT int max_class; /* longest class name */
1058 OUT int values; /* number of values */
1059 OUT int max_value; /* longest value name */
1060 OUT int max_data; /* longest value data */
1061 OUT time_t modif; /* last modification time */
1062 OUT VARARG(name,unicode_len_str); /* key name */
1063 OUT VARARG(class,unicode_str); /* class name */
1067 /* Set a value of a registry key */
1068 struct set_key_value_request
1070 REQUEST_HEADER; /* request header */
1071 IN handle_t hkey; /* handle to registry key */
1072 IN int type; /* value type */
1073 IN unsigned int total; /* total value len */
1074 IN unsigned int offset; /* offset for setting data */
1075 IN VARARG(name,unicode_len_str); /* value name */
1076 IN VARARG(data,bytes); /* value data */
1080 /* Retrieve the value of a registry key */
1081 struct get_key_value_request
1083 REQUEST_HEADER; /* request header */
1084 IN handle_t hkey; /* handle to registry key */
1085 IN unsigned int offset; /* offset for getting data */
1086 OUT int type; /* value type */
1087 OUT int len; /* value data len */
1088 IN VARARG(name,unicode_len_str); /* value name */
1089 OUT VARARG(data,bytes); /* value data */
1093 /* Enumerate a value of a registry key */
1094 struct enum_key_value_request
1096 REQUEST_HEADER; /* request header */
1097 IN handle_t hkey; /* handle to registry key */
1098 IN int index; /* value index */
1099 IN unsigned int offset; /* offset for getting data */
1100 OUT int type; /* value type */
1101 OUT int len; /* value data len */
1102 OUT VARARG(name,unicode_len_str); /* value name */
1103 OUT VARARG(data,bytes); /* value data */
1107 /* Delete a value of a registry key */
1108 struct delete_key_value_request
1110 REQUEST_HEADER; /* request header */
1111 IN handle_t hkey; /* handle to registry key */
1112 IN VARARG(name,unicode_str); /* value name */
1116 /* Load a registry branch from a file */
1117 struct load_registry_request
1119 REQUEST_HEADER; /* request header */
1120 IN handle_t hkey; /* root key to load to */
1121 IN handle_t file; /* file to load from */
1122 IN VARARG(name,unicode_str); /* subkey name */
1126 /* Save a registry branch to a file */
1127 struct save_registry_request
1129 REQUEST_HEADER; /* request header */
1130 IN handle_t hkey; /* key to save */
1131 IN handle_t file; /* file to save to */
1135 /* Save a registry branch at server exit */
1136 struct save_registry_atexit_request
1138 REQUEST_HEADER; /* request header */
1139 IN handle_t hkey; /* key to save */
1140 IN VARARG(file,string); /* file to save to */
1144 /* Set the current and saving level for the registry */
1145 struct set_registry_levels_request
1147 REQUEST_HEADER; /* request header */
1148 IN int current; /* new current level */
1149 IN int saving; /* new saving level */
1150 IN int period; /* duration between periodic saves (milliseconds) */
1154 /* Create a waitable timer */
1155 struct create_timer_request
1157 REQUEST_HEADER; /* request header */
1158 IN int inherit; /* inherit flag */
1159 IN int manual; /* manual reset */
1160 OUT handle_t handle; /* handle to the timer */
1161 IN VARARG(name,unicode_str); /* object name */
1165 /* Open a waitable timer */
1166 struct open_timer_request
1168 REQUEST_HEADER; /* request header */
1169 IN unsigned int access; /* wanted access rights */
1170 IN int inherit; /* inherit flag */
1171 OUT handle_t handle; /* handle to the timer */
1172 IN VARARG(name,unicode_str); /* object name */
1175 /* Set a waitable timer */
1176 struct set_timer_request
1178 REQUEST_HEADER; /* request header */
1179 IN handle_t handle; /* handle to the timer */
1180 IN int sec; /* next expiration absolute time */
1181 IN int usec; /* next expiration absolute time */
1182 IN int period; /* timer period in ms */
1183 IN void* callback; /* callback function */
1184 IN void* arg; /* callback argument */
1187 /* Cancel a waitable timer */
1188 struct cancel_timer_request
1190 REQUEST_HEADER; /* request header */
1191 IN handle_t handle; /* handle to the timer */
1195 /* Retrieve the current context of a thread */
1196 struct get_thread_context_request
1198 REQUEST_HEADER; /* request header */
1199 IN handle_t handle; /* thread handle */
1200 IN unsigned int flags; /* context flags */
1201 OUT VARARG(context,context); /* thread context */
1205 /* Set the current context of a thread */
1206 struct set_thread_context_request
1208 REQUEST_HEADER; /* request header */
1209 IN handle_t handle; /* thread handle */
1210 IN unsigned int flags; /* context flags */
1211 IN VARARG(context,context); /* thread context */
1215 /* Fetch a selector entry for a thread */
1216 struct get_selector_entry_request
1218 REQUEST_HEADER; /* request header */
1219 IN handle_t handle; /* thread handle */
1220 IN int entry; /* LDT entry */
1221 OUT unsigned int base; /* selector base */
1222 OUT unsigned int limit; /* selector limit */
1223 OUT unsigned char flags; /* selector flags */
1227 /* Add an atom */
1228 struct add_atom_request
1230 REQUEST_HEADER; /* request header */
1231 IN int local; /* is atom in local process table? */
1232 OUT int atom; /* resulting atom */
1233 IN VARARG(name,unicode_str); /* atom name */
1237 /* Delete an atom */
1238 struct delete_atom_request
1240 REQUEST_HEADER; /* request header */
1241 IN int atom; /* atom handle */
1242 IN int local; /* is atom in local process table? */
1246 /* Find an atom */
1247 struct find_atom_request
1249 REQUEST_HEADER; /* request header */
1250 IN int local; /* is atom in local process table? */
1251 OUT int atom; /* atom handle */
1252 IN VARARG(name,unicode_str); /* atom name */
1256 /* Get an atom name */
1257 struct get_atom_name_request
1259 REQUEST_HEADER; /* request header */
1260 IN int atom; /* atom handle */
1261 IN int local; /* is atom in local process table? */
1262 OUT int count; /* atom lock count */
1263 OUT VARARG(name,unicode_str); /* atom name */
1267 /* Init the process atom table */
1268 struct init_atom_table_request
1270 REQUEST_HEADER; /* request header */
1271 IN int entries; /* number of entries */
1275 /* Get the message queue of the current thread */
1276 struct get_msg_queue_request
1278 REQUEST_HEADER; /* request header */
1279 OUT handle_t handle; /* handle to the queue */
1282 /* Wake up a message queue */
1283 struct wake_queue_request
1285 REQUEST_HEADER; /* request header */
1286 IN handle_t handle; /* handle to the queue */
1287 IN unsigned int bits; /* wake bits */
1290 /* Wait for a process to start waiting on input */
1291 struct wait_input_idle_request
1293 REQUEST_HEADER; /* request header */
1294 IN handle_t handle; /* process handle */
1295 IN int timeout; /* timeout */
1296 OUT handle_t event; /* handle to idle event */
1299 struct create_serial_request
1301 REQUEST_HEADER; /* request header */
1302 IN unsigned int access; /* wanted access rights */
1303 IN int inherit; /* inherit flag */
1304 IN unsigned int sharing; /* sharing flags */
1305 OUT handle_t handle; /* handle to the port */
1306 IN VARARG(name,string); /* file name */
1309 struct get_serial_info_request
1311 REQUEST_HEADER; /* request header */
1312 IN handle_t handle; /* handle to comm port */
1313 OUT unsigned int readinterval;
1314 OUT unsigned int readconst;
1315 OUT unsigned int readmult;
1316 OUT unsigned int writeconst;
1317 OUT unsigned int writemult;
1318 OUT unsigned int eventmask;
1319 OUT unsigned int commerror;
1322 struct set_serial_info_request
1324 REQUEST_HEADER; /* request header */
1325 IN handle_t handle; /* handle to comm port */
1326 IN int flags; /* bitmask to set values (see below) */
1327 IN unsigned int readinterval;
1328 IN unsigned int readconst;
1329 IN unsigned int readmult;
1330 IN unsigned int writeconst;
1331 IN unsigned int writemult;
1332 IN unsigned int eventmask;
1333 IN unsigned int commerror;
1335 #define SERIALINFO_SET_TIMEOUTS 0x01
1336 #define SERIALINFO_SET_MASK 0x02
1337 #define SERIALINFO_SET_ERROR 0x04
1339 struct create_async_request
1341 REQUEST_HEADER; /* request header */
1342 IN handle_t file_handle; /* handle to comm port */
1343 IN void* overlapped;
1344 IN void* buffer;
1345 IN int count;
1346 IN void* func;
1347 IN int type;
1348 OUT handle_t ov_handle;
1350 #define ASYNC_TYPE_READ 0x01
1351 #define ASYNC_TYPE_WRITE 0x02
1352 #define ASYNC_TYPE_WAIT 0x03
1355 * Used by service thread to tell the server that the current
1356 * operation has completed
1358 struct async_result_request
1360 REQUEST_HEADER; /* request header */
1361 IN handle_t ov_handle;
1362 IN int result; /* NT status code */
1365 /* Everything below this line is generated automatically by tools/make_requests */
1366 /* ### make_requests begin ### */
1368 enum request
1370 REQ_NEW_PROCESS,
1371 REQ_GET_NEW_PROCESS_INFO,
1372 REQ_NEW_THREAD,
1373 REQ_BOOT_DONE,
1374 REQ_INIT_PROCESS,
1375 REQ_INIT_PROCESS_DONE,
1376 REQ_INIT_THREAD,
1377 REQ_GET_THREAD_BUFFER,
1378 REQ_TERMINATE_PROCESS,
1379 REQ_TERMINATE_THREAD,
1380 REQ_GET_PROCESS_INFO,
1381 REQ_SET_PROCESS_INFO,
1382 REQ_GET_THREAD_INFO,
1383 REQ_SET_THREAD_INFO,
1384 REQ_SUSPEND_THREAD,
1385 REQ_RESUME_THREAD,
1386 REQ_LOAD_DLL,
1387 REQ_UNLOAD_DLL,
1388 REQ_QUEUE_APC,
1389 REQ_GET_APC,
1390 REQ_CLOSE_HANDLE,
1391 REQ_SET_HANDLE_INFO,
1392 REQ_DUP_HANDLE,
1393 REQ_OPEN_PROCESS,
1394 REQ_SELECT,
1395 REQ_CREATE_EVENT,
1396 REQ_EVENT_OP,
1397 REQ_OPEN_EVENT,
1398 REQ_CREATE_MUTEX,
1399 REQ_RELEASE_MUTEX,
1400 REQ_OPEN_MUTEX,
1401 REQ_CREATE_SEMAPHORE,
1402 REQ_RELEASE_SEMAPHORE,
1403 REQ_OPEN_SEMAPHORE,
1404 REQ_CREATE_FILE,
1405 REQ_ALLOC_FILE_HANDLE,
1406 REQ_GET_HANDLE_FD,
1407 REQ_SET_FILE_POINTER,
1408 REQ_TRUNCATE_FILE,
1409 REQ_SET_FILE_TIME,
1410 REQ_FLUSH_FILE,
1411 REQ_GET_FILE_INFO,
1412 REQ_LOCK_FILE,
1413 REQ_UNLOCK_FILE,
1414 REQ_CREATE_PIPE,
1415 REQ_CREATE_SOCKET,
1416 REQ_ACCEPT_SOCKET,
1417 REQ_SET_SOCKET_EVENT,
1418 REQ_GET_SOCKET_EVENT,
1419 REQ_ENABLE_SOCKET_EVENT,
1420 REQ_ALLOC_CONSOLE,
1421 REQ_FREE_CONSOLE,
1422 REQ_OPEN_CONSOLE,
1423 REQ_SET_CONSOLE_FD,
1424 REQ_GET_CONSOLE_MODE,
1425 REQ_SET_CONSOLE_MODE,
1426 REQ_SET_CONSOLE_INFO,
1427 REQ_GET_CONSOLE_INFO,
1428 REQ_WRITE_CONSOLE_INPUT,
1429 REQ_READ_CONSOLE_INPUT,
1430 REQ_CREATE_CHANGE_NOTIFICATION,
1431 REQ_CREATE_MAPPING,
1432 REQ_OPEN_MAPPING,
1433 REQ_GET_MAPPING_INFO,
1434 REQ_CREATE_DEVICE,
1435 REQ_CREATE_SNAPSHOT,
1436 REQ_NEXT_PROCESS,
1437 REQ_NEXT_THREAD,
1438 REQ_NEXT_MODULE,
1439 REQ_WAIT_DEBUG_EVENT,
1440 REQ_QUEUE_EXCEPTION_EVENT,
1441 REQ_GET_EXCEPTION_STATUS,
1442 REQ_OUTPUT_DEBUG_STRING,
1443 REQ_CONTINUE_DEBUG_EVENT,
1444 REQ_DEBUG_PROCESS,
1445 REQ_READ_PROCESS_MEMORY,
1446 REQ_WRITE_PROCESS_MEMORY,
1447 REQ_CREATE_KEY,
1448 REQ_OPEN_KEY,
1449 REQ_DELETE_KEY,
1450 REQ_ENUM_KEY,
1451 REQ_SET_KEY_VALUE,
1452 REQ_GET_KEY_VALUE,
1453 REQ_ENUM_KEY_VALUE,
1454 REQ_DELETE_KEY_VALUE,
1455 REQ_LOAD_REGISTRY,
1456 REQ_SAVE_REGISTRY,
1457 REQ_SAVE_REGISTRY_ATEXIT,
1458 REQ_SET_REGISTRY_LEVELS,
1459 REQ_CREATE_TIMER,
1460 REQ_OPEN_TIMER,
1461 REQ_SET_TIMER,
1462 REQ_CANCEL_TIMER,
1463 REQ_GET_THREAD_CONTEXT,
1464 REQ_SET_THREAD_CONTEXT,
1465 REQ_GET_SELECTOR_ENTRY,
1466 REQ_ADD_ATOM,
1467 REQ_DELETE_ATOM,
1468 REQ_FIND_ATOM,
1469 REQ_GET_ATOM_NAME,
1470 REQ_INIT_ATOM_TABLE,
1471 REQ_GET_MSG_QUEUE,
1472 REQ_WAKE_QUEUE,
1473 REQ_WAIT_INPUT_IDLE,
1474 REQ_CREATE_SERIAL,
1475 REQ_GET_SERIAL_INFO,
1476 REQ_SET_SERIAL_INFO,
1477 REQ_CREATE_ASYNC,
1478 REQ_ASYNC_RESULT,
1479 REQ_NB_REQUESTS
1482 union generic_request
1484 struct request_max_size max_size;
1485 struct request_header header;
1486 struct new_process_request new_process;
1487 struct get_new_process_info_request get_new_process_info;
1488 struct new_thread_request new_thread;
1489 struct boot_done_request boot_done;
1490 struct init_process_request init_process;
1491 struct init_process_done_request init_process_done;
1492 struct init_thread_request init_thread;
1493 struct get_thread_buffer_request get_thread_buffer;
1494 struct terminate_process_request terminate_process;
1495 struct terminate_thread_request terminate_thread;
1496 struct get_process_info_request get_process_info;
1497 struct set_process_info_request set_process_info;
1498 struct get_thread_info_request get_thread_info;
1499 struct set_thread_info_request set_thread_info;
1500 struct suspend_thread_request suspend_thread;
1501 struct resume_thread_request resume_thread;
1502 struct load_dll_request load_dll;
1503 struct unload_dll_request unload_dll;
1504 struct queue_apc_request queue_apc;
1505 struct get_apc_request get_apc;
1506 struct close_handle_request close_handle;
1507 struct set_handle_info_request set_handle_info;
1508 struct dup_handle_request dup_handle;
1509 struct open_process_request open_process;
1510 struct select_request select;
1511 struct create_event_request create_event;
1512 struct event_op_request event_op;
1513 struct open_event_request open_event;
1514 struct create_mutex_request create_mutex;
1515 struct release_mutex_request release_mutex;
1516 struct open_mutex_request open_mutex;
1517 struct create_semaphore_request create_semaphore;
1518 struct release_semaphore_request release_semaphore;
1519 struct open_semaphore_request open_semaphore;
1520 struct create_file_request create_file;
1521 struct alloc_file_handle_request alloc_file_handle;
1522 struct get_handle_fd_request get_handle_fd;
1523 struct set_file_pointer_request set_file_pointer;
1524 struct truncate_file_request truncate_file;
1525 struct set_file_time_request set_file_time;
1526 struct flush_file_request flush_file;
1527 struct get_file_info_request get_file_info;
1528 struct lock_file_request lock_file;
1529 struct unlock_file_request unlock_file;
1530 struct create_pipe_request create_pipe;
1531 struct create_socket_request create_socket;
1532 struct accept_socket_request accept_socket;
1533 struct set_socket_event_request set_socket_event;
1534 struct get_socket_event_request get_socket_event;
1535 struct enable_socket_event_request enable_socket_event;
1536 struct alloc_console_request alloc_console;
1537 struct free_console_request free_console;
1538 struct open_console_request open_console;
1539 struct set_console_fd_request set_console_fd;
1540 struct get_console_mode_request get_console_mode;
1541 struct set_console_mode_request set_console_mode;
1542 struct set_console_info_request set_console_info;
1543 struct get_console_info_request get_console_info;
1544 struct write_console_input_request write_console_input;
1545 struct read_console_input_request read_console_input;
1546 struct create_change_notification_request create_change_notification;
1547 struct create_mapping_request create_mapping;
1548 struct open_mapping_request open_mapping;
1549 struct get_mapping_info_request get_mapping_info;
1550 struct create_device_request create_device;
1551 struct create_snapshot_request create_snapshot;
1552 struct next_process_request next_process;
1553 struct next_thread_request next_thread;
1554 struct next_module_request next_module;
1555 struct wait_debug_event_request wait_debug_event;
1556 struct queue_exception_event_request queue_exception_event;
1557 struct get_exception_status_request get_exception_status;
1558 struct output_debug_string_request output_debug_string;
1559 struct continue_debug_event_request continue_debug_event;
1560 struct debug_process_request debug_process;
1561 struct read_process_memory_request read_process_memory;
1562 struct write_process_memory_request write_process_memory;
1563 struct create_key_request create_key;
1564 struct open_key_request open_key;
1565 struct delete_key_request delete_key;
1566 struct enum_key_request enum_key;
1567 struct set_key_value_request set_key_value;
1568 struct get_key_value_request get_key_value;
1569 struct enum_key_value_request enum_key_value;
1570 struct delete_key_value_request delete_key_value;
1571 struct load_registry_request load_registry;
1572 struct save_registry_request save_registry;
1573 struct save_registry_atexit_request save_registry_atexit;
1574 struct set_registry_levels_request set_registry_levels;
1575 struct create_timer_request create_timer;
1576 struct open_timer_request open_timer;
1577 struct set_timer_request set_timer;
1578 struct cancel_timer_request cancel_timer;
1579 struct get_thread_context_request get_thread_context;
1580 struct set_thread_context_request set_thread_context;
1581 struct get_selector_entry_request get_selector_entry;
1582 struct add_atom_request add_atom;
1583 struct delete_atom_request delete_atom;
1584 struct find_atom_request find_atom;
1585 struct get_atom_name_request get_atom_name;
1586 struct init_atom_table_request init_atom_table;
1587 struct get_msg_queue_request get_msg_queue;
1588 struct wake_queue_request wake_queue;
1589 struct wait_input_idle_request wait_input_idle;
1590 struct create_serial_request create_serial;
1591 struct get_serial_info_request get_serial_info;
1592 struct set_serial_info_request set_serial_info;
1593 struct create_async_request create_async;
1594 struct async_result_request async_result;
1597 #define SERVER_PROTOCOL_VERSION 37
1599 /* ### make_requests end ### */
1600 /* Everything above this line is generated automatically by tools/make_requests */
1602 #undef REQUEST_HEADER
1603 #undef VARARG
1605 /* format of the server buffer */
1606 struct server_buffer_info
1608 volatile unsigned int cur_req; /* offset of the current request */
1609 volatile unsigned int cur_pos; /* first available position in buffer */
1612 /* client-side functions */
1614 #ifndef __WINE_SERVER__
1616 #include "thread.h"
1617 #include "ntddk.h"
1618 #include "wine/exception.h"
1620 /* client communication functions */
1622 extern unsigned int wine_server_call( enum request req );
1623 extern unsigned int server_call_fd( enum request req, int fd_out );
1624 extern void server_protocol_error( const char *err, ... ) WINE_NORETURN;
1625 extern void *wine_server_alloc_req( size_t fixed_size, size_t var_size );
1626 extern int wine_server_recv_fd( int handle, int cache );
1627 extern const char *get_config_dir(void);
1629 /* compatibility macros */
1630 #define server_alloc_req(f,v) wine_server_alloc_req(f,v)
1631 #define server_call_noerr(req) wine_server_call(req)
1633 /* do a server call and set the last error code */
1634 inline static unsigned int server_call( enum request req )
1636 unsigned int res = wine_server_call( req );
1637 if (res) SetLastError( RtlNtStatusToDosError(res) );
1638 return res;
1641 /* get a pointer to the variable part of the request */
1642 inline static void *server_data_ptr( const void *req )
1644 return (union generic_request *)req + 1;
1647 /* get the size of the variable part of the request */
1648 inline static size_t server_data_size( const void *req )
1650 return ((struct request_header *)req)->var_size;
1654 /* exception support for server calls */
1656 extern DWORD __wine_server_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
1657 CONTEXT *context, EXCEPTION_FRAME **pdispatcher );
1659 struct __server_exception_frame
1661 EXCEPTION_FRAME frame;
1662 struct server_buffer_info info; /* saved buffer information */
1665 #define SERVER_START_REQ \
1666 do { \
1667 struct __server_exception_frame __f; \
1668 __f.frame.Handler = __wine_server_exception_handler; \
1669 __f.info = *NtCurrentTeb()->buffer_info; \
1670 __wine_push_frame( &__f.frame ); \
1671 do {
1673 #define SERVER_END_REQ \
1674 } while(0); \
1675 *NtCurrentTeb()->buffer_info = __f.info; \
1676 __wine_pop_frame( &__f.frame ); \
1677 } while(0);
1679 extern int CLIENT_InitServer(void);
1680 extern int CLIENT_BootDone( int debug_level );
1681 extern int CLIENT_IsBootThread(void);
1682 extern int CLIENT_InitThread(void);
1683 #endif /* __WINE_SERVER__ */
1685 #endif /* __WINE_SERVER_H */