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*/
25 #define VARARG(name,func) /*nothing*/
29 IN
int req
; /* request code */
30 IN
unsigned short var_offset
; /* offset of the variable part of the request */
31 IN
unsigned short var_size
; /* size of the variable part of the request */
32 OUT
unsigned int error
; /* error result */
34 #define REQUEST_HEADER struct request_header header
37 /* placeholder structure for the maximum allowed request size */
38 /* this is used to construct the generic_request union */
39 struct request_max_size
41 int pad
[16]; /* the max request size is 16 ints */
44 /* max size of the variable part of a request */
45 #define REQUEST_MAX_VAR_SIZE 1024
49 /* definitions of the event data depending on the event code */
50 struct debug_event_exception
52 EXCEPTION_RECORD record
; /* exception record */
53 int first
; /* first chance exception? */
55 struct debug_event_create_thread
57 handle_t handle
; /* handle to the new thread */
58 void *teb
; /* thread teb (in debugged process address space) */
59 void *start
; /* thread startup routine */
61 struct debug_event_create_process
63 handle_t file
; /* handle to the process exe file */
64 handle_t process
; /* handle to the new process */
65 handle_t thread
; /* handle to the new thread */
66 void *base
; /* base of executable image */
67 int dbg_offset
; /* offset of debug info in file */
68 int dbg_size
; /* size of debug info */
69 void *teb
; /* thread teb (in debugged process address space) */
70 void *start
; /* thread startup routine */
71 void *name
; /* image name (optional) */
72 int unicode
; /* is it Unicode? */
74 struct debug_event_exit
76 int exit_code
; /* thread or process exit code */
78 struct debug_event_load_dll
80 handle_t handle
; /* file handle for the dll */
81 void *base
; /* base address of the dll */
82 int dbg_offset
; /* offset of debug info in file */
83 int dbg_size
; /* size of debug info */
84 void *name
; /* image name (optional) */
85 int unicode
; /* is it Unicode? */
87 struct debug_event_unload_dll
89 void *base
; /* base address of the dll */
91 struct debug_event_output_string
93 void *string
; /* string to display (in debugged process address space) */
94 int unicode
; /* is it Unicode? */
95 int length
; /* string length */
97 struct debug_event_rip_info
102 union debug_event_data
104 struct debug_event_exception exception
;
105 struct debug_event_create_thread create_thread
;
106 struct debug_event_create_process create_process
;
107 struct debug_event_exit exit
;
108 struct debug_event_load_dll load_dll
;
109 struct debug_event_unload_dll unload_dll
;
110 struct debug_event_output_string output_string
;
111 struct debug_event_rip_info rip_info
;
114 /* debug event data */
117 int code
; /* event code */
118 union debug_event_data info
; /* event information */
121 /* structure used in sending an fd from client to server */
124 void *tid
; /* thread id */
125 int fd
; /* file descriptor on client-side */
128 /* structure sent by the server on the wait fifo */
131 void *cookie
; /* magic cookie that was passed in select_request */
132 int signaled
; /* wait result */
135 /* Create a new process from the context of the parent */
136 struct new_process_request
138 REQUEST_HEADER
; /* request header */
139 IN
int inherit_all
; /* inherit all handles from parent */
140 IN
int create_flags
; /* creation flags */
141 IN
int start_flags
; /* flags from startup info */
142 IN handle_t exe_file
; /* file handle for main exe */
143 IN handle_t hstdin
; /* handle for stdin */
144 IN handle_t hstdout
; /* handle for stdout */
145 IN handle_t hstderr
; /* handle for stderr */
146 IN
int cmd_show
; /* main window show mode */
147 OUT handle_t info
; /* new process info handle */
148 IN
VARARG(filename
,string
); /* file name of main exe */
152 /* Retrieve information about a newly started process */
153 struct get_new_process_info_request
155 REQUEST_HEADER
; /* request header */
156 IN handle_t info
; /* info handle returned from new_process_request */
157 IN
int pinherit
; /* process handle inherit flag */
158 IN
int tinherit
; /* thread handle inherit flag */
159 OUT
void* pid
; /* process id */
160 OUT handle_t phandle
; /* process handle (in the current process) */
161 OUT
void* tid
; /* thread id */
162 OUT handle_t thandle
; /* thread handle (in the current process) */
163 OUT handle_t event
; /* event handle to signal startup */
167 /* Create a new thread from the context of the parent */
168 struct new_thread_request
170 REQUEST_HEADER
; /* request header */
171 IN
int suspend
; /* new thread should be suspended on creation */
172 IN
int inherit
; /* inherit flag */
173 IN
int request_fd
; /* fd for request pipe */
174 OUT
void* tid
; /* thread id */
175 OUT handle_t handle
; /* thread handle (in the current process) */
179 /* Signal that we are finished booting on the client side */
180 struct boot_done_request
182 REQUEST_HEADER
; /* request header */
183 IN
int debug_level
; /* new debug level */
187 /* Initialize a process; called from the new process context */
188 struct init_process_request
190 REQUEST_HEADER
; /* request header */
191 IN
void* ldt_copy
; /* addr of LDT copy */
192 IN
int ppid
; /* parent Unix pid */
193 OUT
int create_flags
; /* creation flags */
194 OUT
int start_flags
; /* flags from startup info */
195 OUT
unsigned int server_start
; /* server start time (GetTickCount) */
196 OUT handle_t exe_file
; /* file handle for main exe */
197 OUT handle_t hstdin
; /* handle for stdin */
198 OUT handle_t hstdout
; /* handle for stdout */
199 OUT handle_t hstderr
; /* handle for stderr */
200 OUT
int cmd_show
; /* main window show mode */
201 OUT
VARARG(filename
,string
); /* file name of main exe */
205 /* Signal the end of the process initialization */
206 struct init_process_done_request
208 REQUEST_HEADER
; /* request header */
209 IN
void* module
; /* main module base address */
210 IN
void* entry
; /* process entry point */
211 IN
void* name
; /* ptr to ptr to name (in process addr space) */
212 IN handle_t exe_file
; /* file handle for main exe */
213 IN
int gui
; /* is it a GUI process? */
214 OUT
int debugged
; /* being debugged? */
218 /* Initialize a thread; called from the child after fork()/clone() */
219 struct init_thread_request
221 REQUEST_HEADER
; /* request header */
222 IN
int unix_pid
; /* Unix pid of new thread */
223 IN
void* teb
; /* TEB of new thread (in thread address space) */
224 IN
void* entry
; /* thread entry point (in thread address space) */
225 IN
int reply_fd
; /* fd for reply pipe */
226 IN
int wait_fd
; /* fd for blocking calls pipe */
227 OUT
void* pid
; /* process id of the new thread's process */
228 OUT
void* tid
; /* thread id of the new thread */
229 OUT
int boot
; /* is this the boot thread? */
230 OUT
int version
; /* protocol version */
234 /* Set the shared buffer for a thread */
235 struct set_thread_buffer_request
238 IN
int fd
; /* fd to mmap as shared buffer */
239 OUT
unsigned int offset
; /* offset of buffer in file */
240 OUT
unsigned int size
; /* size of buffer */
244 /* Terminate a process */
245 struct terminate_process_request
247 REQUEST_HEADER
; /* request header */
248 IN handle_t handle
; /* process handle to terminate */
249 IN
int exit_code
; /* process exit code */
250 OUT
int self
; /* suicide? */
254 /* Terminate a thread */
255 struct terminate_thread_request
257 REQUEST_HEADER
; /* request header */
258 IN handle_t handle
; /* thread handle to terminate */
259 IN
int exit_code
; /* thread exit code */
260 OUT
int self
; /* suicide? */
261 OUT
int last
; /* last thread in this process? */
265 /* Retrieve information about a process */
266 struct get_process_info_request
268 REQUEST_HEADER
; /* request header */
269 IN handle_t handle
; /* process handle */
270 OUT
void* pid
; /* server process id */
271 OUT
int debugged
; /* debugged? */
272 OUT
int exit_code
; /* process exit code */
273 OUT
int priority
; /* priority class */
274 OUT
int process_affinity
; /* process affinity mask */
275 OUT
int system_affinity
; /* system affinity mask */
279 /* Set a process informations */
280 struct set_process_info_request
282 REQUEST_HEADER
; /* request header */
283 IN handle_t handle
; /* process handle */
284 IN
int mask
; /* setting mask (see below) */
285 IN
int priority
; /* priority class */
286 IN
int affinity
; /* affinity mask */
288 #define SET_PROCESS_INFO_PRIORITY 0x01
289 #define SET_PROCESS_INFO_AFFINITY 0x02
292 /* Retrieve information about a thread */
293 struct get_thread_info_request
295 REQUEST_HEADER
; /* request header */
296 IN handle_t handle
; /* thread handle */
297 IN
void* tid_in
; /* thread id (optional) */
298 OUT
void* tid
; /* server thread id */
299 OUT
void* teb
; /* thread teb pointer */
300 OUT
int exit_code
; /* thread exit code */
301 OUT
int priority
; /* thread priority level */
305 /* Set a thread informations */
306 struct set_thread_info_request
308 REQUEST_HEADER
; /* request header */
309 IN handle_t handle
; /* thread handle */
310 IN
int mask
; /* setting mask (see below) */
311 IN
int priority
; /* priority class */
312 IN
int affinity
; /* affinity mask */
314 #define SET_THREAD_INFO_PRIORITY 0x01
315 #define SET_THREAD_INFO_AFFINITY 0x02
318 /* Suspend a thread */
319 struct suspend_thread_request
321 REQUEST_HEADER
; /* request header */
322 IN handle_t handle
; /* thread handle */
323 OUT
int count
; /* new suspend count */
327 /* Resume a thread */
328 struct resume_thread_request
330 REQUEST_HEADER
; /* request header */
331 IN handle_t handle
; /* thread handle */
332 OUT
int count
; /* new suspend count */
336 /* Notify the server that a dll has been loaded */
337 struct load_dll_request
339 REQUEST_HEADER
; /* request header */
340 IN handle_t handle
; /* file handle */
341 IN
void* base
; /* base address */
342 IN
int dbg_offset
; /* debug info offset */
343 IN
int dbg_size
; /* debug info size */
344 IN
void* name
; /* ptr to ptr to name (in process addr space) */
348 /* Notify the server that a dll is being unloaded */
349 struct unload_dll_request
351 REQUEST_HEADER
; /* request header */
352 IN
void* base
; /* base address */
356 /* Queue an APC for a thread */
357 struct queue_apc_request
359 REQUEST_HEADER
; /* request header */
360 IN handle_t handle
; /* thread handle */
361 IN
int user
; /* user or system apc? */
362 IN
void* func
; /* function to call */
363 IN
void* param
; /* param for function to call */
367 /* Get next APC to call */
368 struct get_apc_request
370 REQUEST_HEADER
; /* request header */
371 IN
int alertable
; /* is thread alertable? */
372 OUT
void* func
; /* function to call */
373 OUT
int type
; /* function type */
374 OUT
VARARG(args
,ptrs
); /* function arguments */
376 enum apc_type
{ APC_NONE
, APC_USER
, APC_TIMER
, APC_ASYNC
};
379 /* Close a handle for the current process */
380 struct close_handle_request
382 REQUEST_HEADER
; /* request header */
383 IN handle_t handle
; /* handle to close */
384 OUT
int fd
; /* associated fd to close */
388 /* Set a handle information */
389 struct set_handle_info_request
391 REQUEST_HEADER
; /* request header */
392 IN handle_t handle
; /* handle we are interested in */
393 IN
int flags
; /* new handle flags */
394 IN
int mask
; /* mask for flags to set */
395 IN
int fd
; /* file descriptor or -1 */
396 OUT
int old_flags
; /* old flag value */
397 OUT
int cur_fd
; /* current file descriptor */
401 /* Duplicate a handle */
402 struct dup_handle_request
404 REQUEST_HEADER
; /* request header */
405 IN handle_t src_process
; /* src process handle */
406 IN handle_t src_handle
; /* src handle to duplicate */
407 IN handle_t dst_process
; /* dst process handle */
408 IN
unsigned int access
; /* wanted access rights */
409 IN
int inherit
; /* inherit flag */
410 IN
int options
; /* duplicate options (see below) */
411 OUT handle_t handle
; /* duplicated handle in dst process */
412 OUT
int fd
; /* associated fd to close */
414 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
415 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
416 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
419 /* Open a handle to a process */
420 struct open_process_request
422 REQUEST_HEADER
; /* request header */
423 IN
void* pid
; /* process id to open */
424 IN
unsigned int access
; /* wanted access rights */
425 IN
int inherit
; /* inherit flag */
426 OUT handle_t handle
; /* handle to the process */
430 /* Wait for handles */
431 struct select_request
433 REQUEST_HEADER
; /* request header */
434 IN
int flags
; /* wait flags (see below) */
435 IN
void* cookie
; /* magic cookie to return to client */
436 IN
int sec
; /* absolute timeout */
437 IN
int usec
; /* absolute timeout */
438 IN
VARARG(handles
,handles
); /* handles to select on */
441 #define SELECT_ALERTABLE 2
442 #define SELECT_INTERRUPTIBLE 4
443 #define SELECT_TIMEOUT 8
446 /* Create an event */
447 struct create_event_request
449 REQUEST_HEADER
; /* request header */
450 IN
int manual_reset
; /* manual reset event */
451 IN
int initial_state
; /* initial state of the event */
452 IN
int inherit
; /* inherit flag */
453 OUT handle_t handle
; /* handle to the event */
454 IN
VARARG(name
,unicode_str
); /* object name */
457 /* Event operation */
458 struct event_op_request
460 REQUEST_HEADER
; /* request header */
461 IN handle_t handle
; /* handle to event */
462 IN
int op
; /* event operation (see below) */
464 enum event_op
{ PULSE_EVENT
, SET_EVENT
, RESET_EVENT
};
468 struct open_event_request
470 REQUEST_HEADER
; /* request header */
471 IN
unsigned int access
; /* wanted access rights */
472 IN
int inherit
; /* inherit flag */
473 OUT handle_t handle
; /* handle to the event */
474 IN
VARARG(name
,unicode_str
); /* object name */
479 struct create_mutex_request
481 REQUEST_HEADER
; /* request header */
482 IN
int owned
; /* initially owned? */
483 IN
int inherit
; /* inherit flag */
484 OUT handle_t handle
; /* handle to the mutex */
485 IN
VARARG(name
,unicode_str
); /* object name */
489 /* Release a mutex */
490 struct release_mutex_request
492 REQUEST_HEADER
; /* request header */
493 IN handle_t handle
; /* handle to the mutex */
498 struct open_mutex_request
500 REQUEST_HEADER
; /* request header */
501 IN
unsigned int access
; /* wanted access rights */
502 IN
int inherit
; /* inherit flag */
503 OUT handle_t handle
; /* handle to the mutex */
504 IN
VARARG(name
,unicode_str
); /* object name */
508 /* Create a semaphore */
509 struct create_semaphore_request
511 REQUEST_HEADER
; /* request header */
512 IN
unsigned int initial
; /* initial count */
513 IN
unsigned int max
; /* maximum count */
514 IN
int inherit
; /* inherit flag */
515 OUT handle_t handle
; /* handle to the semaphore */
516 IN
VARARG(name
,unicode_str
); /* object name */
520 /* Release a semaphore */
521 struct release_semaphore_request
523 REQUEST_HEADER
; /* request header */
524 IN handle_t handle
; /* handle to the semaphore */
525 IN
unsigned int count
; /* count to add to semaphore */
526 OUT
unsigned int prev_count
; /* previous semaphore count */
530 /* Open a semaphore */
531 struct open_semaphore_request
533 REQUEST_HEADER
; /* request header */
534 IN
unsigned int access
; /* wanted access rights */
535 IN
int inherit
; /* inherit flag */
536 OUT handle_t handle
; /* handle to the semaphore */
537 IN
VARARG(name
,unicode_str
); /* object name */
542 struct create_file_request
544 REQUEST_HEADER
; /* request header */
545 IN
unsigned int access
; /* wanted access rights */
546 IN
int inherit
; /* inherit flag */
547 IN
unsigned int sharing
; /* sharing flags */
548 IN
int create
; /* file create action */
549 IN
unsigned int attrs
; /* file attributes for creation */
550 OUT handle_t handle
; /* handle to the file */
551 IN
VARARG(filename
,string
); /* file name */
555 /* Allocate a file handle for a Unix fd */
556 struct alloc_file_handle_request
558 REQUEST_HEADER
; /* request header */
559 IN
unsigned int access
; /* wanted access rights */
560 IN
int fd
; /* file descriptor on the client side */
561 OUT handle_t handle
; /* handle to the file */
565 /* Get a Unix fd to access a file */
566 struct get_handle_fd_request
568 REQUEST_HEADER
; /* request header */
569 IN handle_t handle
; /* handle to the file */
570 IN
unsigned int access
; /* wanted access rights */
571 OUT
int fd
; /* file descriptor */
575 /* Set a file current position */
576 struct set_file_pointer_request
578 REQUEST_HEADER
; /* request header */
579 IN handle_t handle
; /* handle to the file */
580 IN
int low
; /* position low word */
581 IN
int high
; /* position high word */
582 IN
int whence
; /* whence to seek */
583 OUT
int new_low
; /* new position low word */
584 OUT
int new_high
; /* new position high word */
588 /* Truncate (or extend) a file */
589 struct truncate_file_request
591 REQUEST_HEADER
; /* request header */
592 IN handle_t handle
; /* handle to the file */
596 /* Set a file access and modification times */
597 struct set_file_time_request
599 REQUEST_HEADER
; /* request header */
600 IN handle_t handle
; /* handle to the file */
601 IN
time_t access_time
; /* last access time */
602 IN
time_t write_time
; /* last write time */
606 /* Flush a file buffers */
607 struct flush_file_request
609 REQUEST_HEADER
; /* request header */
610 IN handle_t handle
; /* handle to the file */
614 /* Get information about a file */
615 struct get_file_info_request
617 REQUEST_HEADER
; /* request header */
618 IN handle_t handle
; /* handle to the file */
619 OUT
int type
; /* file type */
620 OUT
int attr
; /* file attributes */
621 OUT
time_t access_time
; /* last access time */
622 OUT
time_t write_time
; /* last write time */
623 OUT
int size_high
; /* file size */
624 OUT
int size_low
; /* file size */
625 OUT
int links
; /* number of links */
626 OUT
int index_high
; /* unique index */
627 OUT
int index_low
; /* unique index */
628 OUT
unsigned int serial
; /* volume serial number */
632 /* Lock a region of a file */
633 struct lock_file_request
635 REQUEST_HEADER
; /* request header */
636 IN handle_t handle
; /* handle to the file */
637 IN
unsigned int offset_low
; /* offset of start of lock */
638 IN
unsigned int offset_high
; /* offset of start of lock */
639 IN
unsigned int count_low
; /* count of bytes to lock */
640 IN
unsigned int count_high
; /* count of bytes to lock */
644 /* Unlock a region of a file */
645 struct unlock_file_request
647 REQUEST_HEADER
; /* request header */
648 IN handle_t handle
; /* handle to the file */
649 IN
unsigned int offset_low
; /* offset of start of unlock */
650 IN
unsigned int offset_high
; /* offset of start of unlock */
651 IN
unsigned int count_low
; /* count of bytes to unlock */
652 IN
unsigned int count_high
; /* count of bytes to unlock */
656 /* Create an anonymous pipe */
657 struct create_pipe_request
659 REQUEST_HEADER
; /* request header */
660 IN
int inherit
; /* inherit flag */
661 OUT handle_t handle_read
; /* handle to the read-side of the pipe */
662 OUT handle_t handle_write
; /* handle to the write-side of the pipe */
666 /* Create a socket */
667 struct create_socket_request
669 REQUEST_HEADER
; /* request header */
670 IN
unsigned int access
; /* wanted access rights */
671 IN
int inherit
; /* inherit flag */
672 IN
int family
; /* family, see socket manpage */
673 IN
int type
; /* type, see socket manpage */
674 IN
int protocol
; /* protocol, see socket manpage */
675 OUT handle_t handle
; /* handle to the new socket */
679 /* Accept a socket */
680 struct accept_socket_request
682 REQUEST_HEADER
; /* request header */
683 IN handle_t lhandle
; /* handle to the listening socket */
684 IN
unsigned int access
; /* wanted access rights */
685 IN
int inherit
; /* inherit flag */
686 OUT handle_t handle
; /* handle to the new socket */
690 /* Set socket event parameters */
691 struct set_socket_event_request
693 REQUEST_HEADER
; /* request header */
694 IN handle_t handle
; /* handle to the socket */
695 IN
unsigned int mask
; /* event mask */
696 IN handle_t event
; /* event object */
700 /* Get socket event parameters */
701 struct get_socket_event_request
703 REQUEST_HEADER
; /* request header */
704 IN handle_t handle
; /* handle to the socket */
705 IN
int service
; /* clear pending? */
706 IN handle_t s_event
; /* "expected" event object */
707 IN handle_t c_event
; /* event to clear */
708 OUT
unsigned int mask
; /* event mask */
709 OUT
unsigned int pmask
; /* pending events */
710 OUT
unsigned int state
; /* status bits */
711 OUT
VARARG(errors
,ints
); /* event errors */
715 /* Reenable pending socket events */
716 struct enable_socket_event_request
718 REQUEST_HEADER
; /* request header */
719 IN handle_t handle
; /* handle to the socket */
720 IN
unsigned int mask
; /* events to re-enable */
721 IN
unsigned int sstate
; /* status bits to set */
722 IN
unsigned int cstate
; /* status bits to clear */
726 /* Allocate a console for the current process */
727 struct alloc_console_request
729 REQUEST_HEADER
; /* request header */
730 IN
unsigned int access
; /* wanted access rights */
731 IN
int inherit
; /* inherit flag */
732 OUT handle_t handle_in
; /* handle to console input */
733 OUT handle_t handle_out
; /* handle to console output */
737 /* Free the console of the current process */
738 struct free_console_request
740 REQUEST_HEADER
; /* request header */
744 /* Open a handle to the process console */
745 struct open_console_request
747 REQUEST_HEADER
; /* request header */
748 IN
int output
; /* input or output? */
749 IN
unsigned int access
; /* wanted access rights */
750 IN
int inherit
; /* inherit flag */
751 OUT handle_t handle
; /* handle to the console */
755 /* Set a console file descriptor */
756 struct set_console_fd_request
758 REQUEST_HEADER
; /* request header */
759 IN handle_t handle
; /* handle to the console */
760 IN handle_t handle_in
; /* handle of file to use as input */
761 IN handle_t handle_out
; /* handle of file to use as output */
762 IN
int pid
; /* pid of xterm (hack) */
766 /* Get a console mode (input or output) */
767 struct get_console_mode_request
769 REQUEST_HEADER
; /* request header */
770 IN handle_t handle
; /* handle to the console */
771 OUT
int mode
; /* console mode */
775 /* Set a console mode (input or output) */
776 struct set_console_mode_request
778 REQUEST_HEADER
; /* request header */
779 IN handle_t handle
; /* handle to the console */
780 IN
int mode
; /* console mode */
784 /* Set info about a console (output only) */
785 struct set_console_info_request
787 REQUEST_HEADER
; /* request header */
788 IN handle_t handle
; /* handle to the console */
789 IN
int mask
; /* setting mask (see below) */
790 IN
int cursor_size
; /* size of cursor (percentage filled) */
791 IN
int cursor_visible
;/* cursor visibility flag */
792 IN
VARARG(title
,string
); /* console title */
794 #define SET_CONSOLE_INFO_CURSOR 0x01
795 #define SET_CONSOLE_INFO_TITLE 0x02
797 /* Get info about a console (output only) */
798 struct get_console_info_request
800 REQUEST_HEADER
; /* request header */
801 IN handle_t handle
; /* handle to the console */
802 OUT
int cursor_size
; /* size of cursor (percentage filled) */
803 OUT
int cursor_visible
;/* cursor visibility flag */
804 OUT
int pid
; /* pid of xterm (hack) */
805 OUT
VARARG(title
,string
); /* console title */
809 /* Add input records to a console input queue */
810 struct write_console_input_request
812 REQUEST_HEADER
; /* request header */
813 IN handle_t handle
; /* handle to the console input */
814 OUT
int written
; /* number of records written */
815 IN
VARARG(rec
,input_records
); /* input records */
818 /* Fetch input records from a console input queue */
819 struct read_console_input_request
821 REQUEST_HEADER
; /* request header */
822 IN handle_t handle
; /* handle to the console input */
823 IN
int flush
; /* flush the retrieved records from the queue? */
824 OUT
int read
; /* number of records read */
825 OUT
VARARG(rec
,input_records
); /* input records */
829 /* Create a change notification */
830 struct create_change_notification_request
832 REQUEST_HEADER
; /* request header */
833 IN
int subtree
; /* watch all the subtree */
834 IN
int filter
; /* notification filter */
835 OUT handle_t handle
; /* handle to the change notification */
839 /* Create a file mapping */
840 struct create_mapping_request
842 REQUEST_HEADER
; /* request header */
843 IN
int size_high
; /* mapping size */
844 IN
int size_low
; /* mapping size */
845 IN
int protect
; /* protection flags (see below) */
846 IN
int inherit
; /* inherit flag */
847 IN handle_t file_handle
; /* file handle */
848 OUT handle_t handle
; /* handle to the mapping */
849 IN
VARARG(name
,unicode_str
); /* object name */
851 /* protection flags */
852 #define VPROT_READ 0x01
853 #define VPROT_WRITE 0x02
854 #define VPROT_EXEC 0x04
855 #define VPROT_WRITECOPY 0x08
856 #define VPROT_GUARD 0x10
857 #define VPROT_NOCACHE 0x20
858 #define VPROT_COMMITTED 0x40
859 #define VPROT_IMAGE 0x80
863 struct open_mapping_request
865 REQUEST_HEADER
; /* request header */
866 IN
unsigned int access
; /* wanted access rights */
867 IN
int inherit
; /* inherit flag */
868 OUT handle_t handle
; /* handle to the mapping */
869 IN
VARARG(name
,unicode_str
); /* object name */
873 /* Get information about a file mapping */
874 struct get_mapping_info_request
876 REQUEST_HEADER
; /* request header */
877 IN handle_t handle
; /* handle to the mapping */
878 OUT
int size_high
; /* mapping size */
879 OUT
int size_low
; /* mapping size */
880 OUT
int protect
; /* protection flags */
881 OUT
int header_size
; /* header size (for VPROT_IMAGE mapping) */
882 OUT
void* base
; /* default base addr (for VPROT_IMAGE mapping) */
883 OUT handle_t shared_file
; /* shared mapping file handle */
884 OUT
int shared_size
; /* shared mapping size */
888 /* Create a device */
889 struct create_device_request
891 REQUEST_HEADER
; /* request header */
892 IN
unsigned int access
; /* wanted access rights */
893 IN
int inherit
; /* inherit flag */
894 IN
int id
; /* client private id */
895 OUT handle_t handle
; /* handle to the device */
899 /* Create a snapshot */
900 struct create_snapshot_request
902 REQUEST_HEADER
; /* request header */
903 IN
int inherit
; /* inherit flag */
904 IN
int flags
; /* snapshot flags (TH32CS_*) */
905 IN
void* pid
; /* process id */
906 OUT handle_t handle
; /* handle to the snapshot */
910 /* Get the next process from a snapshot */
911 struct next_process_request
913 REQUEST_HEADER
; /* request header */
914 IN handle_t handle
; /* handle to the snapshot */
915 IN
int reset
; /* reset snapshot position? */
916 OUT
int count
; /* process usage count */
917 OUT
void* pid
; /* process id */
918 OUT
int threads
; /* number of threads */
919 OUT
int priority
; /* process priority */
923 /* Get the next thread from a snapshot */
924 struct next_thread_request
926 REQUEST_HEADER
; /* request header */
927 IN handle_t handle
; /* handle to the snapshot */
928 IN
int reset
; /* reset snapshot position? */
929 OUT
int count
; /* thread usage count */
930 OUT
void* pid
; /* process id */
931 OUT
void* tid
; /* thread id */
932 OUT
int base_pri
; /* base priority */
933 OUT
int delta_pri
; /* delta priority */
937 /* Get the next module from a snapshot */
938 struct next_module_request
940 REQUEST_HEADER
; /* request header */
941 IN handle_t handle
; /* handle to the snapshot */
942 IN
int reset
; /* reset snapshot position? */
943 OUT
void* pid
; /* process id */
944 OUT
void* base
; /* module base address */
948 /* Wait for a debug event */
949 struct wait_debug_event_request
951 REQUEST_HEADER
; /* request header */
952 IN
int get_handle
; /* should we alloc a handle for waiting? */
953 OUT
void* pid
; /* process id */
954 OUT
void* tid
; /* thread id */
955 OUT handle_t wait
; /* wait handle if no event ready */
956 OUT
VARARG(event
,debug_event
); /* debug event data */
960 /* Queue an exception event */
961 struct queue_exception_event_request
963 REQUEST_HEADER
; /* request header */
964 IN
int first
; /* first chance exception? */
965 OUT handle_t handle
; /* handle to the queued event */
966 IN
VARARG(record
,exc_event
); /* thread context followed by exception record */
970 /* Retrieve the status of an exception event */
971 struct get_exception_status_request
973 REQUEST_HEADER
; /* request header */
974 OUT handle_t handle
; /* handle to the queued event */
975 OUT
int status
; /* event continuation status */
976 OUT
VARARG(context
,context
); /* modified thread context */
980 /* Send an output string to the debugger */
981 struct output_debug_string_request
983 REQUEST_HEADER
; /* request header */
984 IN
void* string
; /* string to display (in debugged process address space) */
985 IN
int unicode
; /* is it Unicode? */
986 IN
int length
; /* string length */
990 /* Continue a debug event */
991 struct continue_debug_event_request
993 REQUEST_HEADER
; /* request header */
994 IN
void* pid
; /* process id to continue */
995 IN
void* tid
; /* thread id to continue */
996 IN
int status
; /* continuation status */
1000 /* Start debugging an existing process */
1001 struct debug_process_request
1003 REQUEST_HEADER
; /* request header */
1004 IN
void* pid
; /* id of the process to debug */
1008 /* Read data from a process address space */
1009 struct read_process_memory_request
1011 REQUEST_HEADER
; /* request header */
1012 IN handle_t handle
; /* process handle */
1013 IN
void* addr
; /* addr to read from (must be int-aligned) */
1014 IN
int len
; /* number of ints to read */
1015 OUT
VARARG(data
,bytes
); /* result data */
1019 /* Write data to a process address space */
1020 struct write_process_memory_request
1022 REQUEST_HEADER
; /* request header */
1023 IN handle_t handle
; /* process handle */
1024 IN
void* addr
; /* addr to write to (must be int-aligned) */
1025 IN
int len
; /* number of ints to write */
1026 IN
unsigned int first_mask
; /* mask for first word */
1027 IN
unsigned int last_mask
; /* mask for last word */
1028 IN
VARARG(data
,bytes
); /* result data */
1032 /* Create a registry key */
1033 struct create_key_request
1035 REQUEST_HEADER
; /* request header */
1036 IN handle_t parent
; /* handle to the parent key */
1037 IN
unsigned int access
; /* desired access rights */
1038 IN
unsigned int options
; /* creation options */
1039 IN
time_t modif
; /* last modification time */
1040 OUT handle_t hkey
; /* handle to the created key */
1041 OUT
int created
; /* has it been newly created? */
1042 IN
VARARG(name
,unicode_len_str
); /* key name */
1043 IN
VARARG(class,unicode_str
); /* class name */
1046 /* Open a registry key */
1047 struct open_key_request
1049 REQUEST_HEADER
; /* request header */
1050 IN handle_t parent
; /* handle to the parent key */
1051 IN
unsigned int access
; /* desired access rights */
1052 OUT handle_t hkey
; /* handle to the open key */
1053 IN
VARARG(name
,unicode_str
); /* key name */
1057 /* Delete a registry key */
1058 struct delete_key_request
1060 REQUEST_HEADER
; /* request header */
1061 IN handle_t hkey
; /* handle to the key */
1065 /* Enumerate registry subkeys */
1066 struct enum_key_request
1068 REQUEST_HEADER
; /* request header */
1069 IN handle_t hkey
; /* handle to registry key */
1070 IN
int index
; /* index of subkey (or -1 for current key) */
1071 IN
int full
; /* return the full info? */
1072 OUT
int subkeys
; /* number of subkeys */
1073 OUT
int max_subkey
; /* longest subkey name */
1074 OUT
int max_class
; /* longest class name */
1075 OUT
int values
; /* number of values */
1076 OUT
int max_value
; /* longest value name */
1077 OUT
int max_data
; /* longest value data */
1078 OUT
time_t modif
; /* last modification time */
1079 OUT
VARARG(name
,unicode_len_str
); /* key name */
1080 OUT
VARARG(class,unicode_str
); /* class name */
1084 /* Set a value of a registry key */
1085 struct set_key_value_request
1087 REQUEST_HEADER
; /* request header */
1088 IN handle_t hkey
; /* handle to registry key */
1089 IN
int type
; /* value type */
1090 IN
unsigned int total
; /* total value len */
1091 IN
unsigned int offset
; /* offset for setting data */
1092 IN
VARARG(name
,unicode_len_str
); /* value name */
1093 IN
VARARG(data
,bytes
); /* value data */
1097 /* Retrieve the value of a registry key */
1098 struct get_key_value_request
1100 REQUEST_HEADER
; /* request header */
1101 IN handle_t hkey
; /* handle to registry key */
1102 IN
unsigned int offset
; /* offset for getting data */
1103 OUT
int type
; /* value type */
1104 OUT
int len
; /* value data len */
1105 IN
VARARG(name
,unicode_len_str
); /* value name */
1106 OUT
VARARG(data
,bytes
); /* value data */
1110 /* Enumerate a value of a registry key */
1111 struct enum_key_value_request
1113 REQUEST_HEADER
; /* request header */
1114 IN handle_t hkey
; /* handle to registry key */
1115 IN
int index
; /* value index */
1116 IN
unsigned int offset
; /* offset for getting data */
1117 OUT
int type
; /* value type */
1118 OUT
int len
; /* value data len */
1119 OUT
VARARG(name
,unicode_len_str
); /* value name */
1120 OUT
VARARG(data
,bytes
); /* value data */
1124 /* Delete a value of a registry key */
1125 struct delete_key_value_request
1127 REQUEST_HEADER
; /* request header */
1128 IN handle_t hkey
; /* handle to registry key */
1129 IN
VARARG(name
,unicode_str
); /* value name */
1133 /* Load a registry branch from a file */
1134 struct load_registry_request
1136 REQUEST_HEADER
; /* request header */
1137 IN handle_t hkey
; /* root key to load to */
1138 IN handle_t file
; /* file to load from */
1139 IN
VARARG(name
,unicode_str
); /* subkey name */
1143 /* Save a registry branch to a file */
1144 struct save_registry_request
1146 REQUEST_HEADER
; /* request header */
1147 IN handle_t hkey
; /* key to save */
1148 IN handle_t file
; /* file to save to */
1152 /* Save a registry branch at server exit */
1153 struct save_registry_atexit_request
1155 REQUEST_HEADER
; /* request header */
1156 IN handle_t hkey
; /* key to save */
1157 IN
VARARG(file
,string
); /* file to save to */
1161 /* Set the current and saving level for the registry */
1162 struct set_registry_levels_request
1164 REQUEST_HEADER
; /* request header */
1165 IN
int current
; /* new current level */
1166 IN
int saving
; /* new saving level */
1167 IN
int period
; /* duration between periodic saves (milliseconds) */
1171 /* Create a waitable timer */
1172 struct create_timer_request
1174 REQUEST_HEADER
; /* request header */
1175 IN
int inherit
; /* inherit flag */
1176 IN
int manual
; /* manual reset */
1177 OUT handle_t handle
; /* handle to the timer */
1178 IN
VARARG(name
,unicode_str
); /* object name */
1182 /* Open a waitable timer */
1183 struct open_timer_request
1185 REQUEST_HEADER
; /* request header */
1186 IN
unsigned int access
; /* wanted access rights */
1187 IN
int inherit
; /* inherit flag */
1188 OUT handle_t handle
; /* handle to the timer */
1189 IN
VARARG(name
,unicode_str
); /* object name */
1192 /* Set a waitable timer */
1193 struct set_timer_request
1195 REQUEST_HEADER
; /* request header */
1196 IN handle_t handle
; /* handle to the timer */
1197 IN
int sec
; /* next expiration absolute time */
1198 IN
int usec
; /* next expiration absolute time */
1199 IN
int period
; /* timer period in ms */
1200 IN
void* callback
; /* callback function */
1201 IN
void* arg
; /* callback argument */
1204 /* Cancel a waitable timer */
1205 struct cancel_timer_request
1207 REQUEST_HEADER
; /* request header */
1208 IN handle_t handle
; /* handle to the timer */
1212 /* Retrieve the current context of a thread */
1213 struct get_thread_context_request
1215 REQUEST_HEADER
; /* request header */
1216 IN handle_t handle
; /* thread handle */
1217 IN
unsigned int flags
; /* context flags */
1218 OUT
VARARG(context
,context
); /* thread context */
1222 /* Set the current context of a thread */
1223 struct set_thread_context_request
1225 REQUEST_HEADER
; /* request header */
1226 IN handle_t handle
; /* thread handle */
1227 IN
unsigned int flags
; /* context flags */
1228 IN
VARARG(context
,context
); /* thread context */
1232 /* Fetch a selector entry for a thread */
1233 struct get_selector_entry_request
1235 REQUEST_HEADER
; /* request header */
1236 IN handle_t handle
; /* thread handle */
1237 IN
int entry
; /* LDT entry */
1238 OUT
unsigned int base
; /* selector base */
1239 OUT
unsigned int limit
; /* selector limit */
1240 OUT
unsigned char flags
; /* selector flags */
1245 struct add_atom_request
1247 REQUEST_HEADER
; /* request header */
1248 IN
int local
; /* is atom in local process table? */
1249 OUT
int atom
; /* resulting atom */
1250 IN
VARARG(name
,unicode_str
); /* atom name */
1254 /* Delete an atom */
1255 struct delete_atom_request
1257 REQUEST_HEADER
; /* request header */
1258 IN
int atom
; /* atom handle */
1259 IN
int local
; /* is atom in local process table? */
1264 struct find_atom_request
1266 REQUEST_HEADER
; /* request header */
1267 IN
int local
; /* is atom in local process table? */
1268 OUT
int atom
; /* atom handle */
1269 IN
VARARG(name
,unicode_str
); /* atom name */
1273 /* Get an atom name */
1274 struct get_atom_name_request
1276 REQUEST_HEADER
; /* request header */
1277 IN
int atom
; /* atom handle */
1278 IN
int local
; /* is atom in local process table? */
1279 OUT
int count
; /* atom lock count */
1280 OUT
VARARG(name
,unicode_str
); /* atom name */
1284 /* Init the process atom table */
1285 struct init_atom_table_request
1287 REQUEST_HEADER
; /* request header */
1288 IN
int entries
; /* number of entries */
1292 /* Get the message queue of the current thread */
1293 struct get_msg_queue_request
1295 REQUEST_HEADER
; /* request header */
1296 OUT handle_t handle
; /* handle to the queue */
1299 /* Wake up a message queue */
1300 struct wake_queue_request
1302 REQUEST_HEADER
; /* request header */
1303 IN handle_t handle
; /* handle to the queue */
1304 IN
unsigned int bits
; /* wake bits */
1307 /* Wait for a process to start waiting on input */
1308 struct wait_input_idle_request
1310 REQUEST_HEADER
; /* request header */
1311 IN handle_t handle
; /* process handle */
1312 IN
int timeout
; /* timeout */
1313 OUT handle_t event
; /* handle to idle event */
1316 struct create_serial_request
1318 REQUEST_HEADER
; /* request header */
1319 IN
unsigned int access
; /* wanted access rights */
1320 IN
int inherit
; /* inherit flag */
1321 IN
unsigned int sharing
; /* sharing flags */
1322 OUT handle_t handle
; /* handle to the port */
1323 IN
VARARG(name
,string
); /* file name */
1326 struct get_serial_info_request
1328 REQUEST_HEADER
; /* request header */
1329 IN handle_t handle
; /* handle to comm port */
1330 OUT
unsigned int readinterval
;
1331 OUT
unsigned int readconst
;
1332 OUT
unsigned int readmult
;
1333 OUT
unsigned int writeconst
;
1334 OUT
unsigned int writemult
;
1335 OUT
unsigned int eventmask
;
1336 OUT
unsigned int commerror
;
1339 struct set_serial_info_request
1341 REQUEST_HEADER
; /* request header */
1342 IN handle_t handle
; /* handle to comm port */
1343 IN
int flags
; /* bitmask to set values (see below) */
1344 IN
unsigned int readinterval
;
1345 IN
unsigned int readconst
;
1346 IN
unsigned int readmult
;
1347 IN
unsigned int writeconst
;
1348 IN
unsigned int writemult
;
1349 IN
unsigned int eventmask
;
1350 IN
unsigned int commerror
;
1352 #define SERIALINFO_SET_TIMEOUTS 0x01
1353 #define SERIALINFO_SET_MASK 0x02
1354 #define SERIALINFO_SET_ERROR 0x04
1356 struct create_async_request
1358 REQUEST_HEADER
; /* request header */
1359 IN handle_t file_handle
; /* handle to comm port */
1360 IN
void* overlapped
;
1365 OUT handle_t ov_handle
;
1367 #define ASYNC_TYPE_READ 0x01
1368 #define ASYNC_TYPE_WRITE 0x02
1369 #define ASYNC_TYPE_WAIT 0x03
1372 * Used by service thread to tell the server that the current
1373 * operation has completed
1375 struct async_result_request
1377 REQUEST_HEADER
; /* request header */
1378 IN handle_t ov_handle
;
1379 IN
int result
; /* NT status code */
1382 /* Everything below this line is generated automatically by tools/make_requests */
1383 /* ### make_requests begin ### */
1388 REQ_get_new_process_info
,
1392 REQ_init_process_done
,
1394 REQ_set_thread_buffer
,
1395 REQ_terminate_process
,
1396 REQ_terminate_thread
,
1397 REQ_get_process_info
,
1398 REQ_set_process_info
,
1399 REQ_get_thread_info
,
1400 REQ_set_thread_info
,
1408 REQ_set_handle_info
,
1418 REQ_create_semaphore
,
1419 REQ_release_semaphore
,
1422 REQ_alloc_file_handle
,
1424 REQ_set_file_pointer
,
1434 REQ_set_socket_event
,
1435 REQ_get_socket_event
,
1436 REQ_enable_socket_event
,
1441 REQ_get_console_mode
,
1442 REQ_set_console_mode
,
1443 REQ_set_console_info
,
1444 REQ_get_console_info
,
1445 REQ_write_console_input
,
1446 REQ_read_console_input
,
1447 REQ_create_change_notification
,
1450 REQ_get_mapping_info
,
1452 REQ_create_snapshot
,
1456 REQ_wait_debug_event
,
1457 REQ_queue_exception_event
,
1458 REQ_get_exception_status
,
1459 REQ_output_debug_string
,
1460 REQ_continue_debug_event
,
1462 REQ_read_process_memory
,
1463 REQ_write_process_memory
,
1471 REQ_delete_key_value
,
1474 REQ_save_registry_atexit
,
1475 REQ_set_registry_levels
,
1480 REQ_get_thread_context
,
1481 REQ_set_thread_context
,
1482 REQ_get_selector_entry
,
1487 REQ_init_atom_table
,
1490 REQ_wait_input_idle
,
1492 REQ_get_serial_info
,
1493 REQ_set_serial_info
,
1499 union generic_request
1501 struct request_max_size max_size
;
1502 struct request_header header
;
1503 struct new_process_request new_process
;
1504 struct get_new_process_info_request get_new_process_info
;
1505 struct new_thread_request new_thread
;
1506 struct boot_done_request boot_done
;
1507 struct init_process_request init_process
;
1508 struct init_process_done_request init_process_done
;
1509 struct init_thread_request init_thread
;
1510 struct set_thread_buffer_request set_thread_buffer
;
1511 struct terminate_process_request terminate_process
;
1512 struct terminate_thread_request terminate_thread
;
1513 struct get_process_info_request get_process_info
;
1514 struct set_process_info_request set_process_info
;
1515 struct get_thread_info_request get_thread_info
;
1516 struct set_thread_info_request set_thread_info
;
1517 struct suspend_thread_request suspend_thread
;
1518 struct resume_thread_request resume_thread
;
1519 struct load_dll_request load_dll
;
1520 struct unload_dll_request unload_dll
;
1521 struct queue_apc_request queue_apc
;
1522 struct get_apc_request get_apc
;
1523 struct close_handle_request close_handle
;
1524 struct set_handle_info_request set_handle_info
;
1525 struct dup_handle_request dup_handle
;
1526 struct open_process_request open_process
;
1527 struct select_request select
;
1528 struct create_event_request create_event
;
1529 struct event_op_request event_op
;
1530 struct open_event_request open_event
;
1531 struct create_mutex_request create_mutex
;
1532 struct release_mutex_request release_mutex
;
1533 struct open_mutex_request open_mutex
;
1534 struct create_semaphore_request create_semaphore
;
1535 struct release_semaphore_request release_semaphore
;
1536 struct open_semaphore_request open_semaphore
;
1537 struct create_file_request create_file
;
1538 struct alloc_file_handle_request alloc_file_handle
;
1539 struct get_handle_fd_request get_handle_fd
;
1540 struct set_file_pointer_request set_file_pointer
;
1541 struct truncate_file_request truncate_file
;
1542 struct set_file_time_request set_file_time
;
1543 struct flush_file_request flush_file
;
1544 struct get_file_info_request get_file_info
;
1545 struct lock_file_request lock_file
;
1546 struct unlock_file_request unlock_file
;
1547 struct create_pipe_request create_pipe
;
1548 struct create_socket_request create_socket
;
1549 struct accept_socket_request accept_socket
;
1550 struct set_socket_event_request set_socket_event
;
1551 struct get_socket_event_request get_socket_event
;
1552 struct enable_socket_event_request enable_socket_event
;
1553 struct alloc_console_request alloc_console
;
1554 struct free_console_request free_console
;
1555 struct open_console_request open_console
;
1556 struct set_console_fd_request set_console_fd
;
1557 struct get_console_mode_request get_console_mode
;
1558 struct set_console_mode_request set_console_mode
;
1559 struct set_console_info_request set_console_info
;
1560 struct get_console_info_request get_console_info
;
1561 struct write_console_input_request write_console_input
;
1562 struct read_console_input_request read_console_input
;
1563 struct create_change_notification_request create_change_notification
;
1564 struct create_mapping_request create_mapping
;
1565 struct open_mapping_request open_mapping
;
1566 struct get_mapping_info_request get_mapping_info
;
1567 struct create_device_request create_device
;
1568 struct create_snapshot_request create_snapshot
;
1569 struct next_process_request next_process
;
1570 struct next_thread_request next_thread
;
1571 struct next_module_request next_module
;
1572 struct wait_debug_event_request wait_debug_event
;
1573 struct queue_exception_event_request queue_exception_event
;
1574 struct get_exception_status_request get_exception_status
;
1575 struct output_debug_string_request output_debug_string
;
1576 struct continue_debug_event_request continue_debug_event
;
1577 struct debug_process_request debug_process
;
1578 struct read_process_memory_request read_process_memory
;
1579 struct write_process_memory_request write_process_memory
;
1580 struct create_key_request create_key
;
1581 struct open_key_request open_key
;
1582 struct delete_key_request delete_key
;
1583 struct enum_key_request enum_key
;
1584 struct set_key_value_request set_key_value
;
1585 struct get_key_value_request get_key_value
;
1586 struct enum_key_value_request enum_key_value
;
1587 struct delete_key_value_request delete_key_value
;
1588 struct load_registry_request load_registry
;
1589 struct save_registry_request save_registry
;
1590 struct save_registry_atexit_request save_registry_atexit
;
1591 struct set_registry_levels_request set_registry_levels
;
1592 struct create_timer_request create_timer
;
1593 struct open_timer_request open_timer
;
1594 struct set_timer_request set_timer
;
1595 struct cancel_timer_request cancel_timer
;
1596 struct get_thread_context_request get_thread_context
;
1597 struct set_thread_context_request set_thread_context
;
1598 struct get_selector_entry_request get_selector_entry
;
1599 struct add_atom_request add_atom
;
1600 struct delete_atom_request delete_atom
;
1601 struct find_atom_request find_atom
;
1602 struct get_atom_name_request get_atom_name
;
1603 struct init_atom_table_request init_atom_table
;
1604 struct get_msg_queue_request get_msg_queue
;
1605 struct wake_queue_request wake_queue
;
1606 struct wait_input_idle_request wait_input_idle
;
1607 struct create_serial_request create_serial
;
1608 struct get_serial_info_request get_serial_info
;
1609 struct set_serial_info_request set_serial_info
;
1610 struct create_async_request create_async
;
1611 struct async_result_request async_result
;
1614 #define SERVER_PROTOCOL_VERSION 42
1616 /* ### make_requests end ### */
1617 /* Everything above this line is generated automatically by tools/make_requests */
1619 #undef REQUEST_HEADER
1622 /* client-side functions */
1624 #ifndef __WINE_SERVER__
1628 #include "wine/exception.h"
1630 /* client communication functions */
1632 extern unsigned int wine_server_call( union generic_request
*req
, size_t size
);
1633 extern void server_protocol_error( const char *err
, ... ) WINE_NORETURN
;
1634 extern void server_protocol_perror( const char *err
) WINE_NORETURN
;
1635 extern void wine_server_alloc_req( union generic_request
*req
, size_t size
);
1636 extern void wine_server_send_fd( int fd
);
1637 extern int wine_server_recv_fd( handle_t handle
);
1638 extern const char *get_config_dir(void);
1640 /* do a server call and set the last error code */
1641 inline static unsigned int __server_call_err( union generic_request
*req
, size_t size
)
1643 unsigned int res
= wine_server_call( req
, size
);
1644 if (res
) SetLastError( RtlNtStatusToDosError(res
) );
1648 /* get a pointer to the variable part of the request */
1649 inline static void *server_data_ptr( const void *req
)
1651 return (char *)NtCurrentTeb()->buffer
+ ((struct request_header
*)req
)->var_offset
;
1654 /* get the size of the variable part of the request */
1655 inline static size_t server_data_size( const void *req
)
1657 return ((struct request_header
*)req
)->var_size
;
1661 /* exception support for server calls */
1663 extern DWORD
__wine_server_exception_handler( PEXCEPTION_RECORD record
, EXCEPTION_FRAME
*frame
,
1664 CONTEXT
*context
, EXCEPTION_FRAME
**pdispatcher
);
1666 struct __server_exception_frame
1668 EXCEPTION_FRAME frame
;
1669 unsigned int buffer_pos
; /* saved buffer position */
1673 /* macros for server requests */
1675 #define SERVER_START_REQ(type) \
1677 union generic_request __req; \
1678 struct type##_request * const req = &__req.type; \
1679 __req.header.req = REQ_##type; \
1680 __req.header.var_size = 0; \
1683 #define SERVER_END_REQ \
1687 #define SERVER_START_VAR_REQ(type,size) \
1689 struct __server_exception_frame __f; \
1690 union generic_request __req; \
1691 struct type##_request * const req = &__req.type; \
1692 __f.frame.Handler = __wine_server_exception_handler; \
1693 __f.buffer_pos = NtCurrentTeb()->buffer_pos; \
1694 __wine_push_frame( &__f.frame ); \
1695 __req.header.req = REQ_##type; \
1696 wine_server_alloc_req( &__req, (size) ); \
1699 #define SERVER_END_VAR_REQ \
1701 NtCurrentTeb()->buffer_pos = __f.buffer_pos; \
1702 __wine_pop_frame( &__f.frame ); \
1705 #define SERVER_CALL() (wine_server_call( &__req, sizeof(*req) ))
1706 #define SERVER_CALL_ERR() (__server_call_err( &__req, sizeof(*req) ))
1709 extern void CLIENT_InitServer(void);
1710 extern void CLIENT_InitThread(void);
1711 extern void CLIENT_BootDone( int debug_level
);
1712 extern int CLIENT_IsBootThread(void);
1713 #endif /* __WINE_SERVER__ */
1715 #endif /* __WINE_SERVER_H */