GetLongPathName rewrite.
[wine.git] / include / server.h
blob6eb99c356f91ad2825a8ce1a29ab10e7e02a1b2e
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 int code; /* exception code */
35 int flags; /* exception flags */
36 void *record; /* exception record ptr */
37 void *addr; /* exception address */
38 int nb_params; /* exceptions parameters */
39 int params[15];
40 int first_chance; /* first chance to handle it? */
41 CONTEXT context; /* thread context */
43 struct debug_event_create_thread
45 int handle; /* handle to the new thread */
46 void *teb; /* thread teb (in debugged process address space) */
47 void *start; /* thread startup routine */
49 struct debug_event_create_process
51 int file; /* handle to the process exe file */
52 int process; /* handle to the new process */
53 int thread; /* handle to the new thread */
54 void *base; /* base of executable image */
55 int dbg_offset; /* offset of debug info in file */
56 int dbg_size; /* size of debug info */
57 void *teb; /* thread teb (in debugged process address space) */
58 void *start; /* thread startup routine */
59 void *name; /* image name (optional) */
60 int unicode; /* is it Unicode? */
62 struct debug_event_exit
64 int exit_code; /* thread or process exit code */
66 struct debug_event_load_dll
68 int handle; /* file handle for the dll */
69 void *base; /* base address of the dll */
70 int dbg_offset; /* offset of debug info in file */
71 int dbg_size; /* size of debug info */
72 void *name; /* image name (optional) */
73 int unicode; /* is it Unicode? */
75 struct debug_event_unload_dll
77 void *base; /* base address of the dll */
79 struct debug_event_output_string
81 void *string; /* string to display (in debugged process address space) */
82 int unicode; /* is it Unicode? */
83 int length; /* string length */
85 struct debug_event_rip_info
87 int error; /* ??? */
88 int type; /* ??? */
90 union debug_event_data
92 struct debug_event_exception exception;
93 struct debug_event_create_thread create_thread;
94 struct debug_event_create_process create_process;
95 struct debug_event_exit exit;
96 struct debug_event_load_dll load_dll;
97 struct debug_event_unload_dll unload_dll;
98 struct debug_event_output_string output_string;
99 struct debug_event_rip_info rip_info;
102 /* debug event data */
103 typedef struct
105 int code; /* event code */
106 union debug_event_data info; /* event information */
107 } debug_event_t;
110 /* Create a new process from the context of the parent */
111 struct new_process_request
113 IN int inherit; /* inherit flag */
114 IN int inherit_all; /* inherit all handles from parent */
115 IN int create_flags; /* creation flags */
116 IN int start_flags; /* flags from startup info */
117 IN int exe_file; /* file handle for main exe */
118 IN int hstdin; /* handle for stdin */
119 IN int hstdout; /* handle for stdout */
120 IN int hstderr; /* handle for stderr */
121 IN int event; /* event to signal startup */
122 IN int cmd_show; /* main window show mode */
123 IN void* env_ptr; /* pointer to environment (FIXME: hack) */
124 OUT void* pid; /* process id */
125 OUT int phandle; /* process handle (in the current process) */
126 OUT void* tid; /* thread id */
127 OUT int thandle; /* thread handle (in the current process) */
128 IN char cmdline[1]; /* command line */
132 /* Create a new thread from the context of the parent */
133 struct new_thread_request
135 IN int suspend; /* new thread should be suspended on creation */
136 IN int inherit; /* inherit flag */
137 OUT void* tid; /* thread id */
138 OUT int handle; /* thread handle (in the current process) */
142 /* Signal that we are finished booting on the client side */
143 struct boot_done_request
145 IN int debug_level; /* new debug level */
149 /* Initialize a process; called from the new process context */
150 struct init_process_request
152 IN void* ldt_copy; /* addr of LDT copy */
153 IN void* ldt_flags; /* addr of LDT flags */
154 OUT int start_flags; /* flags from startup info */
155 OUT int exe_file; /* file handle for main exe */
156 OUT int hstdin; /* handle for stdin */
157 OUT int hstdout; /* handle for stdout */
158 OUT int hstderr; /* handle for stderr */
159 OUT int cmd_show; /* main window show mode */
160 OUT void* env_ptr; /* pointer to environment (FIXME: hack) */
161 OUT char cmdline[1]; /* command line */
165 /* Signal the end of the process initialization */
166 struct init_process_done_request
168 IN int dummy;
172 /* Initialize a thread; called from the child after fork()/clone() */
173 struct init_thread_request
175 IN int unix_pid; /* Unix pid of new thread */
176 IN void* teb; /* TEB of new thread (in thread address space) */
177 OUT void* pid; /* process id of the new thread's process */
178 OUT void* tid; /* thread id of the new thread */
179 OUT int boot; /* is this the boot thread? */
183 /* Retrieve the thread buffer file descriptor */
184 /* The reply to this request is the first thing a newly */
185 /* created thread gets (without having to request it) */
186 struct get_thread_buffer_request
188 IN int dummy;
192 /* Terminate a process */
193 struct terminate_process_request
195 IN int handle; /* process handle to terminate */
196 IN int exit_code; /* process exit code */
200 /* Terminate a thread */
201 struct terminate_thread_request
203 IN int handle; /* thread handle to terminate */
204 IN int exit_code; /* thread exit code */
208 /* Retrieve information about a process */
209 struct get_process_info_request
211 IN int handle; /* process handle */
212 OUT void* pid; /* server process id */
213 OUT int exit_code; /* process exit code */
214 OUT int priority; /* priority class */
215 OUT int process_affinity; /* process affinity mask */
216 OUT int system_affinity; /* system affinity mask */
220 /* Set a process informations */
221 struct set_process_info_request
223 IN int handle; /* process handle */
224 IN int mask; /* setting mask (see below) */
225 IN int priority; /* priority class */
226 IN int affinity; /* affinity mask */
228 #define SET_PROCESS_INFO_PRIORITY 0x01
229 #define SET_PROCESS_INFO_AFFINITY 0x02
232 /* Retrieve information about a thread */
233 struct get_thread_info_request
235 IN int handle; /* thread handle */
236 OUT void* tid; /* server thread id */
237 OUT int exit_code; /* thread exit code */
238 OUT int priority; /* thread priority level */
242 /* Set a thread informations */
243 struct set_thread_info_request
245 IN int handle; /* thread handle */
246 IN int mask; /* setting mask (see below) */
247 IN int priority; /* priority class */
248 IN int affinity; /* affinity mask */
250 #define SET_THREAD_INFO_PRIORITY 0x01
251 #define SET_THREAD_INFO_AFFINITY 0x02
254 /* Suspend a thread */
255 struct suspend_thread_request
257 IN int handle; /* thread handle */
258 OUT int count; /* new suspend count */
262 /* Resume a thread */
263 struct resume_thread_request
265 IN int handle; /* thread handle */
266 OUT int count; /* new suspend count */
270 /* Debugger support: freeze / unfreeze */
271 struct debugger_request
273 IN int op; /* operation type */
276 enum debugger_op { DEBUGGER_FREEZE_ALL, DEBUGGER_UNFREEZE_ALL };
279 /* Queue an APC for a thread */
280 struct queue_apc_request
282 IN int handle; /* thread handle */
283 IN void* func; /* function to call */
284 IN void* param; /* param for function to call */
288 /* Get list of APC to call */
289 struct get_apcs_request
291 OUT int count; /* number of apcs */
292 OUT void* apcs[1]; /* async procedures to call */
296 /* Close a handle for the current process */
297 struct close_handle_request
299 IN int handle; /* handle to close */
303 /* Get information about a handle */
304 struct get_handle_info_request
306 IN int handle; /* handle we are interested in */
307 OUT int flags; /* handle flags */
311 /* Set a handle information */
312 struct set_handle_info_request
314 IN int handle; /* handle we are interested in */
315 IN int flags; /* new handle flags */
316 IN int mask; /* mask for flags to set */
320 /* Duplicate a handle */
321 struct dup_handle_request
323 IN int src_process; /* src process handle */
324 IN int src_handle; /* src handle to duplicate */
325 IN int dst_process; /* dst process handle */
326 IN unsigned int access; /* wanted access rights */
327 IN int inherit; /* inherit flag */
328 IN int options; /* duplicate options (see below) */
329 OUT int handle; /* duplicated handle in dst process */
331 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
332 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
333 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
336 /* Open a handle to a process */
337 struct open_process_request
339 IN void* pid; /* process id to open */
340 IN unsigned int access; /* wanted access rights */
341 IN int inherit; /* inherit flag */
342 OUT int handle; /* handle to the process */
346 /* Wait for handles */
347 struct select_request
349 IN int count; /* handles count */
350 IN int flags; /* wait flags (see below) */
351 IN int timeout; /* timeout in ms */
352 OUT int signaled; /* signaled handle */
353 IN int handles[1]; /* handles to select on */
355 #define SELECT_ALL 1
356 #define SELECT_ALERTABLE 2
357 #define SELECT_TIMEOUT 4
360 /* Create an event */
361 struct create_event_request
363 IN int manual_reset; /* manual reset event */
364 IN int initial_state; /* initial state of the event */
365 IN int inherit; /* inherit flag */
366 OUT int handle; /* handle to the event */
367 IN WCHAR name[1]; /* event name */
370 /* Event operation */
371 struct event_op_request
373 IN int handle; /* handle to event */
374 IN int op; /* event operation (see below) */
376 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
379 /* Open an event */
380 struct open_event_request
382 IN unsigned int access; /* wanted access rights */
383 IN int inherit; /* inherit flag */
384 OUT int handle; /* handle to the event */
385 IN WCHAR name[1]; /* object name */
389 /* Create a mutex */
390 struct create_mutex_request
392 IN int owned; /* initially owned? */
393 IN int inherit; /* inherit flag */
394 OUT int handle; /* handle to the mutex */
395 IN WCHAR name[1]; /* mutex name */
399 /* Release a mutex */
400 struct release_mutex_request
402 IN int handle; /* handle to the mutex */
406 /* Open a mutex */
407 struct open_mutex_request
409 IN unsigned int access; /* wanted access rights */
410 IN int inherit; /* inherit flag */
411 OUT int handle; /* handle to the mutex */
412 IN WCHAR name[1]; /* object name */
416 /* Create a semaphore */
417 struct create_semaphore_request
419 IN unsigned int initial; /* initial count */
420 IN unsigned int max; /* maximum count */
421 IN int inherit; /* inherit flag */
422 OUT int handle; /* handle to the semaphore */
423 IN WCHAR name[1]; /* semaphore name */
427 /* Release a semaphore */
428 struct release_semaphore_request
430 IN int handle; /* handle to the semaphore */
431 IN unsigned int count; /* count to add to semaphore */
432 OUT unsigned int prev_count; /* previous semaphore count */
436 /* Open a semaphore */
437 struct open_semaphore_request
439 IN unsigned int access; /* wanted access rights */
440 IN int inherit; /* inherit flag */
441 OUT int handle; /* handle to the semaphore */
442 IN WCHAR name[1]; /* object name */
446 /* Create a file */
447 struct create_file_request
449 IN unsigned int access; /* wanted access rights */
450 IN int inherit; /* inherit flag */
451 IN unsigned int sharing; /* sharing flags */
452 IN int create; /* file create action */
453 IN unsigned int attrs; /* file attributes for creation */
454 OUT int handle; /* handle to the file */
455 IN char name[1]; /* file name */
459 /* Allocate a file handle for a Unix fd */
460 struct alloc_file_handle_request
462 IN unsigned int access; /* wanted access rights */
463 OUT int handle; /* handle to the file */
467 /* Get a Unix fd to read from a file */
468 struct get_read_fd_request
470 IN int handle; /* handle to the file */
474 /* Get a Unix fd to write to a file */
475 struct get_write_fd_request
477 IN int handle; /* handle to the file */
481 /* Set a file current position */
482 struct set_file_pointer_request
484 IN int handle; /* handle to the file */
485 IN int low; /* position low word */
486 IN int high; /* position high word */
487 IN int whence; /* whence to seek */
488 OUT int new_low; /* new position low word */
489 OUT int new_high; /* new position high word */
493 /* Truncate (or extend) a file */
494 struct truncate_file_request
496 IN int handle; /* handle to the file */
500 /* Set a file access and modification times */
501 struct set_file_time_request
503 IN int handle; /* handle to the file */
504 IN time_t access_time; /* last access time */
505 IN time_t write_time; /* last write time */
509 /* Flush a file buffers */
510 struct flush_file_request
512 IN int handle; /* handle to the file */
516 /* Get information about a file */
517 struct get_file_info_request
519 IN int handle; /* handle to the file */
520 OUT int type; /* file type */
521 OUT int attr; /* file attributes */
522 OUT time_t access_time; /* last access time */
523 OUT time_t write_time; /* last write time */
524 OUT int size_high; /* file size */
525 OUT int size_low; /* file size */
526 OUT int links; /* number of links */
527 OUT int index_high; /* unique index */
528 OUT int index_low; /* unique index */
529 OUT unsigned int serial; /* volume serial number */
533 /* Lock a region of a file */
534 struct lock_file_request
536 IN int handle; /* handle to the file */
537 IN unsigned int offset_low; /* offset of start of lock */
538 IN unsigned int offset_high; /* offset of start of lock */
539 IN unsigned int count_low; /* count of bytes to lock */
540 IN unsigned int count_high; /* count of bytes to lock */
544 /* Unlock a region of a file */
545 struct unlock_file_request
547 IN int handle; /* handle to the file */
548 IN unsigned int offset_low; /* offset of start of unlock */
549 IN unsigned int offset_high; /* offset of start of unlock */
550 IN unsigned int count_low; /* count of bytes to unlock */
551 IN unsigned int count_high; /* count of bytes to unlock */
555 /* Create an anonymous pipe */
556 struct create_pipe_request
558 IN int inherit; /* inherit flag */
559 OUT int handle_read; /* handle to the read-side of the pipe */
560 OUT int handle_write; /* handle to the write-side of the pipe */
564 /* Create a socket */
565 struct create_socket_request
567 IN unsigned int access; /* wanted access rights */
568 IN int inherit; /* inherit flag */
569 IN int family; /* family, see socket manpage */
570 IN int type; /* type, see socket manpage */
571 IN int protocol; /* protocol, see socket manpage */
572 OUT int handle; /* handle to the new socket */
576 /* Accept a socket */
577 struct accept_socket_request
579 IN int lhandle; /* handle to the listening socket */
580 IN unsigned int access; /* wanted access rights */
581 IN int inherit; /* inherit flag */
582 OUT int handle; /* handle to the new socket */
586 /* Set socket event parameters */
587 struct set_socket_event_request
589 IN int handle; /* handle to the socket */
590 IN unsigned int mask; /* event mask */
591 IN int event; /* event object */
595 /* Get socket event parameters */
596 struct get_socket_event_request
598 IN int handle; /* handle to the socket */
599 IN int service; /* clear pending? */
600 IN int s_event; /* "expected" event object */
601 OUT unsigned int mask; /* event mask */
602 OUT unsigned int pmask; /* pending events */
603 OUT unsigned int state; /* status bits */
604 OUT int errors[1]; /* event errors */
608 /* Reenable pending socket events */
609 struct enable_socket_event_request
611 IN int handle; /* handle to the socket */
612 IN unsigned int mask; /* events to re-enable */
613 IN unsigned int sstate; /* status bits to set */
614 IN unsigned int cstate; /* status bits to clear */
618 /* Allocate a console for the current process */
619 struct alloc_console_request
621 IN unsigned int access; /* wanted access rights */
622 IN int inherit; /* inherit flag */
623 OUT int handle_in; /* handle to console input */
624 OUT int handle_out; /* handle to console output */
628 /* Free the console of the current process */
629 struct free_console_request
631 IN int dummy;
635 /* Open a handle to the process console */
636 struct open_console_request
638 IN int output; /* input or output? */
639 IN unsigned int access; /* wanted access rights */
640 IN int inherit; /* inherit flag */
641 OUT int handle; /* handle to the console */
645 /* Set a console file descriptor */
646 struct set_console_fd_request
648 IN int handle; /* handle to the console */
649 IN int file_handle; /* handle of file to use as file descriptor */
650 IN int pid; /* pid of xterm (hack) */
654 /* Get a console mode (input or output) */
655 struct get_console_mode_request
657 IN int handle; /* handle to the console */
658 OUT int mode; /* console mode */
662 /* Set a console mode (input or output) */
663 struct set_console_mode_request
665 IN int handle; /* handle to the console */
666 IN int mode; /* console mode */
670 /* Set info about a console (output only) */
671 struct set_console_info_request
673 IN int handle; /* handle to the console */
674 IN int mask; /* setting mask (see below) */
675 IN int cursor_size; /* size of cursor (percentage filled) */
676 IN int cursor_visible;/* cursor visibility flag */
677 IN char title[1]; /* console title */
679 #define SET_CONSOLE_INFO_CURSOR 0x01
680 #define SET_CONSOLE_INFO_TITLE 0x02
682 /* Get info about a console (output only) */
683 struct get_console_info_request
685 IN int handle; /* handle to the console */
686 OUT int cursor_size; /* size of cursor (percentage filled) */
687 OUT int cursor_visible;/* cursor visibility flag */
688 OUT int pid; /* pid of xterm (hack) */
689 OUT char title[1]; /* console title */
693 /* Add input records to a console input queue */
694 struct write_console_input_request
696 IN int handle; /* handle to the console input */
697 IN int count; /* number of input records */
698 OUT int written; /* number of records written */
699 /* INPUT_RECORD records[0]; */ /* input records */
702 /* Fetch input records from a console input queue */
703 struct read_console_input_request
705 IN int handle; /* handle to the console input */
706 IN int count; /* max number of records to retrieve */
707 IN int flush; /* flush the retrieved records from the queue? */
708 OUT int read; /* number of records read */
709 /* INPUT_RECORD records[0]; */ /* input records */
713 /* Create a change notification */
714 struct create_change_notification_request
716 IN int subtree; /* watch all the subtree */
717 IN int filter; /* notification filter */
718 OUT int handle; /* handle to the change notification */
722 /* Create a file mapping */
723 struct create_mapping_request
725 IN int size_high; /* mapping size */
726 IN int size_low; /* mapping size */
727 IN int protect; /* protection flags (see below) */
728 IN int inherit; /* inherit flag */
729 IN int file_handle; /* file handle */
730 OUT int handle; /* handle to the mapping */
731 IN WCHAR name[1]; /* object name */
733 /* protection flags */
734 #define VPROT_READ 0x01
735 #define VPROT_WRITE 0x02
736 #define VPROT_EXEC 0x04
737 #define VPROT_WRITECOPY 0x08
738 #define VPROT_GUARD 0x10
739 #define VPROT_NOCACHE 0x20
740 #define VPROT_COMMITTED 0x40
743 /* Open a mapping */
744 struct open_mapping_request
746 IN unsigned int access; /* wanted access rights */
747 IN int inherit; /* inherit flag */
748 OUT int handle; /* handle to the mapping */
749 IN WCHAR name[1]; /* object name */
753 /* Get information about a file mapping */
754 struct get_mapping_info_request
756 IN int handle; /* handle to the mapping */
757 OUT int size_high; /* mapping size */
758 OUT int size_low; /* mapping size */
759 OUT int protect; /* protection flags */
763 /* Create a device */
764 struct create_device_request
766 IN unsigned int access; /* wanted access rights */
767 IN int inherit; /* inherit flag */
768 IN int id; /* client private id */
769 OUT int handle; /* handle to the device */
773 /* Create a snapshot */
774 struct create_snapshot_request
776 IN int inherit; /* inherit flag */
777 IN int flags; /* snapshot flags (TH32CS_*) */
778 OUT int handle; /* handle to the snapshot */
782 /* Get the next process from a snapshot */
783 struct next_process_request
785 IN int handle; /* handle to the snapshot */
786 IN int reset; /* reset snapshot position? */
787 OUT void* pid; /* process id */
788 OUT int threads; /* number of threads */
789 OUT int priority; /* process priority */
793 /* Wait for a debug event */
794 struct wait_debug_event_request
796 IN int timeout; /* timeout in ms */
797 OUT void* pid; /* process id */
798 OUT void* tid; /* thread id */
799 OUT debug_event_t event; /* debug event data */
803 /* Send a debug event */
804 struct send_debug_event_request
806 OUT int status; /* event continuation status */
807 IN debug_event_t event; /* debug event data */
811 /* Continue a debug event */
812 struct continue_debug_event_request
814 IN void* pid; /* process id to continue */
815 IN void* tid; /* thread id to continue */
816 IN int status; /* continuation status */
820 /* Start debugging an existing process */
821 struct debug_process_request
823 IN void* pid; /* id of the process to debug */
827 /* Read data from a process address space */
828 struct read_process_memory_request
830 IN int handle; /* process handle */
831 IN void* addr; /* addr to read from (must be int-aligned) */
832 IN int len; /* number of ints to read */
833 OUT unsigned int data[1]; /* result data */
837 /* Write data to a process address space */
838 struct write_process_memory_request
840 IN int handle; /* process handle */
841 IN void* addr; /* addr to write to (must be int-aligned) */
842 IN int len; /* number of ints to write */
843 IN unsigned int first_mask; /* mask for first word */
844 IN unsigned int last_mask; /* mask for last word */
845 IN unsigned int data[1]; /* data to write */
849 /* Create a registry key */
850 struct create_key_request
852 IN int parent; /* handle to the parent key */
853 IN unsigned int access; /* desired access rights */
854 IN unsigned int options; /* creation options */
855 IN time_t modif; /* last modification time */
856 OUT int hkey; /* handle to the created key */
857 OUT int created; /* has it been newly created? */
858 IN path_t name; /* key name */
859 IN WCHAR class[1]; /* class name */
863 /* Open a registry key */
864 struct open_key_request
866 IN int parent; /* handle to the parent key */
867 IN unsigned int access; /* desired access rights */
868 OUT int hkey; /* handle to the open key */
869 IN path_t name; /* key name */
873 /* Delete a registry key */
874 struct delete_key_request
876 IN int hkey; /* handle to the parent key */
877 IN path_t name; /* key name */
881 /* Close a registry key */
882 struct close_key_request
884 IN int hkey; /* key to close */
888 /* Enumerate registry subkeys */
889 struct enum_key_request
891 IN int hkey; /* handle to registry key */
892 IN int index; /* index of subkey */
893 OUT time_t modif; /* last modification time */
894 OUT path_t name; /* subkey name */
895 OUT WCHAR class[1]; /* class name */
899 /* Query information about a registry key */
900 struct query_key_info_request
902 IN int hkey; /* handle to registry key */
903 OUT int subkeys; /* number of subkeys */
904 OUT int max_subkey; /* longest subkey name */
905 OUT int max_class; /* longest class name */
906 OUT int values; /* number of values */
907 OUT int max_value; /* longest value name */
908 OUT int max_data; /* longest value data */
909 OUT time_t modif; /* last modification time */
910 OUT path_t name; /* key name */
911 OUT WCHAR class[1]; /* class name */
915 /* Set a value of a registry key */
916 struct set_key_value_request
918 IN int hkey; /* handle to registry key */
919 IN int type; /* value type */
920 IN int len; /* value data len */
921 IN path_t name; /* value name */
922 IN unsigned char data[1]; /* value data */
926 /* Retrieve the value of a registry key */
927 struct get_key_value_request
929 IN int hkey; /* handle to registry key */
930 OUT int type; /* value type */
931 OUT int len; /* value data len */
932 IN WCHAR name[1]; /* value name */
933 OUT unsigned char data[1]; /* value data */
937 /* Enumerate a value of a registry key */
938 struct enum_key_value_request
940 IN int hkey; /* handle to registry key */
941 IN int index; /* value index */
942 OUT int type; /* value type */
943 OUT int len; /* value data len */
944 OUT path_t name; /* value name */
945 OUT unsigned char data[1]; /* value data */
949 /* Delete a value of a registry key */
950 struct delete_key_value_request
952 IN int hkey; /* handle to registry key */
953 IN path_t name; /* value name */
957 /* Load a registry branch from a file */
958 struct load_registry_request
960 IN int hkey; /* root key to load to */
961 IN int file; /* file to load from */
962 IN path_t name; /* subkey name */
966 /* Save a registry branch to a file */
967 struct save_registry_request
969 IN int hkey; /* key to save */
970 IN int file; /* file to save to */
974 /* Set the current and saving level for the registry */
975 struct set_registry_levels_request
977 IN int current; /* new current level */
978 IN int saving; /* new saving level */
979 IN int version; /* file format version for saving */
983 /* Create a waitable timer */
984 struct create_timer_request
986 IN int inherit; /* inherit flag */
987 IN int manual; /* manual reset */
988 OUT int handle; /* handle to the timer */
989 IN WCHAR name[1]; /* timer name */
993 /* Open a waitable timer */
994 struct open_timer_request
996 IN unsigned int access; /* wanted access rights */
997 IN int inherit; /* inherit flag */
998 OUT int handle; /* handle to the timer */
999 IN WCHAR name[1]; /* timer name */
1002 /* Set a waitable timer */
1003 struct set_timer_request
1005 IN int handle; /* handle to the timer */
1006 IN int sec; /* next expiration absolute time */
1007 IN int usec; /* next expiration absolute time */
1008 IN int period; /* timer period in ms */
1009 IN void* callback; /* callback function */
1010 IN void* arg; /* callback argument */
1013 /* Cancel a waitable timer */
1014 struct cancel_timer_request
1016 IN int handle; /* handle to the timer */
1020 /* Retrieve the current context of a thread */
1021 struct get_thread_context_request
1023 IN int handle; /* thread handle */
1024 IN unsigned int flags; /* context flags */
1025 OUT CONTEXT context; /* thread context */
1029 /* Set the current context of a thread */
1030 struct set_thread_context_request
1032 IN int handle; /* thread handle */
1033 IN unsigned int flags; /* context flags */
1034 IN CONTEXT context; /* thread context */
1038 /* Fetch a selector entry for a thread */
1039 struct get_selector_entry_request
1041 IN int handle; /* thread handle */
1042 IN int entry; /* LDT entry */
1043 OUT unsigned int base; /* selector base */
1044 OUT unsigned int limit; /* selector limit */
1045 OUT unsigned char flags; /* selector flags */
1049 /* Add a global atom */
1050 struct add_atom_request
1052 OUT int atom; /* resulting atom */
1053 IN WCHAR name[1]; /* atom name */
1057 /* Delete a global atom */
1058 struct delete_atom_request
1060 IN int atom; /* atom handle */
1064 /* Find a global atom */
1065 struct find_atom_request
1067 OUT int atom; /* atom handle */
1068 IN WCHAR name[1]; /* atom name */
1072 /* Get a global atom name */
1073 struct get_atom_name_request
1075 IN int atom; /* atom handle */
1076 OUT int count; /* atom lock count */
1077 OUT WCHAR name[1]; /* atom name */
1080 /* Everything below this line is generated automatically by tools/make_requests */
1081 /* ### make_requests begin ### */
1083 enum request
1085 REQ_NEW_PROCESS,
1086 REQ_NEW_THREAD,
1087 REQ_BOOT_DONE,
1088 REQ_INIT_PROCESS,
1089 REQ_INIT_PROCESS_DONE,
1090 REQ_INIT_THREAD,
1091 REQ_GET_THREAD_BUFFER,
1092 REQ_TERMINATE_PROCESS,
1093 REQ_TERMINATE_THREAD,
1094 REQ_GET_PROCESS_INFO,
1095 REQ_SET_PROCESS_INFO,
1096 REQ_GET_THREAD_INFO,
1097 REQ_SET_THREAD_INFO,
1098 REQ_SUSPEND_THREAD,
1099 REQ_RESUME_THREAD,
1100 REQ_DEBUGGER,
1101 REQ_QUEUE_APC,
1102 REQ_GET_APCS,
1103 REQ_CLOSE_HANDLE,
1104 REQ_GET_HANDLE_INFO,
1105 REQ_SET_HANDLE_INFO,
1106 REQ_DUP_HANDLE,
1107 REQ_OPEN_PROCESS,
1108 REQ_SELECT,
1109 REQ_CREATE_EVENT,
1110 REQ_EVENT_OP,
1111 REQ_OPEN_EVENT,
1112 REQ_CREATE_MUTEX,
1113 REQ_RELEASE_MUTEX,
1114 REQ_OPEN_MUTEX,
1115 REQ_CREATE_SEMAPHORE,
1116 REQ_RELEASE_SEMAPHORE,
1117 REQ_OPEN_SEMAPHORE,
1118 REQ_CREATE_FILE,
1119 REQ_ALLOC_FILE_HANDLE,
1120 REQ_GET_READ_FD,
1121 REQ_GET_WRITE_FD,
1122 REQ_SET_FILE_POINTER,
1123 REQ_TRUNCATE_FILE,
1124 REQ_SET_FILE_TIME,
1125 REQ_FLUSH_FILE,
1126 REQ_GET_FILE_INFO,
1127 REQ_LOCK_FILE,
1128 REQ_UNLOCK_FILE,
1129 REQ_CREATE_PIPE,
1130 REQ_CREATE_SOCKET,
1131 REQ_ACCEPT_SOCKET,
1132 REQ_SET_SOCKET_EVENT,
1133 REQ_GET_SOCKET_EVENT,
1134 REQ_ENABLE_SOCKET_EVENT,
1135 REQ_ALLOC_CONSOLE,
1136 REQ_FREE_CONSOLE,
1137 REQ_OPEN_CONSOLE,
1138 REQ_SET_CONSOLE_FD,
1139 REQ_GET_CONSOLE_MODE,
1140 REQ_SET_CONSOLE_MODE,
1141 REQ_SET_CONSOLE_INFO,
1142 REQ_GET_CONSOLE_INFO,
1143 REQ_WRITE_CONSOLE_INPUT,
1144 REQ_READ_CONSOLE_INPUT,
1145 REQ_CREATE_CHANGE_NOTIFICATION,
1146 REQ_CREATE_MAPPING,
1147 REQ_OPEN_MAPPING,
1148 REQ_GET_MAPPING_INFO,
1149 REQ_CREATE_DEVICE,
1150 REQ_CREATE_SNAPSHOT,
1151 REQ_NEXT_PROCESS,
1152 REQ_WAIT_DEBUG_EVENT,
1153 REQ_SEND_DEBUG_EVENT,
1154 REQ_CONTINUE_DEBUG_EVENT,
1155 REQ_DEBUG_PROCESS,
1156 REQ_READ_PROCESS_MEMORY,
1157 REQ_WRITE_PROCESS_MEMORY,
1158 REQ_CREATE_KEY,
1159 REQ_OPEN_KEY,
1160 REQ_DELETE_KEY,
1161 REQ_CLOSE_KEY,
1162 REQ_ENUM_KEY,
1163 REQ_QUERY_KEY_INFO,
1164 REQ_SET_KEY_VALUE,
1165 REQ_GET_KEY_VALUE,
1166 REQ_ENUM_KEY_VALUE,
1167 REQ_DELETE_KEY_VALUE,
1168 REQ_LOAD_REGISTRY,
1169 REQ_SAVE_REGISTRY,
1170 REQ_SET_REGISTRY_LEVELS,
1171 REQ_CREATE_TIMER,
1172 REQ_OPEN_TIMER,
1173 REQ_SET_TIMER,
1174 REQ_CANCEL_TIMER,
1175 REQ_GET_THREAD_CONTEXT,
1176 REQ_SET_THREAD_CONTEXT,
1177 REQ_GET_SELECTOR_ENTRY,
1178 REQ_ADD_ATOM,
1179 REQ_DELETE_ATOM,
1180 REQ_FIND_ATOM,
1181 REQ_GET_ATOM_NAME,
1182 REQ_NB_REQUESTS
1185 /* ### make_requests end ### */
1186 /* Everything above this line is generated automatically by tools/make_requests */
1189 /* client-side functions */
1191 #ifndef __WINE_SERVER__
1193 #include "thread.h"
1194 #include "ntddk.h"
1196 /* client communication functions */
1198 extern unsigned int server_call_noerr( enum request req );
1199 extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
1200 extern void server_protocol_error( const char *err, ... );
1202 /* get a pointer to the request buffer */
1203 static inline void * WINE_UNUSED get_req_buffer(void)
1205 return NtCurrentTeb()->buffer;
1208 /* maximum remaining size in the server buffer */
1209 static inline int WINE_UNUSED server_remaining( const void *ptr )
1211 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
1214 /* do a server call and set the last error code */
1215 static inline int server_call( enum request req )
1217 unsigned int res = server_call_noerr( req );
1218 if (res) SetLastError( RtlNtStatusToDosError(res) );
1219 return res;
1222 /* copy a Unicode string to the server buffer */
1223 static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1225 if (src)
1227 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1228 while ((dst < end) && *src) *dst++ = *src++;
1230 *dst = 0;
1233 /* copy and convert an ASCII string to the server buffer */
1234 static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1236 if (src)
1238 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1239 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1241 *dst = 0;
1244 extern int CLIENT_InitServer(void);
1245 extern int CLIENT_BootDone( int debug_level );
1246 extern int CLIENT_IsBootThread(void);
1247 extern int CLIENT_DebuggerRequest( int op );
1248 extern int CLIENT_InitThread(void);
1249 #endif /* __WINE_SERVER__ */
1251 #endif /* __WINE_SERVER_H */