Fixed/commented out duplicate entry point names.
[wine/multimedia.git] / include / server.h
blob1518f0ded7f59e0f5ca90ddd487ca95327829912
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];
30 /* Create a new process from the context of the parent */
31 struct new_process_request
33 IN int inherit; /* inherit flag */
34 IN int inherit_all; /* inherit all handles from parent */
35 IN int create_flags; /* creation flags */
36 IN int start_flags; /* flags from startup info */
37 IN int hstdin; /* handle for stdin */
38 IN int hstdout; /* handle for stdout */
39 IN int hstderr; /* handle for stderr */
40 IN int event; /* event to signal startup */
41 IN int cmd_show; /* main window show mode */
42 IN void* env_ptr; /* pointer to environment (FIXME: hack) */
43 OUT void* pid; /* process id */
44 OUT int handle; /* process handle (in the current process) */
45 IN char cmdline[1]; /* command line */
49 /* Create a new thread from the context of the parent */
50 struct new_thread_request
52 IN void* pid; /* process id for the new thread */
53 IN int suspend; /* new thread should be suspended on creation */
54 IN int inherit; /* inherit flag */
55 OUT void* tid; /* thread id */
56 OUT int handle; /* thread handle (in the current process) */
60 /* Set the server debug level */
61 struct set_debug_request
63 IN int level; /* New debug level */
67 /* Initialize a process; called from the new process context */
68 struct init_process_request
70 OUT int start_flags; /* flags from startup info */
71 OUT int hstdin; /* handle for stdin */
72 OUT int hstdout; /* handle for stdout */
73 OUT int hstderr; /* handle for stderr */
74 OUT int cmd_show; /* main window show mode */
75 OUT void* env_ptr; /* pointer to environment (FIXME: hack) */
76 OUT char cmdline[1]; /* command line */
80 /* Signal the end of the process initialization */
81 struct init_process_done_request
83 IN int dummy;
87 /* Initialize a thread; called from the child after fork()/clone() */
88 struct init_thread_request
90 IN int unix_pid; /* Unix pid of new thread */
91 IN void* teb; /* TEB of new thread (in thread address space) */
92 OUT void* pid; /* process id of the new thread's process */
93 OUT void* tid; /* thread id of the new thread */
97 /* Retrieve the thread buffer file descriptor */
98 /* The reply to this request is the first thing a newly */
99 /* created thread gets (without having to request it) */
100 struct get_thread_buffer_request
102 IN int dummy;
106 /* Terminate a process */
107 struct terminate_process_request
109 IN int handle; /* process handle to terminate */
110 IN int exit_code; /* process exit code */
114 /* Terminate a thread */
115 struct terminate_thread_request
117 IN int handle; /* thread handle to terminate */
118 IN int exit_code; /* thread exit code */
122 /* Retrieve information about a process */
123 struct get_process_info_request
125 IN int handle; /* process handle */
126 OUT void* pid; /* server process id */
127 OUT int exit_code; /* process exit code */
128 OUT int priority; /* priority class */
129 OUT int process_affinity; /* process affinity mask */
130 OUT int system_affinity; /* system affinity mask */
134 /* Set a process informations */
135 struct set_process_info_request
137 IN int handle; /* process handle */
138 IN int mask; /* setting mask (see below) */
139 IN int priority; /* priority class */
140 IN int affinity; /* affinity mask */
142 #define SET_PROCESS_INFO_PRIORITY 0x01
143 #define SET_PROCESS_INFO_AFFINITY 0x02
146 /* Retrieve information about a thread */
147 struct get_thread_info_request
149 IN int handle; /* thread handle */
150 OUT void* tid; /* server thread id */
151 OUT int exit_code; /* thread exit code */
152 OUT int priority; /* thread priority level */
156 /* Set a thread informations */
157 struct set_thread_info_request
159 IN int handle; /* thread handle */
160 IN int mask; /* setting mask (see below) */
161 IN int priority; /* priority class */
162 IN int affinity; /* affinity mask */
164 #define SET_THREAD_INFO_PRIORITY 0x01
165 #define SET_THREAD_INFO_AFFINITY 0x02
168 /* Suspend a thread */
169 struct suspend_thread_request
171 IN int handle; /* thread handle */
172 OUT int count; /* new suspend count */
176 /* Resume a thread */
177 struct resume_thread_request
179 IN int handle; /* thread handle */
180 OUT int count; /* new suspend count */
184 /* Debugger support: freeze / unfreeze */
185 struct debugger_request
187 IN int op; /* operation type */
190 enum debugger_op { DEBUGGER_FREEZE_ALL, DEBUGGER_UNFREEZE_ALL };
193 /* Queue an APC for a thread */
194 struct queue_apc_request
196 IN int handle; /* thread handle */
197 IN void* func; /* function to call */
198 IN void* param; /* param for function to call */
202 /* Get list of APC to call */
203 struct get_apcs_request
205 OUT int count; /* number of apcs */
206 OUT void* apcs[1]; /* async procedures to call */
210 /* Close a handle for the current process */
211 struct close_handle_request
213 IN int handle; /* handle to close */
217 /* Get information about a handle */
218 struct get_handle_info_request
220 IN int handle; /* handle we are interested in */
221 OUT int flags; /* handle flags */
225 /* Set a handle information */
226 struct set_handle_info_request
228 IN int handle; /* handle we are interested in */
229 IN int flags; /* new handle flags */
230 IN int mask; /* mask for flags to set */
234 /* Duplicate a handle */
235 struct dup_handle_request
237 IN int src_process; /* src process handle */
238 IN int src_handle; /* src handle to duplicate */
239 IN int dst_process; /* dst process handle */
240 IN unsigned int access; /* wanted access rights */
241 IN int inherit; /* inherit flag */
242 IN int options; /* duplicate options (see below) */
243 OUT int handle; /* duplicated handle in dst process */
245 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
246 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
247 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
250 /* Open a handle to a process */
251 struct open_process_request
253 IN void* pid; /* process id to open */
254 IN unsigned int access; /* wanted access rights */
255 IN int inherit; /* inherit flag */
256 OUT int handle; /* handle to the process */
260 /* Wait for handles */
261 struct select_request
263 IN int count; /* handles count */
264 IN int flags; /* wait flags (see below) */
265 IN int timeout; /* timeout in ms */
266 OUT int signaled; /* signaled handle */
267 IN int handles[1]; /* handles to select on */
269 #define SELECT_ALL 1
270 #define SELECT_ALERTABLE 2
271 #define SELECT_TIMEOUT 4
274 /* Create an event */
275 struct create_event_request
277 IN int manual_reset; /* manual reset event */
278 IN int initial_state; /* initial state of the event */
279 IN int inherit; /* inherit flag */
280 OUT int handle; /* handle to the event */
281 IN WCHAR name[1]; /* event name */
284 /* Event operation */
285 struct event_op_request
287 IN int handle; /* handle to event */
288 IN int op; /* event operation (see below) */
290 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
293 /* Open an event */
294 struct open_event_request
296 IN unsigned int access; /* wanted access rights */
297 IN int inherit; /* inherit flag */
298 OUT int handle; /* handle to the event */
299 IN WCHAR name[1]; /* object name */
303 /* Create a mutex */
304 struct create_mutex_request
306 IN int owned; /* initially owned? */
307 IN int inherit; /* inherit flag */
308 OUT int handle; /* handle to the mutex */
309 IN WCHAR name[1]; /* mutex name */
313 /* Release a mutex */
314 struct release_mutex_request
316 IN int handle; /* handle to the mutex */
320 /* Open a mutex */
321 struct open_mutex_request
323 IN unsigned int access; /* wanted access rights */
324 IN int inherit; /* inherit flag */
325 OUT int handle; /* handle to the mutex */
326 IN WCHAR name[1]; /* object name */
330 /* Create a semaphore */
331 struct create_semaphore_request
333 IN unsigned int initial; /* initial count */
334 IN unsigned int max; /* maximum count */
335 IN int inherit; /* inherit flag */
336 OUT int handle; /* handle to the semaphore */
337 IN WCHAR name[1]; /* semaphore name */
341 /* Release a semaphore */
342 struct release_semaphore_request
344 IN int handle; /* handle to the semaphore */
345 IN unsigned int count; /* count to add to semaphore */
346 OUT unsigned int prev_count; /* previous semaphore count */
350 /* Open a semaphore */
351 struct open_semaphore_request
353 IN unsigned int access; /* wanted access rights */
354 IN int inherit; /* inherit flag */
355 OUT int handle; /* handle to the semaphore */
356 IN WCHAR name[1]; /* object name */
360 /* Create a file */
361 struct create_file_request
363 IN unsigned int access; /* wanted access rights */
364 IN int inherit; /* inherit flag */
365 IN unsigned int sharing; /* sharing flags */
366 IN int create; /* file create action */
367 IN unsigned int attrs; /* file attributes for creation */
368 OUT int handle; /* handle to the file */
369 IN char name[1]; /* file name */
373 /* Allocate a file handle for a Unix fd */
374 struct alloc_file_handle_request
376 IN unsigned int access; /* wanted access rights */
377 OUT int handle; /* handle to the file */
381 /* Get a Unix fd to read from a file */
382 struct get_read_fd_request
384 IN int handle; /* handle to the file */
388 /* Get a Unix fd to write to a file */
389 struct get_write_fd_request
391 IN int handle; /* handle to the file */
395 /* Set a file current position */
396 struct set_file_pointer_request
398 IN int handle; /* handle to the file */
399 IN int low; /* position low word */
400 IN int high; /* position high word */
401 IN int whence; /* whence to seek */
402 OUT int new_low; /* new position low word */
403 OUT int new_high; /* new position high word */
407 /* Truncate (or extend) a file */
408 struct truncate_file_request
410 IN int handle; /* handle to the file */
414 /* Set a file access and modification times */
415 struct set_file_time_request
417 IN int handle; /* handle to the file */
418 IN time_t access_time; /* last access time */
419 IN time_t write_time; /* last write time */
423 /* Flush a file buffers */
424 struct flush_file_request
426 IN int handle; /* handle to the file */
430 /* Get information about a file */
431 struct get_file_info_request
433 IN int handle; /* handle to the file */
434 OUT int type; /* file type */
435 OUT int attr; /* file attributes */
436 OUT time_t access_time; /* last access time */
437 OUT time_t write_time; /* last write time */
438 OUT int size_high; /* file size */
439 OUT int size_low; /* file size */
440 OUT int links; /* number of links */
441 OUT int index_high; /* unique index */
442 OUT int index_low; /* unique index */
443 OUT unsigned int serial; /* volume serial number */
447 /* Lock a region of a file */
448 struct lock_file_request
450 IN int handle; /* handle to the file */
451 IN unsigned int offset_low; /* offset of start of lock */
452 IN unsigned int offset_high; /* offset of start of lock */
453 IN unsigned int count_low; /* count of bytes to lock */
454 IN unsigned int count_high; /* count of bytes to lock */
458 /* Unlock a region of a file */
459 struct unlock_file_request
461 IN int handle; /* handle to the file */
462 IN unsigned int offset_low; /* offset of start of unlock */
463 IN unsigned int offset_high; /* offset of start of unlock */
464 IN unsigned int count_low; /* count of bytes to unlock */
465 IN unsigned int count_high; /* count of bytes to unlock */
469 /* Create an anonymous pipe */
470 struct create_pipe_request
472 IN int inherit; /* inherit flag */
473 OUT int handle_read; /* handle to the read-side of the pipe */
474 OUT int handle_write; /* handle to the write-side of the pipe */
478 /* Create a socket */
479 struct create_socket_request
481 IN unsigned int access; /* wanted access rights */
482 IN int inherit; /* inherit flag */
483 IN int family; /* family, see socket manpage */
484 IN int type; /* type, see socket manpage */
485 IN int protocol; /* protocol, see socket manpage */
486 OUT int handle; /* handle to the new socket */
490 /* Accept a socket */
491 struct accept_socket_request
493 IN int lhandle; /* handle to the listening socket */
494 IN unsigned int access; /* wanted access rights */
495 IN int inherit; /* inherit flag */
496 OUT int handle; /* handle to the new socket */
500 /* Set socket event parameters */
501 struct set_socket_event_request
503 IN int handle; /* handle to the socket */
504 IN unsigned int mask; /* event mask */
505 IN int event; /* event object */
509 /* Get socket event parameters */
510 struct get_socket_event_request
512 IN int handle; /* handle to the socket */
513 IN int service; /* clear pending? */
514 IN int s_event; /* "expected" event object */
515 OUT unsigned int mask; /* event mask */
516 OUT unsigned int pmask; /* pending events */
517 OUT unsigned int state; /* status bits */
518 OUT int errors[1]; /* event errors */
522 /* Reenable pending socket events */
523 struct enable_socket_event_request
525 IN int handle; /* handle to the socket */
526 IN unsigned int mask; /* events to re-enable */
527 IN unsigned int sstate; /* status bits to set */
528 IN unsigned int cstate; /* status bits to clear */
532 /* Allocate a console for the current process */
533 struct alloc_console_request
535 IN unsigned int access; /* wanted access rights */
536 IN int inherit; /* inherit flag */
537 OUT int handle_in; /* handle to console input */
538 OUT int handle_out; /* handle to console output */
542 /* Free the console of the current process */
543 struct free_console_request
545 IN int dummy;
549 /* Open a handle to the process console */
550 struct open_console_request
552 IN int output; /* input or output? */
553 IN unsigned int access; /* wanted access rights */
554 IN int inherit; /* inherit flag */
555 OUT int handle; /* handle to the console */
559 /* Set a console file descriptor */
560 struct set_console_fd_request
562 IN int handle; /* handle to the console */
563 IN int file_handle; /* handle of file to use as file descriptor */
564 IN int pid; /* pid of xterm (hack) */
568 /* Get a console mode (input or output) */
569 struct get_console_mode_request
571 IN int handle; /* handle to the console */
572 OUT int mode; /* console mode */
576 /* Set a console mode (input or output) */
577 struct set_console_mode_request
579 IN int handle; /* handle to the console */
580 IN int mode; /* console mode */
584 /* Set info about a console (output only) */
585 struct set_console_info_request
587 IN int handle; /* handle to the console */
588 IN int mask; /* setting mask (see below) */
589 IN int cursor_size; /* size of cursor (percentage filled) */
590 IN int cursor_visible;/* cursor visibility flag */
591 IN char title[1]; /* console title */
593 #define SET_CONSOLE_INFO_CURSOR 0x01
594 #define SET_CONSOLE_INFO_TITLE 0x02
596 /* Get info about a console (output only) */
597 struct get_console_info_request
599 IN int handle; /* handle to the console */
600 OUT int cursor_size; /* size of cursor (percentage filled) */
601 OUT int cursor_visible;/* cursor visibility flag */
602 OUT int pid; /* pid of xterm (hack) */
603 OUT char title[1]; /* console title */
607 /* Add input records to a console input queue */
608 struct write_console_input_request
610 IN int handle; /* handle to the console input */
611 IN int count; /* number of input records */
612 OUT int written; /* number of records written */
613 /* INPUT_RECORD records[0]; */ /* input records */
616 /* Fetch input records from a console input queue */
617 struct read_console_input_request
619 IN int handle; /* handle to the console input */
620 IN int count; /* max number of records to retrieve */
621 IN int flush; /* flush the retrieved records from the queue? */
622 OUT int read; /* number of records read */
623 /* INPUT_RECORD records[0]; */ /* input records */
627 /* Create a change notification */
628 struct create_change_notification_request
630 IN int subtree; /* watch all the subtree */
631 IN int filter; /* notification filter */
632 OUT int handle; /* handle to the change notification */
636 /* Create a file mapping */
637 struct create_mapping_request
639 IN int size_high; /* mapping size */
640 IN int size_low; /* mapping size */
641 IN int protect; /* protection flags (see below) */
642 IN int inherit; /* inherit flag */
643 IN int file_handle; /* file handle */
644 OUT int handle; /* handle to the mapping */
645 IN WCHAR name[1]; /* object name */
647 /* protection flags */
648 #define VPROT_READ 0x01
649 #define VPROT_WRITE 0x02
650 #define VPROT_EXEC 0x04
651 #define VPROT_WRITECOPY 0x08
652 #define VPROT_GUARD 0x10
653 #define VPROT_NOCACHE 0x20
654 #define VPROT_COMMITTED 0x40
657 /* Open a mapping */
658 struct open_mapping_request
660 IN unsigned int access; /* wanted access rights */
661 IN int inherit; /* inherit flag */
662 OUT int handle; /* handle to the mapping */
663 IN WCHAR name[1]; /* object name */
667 /* Get information about a file mapping */
668 struct get_mapping_info_request
670 IN int handle; /* handle to the mapping */
671 OUT int size_high; /* mapping size */
672 OUT int size_low; /* mapping size */
673 OUT int protect; /* protection flags */
677 /* Create a device */
678 struct create_device_request
680 IN unsigned int access; /* wanted access rights */
681 IN int inherit; /* inherit flag */
682 IN int id; /* client private id */
683 OUT int handle; /* handle to the device */
687 /* Create a snapshot */
688 struct create_snapshot_request
690 IN int inherit; /* inherit flag */
691 IN int flags; /* snapshot flags (TH32CS_*) */
692 OUT int handle; /* handle to the snapshot */
696 /* Get the next process from a snapshot */
697 struct next_process_request
699 IN int handle; /* handle to the snapshot */
700 IN int reset; /* reset snapshot position? */
701 OUT void* pid; /* process id */
702 OUT int threads; /* number of threads */
703 OUT int priority; /* process priority */
707 /* Wait for a debug event */
708 struct wait_debug_event_request
710 IN int timeout; /* timeout in ms */
711 OUT int code; /* event code */
712 OUT void* pid; /* process id */
713 OUT void* tid; /* thread id */
714 /* OUT union debug_event_data data; */
718 /* Send a debug event */
719 struct send_debug_event_request
721 IN int code; /* event code */
722 OUT int status; /* event continuation status */
723 /* IN union debug_event_data data; */
727 /* definitions of the event data depending on the event code */
728 struct debug_event_exception
730 int code; /* exception code */
731 int flags; /* exception flags */
732 void *record; /* exception record ptr */
733 void *addr; /* exception address */
734 int nb_params; /* exceptions parameters */
735 int params[15];
736 int first_chance; /* first chance to handle it? */
737 CONTEXT context; /* thread context */
739 struct debug_event_create_thread
741 int handle; /* handle to the new thread */
742 void *teb; /* thread teb (in debugged process address space) */
743 void *start; /* thread startup routine */
745 struct debug_event_create_process
747 int file; /* handle to the process exe file */
748 int process; /* handle to the new process */
749 int thread; /* handle to the new thread */
750 void *base; /* base of executable image */
751 int dbg_offset; /* offset of debug info in file */
752 int dbg_size; /* size of debug info */
753 void *teb; /* thread teb (in debugged process address space) */
754 void *start; /* thread startup routine */
755 void *name; /* image name (optional) */
756 int unicode; /* is it Unicode? */
758 struct debug_event_exit
760 int exit_code; /* thread or process exit code */
762 struct debug_event_load_dll
764 int handle; /* file handle for the dll */
765 void *base; /* base address of the dll */
766 int dbg_offset; /* offset of debug info in file */
767 int dbg_size; /* size of debug info */
768 void *name; /* image name (optional) */
769 int unicode; /* is it Unicode? */
771 struct debug_event_unload_dll
773 void *base; /* base address of the dll */
775 struct debug_event_output_string
777 void *string; /* string to display (in debugged process address space) */
778 int unicode; /* is it Unicode? */
779 int length; /* string length */
781 struct debug_event_rip_info
783 int error; /* ??? */
784 int type; /* ??? */
786 union debug_event_data
788 struct debug_event_exception exception;
789 struct debug_event_create_thread create_thread;
790 struct debug_event_create_process create_process;
791 struct debug_event_exit exit;
792 struct debug_event_load_dll load_dll;
793 struct debug_event_unload_dll unload_dll;
794 struct debug_event_output_string output_string;
795 struct debug_event_rip_info rip_info;
799 /* Continue a debug event */
800 struct continue_debug_event_request
802 IN void* pid; /* process id to continue */
803 IN void* tid; /* thread id to continue */
804 IN int status; /* continuation status */
808 /* Start debugging an existing process */
809 struct debug_process_request
811 IN void* pid; /* id of the process to debug */
815 /* Read data from a process address space */
816 struct read_process_memory_request
818 IN int handle; /* process handle */
819 IN void* addr; /* addr to read from (must be int-aligned) */
820 IN int len; /* number of ints to read */
821 OUT unsigned int data[1]; /* result data */
825 /* Write data to a process address space */
826 struct write_process_memory_request
828 IN int handle; /* process handle */
829 IN void* addr; /* addr to write to (must be int-aligned) */
830 IN int len; /* number of ints to write */
831 IN unsigned int first_mask; /* mask for first word */
832 IN unsigned int last_mask; /* mask for last word */
833 IN unsigned int data[1]; /* data to write */
837 /* Create a registry key */
838 struct create_key_request
840 IN int parent; /* handle to the parent key */
841 IN unsigned int access; /* desired access rights */
842 IN unsigned int options; /* creation options */
843 IN time_t modif; /* last modification time */
844 OUT int hkey; /* handle to the created key */
845 OUT int created; /* has it been newly created? */
846 IN path_t name; /* key name */
847 IN WCHAR class[1]; /* class name */
851 /* Open a registry key */
852 struct open_key_request
854 IN int parent; /* handle to the parent key */
855 IN unsigned int access; /* desired access rights */
856 OUT int hkey; /* handle to the open key */
857 IN path_t name; /* key name */
861 /* Delete a registry key */
862 struct delete_key_request
864 IN int hkey; /* handle to the parent key */
865 IN path_t name; /* key name */
869 /* Close a registry key */
870 struct close_key_request
872 IN int hkey; /* key to close */
876 /* Enumerate registry subkeys */
877 struct enum_key_request
879 IN int hkey; /* handle to registry key */
880 IN int index; /* index of subkey */
881 OUT time_t modif; /* last modification time */
882 OUT path_t name; /* subkey name */
883 OUT WCHAR class[1]; /* class name */
887 /* Query information about a registry key */
888 struct query_key_info_request
890 IN int hkey; /* handle to registry key */
891 OUT int subkeys; /* number of subkeys */
892 OUT int max_subkey; /* longest subkey name */
893 OUT int max_class; /* longest class name */
894 OUT int values; /* number of values */
895 OUT int max_value; /* longest value name */
896 OUT int max_data; /* longest value data */
897 OUT time_t modif; /* last modification time */
898 OUT WCHAR class[1]; /* class name */
902 /* Set a value of a registry key */
903 struct set_key_value_request
905 IN int hkey; /* handle to registry key */
906 IN int type; /* value type */
907 IN int len; /* value data len */
908 IN path_t name; /* value name */
909 IN unsigned char data[1]; /* value data */
913 /* Retrieve the value of a registry key */
914 struct get_key_value_request
916 IN int hkey; /* handle to registry key */
917 OUT int type; /* value type */
918 OUT int len; /* value data len */
919 IN WCHAR name[1]; /* value name */
920 OUT unsigned char data[1]; /* value data */
924 /* Enumerate a value of a registry key */
925 struct enum_key_value_request
927 IN int hkey; /* handle to registry key */
928 IN int index; /* value index */
929 OUT int type; /* value type */
930 OUT int len; /* value data len */
931 OUT path_t name; /* value name */
932 OUT unsigned char data[1]; /* value data */
936 /* Delete a value of a registry key */
937 struct delete_key_value_request
939 IN int hkey; /* handle to registry key */
940 IN path_t name; /* value name */
944 /* Load a registry branch from a file */
945 struct load_registry_request
947 IN int hkey; /* root key to load to */
948 IN int file; /* file to load from */
949 IN path_t name; /* subkey name */
953 /* Save a registry branch to a file */
954 struct save_registry_request
956 IN int hkey; /* key to save */
957 IN int file; /* file to save to */
961 /* Set the current and saving level for the registry */
962 struct set_registry_levels_request
964 IN int current; /* new current level */
965 IN int saving; /* new saving level */
966 IN int version; /* file format version for saving */
970 /* Create a waitable timer */
971 struct create_timer_request
973 IN int inherit; /* inherit flag */
974 IN int manual; /* manual reset */
975 OUT int handle; /* handle to the timer */
976 IN WCHAR name[1]; /* timer name */
980 /* Open a waitable timer */
981 struct open_timer_request
983 IN unsigned int access; /* wanted access rights */
984 IN int inherit; /* inherit flag */
985 OUT int handle; /* handle to the timer */
986 IN WCHAR name[1]; /* timer name */
989 /* Set a waitable timer */
990 struct set_timer_request
992 IN int handle; /* handle to the timer */
993 IN int sec; /* next expiration absolute time */
994 IN int usec; /* next expiration absolute time */
995 IN int period; /* timer period in ms */
996 IN void* callback; /* callback function */
997 IN void* arg; /* callback argument */
1000 /* Cancel a waitable timer */
1001 struct cancel_timer_request
1003 IN int handle; /* handle to the timer */
1007 /* Everything below this line is generated automatically by tools/make_requests */
1008 /* ### make_requests begin ### */
1010 enum request
1012 REQ_NEW_PROCESS,
1013 REQ_NEW_THREAD,
1014 REQ_SET_DEBUG,
1015 REQ_INIT_PROCESS,
1016 REQ_INIT_PROCESS_DONE,
1017 REQ_INIT_THREAD,
1018 REQ_GET_THREAD_BUFFER,
1019 REQ_TERMINATE_PROCESS,
1020 REQ_TERMINATE_THREAD,
1021 REQ_GET_PROCESS_INFO,
1022 REQ_SET_PROCESS_INFO,
1023 REQ_GET_THREAD_INFO,
1024 REQ_SET_THREAD_INFO,
1025 REQ_SUSPEND_THREAD,
1026 REQ_RESUME_THREAD,
1027 REQ_DEBUGGER,
1028 REQ_QUEUE_APC,
1029 REQ_GET_APCS,
1030 REQ_CLOSE_HANDLE,
1031 REQ_GET_HANDLE_INFO,
1032 REQ_SET_HANDLE_INFO,
1033 REQ_DUP_HANDLE,
1034 REQ_OPEN_PROCESS,
1035 REQ_SELECT,
1036 REQ_CREATE_EVENT,
1037 REQ_EVENT_OP,
1038 REQ_OPEN_EVENT,
1039 REQ_CREATE_MUTEX,
1040 REQ_RELEASE_MUTEX,
1041 REQ_OPEN_MUTEX,
1042 REQ_CREATE_SEMAPHORE,
1043 REQ_RELEASE_SEMAPHORE,
1044 REQ_OPEN_SEMAPHORE,
1045 REQ_CREATE_FILE,
1046 REQ_ALLOC_FILE_HANDLE,
1047 REQ_GET_READ_FD,
1048 REQ_GET_WRITE_FD,
1049 REQ_SET_FILE_POINTER,
1050 REQ_TRUNCATE_FILE,
1051 REQ_SET_FILE_TIME,
1052 REQ_FLUSH_FILE,
1053 REQ_GET_FILE_INFO,
1054 REQ_LOCK_FILE,
1055 REQ_UNLOCK_FILE,
1056 REQ_CREATE_PIPE,
1057 REQ_CREATE_SOCKET,
1058 REQ_ACCEPT_SOCKET,
1059 REQ_SET_SOCKET_EVENT,
1060 REQ_GET_SOCKET_EVENT,
1061 REQ_ENABLE_SOCKET_EVENT,
1062 REQ_ALLOC_CONSOLE,
1063 REQ_FREE_CONSOLE,
1064 REQ_OPEN_CONSOLE,
1065 REQ_SET_CONSOLE_FD,
1066 REQ_GET_CONSOLE_MODE,
1067 REQ_SET_CONSOLE_MODE,
1068 REQ_SET_CONSOLE_INFO,
1069 REQ_GET_CONSOLE_INFO,
1070 REQ_WRITE_CONSOLE_INPUT,
1071 REQ_READ_CONSOLE_INPUT,
1072 REQ_CREATE_CHANGE_NOTIFICATION,
1073 REQ_CREATE_MAPPING,
1074 REQ_OPEN_MAPPING,
1075 REQ_GET_MAPPING_INFO,
1076 REQ_CREATE_DEVICE,
1077 REQ_CREATE_SNAPSHOT,
1078 REQ_NEXT_PROCESS,
1079 REQ_WAIT_DEBUG_EVENT,
1080 REQ_SEND_DEBUG_EVENT,
1081 REQ_CONTINUE_DEBUG_EVENT,
1082 REQ_DEBUG_PROCESS,
1083 REQ_READ_PROCESS_MEMORY,
1084 REQ_WRITE_PROCESS_MEMORY,
1085 REQ_CREATE_KEY,
1086 REQ_OPEN_KEY,
1087 REQ_DELETE_KEY,
1088 REQ_CLOSE_KEY,
1089 REQ_ENUM_KEY,
1090 REQ_QUERY_KEY_INFO,
1091 REQ_SET_KEY_VALUE,
1092 REQ_GET_KEY_VALUE,
1093 REQ_ENUM_KEY_VALUE,
1094 REQ_DELETE_KEY_VALUE,
1095 REQ_LOAD_REGISTRY,
1096 REQ_SAVE_REGISTRY,
1097 REQ_SET_REGISTRY_LEVELS,
1098 REQ_CREATE_TIMER,
1099 REQ_OPEN_TIMER,
1100 REQ_SET_TIMER,
1101 REQ_CANCEL_TIMER,
1102 REQ_NB_REQUESTS
1105 /* ### make_requests end ### */
1106 /* Everything above this line is generated automatically by tools/make_requests */
1109 /* client-side functions */
1111 #ifndef __WINE_SERVER__
1113 #include "thread.h"
1115 /* client communication functions */
1117 extern unsigned int server_call_noerr( enum request req );
1118 extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
1119 extern void server_protocol_error( const char *err, ... );
1121 /* get a pointer to the request buffer */
1122 static inline void * WINE_UNUSED get_req_buffer(void)
1124 return NtCurrentTeb()->buffer;
1127 /* maximum remaining size in the server buffer */
1128 static inline int WINE_UNUSED server_remaining( const void *ptr )
1130 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
1133 /* do a server call and set the last error code */
1134 static inline int server_call( enum request req )
1136 unsigned int res = server_call_noerr( req );
1137 if (res) SetLastError( res );
1138 return res;
1141 /* copy a Unicode string to the server buffer */
1142 static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1144 if (src)
1146 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1147 while ((dst < end) && *src) *dst++ = *src++;
1149 *dst = 0;
1152 /* copy and convert an ASCII string to the server buffer */
1153 static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1155 if (src)
1157 WCHAR *end = (WCHAR *)((char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size) - 1;
1158 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1160 *dst = 0;
1163 extern int CLIENT_InitServer(void);
1164 extern int CLIENT_SetDebug( int level );
1165 extern int CLIENT_DebuggerRequest( int op );
1166 extern int CLIENT_InitThread(void);
1167 #endif /* __WINE_SERVER__ */
1169 #endif /* __WINE_SERVER_H */