Use "CALL" and "RET" in capital letters for distinction.
[wine.git] / include / server.h
blobeae797135eebc2a7cc4d21235b4c4fdd54f2b71c
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*/
27 /* a path name for server requests (Unicode) */
28 typedef WCHAR path_t[MAX_PATH+1];
31 /* definitions of the event data depending on the event code */
32 struct debug_event_exception
34 EXCEPTION_RECORD record; /* exception record */
35 int first; /* first chance exception? */
37 struct debug_event_create_thread
39 int handle; /* handle to the new thread */
40 void *teb; /* thread teb (in debugged process address space) */
41 void *start; /* thread startup routine */
43 struct debug_event_create_process
45 int file; /* handle to the process exe file */
46 int process; /* handle to the new process */
47 int thread; /* handle to the new thread */
48 void *base; /* base of executable image */
49 int dbg_offset; /* offset of debug info in file */
50 int dbg_size; /* size of debug info */
51 void *teb; /* thread teb (in debugged process address space) */
52 void *start; /* thread startup routine */
53 void *name; /* image name (optional) */
54 int unicode; /* is it Unicode? */
56 struct debug_event_exit
58 int exit_code; /* thread or process exit code */
60 struct debug_event_load_dll
62 int handle; /* file handle for the dll */
63 void *base; /* base address of the dll */
64 int dbg_offset; /* offset of debug info in file */
65 int dbg_size; /* size of debug info */
66 void *name; /* image name (optional) */
67 int unicode; /* is it Unicode? */
69 struct debug_event_unload_dll
71 void *base; /* base address of the dll */
73 struct debug_event_output_string
75 void *string; /* string to display (in debugged process address space) */
76 int unicode; /* is it Unicode? */
77 int length; /* string length */
79 struct debug_event_rip_info
81 int error; /* ??? */
82 int type; /* ??? */
84 union debug_event_data
86 struct debug_event_exception exception;
87 struct debug_event_create_thread create_thread;
88 struct debug_event_create_process create_process;
89 struct debug_event_exit exit;
90 struct debug_event_load_dll load_dll;
91 struct debug_event_unload_dll unload_dll;
92 struct debug_event_output_string output_string;
93 struct debug_event_rip_info rip_info;
96 /* debug event data */
97 typedef struct
99 int code; /* event code */
100 union debug_event_data info; /* event information */
101 } debug_event_t;
104 /* Create a new process from the context of the parent */
105 struct new_process_request
107 IN int inherit_all; /* inherit all handles from parent */
108 IN int create_flags; /* creation flags */
109 IN int start_flags; /* flags from startup info */
110 IN int exe_file; /* file handle for main exe */
111 IN int hstdin; /* handle for stdin */
112 IN int hstdout; /* handle for stdout */
113 IN int hstderr; /* handle for stderr */
114 IN int cmd_show; /* main window show mode */
115 IN int alloc_fd; /* create the fd pair right now? */
116 IN char filename[1]; /* file name of main exe */
120 /* Wait for the new process to start */
121 struct wait_process_request
123 IN int pinherit; /* process handle inherit flag */
124 IN int tinherit; /* thread handle inherit flag */
125 IN int timeout; /* wait timeout */
126 IN int cancel; /* cancel the process creation? */
127 OUT void* pid; /* process id */
128 OUT int phandle; /* process handle (in the current process) */
129 OUT void* tid; /* thread id */
130 OUT int thandle; /* thread handle (in the current process) */
131 OUT int event; /* event handle to signal startup */
135 /* Create a new thread from the context of the parent */
136 struct new_thread_request
138 IN int suspend; /* new thread should be suspended on creation */
139 IN int inherit; /* inherit flag */
140 OUT void* tid; /* thread id */
141 OUT int handle; /* thread handle (in the current process) */
145 /* Signal that we are finished booting on the client side */
146 struct boot_done_request
148 IN int debug_level; /* new debug level */
152 /* Initialize a process; called from the new process context */
153 struct init_process_request
155 IN void* ldt_copy; /* addr of LDT copy */
156 IN void* ldt_flags; /* addr of LDT flags */
157 IN int ppid; /* parent Unix pid */
158 OUT int start_flags; /* flags from startup info */
159 OUT int exe_file; /* file handle for main exe */
160 OUT int hstdin; /* handle for stdin */
161 OUT int hstdout; /* handle for stdout */
162 OUT int hstderr; /* handle for stderr */
163 OUT int cmd_show; /* main window show mode */
164 OUT char filename[1]; /* file name of main exe */
168 /* Signal the end of the process initialization */
169 struct init_process_done_request
171 IN void* module; /* main module base address */
172 IN void* entry; /* process entry point */
173 IN int gui; /* is it a GUI process? */
174 OUT int debugged; /* being debugged? */
178 /* Initialize a thread; called from the child after fork()/clone() */
179 struct init_thread_request
181 IN int unix_pid; /* Unix pid of new thread */
182 IN void* teb; /* TEB of new thread (in thread address space) */
183 IN void* entry; /* thread entry point (in thread address space) */
187 /* Retrieve the thread buffer file descriptor */
188 /* The reply to this request is the first thing a newly */
189 /* created thread gets (without having to request it) */
190 struct get_thread_buffer_request
192 OUT void* pid; /* process id of the new thread's process */
193 OUT void* tid; /* thread id of the new thread */
194 OUT int boot; /* is this the boot thread? */
195 OUT int version; /* protocol version */
199 /* Terminate a process */
200 struct terminate_process_request
202 IN int handle; /* process handle to terminate */
203 IN int exit_code; /* process exit code */
204 OUT int self; /* suicide? */
208 /* Terminate a thread */
209 struct terminate_thread_request
211 IN int handle; /* thread handle to terminate */
212 IN int exit_code; /* thread exit code */
213 OUT int self; /* suicide? */
214 OUT int last; /* last thread in this process? */
218 /* Retrieve information about a process */
219 struct get_process_info_request
221 IN int handle; /* process handle */
222 OUT void* pid; /* server process id */
223 OUT int debugged; /* debugged? */
224 OUT int exit_code; /* process exit code */
225 OUT int priority; /* priority class */
226 OUT int process_affinity; /* process affinity mask */
227 OUT int system_affinity; /* system affinity mask */
231 /* Set a process informations */
232 struct set_process_info_request
234 IN int handle; /* process handle */
235 IN int mask; /* setting mask (see below) */
236 IN int priority; /* priority class */
237 IN int affinity; /* affinity mask */
239 #define SET_PROCESS_INFO_PRIORITY 0x01
240 #define SET_PROCESS_INFO_AFFINITY 0x02
243 /* Retrieve information about a thread */
244 struct get_thread_info_request
246 IN int handle; /* thread handle */
247 IN void* tid_in; /* thread id (optional) */
248 OUT void* tid; /* server thread id */
249 OUT void* teb; /* thread teb pointer */
250 OUT int exit_code; /* thread exit code */
251 OUT int priority; /* thread priority level */
255 /* Set a thread informations */
256 struct set_thread_info_request
258 IN int handle; /* thread handle */
259 IN int mask; /* setting mask (see below) */
260 IN int priority; /* priority class */
261 IN int affinity; /* affinity mask */
263 #define SET_THREAD_INFO_PRIORITY 0x01
264 #define SET_THREAD_INFO_AFFINITY 0x02
267 /* Suspend a thread */
268 struct suspend_thread_request
270 IN int handle; /* thread handle */
271 OUT int count; /* new suspend count */
275 /* Resume a thread */
276 struct resume_thread_request
278 IN int handle; /* thread handle */
279 OUT int count; /* new suspend count */
283 /* Notify the server that a dll has been loaded */
284 struct load_dll_request
286 IN int handle; /* file handle */
287 IN void* base; /* base address */
288 IN int dbg_offset; /* debug info offset */
289 IN int dbg_size; /* debug info size */
290 IN void* name; /* ptr to ptr to name (in process addr space) */
294 /* Notify the server that a dll is being unloaded */
295 struct unload_dll_request
297 IN void* base; /* base address */
301 /* Queue an APC for a thread */
302 struct queue_apc_request
304 IN int handle; /* thread handle */
305 IN void* func; /* function to call */
306 IN void* param; /* param for function to call */
310 /* Get list of APC to call */
311 struct get_apcs_request
313 OUT int count; /* number of apcs */
314 OUT void* apcs[1]; /* async procedures to call */
318 /* Close a handle for the current process */
319 struct close_handle_request
321 IN int handle; /* handle to close */
325 /* Get information about a handle */
326 struct get_handle_info_request
328 IN int handle; /* handle we are interested in */
329 OUT int flags; /* handle flags */
333 /* Set a handle information */
334 struct set_handle_info_request
336 IN int handle; /* handle we are interested in */
337 IN int flags; /* new handle flags */
338 IN int mask; /* mask for flags to set */
342 /* Duplicate a handle */
343 struct dup_handle_request
345 IN int src_process; /* src process handle */
346 IN int src_handle; /* src handle to duplicate */
347 IN int dst_process; /* dst process handle */
348 IN unsigned int access; /* wanted access rights */
349 IN int inherit; /* inherit flag */
350 IN int options; /* duplicate options (see below) */
351 OUT int handle; /* duplicated handle in dst process */
353 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
354 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
355 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
358 /* Open a handle to a process */
359 struct open_process_request
361 IN void* pid; /* process id to open */
362 IN unsigned int access; /* wanted access rights */
363 IN int inherit; /* inherit flag */
364 OUT int handle; /* handle to the process */
368 /* Wait for handles */
369 struct select_request
371 IN int count; /* handles count */
372 IN int flags; /* wait flags (see below) */
373 IN int timeout; /* timeout in ms */
374 OUT int signaled; /* signaled handle */
375 IN int handles[1]; /* handles to select on */
377 #define SELECT_ALL 1
378 #define SELECT_ALERTABLE 2
379 #define SELECT_TIMEOUT 4
382 /* Create an event */
383 struct create_event_request
385 IN int manual_reset; /* manual reset event */
386 IN int initial_state; /* initial state of the event */
387 IN int inherit; /* inherit flag */
388 OUT int handle; /* handle to the event */
389 IN WCHAR name[1]; /* event name */
392 /* Event operation */
393 struct event_op_request
395 IN int handle; /* handle to event */
396 IN int op; /* event operation (see below) */
398 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
401 /* Open an event */
402 struct open_event_request
404 IN unsigned int access; /* wanted access rights */
405 IN int inherit; /* inherit flag */
406 OUT int handle; /* handle to the event */
407 IN WCHAR name[1]; /* object name */
411 /* Create a mutex */
412 struct create_mutex_request
414 IN int owned; /* initially owned? */
415 IN int inherit; /* inherit flag */
416 OUT int handle; /* handle to the mutex */
417 IN WCHAR name[1]; /* mutex name */
421 /* Release a mutex */
422 struct release_mutex_request
424 IN int handle; /* handle to the mutex */
428 /* Open a mutex */
429 struct open_mutex_request
431 IN unsigned int access; /* wanted access rights */
432 IN int inherit; /* inherit flag */
433 OUT int handle; /* handle to the mutex */
434 IN WCHAR name[1]; /* object name */
438 /* Create a semaphore */
439 struct create_semaphore_request
441 IN unsigned int initial; /* initial count */
442 IN unsigned int max; /* maximum count */
443 IN int inherit; /* inherit flag */
444 OUT int handle; /* handle to the semaphore */
445 IN WCHAR name[1]; /* semaphore name */
449 /* Release a semaphore */
450 struct release_semaphore_request
452 IN int handle; /* handle to the semaphore */
453 IN unsigned int count; /* count to add to semaphore */
454 OUT unsigned int prev_count; /* previous semaphore count */
458 /* Open a semaphore */
459 struct open_semaphore_request
461 IN unsigned int access; /* wanted access rights */
462 IN int inherit; /* inherit flag */
463 OUT int handle; /* handle to the semaphore */
464 IN WCHAR name[1]; /* object name */
468 /* Create a file */
469 struct create_file_request
471 IN unsigned int access; /* wanted access rights */
472 IN int inherit; /* inherit flag */
473 IN unsigned int sharing; /* sharing flags */
474 IN int create; /* file create action */
475 IN unsigned int attrs; /* file attributes for creation */
476 OUT int handle; /* handle to the file */
477 IN char name[1]; /* file name */
481 /* Allocate a file handle for a Unix fd */
482 struct alloc_file_handle_request
484 IN unsigned int access; /* wanted access rights */
485 OUT int handle; /* handle to the file */
489 /* Get a Unix fd to read from a file */
490 struct get_read_fd_request
492 IN int handle; /* handle to the file */
496 /* Get a Unix fd to write to a file */
497 struct get_write_fd_request
499 IN int handle; /* handle to the file */
503 /* Set a file current position */
504 struct set_file_pointer_request
506 IN int handle; /* handle to the file */
507 IN int low; /* position low word */
508 IN int high; /* position high word */
509 IN int whence; /* whence to seek */
510 OUT int new_low; /* new position low word */
511 OUT int new_high; /* new position high word */
515 /* Truncate (or extend) a file */
516 struct truncate_file_request
518 IN int handle; /* handle to the file */
522 /* Set a file access and modification times */
523 struct set_file_time_request
525 IN int handle; /* handle to the file */
526 IN time_t access_time; /* last access time */
527 IN time_t write_time; /* last write time */
531 /* Flush a file buffers */
532 struct flush_file_request
534 IN int handle; /* handle to the file */
538 /* Get information about a file */
539 struct get_file_info_request
541 IN int handle; /* handle to the file */
542 OUT int type; /* file type */
543 OUT int attr; /* file attributes */
544 OUT time_t access_time; /* last access time */
545 OUT time_t write_time; /* last write time */
546 OUT int size_high; /* file size */
547 OUT int size_low; /* file size */
548 OUT int links; /* number of links */
549 OUT int index_high; /* unique index */
550 OUT int index_low; /* unique index */
551 OUT unsigned int serial; /* volume serial number */
555 /* Lock a region of a file */
556 struct lock_file_request
558 IN int handle; /* handle to the file */
559 IN unsigned int offset_low; /* offset of start of lock */
560 IN unsigned int offset_high; /* offset of start of lock */
561 IN unsigned int count_low; /* count of bytes to lock */
562 IN unsigned int count_high; /* count of bytes to lock */
566 /* Unlock a region of a file */
567 struct unlock_file_request
569 IN int handle; /* handle to the file */
570 IN unsigned int offset_low; /* offset of start of unlock */
571 IN unsigned int offset_high; /* offset of start of unlock */
572 IN unsigned int count_low; /* count of bytes to unlock */
573 IN unsigned int count_high; /* count of bytes to unlock */
577 /* Create an anonymous pipe */
578 struct create_pipe_request
580 IN int inherit; /* inherit flag */
581 OUT int handle_read; /* handle to the read-side of the pipe */
582 OUT int handle_write; /* handle to the write-side of the pipe */
586 /* Create a socket */
587 struct create_socket_request
589 IN unsigned int access; /* wanted access rights */
590 IN int inherit; /* inherit flag */
591 IN int family; /* family, see socket manpage */
592 IN int type; /* type, see socket manpage */
593 IN int protocol; /* protocol, see socket manpage */
594 OUT int handle; /* handle to the new socket */
598 /* Accept a socket */
599 struct accept_socket_request
601 IN int lhandle; /* handle to the listening socket */
602 IN unsigned int access; /* wanted access rights */
603 IN int inherit; /* inherit flag */
604 OUT int handle; /* handle to the new socket */
608 /* Set socket event parameters */
609 struct set_socket_event_request
611 IN int handle; /* handle to the socket */
612 IN unsigned int mask; /* event mask */
613 IN int event; /* event object */
617 /* Get socket event parameters */
618 struct get_socket_event_request
620 IN int handle; /* handle to the socket */
621 IN int service; /* clear pending? */
622 IN int s_event; /* "expected" event object */
623 IN int c_event; /* event to clear */
624 OUT unsigned int mask; /* event mask */
625 OUT unsigned int pmask; /* pending events */
626 OUT unsigned int state; /* status bits */
627 OUT int errors[1]; /* event errors */
631 /* Reenable pending socket events */
632 struct enable_socket_event_request
634 IN int handle; /* handle to the socket */
635 IN unsigned int mask; /* events to re-enable */
636 IN unsigned int sstate; /* status bits to set */
637 IN unsigned int cstate; /* status bits to clear */
641 /* Allocate a console for the current process */
642 struct alloc_console_request
644 IN unsigned int access; /* wanted access rights */
645 IN int inherit; /* inherit flag */
646 OUT int handle_in; /* handle to console input */
647 OUT int handle_out; /* handle to console output */
651 /* Free the console of the current process */
652 struct free_console_request
654 IN int dummy;
658 /* Open a handle to the process console */
659 struct open_console_request
661 IN int output; /* input or output? */
662 IN unsigned int access; /* wanted access rights */
663 IN int inherit; /* inherit flag */
664 OUT int handle; /* handle to the console */
668 /* Set a console file descriptor */
669 struct set_console_fd_request
671 IN int handle; /* handle to the console */
672 IN int file_handle; /* handle of file to use as file descriptor */
673 IN int pid; /* pid of xterm (hack) */
677 /* Get a console mode (input or output) */
678 struct get_console_mode_request
680 IN int handle; /* handle to the console */
681 OUT int mode; /* console mode */
685 /* Set a console mode (input or output) */
686 struct set_console_mode_request
688 IN int handle; /* handle to the console */
689 IN int mode; /* console mode */
693 /* Set info about a console (output only) */
694 struct set_console_info_request
696 IN int handle; /* handle to the console */
697 IN int mask; /* setting mask (see below) */
698 IN int cursor_size; /* size of cursor (percentage filled) */
699 IN int cursor_visible;/* cursor visibility flag */
700 IN char title[1]; /* console title */
702 #define SET_CONSOLE_INFO_CURSOR 0x01
703 #define SET_CONSOLE_INFO_TITLE 0x02
705 /* Get info about a console (output only) */
706 struct get_console_info_request
708 IN int handle; /* handle to the console */
709 OUT int cursor_size; /* size of cursor (percentage filled) */
710 OUT int cursor_visible;/* cursor visibility flag */
711 OUT int pid; /* pid of xterm (hack) */
712 OUT char title[1]; /* console title */
716 /* Add input records to a console input queue */
717 struct write_console_input_request
719 IN int handle; /* handle to the console input */
720 IN int count; /* number of input records */
721 OUT int written; /* number of records written */
722 /* INPUT_RECORD records[0]; */ /* input records */
725 /* Fetch input records from a console input queue */
726 struct read_console_input_request
728 IN int handle; /* handle to the console input */
729 IN int count; /* max number of records to retrieve */
730 IN int flush; /* flush the retrieved records from the queue? */
731 OUT int read; /* number of records read */
732 /* INPUT_RECORD records[0]; */ /* input records */
736 /* Create a change notification */
737 struct create_change_notification_request
739 IN int subtree; /* watch all the subtree */
740 IN int filter; /* notification filter */
741 OUT int handle; /* handle to the change notification */
745 /* Create a file mapping */
746 struct create_mapping_request
748 IN int size_high; /* mapping size */
749 IN int size_low; /* mapping size */
750 IN int protect; /* protection flags (see below) */
751 IN int inherit; /* inherit flag */
752 IN int file_handle; /* file handle */
753 OUT int handle; /* handle to the mapping */
754 IN WCHAR name[1]; /* object name */
756 /* protection flags */
757 #define VPROT_READ 0x01
758 #define VPROT_WRITE 0x02
759 #define VPROT_EXEC 0x04
760 #define VPROT_WRITECOPY 0x08
761 #define VPROT_GUARD 0x10
762 #define VPROT_NOCACHE 0x20
763 #define VPROT_COMMITTED 0x40
766 /* Open a mapping */
767 struct open_mapping_request
769 IN unsigned int access; /* wanted access rights */
770 IN int inherit; /* inherit flag */
771 OUT int handle; /* handle to the mapping */
772 IN WCHAR name[1]; /* object name */
776 /* Get information about a file mapping */
777 struct get_mapping_info_request
779 IN int handle; /* handle to the mapping */
780 OUT int size_high; /* mapping size */
781 OUT int size_low; /* mapping size */
782 OUT int protect; /* protection flags */
786 /* Create a device */
787 struct create_device_request
789 IN unsigned int access; /* wanted access rights */
790 IN int inherit; /* inherit flag */
791 IN int id; /* client private id */
792 OUT int handle; /* handle to the device */
796 /* Create a snapshot */
797 struct create_snapshot_request
799 IN int inherit; /* inherit flag */
800 IN int flags; /* snapshot flags (TH32CS_*) */
801 IN void* pid; /* process id */
802 OUT int handle; /* handle to the snapshot */
806 /* Get the next process from a snapshot */
807 struct next_process_request
809 IN int handle; /* handle to the snapshot */
810 IN int reset; /* reset snapshot position? */
811 OUT int count; /* process usage count */
812 OUT void* pid; /* process id */
813 OUT int threads; /* number of threads */
814 OUT int priority; /* process priority */
818 /* Get the next thread from a snapshot */
819 struct next_thread_request
821 IN int handle; /* handle to the snapshot */
822 IN int reset; /* reset snapshot position? */
823 OUT int count; /* thread usage count */
824 OUT void* pid; /* process id */
825 OUT void* tid; /* thread id */
826 OUT int base_pri; /* base priority */
827 OUT int delta_pri; /* delta priority */
831 /* Get the next module from a snapshot */
832 struct next_module_request
834 IN int handle; /* handle to the snapshot */
835 IN int reset; /* reset snapshot position? */
836 OUT void* pid; /* process id */
837 OUT void* base; /* module base address */
841 /* Wait for a debug event */
842 struct wait_debug_event_request
844 IN int timeout; /* timeout in ms */
845 OUT void* pid; /* process id */
846 OUT void* tid; /* thread id */
847 OUT debug_event_t event; /* debug event data */
851 /* Send an exception event */
852 struct exception_event_request
854 IN EXCEPTION_RECORD record; /* exception record */
855 IN int first; /* first chance exception? */
856 IN CONTEXT context; /* thread context */
857 OUT int status; /* event continuation status */
861 /* Send an output string to the debugger */
862 struct output_debug_string_request
864 IN void* string; /* string to display (in debugged process address space) */
865 IN int unicode; /* is it Unicode? */
866 IN int length; /* string length */
870 /* Continue a debug event */
871 struct continue_debug_event_request
873 IN void* pid; /* process id to continue */
874 IN void* tid; /* thread id to continue */
875 IN int status; /* continuation status */
879 /* Start debugging an existing process */
880 struct debug_process_request
882 IN void* pid; /* id of the process to debug */
886 /* Read data from a process address space */
887 struct read_process_memory_request
889 IN int handle; /* process handle */
890 IN void* addr; /* addr to read from (must be int-aligned) */
891 IN int len; /* number of ints to read */
892 OUT unsigned int data[1]; /* result data */
896 /* Write data to a process address space */
897 struct write_process_memory_request
899 IN int handle; /* process handle */
900 IN void* addr; /* addr to write to (must be int-aligned) */
901 IN int len; /* number of ints to write */
902 IN unsigned int first_mask; /* mask for first word */
903 IN unsigned int last_mask; /* mask for last word */
904 IN unsigned int data[1]; /* data to write */
908 /* Create a registry key */
909 struct create_key_request
911 IN int parent; /* handle to the parent key */
912 IN unsigned int access; /* desired access rights */
913 IN unsigned int options; /* creation options */
914 IN time_t modif; /* last modification time */
915 OUT int hkey; /* handle to the created key */
916 OUT int created; /* has it been newly created? */
917 IN path_t name; /* key name */
918 IN WCHAR class[1]; /* class name */
922 /* Open a registry key */
923 struct open_key_request
925 IN int parent; /* handle to the parent key */
926 IN unsigned int access; /* desired access rights */
927 OUT int hkey; /* handle to the open key */
928 IN path_t name; /* key name */
932 /* Delete a registry key */
933 struct delete_key_request
935 IN int hkey; /* handle to the parent key */
936 IN path_t name; /* key name */
940 /* Close a registry key */
941 struct close_key_request
943 IN int hkey; /* key to close */
947 /* Enumerate registry subkeys */
948 struct enum_key_request
950 IN int hkey; /* handle to registry key */
951 IN int index; /* index of subkey */
952 OUT time_t modif; /* last modification time */
953 OUT path_t name; /* subkey name */
954 OUT WCHAR class[1]; /* class name */
958 /* Query information about a registry key */
959 struct query_key_info_request
961 IN int hkey; /* handle to registry key */
962 OUT int subkeys; /* number of subkeys */
963 OUT int max_subkey; /* longest subkey name */
964 OUT int max_class; /* longest class name */
965 OUT int values; /* number of values */
966 OUT int max_value; /* longest value name */
967 OUT int max_data; /* longest value data */
968 OUT time_t modif; /* last modification time */
969 OUT path_t name; /* key name */
970 OUT WCHAR class[1]; /* class name */
974 /* Set a value of a registry key */
975 struct set_key_value_request
977 IN int hkey; /* handle to registry key */
978 IN int type; /* value type */
979 IN unsigned int total; /* total value len */
980 IN unsigned int offset; /* offset for setting data */
981 IN unsigned int len; /* value data len */
982 IN path_t name; /* value name */
983 IN unsigned char data[1]; /* value data */
987 /* Retrieve the value of a registry key */
988 struct get_key_value_request
990 IN int hkey; /* handle to registry key */
991 IN unsigned int offset; /* offset for getting data */
992 OUT int type; /* value type */
993 OUT int len; /* value data len */
994 IN WCHAR name[1]; /* value name */
995 OUT unsigned char data[1]; /* value data */
999 /* Enumerate a value of a registry key */
1000 struct enum_key_value_request
1002 IN int hkey; /* handle to registry key */
1003 IN int index; /* value index */
1004 IN unsigned int offset; /* offset for getting data */
1005 OUT int type; /* value type */
1006 OUT int len; /* value data len */
1007 OUT path_t name; /* value name */
1008 OUT unsigned char data[1]; /* value data */
1012 /* Delete a value of a registry key */
1013 struct delete_key_value_request
1015 IN int hkey; /* handle to registry key */
1016 IN path_t name; /* value name */
1020 /* Load a registry branch from a file */
1021 struct load_registry_request
1023 IN int hkey; /* root key to load to */
1024 IN int file; /* file to load from */
1025 IN path_t name; /* subkey name */
1029 /* Save a registry branch to a file */
1030 struct save_registry_request
1032 IN int hkey; /* key to save */
1033 IN int file; /* file to save to */
1037 /* Save a registry branch at server exit */
1038 struct save_registry_atexit_request
1040 IN int hkey; /* key to save */
1041 IN char file[1]; /* file to save to */
1045 /* Set the current and saving level for the registry */
1046 struct set_registry_levels_request
1048 IN int current; /* new current level */
1049 IN int saving; /* new saving level */
1050 IN int period; /* duration between periodic saves (milliseconds) */
1054 /* Create a waitable timer */
1055 struct create_timer_request
1057 IN int inherit; /* inherit flag */
1058 IN int manual; /* manual reset */
1059 OUT int handle; /* handle to the timer */
1060 IN WCHAR name[1]; /* timer name */
1064 /* Open a waitable timer */
1065 struct open_timer_request
1067 IN unsigned int access; /* wanted access rights */
1068 IN int inherit; /* inherit flag */
1069 OUT int handle; /* handle to the timer */
1070 IN WCHAR name[1]; /* timer name */
1073 /* Set a waitable timer */
1074 struct set_timer_request
1076 IN int handle; /* handle to the timer */
1077 IN int sec; /* next expiration absolute time */
1078 IN int usec; /* next expiration absolute time */
1079 IN int period; /* timer period in ms */
1080 IN void* callback; /* callback function */
1081 IN void* arg; /* callback argument */
1084 /* Cancel a waitable timer */
1085 struct cancel_timer_request
1087 IN int handle; /* handle to the timer */
1091 /* Retrieve the current context of a thread */
1092 struct get_thread_context_request
1094 IN int handle; /* thread handle */
1095 IN unsigned int flags; /* context flags */
1096 OUT CONTEXT context; /* thread context */
1100 /* Set the current context of a thread */
1101 struct set_thread_context_request
1103 IN int handle; /* thread handle */
1104 IN unsigned int flags; /* context flags */
1105 IN CONTEXT context; /* thread context */
1109 /* Fetch a selector entry for a thread */
1110 struct get_selector_entry_request
1112 IN int handle; /* thread handle */
1113 IN int entry; /* LDT entry */
1114 OUT unsigned int base; /* selector base */
1115 OUT unsigned int limit; /* selector limit */
1116 OUT unsigned char flags; /* selector flags */
1120 /* Add an atom */
1121 struct add_atom_request
1123 IN int local; /* is atom in local process table? */
1124 OUT int atom; /* resulting atom */
1125 IN WCHAR name[1]; /* atom name */
1129 /* Delete an atom */
1130 struct delete_atom_request
1132 IN int atom; /* atom handle */
1133 IN int local; /* is atom in local process table? */
1137 /* Find an atom */
1138 struct find_atom_request
1140 IN int local; /* is atom in local process table? */
1141 OUT int atom; /* atom handle */
1142 IN WCHAR name[1]; /* atom name */
1146 /* Get an atom name */
1147 struct get_atom_name_request
1149 IN int atom; /* atom handle */
1150 IN int local; /* is atom in local process table? */
1151 OUT int count; /* atom lock count */
1152 OUT WCHAR name[1]; /* atom name */
1156 /* Init the process atom table */
1157 struct init_atom_table_request
1159 IN int entries; /* number of entries */
1163 /* Get the message queue of the current thread */
1164 struct get_msg_queue_request
1166 OUT int handle; /* handle to the queue */
1169 /* Wake up a message queue */
1170 struct wake_queue_request
1172 IN int handle; /* handle to the queue */
1173 IN unsigned int bits; /* wake bits */
1176 /* Wait for a process to start waiting on input */
1177 struct wait_input_idle_request
1179 IN int handle; /* process handle */
1180 IN int timeout; /* timeout */
1181 OUT int event; /* handle to idle event */
1185 /* Everything below this line is generated automatically by tools/make_requests */
1186 /* ### make_requests begin ### */
1188 enum request
1190 REQ_NEW_PROCESS,
1191 REQ_WAIT_PROCESS,
1192 REQ_NEW_THREAD,
1193 REQ_BOOT_DONE,
1194 REQ_INIT_PROCESS,
1195 REQ_INIT_PROCESS_DONE,
1196 REQ_INIT_THREAD,
1197 REQ_GET_THREAD_BUFFER,
1198 REQ_TERMINATE_PROCESS,
1199 REQ_TERMINATE_THREAD,
1200 REQ_GET_PROCESS_INFO,
1201 REQ_SET_PROCESS_INFO,
1202 REQ_GET_THREAD_INFO,
1203 REQ_SET_THREAD_INFO,
1204 REQ_SUSPEND_THREAD,
1205 REQ_RESUME_THREAD,
1206 REQ_LOAD_DLL,
1207 REQ_UNLOAD_DLL,
1208 REQ_QUEUE_APC,
1209 REQ_GET_APCS,
1210 REQ_CLOSE_HANDLE,
1211 REQ_GET_HANDLE_INFO,
1212 REQ_SET_HANDLE_INFO,
1213 REQ_DUP_HANDLE,
1214 REQ_OPEN_PROCESS,
1215 REQ_SELECT,
1216 REQ_CREATE_EVENT,
1217 REQ_EVENT_OP,
1218 REQ_OPEN_EVENT,
1219 REQ_CREATE_MUTEX,
1220 REQ_RELEASE_MUTEX,
1221 REQ_OPEN_MUTEX,
1222 REQ_CREATE_SEMAPHORE,
1223 REQ_RELEASE_SEMAPHORE,
1224 REQ_OPEN_SEMAPHORE,
1225 REQ_CREATE_FILE,
1226 REQ_ALLOC_FILE_HANDLE,
1227 REQ_GET_READ_FD,
1228 REQ_GET_WRITE_FD,
1229 REQ_SET_FILE_POINTER,
1230 REQ_TRUNCATE_FILE,
1231 REQ_SET_FILE_TIME,
1232 REQ_FLUSH_FILE,
1233 REQ_GET_FILE_INFO,
1234 REQ_LOCK_FILE,
1235 REQ_UNLOCK_FILE,
1236 REQ_CREATE_PIPE,
1237 REQ_CREATE_SOCKET,
1238 REQ_ACCEPT_SOCKET,
1239 REQ_SET_SOCKET_EVENT,
1240 REQ_GET_SOCKET_EVENT,
1241 REQ_ENABLE_SOCKET_EVENT,
1242 REQ_ALLOC_CONSOLE,
1243 REQ_FREE_CONSOLE,
1244 REQ_OPEN_CONSOLE,
1245 REQ_SET_CONSOLE_FD,
1246 REQ_GET_CONSOLE_MODE,
1247 REQ_SET_CONSOLE_MODE,
1248 REQ_SET_CONSOLE_INFO,
1249 REQ_GET_CONSOLE_INFO,
1250 REQ_WRITE_CONSOLE_INPUT,
1251 REQ_READ_CONSOLE_INPUT,
1252 REQ_CREATE_CHANGE_NOTIFICATION,
1253 REQ_CREATE_MAPPING,
1254 REQ_OPEN_MAPPING,
1255 REQ_GET_MAPPING_INFO,
1256 REQ_CREATE_DEVICE,
1257 REQ_CREATE_SNAPSHOT,
1258 REQ_NEXT_PROCESS,
1259 REQ_NEXT_THREAD,
1260 REQ_NEXT_MODULE,
1261 REQ_WAIT_DEBUG_EVENT,
1262 REQ_EXCEPTION_EVENT,
1263 REQ_OUTPUT_DEBUG_STRING,
1264 REQ_CONTINUE_DEBUG_EVENT,
1265 REQ_DEBUG_PROCESS,
1266 REQ_READ_PROCESS_MEMORY,
1267 REQ_WRITE_PROCESS_MEMORY,
1268 REQ_CREATE_KEY,
1269 REQ_OPEN_KEY,
1270 REQ_DELETE_KEY,
1271 REQ_CLOSE_KEY,
1272 REQ_ENUM_KEY,
1273 REQ_QUERY_KEY_INFO,
1274 REQ_SET_KEY_VALUE,
1275 REQ_GET_KEY_VALUE,
1276 REQ_ENUM_KEY_VALUE,
1277 REQ_DELETE_KEY_VALUE,
1278 REQ_LOAD_REGISTRY,
1279 REQ_SAVE_REGISTRY,
1280 REQ_SAVE_REGISTRY_ATEXIT,
1281 REQ_SET_REGISTRY_LEVELS,
1282 REQ_CREATE_TIMER,
1283 REQ_OPEN_TIMER,
1284 REQ_SET_TIMER,
1285 REQ_CANCEL_TIMER,
1286 REQ_GET_THREAD_CONTEXT,
1287 REQ_SET_THREAD_CONTEXT,
1288 REQ_GET_SELECTOR_ENTRY,
1289 REQ_ADD_ATOM,
1290 REQ_DELETE_ATOM,
1291 REQ_FIND_ATOM,
1292 REQ_GET_ATOM_NAME,
1293 REQ_INIT_ATOM_TABLE,
1294 REQ_GET_MSG_QUEUE,
1295 REQ_WAKE_QUEUE,
1296 REQ_WAIT_INPUT_IDLE,
1297 REQ_NB_REQUESTS
1300 #define SERVER_PROTOCOL_VERSION 14
1302 /* ### make_requests end ### */
1303 /* Everything above this line is generated automatically by tools/make_requests */
1306 /* client-side functions */
1308 #ifndef __WINE_SERVER__
1310 #include "thread.h"
1311 #include "ntddk.h"
1313 /* client communication functions */
1315 extern unsigned int server_call_noerr( enum request req );
1316 extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
1317 extern void server_protocol_error( const char *err, ... ) WINE_NORETURN;
1318 extern const char *get_config_dir(void);
1320 /* get a pointer to the request buffer */
1321 static inline void * WINE_UNUSED get_req_buffer(void)
1323 return NtCurrentTeb()->buffer;
1326 /* maximum remaining size in the server buffer */
1327 static inline int WINE_UNUSED server_remaining( const void *ptr )
1329 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
1332 /* do a server call and set the last error code */
1333 static inline int server_call( enum request req )
1335 unsigned int res = server_call_noerr( req );
1336 if (res) SetLastError( RtlNtStatusToDosError(res) );
1337 return res;
1340 /* copy a Unicode string to the server buffer */
1341 static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1343 if (src)
1345 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1346 while ((dst < end) && *src) *dst++ = *src++;
1348 *dst = 0;
1351 /* copy and convert an ASCII string to the server buffer */
1352 static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1354 if (src)
1356 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1357 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1359 *dst = 0;
1362 extern int CLIENT_InitServer(void);
1363 extern int CLIENT_BootDone( int debug_level );
1364 extern int CLIENT_IsBootThread(void);
1365 extern int CLIENT_InitThread(void);
1366 #endif /* __WINE_SERVER__ */
1368 #endif /* __WINE_SERVER_H */