3 * Wine server protocol definition
5 * Copyright (C
) 2001 Alexandre Julliard
7 * This file is used by tools
/make_requests to build the
8 * protocol structures in include
/wine
/server_protocol.h
11 @HEADER
/* start of C declarations
*/
19 int req
; /* request code
*/
20 unsigned short var_offset
; /* offset of the variable part of the request
*/
21 unsigned short var_size
; /* size of the variable part of the request
*/
22 unsigned int error
; /* error result
*/
27 unsigned int error
; /* error result
*/
28 unsigned short var_offset
; /* offset of the variable part of the request
*/
29 unsigned short var_size
; /* size of the variable part of the request
*/
32 /* placeholder structure for the maximum allowed request size
*/
33 /* this is used to construct the generic_request union
*/
34 struct request_max_size
36 int pad
[16]; /* the max request size is
16 ints
*/
39 /* max size of the variable part of a request
*/
40 #define REQUEST_MAX_VAR_SIZE
1024
44 /* definitions of the event data depending on the event code
*/
45 struct debug_event_exception
47 EXCEPTION_RECORD record
; /* exception record
*/
48 int first
; /* first chance exception?
*/
50 struct debug_event_create_thread
52 handle_t handle
; /* handle to the new thread
*/
53 void
*teb
; /* thread
teb (in debugged process address space
) */
54 void
*start
; /* thread startup routine
*/
56 struct debug_event_create_process
58 handle_t file
; /* handle to the process exe file
*/
59 handle_t process
; /* handle to the new process
*/
60 handle_t thread
; /* handle to the new thread
*/
61 void
*base
; /* base of executable image
*/
62 int dbg_offset
; /* offset of debug info in file
*/
63 int dbg_size
; /* size of debug info
*/
64 void
*teb
; /* thread
teb (in debugged process address space
) */
65 void
*start
; /* thread startup routine
*/
66 void
*name
; /* image
name (optional
) */
67 int unicode
; /* is it Unicode?
*/
69 struct debug_event_exit
71 int exit_code
; /* thread or process exit code
*/
73 struct debug_event_load_dll
75 handle_t handle
; /* file handle for the dll
*/
76 void
*base
; /* base address of the dll
*/
77 int dbg_offset
; /* offset of debug info in file
*/
78 int dbg_size
; /* size of debug info
*/
79 void
*name
; /* image
name (optional
) */
80 int unicode
; /* is it Unicode?
*/
82 struct debug_event_unload_dll
84 void
*base
; /* base address of the dll
*/
86 struct debug_event_output_string
88 void
*string
; /* string to
display (in debugged process address space
) */
89 int unicode
; /* is it Unicode?
*/
90 int length
; /* string length
*/
92 struct debug_event_rip_info
97 union debug_event_data
99 struct debug_event_exception exception
;
100 struct debug_event_create_thread create_thread
;
101 struct debug_event_create_process create_process
;
102 struct debug_event_exit exit
;
103 struct debug_event_load_dll load_dll
;
104 struct debug_event_unload_dll unload_dll
;
105 struct debug_event_output_string output_string
;
106 struct debug_event_rip_info rip_info
;
109 /* debug event data
*/
112 int code
; /* event code
*/
113 union debug_event_data info
; /* event information
*/
116 /* structure used in sending an fd from client to server
*/
119 void
*tid
; /* thread id
*/
120 int fd
; /* file descriptor on client
-side
*/
123 /* structure sent by the server on the wait fifo
*/
126 void
*cookie
; /* magic cookie that was passed in select_request
*/
127 int signaled
; /* wait result
*/
130 /****************************************************************/
131 /* Request declarations
*/
133 /* Create a new process from the context of the parent
*/
135 int inherit_all
; /* inherit all handles from parent
*/
136 int create_flags
; /* creation flags
*/
137 int start_flags
; /* flags from startup info
*/
138 handle_t exe_file
; /* file handle for main exe
*/
139 handle_t hstdin
; /* handle for stdin
*/
140 handle_t hstdout
; /* handle for stdout
*/
141 handle_t hstderr
; /* handle for stderr
*/
142 int cmd_show
; /* main window show mode
*/
143 VARARG(filename
,string
); /* file name of main exe
*/
145 handle_t info
; /* new process info handle
*/
149 /* Retrieve information about a newly started process
*/
150 @
REQ(get_new_process_info
)
151 handle_t info
; /* info handle returned from new_process_request
*/
152 int pinherit
; /* process handle inherit flag
*/
153 int tinherit
; /* thread handle inherit flag
*/
155 void
* pid
; /* process id
*/
156 handle_t phandle
; /* process
handle (in the current process
) */
157 void
* tid
; /* thread id
*/
158 handle_t thandle
; /* thread
handle (in the current process
) */
159 handle_t event
; /* event handle to signal startup
*/
163 /* Create a new thread from the context of the parent
*/
165 int suspend
; /* new thread should be suspended on creation
*/
166 int inherit
; /* inherit flag
*/
167 int request_fd
; /* fd for request pipe
*/
169 void
* tid
; /* thread id
*/
170 handle_t handle
; /* thread
handle (in the current process
) */
174 /* Signal that we are finished booting on the client side
*/
176 int debug_level
; /* new debug level
*/
180 /* Initialize a process
; called from the new process context
*/
182 void
* ldt_copy
; /* addr of LDT copy
*/
183 int ppid
; /* parent Unix pid
*/
185 int create_flags
; /* creation flags
*/
186 int start_flags
; /* flags from startup info
*/
187 unsigned int server_start
; /* server start
time (GetTickCount
) */
188 handle_t exe_file
; /* file handle for main exe
*/
189 handle_t hstdin
; /* handle for stdin
*/
190 handle_t hstdout
; /* handle for stdout
*/
191 handle_t hstderr
; /* handle for stderr
*/
192 int cmd_show
; /* main window show mode
*/
193 VARARG(filename
,string
); /* file name of main exe
*/
197 /* Signal the end of the process initialization
*/
198 @
REQ(init_process_done
)
199 void
* module
; /* main module base address
*/
200 void
* entry
; /* process entry point
*/
201 void
* name
; /* ptr to ptr to
name (in process addr space
) */
202 handle_t exe_file
; /* file handle for main exe
*/
203 int gui
; /* is it a GUI process?
*/
205 int debugged
; /* being debugged?
*/
209 /* Initialize a thread
; called from the child after
fork()/clone() */
211 int unix_pid
; /* Unix pid of new thread
*/
212 void
* teb
; /* TEB of new
thread (in thread address space
) */
213 void
* entry
; /* thread entry
point (in thread address space
) */
214 int reply_fd
; /* fd for reply pipe
*/
215 int wait_fd
; /* fd for blocking calls pipe
*/
217 void
* pid
; /* process id of the new thread
's process */
218 void* tid; /* thread id of the new thread */
219 int boot; /* is this the boot thread? */
220 int version; /* protocol version */
224 /* Set the shared buffer for a thread */
225 @REQ(set_thread_buffer)
226 int fd; /* fd to mmap as shared buffer */
228 unsigned int offset; /* offset of buffer in file */
229 unsigned int size; /* size of buffer */
233 /* Terminate a process */
234 @REQ(terminate_process)
235 handle_t handle; /* process handle to terminate */
236 int exit_code; /* process exit code */
238 int self; /* suicide? */
242 /* Terminate a thread */
243 @REQ(terminate_thread)
244 handle_t handle; /* thread handle to terminate */
245 int exit_code; /* thread exit code */
247 int self; /* suicide? */
248 int last; /* last thread in this process? */
252 /* Retrieve information about a process */
253 @REQ(get_process_info)
254 handle_t handle; /* process handle */
256 void* pid; /* server process id */
257 int debugged; /* debugged? */
258 int exit_code; /* process exit code */
259 int priority; /* priority class */
260 int process_affinity; /* process affinity mask */
261 int system_affinity; /* system affinity mask */
265 /* Set a process informations */
266 @REQ(set_process_info)
267 handle_t handle; /* process handle */
268 int mask; /* setting mask (see below) */
269 int priority; /* priority class */
270 int affinity; /* affinity mask */
272 #define SET_PROCESS_INFO_PRIORITY 0x01
273 #define SET_PROCESS_INFO_AFFINITY 0x02
276 /* Retrieve information about a thread */
277 @REQ(get_thread_info)
278 handle_t handle; /* thread handle */
279 void* tid_in; /* thread id (optional) */
281 void* tid; /* server thread id */
282 void* teb; /* thread teb pointer */
283 int exit_code; /* thread exit code */
284 int priority; /* thread priority level */
288 /* Set a thread informations */
289 @REQ(set_thread_info)
290 handle_t handle; /* thread handle */
291 int mask; /* setting mask (see below) */
292 int priority; /* priority class */
293 int affinity; /* affinity mask */
295 #define SET_THREAD_INFO_PRIORITY 0x01
296 #define SET_THREAD_INFO_AFFINITY 0x02
299 /* Suspend a thread */
301 handle_t handle; /* thread handle */
303 int count; /* new suspend count */
307 /* Resume a thread */
309 handle_t handle; /* thread handle */
311 int count; /* new suspend count */
315 /* Notify the server that a dll has been loaded */
317 handle_t handle; /* file handle */
318 void* base; /* base address */
319 int dbg_offset; /* debug info offset */
320 int dbg_size; /* debug info size */
321 void* name; /* ptr to ptr to name (in process addr space) */
325 /* Notify the server that a dll is being unloaded */
327 void* base; /* base address */
331 /* Queue an APC for a thread */
333 handle_t handle; /* thread handle */
334 int user; /* user or system apc? */
335 void* func; /* function to call */
336 void* param; /* param for function to call */
340 /* Get next APC to call */
342 int alertable; /* is thread alertable? */
344 void* func; /* function to call */
345 int type; /* function type */
346 VARARG(args,ptrs); /* function arguments */
348 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
351 /* Close a handle for the current process */
353 handle_t handle; /* handle to close */
355 int fd; /* associated fd to close */
359 /* Set a handle information */
360 @REQ(set_handle_info)
361 handle_t handle; /* handle we are interested in */
362 int flags; /* new handle flags */
363 int mask; /* mask for flags to set */
364 int fd; /* file descriptor or -1 */
366 int old_flags; /* old flag value */
367 int cur_fd; /* current file descriptor */
371 /* Duplicate a handle */
373 handle_t src_process; /* src process handle */
374 handle_t src_handle; /* src handle to duplicate */
375 handle_t dst_process; /* dst process handle */
376 unsigned int access; /* wanted access rights */
377 int inherit; /* inherit flag */
378 int options; /* duplicate options (see below) */
380 handle_t handle; /* duplicated handle in dst process */
381 int fd; /* associated fd to close */
383 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
384 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
385 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
388 /* Open a handle to a process */
390 void* pid; /* process id to open */
391 unsigned int access; /* wanted access rights */
392 int inherit; /* inherit flag */
394 handle_t handle; /* handle to the process */
398 /* Wait for handles */
400 int flags; /* wait flags (see below) */
401 void* cookie; /* magic cookie to return to client */
402 int sec; /* absolute timeout */
403 int usec; /* absolute timeout */
404 VARARG(handles,handles); /* handles to select on */
407 #define SELECT_ALERTABLE 2
408 #define SELECT_INTERRUPTIBLE 4
409 #define SELECT_TIMEOUT 8
412 /* Create an event */
414 int manual_reset; /* manual reset event */
415 int initial_state; /* initial state of the event */
416 int inherit; /* inherit flag */
417 VARARG(name,unicode_str); /* object name */
419 handle_t handle; /* handle to the event */
422 /* Event operation */
424 handle_t handle; /* handle to event */
425 int op; /* event operation (see below) */
427 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
432 unsigned int access; /* wanted access rights */
433 int inherit; /* inherit flag */
434 VARARG(name,unicode_str); /* object name */
436 handle_t handle; /* handle to the event */
442 int owned; /* initially owned? */
443 int inherit; /* inherit flag */
444 VARARG(name,unicode_str); /* object name */
446 handle_t handle; /* handle to the mutex */
450 /* Release a mutex */
452 handle_t handle; /* handle to the mutex */
458 unsigned int access; /* wanted access rights */
459 int inherit; /* inherit flag */
460 VARARG(name,unicode_str); /* object name */
462 handle_t handle; /* handle to the mutex */
466 /* Create a semaphore */
467 @REQ(create_semaphore)
468 unsigned int initial; /* initial count */
469 unsigned int max; /* maximum count */
470 int inherit; /* inherit flag */
471 VARARG(name,unicode_str); /* object name */
473 handle_t handle; /* handle to the semaphore */
477 /* Release a semaphore */
478 @REQ(release_semaphore)
479 handle_t handle; /* handle to the semaphore */
480 unsigned int count; /* count to add to semaphore */
482 unsigned int prev_count; /* previous semaphore count */
486 /* Open a semaphore */
488 unsigned int access; /* wanted access rights */
489 int inherit; /* inherit flag */
490 VARARG(name,unicode_str); /* object name */
492 handle_t handle; /* handle to the semaphore */
498 unsigned int access; /* wanted access rights */
499 int inherit; /* inherit flag */
500 unsigned int sharing; /* sharing flags */
501 int create; /* file create action */
502 unsigned int attrs; /* file attributes for creation */
503 VARARG(filename,string); /* file name */
505 handle_t handle; /* handle to the file */
509 /* Allocate a file handle for a Unix fd */
510 @REQ(alloc_file_handle)
511 unsigned int access; /* wanted access rights */
512 int fd; /* file descriptor on the client side */
514 handle_t handle; /* handle to the file */
518 /* Get a Unix fd to access a file */
520 handle_t handle; /* handle to the file */
521 unsigned int access; /* wanted access rights */
523 int fd; /* file descriptor */
527 /* Set a file current position */
528 @REQ(set_file_pointer)
529 handle_t handle; /* handle to the file */
530 int low; /* position low word */
531 int high; /* position high word */
532 int whence; /* whence to seek */
534 int new_low; /* new position low word */
535 int new_high; /* new position high word */
539 /* Truncate (or extend) a file */
541 handle_t handle; /* handle to the file */
545 /* Set a file access and modification times */
547 handle_t handle; /* handle to the file */
548 time_t access_time; /* last access time */
549 time_t write_time; /* last write time */
553 /* Flush a file buffers */
555 handle_t handle; /* handle to the file */
559 /* Get information about a file */
561 handle_t handle; /* handle to the file */
563 int type; /* file type */
564 int attr; /* file attributes */
565 time_t access_time; /* last access time */
566 time_t write_time; /* last write time */
567 int size_high; /* file size */
568 int size_low; /* file size */
569 int links; /* number of links */
570 int index_high; /* unique index */
571 int index_low; /* unique index */
572 unsigned int serial; /* volume serial number */
576 /* Lock a region of a file */
578 handle_t handle; /* handle to the file */
579 unsigned int offset_low; /* offset of start of lock */
580 unsigned int offset_high; /* offset of start of lock */
581 unsigned int count_low; /* count of bytes to lock */
582 unsigned int count_high; /* count of bytes to lock */
586 /* Unlock a region of a file */
588 handle_t handle; /* handle to the file */
589 unsigned int offset_low; /* offset of start of unlock */
590 unsigned int offset_high; /* offset of start of unlock */
591 unsigned int count_low; /* count of bytes to unlock */
592 unsigned int count_high; /* count of bytes to unlock */
596 /* Create an anonymous pipe */
598 int inherit; /* inherit flag */
600 handle_t handle_read; /* handle to the read-side of the pipe */
601 handle_t handle_write; /* handle to the write-side of the pipe */
605 /* Create a socket */
607 unsigned int access; /* wanted access rights */
608 int inherit; /* inherit flag */
609 int family; /* family, see socket manpage */
610 int type; /* type, see socket manpage */
611 int protocol; /* protocol, see socket manpage */
613 handle_t handle; /* handle to the new socket */
617 /* Accept a socket */
619 handle_t lhandle; /* handle to the listening socket */
620 unsigned int access; /* wanted access rights */
621 int inherit; /* inherit flag */
623 handle_t handle; /* handle to the new socket */
627 /* Set socket event parameters */
628 @REQ(set_socket_event)
629 handle_t handle; /* handle to the socket */
630 unsigned int mask; /* event mask */
631 handle_t event; /* event object */
635 /* Get socket event parameters */
636 @REQ(get_socket_event)
637 handle_t handle; /* handle to the socket */
638 int service; /* clear pending? */
639 handle_t s_event; /* "expected" event object */
640 handle_t c_event; /* event to clear */
642 unsigned int mask; /* event mask */
643 unsigned int pmask; /* pending events */
644 unsigned int state; /* status bits */
645 VARARG(errors,ints); /* event errors */
649 /* Reenable pending socket events */
650 @REQ(enable_socket_event)
651 handle_t handle; /* handle to the socket */
652 unsigned int mask; /* events to re-enable */
653 unsigned int sstate; /* status bits to set */
654 unsigned int cstate; /* status bits to clear */
658 /* Allocate a console for the current process */
660 unsigned int access; /* wanted access rights */
661 int inherit; /* inherit flag */
663 handle_t handle_in; /* handle to console input */
664 handle_t handle_out; /* handle to console output */
668 /* Free the console of the current process */
673 /* Open a handle to the process console */
675 int output; /* input or output? */
676 unsigned int access; /* wanted access rights */
677 int inherit; /* inherit flag */
679 handle_t handle; /* handle to the console */
683 /* Set a console file descriptor */
685 handle_t handle; /* handle to the console */
686 int fd_in; /* file descriptor to use as input */
687 int fd_out; /* file descriptor to use as output */
688 int pid; /* pid of xterm (hack) */
692 /* Get a console mode (input or output) */
693 @REQ(get_console_mode)
694 handle_t handle; /* handle to the console */
696 int mode; /* console mode */
700 /* Set a console mode (input or output) */
701 @REQ(set_console_mode)
702 handle_t handle; /* handle to the console */
703 int mode; /* console mode */
707 /* Set info about a console (output only) */
708 @REQ(set_console_info)
709 handle_t handle; /* handle to the console */
710 int mask; /* setting mask (see below) */
711 int cursor_size; /* size of cursor (percentage filled) */
712 int cursor_visible;/* cursor visibility flag */
713 VARARG(title,string); /* console title */
715 #define SET_CONSOLE_INFO_CURSOR 0x01
716 #define SET_CONSOLE_INFO_TITLE 0x02
718 /* Get info about a console (output only) */
719 @REQ(get_console_info)
720 handle_t handle; /* handle to the console */
722 int cursor_size; /* size of cursor (percentage filled) */
723 int cursor_visible;/* cursor visibility flag */
724 int pid; /* pid of xterm (hack) */
725 VARARG(title,string); /* console title */
729 /* Add input records to a console input queue */
730 @REQ(write_console_input)
731 handle_t handle; /* handle to the console input */
732 VARARG(rec,input_records); /* input records */
734 int written; /* number of records written */
737 /* Fetch input records from a console input queue */
738 @REQ(read_console_input)
739 handle_t handle; /* handle to the console input */
740 int flush; /* flush the retrieved records from the queue? */
742 int read; /* number of records read */
743 VARARG(rec,input_records); /* input records */
747 /* Create a change notification */
748 @REQ(create_change_notification)
749 int subtree; /* watch all the subtree */
750 int filter; /* notification filter */
752 handle_t handle; /* handle to the change notification */
756 /* Create a file mapping */
758 int size_high; /* mapping size */
759 int size_low; /* mapping size */
760 int protect; /* protection flags (see below) */
761 int inherit; /* inherit flag */
762 handle_t file_handle; /* file handle */
763 VARARG(name,unicode_str); /* object name */
765 handle_t handle; /* handle to the mapping */
767 /* protection flags */
768 #define VPROT_READ 0x01
769 #define VPROT_WRITE 0x02
770 #define VPROT_EXEC 0x04
771 #define VPROT_WRITECOPY 0x08
772 #define VPROT_GUARD 0x10
773 #define VPROT_NOCACHE 0x20
774 #define VPROT_COMMITTED 0x40
775 #define VPROT_IMAGE 0x80
780 unsigned int access; /* wanted access rights */
781 int inherit; /* inherit flag */
782 VARARG(name,unicode_str); /* object name */
784 handle_t handle; /* handle to the mapping */
788 /* Get information about a file mapping */
789 @REQ(get_mapping_info)
790 handle_t handle; /* handle to the mapping */
792 int size_high; /* mapping size */
793 int size_low; /* mapping size */
794 int protect; /* protection flags */
795 int header_size; /* header size (for VPROT_IMAGE mapping) */
796 void* base; /* default base addr (for VPROT_IMAGE mapping) */
797 handle_t shared_file; /* shared mapping file handle */
798 int shared_size; /* shared mapping size */
802 /* Create a device */
804 unsigned int access; /* wanted access rights */
805 int inherit; /* inherit flag */
806 int id; /* client private id */
808 handle_t handle; /* handle to the device */
812 /* Create a snapshot */
813 @REQ(create_snapshot)
814 int inherit; /* inherit flag */
815 int flags; /* snapshot flags (TH32CS_*) */
816 void* pid; /* process id */
818 handle_t handle; /* handle to the snapshot */
822 /* Get the next process from a snapshot */
824 handle_t handle; /* handle to the snapshot */
825 int reset; /* reset snapshot position? */
827 int count; /* process usage count */
828 void* pid; /* process id */
829 int threads; /* number of threads */
830 int priority; /* process priority */
834 /* Get the next thread from a snapshot */
836 handle_t handle; /* handle to the snapshot */
837 int reset; /* reset snapshot position? */
839 int count; /* thread usage count */
840 void* pid; /* process id */
841 void* tid; /* thread id */
842 int base_pri; /* base priority */
843 int delta_pri; /* delta priority */
847 /* Get the next module from a snapshot */
849 handle_t handle; /* handle to the snapshot */
850 int reset; /* reset snapshot position? */
852 void* pid; /* process id */
853 void* base; /* module base address */
857 /* Wait for a debug event */
858 @REQ(wait_debug_event)
859 int get_handle; /* should we alloc a handle for waiting? */
861 void* pid; /* process id */
862 void* tid; /* thread id */
863 handle_t wait; /* wait handle if no event ready */
864 VARARG(event,debug_event); /* debug event data */
868 /* Queue an exception event */
869 @REQ(queue_exception_event)
870 int first; /* first chance exception? */
871 VARARG(record,exc_event); /* thread context followed by exception record */
873 handle_t handle; /* handle to the queued event */
877 /* Retrieve the status of an exception event */
878 @REQ(get_exception_status)
880 handle_t handle; /* handle to the queued event */
881 int status; /* event continuation status */
882 VARARG(context,context); /* modified thread context */
886 /* Send an output string to the debugger */
887 @REQ(output_debug_string)
888 void* string; /* string to display (in debugged process address space) */
889 int unicode; /* is it Unicode? */
890 int length; /* string length */
894 /* Continue a debug event */
895 @REQ(continue_debug_event)
896 void* pid; /* process id to continue */
897 void* tid; /* thread id to continue */
898 int status; /* continuation status */
902 /* Start debugging an existing process */
904 void* pid; /* id of the process to debug */
908 /* Read data from a process address space */
909 @REQ(read_process_memory)
910 handle_t handle; /* process handle */
911 void* addr; /* addr to read from (must be int-aligned) */
912 int len; /* number of ints to read */
914 VARARG(data,bytes); /* result data */
918 /* Write data to a process address space */
919 @REQ(write_process_memory)
920 handle_t handle; /* process handle */
921 void* addr; /* addr to write to (must be int-aligned) */
922 int len; /* number of ints to write */
923 unsigned int first_mask; /* mask for first word */
924 unsigned int last_mask; /* mask for last word */
925 VARARG(data,bytes); /* result data */
929 /* Create a registry key */
931 handle_t parent; /* handle to the parent key */
932 unsigned int access; /* desired access rights */
933 unsigned int options; /* creation options */
934 time_t modif; /* last modification time */
935 VARARG(name,unicode_len_str); /* key name */
936 VARARG(class,unicode_str); /* class name */
938 handle_t hkey; /* handle to the created key */
939 int created; /* has it been newly created? */
942 /* Open a registry key */
944 handle_t parent; /* handle to the parent key */
945 unsigned int access; /* desired access rights */
946 VARARG(name,unicode_str); /* key name */
948 handle_t hkey; /* handle to the open key */
952 /* Delete a registry key */
954 handle_t hkey; /* handle to the key */
958 /* Enumerate registry subkeys */
960 handle_t hkey; /* handle to registry key */
961 int index; /* index of subkey (or -1 for current key) */
962 int full; /* return the full info? */
964 int subkeys; /* number of subkeys */
965 int max_subkey; /* longest subkey name */
966 int max_class; /* longest class name */
967 int values; /* number of values */
968 int max_value; /* longest value name */
969 int max_data; /* longest value data */
970 time_t modif; /* last modification time */
971 VARARG(name,unicode_len_str); /* key name */
972 VARARG(class,unicode_str); /* class name */
976 /* Set a value of a registry key */
978 handle_t hkey; /* handle to registry key */
979 int type; /* value type */
980 unsigned int total; /* total value len */
981 unsigned int offset; /* offset for setting data */
982 VARARG(name,unicode_len_str); /* value name */
983 VARARG(data,bytes); /* value data */
987 /* Retrieve the value of a registry key */
989 handle_t hkey; /* handle to registry key */
990 unsigned int offset; /* offset for getting data */
991 VARARG(name,unicode_len_str); /* value name */
993 int type; /* value type */
994 int len; /* value data len */
995 VARARG(data,bytes); /* value data */
999 /* Enumerate a value of a registry key */
1000 @REQ(enum_key_value)
1001 handle_t hkey; /* handle to registry key */
1002 int index; /* value index */
1003 unsigned int offset; /* offset for getting data */
1005 int type; /* value type */
1006 int len; /* value data len */
1007 VARARG(name,unicode_len_str); /* value name */
1008 VARARG(data,bytes); /* value data */
1012 /* Delete a value of a registry key */
1013 @REQ(delete_key_value)
1014 handle_t hkey; /* handle to registry key */
1015 VARARG(name,unicode_str); /* value name */
1019 /* Load a registry branch from a file */
1021 handle_t hkey; /* root key to load to */
1022 handle_t file; /* file to load from */
1023 VARARG(name,unicode_str); /* subkey name */
1027 /* Save a registry branch to a file */
1029 handle_t hkey; /* key to save */
1030 handle_t file; /* file to save to */
1034 /* Save a registry branch at server exit */
1035 @REQ(save_registry_atexit)
1036 handle_t hkey; /* key to save */
1037 VARARG(file,string); /* file to save to */
1041 /* Set the current and saving level for the registry */
1042 @REQ(set_registry_levels)
1043 int current; /* new current level */
1044 int saving; /* new saving level */
1045 int period; /* duration between periodic saves (milliseconds) */
1049 /* Create a waitable timer */
1051 int inherit; /* inherit flag */
1052 int manual; /* manual reset */
1053 VARARG(name,unicode_str); /* object name */
1055 handle_t handle; /* handle to the timer */
1059 /* Open a waitable timer */
1061 unsigned int access; /* wanted access rights */
1062 int inherit; /* inherit flag */
1063 VARARG(name,unicode_str); /* object name */
1065 handle_t handle; /* handle to the timer */
1068 /* Set a waitable timer */
1070 handle_t handle; /* handle to the timer */
1071 int sec; /* next expiration absolute time */
1072 int usec; /* next expiration absolute time */
1073 int period; /* timer period in ms */
1074 void* callback; /* callback function */
1075 void* arg; /* callback argument */
1078 /* Cancel a waitable timer */
1080 handle_t handle; /* handle to the timer */
1084 /* Retrieve the current context of a thread */
1085 @REQ(get_thread_context)
1086 handle_t handle; /* thread handle */
1087 unsigned int flags; /* context flags */
1089 VARARG(context,context); /* thread context */
1093 /* Set the current context of a thread */
1094 @REQ(set_thread_context)
1095 handle_t handle; /* thread handle */
1096 unsigned int flags; /* context flags */
1097 VARARG(context,context); /* thread context */
1101 /* Fetch a selector entry for a thread */
1102 @REQ(get_selector_entry)
1103 handle_t handle; /* thread handle */
1104 int entry; /* LDT entry */
1106 unsigned int base; /* selector base */
1107 unsigned int limit; /* selector limit */
1108 unsigned char flags; /* selector flags */
1114 int local; /* is atom in local process table? */
1115 VARARG(name,unicode_str); /* atom name */
1117 int atom; /* resulting atom */
1121 /* Delete an atom */
1123 int atom; /* atom handle */
1124 int local; /* is atom in local process table? */
1130 int local; /* is atom in local process table? */
1131 VARARG(name,unicode_str); /* atom name */
1133 int atom; /* atom handle */
1137 /* Get an atom name */
1139 int atom; /* atom handle */
1140 int local; /* is atom in local process table? */
1142 int count; /* atom lock count */
1143 VARARG(name,unicode_str); /* atom name */
1147 /* Init the process atom table */
1148 @REQ(init_atom_table)
1149 int entries; /* number of entries */
1153 /* Get the message queue of the current thread */
1156 handle_t handle; /* handle to the queue */
1160 /* Increment the message queue paint count */
1161 @REQ(inc_queue_paint_count)
1162 void* id; /* thread id */
1163 int incr; /* increment (can be negative) */
1167 /* Set the current message queue wakeup mask */
1168 @REQ(set_queue_mask)
1169 unsigned int wake_mask; /* wakeup bits mask */
1170 unsigned int changed_mask; /* changed bits mask */
1171 int skip_wait; /* will we skip waiting if signaled? */
1173 unsigned int wake_bits; /* current wake bits */
1174 unsigned int changed_bits; /* current changed bits */
1178 /* Get the current message queue status */
1179 @REQ(get_queue_status)
1180 int clear; /* should we clear the change bits? */
1182 unsigned int wake_bits; /* wake bits */
1183 unsigned int changed_bits; /* changed bits since last time */
1187 /* Wait for a process to start waiting on input */
1188 @REQ(wait_input_idle)
1189 handle_t handle; /* process handle */
1190 int timeout; /* timeout */
1192 handle_t event; /* handle to idle event */
1196 /* Send a message to a thread queue */
1198 void* id; /* thread id */
1199 int type; /* message type (see below) */
1200 handle_t win; /* window handle */
1201 unsigned int msg; /* message code */
1202 unsigned int wparam; /* parameters */
1203 unsigned int lparam; /* parameters */
1204 int x; /* x position */
1205 int y; /* y position */
1206 unsigned int time; /* message time */
1207 unsigned int info; /* extra info */
1208 int timeout; /* timeout for reply */
1209 VARARG(data,bytes); /* message data for sent messages */
1214 MSG_ASCII, /* Ascii message (from SendMessageA) */
1215 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1216 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1217 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1218 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1219 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1220 MSG_HARDWARE_RAW, /* raw hardware message */
1221 MSG_HARDWARE_COOKED /* cooked hardware message */
1225 /* Get a message from the current queue */
1227 int flags; /* see below */
1228 handle_t get_win; /* window handle to get */
1229 unsigned int get_first; /* first message code to get */
1230 unsigned int get_last; /* last message code to get */
1232 int type; /* message type */
1233 handle_t win; /* window handle */
1234 unsigned int msg; /* message code */
1235 unsigned int wparam; /* parameters */
1236 unsigned int lparam; /* parameters */
1237 int x; /* x position */
1238 int y; /* y position */
1239 unsigned int time; /* message time */
1240 unsigned int info; /* extra info */
1241 VARARG(data,bytes); /* message data for sent messages */
1243 #define GET_MSG_REMOVE 1 /* remove the message */
1244 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1245 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1247 /* Reply to a sent message */
1249 unsigned int result; /* message result */
1250 int remove; /* should we remove the message? */
1251 VARARG(data,bytes); /* message data for sent messages */
1255 /* Retrieve the reply for the last message sent */
1256 @REQ(get_message_reply)
1257 int cancel; /* cancel message if not ready? */
1259 unsigned int result; /* message result */
1260 VARARG(data,bytes); /* message data for sent messages */
1264 /* Cleanup a queue when a window is deleted */
1265 @REQ(cleanup_window_queue)
1266 handle_t win; /* window handle */
1270 /* Set a window timer */
1272 handle_t win; /* window handle */
1273 unsigned int msg; /* message to post */
1274 unsigned int id; /* timer id */
1275 unsigned int rate; /* timer rate in ms */
1276 unsigned int lparam; /* message lparam (callback proc) */
1280 /* Kill a window timer */
1281 @REQ(kill_win_timer)
1282 handle_t win; /* window handle */
1283 unsigned int msg; /* message to post */
1284 unsigned int id; /* timer id */
1288 /* Open a serial port */
1290 unsigned int access; /* wanted access rights */
1291 int inherit; /* inherit flag */
1292 unsigned int sharing; /* sharing flags */
1293 VARARG(name,string); /* file name */
1295 handle_t handle; /* handle to the port */
1299 /* Retrieve info about a serial port */
1300 @REQ(get_serial_info)
1301 handle_t handle; /* handle to comm port */
1303 unsigned int readinterval;
1304 unsigned int readconst;
1305 unsigned int readmult;
1306 unsigned int writeconst;
1307 unsigned int writemult;
1308 unsigned int eventmask;
1309 unsigned int commerror;
1313 /* Set info about a serial port */
1314 @REQ(set_serial_info)
1315 handle_t handle; /* handle to comm port */
1316 int flags; /* bitmask to set values (see below) */
1317 unsigned int readinterval;
1318 unsigned int readconst;
1319 unsigned int readmult;
1320 unsigned int writeconst;
1321 unsigned int writemult;
1322 unsigned int eventmask;
1323 unsigned int commerror;
1325 #define SERIALINFO_SET_TIMEOUTS 0x01
1326 #define SERIALINFO_SET_MASK 0x02
1327 #define SERIALINFO_SET_ERROR 0x04
1330 /* Create an async I/O */
1332 handle_t file_handle; /* handle to comm port, socket or file */
1338 #define ASYNC_TYPE_READ 0x01
1339 #define ASYNC_TYPE_WRITE 0x02
1340 #define ASYNC_TYPE_WAIT 0x03
1343 /* Create a named pipe */
1344 @REQ(create_named_pipe)
1345 unsigned int openmode;
1346 unsigned int pipemode;
1347 unsigned int maxinstances;
1348 unsigned int outsize;
1349 unsigned int insize;
1350 unsigned int timeout;
1351 VARARG(filename,string); /* pipe name */
1353 handle_t handle; /* handle to the pipe */
1357 /* Open an existing named pipe */
1358 @REQ(open_named_pipe)
1359 unsigned int access;
1360 VARARG(filename,string); /* pipe name */
1362 handle_t handle; /* handle to the pipe */
1366 /* Connect to a named pipe */
1367 @REQ(connect_named_pipe)
1369 handle_t event; /* set this event when it's ready
*/