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 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
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 */
99 int code
; /* event code */
100 union debug_event_data info
; /* event information */
104 /* Create a new process from the context of the parent */
105 struct new_process_request
107 IN
int pinherit
; /* process handle inherit flag */
108 IN
int tinherit
; /* thread handle inherit flag */
109 IN
int inherit_all
; /* inherit all handles from parent */
110 IN
int create_flags
; /* creation flags */
111 IN
int start_flags
; /* flags from startup info */
112 IN
int exe_file
; /* file handle for main exe */
113 IN
int hstdin
; /* handle for stdin */
114 IN
int hstdout
; /* handle for stdout */
115 IN
int hstderr
; /* handle for stderr */
116 IN
int event
; /* event to signal startup */
117 IN
int cmd_show
; /* main window show mode */
118 IN
void* env_ptr
; /* pointer to environment (FIXME: hack) */
119 OUT
void* pid
; /* process id */
120 OUT
int phandle
; /* process handle (in the current process) */
121 OUT
void* tid
; /* thread id */
122 OUT
int thandle
; /* thread handle (in the current process) */
123 IN
char cmdline
[1]; /* command line */
127 /* Create a new thread from the context of the parent */
128 struct new_thread_request
130 IN
int suspend
; /* new thread should be suspended on creation */
131 IN
int inherit
; /* inherit flag */
132 OUT
void* tid
; /* thread id */
133 OUT
int handle
; /* thread handle (in the current process) */
137 /* Signal that we are finished booting on the client side */
138 struct boot_done_request
140 IN
int debug_level
; /* new debug level */
144 /* Initialize a process; called from the new process context */
145 struct init_process_request
147 IN
void* ldt_copy
; /* addr of LDT copy */
148 IN
void* ldt_flags
; /* addr of LDT flags */
149 OUT
int start_flags
; /* flags from startup info */
150 OUT
int exe_file
; /* file handle for main exe */
151 OUT
int hstdin
; /* handle for stdin */
152 OUT
int hstdout
; /* handle for stdout */
153 OUT
int hstderr
; /* handle for stderr */
154 OUT
int cmd_show
; /* main window show mode */
155 OUT
void* env_ptr
; /* pointer to environment (FIXME: hack) */
156 OUT
char cmdline
[1]; /* command line */
160 /* Signal the end of the process initialization */
161 struct init_process_done_request
163 IN
void* module
; /* main module base address */
164 IN
void* entry
; /* process entry point */
165 OUT
int debugged
; /* being debugged? */
169 /* Initialize a thread; called from the child after fork()/clone() */
170 struct init_thread_request
172 IN
int unix_pid
; /* Unix pid of new thread */
173 IN
void* teb
; /* TEB of new thread (in thread address space) */
174 IN
void* entry
; /* thread entry point (in thread address space) */
178 /* Retrieve the thread buffer file descriptor */
179 /* The reply to this request is the first thing a newly */
180 /* created thread gets (without having to request it) */
181 struct get_thread_buffer_request
183 OUT
void* pid
; /* process id of the new thread's process */
184 OUT
void* tid
; /* thread id of the new thread */
185 OUT
int boot
; /* is this the boot thread? */
186 OUT
int version
; /* protocol version */
190 /* Terminate a process */
191 struct terminate_process_request
193 IN
int handle
; /* process handle to terminate */
194 IN
int exit_code
; /* process exit code */
195 OUT
int self
; /* suicide? */
199 /* Terminate a thread */
200 struct terminate_thread_request
202 IN
int handle
; /* thread handle to terminate */
203 IN
int exit_code
; /* thread exit code */
204 OUT
int self
; /* suicide? */
205 OUT
int last
; /* last thread in this process? */
209 /* Retrieve information about a process */
210 struct get_process_info_request
212 IN
int handle
; /* process handle */
213 OUT
void* pid
; /* server process id */
214 OUT
int debugged
; /* debugged? */
215 OUT
int exit_code
; /* process exit code */
216 OUT
int priority
; /* priority class */
217 OUT
int process_affinity
; /* process affinity mask */
218 OUT
int system_affinity
; /* system affinity mask */
222 /* Set a process informations */
223 struct set_process_info_request
225 IN
int handle
; /* process handle */
226 IN
int mask
; /* setting mask (see below) */
227 IN
int priority
; /* priority class */
228 IN
int affinity
; /* affinity mask */
230 #define SET_PROCESS_INFO_PRIORITY 0x01
231 #define SET_PROCESS_INFO_AFFINITY 0x02
234 /* Retrieve information about a thread */
235 struct get_thread_info_request
237 IN
int handle
; /* thread handle */
238 IN
void* tid_in
; /* thread id (optional) */
239 OUT
void* tid
; /* server thread id */
240 OUT
void* teb
; /* thread teb pointer */
241 OUT
int exit_code
; /* thread exit code */
242 OUT
int priority
; /* thread priority level */
246 /* Set a thread informations */
247 struct set_thread_info_request
249 IN
int handle
; /* thread handle */
250 IN
int mask
; /* setting mask (see below) */
251 IN
int priority
; /* priority class */
252 IN
int affinity
; /* affinity mask */
254 #define SET_THREAD_INFO_PRIORITY 0x01
255 #define SET_THREAD_INFO_AFFINITY 0x02
258 /* Suspend a thread */
259 struct suspend_thread_request
261 IN
int handle
; /* thread handle */
262 OUT
int count
; /* new suspend count */
266 /* Resume a thread */
267 struct resume_thread_request
269 IN
int handle
; /* thread handle */
270 OUT
int count
; /* new suspend count */
274 /* Notify the server that a dll has been loaded */
275 struct load_dll_request
277 IN
int handle
; /* file handle */
278 IN
void* base
; /* base address */
279 IN
int dbg_offset
; /* debug info offset */
280 IN
int dbg_size
; /* debug info size */
281 IN
void* name
; /* ptr to ptr to name (in process addr space) */
285 /* Notify the server that a dll is being unloaded */
286 struct unload_dll_request
288 IN
void* base
; /* base address */
292 /* Queue an APC for a thread */
293 struct queue_apc_request
295 IN
int handle
; /* thread handle */
296 IN
void* func
; /* function to call */
297 IN
void* param
; /* param for function to call */
301 /* Get list of APC to call */
302 struct get_apcs_request
304 OUT
int count
; /* number of apcs */
305 OUT
void* apcs
[1]; /* async procedures to call */
309 /* Close a handle for the current process */
310 struct close_handle_request
312 IN
int handle
; /* handle to close */
316 /* Get information about a handle */
317 struct get_handle_info_request
319 IN
int handle
; /* handle we are interested in */
320 OUT
int flags
; /* handle flags */
324 /* Set a handle information */
325 struct set_handle_info_request
327 IN
int handle
; /* handle we are interested in */
328 IN
int flags
; /* new handle flags */
329 IN
int mask
; /* mask for flags to set */
333 /* Duplicate a handle */
334 struct dup_handle_request
336 IN
int src_process
; /* src process handle */
337 IN
int src_handle
; /* src handle to duplicate */
338 IN
int dst_process
; /* dst process handle */
339 IN
unsigned int access
; /* wanted access rights */
340 IN
int inherit
; /* inherit flag */
341 IN
int options
; /* duplicate options (see below) */
342 OUT
int handle
; /* duplicated handle in dst process */
344 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
345 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
346 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
349 /* Open a handle to a process */
350 struct open_process_request
352 IN
void* pid
; /* process id to open */
353 IN
unsigned int access
; /* wanted access rights */
354 IN
int inherit
; /* inherit flag */
355 OUT
int handle
; /* handle to the process */
359 /* Wait for handles */
360 struct select_request
362 IN
int count
; /* handles count */
363 IN
int flags
; /* wait flags (see below) */
364 IN
int timeout
; /* timeout in ms */
365 OUT
int signaled
; /* signaled handle */
366 IN
int handles
[1]; /* handles to select on */
369 #define SELECT_ALERTABLE 2
370 #define SELECT_TIMEOUT 4
373 /* Create an event */
374 struct create_event_request
376 IN
int manual_reset
; /* manual reset event */
377 IN
int initial_state
; /* initial state of the event */
378 IN
int inherit
; /* inherit flag */
379 OUT
int handle
; /* handle to the event */
380 IN WCHAR name
[1]; /* event name */
383 /* Event operation */
384 struct event_op_request
386 IN
int handle
; /* handle to event */
387 IN
int op
; /* event operation (see below) */
389 enum event_op
{ PULSE_EVENT
, SET_EVENT
, RESET_EVENT
};
393 struct open_event_request
395 IN
unsigned int access
; /* wanted access rights */
396 IN
int inherit
; /* inherit flag */
397 OUT
int handle
; /* handle to the event */
398 IN WCHAR name
[1]; /* object name */
403 struct create_mutex_request
405 IN
int owned
; /* initially owned? */
406 IN
int inherit
; /* inherit flag */
407 OUT
int handle
; /* handle to the mutex */
408 IN WCHAR name
[1]; /* mutex name */
412 /* Release a mutex */
413 struct release_mutex_request
415 IN
int handle
; /* handle to the mutex */
420 struct open_mutex_request
422 IN
unsigned int access
; /* wanted access rights */
423 IN
int inherit
; /* inherit flag */
424 OUT
int handle
; /* handle to the mutex */
425 IN WCHAR name
[1]; /* object name */
429 /* Create a semaphore */
430 struct create_semaphore_request
432 IN
unsigned int initial
; /* initial count */
433 IN
unsigned int max
; /* maximum count */
434 IN
int inherit
; /* inherit flag */
435 OUT
int handle
; /* handle to the semaphore */
436 IN WCHAR name
[1]; /* semaphore name */
440 /* Release a semaphore */
441 struct release_semaphore_request
443 IN
int handle
; /* handle to the semaphore */
444 IN
unsigned int count
; /* count to add to semaphore */
445 OUT
unsigned int prev_count
; /* previous semaphore count */
449 /* Open a semaphore */
450 struct open_semaphore_request
452 IN
unsigned int access
; /* wanted access rights */
453 IN
int inherit
; /* inherit flag */
454 OUT
int handle
; /* handle to the semaphore */
455 IN WCHAR name
[1]; /* object name */
460 struct create_file_request
462 IN
unsigned int access
; /* wanted access rights */
463 IN
int inherit
; /* inherit flag */
464 IN
unsigned int sharing
; /* sharing flags */
465 IN
int create
; /* file create action */
466 IN
unsigned int attrs
; /* file attributes for creation */
467 OUT
int handle
; /* handle to the file */
468 IN
char name
[1]; /* file name */
472 /* Allocate a file handle for a Unix fd */
473 struct alloc_file_handle_request
475 IN
unsigned int access
; /* wanted access rights */
476 OUT
int handle
; /* handle to the file */
480 /* Get a Unix fd to read from a file */
481 struct get_read_fd_request
483 IN
int handle
; /* handle to the file */
487 /* Get a Unix fd to write to a file */
488 struct get_write_fd_request
490 IN
int handle
; /* handle to the file */
494 /* Set a file current position */
495 struct set_file_pointer_request
497 IN
int handle
; /* handle to the file */
498 IN
int low
; /* position low word */
499 IN
int high
; /* position high word */
500 IN
int whence
; /* whence to seek */
501 OUT
int new_low
; /* new position low word */
502 OUT
int new_high
; /* new position high word */
506 /* Truncate (or extend) a file */
507 struct truncate_file_request
509 IN
int handle
; /* handle to the file */
513 /* Set a file access and modification times */
514 struct set_file_time_request
516 IN
int handle
; /* handle to the file */
517 IN
time_t access_time
; /* last access time */
518 IN
time_t write_time
; /* last write time */
522 /* Flush a file buffers */
523 struct flush_file_request
525 IN
int handle
; /* handle to the file */
529 /* Get information about a file */
530 struct get_file_info_request
532 IN
int handle
; /* handle to the file */
533 OUT
int type
; /* file type */
534 OUT
int attr
; /* file attributes */
535 OUT
time_t access_time
; /* last access time */
536 OUT
time_t write_time
; /* last write time */
537 OUT
int size_high
; /* file size */
538 OUT
int size_low
; /* file size */
539 OUT
int links
; /* number of links */
540 OUT
int index_high
; /* unique index */
541 OUT
int index_low
; /* unique index */
542 OUT
unsigned int serial
; /* volume serial number */
546 /* Lock a region of a file */
547 struct lock_file_request
549 IN
int handle
; /* handle to the file */
550 IN
unsigned int offset_low
; /* offset of start of lock */
551 IN
unsigned int offset_high
; /* offset of start of lock */
552 IN
unsigned int count_low
; /* count of bytes to lock */
553 IN
unsigned int count_high
; /* count of bytes to lock */
557 /* Unlock a region of a file */
558 struct unlock_file_request
560 IN
int handle
; /* handle to the file */
561 IN
unsigned int offset_low
; /* offset of start of unlock */
562 IN
unsigned int offset_high
; /* offset of start of unlock */
563 IN
unsigned int count_low
; /* count of bytes to unlock */
564 IN
unsigned int count_high
; /* count of bytes to unlock */
568 /* Create an anonymous pipe */
569 struct create_pipe_request
571 IN
int inherit
; /* inherit flag */
572 OUT
int handle_read
; /* handle to the read-side of the pipe */
573 OUT
int handle_write
; /* handle to the write-side of the pipe */
577 /* Create a socket */
578 struct create_socket_request
580 IN
unsigned int access
; /* wanted access rights */
581 IN
int inherit
; /* inherit flag */
582 IN
int family
; /* family, see socket manpage */
583 IN
int type
; /* type, see socket manpage */
584 IN
int protocol
; /* protocol, see socket manpage */
585 OUT
int handle
; /* handle to the new socket */
589 /* Accept a socket */
590 struct accept_socket_request
592 IN
int lhandle
; /* handle to the listening socket */
593 IN
unsigned int access
; /* wanted access rights */
594 IN
int inherit
; /* inherit flag */
595 OUT
int handle
; /* handle to the new socket */
599 /* Set socket event parameters */
600 struct set_socket_event_request
602 IN
int handle
; /* handle to the socket */
603 IN
unsigned int mask
; /* event mask */
604 IN
int event
; /* event object */
608 /* Get socket event parameters */
609 struct get_socket_event_request
611 IN
int handle
; /* handle to the socket */
612 IN
int service
; /* clear pending? */
613 IN
int s_event
; /* "expected" event object */
614 IN
int c_event
; /* event to clear */
615 OUT
unsigned int mask
; /* event mask */
616 OUT
unsigned int pmask
; /* pending events */
617 OUT
unsigned int state
; /* status bits */
618 OUT
int errors
[1]; /* event errors */
622 /* Reenable pending socket events */
623 struct enable_socket_event_request
625 IN
int handle
; /* handle to the socket */
626 IN
unsigned int mask
; /* events to re-enable */
627 IN
unsigned int sstate
; /* status bits to set */
628 IN
unsigned int cstate
; /* status bits to clear */
632 /* Allocate a console for the current process */
633 struct alloc_console_request
635 IN
unsigned int access
; /* wanted access rights */
636 IN
int inherit
; /* inherit flag */
637 OUT
int handle_in
; /* handle to console input */
638 OUT
int handle_out
; /* handle to console output */
642 /* Free the console of the current process */
643 struct free_console_request
649 /* Open a handle to the process console */
650 struct open_console_request
652 IN
int output
; /* input or output? */
653 IN
unsigned int access
; /* wanted access rights */
654 IN
int inherit
; /* inherit flag */
655 OUT
int handle
; /* handle to the console */
659 /* Set a console file descriptor */
660 struct set_console_fd_request
662 IN
int handle
; /* handle to the console */
663 IN
int file_handle
; /* handle of file to use as file descriptor */
664 IN
int pid
; /* pid of xterm (hack) */
668 /* Get a console mode (input or output) */
669 struct get_console_mode_request
671 IN
int handle
; /* handle to the console */
672 OUT
int mode
; /* console mode */
676 /* Set a console mode (input or output) */
677 struct set_console_mode_request
679 IN
int handle
; /* handle to the console */
680 IN
int mode
; /* console mode */
684 /* Set info about a console (output only) */
685 struct set_console_info_request
687 IN
int handle
; /* handle to the console */
688 IN
int mask
; /* setting mask (see below) */
689 IN
int cursor_size
; /* size of cursor (percentage filled) */
690 IN
int cursor_visible
;/* cursor visibility flag */
691 IN
char title
[1]; /* console title */
693 #define SET_CONSOLE_INFO_CURSOR 0x01
694 #define SET_CONSOLE_INFO_TITLE 0x02
696 /* Get info about a console (output only) */
697 struct get_console_info_request
699 IN
int handle
; /* handle to the console */
700 OUT
int cursor_size
; /* size of cursor (percentage filled) */
701 OUT
int cursor_visible
;/* cursor visibility flag */
702 OUT
int pid
; /* pid of xterm (hack) */
703 OUT
char title
[1]; /* console title */
707 /* Add input records to a console input queue */
708 struct write_console_input_request
710 IN
int handle
; /* handle to the console input */
711 IN
int count
; /* number of input records */
712 OUT
int written
; /* number of records written */
713 /* INPUT_RECORD records[0]; */ /* input records */
716 /* Fetch input records from a console input queue */
717 struct read_console_input_request
719 IN
int handle
; /* handle to the console input */
720 IN
int count
; /* max number of records to retrieve */
721 IN
int flush
; /* flush the retrieved records from the queue? */
722 OUT
int read
; /* number of records read */
723 /* INPUT_RECORD records[0]; */ /* input records */
727 /* Create a change notification */
728 struct create_change_notification_request
730 IN
int subtree
; /* watch all the subtree */
731 IN
int filter
; /* notification filter */
732 OUT
int handle
; /* handle to the change notification */
736 /* Create a file mapping */
737 struct create_mapping_request
739 IN
int size_high
; /* mapping size */
740 IN
int size_low
; /* mapping size */
741 IN
int protect
; /* protection flags (see below) */
742 IN
int inherit
; /* inherit flag */
743 IN
int file_handle
; /* file handle */
744 OUT
int handle
; /* handle to the mapping */
745 IN WCHAR name
[1]; /* object name */
747 /* protection flags */
748 #define VPROT_READ 0x01
749 #define VPROT_WRITE 0x02
750 #define VPROT_EXEC 0x04
751 #define VPROT_WRITECOPY 0x08
752 #define VPROT_GUARD 0x10
753 #define VPROT_NOCACHE 0x20
754 #define VPROT_COMMITTED 0x40
758 struct open_mapping_request
760 IN
unsigned int access
; /* wanted access rights */
761 IN
int inherit
; /* inherit flag */
762 OUT
int handle
; /* handle to the mapping */
763 IN WCHAR name
[1]; /* object name */
767 /* Get information about a file mapping */
768 struct get_mapping_info_request
770 IN
int handle
; /* handle to the mapping */
771 OUT
int size_high
; /* mapping size */
772 OUT
int size_low
; /* mapping size */
773 OUT
int protect
; /* protection flags */
777 /* Create a device */
778 struct create_device_request
780 IN
unsigned int access
; /* wanted access rights */
781 IN
int inherit
; /* inherit flag */
782 IN
int id
; /* client private id */
783 OUT
int handle
; /* handle to the device */
787 /* Create a snapshot */
788 struct create_snapshot_request
790 IN
int inherit
; /* inherit flag */
791 IN
int flags
; /* snapshot flags (TH32CS_*) */
792 OUT
int handle
; /* handle to the snapshot */
796 /* Get the next process from a snapshot */
797 struct next_process_request
799 IN
int handle
; /* handle to the snapshot */
800 IN
int reset
; /* reset snapshot position? */
801 OUT
void* pid
; /* process id */
802 OUT
int threads
; /* number of threads */
803 OUT
int priority
; /* process priority */
807 /* Wait for a debug event */
808 struct wait_debug_event_request
810 IN
int timeout
; /* timeout in ms */
811 OUT
void* pid
; /* process id */
812 OUT
void* tid
; /* thread id */
813 OUT debug_event_t event
; /* debug event data */
817 /* Send an exception event */
818 struct exception_event_request
820 IN EXCEPTION_RECORD record
; /* exception record */
821 IN
int first
; /* first chance exception? */
822 IN CONTEXT context
; /* thread context */
823 OUT
int status
; /* event continuation status */
827 /* Send an output string to the debugger */
828 struct output_debug_string_request
830 IN
void* string
; /* string to display (in debugged process address space) */
831 IN
int unicode
; /* is it Unicode? */
832 IN
int length
; /* string length */
836 /* Continue a debug event */
837 struct continue_debug_event_request
839 IN
void* pid
; /* process id to continue */
840 IN
void* tid
; /* thread id to continue */
841 IN
int status
; /* continuation status */
845 /* Start debugging an existing process */
846 struct debug_process_request
848 IN
void* pid
; /* id of the process to debug */
852 /* Read data from a process address space */
853 struct read_process_memory_request
855 IN
int handle
; /* process handle */
856 IN
void* addr
; /* addr to read from (must be int-aligned) */
857 IN
int len
; /* number of ints to read */
858 OUT
unsigned int data
[1]; /* result data */
862 /* Write data to a process address space */
863 struct write_process_memory_request
865 IN
int handle
; /* process handle */
866 IN
void* addr
; /* addr to write to (must be int-aligned) */
867 IN
int len
; /* number of ints to write */
868 IN
unsigned int first_mask
; /* mask for first word */
869 IN
unsigned int last_mask
; /* mask for last word */
870 IN
unsigned int data
[1]; /* data to write */
874 /* Create a registry key */
875 struct create_key_request
877 IN
int parent
; /* handle to the parent key */
878 IN
unsigned int access
; /* desired access rights */
879 IN
unsigned int options
; /* creation options */
880 IN
time_t modif
; /* last modification time */
881 OUT
int hkey
; /* handle to the created key */
882 OUT
int created
; /* has it been newly created? */
883 IN path_t name
; /* key name */
884 IN WCHAR
class[1]; /* class name */
888 /* Open a registry key */
889 struct open_key_request
891 IN
int parent
; /* handle to the parent key */
892 IN
unsigned int access
; /* desired access rights */
893 OUT
int hkey
; /* handle to the open key */
894 IN path_t name
; /* key name */
898 /* Delete a registry key */
899 struct delete_key_request
901 IN
int hkey
; /* handle to the parent key */
902 IN path_t name
; /* key name */
906 /* Close a registry key */
907 struct close_key_request
909 IN
int hkey
; /* key to close */
913 /* Enumerate registry subkeys */
914 struct enum_key_request
916 IN
int hkey
; /* handle to registry key */
917 IN
int index
; /* index of subkey */
918 OUT
time_t modif
; /* last modification time */
919 OUT path_t name
; /* subkey name */
920 OUT WCHAR
class[1]; /* class name */
924 /* Query information about a registry key */
925 struct query_key_info_request
927 IN
int hkey
; /* handle to registry key */
928 OUT
int subkeys
; /* number of subkeys */
929 OUT
int max_subkey
; /* longest subkey name */
930 OUT
int max_class
; /* longest class name */
931 OUT
int values
; /* number of values */
932 OUT
int max_value
; /* longest value name */
933 OUT
int max_data
; /* longest value data */
934 OUT
time_t modif
; /* last modification time */
935 OUT path_t name
; /* key name */
936 OUT WCHAR
class[1]; /* class name */
940 /* Set a value of a registry key */
941 struct set_key_value_request
943 IN
int hkey
; /* handle to registry key */
944 IN
int type
; /* value type */
945 IN
int len
; /* value data len */
946 IN path_t name
; /* value name */
947 IN
unsigned char data
[1]; /* value data */
951 /* Retrieve the value of a registry key */
952 struct get_key_value_request
954 IN
int hkey
; /* handle to registry key */
955 OUT
int type
; /* value type */
956 OUT
int len
; /* value data len */
957 IN WCHAR name
[1]; /* value name */
958 OUT
unsigned char data
[1]; /* value data */
962 /* Enumerate a value of a registry key */
963 struct enum_key_value_request
965 IN
int hkey
; /* handle to registry key */
966 IN
int index
; /* value index */
967 OUT
int type
; /* value type */
968 OUT
int len
; /* value data len */
969 OUT path_t name
; /* value name */
970 OUT
unsigned char data
[1]; /* value data */
974 /* Delete a value of a registry key */
975 struct delete_key_value_request
977 IN
int hkey
; /* handle to registry key */
978 IN path_t name
; /* value name */
982 /* Load a registry branch from a file */
983 struct load_registry_request
985 IN
int hkey
; /* root key to load to */
986 IN
int file
; /* file to load from */
987 IN path_t name
; /* subkey name */
991 /* Save a registry branch to a file */
992 struct save_registry_request
994 IN
int hkey
; /* key to save */
995 IN
int file
; /* file to save to */
999 /* Set the current and saving level for the registry */
1000 struct set_registry_levels_request
1002 IN
int current
; /* new current level */
1003 IN
int saving
; /* new saving level */
1004 IN
int version
; /* file format version for saving */
1008 /* Create a waitable timer */
1009 struct create_timer_request
1011 IN
int inherit
; /* inherit flag */
1012 IN
int manual
; /* manual reset */
1013 OUT
int handle
; /* handle to the timer */
1014 IN WCHAR name
[1]; /* timer name */
1018 /* Open a waitable timer */
1019 struct open_timer_request
1021 IN
unsigned int access
; /* wanted access rights */
1022 IN
int inherit
; /* inherit flag */
1023 OUT
int handle
; /* handle to the timer */
1024 IN WCHAR name
[1]; /* timer name */
1027 /* Set a waitable timer */
1028 struct set_timer_request
1030 IN
int handle
; /* handle to the timer */
1031 IN
int sec
; /* next expiration absolute time */
1032 IN
int usec
; /* next expiration absolute time */
1033 IN
int period
; /* timer period in ms */
1034 IN
void* callback
; /* callback function */
1035 IN
void* arg
; /* callback argument */
1038 /* Cancel a waitable timer */
1039 struct cancel_timer_request
1041 IN
int handle
; /* handle to the timer */
1045 /* Retrieve the current context of a thread */
1046 struct get_thread_context_request
1048 IN
int handle
; /* thread handle */
1049 IN
unsigned int flags
; /* context flags */
1050 OUT CONTEXT context
; /* thread context */
1054 /* Set the current context of a thread */
1055 struct set_thread_context_request
1057 IN
int handle
; /* thread handle */
1058 IN
unsigned int flags
; /* context flags */
1059 IN CONTEXT context
; /* thread context */
1063 /* Fetch a selector entry for a thread */
1064 struct get_selector_entry_request
1066 IN
int handle
; /* thread handle */
1067 IN
int entry
; /* LDT entry */
1068 OUT
unsigned int base
; /* selector base */
1069 OUT
unsigned int limit
; /* selector limit */
1070 OUT
unsigned char flags
; /* selector flags */
1074 /* Add a global atom */
1075 struct add_atom_request
1077 OUT
int atom
; /* resulting atom */
1078 IN WCHAR name
[1]; /* atom name */
1082 /* Delete a global atom */
1083 struct delete_atom_request
1085 IN
int atom
; /* atom handle */
1089 /* Find a global atom */
1090 struct find_atom_request
1092 OUT
int atom
; /* atom handle */
1093 IN WCHAR name
[1]; /* atom name */
1097 /* Get a global atom name */
1098 struct get_atom_name_request
1100 IN
int atom
; /* atom handle */
1101 OUT
int count
; /* atom lock count */
1102 OUT WCHAR name
[1]; /* atom name */
1105 /* Everything below this line is generated automatically by tools/make_requests */
1106 /* ### make_requests begin ### */
1114 REQ_INIT_PROCESS_DONE
,
1116 REQ_GET_THREAD_BUFFER
,
1117 REQ_TERMINATE_PROCESS
,
1118 REQ_TERMINATE_THREAD
,
1119 REQ_GET_PROCESS_INFO
,
1120 REQ_SET_PROCESS_INFO
,
1121 REQ_GET_THREAD_INFO
,
1122 REQ_SET_THREAD_INFO
,
1130 REQ_GET_HANDLE_INFO
,
1131 REQ_SET_HANDLE_INFO
,
1141 REQ_CREATE_SEMAPHORE
,
1142 REQ_RELEASE_SEMAPHORE
,
1145 REQ_ALLOC_FILE_HANDLE
,
1148 REQ_SET_FILE_POINTER
,
1158 REQ_SET_SOCKET_EVENT
,
1159 REQ_GET_SOCKET_EVENT
,
1160 REQ_ENABLE_SOCKET_EVENT
,
1165 REQ_GET_CONSOLE_MODE
,
1166 REQ_SET_CONSOLE_MODE
,
1167 REQ_SET_CONSOLE_INFO
,
1168 REQ_GET_CONSOLE_INFO
,
1169 REQ_WRITE_CONSOLE_INPUT
,
1170 REQ_READ_CONSOLE_INPUT
,
1171 REQ_CREATE_CHANGE_NOTIFICATION
,
1174 REQ_GET_MAPPING_INFO
,
1176 REQ_CREATE_SNAPSHOT
,
1178 REQ_WAIT_DEBUG_EVENT
,
1179 REQ_EXCEPTION_EVENT
,
1180 REQ_OUTPUT_DEBUG_STRING
,
1181 REQ_CONTINUE_DEBUG_EVENT
,
1183 REQ_READ_PROCESS_MEMORY
,
1184 REQ_WRITE_PROCESS_MEMORY
,
1194 REQ_DELETE_KEY_VALUE
,
1197 REQ_SET_REGISTRY_LEVELS
,
1202 REQ_GET_THREAD_CONTEXT
,
1203 REQ_SET_THREAD_CONTEXT
,
1204 REQ_GET_SELECTOR_ENTRY
,
1212 #define SERVER_PROTOCOL_VERSION 6
1214 /* ### make_requests end ### */
1215 /* Everything above this line is generated automatically by tools/make_requests */
1218 /* client-side functions */
1220 #ifndef __WINE_SERVER__
1225 /* client communication functions */
1227 extern unsigned int server_call_noerr( enum request req
);
1228 extern unsigned int server_call_fd( enum request req
, int fd_out
, int *fd_in
);
1229 extern void server_protocol_error( const char *err
, ... ) WINE_NORETURN
;
1231 /* get a pointer to the request buffer */
1232 static inline void * WINE_UNUSED
get_req_buffer(void)
1234 return NtCurrentTeb()->buffer
;
1237 /* maximum remaining size in the server buffer */
1238 static inline int WINE_UNUSED
server_remaining( const void *ptr
)
1240 return (char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
- (char *)ptr
;
1243 /* do a server call and set the last error code */
1244 static inline int server_call( enum request req
)
1246 unsigned int res
= server_call_noerr( req
);
1247 if (res
) SetLastError( RtlNtStatusToDosError(res
) );
1251 /* copy a Unicode string to the server buffer */
1252 static inline void server_strcpyW( WCHAR
*dst
, const WCHAR
*src
)
1256 WCHAR
*end
= (WCHAR
*)((char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
) - 1;
1257 while ((dst
< end
) && *src
) *dst
++ = *src
++;
1262 /* copy and convert an ASCII string to the server buffer */
1263 static inline void server_strcpyAtoW( WCHAR
*dst
, const char *src
)
1267 WCHAR
*end
= (WCHAR
*)((char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
) - 1;
1268 while ((dst
< end
) && *src
) *dst
++ = (WCHAR
)(unsigned char)*src
++;
1273 extern int CLIENT_InitServer(void);
1274 extern int CLIENT_BootDone( int debug_level
);
1275 extern int CLIENT_IsBootThread(void);
1276 extern int CLIENT_InitThread(void);
1277 #endif /* __WINE_SERVER__ */
1279 #endif /* __WINE_SERVER_H */