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
43 typedef unsigned short atom_t
;
44 typedef unsigned int user_handle_t
;
46 #define FIRST_USER_HANDLE
0x0020 /* first possible value for low word of user handle
*/
47 #define LAST_USER_HANDLE
0xffef /* last possible value for low word of user handle
*/
50 /* definitions of the event data depending on the event code
*/
51 struct debug_event_exception
53 EXCEPTION_RECORD record
; /* exception record
*/
54 int first
; /* first chance exception?
*/
56 struct debug_event_create_thread
58 handle_t handle
; /* handle to the new thread
*/
59 void
*teb
; /* thread
teb (in debugged process address space
) */
60 void
*start
; /* thread startup routine
*/
62 struct debug_event_create_process
64 handle_t file
; /* handle to the process exe file
*/
65 handle_t process
; /* handle to the new process
*/
66 handle_t thread
; /* handle to the new thread
*/
67 void
*base
; /* base of executable image
*/
68 int dbg_offset
; /* offset of debug info in file
*/
69 int dbg_size
; /* size of debug info
*/
70 void
*teb
; /* thread
teb (in debugged process address space
) */
71 void
*start
; /* thread startup routine
*/
72 void
*name
; /* image
name (optional
) */
73 int unicode
; /* is it Unicode?
*/
75 struct debug_event_exit
77 int exit_code
; /* thread or process exit code
*/
79 struct debug_event_load_dll
81 handle_t handle
; /* file handle for the dll
*/
82 void
*base
; /* base address of the dll
*/
83 int dbg_offset
; /* offset of debug info in file
*/
84 int dbg_size
; /* size of debug info
*/
85 void
*name
; /* image
name (optional
) */
86 int unicode
; /* is it Unicode?
*/
88 struct debug_event_unload_dll
90 void
*base
; /* base address of the dll
*/
92 struct debug_event_output_string
94 void
*string
; /* string to
display (in debugged process address space
) */
95 int unicode
; /* is it Unicode?
*/
96 int length
; /* string length
*/
98 struct debug_event_rip_info
103 union debug_event_data
105 struct debug_event_exception exception
;
106 struct debug_event_create_thread create_thread
;
107 struct debug_event_create_process create_process
;
108 struct debug_event_exit exit
;
109 struct debug_event_load_dll load_dll
;
110 struct debug_event_unload_dll unload_dll
;
111 struct debug_event_output_string output_string
;
112 struct debug_event_rip_info rip_info
;
115 /* debug event data
*/
118 int code
; /* event code
*/
119 union debug_event_data info
; /* event information
*/
122 /* structure used in sending an fd from client to server
*/
125 void
*tid
; /* thread id
*/
126 int fd
; /* file descriptor on client
-side
*/
129 /* structure sent by the server on the wait fifo
*/
132 void
*cookie
; /* magic cookie that was passed in select_request
*/
133 int signaled
; /* wait result
*/
136 /* structure returned in the list of window properties
*/
139 atom_t atom
; /* property atom
*/
140 short string
; /* was atom a string originally?
*/
141 handle_t handle
; /* handle stored in property
*/
144 /* structure to specify window rectangles
*/
153 /****************************************************************/
154 /* Request declarations
*/
156 /* Create a new process from the context of the parent
*/
158 int inherit_all
; /* inherit all handles from parent
*/
159 int create_flags
; /* creation flags
*/
160 int start_flags
; /* flags from startup info
*/
161 handle_t exe_file
; /* file handle for main exe
*/
162 handle_t hstdin
; /* handle for stdin
*/
163 handle_t hstdout
; /* handle for stdout
*/
164 handle_t hstderr
; /* handle for stderr
*/
165 int cmd_show
; /* main window show mode
*/
166 VARARG(filename
,string
); /* file name of main exe
*/
168 handle_t info
; /* new process info handle
*/
172 /* Retrieve information about a newly started process
*/
173 @
REQ(get_new_process_info
)
174 handle_t info
; /* info handle returned from new_process_request
*/
175 int pinherit
; /* process handle inherit flag
*/
176 int tinherit
; /* thread handle inherit flag
*/
178 void
* pid
; /* process id
*/
179 handle_t phandle
; /* process
handle (in the current process
) */
180 void
* tid
; /* thread id
*/
181 handle_t thandle
; /* thread
handle (in the current process
) */
182 handle_t event
; /* event handle to signal startup
*/
186 /* Create a new thread from the context of the parent
*/
188 int suspend
; /* new thread should be suspended on creation
*/
189 int inherit
; /* inherit flag
*/
190 int request_fd
; /* fd for request pipe
*/
192 void
* tid
; /* thread id
*/
193 handle_t handle
; /* thread
handle (in the current process
) */
197 /* Signal that we are finished booting on the client side
*/
199 int debug_level
; /* new debug level
*/
203 /* Initialize a process
; called from the new process context
*/
205 void
* ldt_copy
; /* addr of LDT copy
*/
206 int ppid
; /* parent Unix pid
*/
208 int create_flags
; /* creation flags
*/
209 int start_flags
; /* flags from startup info
*/
210 unsigned int server_start
; /* server start
time (GetTickCount
) */
211 handle_t exe_file
; /* file handle for main exe
*/
212 handle_t hstdin
; /* handle for stdin
*/
213 handle_t hstdout
; /* handle for stdout
*/
214 handle_t hstderr
; /* handle for stderr
*/
215 int cmd_show
; /* main window show mode
*/
216 VARARG(filename
,string
); /* file name of main exe
*/
220 /* Signal the end of the process initialization
*/
221 @
REQ(init_process_done
)
222 void
* module
; /* main module base address
*/
223 void
* entry
; /* process entry point
*/
224 void
* name
; /* ptr to ptr to
name (in process addr space
) */
225 handle_t exe_file
; /* file handle for main exe
*/
226 int gui
; /* is it a GUI process?
*/
228 int debugged
; /* being debugged?
*/
232 /* Initialize a thread
; called from the child after
fork()/clone() */
234 int unix_pid
; /* Unix pid of new thread
*/
235 void
* teb
; /* TEB of new
thread (in thread address space
) */
236 void
* entry
; /* thread entry
point (in thread address space
) */
237 int reply_fd
; /* fd for reply pipe
*/
238 int wait_fd
; /* fd for blocking calls pipe
*/
240 void
* pid
; /* process id of the new thread
's process */
241 void* tid; /* thread id of the new thread */
242 int boot; /* is this the boot thread? */
243 int version; /* protocol version */
247 /* Set the shared buffer for a thread */
248 @REQ(set_thread_buffer)
249 int fd; /* fd to mmap as shared buffer */
251 unsigned int offset; /* offset of buffer in file */
252 unsigned int size; /* size of buffer */
256 /* Terminate a process */
257 @REQ(terminate_process)
258 handle_t handle; /* process handle to terminate */
259 int exit_code; /* process exit code */
261 int self; /* suicide? */
265 /* Terminate a thread */
266 @REQ(terminate_thread)
267 handle_t handle; /* thread handle to terminate */
268 int exit_code; /* thread exit code */
270 int self; /* suicide? */
271 int last; /* last thread in this process? */
275 /* Retrieve information about a process */
276 @REQ(get_process_info)
277 handle_t handle; /* process handle */
279 void* pid; /* server process id */
280 int debugged; /* debugged? */
281 int exit_code; /* process exit code */
282 int priority; /* priority class */
283 int process_affinity; /* process affinity mask */
284 int system_affinity; /* system affinity mask */
288 /* Set a process informations */
289 @REQ(set_process_info)
290 handle_t handle; /* process handle */
291 int mask; /* setting mask (see below) */
292 int priority; /* priority class */
293 int affinity; /* affinity mask */
295 #define SET_PROCESS_INFO_PRIORITY 0x01
296 #define SET_PROCESS_INFO_AFFINITY 0x02
299 /* Retrieve information about a thread */
300 @REQ(get_thread_info)
301 handle_t handle; /* thread handle */
302 void* tid_in; /* thread id (optional) */
304 void* tid; /* server thread id */
305 void* teb; /* thread teb pointer */
306 int exit_code; /* thread exit code */
307 int priority; /* thread priority level */
311 /* Set a thread informations */
312 @REQ(set_thread_info)
313 handle_t handle; /* thread handle */
314 int mask; /* setting mask (see below) */
315 int priority; /* priority class */
316 int affinity; /* affinity mask */
318 #define SET_THREAD_INFO_PRIORITY 0x01
319 #define SET_THREAD_INFO_AFFINITY 0x02
322 /* Suspend a thread */
324 handle_t handle; /* thread handle */
326 int count; /* new suspend count */
330 /* Resume a thread */
332 handle_t handle; /* thread handle */
334 int count; /* new suspend count */
338 /* Notify the server that a dll has been loaded */
340 handle_t handle; /* file handle */
341 void* base; /* base address */
342 int dbg_offset; /* debug info offset */
343 int dbg_size; /* debug info size */
344 void* name; /* ptr to ptr to name (in process addr space) */
348 /* Notify the server that a dll is being unloaded */
350 void* base; /* base address */
354 /* Queue an APC for a thread */
356 handle_t handle; /* thread handle */
357 int user; /* user or system apc? */
358 void* func; /* function to call */
359 void* param; /* param for function to call */
363 /* Get next APC to call */
365 int alertable; /* is thread alertable? */
367 void* func; /* function to call */
368 int type; /* function type */
369 VARARG(args,ptrs); /* function arguments */
371 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
374 /* Close a handle for the current process */
376 handle_t handle; /* handle to close */
378 int fd; /* associated fd to close */
382 /* Set a handle information */
383 @REQ(set_handle_info)
384 handle_t handle; /* handle we are interested in */
385 int flags; /* new handle flags */
386 int mask; /* mask for flags to set */
387 int fd; /* file descriptor or -1 */
389 int old_flags; /* old flag value */
390 int cur_fd; /* current file descriptor */
394 /* Duplicate a handle */
396 handle_t src_process; /* src process handle */
397 handle_t src_handle; /* src handle to duplicate */
398 handle_t dst_process; /* dst process handle */
399 unsigned int access; /* wanted access rights */
400 int inherit; /* inherit flag */
401 int options; /* duplicate options (see below) */
403 handle_t handle; /* duplicated handle in dst process */
404 int fd; /* associated fd to close */
406 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
407 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
408 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
411 /* Open a handle to a process */
413 void* pid; /* process id to open */
414 unsigned int access; /* wanted access rights */
415 int inherit; /* inherit flag */
417 handle_t handle; /* handle to the process */
421 /* Wait for handles */
423 int flags; /* wait flags (see below) */
424 void* cookie; /* magic cookie to return to client */
425 int sec; /* absolute timeout */
426 int usec; /* absolute timeout */
427 VARARG(handles,handles); /* handles to select on */
430 #define SELECT_ALERTABLE 2
431 #define SELECT_INTERRUPTIBLE 4
432 #define SELECT_TIMEOUT 8
435 /* Create an event */
437 int manual_reset; /* manual reset event */
438 int initial_state; /* initial state of the event */
439 int inherit; /* inherit flag */
440 VARARG(name,unicode_str); /* object name */
442 handle_t handle; /* handle to the event */
445 /* Event operation */
447 handle_t handle; /* handle to event */
448 int op; /* event operation (see below) */
450 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
455 unsigned int access; /* wanted access rights */
456 int inherit; /* inherit flag */
457 VARARG(name,unicode_str); /* object name */
459 handle_t handle; /* handle to the event */
465 int owned; /* initially owned? */
466 int inherit; /* inherit flag */
467 VARARG(name,unicode_str); /* object name */
469 handle_t handle; /* handle to the mutex */
473 /* Release a mutex */
475 handle_t handle; /* handle to the mutex */
481 unsigned int access; /* wanted access rights */
482 int inherit; /* inherit flag */
483 VARARG(name,unicode_str); /* object name */
485 handle_t handle; /* handle to the mutex */
489 /* Create a semaphore */
490 @REQ(create_semaphore)
491 unsigned int initial; /* initial count */
492 unsigned int max; /* maximum count */
493 int inherit; /* inherit flag */
494 VARARG(name,unicode_str); /* object name */
496 handle_t handle; /* handle to the semaphore */
500 /* Release a semaphore */
501 @REQ(release_semaphore)
502 handle_t handle; /* handle to the semaphore */
503 unsigned int count; /* count to add to semaphore */
505 unsigned int prev_count; /* previous semaphore count */
509 /* Open a semaphore */
511 unsigned int access; /* wanted access rights */
512 int inherit; /* inherit flag */
513 VARARG(name,unicode_str); /* object name */
515 handle_t handle; /* handle to the semaphore */
521 unsigned int access; /* wanted access rights */
522 int inherit; /* inherit flag */
523 unsigned int sharing; /* sharing flags */
524 int create; /* file create action */
525 unsigned int attrs; /* file attributes for creation */
526 int drive_type; /* type of drive the file is on */
527 VARARG(filename,string); /* file name */
529 handle_t handle; /* handle to the file */
533 /* Allocate a file handle for a Unix fd */
534 @REQ(alloc_file_handle)
535 unsigned int access; /* wanted access rights */
536 int fd; /* file descriptor on the client side */
538 handle_t handle; /* handle to the file */
542 /* Get a Unix fd to access a file */
544 handle_t handle; /* handle to the file */
545 unsigned int access; /* wanted access rights */
547 int fd; /* file descriptor */
548 int type; /* the type of file */
550 #define FD_TYPE_INVALID 0
551 #define FD_TYPE_DEFAULT 1
552 #define FD_TYPE_CONSOLE 2
553 #define FD_TYPE_OVERLAPPED 3
554 #define FD_TYPE_TIMEOUT 4
557 /* Set a file current position */
558 @REQ(set_file_pointer)
559 handle_t handle; /* handle to the file */
560 int low; /* position low word */
561 int high; /* position high word */
562 int whence; /* whence to seek */
564 int new_low; /* new position low word */
565 int new_high; /* new position high word */
569 /* Truncate (or extend) a file */
571 handle_t handle; /* handle to the file */
575 /* Set a file access and modification times */
577 handle_t handle; /* handle to the file */
578 time_t access_time; /* last access time */
579 time_t write_time; /* last write time */
583 /* Flush a file buffers */
585 handle_t handle; /* handle to the file */
589 /* Get information about a file */
591 handle_t handle; /* handle to the file */
593 int type; /* file type */
594 int attr; /* file attributes */
595 time_t access_time; /* last access time */
596 time_t write_time; /* last write time */
597 int size_high; /* file size */
598 int size_low; /* file size */
599 int links; /* number of links */
600 int index_high; /* unique index */
601 int index_low; /* unique index */
602 unsigned int serial; /* volume serial number */
606 /* Lock a region of a file */
608 handle_t handle; /* handle to the file */
609 unsigned int offset_low; /* offset of start of lock */
610 unsigned int offset_high; /* offset of start of lock */
611 unsigned int count_low; /* count of bytes to lock */
612 unsigned int count_high; /* count of bytes to lock */
616 /* Unlock a region of a file */
618 handle_t handle; /* handle to the file */
619 unsigned int offset_low; /* offset of start of unlock */
620 unsigned int offset_high; /* offset of start of unlock */
621 unsigned int count_low; /* count of bytes to unlock */
622 unsigned int count_high; /* count of bytes to unlock */
626 /* Create an anonymous pipe */
628 int inherit; /* inherit flag */
630 handle_t handle_read; /* handle to the read-side of the pipe */
631 handle_t handle_write; /* handle to the write-side of the pipe */
635 /* Create a socket */
637 unsigned int access; /* wanted access rights */
638 int inherit; /* inherit flag */
639 int family; /* family, see socket manpage */
640 int type; /* type, see socket manpage */
641 int protocol; /* protocol, see socket manpage */
643 handle_t handle; /* handle to the new socket */
647 /* Accept a socket */
649 handle_t lhandle; /* handle to the listening socket */
650 unsigned int access; /* wanted access rights */
651 int inherit; /* inherit flag */
653 handle_t handle; /* handle to the new socket */
657 /* Set socket event parameters */
658 @REQ(set_socket_event)
659 handle_t handle; /* handle to the socket */
660 unsigned int mask; /* event mask */
661 handle_t event; /* event object */
665 /* Get socket event parameters */
666 @REQ(get_socket_event)
667 handle_t handle; /* handle to the socket */
668 int service; /* clear pending? */
669 handle_t s_event; /* "expected" event object */
670 handle_t c_event; /* event to clear */
672 unsigned int mask; /* event mask */
673 unsigned int pmask; /* pending events */
674 unsigned int state; /* status bits */
675 VARARG(errors,ints); /* event errors */
679 /* Reenable pending socket events */
680 @REQ(enable_socket_event)
681 handle_t handle; /* handle to the socket */
682 unsigned int mask; /* events to re-enable */
683 unsigned int sstate; /* status bits to set */
684 unsigned int cstate; /* status bits to clear */
688 /* Allocate a console for the current process */
690 unsigned int access; /* wanted access rights */
691 int inherit; /* inherit flag */
693 handle_t handle_in; /* handle to console input */
694 handle_t handle_out; /* handle to console output */
698 /* Free the console of the current process */
703 /* Open a handle to the process console */
705 int output; /* input or output? */
706 unsigned int access; /* wanted access rights */
707 int inherit; /* inherit flag */
709 handle_t handle; /* handle to the console */
713 /* Set a console file descriptor */
715 handle_t handle; /* handle to the console */
716 int fd_in; /* file descriptor to use as input */
717 int fd_out; /* file descriptor to use as output */
718 int pid; /* pid of xterm (hack) */
722 /* Get a console mode (input or output) */
723 @REQ(get_console_mode)
724 handle_t handle; /* handle to the console */
726 int mode; /* console mode */
730 /* Set a console mode (input or output) */
731 @REQ(set_console_mode)
732 handle_t handle; /* handle to the console */
733 int mode; /* console mode */
737 /* Set info about a console (output only) */
738 @REQ(set_console_info)
739 handle_t handle; /* handle to the console */
740 int mask; /* setting mask (see below) */
741 int cursor_size; /* size of cursor (percentage filled) */
742 int cursor_visible;/* cursor visibility flag */
743 VARARG(title,string); /* console title */
745 #define SET_CONSOLE_INFO_CURSOR 0x01
746 #define SET_CONSOLE_INFO_TITLE 0x02
748 /* Get info about a console (output only) */
749 @REQ(get_console_info)
750 handle_t handle; /* handle to the console */
752 int cursor_size; /* size of cursor (percentage filled) */
753 int cursor_visible;/* cursor visibility flag */
754 int pid; /* pid of xterm (hack) */
755 VARARG(title,string); /* console title */
759 /* Add input records to a console input queue */
760 @REQ(write_console_input)
761 handle_t handle; /* handle to the console input */
762 VARARG(rec,input_records); /* input records */
764 int written; /* number of records written */
767 /* Fetch input records from a console input queue */
768 @REQ(read_console_input)
769 handle_t handle; /* handle to the console input */
770 int flush; /* flush the retrieved records from the queue? */
772 int read; /* number of records read */
773 VARARG(rec,input_records); /* input records */
777 /* Create a change notification */
778 @REQ(create_change_notification)
779 int subtree; /* watch all the subtree */
780 int filter; /* notification filter */
782 handle_t handle; /* handle to the change notification */
786 /* Create a file mapping */
788 int size_high; /* mapping size */
789 int size_low; /* mapping size */
790 int protect; /* protection flags (see below) */
791 int inherit; /* inherit flag */
792 handle_t file_handle; /* file handle */
793 VARARG(name,unicode_str); /* object name */
795 handle_t handle; /* handle to the mapping */
797 /* protection flags */
798 #define VPROT_READ 0x01
799 #define VPROT_WRITE 0x02
800 #define VPROT_EXEC 0x04
801 #define VPROT_WRITECOPY 0x08
802 #define VPROT_GUARD 0x10
803 #define VPROT_NOCACHE 0x20
804 #define VPROT_COMMITTED 0x40
805 #define VPROT_IMAGE 0x80
810 unsigned int access; /* wanted access rights */
811 int inherit; /* inherit flag */
812 VARARG(name,unicode_str); /* object name */
814 handle_t handle; /* handle to the mapping */
818 /* Get information about a file mapping */
819 @REQ(get_mapping_info)
820 handle_t handle; /* handle to the mapping */
822 int size_high; /* mapping size */
823 int size_low; /* mapping size */
824 int protect; /* protection flags */
825 int header_size; /* header size (for VPROT_IMAGE mapping) */
826 void* base; /* default base addr (for VPROT_IMAGE mapping) */
827 handle_t shared_file; /* shared mapping file handle */
828 int shared_size; /* shared mapping size */
829 int drive_type; /* type of drive the file is on */
833 /* Create a device */
835 unsigned int access; /* wanted access rights */
836 int inherit; /* inherit flag */
837 int id; /* client private id */
839 handle_t handle; /* handle to the device */
843 /* Create a snapshot */
844 @REQ(create_snapshot)
845 int inherit; /* inherit flag */
846 int flags; /* snapshot flags (TH32CS_*) */
847 void* pid; /* process id */
849 handle_t handle; /* handle to the snapshot */
853 /* Get the next process from a snapshot */
855 handle_t handle; /* handle to the snapshot */
856 int reset; /* reset snapshot position? */
858 int count; /* process usage count */
859 void* pid; /* process id */
860 int threads; /* number of threads */
861 int priority; /* process priority */
865 /* Get the next thread from a snapshot */
867 handle_t handle; /* handle to the snapshot */
868 int reset; /* reset snapshot position? */
870 int count; /* thread usage count */
871 void* pid; /* process id */
872 void* tid; /* thread id */
873 int base_pri; /* base priority */
874 int delta_pri; /* delta priority */
878 /* Get the next module from a snapshot */
880 handle_t handle; /* handle to the snapshot */
881 int reset; /* reset snapshot position? */
883 void* pid; /* process id */
884 void* base; /* module base address */
888 /* Wait for a debug event */
889 @REQ(wait_debug_event)
890 int get_handle; /* should we alloc a handle for waiting? */
892 void* pid; /* process id */
893 void* tid; /* thread id */
894 handle_t wait; /* wait handle if no event ready */
895 VARARG(event,debug_event); /* debug event data */
899 /* Queue an exception event */
900 @REQ(queue_exception_event)
901 int first; /* first chance exception? */
902 VARARG(record,exc_event); /* thread context followed by exception record */
904 handle_t handle; /* handle to the queued event */
908 /* Retrieve the status of an exception event */
909 @REQ(get_exception_status)
911 handle_t handle; /* handle to the queued event */
912 int status; /* event continuation status */
913 VARARG(context,context); /* modified thread context */
917 /* Send an output string to the debugger */
918 @REQ(output_debug_string)
919 void* string; /* string to display (in debugged process address space) */
920 int unicode; /* is it Unicode? */
921 int length; /* string length */
925 /* Continue a debug event */
926 @REQ(continue_debug_event)
927 void* pid; /* process id to continue */
928 void* tid; /* thread id to continue */
929 int status; /* continuation status */
933 /* Start debugging an existing process */
935 void* pid; /* id of the process to debug */
939 /* Read data from a process address space */
940 @REQ(read_process_memory)
941 handle_t handle; /* process handle */
942 void* addr; /* addr to read from (must be int-aligned) */
943 int len; /* number of ints to read */
945 VARARG(data,bytes); /* result data */
949 /* Write data to a process address space */
950 @REQ(write_process_memory)
951 handle_t handle; /* process handle */
952 void* addr; /* addr to write to (must be int-aligned) */
953 int len; /* number of ints to write */
954 unsigned int first_mask; /* mask for first word */
955 unsigned int last_mask; /* mask for last word */
956 VARARG(data,bytes); /* result data */
960 /* Create a registry key */
962 handle_t parent; /* handle to the parent key */
963 unsigned int access; /* desired access rights */
964 unsigned int options; /* creation options */
965 time_t modif; /* last modification time */
966 VARARG(name,unicode_len_str); /* key name */
967 VARARG(class,unicode_str); /* class name */
969 handle_t hkey; /* handle to the created key */
970 int created; /* has it been newly created? */
973 /* Open a registry key */
975 handle_t parent; /* handle to the parent key */
976 unsigned int access; /* desired access rights */
977 VARARG(name,unicode_str); /* key name */
979 handle_t hkey; /* handle to the open key */
983 /* Delete a registry key */
985 handle_t hkey; /* handle to the key */
989 /* Enumerate registry subkeys */
991 handle_t hkey; /* handle to registry key */
992 int index; /* index of subkey (or -1 for current key) */
993 int full; /* return the full info? */
995 int subkeys; /* number of subkeys */
996 int max_subkey; /* longest subkey name */
997 int max_class; /* longest class name */
998 int values; /* number of values */
999 int max_value; /* longest value name */
1000 int max_data; /* longest value data */
1001 time_t modif; /* last modification time */
1002 VARARG(name,unicode_len_str); /* key name */
1003 VARARG(class,unicode_str); /* class name */
1007 /* Set a value of a registry key */
1009 handle_t hkey; /* handle to registry key */
1010 int type; /* value type */
1011 unsigned int total; /* total value len */
1012 unsigned int offset; /* offset for setting data */
1013 VARARG(name,unicode_len_str); /* value name */
1014 VARARG(data,bytes); /* value data */
1018 /* Retrieve the value of a registry key */
1020 handle_t hkey; /* handle to registry key */
1021 unsigned int offset; /* offset for getting data */
1022 VARARG(name,unicode_len_str); /* value name */
1024 int type; /* value type */
1025 int len; /* value data len */
1026 VARARG(data,bytes); /* value data */
1030 /* Enumerate a value of a registry key */
1031 @REQ(enum_key_value)
1032 handle_t hkey; /* handle to registry key */
1033 int index; /* value index */
1034 unsigned int offset; /* offset for getting data */
1036 int type; /* value type */
1037 int len; /* value data len */
1038 VARARG(name,unicode_len_str); /* value name */
1039 VARARG(data,bytes); /* value data */
1043 /* Delete a value of a registry key */
1044 @REQ(delete_key_value)
1045 handle_t hkey; /* handle to registry key */
1046 VARARG(name,unicode_str); /* value name */
1050 /* Load a registry branch from a file */
1052 handle_t hkey; /* root key to load to */
1053 handle_t file; /* file to load from */
1054 VARARG(name,unicode_str); /* subkey name */
1058 /* Save a registry branch to a file */
1060 handle_t hkey; /* key to save */
1061 handle_t file; /* file to save to */
1065 /* Save a registry branch at server exit */
1066 @REQ(save_registry_atexit)
1067 handle_t hkey; /* key to save */
1068 VARARG(file,string); /* file to save to */
1072 /* Set the current and saving level for the registry */
1073 @REQ(set_registry_levels)
1074 int current; /* new current level */
1075 int saving; /* new saving level */
1076 int period; /* duration between periodic saves (milliseconds) */
1080 /* Create a waitable timer */
1082 int inherit; /* inherit flag */
1083 int manual; /* manual reset */
1084 VARARG(name,unicode_str); /* object name */
1086 handle_t handle; /* handle to the timer */
1090 /* Open a waitable timer */
1092 unsigned int access; /* wanted access rights */
1093 int inherit; /* inherit flag */
1094 VARARG(name,unicode_str); /* object name */
1096 handle_t handle; /* handle to the timer */
1099 /* Set a waitable timer */
1101 handle_t handle; /* handle to the timer */
1102 int sec; /* next expiration absolute time */
1103 int usec; /* next expiration absolute time */
1104 int period; /* timer period in ms */
1105 void* callback; /* callback function */
1106 void* arg; /* callback argument */
1109 /* Cancel a waitable timer */
1111 handle_t handle; /* handle to the timer */
1115 /* Retrieve the current context of a thread */
1116 @REQ(get_thread_context)
1117 handle_t handle; /* thread handle */
1118 unsigned int flags; /* context flags */
1120 VARARG(context,context); /* thread context */
1124 /* Set the current context of a thread */
1125 @REQ(set_thread_context)
1126 handle_t handle; /* thread handle */
1127 unsigned int flags; /* context flags */
1128 VARARG(context,context); /* thread context */
1132 /* Fetch a selector entry for a thread */
1133 @REQ(get_selector_entry)
1134 handle_t handle; /* thread handle */
1135 int entry; /* LDT entry */
1137 unsigned int base; /* selector base */
1138 unsigned int limit; /* selector limit */
1139 unsigned char flags; /* selector flags */
1145 int local; /* is atom in local process table? */
1146 VARARG(name,unicode_str); /* atom name */
1148 atom_t atom; /* resulting atom */
1152 /* Delete an atom */
1154 atom_t atom; /* atom handle */
1155 int local; /* is atom in local process table? */
1161 int local; /* is atom in local process table? */
1162 VARARG(name,unicode_str); /* atom name */
1164 atom_t atom; /* atom handle */
1168 /* Get an atom name */
1170 atom_t atom; /* atom handle */
1171 int local; /* is atom in local process table? */
1173 int count; /* atom lock count */
1174 VARARG(name,unicode_str); /* atom name */
1178 /* Init the process atom table */
1179 @REQ(init_atom_table)
1180 int entries; /* number of entries */
1184 /* Get the message queue of the current thread */
1187 handle_t handle; /* handle to the queue */
1191 /* Set the current message queue wakeup mask */
1192 @REQ(set_queue_mask)
1193 unsigned int wake_mask; /* wakeup bits mask */
1194 unsigned int changed_mask; /* changed bits mask */
1195 int skip_wait; /* will we skip waiting if signaled? */
1197 unsigned int wake_bits; /* current wake bits */
1198 unsigned int changed_bits; /* current changed bits */
1202 /* Get the current message queue status */
1203 @REQ(get_queue_status)
1204 int clear; /* should we clear the change bits? */
1206 unsigned int wake_bits; /* wake bits */
1207 unsigned int changed_bits; /* changed bits since last time */
1211 /* Wait for a process to start waiting on input */
1212 @REQ(wait_input_idle)
1213 handle_t handle; /* process handle */
1214 int timeout; /* timeout */
1216 handle_t event; /* handle to idle event */
1220 /* Send a message to a thread queue */
1222 void* id; /* thread id */
1223 int type; /* message type (see below) */
1224 user_handle_t win; /* window handle */
1225 unsigned int msg; /* message code */
1226 unsigned int wparam; /* parameters */
1227 unsigned int lparam; /* parameters */
1228 int x; /* x position */
1229 int y; /* y position */
1230 unsigned int time; /* message time */
1231 unsigned int info; /* extra info */
1232 int timeout; /* timeout for reply */
1233 VARARG(data,bytes); /* message data for sent messages */
1238 MSG_ASCII, /* Ascii message (from SendMessageA) */
1239 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1240 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1241 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1242 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1243 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1244 MSG_HARDWARE_RAW, /* raw hardware message */
1245 MSG_HARDWARE_COOKED /* cooked hardware message */
1249 /* Get a message from the current queue */
1251 int flags; /* see below */
1252 user_handle_t get_win; /* window handle to get */
1253 unsigned int get_first; /* first message code to get */
1254 unsigned int get_last; /* last message code to get */
1256 int type; /* message type */
1257 user_handle_t win; /* window handle */
1258 unsigned int msg; /* message code */
1259 unsigned int wparam; /* parameters */
1260 unsigned int lparam; /* parameters */
1261 int x; /* x position */
1262 int y; /* y position */
1263 unsigned int time; /* message time */
1264 unsigned int info; /* extra info */
1265 VARARG(data,bytes); /* message data for sent messages */
1267 #define GET_MSG_REMOVE 1 /* remove the message */
1268 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1269 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1271 /* Reply to a sent message */
1273 unsigned int result; /* message result */
1274 int remove; /* should we remove the message? */
1275 VARARG(data,bytes); /* message data for sent messages */
1279 /* Retrieve the reply for the last message sent */
1280 @REQ(get_message_reply)
1281 int cancel; /* cancel message if not ready? */
1283 unsigned int result; /* message result */
1284 VARARG(data,bytes); /* message data for sent messages */
1288 /* Set a window timer */
1290 user_handle_t win; /* window handle */
1291 unsigned int msg; /* message to post */
1292 unsigned int id; /* timer id */
1293 unsigned int rate; /* timer rate in ms */
1294 unsigned int lparam; /* message lparam (callback proc) */
1298 /* Kill a window timer */
1299 @REQ(kill_win_timer)
1300 user_handle_t win; /* window handle */
1301 unsigned int msg; /* message to post */
1302 unsigned int id; /* timer id */
1306 /* Open a serial port */
1308 unsigned int access; /* wanted access rights */
1309 int inherit; /* inherit flag */
1310 unsigned int attributes; /* eg. FILE_FLAG_OVERLAPPED */
1311 unsigned int sharing; /* sharing flags */
1312 VARARG(name,string); /* file name */
1314 handle_t handle; /* handle to the port */
1318 /* Retrieve info about a serial port */
1319 @REQ(get_serial_info)
1320 handle_t handle; /* handle to comm port */
1322 unsigned int readinterval;
1323 unsigned int readconst;
1324 unsigned int readmult;
1325 unsigned int writeconst;
1326 unsigned int writemult;
1327 unsigned int eventmask;
1328 unsigned int commerror;
1332 /* Set info about a serial port */
1333 @REQ(set_serial_info)
1334 handle_t handle; /* handle to comm port */
1335 int flags; /* bitmask to set values (see below) */
1336 unsigned int readinterval;
1337 unsigned int readconst;
1338 unsigned int readmult;
1339 unsigned int writeconst;
1340 unsigned int writemult;
1341 unsigned int eventmask;
1342 unsigned int commerror;
1344 #define SERIALINFO_SET_TIMEOUTS 0x01
1345 #define SERIALINFO_SET_MASK 0x02
1346 #define SERIALINFO_SET_ERROR 0x04
1349 /* Create an async I/O */
1351 handle_t file_handle; /* handle to comm port, socket or file */
1357 #define ASYNC_TYPE_READ 0x01
1358 #define ASYNC_TYPE_WRITE 0x02
1359 #define ASYNC_TYPE_WAIT 0x03
1362 /* Create a named pipe */
1363 @REQ(create_named_pipe)
1364 unsigned int openmode;
1365 unsigned int pipemode;
1366 unsigned int maxinstances;
1367 unsigned int outsize;
1368 unsigned int insize;
1369 unsigned int timeout;
1370 VARARG(filename,string); /* pipe name */
1372 handle_t handle; /* handle to the pipe */
1376 /* Open an existing named pipe */
1377 @REQ(open_named_pipe)
1378 unsigned int access;
1379 VARARG(filename,string); /* pipe name */
1381 handle_t handle; /* handle to the pipe */
1385 /* Connect to a named pipe */
1386 @REQ(connect_named_pipe)
1393 /* Wait for a named pipe */
1394 @REQ(wait_named_pipe)
1395 unsigned int timeout;
1398 VARARG(filename,string); /* pipe name */
1402 /* Disconnect a named pipe */
1403 @REQ(disconnect_named_pipe)
1408 @REQ(get_named_pipe_info)
1412 unsigned int maxinstances;
1413 unsigned int outsize;
1414 unsigned int insize;
1418 /* Create a window */
1420 user_handle_t parent; /* parent window */
1421 user_handle_t owner; /* owner window */
1422 atom_t atom; /* class atom */
1424 user_handle_t handle; /* created window */
1428 /* Link a window into the tree */
1430 user_handle_t handle; /* handle to the window */
1431 user_handle_t parent; /* handle to the parent */
1432 user_handle_t previous; /* previous child in Z-order */
1434 user_handle_t full_parent; /* full handle of new parent */
1438 /* Destroy a window */
1439 @REQ(destroy_window)
1440 user_handle_t handle; /* handle to the window */
1444 /* Set a window owner */
1445 @REQ(set_window_owner)
1446 user_handle_t handle; /* handle to the window */
1447 user_handle_t owner; /* new owner */
1449 user_handle_t full_owner; /* full handle of new owner */
1453 /* Get information from a window handle */
1454 @REQ(get_window_info)
1455 user_handle_t handle; /* handle to the window */
1457 user_handle_t full_handle; /* full 32-bit handle */
1458 void* pid; /* process owning the window */
1459 void* tid; /* thread owning the window */
1460 atom_t atom; /* class atom */
1464 /* Set some information in a window */
1465 @REQ(set_window_info)
1466 user_handle_t handle; /* handle to the window */
1467 unsigned int flags; /* flags for fields to set (see below) */
1468 unsigned int style; /* window style */
1469 unsigned int ex_style; /* window extended style */
1470 unsigned int id; /* window id */
1471 void* instance; /* creator instance */
1472 void* user_data; /* user-specific data */
1474 unsigned int old_style; /* old window style */
1475 unsigned int old_ex_style; /* old window extended style */
1476 unsigned int old_id; /* old window id */
1477 void* old_instance; /* old creator instance */
1478 void* old_user_data; /* old user-specific data */
1480 #define SET_WIN_STYLE 0x01
1481 #define SET_WIN_EXSTYLE 0x02
1482 #define SET_WIN_ID 0x04
1483 #define SET_WIN_INSTANCE 0x08
1484 #define SET_WIN_USERDATA 0x10
1487 /* Get a list of the window parents, up to the root of the tree */
1488 @REQ(get_window_parents)
1489 user_handle_t handle; /* handle to the window */
1491 int count; /* total count of parents */
1492 VARARG(parents,user_handles); /* parent handles */
1496 /* Get a list of the window children */
1497 @REQ(get_window_children)
1498 user_handle_t parent; /* parent window */
1499 atom_t atom; /* class atom for the listed children */
1500 void* tid; /* thread owning the listed children */
1502 int count; /* total count of children */
1503 VARARG(children,user_handles); /* children handles */
1507 /* Get window tree information from a window handle */
1508 @REQ(get_window_tree)
1509 user_handle_t handle; /* handle to the window */
1511 user_handle_t parent; /* parent window */
1512 user_handle_t owner; /* owner window */
1513 user_handle_t next_sibling; /* next sibling in Z-order */
1514 user_handle_t prev_sibling; /* prev sibling in Z-order */
1515 user_handle_t first_sibling; /* first sibling in Z-order */
1516 user_handle_t last_sibling; /* last sibling in Z-order */
1517 user_handle_t first_child; /* first child */
1518 user_handle_t last_child; /* last child */
1521 /* Set the window and client rectangles of a window */
1522 @REQ(set_window_rectangles)
1523 user_handle_t handle; /* handle to the window */
1524 rectangle_t window; /* window rectangle */
1525 rectangle_t client; /* client rectangle */
1529 /* Get the window and client rectangles of a window */
1530 @REQ(get_window_rectangles)
1531 user_handle_t handle; /* handle to the window */
1533 rectangle_t window; /* window rectangle */
1534 rectangle_t client; /* client rectangle */
1538 /* Get the window text */
1539 @REQ(get_window_text)
1540 user_handle_t handle; /* handle to the window */
1542 VARARG(text,unicode_str); /* window text */
1546 /* Set the window text */
1547 @REQ(set_window_text)
1548 user_handle_t handle; /* handle to the window */
1549 VARARG(text,unicode_str); /* window text */
1553 /* Increment the window paint count */
1554 @REQ(inc_window_paint_count)
1555 user_handle_t handle; /* handle to the window */
1556 int incr; /* increment (can be negative) */
1560 /* Get the coordinates offset between two windows */
1561 @REQ(get_windows_offset)
1562 user_handle_t from; /* handle to the first window */
1563 user_handle_t to; /* handle to the second window */
1565 int x; /* x coordinate offset */
1566 int y; /* y coordinate offset */
1570 /* Set a window property */
1571 @REQ(set_window_property)
1572 user_handle_t window; /* handle to the window */
1573 atom_t atom; /* property atom (high-word set if it was a string) */
1574 int string; /* was atom a string originally? */
1575 handle_t handle; /* handle to store */
1579 /* Remove a window property */
1580 @REQ(remove_window_property)
1581 user_handle_t window; /* handle to the window */
1582 atom_t atom; /* property atom */
1584 handle_t handle; /* handle stored in property */
1588 /* Get a window property */
1589 @REQ(get_window_property)
1590 user_handle_t window; /* handle to the window */
1591 atom_t atom; /* property atom */
1593 handle_t handle; /* handle stored in property */
1597 /* Get the list of properties of a window */
1598 @REQ(get_window_properties)
1599 user_handle_t window; /* handle to the window */
1601 VARARG(props,properties); /* list of properties */