Do not keep the handle of a deleted item as the selectedItem..
[wine/testsucceed.git] / server / protocol.def
bloba4a7af8b78881887b26ec9eada9446882d9939a0
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;
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
94 int error; /* ??? */
95 int type; /* ??? */
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 */
110 typedef struct
112 int code; /* event code */
113 union debug_event_data info; /* event information */
114 } debug_event_t;
116 /* structure used in sending an fd from client to server */
117 struct send_fd
119 void *tid; /* thread id */
120 int fd; /* file descriptor on client-side */
123 /* structure sent by the server on the wait fifo */
124 struct wake_up_reply
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 */
134 @REQ(new_process)
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 */
144 @REPLY
145 handle_t info; /* new process info handle */
146 @END
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 */
154 @REPLY
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 */
160 @END
163 /* Create a new thread from the context of the parent */
164 @REQ(new_thread)
165 int suspend; /* new thread should be suspended on creation */
166 int inherit; /* inherit flag */
167 int request_fd; /* fd for request pipe */
168 @REPLY
169 void* tid; /* thread id */
170 handle_t handle; /* thread handle (in the current process) */
171 @END
174 /* Signal that we are finished booting on the client side */
175 @REQ(boot_done)
176 int debug_level; /* new debug level */
177 @END
180 /* Initialize a process; called from the new process context */
181 @REQ(init_process)
182 void* ldt_copy; /* addr of LDT copy */
183 int ppid; /* parent Unix pid */
184 @REPLY
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 */
194 @END
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? */
204 @REPLY
205 int debugged; /* being debugged? */
206 @END
209 /* Initialize a thread; called from the child after fork()/clone() */
210 @REQ(init_thread)
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 */
216 @REPLY
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 */
221 @END
224 /* Set the shared buffer for a thread */
225 @REQ(set_thread_buffer)
226 int fd; /* fd to mmap as shared buffer */
227 @REPLY
228 unsigned int offset; /* offset of buffer in file */
229 unsigned int size; /* size of buffer */
230 @END
233 /* Terminate a process */
234 @REQ(terminate_process)
235 handle_t handle; /* process handle to terminate */
236 int exit_code; /* process exit code */
237 @REPLY
238 int self; /* suicide? */
239 @END
242 /* Terminate a thread */
243 @REQ(terminate_thread)
244 handle_t handle; /* thread handle to terminate */
245 int exit_code; /* thread exit code */
246 @REPLY
247 int self; /* suicide? */
248 int last; /* last thread in this process? */
249 @END
252 /* Retrieve information about a process */
253 @REQ(get_process_info)
254 handle_t handle; /* process handle */
255 @REPLY
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 */
262 @END
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 */
271 @END
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) */
280 @REPLY
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 */
285 @END
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 */
294 @END
295 #define SET_THREAD_INFO_PRIORITY 0x01
296 #define SET_THREAD_INFO_AFFINITY 0x02
299 /* Suspend a thread */
300 @REQ(suspend_thread)
301 handle_t handle; /* thread handle */
302 @REPLY
303 int count; /* new suspend count */
304 @END
307 /* Resume a thread */
308 @REQ(resume_thread)
309 handle_t handle; /* thread handle */
310 @REPLY
311 int count; /* new suspend count */
312 @END
315 /* Notify the server that a dll has been loaded */
316 @REQ(load_dll)
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) */
322 @END
325 /* Notify the server that a dll is being unloaded */
326 @REQ(unload_dll)
327 void* base; /* base address */
328 @END
331 /* Queue an APC for a thread */
332 @REQ(queue_apc)
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 */
337 @END
340 /* Get next APC to call */
341 @REQ(get_apc)
342 int alertable; /* is thread alertable? */
343 @REPLY
344 void* func; /* function to call */
345 int type; /* function type */
346 VARARG(args,ptrs); /* function arguments */
347 @END
348 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
351 /* Close a handle for the current process */
352 @REQ(close_handle)
353 handle_t handle; /* handle to close */
354 @REPLY
355 int fd; /* associated fd to close */
356 @END
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 */
365 @REPLY
366 int old_flags; /* old flag value */
367 int cur_fd; /* current file descriptor */
368 @END
371 /* Duplicate a handle */
372 @REQ(dup_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) */
379 @REPLY
380 handle_t handle; /* duplicated handle in dst process */
381 int fd; /* associated fd to close */
382 @END
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 */
389 @REQ(open_process)
390 void* pid; /* process id to open */
391 unsigned int access; /* wanted access rights */
392 int inherit; /* inherit flag */
393 @REPLY
394 handle_t handle; /* handle to the process */
395 @END
398 /* Wait for handles */
399 @REQ(select)
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 */
405 @END
406 #define SELECT_ALL 1
407 #define SELECT_ALERTABLE 2
408 #define SELECT_INTERRUPTIBLE 4
409 #define SELECT_TIMEOUT 8
412 /* Create an event */
413 @REQ(create_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 */
418 @REPLY
419 handle_t handle; /* handle to the event */
420 @END
422 /* Event operation */
423 @REQ(event_op)
424 handle_t handle; /* handle to event */
425 int op; /* event operation (see below) */
426 @END
427 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
430 /* Open an event */
431 @REQ(open_event)
432 unsigned int access; /* wanted access rights */
433 int inherit; /* inherit flag */
434 VARARG(name,unicode_str); /* object name */
435 @REPLY
436 handle_t handle; /* handle to the event */
437 @END
440 /* Create a mutex */
441 @REQ(create_mutex)
442 int owned; /* initially owned? */
443 int inherit; /* inherit flag */
444 VARARG(name,unicode_str); /* object name */
445 @REPLY
446 handle_t handle; /* handle to the mutex */
447 @END
450 /* Release a mutex */
451 @REQ(release_mutex)
452 handle_t handle; /* handle to the mutex */
453 @END
456 /* Open a mutex */
457 @REQ(open_mutex)
458 unsigned int access; /* wanted access rights */
459 int inherit; /* inherit flag */
460 VARARG(name,unicode_str); /* object name */
461 @REPLY
462 handle_t handle; /* handle to the mutex */
463 @END
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 */
472 @REPLY
473 handle_t handle; /* handle to the semaphore */
474 @END
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 */
481 @REPLY
482 unsigned int prev_count; /* previous semaphore count */
483 @END
486 /* Open a semaphore */
487 @REQ(open_semaphore)
488 unsigned int access; /* wanted access rights */
489 int inherit; /* inherit flag */
490 VARARG(name,unicode_str); /* object name */
491 @REPLY
492 handle_t handle; /* handle to the semaphore */
493 @END
496 /* Create a file */
497 @REQ(create_file)
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 */
504 @REPLY
505 handle_t handle; /* handle to the file */
506 @END
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 */
513 @REPLY
514 handle_t handle; /* handle to the file */
515 @END
518 /* Get a Unix fd to access a file */
519 @REQ(get_handle_fd)
520 handle_t handle; /* handle to the file */
521 unsigned int access; /* wanted access rights */
522 @REPLY
523 int fd; /* file descriptor */
524 @END
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 */
533 @REPLY
534 int new_low; /* new position low word */
535 int new_high; /* new position high word */
536 @END
539 /* Truncate (or extend) a file */
540 @REQ(truncate_file)
541 handle_t handle; /* handle to the file */
542 @END
545 /* Set a file access and modification times */
546 @REQ(set_file_time)
547 handle_t handle; /* handle to the file */
548 time_t access_time; /* last access time */
549 time_t write_time; /* last write time */
550 @END
553 /* Flush a file buffers */
554 @REQ(flush_file)
555 handle_t handle; /* handle to the file */
556 @END
559 /* Get information about a file */
560 @REQ(get_file_info)
561 handle_t handle; /* handle to the file */
562 @REPLY
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 */
573 @END
576 /* Lock a region of a file */
577 @REQ(lock_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 */
583 @END
586 /* Unlock a region of a file */
587 @REQ(unlock_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 */
593 @END
596 /* Create an anonymous pipe */
597 @REQ(create_pipe)
598 int inherit; /* inherit flag */
599 @REPLY
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 */
602 @END
605 /* Create a socket */
606 @REQ(create_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 */
612 @REPLY
613 handle_t handle; /* handle to the new socket */
614 @END
617 /* Accept a socket */
618 @REQ(accept_socket)
619 handle_t lhandle; /* handle to the listening socket */
620 unsigned int access; /* wanted access rights */
621 int inherit; /* inherit flag */
622 @REPLY
623 handle_t handle; /* handle to the new socket */
624 @END
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 */
632 @END
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 */
641 @REPLY
642 unsigned int mask; /* event mask */
643 unsigned int pmask; /* pending events */
644 unsigned int state; /* status bits */
645 VARARG(errors,ints); /* event errors */
646 @END
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 */
655 @END
658 /* Allocate a console for the current process */
659 @REQ(alloc_console)
660 unsigned int access; /* wanted access rights */
661 int inherit; /* inherit flag */
662 @REPLY
663 handle_t handle_in; /* handle to console input */
664 handle_t handle_out; /* handle to console output */
665 @END
668 /* Free the console of the current process */
669 @REQ(free_console)
670 @END
673 /* Open a handle to the process console */
674 @REQ(open_console)
675 int output; /* input or output? */
676 unsigned int access; /* wanted access rights */
677 int inherit; /* inherit flag */
678 @REPLY
679 handle_t handle; /* handle to the console */
680 @END
683 /* Set a console file descriptor */
684 @REQ(set_console_fd)
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) */
689 @END
692 /* Get a console mode (input or output) */
693 @REQ(get_console_mode)
694 handle_t handle; /* handle to the console */
695 @REPLY
696 int mode; /* console mode */
697 @END
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 */
704 @END
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 */
714 @END
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 */
721 @REPLY
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 */
726 @END
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 */
733 @REPLY
734 int written; /* number of records written */
735 @END
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? */
741 @REPLY
742 int read; /* number of records read */
743 VARARG(rec,input_records); /* input records */
744 @END
747 /* Create a change notification */
748 @REQ(create_change_notification)
749 int subtree; /* watch all the subtree */
750 int filter; /* notification filter */
751 @REPLY
752 handle_t handle; /* handle to the change notification */
753 @END
756 /* Create a file mapping */
757 @REQ(create_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 */
764 @REPLY
765 handle_t handle; /* handle to the mapping */
766 @END
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
778 /* Open a mapping */
779 @REQ(open_mapping)
780 unsigned int access; /* wanted access rights */
781 int inherit; /* inherit flag */
782 VARARG(name,unicode_str); /* object name */
783 @REPLY
784 handle_t handle; /* handle to the mapping */
785 @END
788 /* Get information about a file mapping */
789 @REQ(get_mapping_info)
790 handle_t handle; /* handle to the mapping */
791 @REPLY
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 */
799 @END
802 /* Create a device */
803 @REQ(create_device)
804 unsigned int access; /* wanted access rights */
805 int inherit; /* inherit flag */
806 int id; /* client private id */
807 @REPLY
808 handle_t handle; /* handle to the device */
809 @END
812 /* Create a snapshot */
813 @REQ(create_snapshot)
814 int inherit; /* inherit flag */
815 int flags; /* snapshot flags (TH32CS_*) */
816 void* pid; /* process id */
817 @REPLY
818 handle_t handle; /* handle to the snapshot */
819 @END
822 /* Get the next process from a snapshot */
823 @REQ(next_process)
824 handle_t handle; /* handle to the snapshot */
825 int reset; /* reset snapshot position? */
826 @REPLY
827 int count; /* process usage count */
828 void* pid; /* process id */
829 int threads; /* number of threads */
830 int priority; /* process priority */
831 @END
834 /* Get the next thread from a snapshot */
835 @REQ(next_thread)
836 handle_t handle; /* handle to the snapshot */
837 int reset; /* reset snapshot position? */
838 @REPLY
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 */
844 @END
847 /* Get the next module from a snapshot */
848 @REQ(next_module)
849 handle_t handle; /* handle to the snapshot */
850 int reset; /* reset snapshot position? */
851 @REPLY
852 void* pid; /* process id */
853 void* base; /* module base address */
854 @END
857 /* Wait for a debug event */
858 @REQ(wait_debug_event)
859 int get_handle; /* should we alloc a handle for waiting? */
860 @REPLY
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 */
865 @END
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 */
872 @REPLY
873 handle_t handle; /* handle to the queued event */
874 @END
877 /* Retrieve the status of an exception event */
878 @REQ(get_exception_status)
879 @REPLY
880 handle_t handle; /* handle to the queued event */
881 int status; /* event continuation status */
882 VARARG(context,context); /* modified thread context */
883 @END
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 */
891 @END
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 */
899 @END
902 /* Start debugging an existing process */
903 @REQ(debug_process)
904 void* pid; /* id of the process to debug */
905 @END
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 */
913 @REPLY
914 VARARG(data,bytes); /* result data */
915 @END
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 */
926 @END
929 /* Create a registry key */
930 @REQ(create_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 */
937 @REPLY
938 handle_t hkey; /* handle to the created key */
939 int created; /* has it been newly created? */
940 @END
942 /* Open a registry key */
943 @REQ(open_key)
944 handle_t parent; /* handle to the parent key */
945 unsigned int access; /* desired access rights */
946 VARARG(name,unicode_str); /* key name */
947 @REPLY
948 handle_t hkey; /* handle to the open key */
949 @END
952 /* Delete a registry key */
953 @REQ(delete_key)
954 handle_t hkey; /* handle to the key */
955 @END
958 /* Enumerate registry subkeys */
959 @REQ(enum_key)
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? */
963 @REPLY
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 */
973 @END
976 /* Set a value of a registry key */
977 @REQ(set_key_value)
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 */
984 @END
987 /* Retrieve the value of a registry key */
988 @REQ(get_key_value)
989 handle_t hkey; /* handle to registry key */
990 unsigned int offset; /* offset for getting data */
991 VARARG(name,unicode_len_str); /* value name */
992 @REPLY
993 int type; /* value type */
994 int len; /* value data len */
995 VARARG(data,bytes); /* value data */
996 @END
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 */
1004 @REPLY
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 */
1009 @END
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 */
1016 @END
1019 /* Load a registry branch from a file */
1020 @REQ(load_registry)
1021 handle_t hkey; /* root key to load to */
1022 handle_t file; /* file to load from */
1023 VARARG(name,unicode_str); /* subkey name */
1024 @END
1027 /* Save a registry branch to a file */
1028 @REQ(save_registry)
1029 handle_t hkey; /* key to save */
1030 handle_t file; /* file to save to */
1031 @END
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 */
1038 @END
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) */
1046 @END
1049 /* Create a waitable timer */
1050 @REQ(create_timer)
1051 int inherit; /* inherit flag */
1052 int manual; /* manual reset */
1053 VARARG(name,unicode_str); /* object name */
1054 @REPLY
1055 handle_t handle; /* handle to the timer */
1056 @END
1059 /* Open a waitable timer */
1060 @REQ(open_timer)
1061 unsigned int access; /* wanted access rights */
1062 int inherit; /* inherit flag */
1063 VARARG(name,unicode_str); /* object name */
1064 @REPLY
1065 handle_t handle; /* handle to the timer */
1066 @END
1068 /* Set a waitable timer */
1069 @REQ(set_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 */
1076 @END
1078 /* Cancel a waitable timer */
1079 @REQ(cancel_timer)
1080 handle_t handle; /* handle to the timer */
1081 @END
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 */
1088 @REPLY
1089 VARARG(context,context); /* thread context */
1090 @END
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 */
1098 @END
1101 /* Fetch a selector entry for a thread */
1102 @REQ(get_selector_entry)
1103 handle_t handle; /* thread handle */
1104 int entry; /* LDT entry */
1105 @REPLY
1106 unsigned int base; /* selector base */
1107 unsigned int limit; /* selector limit */
1108 unsigned char flags; /* selector flags */
1109 @END
1112 /* Add an atom */
1113 @REQ(add_atom)
1114 int local; /* is atom in local process table? */
1115 VARARG(name,unicode_str); /* atom name */
1116 @REPLY
1117 int atom; /* resulting atom */
1118 @END
1121 /* Delete an atom */
1122 @REQ(delete_atom)
1123 int atom; /* atom handle */
1124 int local; /* is atom in local process table? */
1125 @END
1128 /* Find an atom */
1129 @REQ(find_atom)
1130 int local; /* is atom in local process table? */
1131 VARARG(name,unicode_str); /* atom name */
1132 @REPLY
1133 int atom; /* atom handle */
1134 @END
1137 /* Get an atom name */
1138 @REQ(get_atom_name)
1139 int atom; /* atom handle */
1140 int local; /* is atom in local process table? */
1141 @REPLY
1142 int count; /* atom lock count */
1143 VARARG(name,unicode_str); /* atom name */
1144 @END
1147 /* Init the process atom table */
1148 @REQ(init_atom_table)
1149 int entries; /* number of entries */
1150 @END
1153 /* Get the message queue of the current thread */
1154 @REQ(get_msg_queue)
1155 @REPLY
1156 handle_t handle; /* handle to the queue */
1157 @END
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) */
1164 @END
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? */
1172 @REPLY
1173 unsigned int wake_bits; /* current wake bits */
1174 unsigned int changed_bits; /* current changed bits */
1175 @END
1178 /* Get the current message queue status */
1179 @REQ(get_queue_status)
1180 int clear; /* should we clear the change bits? */
1181 @REPLY
1182 unsigned int wake_bits; /* wake bits */
1183 unsigned int changed_bits; /* changed bits since last time */
1184 @END
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 */
1191 @REPLY
1192 handle_t event; /* handle to idle event */
1193 @END
1196 /* Send a message to a thread queue */
1197 @REQ(send_message)
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 */
1210 @END
1212 enum message_type
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 */
1226 @REQ(get_message)
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 */
1231 @REPLY
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 */
1242 @END
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 */
1248 @REQ(reply_message)
1249 unsigned int result; /* message result */
1250 int remove; /* should we remove the message? */
1251 VARARG(data,bytes); /* message data for sent messages */
1252 @END
1255 /* Retrieve the reply for the last message sent */
1256 @REQ(get_message_reply)
1257 int cancel; /* cancel message if not ready? */
1258 @REPLY
1259 unsigned int result; /* message result */
1260 VARARG(data,bytes); /* message data for sent messages */
1261 @END
1264 /* Cleanup a queue when a window is deleted */
1265 @REQ(cleanup_window_queue)
1266 handle_t win; /* window handle */
1267 @END
1270 /* Set a window timer */
1271 @REQ(set_win_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) */
1277 @END
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 */
1285 @END
1288 /* Open a serial port */
1289 @REQ(create_serial)
1290 unsigned int access; /* wanted access rights */
1291 int inherit; /* inherit flag */
1292 unsigned int sharing; /* sharing flags */
1293 VARARG(name,string); /* file name */
1294 @REPLY
1295 handle_t handle; /* handle to the port */
1296 @END
1299 /* Retrieve info about a serial port */
1300 @REQ(get_serial_info)
1301 handle_t handle; /* handle to comm port */
1302 @REPLY
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;
1310 @END
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;
1324 @END
1325 #define SERIALINFO_SET_TIMEOUTS 0x01
1326 #define SERIALINFO_SET_MASK 0x02
1327 #define SERIALINFO_SET_ERROR 0x04
1330 /* Create an async I/O */
1331 @REQ(create_async)
1332 handle_t file_handle; /* handle to comm port, socket or file */
1333 int count;
1334 int type;
1335 @REPLY
1336 int timeout;
1337 @END
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 */
1352 @REPLY
1353 handle_t handle; /* handle to the pipe */
1354 @END
1357 /* Open an existing named pipe */
1358 @REQ(open_named_pipe)
1359 unsigned int access;
1360 VARARG(filename,string); /* pipe name */
1361 @REPLY
1362 handle_t handle; /* handle to the pipe */
1363 @END
1366 /* Connect to a named pipe */
1367 @REQ(connect_named_pipe)
1368 handle_t handle;
1369 handle_t event; /* set this event when it's ready */
1370 @END