Initialize argc/argv/wargv by calling ntdll.__wine_get_{w}main_args.
[wine/wine-kai.git] / server / protocol.def
blobc386dd93b0f20e0fdd01b114de8d2f2e0d03f85c
1 /* -*- C -*-
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
9 */
11 @HEADER /* start of C declarations */
13 #include <stdlib.h>
14 #include <time.h>
15 #include "winbase.h"
17 struct request_header
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 */
25 struct reply_header
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
42 typedef int handle_t;
43 typedef unsigned int user_handle_t;
45 /* definitions of the event data depending on the event code */
46 struct debug_event_exception
48 EXCEPTION_RECORD record; /* exception record */
49 int first; /* first chance exception? */
51 struct debug_event_create_thread
53 handle_t handle; /* handle to the new thread */
54 void *teb; /* thread teb (in debugged process address space) */
55 void *start; /* thread startup routine */
57 struct debug_event_create_process
59 handle_t file; /* handle to the process exe file */
60 handle_t process; /* handle to the new process */
61 handle_t thread; /* handle to the new thread */
62 void *base; /* base of executable image */
63 int dbg_offset; /* offset of debug info in file */
64 int dbg_size; /* size of debug info */
65 void *teb; /* thread teb (in debugged process address space) */
66 void *start; /* thread startup routine */
67 void *name; /* image name (optional) */
68 int unicode; /* is it Unicode? */
70 struct debug_event_exit
72 int exit_code; /* thread or process exit code */
74 struct debug_event_load_dll
76 handle_t handle; /* file handle for the dll */
77 void *base; /* base address of the dll */
78 int dbg_offset; /* offset of debug info in file */
79 int dbg_size; /* size of debug info */
80 void *name; /* image name (optional) */
81 int unicode; /* is it Unicode? */
83 struct debug_event_unload_dll
85 void *base; /* base address of the dll */
87 struct debug_event_output_string
89 void *string; /* string to display (in debugged process address space) */
90 int unicode; /* is it Unicode? */
91 int length; /* string length */
93 struct debug_event_rip_info
95 int error; /* ??? */
96 int type; /* ??? */
98 union debug_event_data
100 struct debug_event_exception exception;
101 struct debug_event_create_thread create_thread;
102 struct debug_event_create_process create_process;
103 struct debug_event_exit exit;
104 struct debug_event_load_dll load_dll;
105 struct debug_event_unload_dll unload_dll;
106 struct debug_event_output_string output_string;
107 struct debug_event_rip_info rip_info;
110 /* debug event data */
111 typedef struct
113 int code; /* event code */
114 union debug_event_data info; /* event information */
115 } debug_event_t;
117 /* structure used in sending an fd from client to server */
118 struct send_fd
120 void *tid; /* thread id */
121 int fd; /* file descriptor on client-side */
124 /* structure sent by the server on the wait fifo */
125 struct wake_up_reply
127 void *cookie; /* magic cookie that was passed in select_request */
128 int signaled; /* wait result */
131 /****************************************************************/
132 /* Request declarations */
134 /* Create a new process from the context of the parent */
135 @REQ(new_process)
136 int inherit_all; /* inherit all handles from parent */
137 int create_flags; /* creation flags */
138 int start_flags; /* flags from startup info */
139 handle_t exe_file; /* file handle for main exe */
140 handle_t hstdin; /* handle for stdin */
141 handle_t hstdout; /* handle for stdout */
142 handle_t hstderr; /* handle for stderr */
143 int cmd_show; /* main window show mode */
144 VARARG(filename,string); /* file name of main exe */
145 @REPLY
146 handle_t info; /* new process info handle */
147 @END
150 /* Retrieve information about a newly started process */
151 @REQ(get_new_process_info)
152 handle_t info; /* info handle returned from new_process_request */
153 int pinherit; /* process handle inherit flag */
154 int tinherit; /* thread handle inherit flag */
155 @REPLY
156 void* pid; /* process id */
157 handle_t phandle; /* process handle (in the current process) */
158 void* tid; /* thread id */
159 handle_t thandle; /* thread handle (in the current process) */
160 handle_t event; /* event handle to signal startup */
161 @END
164 /* Create a new thread from the context of the parent */
165 @REQ(new_thread)
166 int suspend; /* new thread should be suspended on creation */
167 int inherit; /* inherit flag */
168 int request_fd; /* fd for request pipe */
169 @REPLY
170 void* tid; /* thread id */
171 handle_t handle; /* thread handle (in the current process) */
172 @END
175 /* Signal that we are finished booting on the client side */
176 @REQ(boot_done)
177 int debug_level; /* new debug level */
178 @END
181 /* Initialize a process; called from the new process context */
182 @REQ(init_process)
183 void* ldt_copy; /* addr of LDT copy */
184 int ppid; /* parent Unix pid */
185 @REPLY
186 int create_flags; /* creation flags */
187 int start_flags; /* flags from startup info */
188 unsigned int server_start; /* server start time (GetTickCount) */
189 handle_t exe_file; /* file handle for main exe */
190 handle_t hstdin; /* handle for stdin */
191 handle_t hstdout; /* handle for stdout */
192 handle_t hstderr; /* handle for stderr */
193 int cmd_show; /* main window show mode */
194 VARARG(filename,string); /* file name of main exe */
195 @END
198 /* Signal the end of the process initialization */
199 @REQ(init_process_done)
200 void* module; /* main module base address */
201 void* entry; /* process entry point */
202 void* name; /* ptr to ptr to name (in process addr space) */
203 handle_t exe_file; /* file handle for main exe */
204 int gui; /* is it a GUI process? */
205 @REPLY
206 int debugged; /* being debugged? */
207 @END
210 /* Initialize a thread; called from the child after fork()/clone() */
211 @REQ(init_thread)
212 int unix_pid; /* Unix pid of new thread */
213 void* teb; /* TEB of new thread (in thread address space) */
214 void* entry; /* thread entry point (in thread address space) */
215 int reply_fd; /* fd for reply pipe */
216 int wait_fd; /* fd for blocking calls pipe */
217 @REPLY
218 void* pid; /* process id of the new thread's process */
219 void* tid; /* thread id of the new thread */
220 int boot; /* is this the boot thread? */
221 int version; /* protocol version */
222 @END
225 /* Set the shared buffer for a thread */
226 @REQ(set_thread_buffer)
227 int fd; /* fd to mmap as shared buffer */
228 @REPLY
229 unsigned int offset; /* offset of buffer in file */
230 unsigned int size; /* size of buffer */
231 @END
234 /* Terminate a process */
235 @REQ(terminate_process)
236 handle_t handle; /* process handle to terminate */
237 int exit_code; /* process exit code */
238 @REPLY
239 int self; /* suicide? */
240 @END
243 /* Terminate a thread */
244 @REQ(terminate_thread)
245 handle_t handle; /* thread handle to terminate */
246 int exit_code; /* thread exit code */
247 @REPLY
248 int self; /* suicide? */
249 int last; /* last thread in this process? */
250 @END
253 /* Retrieve information about a process */
254 @REQ(get_process_info)
255 handle_t handle; /* process handle */
256 @REPLY
257 void* pid; /* server process id */
258 int debugged; /* debugged? */
259 int exit_code; /* process exit code */
260 int priority; /* priority class */
261 int process_affinity; /* process affinity mask */
262 int system_affinity; /* system affinity mask */
263 @END
266 /* Set a process informations */
267 @REQ(set_process_info)
268 handle_t handle; /* process handle */
269 int mask; /* setting mask (see below) */
270 int priority; /* priority class */
271 int affinity; /* affinity mask */
272 @END
273 #define SET_PROCESS_INFO_PRIORITY 0x01
274 #define SET_PROCESS_INFO_AFFINITY 0x02
277 /* Retrieve information about a thread */
278 @REQ(get_thread_info)
279 handle_t handle; /* thread handle */
280 void* tid_in; /* thread id (optional) */
281 @REPLY
282 void* tid; /* server thread id */
283 void* teb; /* thread teb pointer */
284 int exit_code; /* thread exit code */
285 int priority; /* thread priority level */
286 @END
289 /* Set a thread informations */
290 @REQ(set_thread_info)
291 handle_t handle; /* thread handle */
292 int mask; /* setting mask (see below) */
293 int priority; /* priority class */
294 int affinity; /* affinity mask */
295 @END
296 #define SET_THREAD_INFO_PRIORITY 0x01
297 #define SET_THREAD_INFO_AFFINITY 0x02
300 /* Suspend a thread */
301 @REQ(suspend_thread)
302 handle_t handle; /* thread handle */
303 @REPLY
304 int count; /* new suspend count */
305 @END
308 /* Resume a thread */
309 @REQ(resume_thread)
310 handle_t handle; /* thread handle */
311 @REPLY
312 int count; /* new suspend count */
313 @END
316 /* Notify the server that a dll has been loaded */
317 @REQ(load_dll)
318 handle_t handle; /* file handle */
319 void* base; /* base address */
320 int dbg_offset; /* debug info offset */
321 int dbg_size; /* debug info size */
322 void* name; /* ptr to ptr to name (in process addr space) */
323 @END
326 /* Notify the server that a dll is being unloaded */
327 @REQ(unload_dll)
328 void* base; /* base address */
329 @END
332 /* Queue an APC for a thread */
333 @REQ(queue_apc)
334 handle_t handle; /* thread handle */
335 int user; /* user or system apc? */
336 void* func; /* function to call */
337 void* param; /* param for function to call */
338 @END
341 /* Get next APC to call */
342 @REQ(get_apc)
343 int alertable; /* is thread alertable? */
344 @REPLY
345 void* func; /* function to call */
346 int type; /* function type */
347 VARARG(args,ptrs); /* function arguments */
348 @END
349 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
352 /* Close a handle for the current process */
353 @REQ(close_handle)
354 handle_t handle; /* handle to close */
355 @REPLY
356 int fd; /* associated fd to close */
357 @END
360 /* Set a handle information */
361 @REQ(set_handle_info)
362 handle_t handle; /* handle we are interested in */
363 int flags; /* new handle flags */
364 int mask; /* mask for flags to set */
365 int fd; /* file descriptor or -1 */
366 @REPLY
367 int old_flags; /* old flag value */
368 int cur_fd; /* current file descriptor */
369 @END
372 /* Duplicate a handle */
373 @REQ(dup_handle)
374 handle_t src_process; /* src process handle */
375 handle_t src_handle; /* src handle to duplicate */
376 handle_t dst_process; /* dst process handle */
377 unsigned int access; /* wanted access rights */
378 int inherit; /* inherit flag */
379 int options; /* duplicate options (see below) */
380 @REPLY
381 handle_t handle; /* duplicated handle in dst process */
382 int fd; /* associated fd to close */
383 @END
384 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
385 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
386 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
389 /* Open a handle to a process */
390 @REQ(open_process)
391 void* pid; /* process id to open */
392 unsigned int access; /* wanted access rights */
393 int inherit; /* inherit flag */
394 @REPLY
395 handle_t handle; /* handle to the process */
396 @END
399 /* Wait for handles */
400 @REQ(select)
401 int flags; /* wait flags (see below) */
402 void* cookie; /* magic cookie to return to client */
403 int sec; /* absolute timeout */
404 int usec; /* absolute timeout */
405 VARARG(handles,handles); /* handles to select on */
406 @END
407 #define SELECT_ALL 1
408 #define SELECT_ALERTABLE 2
409 #define SELECT_INTERRUPTIBLE 4
410 #define SELECT_TIMEOUT 8
413 /* Create an event */
414 @REQ(create_event)
415 int manual_reset; /* manual reset event */
416 int initial_state; /* initial state of the event */
417 int inherit; /* inherit flag */
418 VARARG(name,unicode_str); /* object name */
419 @REPLY
420 handle_t handle; /* handle to the event */
421 @END
423 /* Event operation */
424 @REQ(event_op)
425 handle_t handle; /* handle to event */
426 int op; /* event operation (see below) */
427 @END
428 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
431 /* Open an event */
432 @REQ(open_event)
433 unsigned int access; /* wanted access rights */
434 int inherit; /* inherit flag */
435 VARARG(name,unicode_str); /* object name */
436 @REPLY
437 handle_t handle; /* handle to the event */
438 @END
441 /* Create a mutex */
442 @REQ(create_mutex)
443 int owned; /* initially owned? */
444 int inherit; /* inherit flag */
445 VARARG(name,unicode_str); /* object name */
446 @REPLY
447 handle_t handle; /* handle to the mutex */
448 @END
451 /* Release a mutex */
452 @REQ(release_mutex)
453 handle_t handle; /* handle to the mutex */
454 @END
457 /* Open a mutex */
458 @REQ(open_mutex)
459 unsigned int access; /* wanted access rights */
460 int inherit; /* inherit flag */
461 VARARG(name,unicode_str); /* object name */
462 @REPLY
463 handle_t handle; /* handle to the mutex */
464 @END
467 /* Create a semaphore */
468 @REQ(create_semaphore)
469 unsigned int initial; /* initial count */
470 unsigned int max; /* maximum count */
471 int inherit; /* inherit flag */
472 VARARG(name,unicode_str); /* object name */
473 @REPLY
474 handle_t handle; /* handle to the semaphore */
475 @END
478 /* Release a semaphore */
479 @REQ(release_semaphore)
480 handle_t handle; /* handle to the semaphore */
481 unsigned int count; /* count to add to semaphore */
482 @REPLY
483 unsigned int prev_count; /* previous semaphore count */
484 @END
487 /* Open a semaphore */
488 @REQ(open_semaphore)
489 unsigned int access; /* wanted access rights */
490 int inherit; /* inherit flag */
491 VARARG(name,unicode_str); /* object name */
492 @REPLY
493 handle_t handle; /* handle to the semaphore */
494 @END
497 /* Create a file */
498 @REQ(create_file)
499 unsigned int access; /* wanted access rights */
500 int inherit; /* inherit flag */
501 unsigned int sharing; /* sharing flags */
502 int create; /* file create action */
503 unsigned int attrs; /* file attributes for creation */
504 VARARG(filename,string); /* file name */
505 @REPLY
506 handle_t handle; /* handle to the file */
507 @END
510 /* Allocate a file handle for a Unix fd */
511 @REQ(alloc_file_handle)
512 unsigned int access; /* wanted access rights */
513 int fd; /* file descriptor on the client side */
514 @REPLY
515 handle_t handle; /* handle to the file */
516 @END
519 /* Get a Unix fd to access a file */
520 @REQ(get_handle_fd)
521 handle_t handle; /* handle to the file */
522 unsigned int access; /* wanted access rights */
523 @REPLY
524 int fd; /* file descriptor */
525 @END
528 /* Set a file current position */
529 @REQ(set_file_pointer)
530 handle_t handle; /* handle to the file */
531 int low; /* position low word */
532 int high; /* position high word */
533 int whence; /* whence to seek */
534 @REPLY
535 int new_low; /* new position low word */
536 int new_high; /* new position high word */
537 @END
540 /* Truncate (or extend) a file */
541 @REQ(truncate_file)
542 handle_t handle; /* handle to the file */
543 @END
546 /* Set a file access and modification times */
547 @REQ(set_file_time)
548 handle_t handle; /* handle to the file */
549 time_t access_time; /* last access time */
550 time_t write_time; /* last write time */
551 @END
554 /* Flush a file buffers */
555 @REQ(flush_file)
556 handle_t handle; /* handle to the file */
557 @END
560 /* Get information about a file */
561 @REQ(get_file_info)
562 handle_t handle; /* handle to the file */
563 @REPLY
564 int type; /* file type */
565 int attr; /* file attributes */
566 time_t access_time; /* last access time */
567 time_t write_time; /* last write time */
568 int size_high; /* file size */
569 int size_low; /* file size */
570 int links; /* number of links */
571 int index_high; /* unique index */
572 int index_low; /* unique index */
573 unsigned int serial; /* volume serial number */
574 @END
577 /* Lock a region of a file */
578 @REQ(lock_file)
579 handle_t handle; /* handle to the file */
580 unsigned int offset_low; /* offset of start of lock */
581 unsigned int offset_high; /* offset of start of lock */
582 unsigned int count_low; /* count of bytes to lock */
583 unsigned int count_high; /* count of bytes to lock */
584 @END
587 /* Unlock a region of a file */
588 @REQ(unlock_file)
589 handle_t handle; /* handle to the file */
590 unsigned int offset_low; /* offset of start of unlock */
591 unsigned int offset_high; /* offset of start of unlock */
592 unsigned int count_low; /* count of bytes to unlock */
593 unsigned int count_high; /* count of bytes to unlock */
594 @END
597 /* Create an anonymous pipe */
598 @REQ(create_pipe)
599 int inherit; /* inherit flag */
600 @REPLY
601 handle_t handle_read; /* handle to the read-side of the pipe */
602 handle_t handle_write; /* handle to the write-side of the pipe */
603 @END
606 /* Create a socket */
607 @REQ(create_socket)
608 unsigned int access; /* wanted access rights */
609 int inherit; /* inherit flag */
610 int family; /* family, see socket manpage */
611 int type; /* type, see socket manpage */
612 int protocol; /* protocol, see socket manpage */
613 @REPLY
614 handle_t handle; /* handle to the new socket */
615 @END
618 /* Accept a socket */
619 @REQ(accept_socket)
620 handle_t lhandle; /* handle to the listening socket */
621 unsigned int access; /* wanted access rights */
622 int inherit; /* inherit flag */
623 @REPLY
624 handle_t handle; /* handle to the new socket */
625 @END
628 /* Set socket event parameters */
629 @REQ(set_socket_event)
630 handle_t handle; /* handle to the socket */
631 unsigned int mask; /* event mask */
632 handle_t event; /* event object */
633 @END
636 /* Get socket event parameters */
637 @REQ(get_socket_event)
638 handle_t handle; /* handle to the socket */
639 int service; /* clear pending? */
640 handle_t s_event; /* "expected" event object */
641 handle_t c_event; /* event to clear */
642 @REPLY
643 unsigned int mask; /* event mask */
644 unsigned int pmask; /* pending events */
645 unsigned int state; /* status bits */
646 VARARG(errors,ints); /* event errors */
647 @END
650 /* Reenable pending socket events */
651 @REQ(enable_socket_event)
652 handle_t handle; /* handle to the socket */
653 unsigned int mask; /* events to re-enable */
654 unsigned int sstate; /* status bits to set */
655 unsigned int cstate; /* status bits to clear */
656 @END
659 /* Allocate a console for the current process */
660 @REQ(alloc_console)
661 unsigned int access; /* wanted access rights */
662 int inherit; /* inherit flag */
663 @REPLY
664 handle_t handle_in; /* handle to console input */
665 handle_t handle_out; /* handle to console output */
666 @END
669 /* Free the console of the current process */
670 @REQ(free_console)
671 @END
674 /* Open a handle to the process console */
675 @REQ(open_console)
676 int output; /* input or output? */
677 unsigned int access; /* wanted access rights */
678 int inherit; /* inherit flag */
679 @REPLY
680 handle_t handle; /* handle to the console */
681 @END
684 /* Set a console file descriptor */
685 @REQ(set_console_fd)
686 handle_t handle; /* handle to the console */
687 int fd_in; /* file descriptor to use as input */
688 int fd_out; /* file descriptor to use as output */
689 int pid; /* pid of xterm (hack) */
690 @END
693 /* Get a console mode (input or output) */
694 @REQ(get_console_mode)
695 handle_t handle; /* handle to the console */
696 @REPLY
697 int mode; /* console mode */
698 @END
701 /* Set a console mode (input or output) */
702 @REQ(set_console_mode)
703 handle_t handle; /* handle to the console */
704 int mode; /* console mode */
705 @END
708 /* Set info about a console (output only) */
709 @REQ(set_console_info)
710 handle_t handle; /* handle to the console */
711 int mask; /* setting mask (see below) */
712 int cursor_size; /* size of cursor (percentage filled) */
713 int cursor_visible;/* cursor visibility flag */
714 VARARG(title,string); /* console title */
715 @END
716 #define SET_CONSOLE_INFO_CURSOR 0x01
717 #define SET_CONSOLE_INFO_TITLE 0x02
719 /* Get info about a console (output only) */
720 @REQ(get_console_info)
721 handle_t handle; /* handle to the console */
722 @REPLY
723 int cursor_size; /* size of cursor (percentage filled) */
724 int cursor_visible;/* cursor visibility flag */
725 int pid; /* pid of xterm (hack) */
726 VARARG(title,string); /* console title */
727 @END
730 /* Add input records to a console input queue */
731 @REQ(write_console_input)
732 handle_t handle; /* handle to the console input */
733 VARARG(rec,input_records); /* input records */
734 @REPLY
735 int written; /* number of records written */
736 @END
738 /* Fetch input records from a console input queue */
739 @REQ(read_console_input)
740 handle_t handle; /* handle to the console input */
741 int flush; /* flush the retrieved records from the queue? */
742 @REPLY
743 int read; /* number of records read */
744 VARARG(rec,input_records); /* input records */
745 @END
748 /* Create a change notification */
749 @REQ(create_change_notification)
750 int subtree; /* watch all the subtree */
751 int filter; /* notification filter */
752 @REPLY
753 handle_t handle; /* handle to the change notification */
754 @END
757 /* Create a file mapping */
758 @REQ(create_mapping)
759 int size_high; /* mapping size */
760 int size_low; /* mapping size */
761 int protect; /* protection flags (see below) */
762 int inherit; /* inherit flag */
763 handle_t file_handle; /* file handle */
764 VARARG(name,unicode_str); /* object name */
765 @REPLY
766 handle_t handle; /* handle to the mapping */
767 @END
768 /* protection flags */
769 #define VPROT_READ 0x01
770 #define VPROT_WRITE 0x02
771 #define VPROT_EXEC 0x04
772 #define VPROT_WRITECOPY 0x08
773 #define VPROT_GUARD 0x10
774 #define VPROT_NOCACHE 0x20
775 #define VPROT_COMMITTED 0x40
776 #define VPROT_IMAGE 0x80
779 /* Open a mapping */
780 @REQ(open_mapping)
781 unsigned int access; /* wanted access rights */
782 int inherit; /* inherit flag */
783 VARARG(name,unicode_str); /* object name */
784 @REPLY
785 handle_t handle; /* handle to the mapping */
786 @END
789 /* Get information about a file mapping */
790 @REQ(get_mapping_info)
791 handle_t handle; /* handle to the mapping */
792 @REPLY
793 int size_high; /* mapping size */
794 int size_low; /* mapping size */
795 int protect; /* protection flags */
796 int header_size; /* header size (for VPROT_IMAGE mapping) */
797 void* base; /* default base addr (for VPROT_IMAGE mapping) */
798 handle_t shared_file; /* shared mapping file handle */
799 int shared_size; /* shared mapping size */
800 @END
803 /* Create a device */
804 @REQ(create_device)
805 unsigned int access; /* wanted access rights */
806 int inherit; /* inherit flag */
807 int id; /* client private id */
808 @REPLY
809 handle_t handle; /* handle to the device */
810 @END
813 /* Create a snapshot */
814 @REQ(create_snapshot)
815 int inherit; /* inherit flag */
816 int flags; /* snapshot flags (TH32CS_*) */
817 void* pid; /* process id */
818 @REPLY
819 handle_t handle; /* handle to the snapshot */
820 @END
823 /* Get the next process from a snapshot */
824 @REQ(next_process)
825 handle_t handle; /* handle to the snapshot */
826 int reset; /* reset snapshot position? */
827 @REPLY
828 int count; /* process usage count */
829 void* pid; /* process id */
830 int threads; /* number of threads */
831 int priority; /* process priority */
832 @END
835 /* Get the next thread from a snapshot */
836 @REQ(next_thread)
837 handle_t handle; /* handle to the snapshot */
838 int reset; /* reset snapshot position? */
839 @REPLY
840 int count; /* thread usage count */
841 void* pid; /* process id */
842 void* tid; /* thread id */
843 int base_pri; /* base priority */
844 int delta_pri; /* delta priority */
845 @END
848 /* Get the next module from a snapshot */
849 @REQ(next_module)
850 handle_t handle; /* handle to the snapshot */
851 int reset; /* reset snapshot position? */
852 @REPLY
853 void* pid; /* process id */
854 void* base; /* module base address */
855 @END
858 /* Wait for a debug event */
859 @REQ(wait_debug_event)
860 int get_handle; /* should we alloc a handle for waiting? */
861 @REPLY
862 void* pid; /* process id */
863 void* tid; /* thread id */
864 handle_t wait; /* wait handle if no event ready */
865 VARARG(event,debug_event); /* debug event data */
866 @END
869 /* Queue an exception event */
870 @REQ(queue_exception_event)
871 int first; /* first chance exception? */
872 VARARG(record,exc_event); /* thread context followed by exception record */
873 @REPLY
874 handle_t handle; /* handle to the queued event */
875 @END
878 /* Retrieve the status of an exception event */
879 @REQ(get_exception_status)
880 @REPLY
881 handle_t handle; /* handle to the queued event */
882 int status; /* event continuation status */
883 VARARG(context,context); /* modified thread context */
884 @END
887 /* Send an output string to the debugger */
888 @REQ(output_debug_string)
889 void* string; /* string to display (in debugged process address space) */
890 int unicode; /* is it Unicode? */
891 int length; /* string length */
892 @END
895 /* Continue a debug event */
896 @REQ(continue_debug_event)
897 void* pid; /* process id to continue */
898 void* tid; /* thread id to continue */
899 int status; /* continuation status */
900 @END
903 /* Start debugging an existing process */
904 @REQ(debug_process)
905 void* pid; /* id of the process to debug */
906 @END
909 /* Read data from a process address space */
910 @REQ(read_process_memory)
911 handle_t handle; /* process handle */
912 void* addr; /* addr to read from (must be int-aligned) */
913 int len; /* number of ints to read */
914 @REPLY
915 VARARG(data,bytes); /* result data */
916 @END
919 /* Write data to a process address space */
920 @REQ(write_process_memory)
921 handle_t handle; /* process handle */
922 void* addr; /* addr to write to (must be int-aligned) */
923 int len; /* number of ints to write */
924 unsigned int first_mask; /* mask for first word */
925 unsigned int last_mask; /* mask for last word */
926 VARARG(data,bytes); /* result data */
927 @END
930 /* Create a registry key */
931 @REQ(create_key)
932 handle_t parent; /* handle to the parent key */
933 unsigned int access; /* desired access rights */
934 unsigned int options; /* creation options */
935 time_t modif; /* last modification time */
936 VARARG(name,unicode_len_str); /* key name */
937 VARARG(class,unicode_str); /* class name */
938 @REPLY
939 handle_t hkey; /* handle to the created key */
940 int created; /* has it been newly created? */
941 @END
943 /* Open a registry key */
944 @REQ(open_key)
945 handle_t parent; /* handle to the parent key */
946 unsigned int access; /* desired access rights */
947 VARARG(name,unicode_str); /* key name */
948 @REPLY
949 handle_t hkey; /* handle to the open key */
950 @END
953 /* Delete a registry key */
954 @REQ(delete_key)
955 handle_t hkey; /* handle to the key */
956 @END
959 /* Enumerate registry subkeys */
960 @REQ(enum_key)
961 handle_t hkey; /* handle to registry key */
962 int index; /* index of subkey (or -1 for current key) */
963 int full; /* return the full info? */
964 @REPLY
965 int subkeys; /* number of subkeys */
966 int max_subkey; /* longest subkey name */
967 int max_class; /* longest class name */
968 int values; /* number of values */
969 int max_value; /* longest value name */
970 int max_data; /* longest value data */
971 time_t modif; /* last modification time */
972 VARARG(name,unicode_len_str); /* key name */
973 VARARG(class,unicode_str); /* class name */
974 @END
977 /* Set a value of a registry key */
978 @REQ(set_key_value)
979 handle_t hkey; /* handle to registry key */
980 int type; /* value type */
981 unsigned int total; /* total value len */
982 unsigned int offset; /* offset for setting data */
983 VARARG(name,unicode_len_str); /* value name */
984 VARARG(data,bytes); /* value data */
985 @END
988 /* Retrieve the value of a registry key */
989 @REQ(get_key_value)
990 handle_t hkey; /* handle to registry key */
991 unsigned int offset; /* offset for getting data */
992 VARARG(name,unicode_len_str); /* value name */
993 @REPLY
994 int type; /* value type */
995 int len; /* value data len */
996 VARARG(data,bytes); /* value data */
997 @END
1000 /* Enumerate a value of a registry key */
1001 @REQ(enum_key_value)
1002 handle_t hkey; /* handle to registry key */
1003 int index; /* value index */
1004 unsigned int offset; /* offset for getting data */
1005 @REPLY
1006 int type; /* value type */
1007 int len; /* value data len */
1008 VARARG(name,unicode_len_str); /* value name */
1009 VARARG(data,bytes); /* value data */
1010 @END
1013 /* Delete a value of a registry key */
1014 @REQ(delete_key_value)
1015 handle_t hkey; /* handle to registry key */
1016 VARARG(name,unicode_str); /* value name */
1017 @END
1020 /* Load a registry branch from a file */
1021 @REQ(load_registry)
1022 handle_t hkey; /* root key to load to */
1023 handle_t file; /* file to load from */
1024 VARARG(name,unicode_str); /* subkey name */
1025 @END
1028 /* Save a registry branch to a file */
1029 @REQ(save_registry)
1030 handle_t hkey; /* key to save */
1031 handle_t file; /* file to save to */
1032 @END
1035 /* Save a registry branch at server exit */
1036 @REQ(save_registry_atexit)
1037 handle_t hkey; /* key to save */
1038 VARARG(file,string); /* file to save to */
1039 @END
1042 /* Set the current and saving level for the registry */
1043 @REQ(set_registry_levels)
1044 int current; /* new current level */
1045 int saving; /* new saving level */
1046 int period; /* duration between periodic saves (milliseconds) */
1047 @END
1050 /* Create a waitable timer */
1051 @REQ(create_timer)
1052 int inherit; /* inherit flag */
1053 int manual; /* manual reset */
1054 VARARG(name,unicode_str); /* object name */
1055 @REPLY
1056 handle_t handle; /* handle to the timer */
1057 @END
1060 /* Open a waitable timer */
1061 @REQ(open_timer)
1062 unsigned int access; /* wanted access rights */
1063 int inherit; /* inherit flag */
1064 VARARG(name,unicode_str); /* object name */
1065 @REPLY
1066 handle_t handle; /* handle to the timer */
1067 @END
1069 /* Set a waitable timer */
1070 @REQ(set_timer)
1071 handle_t handle; /* handle to the timer */
1072 int sec; /* next expiration absolute time */
1073 int usec; /* next expiration absolute time */
1074 int period; /* timer period in ms */
1075 void* callback; /* callback function */
1076 void* arg; /* callback argument */
1077 @END
1079 /* Cancel a waitable timer */
1080 @REQ(cancel_timer)
1081 handle_t handle; /* handle to the timer */
1082 @END
1085 /* Retrieve the current context of a thread */
1086 @REQ(get_thread_context)
1087 handle_t handle; /* thread handle */
1088 unsigned int flags; /* context flags */
1089 @REPLY
1090 VARARG(context,context); /* thread context */
1091 @END
1094 /* Set the current context of a thread */
1095 @REQ(set_thread_context)
1096 handle_t handle; /* thread handle */
1097 unsigned int flags; /* context flags */
1098 VARARG(context,context); /* thread context */
1099 @END
1102 /* Fetch a selector entry for a thread */
1103 @REQ(get_selector_entry)
1104 handle_t handle; /* thread handle */
1105 int entry; /* LDT entry */
1106 @REPLY
1107 unsigned int base; /* selector base */
1108 unsigned int limit; /* selector limit */
1109 unsigned char flags; /* selector flags */
1110 @END
1113 /* Add an atom */
1114 @REQ(add_atom)
1115 int local; /* is atom in local process table? */
1116 VARARG(name,unicode_str); /* atom name */
1117 @REPLY
1118 int atom; /* resulting atom */
1119 @END
1122 /* Delete an atom */
1123 @REQ(delete_atom)
1124 int atom; /* atom handle */
1125 int local; /* is atom in local process table? */
1126 @END
1129 /* Find an atom */
1130 @REQ(find_atom)
1131 int local; /* is atom in local process table? */
1132 VARARG(name,unicode_str); /* atom name */
1133 @REPLY
1134 int atom; /* atom handle */
1135 @END
1138 /* Get an atom name */
1139 @REQ(get_atom_name)
1140 int atom; /* atom handle */
1141 int local; /* is atom in local process table? */
1142 @REPLY
1143 int count; /* atom lock count */
1144 VARARG(name,unicode_str); /* atom name */
1145 @END
1148 /* Init the process atom table */
1149 @REQ(init_atom_table)
1150 int entries; /* number of entries */
1151 @END
1154 /* Get the message queue of the current thread */
1155 @REQ(get_msg_queue)
1156 @REPLY
1157 handle_t handle; /* handle to the queue */
1158 @END
1161 /* Increment the message queue paint count */
1162 @REQ(inc_queue_paint_count)
1163 void* id; /* thread id */
1164 int incr; /* increment (can be negative) */
1165 @END
1168 /* Set the current message queue wakeup mask */
1169 @REQ(set_queue_mask)
1170 unsigned int wake_mask; /* wakeup bits mask */
1171 unsigned int changed_mask; /* changed bits mask */
1172 int skip_wait; /* will we skip waiting if signaled? */
1173 @REPLY
1174 unsigned int wake_bits; /* current wake bits */
1175 unsigned int changed_bits; /* current changed bits */
1176 @END
1179 /* Get the current message queue status */
1180 @REQ(get_queue_status)
1181 int clear; /* should we clear the change bits? */
1182 @REPLY
1183 unsigned int wake_bits; /* wake bits */
1184 unsigned int changed_bits; /* changed bits since last time */
1185 @END
1188 /* Wait for a process to start waiting on input */
1189 @REQ(wait_input_idle)
1190 handle_t handle; /* process handle */
1191 int timeout; /* timeout */
1192 @REPLY
1193 handle_t event; /* handle to idle event */
1194 @END
1197 /* Send a message to a thread queue */
1198 @REQ(send_message)
1199 void* id; /* thread id */
1200 int type; /* message type (see below) */
1201 user_handle_t win; /* window handle */
1202 unsigned int msg; /* message code */
1203 unsigned int wparam; /* parameters */
1204 unsigned int lparam; /* parameters */
1205 int x; /* x position */
1206 int y; /* y position */
1207 unsigned int time; /* message time */
1208 unsigned int info; /* extra info */
1209 int timeout; /* timeout for reply */
1210 VARARG(data,bytes); /* message data for sent messages */
1211 @END
1213 enum message_type
1215 MSG_ASCII, /* Ascii message (from SendMessageA) */
1216 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1217 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1218 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1219 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1220 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1221 MSG_HARDWARE_RAW, /* raw hardware message */
1222 MSG_HARDWARE_COOKED /* cooked hardware message */
1226 /* Get a message from the current queue */
1227 @REQ(get_message)
1228 int flags; /* see below */
1229 user_handle_t get_win; /* window handle to get */
1230 unsigned int get_first; /* first message code to get */
1231 unsigned int get_last; /* last message code to get */
1232 @REPLY
1233 int type; /* message type */
1234 user_handle_t win; /* window handle */
1235 unsigned int msg; /* message code */
1236 unsigned int wparam; /* parameters */
1237 unsigned int lparam; /* parameters */
1238 int x; /* x position */
1239 int y; /* y position */
1240 unsigned int time; /* message time */
1241 unsigned int info; /* extra info */
1242 VARARG(data,bytes); /* message data for sent messages */
1243 @END
1244 #define GET_MSG_REMOVE 1 /* remove the message */
1245 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1246 #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */
1248 /* Reply to a sent message */
1249 @REQ(reply_message)
1250 unsigned int result; /* message result */
1251 int remove; /* should we remove the message? */
1252 VARARG(data,bytes); /* message data for sent messages */
1253 @END
1256 /* Retrieve the reply for the last message sent */
1257 @REQ(get_message_reply)
1258 int cancel; /* cancel message if not ready? */
1259 @REPLY
1260 unsigned int result; /* message result */
1261 VARARG(data,bytes); /* message data for sent messages */
1262 @END
1265 /* Cleanup a queue when a window is deleted */
1266 @REQ(cleanup_window_queue)
1267 user_handle_t win; /* window handle */
1268 @END
1271 /* Set a window timer */
1272 @REQ(set_win_timer)
1273 user_handle_t win; /* window handle */
1274 unsigned int msg; /* message to post */
1275 unsigned int id; /* timer id */
1276 unsigned int rate; /* timer rate in ms */
1277 unsigned int lparam; /* message lparam (callback proc) */
1278 @END
1281 /* Kill a window timer */
1282 @REQ(kill_win_timer)
1283 user_handle_t win; /* window handle */
1284 unsigned int msg; /* message to post */
1285 unsigned int id; /* timer id */
1286 @END
1289 /* Open a serial port */
1290 @REQ(create_serial)
1291 unsigned int access; /* wanted access rights */
1292 int inherit; /* inherit flag */
1293 unsigned int sharing; /* sharing flags */
1294 VARARG(name,string); /* file name */
1295 @REPLY
1296 handle_t handle; /* handle to the port */
1297 @END
1300 /* Retrieve info about a serial port */
1301 @REQ(get_serial_info)
1302 handle_t handle; /* handle to comm port */
1303 @REPLY
1304 unsigned int readinterval;
1305 unsigned int readconst;
1306 unsigned int readmult;
1307 unsigned int writeconst;
1308 unsigned int writemult;
1309 unsigned int eventmask;
1310 unsigned int commerror;
1311 @END
1314 /* Set info about a serial port */
1315 @REQ(set_serial_info)
1316 handle_t handle; /* handle to comm port */
1317 int flags; /* bitmask to set values (see below) */
1318 unsigned int readinterval;
1319 unsigned int readconst;
1320 unsigned int readmult;
1321 unsigned int writeconst;
1322 unsigned int writemult;
1323 unsigned int eventmask;
1324 unsigned int commerror;
1325 @END
1326 #define SERIALINFO_SET_TIMEOUTS 0x01
1327 #define SERIALINFO_SET_MASK 0x02
1328 #define SERIALINFO_SET_ERROR 0x04
1331 /* Create an async I/O */
1332 @REQ(create_async)
1333 handle_t file_handle; /* handle to comm port, socket or file */
1334 int count;
1335 int type;
1336 @REPLY
1337 int timeout;
1338 @END
1339 #define ASYNC_TYPE_READ 0x01
1340 #define ASYNC_TYPE_WRITE 0x02
1341 #define ASYNC_TYPE_WAIT 0x03
1344 /* Create a named pipe */
1345 @REQ(create_named_pipe)
1346 unsigned int openmode;
1347 unsigned int pipemode;
1348 unsigned int maxinstances;
1349 unsigned int outsize;
1350 unsigned int insize;
1351 unsigned int timeout;
1352 VARARG(filename,string); /* pipe name */
1353 @REPLY
1354 handle_t handle; /* handle to the pipe */
1355 @END
1358 /* Open an existing named pipe */
1359 @REQ(open_named_pipe)
1360 unsigned int access;
1361 VARARG(filename,string); /* pipe name */
1362 @REPLY
1363 handle_t handle; /* handle to the pipe */
1364 @END
1367 /* Connect to a named pipe */
1368 @REQ(connect_named_pipe)
1369 handle_t handle;
1370 handle_t event; /* set this event when it's ready */
1371 @END
1374 /* Wait for a named pipe */
1375 @REQ(wait_named_pipe)
1376 unsigned int timeout;
1377 handle_t event; /* set this event when it's ready */
1378 VARARG(filename,string); /* pipe name */
1379 @END
1382 /* Disconnect a named pipe */
1383 @REQ(disconnect_named_pipe)
1384 handle_t handle;
1385 @END
1388 @REQ(get_named_pipe_info)
1389 handle_t handle;
1390 @REPLY
1391 unsigned int flags;
1392 unsigned int maxinstances;
1393 unsigned int outsize;
1394 unsigned int insize;
1395 @END
1398 /* Create the desktop window */
1399 @REQ(create_desktop_window)
1400 @REPLY
1401 user_handle_t handle; /* handle to the window */
1402 @END
1405 /* Create a window */
1406 @REQ(create_window)
1407 @REPLY
1408 user_handle_t handle; /* handle to the window */
1409 @END
1412 /* Link a window into the tree */
1413 @REQ(link_window)
1414 user_handle_t handle; /* handle to the window */
1415 user_handle_t parent; /* handle to the parent */
1416 user_handle_t previous; /* previous child in Z-order */
1417 @REPLY
1418 @END
1421 /* Destroy a window */
1422 @REQ(destroy_window)
1423 user_handle_t handle; /* handle to the window */
1424 @END
1427 /* Get information from a window handle */
1428 @REQ(get_window_info)
1429 user_handle_t handle; /* handle to the window */
1430 @REPLY
1431 user_handle_t full_handle; /* full 32-bit handle */
1432 void* pid; /* process owning the window */
1433 void* tid; /* thread owning the window */
1434 @END