Store process file name in startup info.
[wine.git] / include / server.h
blob234d8db6110bae90f273dfef700399c4a70240cc
1 /*
2 * Wine server definitions
4 * Copyright (C) 1998 Alexandre Julliard
5 */
7 #ifndef __WINE_SERVER_H
8 #define __WINE_SERVER_H
10 #include <stdlib.h>
11 #include <time.h>
12 #include "winbase.h"
14 /* Request structures */
16 /* Following are the definitions of all the client<->server */
17 /* communication format; if you make any change in this file, */
18 /* you must run tools/make_requests again. */
21 /* These empty macros are used by tools/make_requests */
22 /* to generate the request/reply tracing functions */
23 #define IN /*nothing*/
24 #define OUT /*nothing*/
27 /* a path name for server requests (Unicode) */
28 typedef WCHAR path_t[MAX_PATH+1];
31 /* definitions of the event data depending on the event code */
32 struct debug_event_exception
34 EXCEPTION_RECORD record; /* exception record */
35 int first; /* first chance exception? */
37 struct debug_event_create_thread
39 int handle; /* handle to the new thread */
40 void *teb; /* thread teb (in debugged process address space) */
41 void *start; /* thread startup routine */
43 struct debug_event_create_process
45 int file; /* handle to the process exe file */
46 int process; /* handle to the new process */
47 int thread; /* handle to the new thread */
48 void *base; /* base of executable image */
49 int dbg_offset; /* offset of debug info in file */
50 int dbg_size; /* size of debug info */
51 void *teb; /* thread teb (in debugged process address space) */
52 void *start; /* thread startup routine */
53 void *name; /* image name (optional) */
54 int unicode; /* is it Unicode? */
56 struct debug_event_exit
58 int exit_code; /* thread or process exit code */
60 struct debug_event_load_dll
62 int handle; /* file handle for the dll */
63 void *base; /* base address of the dll */
64 int dbg_offset; /* offset of debug info in file */
65 int dbg_size; /* size of debug info */
66 void *name; /* image name (optional) */
67 int unicode; /* is it Unicode? */
69 struct debug_event_unload_dll
71 void *base; /* base address of the dll */
73 struct debug_event_output_string
75 void *string; /* string to display (in debugged process address space) */
76 int unicode; /* is it Unicode? */
77 int length; /* string length */
79 struct debug_event_rip_info
81 int error; /* ??? */
82 int type; /* ??? */
84 union debug_event_data
86 struct debug_event_exception exception;
87 struct debug_event_create_thread create_thread;
88 struct debug_event_create_process create_process;
89 struct debug_event_exit exit;
90 struct debug_event_load_dll load_dll;
91 struct debug_event_unload_dll unload_dll;
92 struct debug_event_output_string output_string;
93 struct debug_event_rip_info rip_info;
96 /* debug event data */
97 typedef struct
99 int code; /* event code */
100 union debug_event_data info; /* event information */
101 } debug_event_t;
104 /* Create a new process from the context of the parent */
105 struct new_process_request
107 IN int inherit_all; /* inherit all handles from parent */
108 IN int create_flags; /* creation flags */
109 IN int start_flags; /* flags from startup info */
110 IN int exe_file; /* file handle for main exe */
111 IN int hstdin; /* handle for stdin */
112 IN int hstdout; /* handle for stdout */
113 IN int hstderr; /* handle for stderr */
114 IN int cmd_show; /* main window show mode */
115 IN int alloc_fd; /* create the fd pair right now? */
116 IN char filename[1]; /* file name of main exe */
120 /* Wait for the new process to start */
121 struct wait_process_request
123 IN int pinherit; /* process handle inherit flag */
124 IN int tinherit; /* thread handle inherit flag */
125 IN int timeout; /* wait timeout */
126 IN int cancel; /* cancel the process creation? */
127 OUT void* pid; /* process id */
128 OUT int phandle; /* process handle (in the current process) */
129 OUT void* tid; /* thread id */
130 OUT int thandle; /* thread handle (in the current process) */
131 OUT int event; /* event handle to signal startup */
135 /* Create a new thread from the context of the parent */
136 struct new_thread_request
138 IN int suspend; /* new thread should be suspended on creation */
139 IN int inherit; /* inherit flag */
140 OUT void* tid; /* thread id */
141 OUT int handle; /* thread handle (in the current process) */
145 /* Signal that we are finished booting on the client side */
146 struct boot_done_request
148 IN int debug_level; /* new debug level */
152 /* Initialize a process; called from the new process context */
153 struct init_process_request
155 IN void* ldt_copy; /* addr of LDT copy */
156 IN void* ldt_flags; /* addr of LDT flags */
157 IN int ppid; /* parent Unix pid */
158 OUT int start_flags; /* flags from startup info */
159 OUT int exe_file; /* file handle for main exe */
160 OUT int hstdin; /* handle for stdin */
161 OUT int hstdout; /* handle for stdout */
162 OUT int hstderr; /* handle for stderr */
163 OUT int cmd_show; /* main window show mode */
164 OUT char filename[1]; /* file name of main exe */
168 /* Signal the end of the process initialization */
169 struct init_process_done_request
171 IN void* module; /* main module base address */
172 IN void* entry; /* process entry point */
173 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 */
376 #define SELECT_ALL 1
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 };
400 /* Open an 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 */
410 /* Create a mutex */
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 */
427 /* Open a 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 */
467 /* Create a file */
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
653 IN int dummy;
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
765 /* Open a mapping */
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 int len; /* value data len */
979 IN path_t name; /* value name */
980 IN unsigned char data[1]; /* value data */
984 /* Retrieve the value of a registry key */
985 struct get_key_value_request
987 IN int hkey; /* handle to registry key */
988 OUT int type; /* value type */
989 OUT int len; /* value data len */
990 IN WCHAR name[1]; /* value name */
991 OUT unsigned char data[1]; /* value data */
995 /* Enumerate a value of a registry key */
996 struct enum_key_value_request
998 IN int hkey; /* handle to registry key */
999 IN int index; /* value index */
1000 OUT int type; /* value type */
1001 OUT int len; /* value data len */
1002 OUT path_t name; /* value name */
1003 OUT unsigned char data[1]; /* value data */
1007 /* Delete a value of a registry key */
1008 struct delete_key_value_request
1010 IN int hkey; /* handle to registry key */
1011 IN path_t name; /* value name */
1015 /* Load a registry branch from a file */
1016 struct load_registry_request
1018 IN int hkey; /* root key to load to */
1019 IN int file; /* file to load from */
1020 IN path_t name; /* subkey name */
1024 /* Save a registry branch to a file */
1025 struct save_registry_request
1027 IN int hkey; /* key to save */
1028 IN int file; /* file to save to */
1032 /* Save a registry branch at server exit */
1033 struct save_registry_atexit_request
1035 IN int hkey; /* key to save */
1036 IN char file[1]; /* file to save to */
1040 /* Set the current and saving level for the registry */
1041 struct set_registry_levels_request
1043 IN int current; /* new current level */
1044 IN int saving; /* new saving level */
1045 IN int version; /* file format version for saving */
1046 IN int period; /* duration between periodic saves (milliseconds) */
1050 /* Create a waitable timer */
1051 struct create_timer_request
1053 IN int inherit; /* inherit flag */
1054 IN int manual; /* manual reset */
1055 OUT int handle; /* handle to the timer */
1056 IN WCHAR name[1]; /* timer name */
1060 /* Open a waitable timer */
1061 struct open_timer_request
1063 IN unsigned int access; /* wanted access rights */
1064 IN int inherit; /* inherit flag */
1065 OUT int handle; /* handle to the timer */
1066 IN WCHAR name[1]; /* timer name */
1069 /* Set a waitable timer */
1070 struct set_timer_request
1072 IN int handle; /* handle to the timer */
1073 IN int sec; /* next expiration absolute time */
1074 IN int usec; /* next expiration absolute time */
1075 IN int period; /* timer period in ms */
1076 IN void* callback; /* callback function */
1077 IN void* arg; /* callback argument */
1080 /* Cancel a waitable timer */
1081 struct cancel_timer_request
1083 IN int handle; /* handle to the timer */
1087 /* Retrieve the current context of a thread */
1088 struct get_thread_context_request
1090 IN int handle; /* thread handle */
1091 IN unsigned int flags; /* context flags */
1092 OUT CONTEXT context; /* thread context */
1096 /* Set the current context of a thread */
1097 struct set_thread_context_request
1099 IN int handle; /* thread handle */
1100 IN unsigned int flags; /* context flags */
1101 IN CONTEXT context; /* thread context */
1105 /* Fetch a selector entry for a thread */
1106 struct get_selector_entry_request
1108 IN int handle; /* thread handle */
1109 IN int entry; /* LDT entry */
1110 OUT unsigned int base; /* selector base */
1111 OUT unsigned int limit; /* selector limit */
1112 OUT unsigned char flags; /* selector flags */
1116 /* Add a global atom */
1117 struct add_atom_request
1119 OUT int atom; /* resulting atom */
1120 IN WCHAR name[1]; /* atom name */
1124 /* Delete a global atom */
1125 struct delete_atom_request
1127 IN int atom; /* atom handle */
1131 /* Find a global atom */
1132 struct find_atom_request
1134 OUT int atom; /* atom handle */
1135 IN WCHAR name[1]; /* atom name */
1139 /* Get a global atom name */
1140 struct get_atom_name_request
1142 IN int atom; /* atom handle */
1143 OUT int count; /* atom lock count */
1144 OUT WCHAR name[1]; /* atom name */
1147 /* Everything below this line is generated automatically by tools/make_requests */
1148 /* ### make_requests begin ### */
1150 enum request
1152 REQ_NEW_PROCESS,
1153 REQ_WAIT_PROCESS,
1154 REQ_NEW_THREAD,
1155 REQ_BOOT_DONE,
1156 REQ_INIT_PROCESS,
1157 REQ_INIT_PROCESS_DONE,
1158 REQ_INIT_THREAD,
1159 REQ_GET_THREAD_BUFFER,
1160 REQ_TERMINATE_PROCESS,
1161 REQ_TERMINATE_THREAD,
1162 REQ_GET_PROCESS_INFO,
1163 REQ_SET_PROCESS_INFO,
1164 REQ_GET_THREAD_INFO,
1165 REQ_SET_THREAD_INFO,
1166 REQ_SUSPEND_THREAD,
1167 REQ_RESUME_THREAD,
1168 REQ_LOAD_DLL,
1169 REQ_UNLOAD_DLL,
1170 REQ_QUEUE_APC,
1171 REQ_GET_APCS,
1172 REQ_CLOSE_HANDLE,
1173 REQ_GET_HANDLE_INFO,
1174 REQ_SET_HANDLE_INFO,
1175 REQ_DUP_HANDLE,
1176 REQ_OPEN_PROCESS,
1177 REQ_SELECT,
1178 REQ_CREATE_EVENT,
1179 REQ_EVENT_OP,
1180 REQ_OPEN_EVENT,
1181 REQ_CREATE_MUTEX,
1182 REQ_RELEASE_MUTEX,
1183 REQ_OPEN_MUTEX,
1184 REQ_CREATE_SEMAPHORE,
1185 REQ_RELEASE_SEMAPHORE,
1186 REQ_OPEN_SEMAPHORE,
1187 REQ_CREATE_FILE,
1188 REQ_ALLOC_FILE_HANDLE,
1189 REQ_GET_READ_FD,
1190 REQ_GET_WRITE_FD,
1191 REQ_SET_FILE_POINTER,
1192 REQ_TRUNCATE_FILE,
1193 REQ_SET_FILE_TIME,
1194 REQ_FLUSH_FILE,
1195 REQ_GET_FILE_INFO,
1196 REQ_LOCK_FILE,
1197 REQ_UNLOCK_FILE,
1198 REQ_CREATE_PIPE,
1199 REQ_CREATE_SOCKET,
1200 REQ_ACCEPT_SOCKET,
1201 REQ_SET_SOCKET_EVENT,
1202 REQ_GET_SOCKET_EVENT,
1203 REQ_ENABLE_SOCKET_EVENT,
1204 REQ_ALLOC_CONSOLE,
1205 REQ_FREE_CONSOLE,
1206 REQ_OPEN_CONSOLE,
1207 REQ_SET_CONSOLE_FD,
1208 REQ_GET_CONSOLE_MODE,
1209 REQ_SET_CONSOLE_MODE,
1210 REQ_SET_CONSOLE_INFO,
1211 REQ_GET_CONSOLE_INFO,
1212 REQ_WRITE_CONSOLE_INPUT,
1213 REQ_READ_CONSOLE_INPUT,
1214 REQ_CREATE_CHANGE_NOTIFICATION,
1215 REQ_CREATE_MAPPING,
1216 REQ_OPEN_MAPPING,
1217 REQ_GET_MAPPING_INFO,
1218 REQ_CREATE_DEVICE,
1219 REQ_CREATE_SNAPSHOT,
1220 REQ_NEXT_PROCESS,
1221 REQ_NEXT_THREAD,
1222 REQ_NEXT_MODULE,
1223 REQ_WAIT_DEBUG_EVENT,
1224 REQ_EXCEPTION_EVENT,
1225 REQ_OUTPUT_DEBUG_STRING,
1226 REQ_CONTINUE_DEBUG_EVENT,
1227 REQ_DEBUG_PROCESS,
1228 REQ_READ_PROCESS_MEMORY,
1229 REQ_WRITE_PROCESS_MEMORY,
1230 REQ_CREATE_KEY,
1231 REQ_OPEN_KEY,
1232 REQ_DELETE_KEY,
1233 REQ_CLOSE_KEY,
1234 REQ_ENUM_KEY,
1235 REQ_QUERY_KEY_INFO,
1236 REQ_SET_KEY_VALUE,
1237 REQ_GET_KEY_VALUE,
1238 REQ_ENUM_KEY_VALUE,
1239 REQ_DELETE_KEY_VALUE,
1240 REQ_LOAD_REGISTRY,
1241 REQ_SAVE_REGISTRY,
1242 REQ_SAVE_REGISTRY_ATEXIT,
1243 REQ_SET_REGISTRY_LEVELS,
1244 REQ_CREATE_TIMER,
1245 REQ_OPEN_TIMER,
1246 REQ_SET_TIMER,
1247 REQ_CANCEL_TIMER,
1248 REQ_GET_THREAD_CONTEXT,
1249 REQ_SET_THREAD_CONTEXT,
1250 REQ_GET_SELECTOR_ENTRY,
1251 REQ_ADD_ATOM,
1252 REQ_DELETE_ATOM,
1253 REQ_FIND_ATOM,
1254 REQ_GET_ATOM_NAME,
1255 REQ_NB_REQUESTS
1258 #define SERVER_PROTOCOL_VERSION 11
1260 /* ### make_requests end ### */
1261 /* Everything above this line is generated automatically by tools/make_requests */
1264 /* client-side functions */
1266 #ifndef __WINE_SERVER__
1268 #include "thread.h"
1269 #include "ntddk.h"
1271 /* client communication functions */
1273 extern unsigned int server_call_noerr( enum request req );
1274 extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
1275 extern void server_protocol_error( const char *err, ... ) WINE_NORETURN;
1276 extern const char *get_config_dir(void);
1278 /* get a pointer to the request buffer */
1279 static inline void * WINE_UNUSED get_req_buffer(void)
1281 return NtCurrentTeb()->buffer;
1284 /* maximum remaining size in the server buffer */
1285 static inline int WINE_UNUSED server_remaining( const void *ptr )
1287 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
1290 /* do a server call and set the last error code */
1291 static inline int server_call( enum request req )
1293 unsigned int res = server_call_noerr( req );
1294 if (res) SetLastError( RtlNtStatusToDosError(res) );
1295 return res;
1298 /* copy a Unicode string to the server buffer */
1299 static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1301 if (src)
1303 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1304 while ((dst < end) && *src) *dst++ = *src++;
1306 *dst = 0;
1309 /* copy and convert an ASCII string to the server buffer */
1310 static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1312 if (src)
1314 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1315 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1317 *dst = 0;
1320 extern int CLIENT_InitServer(void);
1321 extern int CLIENT_BootDone( int debug_level );
1322 extern int CLIENT_IsBootThread(void);
1323 extern int CLIENT_InitThread(void);
1324 #endif /* __WINE_SERVER__ */
1326 #endif /* __WINE_SERVER_H */