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*/
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 int code; /* exception code */
35 int flags; /* exception flags */
36 void *record; /* exception record ptr */
37 void *addr; /* exception address */
38 int nb_params; /* exceptions parameters */
40 int first_chance; /* first chance to handle it? */
41 CONTEXT context; /* thread context */
43 struct debug_event_create_thread
45 int handle; /* handle to the new thread */
46 void *teb; /* thread teb (in debugged process address space) */
47 void *start; /* thread startup routine */
49 struct debug_event_create_process
51 int file; /* handle to the process exe file */
52 int process; /* handle to the new process */
53 int thread; /* handle to the new thread */
54 void *base; /* base of executable image */
55 int dbg_offset; /* offset of debug info in file */
56 int dbg_size; /* size of debug info */
57 void *teb; /* thread teb (in debugged process address space) */
58 void *start; /* thread startup routine */
59 void *name; /* image name (optional) */
60 int unicode; /* is it Unicode? */
62 struct debug_event_exit
64 int exit_code; /* thread or process exit code */
66 struct debug_event_load_dll
68 int handle; /* file handle for the dll */
69 void *base; /* base address of the dll */
70 int dbg_offset; /* offset of debug info in file */
71 int dbg_size; /* size of debug info */
72 void *name; /* image name (optional) */
73 int unicode; /* is it Unicode? */
75 struct debug_event_unload_dll
77 void *base; /* base address of the dll */
79 struct debug_event_output_string
81 void *string; /* string to display (in debugged process address space) */
82 int unicode; /* is it Unicode? */
83 int length; /* string length */
85 struct debug_event_rip_info
90 union debug_event_data
92 struct debug_event_exception exception;
93 struct debug_event_create_thread create_thread;
94 struct debug_event_create_process create_process;
95 struct debug_event_exit exit;
96 struct debug_event_load_dll load_dll;
97 struct debug_event_unload_dll unload_dll;
98 struct debug_event_output_string output_string;
99 struct debug_event_rip_info rip_info;
102 /* debug event data */
105 int code; /* event code */
106 union debug_event_data info; /* event information */
110 /* Create a new process from the context of the parent */
111 struct new_process_request
113 IN int inherit; /* inherit flag */
114 IN int inherit_all; /* inherit all handles from parent */
115 IN int create_flags; /* creation flags */
116 IN int start_flags; /* flags from startup info */
117 IN int exe_file; /* file handle for main exe */
118 IN int hstdin; /* handle for stdin */
119 IN int hstdout; /* handle for stdout */
120 IN int hstderr; /* handle for stderr */
121 IN int event; /* event to signal startup */
122 IN int cmd_show; /* main window show mode */
123 IN void* env_ptr; /* pointer to environment (FIXME: hack) */
124 OUT void* pid; /* process id */
125 OUT int phandle; /* process handle (in the current process) */
126 OUT void* tid; /* thread id */
127 OUT int thandle; /* thread handle (in the current process) */
128 IN char cmdline[1]; /* command line */
132 /* Create a new thread from the context of the parent */
133 struct new_thread_request
135 IN int suspend; /* new thread should be suspended on creation */
136 IN int inherit; /* inherit flag */
137 OUT void* tid; /* thread id */
138 OUT int handle; /* thread handle (in the current process) */
142 /* Signal that we are finished booting on the client side */
143 struct boot_done_request
145 IN int debug_level; /* new debug level */
149 /* Initialize a process; called from the new process context */
150 struct init_process_request
152 IN void* ldt_copy; /* addr of LDT copy */
153 IN void* ldt_flags; /* addr of LDT flags */
154 OUT int start_flags; /* flags from startup info */
155 OUT int exe_file; /* file handle for main exe */
156 OUT int hstdin; /* handle for stdin */
157 OUT int hstdout; /* handle for stdout */
158 OUT int hstderr; /* handle for stderr */
159 OUT int cmd_show; /* main window show mode */
160 OUT void* env_ptr; /* pointer to environment (FIXME: hack) */
161 OUT char cmdline[1]; /* command line */
165 /* Signal the end of the process initialization */
166 struct init_process_done_request
168 IN void* module; /* main module base address */
169 IN void* entry; /* process entry point */
170 OUT int debugged; /* being debugged? */
174 /* Initialize a thread; called from the child after fork()/clone() */
175 struct init_thread_request
177 IN int unix_pid; /* Unix pid of new thread */
178 IN void* teb; /* TEB of new thread (in thread address space) */
179 IN void* entry; /* thread entry point (in thread address space) */
183 /* Retrieve the thread buffer file descriptor */
184 /* The reply to this request is the first thing a newly */
185 /* created thread gets (without having to request it) */
186 struct get_thread_buffer_request
188 OUT void* pid; /* process id of the new thread's process */
189 OUT void* tid; /* thread id of the new thread */
190 OUT int boot; /* is this the boot thread? */
194 /* Terminate a process */
195 struct terminate_process_request
197 IN int handle; /* process handle to terminate */
198 IN int exit_code; /* process exit code */
202 /* Terminate a thread */
203 struct terminate_thread_request
205 IN int handle; /* thread handle to terminate */
206 IN int exit_code; /* thread exit code */
210 /* Retrieve information about a process */
211 struct get_process_info_request
213 IN int handle; /* process handle */
214 OUT void* pid; /* server process id */
215 OUT int debugged; /* debugged? */
216 OUT int exit_code; /* process exit code */
217 OUT int priority; /* priority class */
218 OUT int process_affinity; /* process affinity mask */
219 OUT int system_affinity; /* system affinity mask */
223 /* Set a process informations */
224 struct set_process_info_request
226 IN int handle; /* process handle */
227 IN int mask; /* setting mask (see below) */
228 IN int priority; /* priority class */
229 IN int affinity; /* affinity mask */
231 #define SET_PROCESS_INFO_PRIORITY 0x01
232 #define SET_PROCESS_INFO_AFFINITY 0x02
235 /* Retrieve information about a thread */
236 struct get_thread_info_request
238 IN int handle; /* thread handle */
239 OUT void* tid; /* server thread id */
240 OUT int exit_code; /* thread exit code */
241 OUT int priority; /* thread priority level */
245 /* Set a thread informations */
246 struct set_thread_info_request
248 IN int handle; /* thread handle */
249 IN int mask; /* setting mask (see below) */
250 IN int priority; /* priority class */
251 IN int affinity; /* affinity mask */
253 #define SET_THREAD_INFO_PRIORITY 0x01
254 #define SET_THREAD_INFO_AFFINITY 0x02
257 /* Suspend a thread */
258 struct suspend_thread_request
260 IN int handle; /* thread handle */
261 OUT int count; /* new suspend count */
265 /* Resume a thread */
266 struct resume_thread_request
268 IN int handle; /* thread handle */
269 OUT int count; /* new suspend count */
273 /* Debugger support: freeze / unfreeze */
274 struct debugger_request
276 IN int op; /* operation type */
279 enum debugger_op { DEBUGGER_FREEZE_ALL, DEBUGGER_UNFREEZE_ALL };
282 /* Queue an APC for a thread */
283 struct queue_apc_request
285 IN int handle; /* thread handle */
286 IN void* func; /* function to call */
287 IN void* param; /* param for function to call */
291 /* Get list of APC to call */
292 struct get_apcs_request
294 OUT int count; /* number of apcs */
295 OUT void* apcs[1]; /* async procedures to call */
299 /* Close a handle for the current process */
300 struct close_handle_request
302 IN int handle; /* handle to close */
306 /* Get information about a handle */
307 struct get_handle_info_request
309 IN int handle; /* handle we are interested in */
310 OUT int flags; /* handle flags */
314 /* Set a handle information */
315 struct set_handle_info_request
317 IN int handle; /* handle we are interested in */
318 IN int flags; /* new handle flags */
319 IN int mask; /* mask for flags to set */
323 /* Duplicate a handle */
324 struct dup_handle_request
326 IN int src_process; /* src process handle */
327 IN int src_handle; /* src handle to duplicate */
328 IN int dst_process; /* dst process handle */
329 IN unsigned int access; /* wanted access rights */
330 IN int inherit; /* inherit flag */
331 IN int options; /* duplicate options (see below) */
332 OUT int handle; /* duplicated handle in dst process */
334 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
335 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
336 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
339 /* Open a handle to a process */
340 struct open_process_request
342 IN void* pid; /* process id to open */
343 IN unsigned int access; /* wanted access rights */
344 IN int inherit; /* inherit flag */
345 OUT int handle; /* handle to the process */
349 /* Wait for handles */
350 struct select_request
352 IN int count; /* handles count */
353 IN int flags; /* wait flags (see below) */
354 IN int timeout; /* timeout in ms */
355 OUT int signaled; /* signaled handle */
356 IN int handles[1]; /* handles to select on */
359 #define SELECT_ALERTABLE 2
360 #define SELECT_TIMEOUT 4
363 /* Create an event */
364 struct create_event_request
366 IN int manual_reset; /* manual reset event */
367 IN int initial_state; /* initial state of the event */
368 IN int inherit; /* inherit flag */
369 OUT int handle; /* handle to the event */
370 IN WCHAR name[1]; /* event name */
373 /* Event operation */
374 struct event_op_request
376 IN int handle; /* handle to event */
377 IN int op; /* event operation (see below) */
379 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
383 struct open_event_request
385 IN unsigned int access; /* wanted access rights */
386 IN int inherit; /* inherit flag */
387 OUT int handle; /* handle to the event */
388 IN WCHAR name[1]; /* object name */
393 struct create_mutex_request
395 IN int owned; /* initially owned? */
396 IN int inherit; /* inherit flag */
397 OUT int handle; /* handle to the mutex */
398 IN WCHAR name[1]; /* mutex name */
402 /* Release a mutex */
403 struct release_mutex_request
405 IN int handle; /* handle to the mutex */
410 struct open_mutex_request
412 IN unsigned int access; /* wanted access rights */
413 IN int inherit; /* inherit flag */
414 OUT int handle; /* handle to the mutex */
415 IN WCHAR name[1]; /* object name */
419 /* Create a semaphore */
420 struct create_semaphore_request
422 IN unsigned int initial; /* initial count */
423 IN unsigned int max; /* maximum count */
424 IN int inherit; /* inherit flag */
425 OUT int handle; /* handle to the semaphore */
426 IN WCHAR name[1]; /* semaphore name */
430 /* Release a semaphore */
431 struct release_semaphore_request
433 IN int handle; /* handle to the semaphore */
434 IN unsigned int count; /* count to add to semaphore */
435 OUT unsigned int prev_count; /* previous semaphore count */
439 /* Open a semaphore */
440 struct open_semaphore_request
442 IN unsigned int access; /* wanted access rights */
443 IN int inherit; /* inherit flag */
444 OUT int handle; /* handle to the semaphore */
445 IN WCHAR name[1]; /* object name */
450 struct create_file_request
452 IN unsigned int access; /* wanted access rights */
453 IN int inherit; /* inherit flag */
454 IN unsigned int sharing; /* sharing flags */
455 IN int create; /* file create action */
456 IN unsigned int attrs; /* file attributes for creation */
457 OUT int handle; /* handle to the file */
458 IN char name[1]; /* file name */
462 /* Allocate a file handle for a Unix fd */
463 struct alloc_file_handle_request
465 IN unsigned int access; /* wanted access rights */
466 OUT int handle; /* handle to the file */
470 /* Get a Unix fd to read from a file */
471 struct get_read_fd_request
473 IN int handle; /* handle to the file */
477 /* Get a Unix fd to write to a file */
478 struct get_write_fd_request
480 IN int handle; /* handle to the file */
484 /* Set a file current position */
485 struct set_file_pointer_request
487 IN int handle; /* handle to the file */
488 IN int low; /* position low word */
489 IN int high; /* position high word */
490 IN int whence; /* whence to seek */
491 OUT int new_low; /* new position low word */
492 OUT int new_high; /* new position high word */
496 /* Truncate (or extend) a file */
497 struct truncate_file_request
499 IN int handle; /* handle to the file */
503 /* Set a file access and modification times */
504 struct set_file_time_request
506 IN int handle; /* handle to the file */
507 IN time_t access_time; /* last access time */
508 IN time_t write_time; /* last write time */
512 /* Flush a file buffers */
513 struct flush_file_request
515 IN int handle; /* handle to the file */
519 /* Get information about a file */
520 struct get_file_info_request
522 IN int handle; /* handle to the file */
523 OUT int type; /* file type */
524 OUT int attr; /* file attributes */
525 OUT time_t access_time; /* last access time */
526 OUT time_t write_time; /* last write time */
527 OUT int size_high; /* file size */
528 OUT int size_low; /* file size */
529 OUT int links; /* number of links */
530 OUT int index_high; /* unique index */
531 OUT int index_low; /* unique index */
532 OUT unsigned int serial; /* volume serial number */
536 /* Lock a region of a file */
537 struct lock_file_request
539 IN int handle; /* handle to the file */
540 IN unsigned int offset_low; /* offset of start of lock */
541 IN unsigned int offset_high; /* offset of start of lock */
542 IN unsigned int count_low; /* count of bytes to lock */
543 IN unsigned int count_high; /* count of bytes to lock */
547 /* Unlock a region of a file */
548 struct unlock_file_request
550 IN int handle; /* handle to the file */
551 IN unsigned int offset_low; /* offset of start of unlock */
552 IN unsigned int offset_high; /* offset of start of unlock */
553 IN unsigned int count_low; /* count of bytes to unlock */
554 IN unsigned int count_high; /* count of bytes to unlock */
558 /* Create an anonymous pipe */
559 struct create_pipe_request
561 IN int inherit; /* inherit flag */
562 OUT int handle_read; /* handle to the read-side of the pipe */
563 OUT int handle_write; /* handle to the write-side of the pipe */
567 /* Create a socket */
568 struct create_socket_request
570 IN unsigned int access; /* wanted access rights */
571 IN int inherit; /* inherit flag */
572 IN int family; /* family, see socket manpage */
573 IN int type; /* type, see socket manpage */
574 IN int protocol; /* protocol, see socket manpage */
575 OUT int handle; /* handle to the new socket */
579 /* Accept a socket */
580 struct accept_socket_request
582 IN int lhandle; /* handle to the listening socket */
583 IN unsigned int access; /* wanted access rights */
584 IN int inherit; /* inherit flag */
585 OUT int handle; /* handle to the new socket */
589 /* Set socket event parameters */
590 struct set_socket_event_request
592 IN int handle; /* handle to the socket */
593 IN unsigned int mask; /* event mask */
594 IN int event; /* event object */
598 /* Get socket event parameters */
599 struct get_socket_event_request
601 IN int handle; /* handle to the socket */
602 IN int service; /* clear pending? */
603 IN int s_event; /* "expected" event object */
604 OUT unsigned int mask; /* event mask */
605 OUT unsigned int pmask; /* pending events */
606 OUT unsigned int state; /* status bits */
607 OUT int errors[1]; /* event errors */
611 /* Reenable pending socket events */
612 struct enable_socket_event_request
614 IN int handle; /* handle to the socket */
615 IN unsigned int mask; /* events to re-enable */
616 IN unsigned int sstate; /* status bits to set */
617 IN unsigned int cstate; /* status bits to clear */
621 /* Allocate a console for the current process */
622 struct alloc_console_request
624 IN unsigned int access; /* wanted access rights */
625 IN int inherit; /* inherit flag */
626 OUT int handle_in; /* handle to console input */
627 OUT int handle_out; /* handle to console output */
631 /* Free the console of the current process */
632 struct free_console_request
638 /* Open a handle to the process console */
639 struct open_console_request
641 IN int output; /* input or output? */
642 IN unsigned int access; /* wanted access rights */
643 IN int inherit; /* inherit flag */
644 OUT int handle; /* handle to the console */
648 /* Set a console file descriptor */
649 struct set_console_fd_request
651 IN int handle; /* handle to the console */
652 IN int file_handle; /* handle of file to use as file descriptor */
653 IN int pid; /* pid of xterm (hack) */
657 /* Get a console mode (input or output) */
658 struct get_console_mode_request
660 IN int handle; /* handle to the console */
661 OUT int mode; /* console mode */
665 /* Set a console mode (input or output) */
666 struct set_console_mode_request
668 IN int handle; /* handle to the console */
669 IN int mode; /* console mode */
673 /* Set info about a console (output only) */
674 struct set_console_info_request
676 IN int handle; /* handle to the console */
677 IN int mask; /* setting mask (see below) */
678 IN int cursor_size; /* size of cursor (percentage filled) */
679 IN int cursor_visible;/* cursor visibility flag */
680 IN char title[1]; /* console title */
682 #define SET_CONSOLE_INFO_CURSOR 0x01
683 #define SET_CONSOLE_INFO_TITLE 0x02
685 /* Get info about a console (output only) */
686 struct get_console_info_request
688 IN int handle; /* handle to the console */
689 OUT int cursor_size; /* size of cursor (percentage filled) */
690 OUT int cursor_visible;/* cursor visibility flag */
691 OUT int pid; /* pid of xterm (hack) */
692 OUT char title[1]; /* console title */
696 /* Add input records to a console input queue */
697 struct write_console_input_request
699 IN int handle; /* handle to the console input */
700 IN int count; /* number of input records */
701 OUT int written; /* number of records written */
702 /* INPUT_RECORD records[0]; */ /* input records */
705 /* Fetch input records from a console input queue */
706 struct read_console_input_request
708 IN int handle; /* handle to the console input */
709 IN int count; /* max number of records to retrieve */
710 IN int flush; /* flush the retrieved records from the queue? */
711 OUT int read; /* number of records read */
712 /* INPUT_RECORD records[0]; */ /* input records */
716 /* Create a change notification */
717 struct create_change_notification_request
719 IN int subtree; /* watch all the subtree */
720 IN int filter; /* notification filter */
721 OUT int handle; /* handle to the change notification */
725 /* Create a file mapping */
726 struct create_mapping_request
728 IN int size_high; /* mapping size */
729 IN int size_low; /* mapping size */
730 IN int protect; /* protection flags (see below) */
731 IN int inherit; /* inherit flag */
732 IN int file_handle; /* file handle */
733 OUT int handle; /* handle to the mapping */
734 IN WCHAR name[1]; /* object name */
736 /* protection flags */
737 #define VPROT_READ 0x01
738 #define VPROT_WRITE 0x02
739 #define VPROT_EXEC 0x04
740 #define VPROT_WRITECOPY 0x08
741 #define VPROT_GUARD 0x10
742 #define VPROT_NOCACHE 0x20
743 #define VPROT_COMMITTED 0x40
747 struct open_mapping_request
749 IN unsigned int access; /* wanted access rights */
750 IN int inherit; /* inherit flag */
751 OUT int handle; /* handle to the mapping */
752 IN WCHAR name[1]; /* object name */
756 /* Get information about a file mapping */
757 struct get_mapping_info_request
759 IN int handle; /* handle to the mapping */
760 OUT int size_high; /* mapping size */
761 OUT int size_low; /* mapping size */
762 OUT int protect; /* protection flags */
766 /* Create a device */
767 struct create_device_request
769 IN unsigned int access; /* wanted access rights */
770 IN int inherit; /* inherit flag */
771 IN int id; /* client private id */
772 OUT int handle; /* handle to the device */
776 /* Create a snapshot */
777 struct create_snapshot_request
779 IN int inherit; /* inherit flag */
780 IN int flags; /* snapshot flags (TH32CS_*) */
781 OUT int handle; /* handle to the snapshot */
785 /* Get the next process from a snapshot */
786 struct next_process_request
788 IN int handle; /* handle to the snapshot */
789 IN int reset; /* reset snapshot position? */
790 OUT void* pid; /* process id */
791 OUT int threads; /* number of threads */
792 OUT int priority; /* process priority */
796 /* Wait for a debug event */
797 struct wait_debug_event_request
799 IN int timeout; /* timeout in ms */
800 OUT void* pid; /* process id */
801 OUT void* tid; /* thread id */
802 OUT debug_event_t event; /* debug event data */
806 /* Send a debug event */
807 struct send_debug_event_request
809 OUT int status; /* event continuation status */
810 IN debug_event_t event; /* debug event data */
814 /* Continue a debug event */
815 struct continue_debug_event_request
817 IN void* pid; /* process id to continue */
818 IN void* tid; /* thread id to continue */
819 IN int status; /* continuation status */
823 /* Start debugging an existing process */
824 struct debug_process_request
826 IN void* pid; /* id of the process to debug */
830 /* Read data from a process address space */
831 struct read_process_memory_request
833 IN int handle; /* process handle */
834 IN void* addr; /* addr to read from (must be int-aligned) */
835 IN int len; /* number of ints to read */
836 OUT unsigned int data[1]; /* result data */
840 /* Write data to a process address space */
841 struct write_process_memory_request
843 IN int handle; /* process handle */
844 IN void* addr; /* addr to write to (must be int-aligned) */
845 IN int len; /* number of ints to write */
846 IN unsigned int first_mask; /* mask for first word */
847 IN unsigned int last_mask; /* mask for last word */
848 IN unsigned int data[1]; /* data to write */
852 /* Create a registry key */
853 struct create_key_request
855 IN int parent; /* handle to the parent key */
856 IN unsigned int access; /* desired access rights */
857 IN unsigned int options; /* creation options */
858 IN time_t modif; /* last modification time */
859 OUT int hkey; /* handle to the created key */
860 OUT int created; /* has it been newly created? */
861 IN path_t name; /* key name */
862 IN WCHAR class[1]; /* class name */
866 /* Open a registry key */
867 struct open_key_request
869 IN int parent; /* handle to the parent key */
870 IN unsigned int access; /* desired access rights */
871 OUT int hkey; /* handle to the open key */
872 IN path_t name; /* key name */
876 /* Delete a registry key */
877 struct delete_key_request
879 IN int hkey; /* handle to the parent key */
880 IN path_t name; /* key name */
884 /* Close a registry key */
885 struct close_key_request
887 IN int hkey; /* key to close */
891 /* Enumerate registry subkeys */
892 struct enum_key_request
894 IN int hkey; /* handle to registry key */
895 IN int index; /* index of subkey */
896 OUT time_t modif; /* last modification time */
897 OUT path_t name; /* subkey name */
898 OUT WCHAR class[1]; /* class name */
902 /* Query information about a registry key */
903 struct query_key_info_request
905 IN int hkey; /* handle to registry key */
906 OUT int subkeys; /* number of subkeys */
907 OUT int max_subkey; /* longest subkey name */
908 OUT int max_class; /* longest class name */
909 OUT int values; /* number of values */
910 OUT int max_value; /* longest value name */
911 OUT int max_data; /* longest value data */
912 OUT time_t modif; /* last modification time */
913 OUT path_t name; /* key name */
914 OUT WCHAR class[1]; /* class name */
918 /* Set a value of a registry key */
919 struct set_key_value_request
921 IN int hkey; /* handle to registry key */
922 IN int type; /* value type */
923 IN int len; /* value data len */
924 IN path_t name; /* value name */
925 IN unsigned char data[1]; /* value data */
929 /* Retrieve the value of a registry key */
930 struct get_key_value_request
932 IN int hkey; /* handle to registry key */
933 OUT int type; /* value type */
934 OUT int len; /* value data len */
935 IN WCHAR name[1]; /* value name */
936 OUT unsigned char data[1]; /* value data */
940 /* Enumerate a value of a registry key */
941 struct enum_key_value_request
943 IN int hkey; /* handle to registry key */
944 IN int index; /* value index */
945 OUT int type; /* value type */
946 OUT int len; /* value data len */
947 OUT path_t name; /* value name */
948 OUT unsigned char data[1]; /* value data */
952 /* Delete a value of a registry key */
953 struct delete_key_value_request
955 IN int hkey; /* handle to registry key */
956 IN path_t name; /* value name */
960 /* Load a registry branch from a file */
961 struct load_registry_request
963 IN int hkey; /* root key to load to */
964 IN int file; /* file to load from */
965 IN path_t name; /* subkey name */
969 /* Save a registry branch to a file */
970 struct save_registry_request
972 IN int hkey; /* key to save */
973 IN int file; /* file to save to */
977 /* Set the current and saving level for the registry */
978 struct set_registry_levels_request
980 IN int current; /* new current level */
981 IN int saving; /* new saving level */
982 IN int version; /* file format version for saving */
986 /* Create a waitable timer */
987 struct create_timer_request
989 IN int inherit; /* inherit flag */
990 IN int manual; /* manual reset */
991 OUT int handle; /* handle to the timer */
992 IN WCHAR name[1]; /* timer name */
996 /* Open a waitable timer */
997 struct open_timer_request
999 IN unsigned int access; /* wanted access rights */
1000 IN int inherit; /* inherit flag */
1001 OUT int handle; /* handle to the timer */
1002 IN WCHAR name[1]; /* timer name */
1005 /* Set a waitable timer */
1006 struct set_timer_request
1008 IN int handle; /* handle to the timer */
1009 IN int sec; /* next expiration absolute time */
1010 IN int usec; /* next expiration absolute time */
1011 IN int period; /* timer period in ms */
1012 IN void* callback; /* callback function */
1013 IN void* arg; /* callback argument */
1016 /* Cancel a waitable timer */
1017 struct cancel_timer_request
1019 IN int handle; /* handle to the timer */
1023 /* Retrieve the current context of a thread */
1024 struct get_thread_context_request
1026 IN int handle; /* thread handle */
1027 IN unsigned int flags; /* context flags */
1028 OUT CONTEXT context; /* thread context */
1032 /* Set the current context of a thread */
1033 struct set_thread_context_request
1035 IN int handle; /* thread handle */
1036 IN unsigned int flags; /* context flags */
1037 IN CONTEXT context; /* thread context */
1041 /* Fetch a selector entry for a thread */
1042 struct get_selector_entry_request
1044 IN int handle; /* thread handle */
1045 IN int entry; /* LDT entry */
1046 OUT unsigned int base; /* selector base */
1047 OUT unsigned int limit; /* selector limit */
1048 OUT unsigned char flags; /* selector flags */
1052 /* Add a global atom */
1053 struct add_atom_request
1055 OUT int atom; /* resulting atom */
1056 IN WCHAR name[1]; /* atom name */
1060 /* Delete a global atom */
1061 struct delete_atom_request
1063 IN int atom; /* atom handle */
1067 /* Find a global atom */
1068 struct find_atom_request
1070 OUT int atom; /* atom handle */
1071 IN WCHAR name[1]; /* atom name */
1075 /* Get a global atom name */
1076 struct get_atom_name_request
1078 IN int atom; /* atom handle */
1079 OUT int count; /* atom lock count */
1080 OUT WCHAR name[1]; /* atom name */
1083 /* Everything below this line is generated automatically by tools/make_requests */
1084 /* ### make_requests begin ### */
1092 REQ_INIT_PROCESS_DONE,
1094 REQ_GET_THREAD_BUFFER,
1095 REQ_TERMINATE_PROCESS,
1096 REQ_TERMINATE_THREAD,
1097 REQ_GET_PROCESS_INFO,
1098 REQ_SET_PROCESS_INFO,
1099 REQ_GET_THREAD_INFO,
1100 REQ_SET_THREAD_INFO,
1107 REQ_GET_HANDLE_INFO,
1108 REQ_SET_HANDLE_INFO,
1118 REQ_CREATE_SEMAPHORE,
1119 REQ_RELEASE_SEMAPHORE,
1122 REQ_ALLOC_FILE_HANDLE,
1125 REQ_SET_FILE_POINTER,
1135 REQ_SET_SOCKET_EVENT,
1136 REQ_GET_SOCKET_EVENT,
1137 REQ_ENABLE_SOCKET_EVENT,
1142 REQ_GET_CONSOLE_MODE,
1143 REQ_SET_CONSOLE_MODE,
1144 REQ_SET_CONSOLE_INFO,
1145 REQ_GET_CONSOLE_INFO,
1146 REQ_WRITE_CONSOLE_INPUT,
1147 REQ_READ_CONSOLE_INPUT,
1148 REQ_CREATE_CHANGE_NOTIFICATION,
1151 REQ_GET_MAPPING_INFO,
1153 REQ_CREATE_SNAPSHOT,
1155 REQ_WAIT_DEBUG_EVENT,
1156 REQ_SEND_DEBUG_EVENT,
1157 REQ_CONTINUE_DEBUG_EVENT,
1159 REQ_READ_PROCESS_MEMORY,
1160 REQ_WRITE_PROCESS_MEMORY,
1170 REQ_DELETE_KEY_VALUE,
1173 REQ_SET_REGISTRY_LEVELS,
1178 REQ_GET_THREAD_CONTEXT,
1179 REQ_SET_THREAD_CONTEXT,
1180 REQ_GET_SELECTOR_ENTRY,
1188 /* ### make_requests end ### */
1189 /* Everything above this line is generated automatically by tools/make_requests */
1192 /* client-side functions */
1194 #ifndef __WINE_SERVER__
1199 /* client communication functions */
1201 extern unsigned int server_call_noerr( enum request req );
1202 extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
1203 extern void server_protocol_error( const char *err, ... );
1205 /* get a pointer to the request buffer */
1206 static inline void * WINE_UNUSED get_req_buffer(void)
1208 return NtCurrentTeb()->buffer;
1211 /* maximum remaining size in the server buffer */
1212 static inline int WINE_UNUSED server_remaining( const void *ptr )
1214 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
1217 /* do a server call and set the last error code */
1218 static inline int server_call( enum request req )
1220 unsigned int res = server_call_noerr( req );
1221 if (res) SetLastError( RtlNtStatusToDosError(res) );
1225 /* copy a Unicode string to the server buffer */
1226 static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1230 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1231 while ((dst < end) && *src) *dst++ = *src++;
1236 /* copy and convert an ASCII string to the server buffer */
1237 static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1241 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1242 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1247 extern int CLIENT_InitServer(void);
1248 extern int CLIENT_BootDone( int debug_level );
1249 extern int CLIENT_IsBootThread(void);
1250 extern int CLIENT_DebuggerRequest( int op );
1251 extern int CLIENT_InitThread(void);
1252 #endif /* __WINE_SERVER__ */
1254 #endif /* __WINE_SERVER_H */