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 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 OUT
int debugged
; /* being debugged? */
177 /* Initialize a thread; called from the child after fork()/clone() */
178 struct init_thread_request
180 IN
int unix_pid
; /* Unix pid of new thread */
181 IN
void* teb
; /* TEB of new thread (in thread address space) */
182 IN
void* entry
; /* thread entry point (in thread address space) */
186 /* Retrieve the thread buffer file descriptor */
187 /* The reply to this request is the first thing a newly */
188 /* created thread gets (without having to request it) */
189 struct get_thread_buffer_request
191 OUT
void* pid
; /* process id of the new thread's process */
192 OUT
void* tid
; /* thread id of the new thread */
193 OUT
int boot
; /* is this the boot thread? */
194 OUT
int version
; /* protocol version */
198 /* Terminate a process */
199 struct terminate_process_request
201 IN
int handle
; /* process handle to terminate */
202 IN
int exit_code
; /* process exit code */
203 OUT
int self
; /* suicide? */
207 /* Terminate a thread */
208 struct terminate_thread_request
210 IN
int handle
; /* thread handle to terminate */
211 IN
int exit_code
; /* thread exit code */
212 OUT
int self
; /* suicide? */
213 OUT
int last
; /* last thread in this process? */
217 /* Retrieve information about a process */
218 struct get_process_info_request
220 IN
int handle
; /* process handle */
221 OUT
void* pid
; /* server process id */
222 OUT
int debugged
; /* debugged? */
223 OUT
int exit_code
; /* process exit code */
224 OUT
int priority
; /* priority class */
225 OUT
int process_affinity
; /* process affinity mask */
226 OUT
int system_affinity
; /* system affinity mask */
230 /* Set a process informations */
231 struct set_process_info_request
233 IN
int handle
; /* process handle */
234 IN
int mask
; /* setting mask (see below) */
235 IN
int priority
; /* priority class */
236 IN
int affinity
; /* affinity mask */
238 #define SET_PROCESS_INFO_PRIORITY 0x01
239 #define SET_PROCESS_INFO_AFFINITY 0x02
242 /* Retrieve information about a thread */
243 struct get_thread_info_request
245 IN
int handle
; /* thread handle */
246 IN
void* tid_in
; /* thread id (optional) */
247 OUT
void* tid
; /* server thread id */
248 OUT
void* teb
; /* thread teb pointer */
249 OUT
int exit_code
; /* thread exit code */
250 OUT
int priority
; /* thread priority level */
254 /* Set a thread informations */
255 struct set_thread_info_request
257 IN
int handle
; /* thread handle */
258 IN
int mask
; /* setting mask (see below) */
259 IN
int priority
; /* priority class */
260 IN
int affinity
; /* affinity mask */
262 #define SET_THREAD_INFO_PRIORITY 0x01
263 #define SET_THREAD_INFO_AFFINITY 0x02
266 /* Suspend a thread */
267 struct suspend_thread_request
269 IN
int handle
; /* thread handle */
270 OUT
int count
; /* new suspend count */
274 /* Resume a thread */
275 struct resume_thread_request
277 IN
int handle
; /* thread handle */
278 OUT
int count
; /* new suspend count */
282 /* Notify the server that a dll has been loaded */
283 struct load_dll_request
285 IN
int handle
; /* file handle */
286 IN
void* base
; /* base address */
287 IN
int dbg_offset
; /* debug info offset */
288 IN
int dbg_size
; /* debug info size */
289 IN
void* name
; /* ptr to ptr to name (in process addr space) */
293 /* Notify the server that a dll is being unloaded */
294 struct unload_dll_request
296 IN
void* base
; /* base address */
300 /* Queue an APC for a thread */
301 struct queue_apc_request
303 IN
int handle
; /* thread handle */
304 IN
void* func
; /* function to call */
305 IN
void* param
; /* param for function to call */
309 /* Get list of APC to call */
310 struct get_apcs_request
312 OUT
int count
; /* number of apcs */
313 OUT
void* apcs
[1]; /* async procedures to call */
317 /* Close a handle for the current process */
318 struct close_handle_request
320 IN
int handle
; /* handle to close */
324 /* Get information about a handle */
325 struct get_handle_info_request
327 IN
int handle
; /* handle we are interested in */
328 OUT
int flags
; /* handle flags */
332 /* Set a handle information */
333 struct set_handle_info_request
335 IN
int handle
; /* handle we are interested in */
336 IN
int flags
; /* new handle flags */
337 IN
int mask
; /* mask for flags to set */
341 /* Duplicate a handle */
342 struct dup_handle_request
344 IN
int src_process
; /* src process handle */
345 IN
int src_handle
; /* src handle to duplicate */
346 IN
int dst_process
; /* dst process handle */
347 IN
unsigned int access
; /* wanted access rights */
348 IN
int inherit
; /* inherit flag */
349 IN
int options
; /* duplicate options (see below) */
350 OUT
int handle
; /* duplicated handle in dst process */
352 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
353 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
354 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
357 /* Open a handle to a process */
358 struct open_process_request
360 IN
void* pid
; /* process id to open */
361 IN
unsigned int access
; /* wanted access rights */
362 IN
int inherit
; /* inherit flag */
363 OUT
int handle
; /* handle to the process */
367 /* Wait for handles */
368 struct select_request
370 IN
int count
; /* handles count */
371 IN
int flags
; /* wait flags (see below) */
372 IN
int timeout
; /* timeout in ms */
373 OUT
int signaled
; /* signaled handle */
374 IN
int handles
[1]; /* handles to select on */
377 #define SELECT_ALERTABLE 2
378 #define SELECT_TIMEOUT 4
381 /* Create an event */
382 struct create_event_request
384 IN
int manual_reset
; /* manual reset event */
385 IN
int initial_state
; /* initial state of the event */
386 IN
int inherit
; /* inherit flag */
387 OUT
int handle
; /* handle to the event */
388 IN WCHAR name
[1]; /* event name */
391 /* Event operation */
392 struct event_op_request
394 IN
int handle
; /* handle to event */
395 IN
int op
; /* event operation (see below) */
397 enum event_op
{ PULSE_EVENT
, SET_EVENT
, RESET_EVENT
};
401 struct open_event_request
403 IN
unsigned int access
; /* wanted access rights */
404 IN
int inherit
; /* inherit flag */
405 OUT
int handle
; /* handle to the event */
406 IN WCHAR name
[1]; /* object name */
411 struct create_mutex_request
413 IN
int owned
; /* initially owned? */
414 IN
int inherit
; /* inherit flag */
415 OUT
int handle
; /* handle to the mutex */
416 IN WCHAR name
[1]; /* mutex name */
420 /* Release a mutex */
421 struct release_mutex_request
423 IN
int handle
; /* handle to the mutex */
428 struct open_mutex_request
430 IN
unsigned int access
; /* wanted access rights */
431 IN
int inherit
; /* inherit flag */
432 OUT
int handle
; /* handle to the mutex */
433 IN WCHAR name
[1]; /* object name */
437 /* Create a semaphore */
438 struct create_semaphore_request
440 IN
unsigned int initial
; /* initial count */
441 IN
unsigned int max
; /* maximum count */
442 IN
int inherit
; /* inherit flag */
443 OUT
int handle
; /* handle to the semaphore */
444 IN WCHAR name
[1]; /* semaphore name */
448 /* Release a semaphore */
449 struct release_semaphore_request
451 IN
int handle
; /* handle to the semaphore */
452 IN
unsigned int count
; /* count to add to semaphore */
453 OUT
unsigned int prev_count
; /* previous semaphore count */
457 /* Open a semaphore */
458 struct open_semaphore_request
460 IN
unsigned int access
; /* wanted access rights */
461 IN
int inherit
; /* inherit flag */
462 OUT
int handle
; /* handle to the semaphore */
463 IN WCHAR name
[1]; /* object name */
468 struct create_file_request
470 IN
unsigned int access
; /* wanted access rights */
471 IN
int inherit
; /* inherit flag */
472 IN
unsigned int sharing
; /* sharing flags */
473 IN
int create
; /* file create action */
474 IN
unsigned int attrs
; /* file attributes for creation */
475 OUT
int handle
; /* handle to the file */
476 IN
char name
[1]; /* file name */
480 /* Allocate a file handle for a Unix fd */
481 struct alloc_file_handle_request
483 IN
unsigned int access
; /* wanted access rights */
484 OUT
int handle
; /* handle to the file */
488 /* Get a Unix fd to read from a file */
489 struct get_read_fd_request
491 IN
int handle
; /* handle to the file */
495 /* Get a Unix fd to write to a file */
496 struct get_write_fd_request
498 IN
int handle
; /* handle to the file */
502 /* Set a file current position */
503 struct set_file_pointer_request
505 IN
int handle
; /* handle to the file */
506 IN
int low
; /* position low word */
507 IN
int high
; /* position high word */
508 IN
int whence
; /* whence to seek */
509 OUT
int new_low
; /* new position low word */
510 OUT
int new_high
; /* new position high word */
514 /* Truncate (or extend) a file */
515 struct truncate_file_request
517 IN
int handle
; /* handle to the file */
521 /* Set a file access and modification times */
522 struct set_file_time_request
524 IN
int handle
; /* handle to the file */
525 IN
time_t access_time
; /* last access time */
526 IN
time_t write_time
; /* last write time */
530 /* Flush a file buffers */
531 struct flush_file_request
533 IN
int handle
; /* handle to the file */
537 /* Get information about a file */
538 struct get_file_info_request
540 IN
int handle
; /* handle to the file */
541 OUT
int type
; /* file type */
542 OUT
int attr
; /* file attributes */
543 OUT
time_t access_time
; /* last access time */
544 OUT
time_t write_time
; /* last write time */
545 OUT
int size_high
; /* file size */
546 OUT
int size_low
; /* file size */
547 OUT
int links
; /* number of links */
548 OUT
int index_high
; /* unique index */
549 OUT
int index_low
; /* unique index */
550 OUT
unsigned int serial
; /* volume serial number */
554 /* Lock a region of a file */
555 struct lock_file_request
557 IN
int handle
; /* handle to the file */
558 IN
unsigned int offset_low
; /* offset of start of lock */
559 IN
unsigned int offset_high
; /* offset of start of lock */
560 IN
unsigned int count_low
; /* count of bytes to lock */
561 IN
unsigned int count_high
; /* count of bytes to lock */
565 /* Unlock a region of a file */
566 struct unlock_file_request
568 IN
int handle
; /* handle to the file */
569 IN
unsigned int offset_low
; /* offset of start of unlock */
570 IN
unsigned int offset_high
; /* offset of start of unlock */
571 IN
unsigned int count_low
; /* count of bytes to unlock */
572 IN
unsigned int count_high
; /* count of bytes to unlock */
576 /* Create an anonymous pipe */
577 struct create_pipe_request
579 IN
int inherit
; /* inherit flag */
580 OUT
int handle_read
; /* handle to the read-side of the pipe */
581 OUT
int handle_write
; /* handle to the write-side of the pipe */
585 /* Create a socket */
586 struct create_socket_request
588 IN
unsigned int access
; /* wanted access rights */
589 IN
int inherit
; /* inherit flag */
590 IN
int family
; /* family, see socket manpage */
591 IN
int type
; /* type, see socket manpage */
592 IN
int protocol
; /* protocol, see socket manpage */
593 OUT
int handle
; /* handle to the new socket */
597 /* Accept a socket */
598 struct accept_socket_request
600 IN
int lhandle
; /* handle to the listening socket */
601 IN
unsigned int access
; /* wanted access rights */
602 IN
int inherit
; /* inherit flag */
603 OUT
int handle
; /* handle to the new socket */
607 /* Set socket event parameters */
608 struct set_socket_event_request
610 IN
int handle
; /* handle to the socket */
611 IN
unsigned int mask
; /* event mask */
612 IN
int event
; /* event object */
616 /* Get socket event parameters */
617 struct get_socket_event_request
619 IN
int handle
; /* handle to the socket */
620 IN
int service
; /* clear pending? */
621 IN
int s_event
; /* "expected" event object */
622 IN
int c_event
; /* event to clear */
623 OUT
unsigned int mask
; /* event mask */
624 OUT
unsigned int pmask
; /* pending events */
625 OUT
unsigned int state
; /* status bits */
626 OUT
int errors
[1]; /* event errors */
630 /* Reenable pending socket events */
631 struct enable_socket_event_request
633 IN
int handle
; /* handle to the socket */
634 IN
unsigned int mask
; /* events to re-enable */
635 IN
unsigned int sstate
; /* status bits to set */
636 IN
unsigned int cstate
; /* status bits to clear */
640 /* Allocate a console for the current process */
641 struct alloc_console_request
643 IN
unsigned int access
; /* wanted access rights */
644 IN
int inherit
; /* inherit flag */
645 OUT
int handle_in
; /* handle to console input */
646 OUT
int handle_out
; /* handle to console output */
650 /* Free the console of the current process */
651 struct free_console_request
657 /* Open a handle to the process console */
658 struct open_console_request
660 IN
int output
; /* input or output? */
661 IN
unsigned int access
; /* wanted access rights */
662 IN
int inherit
; /* inherit flag */
663 OUT
int handle
; /* handle to the console */
667 /* Set a console file descriptor */
668 struct set_console_fd_request
670 IN
int handle
; /* handle to the console */
671 IN
int file_handle
; /* handle of file to use as file descriptor */
672 IN
int pid
; /* pid of xterm (hack) */
676 /* Get a console mode (input or output) */
677 struct get_console_mode_request
679 IN
int handle
; /* handle to the console */
680 OUT
int mode
; /* console mode */
684 /* Set a console mode (input or output) */
685 struct set_console_mode_request
687 IN
int handle
; /* handle to the console */
688 IN
int mode
; /* console mode */
692 /* Set info about a console (output only) */
693 struct set_console_info_request
695 IN
int handle
; /* handle to the console */
696 IN
int mask
; /* setting mask (see below) */
697 IN
int cursor_size
; /* size of cursor (percentage filled) */
698 IN
int cursor_visible
;/* cursor visibility flag */
699 IN
char title
[1]; /* console title */
701 #define SET_CONSOLE_INFO_CURSOR 0x01
702 #define SET_CONSOLE_INFO_TITLE 0x02
704 /* Get info about a console (output only) */
705 struct get_console_info_request
707 IN
int handle
; /* handle to the console */
708 OUT
int cursor_size
; /* size of cursor (percentage filled) */
709 OUT
int cursor_visible
;/* cursor visibility flag */
710 OUT
int pid
; /* pid of xterm (hack) */
711 OUT
char title
[1]; /* console title */
715 /* Add input records to a console input queue */
716 struct write_console_input_request
718 IN
int handle
; /* handle to the console input */
719 IN
int count
; /* number of input records */
720 OUT
int written
; /* number of records written */
721 /* INPUT_RECORD records[0]; */ /* input records */
724 /* Fetch input records from a console input queue */
725 struct read_console_input_request
727 IN
int handle
; /* handle to the console input */
728 IN
int count
; /* max number of records to retrieve */
729 IN
int flush
; /* flush the retrieved records from the queue? */
730 OUT
int read
; /* number of records read */
731 /* INPUT_RECORD records[0]; */ /* input records */
735 /* Create a change notification */
736 struct create_change_notification_request
738 IN
int subtree
; /* watch all the subtree */
739 IN
int filter
; /* notification filter */
740 OUT
int handle
; /* handle to the change notification */
744 /* Create a file mapping */
745 struct create_mapping_request
747 IN
int size_high
; /* mapping size */
748 IN
int size_low
; /* mapping size */
749 IN
int protect
; /* protection flags (see below) */
750 IN
int inherit
; /* inherit flag */
751 IN
int file_handle
; /* file handle */
752 OUT
int handle
; /* handle to the mapping */
753 IN WCHAR name
[1]; /* object name */
755 /* protection flags */
756 #define VPROT_READ 0x01
757 #define VPROT_WRITE 0x02
758 #define VPROT_EXEC 0x04
759 #define VPROT_WRITECOPY 0x08
760 #define VPROT_GUARD 0x10
761 #define VPROT_NOCACHE 0x20
762 #define VPROT_COMMITTED 0x40
766 struct open_mapping_request
768 IN
unsigned int access
; /* wanted access rights */
769 IN
int inherit
; /* inherit flag */
770 OUT
int handle
; /* handle to the mapping */
771 IN WCHAR name
[1]; /* object name */
775 /* Get information about a file mapping */
776 struct get_mapping_info_request
778 IN
int handle
; /* handle to the mapping */
779 OUT
int size_high
; /* mapping size */
780 OUT
int size_low
; /* mapping size */
781 OUT
int protect
; /* protection flags */
785 /* Create a device */
786 struct create_device_request
788 IN
unsigned int access
; /* wanted access rights */
789 IN
int inherit
; /* inherit flag */
790 IN
int id
; /* client private id */
791 OUT
int handle
; /* handle to the device */
795 /* Create a snapshot */
796 struct create_snapshot_request
798 IN
int inherit
; /* inherit flag */
799 IN
int flags
; /* snapshot flags (TH32CS_*) */
800 IN
void* pid
; /* process id */
801 OUT
int handle
; /* handle to the snapshot */
805 /* Get the next process from a snapshot */
806 struct next_process_request
808 IN
int handle
; /* handle to the snapshot */
809 IN
int reset
; /* reset snapshot position? */
810 OUT
int count
; /* process usage count */
811 OUT
void* pid
; /* process id */
812 OUT
int threads
; /* number of threads */
813 OUT
int priority
; /* process priority */
817 /* Get the next thread from a snapshot */
818 struct next_thread_request
820 IN
int handle
; /* handle to the snapshot */
821 IN
int reset
; /* reset snapshot position? */
822 OUT
int count
; /* thread usage count */
823 OUT
void* pid
; /* process id */
824 OUT
void* tid
; /* thread id */
825 OUT
int base_pri
; /* base priority */
826 OUT
int delta_pri
; /* delta priority */
830 /* Get the next module from a snapshot */
831 struct next_module_request
833 IN
int handle
; /* handle to the snapshot */
834 IN
int reset
; /* reset snapshot position? */
835 OUT
void* pid
; /* process id */
836 OUT
void* base
; /* module base address */
840 /* Wait for a debug event */
841 struct wait_debug_event_request
843 IN
int timeout
; /* timeout in ms */
844 OUT
void* pid
; /* process id */
845 OUT
void* tid
; /* thread id */
846 OUT debug_event_t event
; /* debug event data */
850 /* Send an exception event */
851 struct exception_event_request
853 IN EXCEPTION_RECORD record
; /* exception record */
854 IN
int first
; /* first chance exception? */
855 IN CONTEXT context
; /* thread context */
856 OUT
int status
; /* event continuation status */
860 /* Send an output string to the debugger */
861 struct output_debug_string_request
863 IN
void* string
; /* string to display (in debugged process address space) */
864 IN
int unicode
; /* is it Unicode? */
865 IN
int length
; /* string length */
869 /* Continue a debug event */
870 struct continue_debug_event_request
872 IN
void* pid
; /* process id to continue */
873 IN
void* tid
; /* thread id to continue */
874 IN
int status
; /* continuation status */
878 /* Start debugging an existing process */
879 struct debug_process_request
881 IN
void* pid
; /* id of the process to debug */
885 /* Read data from a process address space */
886 struct read_process_memory_request
888 IN
int handle
; /* process handle */
889 IN
void* addr
; /* addr to read from (must be int-aligned) */
890 IN
int len
; /* number of ints to read */
891 OUT
unsigned int data
[1]; /* result data */
895 /* Write data to a process address space */
896 struct write_process_memory_request
898 IN
int handle
; /* process handle */
899 IN
void* addr
; /* addr to write to (must be int-aligned) */
900 IN
int len
; /* number of ints to write */
901 IN
unsigned int first_mask
; /* mask for first word */
902 IN
unsigned int last_mask
; /* mask for last word */
903 IN
unsigned int data
[1]; /* data to write */
907 /* Create a registry key */
908 struct create_key_request
910 IN
int parent
; /* handle to the parent key */
911 IN
unsigned int access
; /* desired access rights */
912 IN
unsigned int options
; /* creation options */
913 IN
time_t modif
; /* last modification time */
914 OUT
int hkey
; /* handle to the created key */
915 OUT
int created
; /* has it been newly created? */
916 IN path_t name
; /* key name */
917 IN WCHAR
class[1]; /* class name */
921 /* Open a registry key */
922 struct open_key_request
924 IN
int parent
; /* handle to the parent key */
925 IN
unsigned int access
; /* desired access rights */
926 OUT
int hkey
; /* handle to the open key */
927 IN path_t name
; /* key name */
931 /* Delete a registry key */
932 struct delete_key_request
934 IN
int hkey
; /* handle to the parent key */
935 IN path_t name
; /* key name */
939 /* Close a registry key */
940 struct close_key_request
942 IN
int hkey
; /* key to close */
946 /* Enumerate registry subkeys */
947 struct enum_key_request
949 IN
int hkey
; /* handle to registry key */
950 IN
int index
; /* index of subkey */
951 OUT
time_t modif
; /* last modification time */
952 OUT path_t name
; /* subkey name */
953 OUT WCHAR
class[1]; /* class name */
957 /* Query information about a registry key */
958 struct query_key_info_request
960 IN
int hkey
; /* handle to registry key */
961 OUT
int subkeys
; /* number of subkeys */
962 OUT
int max_subkey
; /* longest subkey name */
963 OUT
int max_class
; /* longest class name */
964 OUT
int values
; /* number of values */
965 OUT
int max_value
; /* longest value name */
966 OUT
int max_data
; /* longest value data */
967 OUT
time_t modif
; /* last modification time */
968 OUT path_t name
; /* key name */
969 OUT WCHAR
class[1]; /* class name */
973 /* Set a value of a registry key */
974 struct set_key_value_request
976 IN
int hkey
; /* handle to registry key */
977 IN
int type
; /* value type */
978 IN
unsigned int total
; /* total value len */
979 IN
unsigned int offset
; /* offset for setting data */
980 IN
unsigned int len
; /* value data len */
981 IN path_t name
; /* value name */
982 IN
unsigned char data
[1]; /* value data */
986 /* Retrieve the value of a registry key */
987 struct get_key_value_request
989 IN
int hkey
; /* handle to registry key */
990 IN
unsigned int offset
; /* offset for getting data */
991 OUT
int type
; /* value type */
992 OUT
int len
; /* value data len */
993 IN WCHAR name
[1]; /* value name */
994 OUT
unsigned char data
[1]; /* value data */
998 /* Enumerate a value of a registry key */
999 struct enum_key_value_request
1001 IN
int hkey
; /* handle to registry key */
1002 IN
int index
; /* value index */
1003 IN
unsigned int offset
; /* offset for getting data */
1004 OUT
int type
; /* value type */
1005 OUT
int len
; /* value data len */
1006 OUT path_t name
; /* value name */
1007 OUT
unsigned char data
[1]; /* value data */
1011 /* Delete a value of a registry key */
1012 struct delete_key_value_request
1014 IN
int hkey
; /* handle to registry key */
1015 IN path_t name
; /* value name */
1019 /* Load a registry branch from a file */
1020 struct load_registry_request
1022 IN
int hkey
; /* root key to load to */
1023 IN
int file
; /* file to load from */
1024 IN path_t name
; /* subkey name */
1028 /* Save a registry branch to a file */
1029 struct save_registry_request
1031 IN
int hkey
; /* key to save */
1032 IN
int file
; /* file to save to */
1036 /* Save a registry branch at server exit */
1037 struct save_registry_atexit_request
1039 IN
int hkey
; /* key to save */
1040 IN
char file
[1]; /* file to save to */
1044 /* Set the current and saving level for the registry */
1045 struct set_registry_levels_request
1047 IN
int current
; /* new current level */
1048 IN
int saving
; /* new saving level */
1049 IN
int period
; /* duration between periodic saves (milliseconds) */
1053 /* Create a waitable timer */
1054 struct create_timer_request
1056 IN
int inherit
; /* inherit flag */
1057 IN
int manual
; /* manual reset */
1058 OUT
int handle
; /* handle to the timer */
1059 IN WCHAR name
[1]; /* timer name */
1063 /* Open a waitable timer */
1064 struct open_timer_request
1066 IN
unsigned int access
; /* wanted access rights */
1067 IN
int inherit
; /* inherit flag */
1068 OUT
int handle
; /* handle to the timer */
1069 IN WCHAR name
[1]; /* timer name */
1072 /* Set a waitable timer */
1073 struct set_timer_request
1075 IN
int handle
; /* handle to the timer */
1076 IN
int sec
; /* next expiration absolute time */
1077 IN
int usec
; /* next expiration absolute time */
1078 IN
int period
; /* timer period in ms */
1079 IN
void* callback
; /* callback function */
1080 IN
void* arg
; /* callback argument */
1083 /* Cancel a waitable timer */
1084 struct cancel_timer_request
1086 IN
int handle
; /* handle to the timer */
1090 /* Retrieve the current context of a thread */
1091 struct get_thread_context_request
1093 IN
int handle
; /* thread handle */
1094 IN
unsigned int flags
; /* context flags */
1095 OUT CONTEXT context
; /* thread context */
1099 /* Set the current context of a thread */
1100 struct set_thread_context_request
1102 IN
int handle
; /* thread handle */
1103 IN
unsigned int flags
; /* context flags */
1104 IN CONTEXT context
; /* thread context */
1108 /* Fetch a selector entry for a thread */
1109 struct get_selector_entry_request
1111 IN
int handle
; /* thread handle */
1112 IN
int entry
; /* LDT entry */
1113 OUT
unsigned int base
; /* selector base */
1114 OUT
unsigned int limit
; /* selector limit */
1115 OUT
unsigned char flags
; /* selector flags */
1119 /* Add a global atom */
1120 struct add_atom_request
1122 OUT
int atom
; /* resulting atom */
1123 IN WCHAR name
[1]; /* atom name */
1127 /* Delete a global atom */
1128 struct delete_atom_request
1130 IN
int atom
; /* atom handle */
1134 /* Find a global atom */
1135 struct find_atom_request
1137 OUT
int atom
; /* atom handle */
1138 IN WCHAR name
[1]; /* atom name */
1142 /* Get a global atom name */
1143 struct get_atom_name_request
1145 IN
int atom
; /* atom handle */
1146 OUT
int count
; /* atom lock count */
1147 OUT WCHAR name
[1]; /* atom name */
1150 /* Everything below this line is generated automatically by tools/make_requests */
1151 /* ### make_requests begin ### */
1160 REQ_INIT_PROCESS_DONE
,
1162 REQ_GET_THREAD_BUFFER
,
1163 REQ_TERMINATE_PROCESS
,
1164 REQ_TERMINATE_THREAD
,
1165 REQ_GET_PROCESS_INFO
,
1166 REQ_SET_PROCESS_INFO
,
1167 REQ_GET_THREAD_INFO
,
1168 REQ_SET_THREAD_INFO
,
1176 REQ_GET_HANDLE_INFO
,
1177 REQ_SET_HANDLE_INFO
,
1187 REQ_CREATE_SEMAPHORE
,
1188 REQ_RELEASE_SEMAPHORE
,
1191 REQ_ALLOC_FILE_HANDLE
,
1194 REQ_SET_FILE_POINTER
,
1204 REQ_SET_SOCKET_EVENT
,
1205 REQ_GET_SOCKET_EVENT
,
1206 REQ_ENABLE_SOCKET_EVENT
,
1211 REQ_GET_CONSOLE_MODE
,
1212 REQ_SET_CONSOLE_MODE
,
1213 REQ_SET_CONSOLE_INFO
,
1214 REQ_GET_CONSOLE_INFO
,
1215 REQ_WRITE_CONSOLE_INPUT
,
1216 REQ_READ_CONSOLE_INPUT
,
1217 REQ_CREATE_CHANGE_NOTIFICATION
,
1220 REQ_GET_MAPPING_INFO
,
1222 REQ_CREATE_SNAPSHOT
,
1226 REQ_WAIT_DEBUG_EVENT
,
1227 REQ_EXCEPTION_EVENT
,
1228 REQ_OUTPUT_DEBUG_STRING
,
1229 REQ_CONTINUE_DEBUG_EVENT
,
1231 REQ_READ_PROCESS_MEMORY
,
1232 REQ_WRITE_PROCESS_MEMORY
,
1242 REQ_DELETE_KEY_VALUE
,
1245 REQ_SAVE_REGISTRY_ATEXIT
,
1246 REQ_SET_REGISTRY_LEVELS
,
1251 REQ_GET_THREAD_CONTEXT
,
1252 REQ_SET_THREAD_CONTEXT
,
1253 REQ_GET_SELECTOR_ENTRY
,
1261 #define SERVER_PROTOCOL_VERSION 12
1263 /* ### make_requests end ### */
1264 /* Everything above this line is generated automatically by tools/make_requests */
1267 /* client-side functions */
1269 #ifndef __WINE_SERVER__
1274 /* client communication functions */
1276 extern unsigned int server_call_noerr( enum request req
);
1277 extern unsigned int server_call_fd( enum request req
, int fd_out
, int *fd_in
);
1278 extern void server_protocol_error( const char *err
, ... ) WINE_NORETURN
;
1279 extern const char *get_config_dir(void);
1281 /* get a pointer to the request buffer */
1282 static inline void * WINE_UNUSED
get_req_buffer(void)
1284 return NtCurrentTeb()->buffer
;
1287 /* maximum remaining size in the server buffer */
1288 static inline int WINE_UNUSED
server_remaining( const void *ptr
)
1290 return (char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
- (char *)ptr
;
1293 /* do a server call and set the last error code */
1294 static inline int server_call( enum request req
)
1296 unsigned int res
= server_call_noerr( req
);
1297 if (res
) SetLastError( RtlNtStatusToDosError(res
) );
1301 /* copy a Unicode string to the server buffer */
1302 static inline void server_strcpyW( WCHAR
*dst
, const WCHAR
*src
)
1306 WCHAR
*end
= (WCHAR
*)((char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
) - 1;
1307 while ((dst
< end
) && *src
) *dst
++ = *src
++;
1312 /* copy and convert an ASCII string to the server buffer */
1313 static inline void server_strcpyAtoW( WCHAR
*dst
, const char *src
)
1317 WCHAR
*end
= (WCHAR
*)((char *)NtCurrentTeb()->buffer
+ NtCurrentTeb()->buffer_size
) - 1;
1318 while ((dst
< end
) && *src
) *dst
++ = (WCHAR
)(unsigned char)*src
++;
1323 extern int CLIENT_InitServer(void);
1324 extern int CLIENT_BootDone( int debug_level
);
1325 extern int CLIENT_IsBootThread(void);
1326 extern int CLIENT_InitThread(void);
1327 #endif /* __WINE_SERVER__ */
1329 #endif /* __WINE_SERVER_H */