winedbg: Align module addresses to 8 characters.
[wine.git] / server / protocol.def
blob48d1096589c8fe85639dcd4f7e9abc1b4f8686b4
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
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 @HEADER /* start of C declarations */
27 #include <stdarg.h>
28 #include <stdlib.h>
29 #include <time.h>
31 #include <windef.h>
32 #include <winbase.h>
34 typedef void *obj_handle_t;
35 typedef void *user_handle_t;
36 typedef unsigned short atom_t;
37 typedef unsigned int process_id_t;
38 typedef unsigned int thread_id_t;
39 typedef unsigned int data_size_t;
41 struct request_header
43 int req; /* request code */
44 data_size_t request_size; /* request variable part size */
45 data_size_t reply_size; /* reply variable part maximum size */
48 struct reply_header
50 unsigned int error; /* error result */
51 data_size_t reply_size; /* reply variable part size */
54 /* placeholder structure for the maximum allowed request size */
55 /* this is used to construct the generic_request union */
56 struct request_max_size
58 int pad[16]; /* the max request size is 16 ints */
61 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
62 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
65 /* definitions of the event data depending on the event code */
66 struct debug_event_exception
68 EXCEPTION_RECORD record; /* exception record */
69 int first; /* first chance exception? */
71 struct debug_event_create_thread
73 obj_handle_t handle; /* handle to the new thread */
74 void *teb; /* thread teb (in debugged process address space) */
75 void *start; /* thread startup routine */
77 struct debug_event_create_process
79 obj_handle_t file; /* handle to the process exe file */
80 obj_handle_t process; /* handle to the new process */
81 obj_handle_t thread; /* handle to the new thread */
82 void *base; /* base of executable image */
83 int dbg_offset; /* offset of debug info in file */
84 int dbg_size; /* size of debug info */
85 void *teb; /* thread teb (in debugged process address space) */
86 void *start; /* thread startup routine */
87 void *name; /* image name (optional) */
88 int unicode; /* is it Unicode? */
90 struct debug_event_exit
92 int exit_code; /* thread or process exit code */
94 struct debug_event_load_dll
96 obj_handle_t handle; /* file handle for the dll */
97 void *base; /* base address of the dll */
98 int dbg_offset; /* offset of debug info in file */
99 int dbg_size; /* size of debug info */
100 void *name; /* image name (optional) */
101 int unicode; /* is it Unicode? */
103 struct debug_event_unload_dll
105 void *base; /* base address of the dll */
107 struct debug_event_output_string
109 void *string; /* string to display (in debugged process address space) */
110 int unicode; /* is it Unicode? */
111 int length; /* string length */
113 struct debug_event_rip_info
115 int error; /* ??? */
116 int type; /* ??? */
118 union debug_event_data
120 struct debug_event_exception exception;
121 struct debug_event_create_thread create_thread;
122 struct debug_event_create_process create_process;
123 struct debug_event_exit exit;
124 struct debug_event_load_dll load_dll;
125 struct debug_event_unload_dll unload_dll;
126 struct debug_event_output_string output_string;
127 struct debug_event_rip_info rip_info;
130 /* debug event data */
131 typedef struct
133 int code; /* event code */
134 union debug_event_data info; /* event information */
135 } debug_event_t;
137 /* structure used in sending an fd from client to server */
138 struct send_fd
140 thread_id_t tid; /* thread id */
141 int fd; /* file descriptor on client-side */
144 /* structure sent by the server on the wait fifo */
145 struct wake_up_reply
147 void *cookie; /* magic cookie that was passed in select_request */
148 int signaled; /* wait result */
151 /* structure for absolute timeouts */
152 typedef struct
154 int sec; /* seconds since Unix epoch */
155 int usec; /* microseconds */
156 } abs_time_t;
158 /* structure returned in the list of window properties */
159 typedef struct
161 atom_t atom; /* property atom */
162 short string; /* was atom a string originally? */
163 obj_handle_t handle; /* handle stored in property */
164 } property_data_t;
166 /* structure to specify window rectangles */
167 typedef struct
169 int left;
170 int top;
171 int right;
172 int bottom;
173 } rectangle_t;
175 /* structure for parameters of async I/O calls */
176 typedef struct
178 void *callback; /* client-side callback to call upon end of async */
179 void *iosb; /* I/O status block in client addr space */
180 void *arg; /* opaque user data to pass to callback */
181 void *apc; /* user apc to call */
182 void *apc_arg; /* argument for user apc */
183 obj_handle_t event; /* event to signal when done */
184 } async_data_t;
186 /* structures for extra message data */
188 struct callback_msg_data
190 void *callback; /* callback function */
191 unsigned long data; /* user data for callback */
192 unsigned long result; /* message result */
195 struct winevent_msg_data
197 user_handle_t hook; /* hook handle */
198 thread_id_t tid; /* thread id */
199 void *hook_proc; /* hook proc address */
200 /* followed by module name if any */
203 typedef union
205 unsigned char bytes[1]; /* raw data for sent messages */
206 struct callback_msg_data callback;
207 struct winevent_msg_data winevent;
208 } message_data_t;
210 /* structure for console char/attribute info */
211 typedef struct
213 WCHAR ch;
214 unsigned short attr;
215 } char_info_t;
217 typedef struct
219 unsigned int low_part;
220 int high_part;
221 } luid_t;
223 #define MAX_ACL_LEN 65535
225 struct security_descriptor
227 unsigned int control; /* SE_ flags */
228 data_size_t owner_len;
229 data_size_t group_len;
230 data_size_t sacl_len;
231 data_size_t dacl_len;
232 /* VARARGS(owner,SID); */
233 /* VARARGS(group,SID); */
234 /* VARARGS(sacl,ACL); */
235 /* VARARGS(dacl,ACL); */
238 struct token_groups
240 unsigned int count;
241 /* unsigned int attributes[count]; */
242 /* VARARGS(sids,SID); */
245 enum apc_type
247 APC_NONE,
248 APC_USER,
249 APC_TIMER,
250 APC_ASYNC_IO,
251 APC_VIRTUAL_ALLOC,
252 APC_VIRTUAL_FREE,
253 APC_VIRTUAL_QUERY,
254 APC_VIRTUAL_PROTECT,
255 APC_VIRTUAL_FLUSH,
256 APC_VIRTUAL_LOCK,
257 APC_VIRTUAL_UNLOCK,
258 APC_MAP_VIEW,
259 APC_UNMAP_VIEW,
260 APC_CREATE_THREAD
263 typedef union
265 enum apc_type type;
266 struct
268 enum apc_type type; /* APC_USER */
269 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
270 unsigned long args[3]; /* arguments for user function */
271 } user;
272 struct
274 enum apc_type type; /* APC_TIMER */
275 void (__stdcall *func)(void*, unsigned int, unsigned int);
276 abs_time_t time; /* absolute time of expiration */
277 void *arg; /* user argument */
278 } timer;
279 struct
281 enum apc_type type; /* APC_ASYNC_IO */
282 void (__stdcall *func)(void*, void*, unsigned int);
283 void *user; /* user pointer */
284 void *sb; /* status block */
285 unsigned int status; /* I/O status */
286 } async_io;
287 struct
289 enum apc_type type; /* APC_VIRTUAL_ALLOC */
290 void *addr; /* requested address */
291 unsigned long size; /* allocation size */
292 unsigned int zero_bits; /* allocation alignment */
293 unsigned int op_type; /* type of operation */
294 unsigned int prot; /* memory protection flags */
295 } virtual_alloc;
296 struct
298 enum apc_type type; /* APC_VIRTUAL_FREE */
299 void *addr; /* requested address */
300 unsigned long size; /* allocation size */
301 unsigned int op_type; /* type of operation */
302 } virtual_free;
303 struct
305 enum apc_type type; /* APC_VIRTUAL_QUERY */
306 const void *addr; /* requested address */
307 } virtual_query;
308 struct
310 enum apc_type type; /* APC_VIRTUAL_PROTECT */
311 void *addr; /* requested address */
312 unsigned long size; /* requested address */
313 unsigned int prot; /* new protection flags */
314 } virtual_protect;
315 struct
317 enum apc_type type; /* APC_VIRTUAL_FLUSH */
318 const void *addr; /* requested address */
319 unsigned long size; /* requested address */
320 } virtual_flush;
321 struct
323 enum apc_type type; /* APC_VIRTUAL_LOCK */
324 void *addr; /* requested address */
325 unsigned long size; /* requested address */
326 } virtual_lock;
327 struct
329 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
330 void *addr; /* requested address */
331 unsigned long size; /* requested address */
332 } virtual_unlock;
333 struct
335 enum apc_type type; /* APC_MAP_VIEW */
336 obj_handle_t handle; /* mapping handle */
337 void *addr; /* requested address */
338 unsigned long size; /* allocation size */
339 unsigned int offset_low;/* file offset */
340 unsigned int offset_high;
341 unsigned int zero_bits; /* allocation alignment */
342 unsigned int alloc_type;/* allocation type */
343 unsigned int prot; /* memory protection flags */
344 } map_view;
345 struct
347 enum apc_type type; /* APC_UNMAP_VIEW */
348 void *addr; /* view address */
349 } unmap_view;
350 struct
352 enum apc_type type; /* APC_CREATE_THREAD */
353 void (__stdcall *func)(void*); /* start function */
354 void *arg; /* argument for start function */
355 unsigned long reserve; /* reserve size for thread stack */
356 unsigned long commit; /* commit size for thread stack */
357 int suspend; /* suspended thread? */
358 } create_thread;
359 } apc_call_t;
361 typedef union
363 enum apc_type type;
364 struct
366 enum apc_type type; /* APC_ASYNC_IO */
367 unsigned int status; /* new status of async operation */
368 } async_io;
369 struct
371 enum apc_type type; /* APC_VIRTUAL_ALLOC */
372 unsigned int status; /* status returned by call */
373 void *addr; /* resulting address */
374 unsigned long size; /* resulting size */
375 } virtual_alloc;
376 struct
378 enum apc_type type; /* APC_VIRTUAL_FREE */
379 unsigned int status; /* status returned by call */
380 void *addr; /* resulting address */
381 unsigned long size; /* resulting size */
382 } virtual_free;
383 struct
385 enum apc_type type; /* APC_VIRTUAL_QUERY */
386 unsigned int status; /* status returned by call */
387 void *base; /* resulting base address */
388 void *alloc_base;/* resulting allocation base */
389 unsigned long size; /* resulting region size */
390 unsigned int state; /* resulting region state */
391 unsigned int prot; /* resulting region protection */
392 unsigned int alloc_prot;/* resulting allocation protection */
393 unsigned int alloc_type;/* resulting region allocation type */
394 } virtual_query;
395 struct
397 enum apc_type type; /* APC_VIRTUAL_PROTECT */
398 unsigned int status; /* status returned by call */
399 void *addr; /* resulting address */
400 unsigned long size; /* resulting size */
401 unsigned int prot; /* old protection flags */
402 } virtual_protect;
403 struct
405 enum apc_type type; /* APC_VIRTUAL_FLUSH */
406 unsigned int status; /* status returned by call */
407 const void *addr; /* resulting address */
408 unsigned long size; /* resulting size */
409 } virtual_flush;
410 struct
412 enum apc_type type; /* APC_VIRTUAL_LOCK */
413 unsigned int status; /* status returned by call */
414 void *addr; /* resulting address */
415 unsigned long size; /* resulting size */
416 } virtual_lock;
417 struct
419 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
420 unsigned int status; /* status returned by call */
421 void *addr; /* resulting address */
422 unsigned long size; /* resulting size */
423 } virtual_unlock;
424 struct
426 enum apc_type type; /* APC_MAP_VIEW */
427 unsigned int status; /* status returned by call */
428 void *addr; /* resulting address */
429 unsigned long size; /* resulting size */
430 } map_view;
431 struct
433 enum apc_type type; /* APC_MAP_VIEW */
434 unsigned int status; /* status returned by call */
435 } unmap_view;
436 struct
438 enum apc_type type; /* APC_CREATE_THREAD */
439 unsigned int status; /* status returned by call */
440 thread_id_t tid; /* thread id */
441 obj_handle_t handle; /* handle to new thread */
442 } create_thread;
443 } apc_result_t;
445 /****************************************************************/
446 /* Request declarations */
448 /* Create a new process from the context of the parent */
449 @REQ(new_process)
450 int inherit_all; /* inherit all handles from parent */
451 unsigned int create_flags; /* creation flags */
452 int socket_fd; /* file descriptor for process socket */
453 obj_handle_t exe_file; /* file handle for main exe */
454 obj_handle_t hstdin; /* handle for stdin */
455 obj_handle_t hstdout; /* handle for stdout */
456 obj_handle_t hstderr; /* handle for stderr */
457 unsigned int process_access; /* access rights for process object */
458 unsigned int process_attr; /* attributes for process object */
459 unsigned int thread_access; /* access rights for thread object */
460 unsigned int thread_attr; /* attributes for thread object */
461 VARARG(info,startup_info); /* startup information */
462 VARARG(env,unicode_str); /* environment for new process */
463 @REPLY
464 obj_handle_t info; /* new process info handle */
465 process_id_t pid; /* process id */
466 obj_handle_t phandle; /* process handle (in the current process) */
467 thread_id_t tid; /* thread id */
468 obj_handle_t thandle; /* thread handle (in the current process) */
469 @END
472 /* Retrieve information about a newly started process */
473 @REQ(get_new_process_info)
474 obj_handle_t info; /* info handle returned from new_process_request */
475 @REPLY
476 int success; /* did the process start successfully? */
477 int exit_code; /* process exit code if failed */
478 @END
481 /* Create a new thread from the context of the parent */
482 @REQ(new_thread)
483 unsigned int access; /* wanted access rights */
484 unsigned int attributes; /* object attributes */
485 int suspend; /* new thread should be suspended on creation */
486 int request_fd; /* fd for request pipe */
487 @REPLY
488 thread_id_t tid; /* thread id */
489 obj_handle_t handle; /* thread handle (in the current process) */
490 @END
493 /* Retrieve the new process startup info */
494 @REQ(get_startup_info)
495 @REPLY
496 obj_handle_t exe_file; /* file handle for main exe */
497 obj_handle_t hstdin; /* handle for stdin */
498 obj_handle_t hstdout; /* handle for stdout */
499 obj_handle_t hstderr; /* handle for stderr */
500 VARARG(info,startup_info); /* startup information */
501 VARARG(env,unicode_str); /* environment */
502 @END
505 /* Signal the end of the process initialization */
506 @REQ(init_process_done)
507 void* module; /* main module base address */
508 void* entry; /* process entry point */
509 int gui; /* is it a GUI process? */
510 @END
513 /* Initialize a thread; called from the child after fork()/clone() */
514 @REQ(init_thread)
515 int unix_pid; /* Unix pid of new thread */
516 int unix_tid; /* Unix tid of new thread */
517 int debug_level; /* new debug level */
518 void* teb; /* TEB of new thread (in thread address space) */
519 void* peb; /* address of PEB (in thread address space) */
520 void* entry; /* thread entry point (in thread address space) */
521 void* ldt_copy; /* address of LDT copy (in thread address space) */
522 int reply_fd; /* fd for reply pipe */
523 int wait_fd; /* fd for blocking calls pipe */
524 @REPLY
525 process_id_t pid; /* process id of the new thread's process */
526 thread_id_t tid; /* thread id of the new thread */
527 data_size_t info_size; /* total size of startup info */
528 abs_time_t server_start; /* server start time */
529 int version; /* protocol version */
530 @END
533 /* Terminate a process */
534 @REQ(terminate_process)
535 obj_handle_t handle; /* process handle to terminate */
536 int exit_code; /* process exit code */
537 @REPLY
538 int self; /* suicide? */
539 @END
542 /* Terminate a thread */
543 @REQ(terminate_thread)
544 obj_handle_t handle; /* thread handle to terminate */
545 int exit_code; /* thread exit code */
546 @REPLY
547 int self; /* suicide? */
548 int last; /* last thread in this process? */
549 @END
552 /* Retrieve information about a process */
553 @REQ(get_process_info)
554 obj_handle_t handle; /* process handle */
555 @REPLY
556 process_id_t pid; /* server process id */
557 process_id_t ppid; /* server process id of parent */
558 int exit_code; /* process exit code */
559 int priority; /* priority class */
560 int affinity; /* process affinity mask */
561 void* peb; /* PEB address in process address space */
562 abs_time_t start_time; /* process start time */
563 abs_time_t end_time; /* process end time */
564 @END
567 /* Set a process informations */
568 @REQ(set_process_info)
569 obj_handle_t handle; /* process handle */
570 int mask; /* setting mask (see below) */
571 int priority; /* priority class */
572 int affinity; /* affinity mask */
573 @END
574 #define SET_PROCESS_INFO_PRIORITY 0x01
575 #define SET_PROCESS_INFO_AFFINITY 0x02
578 /* Retrieve information about a thread */
579 @REQ(get_thread_info)
580 obj_handle_t handle; /* thread handle */
581 thread_id_t tid_in; /* thread id (optional) */
582 @REPLY
583 process_id_t pid; /* server process id */
584 thread_id_t tid; /* server thread id */
585 void* teb; /* thread teb pointer */
586 int exit_code; /* thread exit code */
587 int priority; /* thread priority level */
588 int affinity; /* thread affinity mask */
589 abs_time_t creation_time; /* thread creation time */
590 abs_time_t exit_time; /* thread exit time */
591 int last; /* last thread in process */
592 @END
595 /* Set a thread informations */
596 @REQ(set_thread_info)
597 obj_handle_t handle; /* thread handle */
598 int mask; /* setting mask (see below) */
599 int priority; /* priority class */
600 int affinity; /* affinity mask */
601 obj_handle_t token; /* impersonation token */
602 @END
603 #define SET_THREAD_INFO_PRIORITY 0x01
604 #define SET_THREAD_INFO_AFFINITY 0x02
605 #define SET_THREAD_INFO_TOKEN 0x04
608 /* Retrieve information about a module */
609 @REQ(get_dll_info)
610 obj_handle_t handle; /* process handle */
611 void* base_address; /* base address of module */
612 @REPLY
613 size_t size; /* module size */
614 void* entry_point;
615 VARARG(filename,unicode_str); /* file name of module */
616 @END
619 /* Suspend a thread */
620 @REQ(suspend_thread)
621 obj_handle_t handle; /* thread handle */
622 @REPLY
623 int count; /* new suspend count */
624 @END
627 /* Resume a thread */
628 @REQ(resume_thread)
629 obj_handle_t handle; /* thread handle */
630 @REPLY
631 int count; /* new suspend count */
632 @END
635 /* Notify the server that a dll has been loaded */
636 @REQ(load_dll)
637 obj_handle_t handle; /* file handle */
638 void* base; /* base address */
639 size_t size; /* dll size */
640 int dbg_offset; /* debug info offset */
641 int dbg_size; /* debug info size */
642 void* name; /* ptr to ptr to name (in process addr space) */
643 VARARG(filename,unicode_str); /* file name of dll */
644 @END
647 /* Notify the server that a dll is being unloaded */
648 @REQ(unload_dll)
649 void* base; /* base address */
650 @END
653 /* Queue an APC for a thread or process */
654 @REQ(queue_apc)
655 obj_handle_t thread; /* thread handle */
656 obj_handle_t process; /* process handle */
657 apc_call_t call; /* call arguments */
658 @REPLY
659 obj_handle_t handle; /* APC handle */
660 int self; /* run APC in caller itself? */
661 @END
664 /* Get next APC to call */
665 @REQ(get_apc)
666 int alertable; /* is thread alertable? */
667 obj_handle_t prev; /* handle to previous APC */
668 apc_result_t result; /* result of previous APC */
669 @REPLY
670 obj_handle_t handle; /* handle to APC */
671 apc_call_t call; /* call arguments */
672 @END
675 /* Get the result of an APC call */
676 @REQ(get_apc_result)
677 obj_handle_t handle; /* handle to the APC */
678 @REPLY
679 apc_result_t result; /* result of the APC */
680 @END
683 /* Close a handle for the current process */
684 @REQ(close_handle)
685 obj_handle_t handle; /* handle to close */
686 @END
689 /* Set a handle information */
690 @REQ(set_handle_info)
691 obj_handle_t handle; /* handle we are interested in */
692 int flags; /* new handle flags */
693 int mask; /* mask for flags to set */
694 @REPLY
695 int old_flags; /* old flag value */
696 @END
699 /* Duplicate a handle */
700 @REQ(dup_handle)
701 obj_handle_t src_process; /* src process handle */
702 obj_handle_t src_handle; /* src handle to duplicate */
703 obj_handle_t dst_process; /* dst process handle */
704 unsigned int access; /* wanted access rights */
705 unsigned int attributes; /* object attributes */
706 unsigned int options; /* duplicate options (see below) */
707 @REPLY
708 obj_handle_t handle; /* duplicated handle in dst process */
709 int self; /* is the source the current process? */
710 int closed; /* whether the source handle has been closed */
711 @END
712 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
713 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
714 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
717 /* Open a handle to a process */
718 @REQ(open_process)
719 process_id_t pid; /* process id to open */
720 unsigned int access; /* wanted access rights */
721 unsigned int attributes; /* object attributes */
722 @REPLY
723 obj_handle_t handle; /* handle to the process */
724 @END
727 /* Open a handle to a thread */
728 @REQ(open_thread)
729 thread_id_t tid; /* thread id to open */
730 unsigned int access; /* wanted access rights */
731 unsigned int attributes; /* object attributes */
732 @REPLY
733 obj_handle_t handle; /* handle to the thread */
734 @END
737 /* Wait for handles */
738 @REQ(select)
739 int flags; /* wait flags (see below) */
740 void* cookie; /* magic cookie to return to client */
741 obj_handle_t signal; /* object to signal (0 if none) */
742 abs_time_t timeout; /* absolute timeout */
743 VARARG(handles,handles); /* handles to select on */
744 @END
745 #define SELECT_ALL 1
746 #define SELECT_ALERTABLE 2
747 #define SELECT_INTERRUPTIBLE 4
748 #define SELECT_TIMEOUT 8
751 /* Create an event */
752 @REQ(create_event)
753 unsigned int access; /* wanted access rights */
754 unsigned int attributes; /* object attributes */
755 obj_handle_t rootdir; /* root directory */
756 int manual_reset; /* manual reset event */
757 int initial_state; /* initial state of the event */
758 VARARG(name,unicode_str); /* object name */
759 @REPLY
760 obj_handle_t handle; /* handle to the event */
761 @END
763 /* Event operation */
764 @REQ(event_op)
765 obj_handle_t handle; /* handle to event */
766 int op; /* event operation (see below) */
767 @END
768 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
771 /* Open an event */
772 @REQ(open_event)
773 unsigned int access; /* wanted access rights */
774 unsigned int attributes; /* object attributes */
775 obj_handle_t rootdir; /* root directory */
776 VARARG(name,unicode_str); /* object name */
777 @REPLY
778 obj_handle_t handle; /* handle to the event */
779 @END
782 /* Create a mutex */
783 @REQ(create_mutex)
784 unsigned int access; /* wanted access rights */
785 unsigned int attributes; /* object attributes */
786 obj_handle_t rootdir; /* root directory */
787 int owned; /* initially owned? */
788 VARARG(name,unicode_str); /* object name */
789 @REPLY
790 obj_handle_t handle; /* handle to the mutex */
791 @END
794 /* Release a mutex */
795 @REQ(release_mutex)
796 obj_handle_t handle; /* handle to the mutex */
797 @REPLY
798 unsigned int prev_count; /* value of internal counter, before release */
799 @END
802 /* Open a mutex */
803 @REQ(open_mutex)
804 unsigned int access; /* wanted access rights */
805 unsigned int attributes; /* object attributes */
806 obj_handle_t rootdir; /* root directory */
807 VARARG(name,unicode_str); /* object name */
808 @REPLY
809 obj_handle_t handle; /* handle to the mutex */
810 @END
813 /* Create a semaphore */
814 @REQ(create_semaphore)
815 unsigned int access; /* wanted access rights */
816 unsigned int attributes; /* object attributes */
817 obj_handle_t rootdir; /* root directory */
818 unsigned int initial; /* initial count */
819 unsigned int max; /* maximum count */
820 VARARG(name,unicode_str); /* object name */
821 @REPLY
822 obj_handle_t handle; /* handle to the semaphore */
823 @END
826 /* Release a semaphore */
827 @REQ(release_semaphore)
828 obj_handle_t handle; /* handle to the semaphore */
829 unsigned int count; /* count to add to semaphore */
830 @REPLY
831 unsigned int prev_count; /* previous semaphore count */
832 @END
835 /* Open a semaphore */
836 @REQ(open_semaphore)
837 unsigned int access; /* wanted access rights */
838 unsigned int attributes; /* object attributes */
839 obj_handle_t rootdir; /* root directory */
840 VARARG(name,unicode_str); /* object name */
841 @REPLY
842 obj_handle_t handle; /* handle to the semaphore */
843 @END
846 /* Create a file */
847 @REQ(create_file)
848 unsigned int access; /* wanted access rights */
849 unsigned int attributes; /* object attributes */
850 unsigned int sharing; /* sharing flags */
851 int create; /* file create action */
852 unsigned int options; /* file options */
853 unsigned int attrs; /* file attributes for creation */
854 VARARG(filename,string); /* file name */
855 @REPLY
856 obj_handle_t handle; /* handle to the file */
857 @END
860 /* Open a file object */
861 @REQ(open_file_object)
862 unsigned int access; /* wanted access rights */
863 unsigned int attributes; /* open attributes */
864 obj_handle_t rootdir; /* root directory */
865 unsigned int sharing; /* sharing flags */
866 unsigned int options; /* file options */
867 VARARG(filename,unicode_str); /* file name */
868 @REPLY
869 obj_handle_t handle; /* handle to the file */
870 @END
873 /* Allocate a file handle for a Unix fd */
874 @REQ(alloc_file_handle)
875 unsigned int access; /* wanted access rights */
876 unsigned int attributes; /* object attributes */
877 int fd; /* file descriptor on the client side */
878 @REPLY
879 obj_handle_t handle; /* handle to the file */
880 @END
883 /* Get a Unix fd to access a file */
884 @REQ(get_handle_fd)
885 obj_handle_t handle; /* handle to the file */
886 unsigned int access; /* wanted access rights */
887 int cached; /* is it cached on the client already? */
888 @REPLY
889 int type; /* file type (see below) */
890 int flags; /* file read/write flags (see below) */
891 @END
892 enum server_fd_type
894 FD_TYPE_INVALID, /* invalid file (no associated fd) */
895 FD_TYPE_FILE, /* regular file */
896 FD_TYPE_DIR, /* directory */
897 FD_TYPE_SOCKET, /* socket */
898 FD_TYPE_SERIAL, /* serial port */
899 FD_TYPE_PIPE, /* named pipe */
900 FD_TYPE_MAILSLOT, /* mailslot */
901 FD_TYPE_DEVICE, /* Windows device file */
902 FD_TYPE_NB_TYPES
904 #define FD_FLAG_OVERLAPPED 0x01 /* fd opened in overlapped mode */
905 #define FD_FLAG_TIMEOUT 0x02 /* read/write is synchronous */
906 #define FD_FLAG_RECV_SHUTDOWN 0x04
907 #define FD_FLAG_SEND_SHUTDOWN 0x08
908 #define FD_FLAG_AVAILABLE 0x10 /* in overlap read/write operation,
909 * only handle available data (don't wait) */
910 #define FD_FLAG_REMOVABLE 0x20 /* is it on a removable device? */
912 /* Flush a file buffers */
913 @REQ(flush_file)
914 obj_handle_t handle; /* handle to the file */
915 @REPLY
916 obj_handle_t event; /* event set when finished */
917 @END
920 /* Lock a region of a file */
921 @REQ(lock_file)
922 obj_handle_t handle; /* handle to the file */
923 unsigned int offset_low; /* offset of start of lock */
924 unsigned int offset_high; /* offset of start of lock */
925 unsigned int count_low; /* count of bytes to lock */
926 unsigned int count_high; /* count of bytes to lock */
927 int shared; /* shared or exclusive lock? */
928 int wait; /* do we want to wait? */
929 @REPLY
930 obj_handle_t handle; /* handle to wait on */
931 int overlapped; /* is it an overlapped I/O handle? */
932 @END
935 /* Unlock a region of a file */
936 @REQ(unlock_file)
937 obj_handle_t handle; /* handle to the file */
938 unsigned int offset_low; /* offset of start of unlock */
939 unsigned int offset_high; /* offset of start of unlock */
940 unsigned int count_low; /* count of bytes to unlock */
941 unsigned int count_high; /* count of bytes to unlock */
942 @END
945 /* Get ready to unmount a Unix device */
946 @REQ(unmount_device)
947 obj_handle_t handle; /* handle to a file on the device */
948 @END
951 /* Create a socket */
952 @REQ(create_socket)
953 unsigned int access; /* wanted access rights */
954 unsigned int attributes; /* object attributes */
955 int family; /* family, see socket manpage */
956 int type; /* type, see socket manpage */
957 int protocol; /* protocol, see socket manpage */
958 unsigned int flags; /* socket flags */
959 @REPLY
960 obj_handle_t handle; /* handle to the new socket */
961 @END
964 /* Accept a socket */
965 @REQ(accept_socket)
966 obj_handle_t lhandle; /* handle to the listening socket */
967 unsigned int access; /* wanted access rights */
968 unsigned int attributes; /* object attributes */
969 @REPLY
970 obj_handle_t handle; /* handle to the new socket */
971 @END
974 /* Set socket event parameters */
975 @REQ(set_socket_event)
976 obj_handle_t handle; /* handle to the socket */
977 unsigned int mask; /* event mask */
978 obj_handle_t event; /* event object */
979 user_handle_t window; /* window to send the message to */
980 unsigned int msg; /* message to send */
981 @END
984 /* Get socket event parameters */
985 @REQ(get_socket_event)
986 obj_handle_t handle; /* handle to the socket */
987 int service; /* clear pending? */
988 obj_handle_t c_event; /* event to clear */
989 @REPLY
990 unsigned int mask; /* event mask */
991 unsigned int pmask; /* pending events */
992 unsigned int state; /* status bits */
993 VARARG(errors,ints); /* event errors */
994 @END
997 /* Reenable pending socket events */
998 @REQ(enable_socket_event)
999 obj_handle_t handle; /* handle to the socket */
1000 unsigned int mask; /* events to re-enable */
1001 unsigned int sstate; /* status bits to set */
1002 unsigned int cstate; /* status bits to clear */
1003 @END
1005 @REQ(set_socket_deferred)
1006 obj_handle_t handle; /* handle to the socket */
1007 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1008 @END
1010 /* Allocate a console (only used by a console renderer) */
1011 @REQ(alloc_console)
1012 unsigned int access; /* wanted access rights */
1013 unsigned int attributes; /* object attributes */
1014 process_id_t pid; /* pid of process which shall be attached to the console */
1015 @REPLY
1016 obj_handle_t handle_in; /* handle to console input */
1017 obj_handle_t event; /* handle to renderer events change notification */
1018 @END
1021 /* Free the console of the current process */
1022 @REQ(free_console)
1023 @END
1026 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1027 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1028 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1029 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1030 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1031 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1032 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1033 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1034 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1035 struct console_renderer_event
1037 short event;
1038 union
1040 struct update
1042 short top;
1043 short bottom;
1044 } update;
1045 struct resize
1047 short width;
1048 short height;
1049 } resize;
1050 struct cursor_pos
1052 short x;
1053 short y;
1054 } cursor_pos;
1055 struct cursor_geom
1057 short visible;
1058 short size;
1059 } cursor_geom;
1060 struct display
1062 short left;
1063 short top;
1064 short width;
1065 short height;
1066 } display;
1067 } u;
1070 /* retrieve console events for the renderer */
1071 @REQ(get_console_renderer_events)
1072 obj_handle_t handle; /* handle to console input events */
1073 @REPLY
1074 VARARG(data,bytes); /* the various console_renderer_events */
1075 @END
1078 /* Open a handle to the process console */
1079 @REQ(open_console)
1080 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1081 /* otherwise console_in handle to get active screen buffer? */
1082 unsigned int access; /* wanted access rights */
1083 unsigned int attributes; /* object attributes */
1084 int share; /* share mask (only for output handles) */
1085 @REPLY
1086 obj_handle_t handle; /* handle to the console */
1087 @END
1090 /* Get the input queue wait event */
1091 @REQ(get_console_wait_event)
1092 @REPLY
1093 obj_handle_t handle;
1094 @END
1096 /* Get a console mode (input or output) */
1097 @REQ(get_console_mode)
1098 obj_handle_t handle; /* handle to the console */
1099 @REPLY
1100 int mode; /* console mode */
1101 @END
1104 /* Set a console mode (input or output) */
1105 @REQ(set_console_mode)
1106 obj_handle_t handle; /* handle to the console */
1107 int mode; /* console mode */
1108 @END
1111 /* Set info about a console (input only) */
1112 @REQ(set_console_input_info)
1113 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1114 int mask; /* setting mask (see below) */
1115 obj_handle_t active_sb; /* active screen buffer */
1116 int history_mode; /* whether we duplicate lines in history */
1117 int history_size; /* number of lines in history */
1118 int edition_mode; /* index to the edition mode flavors */
1119 VARARG(title,unicode_str); /* console title */
1120 @END
1121 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1122 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1123 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1124 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1125 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1128 /* Get info about a console (input only) */
1129 @REQ(get_console_input_info)
1130 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1131 @REPLY
1132 int history_mode; /* whether we duplicate lines in history */
1133 int history_size; /* number of lines in history */
1134 int history_index; /* number of used lines in history */
1135 int edition_mode; /* index to the edition mode flavors */
1136 VARARG(title,unicode_str); /* console title */
1137 @END
1140 /* appends a string to console's history */
1141 @REQ(append_console_input_history)
1142 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1143 VARARG(line,unicode_str); /* line to add */
1144 @END
1147 /* appends a string to console's history */
1148 @REQ(get_console_input_history)
1149 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1150 int index; /* index to get line from */
1151 @REPLY
1152 int total; /* total length of line in Unicode chars */
1153 VARARG(line,unicode_str); /* line to add */
1154 @END
1157 /* creates a new screen buffer on process' console */
1158 @REQ(create_console_output)
1159 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1160 unsigned int access; /* wanted access rights */
1161 unsigned int attributes; /* object attributes */
1162 unsigned int share; /* sharing credentials */
1163 @REPLY
1164 obj_handle_t handle_out; /* handle to the screen buffer */
1165 @END
1168 /* Set info about a console (output only) */
1169 @REQ(set_console_output_info)
1170 obj_handle_t handle; /* handle to the console */
1171 int mask; /* setting mask (see below) */
1172 short int cursor_size; /* size of cursor (percentage filled) */
1173 short int cursor_visible;/* cursor visibility flag */
1174 short int cursor_x; /* position of cursor (x, y) */
1175 short int cursor_y;
1176 short int width; /* width of the screen buffer */
1177 short int height; /* height of the screen buffer */
1178 short int attr; /* default attribute */
1179 short int win_left; /* window actually displayed by renderer */
1180 short int win_top; /* the rect area is expressed withing the */
1181 short int win_right; /* boundaries of the screen buffer */
1182 short int win_bottom;
1183 short int max_width; /* maximum size (width x height) for the window */
1184 short int max_height;
1185 @END
1186 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1187 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1188 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1189 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1190 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1191 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1194 /* Get info about a console (output only) */
1195 @REQ(get_console_output_info)
1196 obj_handle_t handle; /* handle to the console */
1197 @REPLY
1198 short int cursor_size; /* size of cursor (percentage filled) */
1199 short int cursor_visible;/* cursor visibility flag */
1200 short int cursor_x; /* position of cursor (x, y) */
1201 short int cursor_y;
1202 short int width; /* width of the screen buffer */
1203 short int height; /* height of the screen buffer */
1204 short int attr; /* default attribute */
1205 short int win_left; /* window actually displayed by renderer */
1206 short int win_top; /* the rect area is expressed withing the */
1207 short int win_right; /* boundaries of the screen buffer */
1208 short int win_bottom;
1209 short int max_width; /* maximum size (width x height) for the window */
1210 short int max_height;
1211 @END
1213 /* Add input records to a console input queue */
1214 @REQ(write_console_input)
1215 obj_handle_t handle; /* handle to the console input */
1216 VARARG(rec,input_records); /* input records */
1217 @REPLY
1218 int written; /* number of records written */
1219 @END
1222 /* Fetch input records from a console input queue */
1223 @REQ(read_console_input)
1224 obj_handle_t handle; /* handle to the console input */
1225 int flush; /* flush the retrieved records from the queue? */
1226 @REPLY
1227 int read; /* number of records read */
1228 VARARG(rec,input_records); /* input records */
1229 @END
1232 /* write data (chars and/or attributes) in a screen buffer */
1233 @REQ(write_console_output)
1234 obj_handle_t handle; /* handle to the console output */
1235 int x; /* position where to start writing */
1236 int y;
1237 int mode; /* char info (see below) */
1238 int wrap; /* wrap around at end of line? */
1239 VARARG(data,bytes); /* info to write */
1240 @REPLY
1241 int written; /* number of char infos actually written */
1242 int width; /* width of screen buffer */
1243 int height; /* height of screen buffer */
1244 @END
1245 enum char_info_mode
1247 CHAR_INFO_MODE_TEXT, /* characters only */
1248 CHAR_INFO_MODE_ATTR, /* attributes only */
1249 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1250 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1254 /* fill a screen buffer with constant data (chars and/or attributes) */
1255 @REQ(fill_console_output)
1256 obj_handle_t handle; /* handle to the console output */
1257 int x; /* position where to start writing */
1258 int y;
1259 int mode; /* char info mode */
1260 int count; /* number to write */
1261 int wrap; /* wrap around at end of line? */
1262 char_info_t data; /* data to write */
1263 @REPLY
1264 int written; /* number of char infos actually written */
1265 @END
1268 /* read data (chars and/or attributes) from a screen buffer */
1269 @REQ(read_console_output)
1270 obj_handle_t handle; /* handle to the console output */
1271 int x; /* position (x,y) where to start reading */
1272 int y;
1273 int mode; /* char info mode */
1274 int wrap; /* wrap around at end of line? */
1275 @REPLY
1276 int width; /* width of screen buffer */
1277 int height; /* height of screen buffer */
1278 VARARG(data,bytes);
1279 @END
1282 /* move a rect (of data) in screen buffer content */
1283 @REQ(move_console_output)
1284 obj_handle_t handle; /* handle to the console output */
1285 short int x_src; /* position (x, y) of rect to start moving from */
1286 short int y_src;
1287 short int x_dst; /* position (x, y) of rect to move to */
1288 short int y_dst;
1289 short int w; /* size of the rect (width, height) to move */
1290 short int h;
1291 @END
1294 /* Sends a signal to a process group */
1295 @REQ(send_console_signal)
1296 int signal; /* the signal to send */
1297 process_id_t group_id; /* the group to send the signal to */
1298 @END
1301 /* enable directory change notifications */
1302 @REQ(read_directory_changes)
1303 unsigned int filter; /* notification filter */
1304 obj_handle_t handle; /* handle to the directory */
1305 int subtree; /* watch the subtree? */
1306 int want_data; /* flag indicating whether change data should be collected */
1307 async_data_t async; /* async I/O parameters */
1308 @END
1311 @REQ(read_change)
1312 obj_handle_t handle;
1313 @REPLY
1314 int action; /* type of change */
1315 VARARG(name,string); /* name of directory entry that changed */
1316 @END
1319 /* Create a file mapping */
1320 @REQ(create_mapping)
1321 unsigned int access; /* wanted access rights */
1322 unsigned int attributes; /* object attributes */
1323 obj_handle_t rootdir; /* root directory */
1324 int size_high; /* mapping size */
1325 int size_low; /* mapping size */
1326 int protect; /* protection flags (see below) */
1327 obj_handle_t file_handle; /* file handle */
1328 VARARG(name,unicode_str); /* object name */
1329 @REPLY
1330 obj_handle_t handle; /* handle to the mapping */
1331 @END
1332 /* protection flags */
1333 #define VPROT_READ 0x01
1334 #define VPROT_WRITE 0x02
1335 #define VPROT_EXEC 0x04
1336 #define VPROT_WRITECOPY 0x08
1337 #define VPROT_GUARD 0x10
1338 #define VPROT_NOCACHE 0x20
1339 #define VPROT_COMMITTED 0x40
1340 #define VPROT_IMAGE 0x80
1343 /* Open a mapping */
1344 @REQ(open_mapping)
1345 unsigned int access; /* wanted access rights */
1346 unsigned int attributes; /* object attributes */
1347 obj_handle_t rootdir; /* root directory */
1348 VARARG(name,unicode_str); /* object name */
1349 @REPLY
1350 obj_handle_t handle; /* handle to the mapping */
1351 @END
1354 /* Get information about a file mapping */
1355 @REQ(get_mapping_info)
1356 obj_handle_t handle; /* handle to the mapping */
1357 @REPLY
1358 int size_high; /* mapping size */
1359 int size_low; /* mapping size */
1360 int protect; /* protection flags */
1361 int header_size; /* header size (for VPROT_IMAGE mapping) */
1362 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1363 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1364 obj_handle_t shared_file; /* shared mapping file handle */
1365 int shared_size; /* shared mapping size */
1366 @END
1369 #define SNAP_HEAPLIST 0x00000001
1370 #define SNAP_PROCESS 0x00000002
1371 #define SNAP_THREAD 0x00000004
1372 #define SNAP_MODULE 0x00000008
1373 /* Create a snapshot */
1374 @REQ(create_snapshot)
1375 unsigned int attributes; /* object attributes */
1376 int flags; /* snapshot flags (SNAP_*) */
1377 process_id_t pid; /* process id */
1378 @REPLY
1379 obj_handle_t handle; /* handle to the snapshot */
1380 @END
1383 /* Get the next process from a snapshot */
1384 @REQ(next_process)
1385 obj_handle_t handle; /* handle to the snapshot */
1386 int reset; /* reset snapshot position? */
1387 @REPLY
1388 int count; /* process usage count */
1389 process_id_t pid; /* process id */
1390 process_id_t ppid; /* parent process id */
1391 void* heap; /* heap base */
1392 void* module; /* main module */
1393 int threads; /* number of threads */
1394 int priority; /* process priority */
1395 int handles; /* number of handles */
1396 VARARG(filename,unicode_str); /* file name of main exe */
1397 @END
1400 /* Get the next thread from a snapshot */
1401 @REQ(next_thread)
1402 obj_handle_t handle; /* handle to the snapshot */
1403 int reset; /* reset snapshot position? */
1404 @REPLY
1405 int count; /* thread usage count */
1406 process_id_t pid; /* process id */
1407 thread_id_t tid; /* thread id */
1408 int base_pri; /* base priority */
1409 int delta_pri; /* delta priority */
1410 @END
1413 /* Get the next module from a snapshot */
1414 @REQ(next_module)
1415 obj_handle_t handle; /* handle to the snapshot */
1416 int reset; /* reset snapshot position? */
1417 @REPLY
1418 process_id_t pid; /* process id */
1419 void* base; /* module base address */
1420 size_t size; /* module size */
1421 VARARG(filename,unicode_str); /* file name of module */
1422 @END
1425 /* Wait for a debug event */
1426 @REQ(wait_debug_event)
1427 int get_handle; /* should we alloc a handle for waiting? */
1428 @REPLY
1429 process_id_t pid; /* process id */
1430 thread_id_t tid; /* thread id */
1431 obj_handle_t wait; /* wait handle if no event ready */
1432 VARARG(event,debug_event); /* debug event data */
1433 @END
1436 /* Queue an exception event */
1437 @REQ(queue_exception_event)
1438 int first; /* first chance exception? */
1439 VARARG(record,exc_event); /* thread context followed by exception record */
1440 @REPLY
1441 obj_handle_t handle; /* handle to the queued event */
1442 @END
1445 /* Retrieve the status of an exception event */
1446 @REQ(get_exception_status)
1447 obj_handle_t handle; /* handle to the queued event */
1448 @REPLY
1449 VARARG(context,context); /* modified thread context */
1450 @END
1453 /* Send an output string to the debugger */
1454 @REQ(output_debug_string)
1455 void* string; /* string to display (in debugged process address space) */
1456 int unicode; /* is it Unicode? */
1457 int length; /* string length */
1458 @END
1461 /* Continue a debug event */
1462 @REQ(continue_debug_event)
1463 process_id_t pid; /* process id to continue */
1464 thread_id_t tid; /* thread id to continue */
1465 int status; /* continuation status */
1466 @END
1469 /* Start/stop debugging an existing process */
1470 @REQ(debug_process)
1471 process_id_t pid; /* id of the process to debug */
1472 int attach; /* 1=attaching / 0=detaching from the process */
1473 @END
1476 /* Simulate a breakpoint in a process */
1477 @REQ(debug_break)
1478 obj_handle_t handle; /* process handle */
1479 @REPLY
1480 int self; /* was it the caller itself? */
1481 @END
1484 /* Set debugger kill on exit flag */
1485 @REQ(set_debugger_kill_on_exit)
1486 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1487 @END
1490 /* Read data from a process address space */
1491 @REQ(read_process_memory)
1492 obj_handle_t handle; /* process handle */
1493 void* addr; /* addr to read from */
1494 @REPLY
1495 VARARG(data,bytes); /* result data */
1496 @END
1499 /* Write data to a process address space */
1500 @REQ(write_process_memory)
1501 obj_handle_t handle; /* process handle */
1502 void* addr; /* addr to write to */
1503 VARARG(data,bytes); /* data to write */
1504 @END
1507 /* Create a registry key */
1508 @REQ(create_key)
1509 obj_handle_t parent; /* handle to the parent key */
1510 unsigned int access; /* desired access rights */
1511 unsigned int attributes; /* object attributes */
1512 unsigned int options; /* creation options */
1513 time_t modif; /* last modification time */
1514 data_size_t namelen; /* length of key name in bytes */
1515 VARARG(name,unicode_str,namelen); /* key name */
1516 VARARG(class,unicode_str); /* class name */
1517 @REPLY
1518 obj_handle_t hkey; /* handle to the created key */
1519 int created; /* has it been newly created? */
1520 @END
1522 /* Open a registry key */
1523 @REQ(open_key)
1524 obj_handle_t parent; /* handle to the parent key */
1525 unsigned int access; /* desired access rights */
1526 unsigned int attributes; /* object attributes */
1527 VARARG(name,unicode_str); /* key name */
1528 @REPLY
1529 obj_handle_t hkey; /* handle to the open key */
1530 @END
1533 /* Delete a registry key */
1534 @REQ(delete_key)
1535 obj_handle_t hkey; /* handle to the key */
1536 @END
1539 /* Flush a registry key */
1540 @REQ(flush_key)
1541 obj_handle_t hkey; /* handle to the key */
1542 @END
1545 /* Enumerate registry subkeys */
1546 @REQ(enum_key)
1547 obj_handle_t hkey; /* handle to registry key */
1548 int index; /* index of subkey (or -1 for current key) */
1549 int info_class; /* requested information class */
1550 @REPLY
1551 int subkeys; /* number of subkeys */
1552 int max_subkey; /* longest subkey name */
1553 int max_class; /* longest class name */
1554 int values; /* number of values */
1555 int max_value; /* longest value name */
1556 int max_data; /* longest value data */
1557 time_t modif; /* last modification time */
1558 data_size_t total; /* total length needed for full name and class */
1559 data_size_t namelen; /* length of key name in bytes */
1560 VARARG(name,unicode_str,namelen); /* key name */
1561 VARARG(class,unicode_str); /* class name */
1562 @END
1565 /* Set a value of a registry key */
1566 @REQ(set_key_value)
1567 obj_handle_t hkey; /* handle to registry key */
1568 int type; /* value type */
1569 data_size_t namelen; /* length of value name in bytes */
1570 VARARG(name,unicode_str,namelen); /* value name */
1571 VARARG(data,bytes); /* value data */
1572 @END
1575 /* Retrieve the value of a registry key */
1576 @REQ(get_key_value)
1577 obj_handle_t hkey; /* handle to registry key */
1578 VARARG(name,unicode_str); /* value name */
1579 @REPLY
1580 int type; /* value type */
1581 data_size_t total; /* total length needed for data */
1582 VARARG(data,bytes); /* value data */
1583 @END
1586 /* Enumerate a value of a registry key */
1587 @REQ(enum_key_value)
1588 obj_handle_t hkey; /* handle to registry key */
1589 int index; /* value index */
1590 int info_class; /* requested information class */
1591 @REPLY
1592 int type; /* value type */
1593 data_size_t total; /* total length needed for full name and data */
1594 data_size_t namelen; /* length of value name in bytes */
1595 VARARG(name,unicode_str,namelen); /* value name */
1596 VARARG(data,bytes); /* value data */
1597 @END
1600 /* Delete a value of a registry key */
1601 @REQ(delete_key_value)
1602 obj_handle_t hkey; /* handle to registry key */
1603 VARARG(name,unicode_str); /* value name */
1604 @END
1607 /* Load a registry branch from a file */
1608 @REQ(load_registry)
1609 obj_handle_t hkey; /* root key to load to */
1610 obj_handle_t file; /* file to load from */
1611 VARARG(name,unicode_str); /* subkey name */
1612 @END
1615 /* UnLoad a registry branch from a file */
1616 @REQ(unload_registry)
1617 obj_handle_t hkey; /* root key to unload to */
1618 @END
1621 /* Save a registry branch to a file */
1622 @REQ(save_registry)
1623 obj_handle_t hkey; /* key to save */
1624 obj_handle_t file; /* file to save to */
1625 @END
1628 /* Add a registry key change notification */
1629 @REQ(set_registry_notification)
1630 obj_handle_t hkey; /* key to watch for changes */
1631 obj_handle_t event; /* event to set */
1632 int subtree; /* should we watch the whole subtree? */
1633 unsigned int filter; /* things to watch */
1634 @END
1637 /* Create a waitable timer */
1638 @REQ(create_timer)
1639 unsigned int access; /* wanted access rights */
1640 unsigned int attributes; /* object attributes */
1641 obj_handle_t rootdir; /* root directory */
1642 int manual; /* manual reset */
1643 VARARG(name,unicode_str); /* object name */
1644 @REPLY
1645 obj_handle_t handle; /* handle to the timer */
1646 @END
1649 /* Open a waitable timer */
1650 @REQ(open_timer)
1651 unsigned int access; /* wanted access rights */
1652 unsigned int attributes; /* object attributes */
1653 obj_handle_t rootdir; /* root directory */
1654 VARARG(name,unicode_str); /* object name */
1655 @REPLY
1656 obj_handle_t handle; /* handle to the timer */
1657 @END
1659 /* Set a waitable timer */
1660 @REQ(set_timer)
1661 obj_handle_t handle; /* handle to the timer */
1662 abs_time_t expire; /* next expiration absolute time */
1663 int period; /* timer period in ms */
1664 void* callback; /* callback function */
1665 void* arg; /* callback argument */
1666 @REPLY
1667 int signaled; /* was the timer signaled before this call ? */
1668 @END
1670 /* Cancel a waitable timer */
1671 @REQ(cancel_timer)
1672 obj_handle_t handle; /* handle to the timer */
1673 @REPLY
1674 int signaled; /* was the timer signaled before this calltime ? */
1675 @END
1677 /* Get information on a waitable timer */
1678 @REQ(get_timer_info)
1679 obj_handle_t handle; /* handle to the timer */
1680 @REPLY
1681 abs_time_t when; /* absolute time when the timer next expires */
1682 int signaled; /* is the timer signaled? */
1683 @END
1686 /* Retrieve the current context of a thread */
1687 @REQ(get_thread_context)
1688 obj_handle_t handle; /* thread handle */
1689 unsigned int flags; /* context flags */
1690 int suspend; /* if getting context during suspend */
1691 @REPLY
1692 int self; /* was it a handle to the current thread? */
1693 VARARG(context,context); /* thread context */
1694 @END
1697 /* Set the current context of a thread */
1698 @REQ(set_thread_context)
1699 obj_handle_t handle; /* thread handle */
1700 unsigned int flags; /* context flags */
1701 int suspend; /* if setting context during suspend */
1702 VARARG(context,context); /* thread context */
1703 @REPLY
1704 int self; /* was it a handle to the current thread? */
1705 @END
1708 /* Fetch a selector entry for a thread */
1709 @REQ(get_selector_entry)
1710 obj_handle_t handle; /* thread handle */
1711 int entry; /* LDT entry */
1712 @REPLY
1713 unsigned int base; /* selector base */
1714 unsigned int limit; /* selector limit */
1715 unsigned char flags; /* selector flags */
1716 @END
1719 /* Add an atom */
1720 @REQ(add_atom)
1721 obj_handle_t table; /* which table to add atom to */
1722 VARARG(name,unicode_str); /* atom name */
1723 @REPLY
1724 atom_t atom; /* resulting atom */
1725 @END
1728 /* Delete an atom */
1729 @REQ(delete_atom)
1730 obj_handle_t table; /* which table to delete atom from */
1731 atom_t atom; /* atom handle */
1732 @END
1735 /* Find an atom */
1736 @REQ(find_atom)
1737 obj_handle_t table; /* which table to find atom from */
1738 VARARG(name,unicode_str); /* atom name */
1739 @REPLY
1740 atom_t atom; /* atom handle */
1741 @END
1744 /* Get information about an atom */
1745 @REQ(get_atom_information)
1746 obj_handle_t table; /* which table to find atom from */
1747 atom_t atom; /* atom handle */
1748 @REPLY
1749 int count; /* atom lock count */
1750 int pinned; /* whether the atom has been pinned */
1751 data_size_t total; /* actual length of atom name */
1752 VARARG(name,unicode_str); /* atom name */
1753 @END
1756 /* Set information about an atom */
1757 @REQ(set_atom_information)
1758 obj_handle_t table; /* which table to find atom from */
1759 atom_t atom; /* atom handle */
1760 int pinned; /* whether to bump atom information */
1761 @END
1764 /* Empty an atom table */
1765 @REQ(empty_atom_table)
1766 obj_handle_t table; /* which table to find atom from */
1767 int if_pinned; /* whether to delete pinned atoms */
1768 @END
1771 /* Init an atom table */
1772 @REQ(init_atom_table)
1773 int entries; /* number of entries (only for local) */
1774 @REPLY
1775 obj_handle_t table; /* handle to the atom table */
1776 @END
1779 /* Get the message queue of the current thread */
1780 @REQ(get_msg_queue)
1781 @REPLY
1782 obj_handle_t handle; /* handle to the queue */
1783 @END
1786 /* Set the file descriptor associated to the current thread queue */
1787 @REQ(set_queue_fd)
1788 obj_handle_t handle; /* handle to the file descriptor */
1789 @END
1792 /* Set the current message queue wakeup mask */
1793 @REQ(set_queue_mask)
1794 unsigned int wake_mask; /* wakeup bits mask */
1795 unsigned int changed_mask; /* changed bits mask */
1796 int skip_wait; /* will we skip waiting if signaled? */
1797 @REPLY
1798 unsigned int wake_bits; /* current wake bits */
1799 unsigned int changed_bits; /* current changed bits */
1800 @END
1803 /* Get the current message queue status */
1804 @REQ(get_queue_status)
1805 int clear; /* should we clear the change bits? */
1806 @REPLY
1807 unsigned int wake_bits; /* wake bits */
1808 unsigned int changed_bits; /* changed bits since last time */
1809 @END
1812 /* Retrieve the process idle event */
1813 @REQ(get_process_idle_event)
1814 obj_handle_t handle; /* process handle */
1815 @REPLY
1816 obj_handle_t event; /* handle to idle event */
1817 @END
1820 /* Send a message to a thread queue */
1821 @REQ(send_message)
1822 thread_id_t id; /* thread id */
1823 int type; /* message type (see below) */
1824 int flags; /* message flags (see below) */
1825 user_handle_t win; /* window handle */
1826 unsigned int msg; /* message code */
1827 unsigned long wparam; /* parameters */
1828 unsigned long lparam; /* parameters */
1829 int timeout; /* timeout for reply */
1830 VARARG(data,message_data); /* message data for sent messages */
1831 @END
1833 @REQ(post_quit_message)
1834 int exit_code; /* exit code to return */
1835 @END
1837 enum message_type
1839 MSG_ASCII, /* Ascii message (from SendMessageA) */
1840 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1841 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1842 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1843 MSG_CALLBACK_RESULT,/* result of a callback message */
1844 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1845 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1846 MSG_HARDWARE, /* hardware message */
1847 MSG_WINEVENT /* winevent message */
1849 #define SEND_MSG_ABORT_IF_HUNG 0x01
1852 /* Send a hardware message to a thread queue */
1853 @REQ(send_hardware_message)
1854 thread_id_t id; /* thread id */
1855 user_handle_t win; /* window handle */
1856 unsigned int msg; /* message code */
1857 unsigned int time; /* message time */
1858 unsigned long wparam; /* parameters */
1859 unsigned long lparam; /* parameters */
1860 unsigned long info; /* extra info */
1861 int x; /* x position */
1862 int y; /* y position */
1863 @END
1866 /* Get a message from the current queue */
1867 @REQ(get_message)
1868 unsigned int flags; /* PM_* flags */
1869 user_handle_t get_win; /* window handle to get */
1870 unsigned int get_first; /* first message code to get */
1871 unsigned int get_last; /* last message code to get */
1872 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1873 @REPLY
1874 user_handle_t win; /* window handle */
1875 int type; /* message type */
1876 unsigned int msg; /* message code */
1877 unsigned long wparam; /* parameters */
1878 unsigned long lparam; /* parameters */
1879 unsigned long info; /* extra info */
1880 int x; /* x position */
1881 int y; /* y position */
1882 unsigned int time; /* message time */
1883 unsigned int hw_id; /* id if hardware message */
1884 unsigned int active_hooks; /* active hooks bitmap */
1885 data_size_t total; /* total size of extra data */
1886 VARARG(data,message_data); /* message data for sent messages */
1887 @END
1890 /* Reply to a sent message */
1891 @REQ(reply_message)
1892 unsigned int result; /* message result */
1893 int remove; /* should we remove the message? */
1894 VARARG(data,bytes); /* message data for sent messages */
1895 @END
1898 /* Accept the current hardware message */
1899 @REQ(accept_hardware_message)
1900 unsigned int hw_id; /* id of the hardware message */
1901 int remove; /* should we remove the message? */
1902 user_handle_t new_win; /* new destination window for current message */
1903 @END
1906 /* Retrieve the reply for the last message sent */
1907 @REQ(get_message_reply)
1908 int cancel; /* cancel message if not ready? */
1909 @REPLY
1910 unsigned int result; /* message result */
1911 VARARG(data,bytes); /* message data for sent messages */
1912 @END
1915 /* Set a window timer */
1916 @REQ(set_win_timer)
1917 user_handle_t win; /* window handle */
1918 unsigned int msg; /* message to post */
1919 unsigned int rate; /* timer rate in ms */
1920 unsigned long id; /* timer id */
1921 unsigned long lparam; /* message lparam (callback proc) */
1922 @REPLY
1923 unsigned long id; /* timer id */
1924 @END
1927 /* Kill a window timer */
1928 @REQ(kill_win_timer)
1929 user_handle_t win; /* window handle */
1930 unsigned int msg; /* message to post */
1931 unsigned long id; /* timer id */
1932 @END
1935 /* Retrieve info about a serial port */
1936 @REQ(get_serial_info)
1937 obj_handle_t handle; /* handle to comm port */
1938 @REPLY
1939 unsigned int readinterval;
1940 unsigned int readconst;
1941 unsigned int readmult;
1942 unsigned int writeconst;
1943 unsigned int writemult;
1944 unsigned int eventmask;
1945 @END
1948 /* Set info about a serial port */
1949 @REQ(set_serial_info)
1950 obj_handle_t handle; /* handle to comm port */
1951 int flags; /* bitmask to set values (see below) */
1952 unsigned int readinterval;
1953 unsigned int readconst;
1954 unsigned int readmult;
1955 unsigned int writeconst;
1956 unsigned int writemult;
1957 unsigned int eventmask;
1958 @END
1959 #define SERIALINFO_SET_TIMEOUTS 0x01
1960 #define SERIALINFO_SET_MASK 0x02
1963 /* Create an async I/O */
1964 @REQ(register_async)
1965 obj_handle_t handle; /* handle to comm port, socket or file */
1966 int type; /* type of queue to look after */
1967 int count; /* count - usually # of bytes to be read/written */
1968 async_data_t async; /* async I/O parameters */
1969 @END
1970 #define ASYNC_TYPE_READ 0x01
1971 #define ASYNC_TYPE_WRITE 0x02
1972 #define ASYNC_TYPE_WAIT 0x03
1975 /* Cancel all async op on a fd */
1976 @REQ(cancel_async)
1977 obj_handle_t handle; /* handle to comm port, socket or file */
1978 @END
1981 /* Create a named pipe */
1982 @REQ(create_named_pipe)
1983 unsigned int access;
1984 unsigned int attributes; /* object attributes */
1985 obj_handle_t rootdir; /* root directory */
1986 unsigned int options;
1987 unsigned int flags;
1988 unsigned int maxinstances;
1989 unsigned int outsize;
1990 unsigned int insize;
1991 unsigned int timeout;
1992 VARARG(name,unicode_str); /* pipe name */
1993 @REPLY
1994 obj_handle_t handle; /* handle to the pipe */
1995 @END
1997 /* flags in create_named_pipe and get_named_pipe_info */
1998 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1999 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2000 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2001 #define NAMED_PIPE_SERVER_END 0x8000
2003 /* Connect to a named pipe */
2004 @REQ(connect_named_pipe)
2005 obj_handle_t handle;
2006 async_data_t async; /* async I/O parameters */
2007 @END
2010 /* Wait for a named pipe */
2011 @REQ(wait_named_pipe)
2012 obj_handle_t handle;
2013 async_data_t async; /* async I/O parameters */
2014 unsigned int timeout;
2015 VARARG(name,unicode_str); /* pipe name */
2016 @END
2019 /* Disconnect a named pipe */
2020 @REQ(disconnect_named_pipe)
2021 obj_handle_t handle;
2022 @END
2025 @REQ(get_named_pipe_info)
2026 obj_handle_t handle;
2027 @REPLY
2028 unsigned int flags;
2029 unsigned int maxinstances;
2030 unsigned int instances;
2031 unsigned int outsize;
2032 unsigned int insize;
2033 @END
2036 /* Create a window */
2037 @REQ(create_window)
2038 user_handle_t parent; /* parent window */
2039 user_handle_t owner; /* owner window */
2040 atom_t atom; /* class atom */
2041 void* instance; /* module instance */
2042 @REPLY
2043 user_handle_t handle; /* created window */
2044 user_handle_t parent; /* full handle of parent */
2045 user_handle_t owner; /* full handle of owner */
2046 int extra; /* number of extra bytes */
2047 void* class_ptr; /* pointer to class in client address space */
2048 @END
2051 /* Destroy a window */
2052 @REQ(destroy_window)
2053 user_handle_t handle; /* handle to the window */
2054 @END
2057 /* Retrieve the desktop window for the current thread */
2058 @REQ(get_desktop_window)
2059 int force; /* force creation if it doesn't exist */
2060 @REPLY
2061 user_handle_t handle; /* handle to the desktop window */
2062 @END
2065 /* Set a window owner */
2066 @REQ(set_window_owner)
2067 user_handle_t handle; /* handle to the window */
2068 user_handle_t owner; /* new owner */
2069 @REPLY
2070 user_handle_t full_owner; /* full handle of new owner */
2071 user_handle_t prev_owner; /* full handle of previous owner */
2072 @END
2075 /* Get information from a window handle */
2076 @REQ(get_window_info)
2077 user_handle_t handle; /* handle to the window */
2078 @REPLY
2079 user_handle_t full_handle; /* full 32-bit handle */
2080 user_handle_t last_active; /* last active popup */
2081 process_id_t pid; /* process owning the window */
2082 thread_id_t tid; /* thread owning the window */
2083 atom_t atom; /* class atom */
2084 int is_unicode; /* ANSI or unicode */
2085 @END
2088 /* Set some information in a window */
2089 @REQ(set_window_info)
2090 unsigned int flags; /* flags for fields to set (see below) */
2091 user_handle_t handle; /* handle to the window */
2092 unsigned int style; /* window style */
2093 unsigned int ex_style; /* window extended style */
2094 unsigned int id; /* window id */
2095 int is_unicode; /* ANSI or unicode */
2096 void* instance; /* creator instance */
2097 unsigned long user_data; /* user-specific data */
2098 int extra_offset; /* offset to set in extra bytes */
2099 data_size_t extra_size; /* size to set in extra bytes */
2100 unsigned long extra_value; /* value to set in extra bytes */
2101 @REPLY
2102 unsigned int old_style; /* old window style */
2103 unsigned int old_ex_style; /* old window extended style */
2104 unsigned int old_id; /* old window id */
2105 void* old_instance; /* old creator instance */
2106 unsigned long old_user_data; /* old user-specific data */
2107 unsigned long old_extra_value; /* old value in extra bytes */
2108 @END
2109 #define SET_WIN_STYLE 0x01
2110 #define SET_WIN_EXSTYLE 0x02
2111 #define SET_WIN_ID 0x04
2112 #define SET_WIN_INSTANCE 0x08
2113 #define SET_WIN_USERDATA 0x10
2114 #define SET_WIN_EXTRA 0x20
2115 #define SET_WIN_UNICODE 0x40
2118 /* Set the parent of a window */
2119 @REQ(set_parent)
2120 user_handle_t handle; /* handle to the window */
2121 user_handle_t parent; /* handle to the parent */
2122 @REPLY
2123 user_handle_t old_parent; /* old parent window */
2124 user_handle_t full_parent; /* full handle of new parent */
2125 @END
2128 /* Get a list of the window parents, up to the root of the tree */
2129 @REQ(get_window_parents)
2130 user_handle_t handle; /* handle to the window */
2131 @REPLY
2132 int count; /* total count of parents */
2133 VARARG(parents,user_handles); /* parent handles */
2134 @END
2137 /* Get a list of the window children */
2138 @REQ(get_window_children)
2139 user_handle_t parent; /* parent window */
2140 atom_t atom; /* class atom for the listed children */
2141 thread_id_t tid; /* thread owning the listed children */
2142 @REPLY
2143 int count; /* total count of children */
2144 VARARG(children,user_handles); /* children handles */
2145 @END
2148 /* Get a list of the window children that contain a given point */
2149 @REQ(get_window_children_from_point)
2150 user_handle_t parent; /* parent window */
2151 int x; /* point in parent coordinates */
2152 int y;
2153 @REPLY
2154 int count; /* total count of children */
2155 VARARG(children,user_handles); /* children handles */
2156 @END
2159 /* Get window tree information from a window handle */
2160 @REQ(get_window_tree)
2161 user_handle_t handle; /* handle to the window */
2162 @REPLY
2163 user_handle_t parent; /* parent window */
2164 user_handle_t owner; /* owner window */
2165 user_handle_t next_sibling; /* next sibling in Z-order */
2166 user_handle_t prev_sibling; /* prev sibling in Z-order */
2167 user_handle_t first_sibling; /* first sibling in Z-order */
2168 user_handle_t last_sibling; /* last sibling in Z-order */
2169 user_handle_t first_child; /* first child */
2170 user_handle_t last_child; /* last child */
2171 @END
2173 /* Set the position and Z order of a window */
2174 @REQ(set_window_pos)
2175 unsigned int flags; /* SWP_* flags */
2176 user_handle_t handle; /* handle to the window */
2177 user_handle_t previous; /* previous window in Z order */
2178 rectangle_t window; /* window rectangle */
2179 rectangle_t client; /* client rectangle */
2180 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
2181 @REPLY
2182 unsigned int new_style; /* new window style */
2183 @END
2186 /* Get the window and client rectangles of a window */
2187 @REQ(get_window_rectangles)
2188 user_handle_t handle; /* handle to the window */
2189 @REPLY
2190 rectangle_t window; /* window rectangle */
2191 rectangle_t visible; /* visible part of the window rectangle */
2192 rectangle_t client; /* client rectangle */
2193 @END
2196 /* Get the window text */
2197 @REQ(get_window_text)
2198 user_handle_t handle; /* handle to the window */
2199 @REPLY
2200 VARARG(text,unicode_str); /* window text */
2201 @END
2204 /* Set the window text */
2205 @REQ(set_window_text)
2206 user_handle_t handle; /* handle to the window */
2207 VARARG(text,unicode_str); /* window text */
2208 @END
2211 /* Get the coordinates offset between two windows */
2212 @REQ(get_windows_offset)
2213 user_handle_t from; /* handle to the first window */
2214 user_handle_t to; /* handle to the second window */
2215 @REPLY
2216 int x; /* x coordinate offset */
2217 int y; /* y coordinate offset */
2218 @END
2221 /* Get the visible region of a window */
2222 @REQ(get_visible_region)
2223 user_handle_t window; /* handle to the window */
2224 unsigned int flags; /* DCX flags */
2225 @REPLY
2226 user_handle_t top_win; /* top window to clip against */
2227 rectangle_t top_rect; /* top window visible rect with screen coords */
2228 rectangle_t win_rect; /* window rect in screen coords */
2229 data_size_t total_size; /* total size of the resulting region */
2230 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2231 @END
2234 /* Get the window region */
2235 @REQ(get_window_region)
2236 user_handle_t window; /* handle to the window */
2237 @REPLY
2238 data_size_t total_size; /* total size of the resulting region */
2239 VARARG(region,rectangles); /* list of rectangles for the region */
2240 @END
2243 /* Set the window region */
2244 @REQ(set_window_region)
2245 user_handle_t window; /* handle to the window */
2246 int redraw; /* redraw the window? */
2247 VARARG(region,rectangles); /* list of rectangles for the region */
2248 @END
2251 /* Get the window update region */
2252 @REQ(get_update_region)
2253 user_handle_t window; /* handle to the window */
2254 user_handle_t from_child; /* child to start searching from */
2255 unsigned int flags; /* update flags (see below) */
2256 @REPLY
2257 user_handle_t child; /* child to repaint (or window itself) */
2258 unsigned int flags; /* resulting update flags (see below) */
2259 data_size_t total_size; /* total size of the resulting region */
2260 VARARG(region,rectangles); /* list of rectangles for the region */
2261 @END
2262 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2263 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2264 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2265 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2266 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2267 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2268 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2271 /* Update the z order of a window so that a given rectangle is fully visible */
2272 @REQ(update_window_zorder)
2273 user_handle_t window; /* handle to the window */
2274 rectangle_t rect; /* rectangle that must be visible */
2275 @END
2278 /* Mark parts of a window as needing a redraw */
2279 @REQ(redraw_window)
2280 user_handle_t window; /* handle to the window */
2281 unsigned int flags; /* RDW_* flags */
2282 VARARG(region,rectangles); /* list of rectangles for the region */
2283 @END
2286 /* Set a window property */
2287 @REQ(set_window_property)
2288 user_handle_t window; /* handle to the window */
2289 atom_t atom; /* property atom (if no name specified) */
2290 obj_handle_t handle; /* handle to store */
2291 VARARG(name,unicode_str); /* property name */
2292 @END
2295 /* Remove a window property */
2296 @REQ(remove_window_property)
2297 user_handle_t window; /* handle to the window */
2298 atom_t atom; /* property atom (if no name specified) */
2299 VARARG(name,unicode_str); /* property name */
2300 @REPLY
2301 obj_handle_t handle; /* handle stored in property */
2302 @END
2305 /* Get a window property */
2306 @REQ(get_window_property)
2307 user_handle_t window; /* handle to the window */
2308 atom_t atom; /* property atom (if no name specified) */
2309 VARARG(name,unicode_str); /* property name */
2310 @REPLY
2311 obj_handle_t handle; /* handle stored in property */
2312 @END
2315 /* Get the list of properties of a window */
2316 @REQ(get_window_properties)
2317 user_handle_t window; /* handle to the window */
2318 @REPLY
2319 int total; /* total number of properties */
2320 VARARG(props,properties); /* list of properties */
2321 @END
2324 /* Create a window station */
2325 @REQ(create_winstation)
2326 unsigned int flags; /* window station flags */
2327 unsigned int access; /* wanted access rights */
2328 unsigned int attributes; /* object attributes */
2329 VARARG(name,unicode_str); /* object name */
2330 @REPLY
2331 obj_handle_t handle; /* handle to the window station */
2332 @END
2335 /* Open a handle to a window station */
2336 @REQ(open_winstation)
2337 unsigned int access; /* wanted access rights */
2338 unsigned int attributes; /* object attributes */
2339 VARARG(name,unicode_str); /* object name */
2340 @REPLY
2341 obj_handle_t handle; /* handle to the window station */
2342 @END
2345 /* Close a window station */
2346 @REQ(close_winstation)
2347 obj_handle_t handle; /* handle to the window station */
2348 @END
2351 /* Get the process current window station */
2352 @REQ(get_process_winstation)
2353 @REPLY
2354 obj_handle_t handle; /* handle to the window station */
2355 @END
2358 /* Set the process current window station */
2359 @REQ(set_process_winstation)
2360 obj_handle_t handle; /* handle to the window station */
2361 @END
2364 /* Create a desktop */
2365 @REQ(create_desktop)
2366 unsigned int flags; /* desktop flags */
2367 unsigned int access; /* wanted access rights */
2368 unsigned int attributes; /* object attributes */
2369 VARARG(name,unicode_str); /* object name */
2370 @REPLY
2371 obj_handle_t handle; /* handle to the desktop */
2372 @END
2375 /* Open a handle to a desktop */
2376 @REQ(open_desktop)
2377 unsigned int flags; /* desktop flags */
2378 unsigned int access; /* wanted access rights */
2379 unsigned int attributes; /* object attributes */
2380 VARARG(name,unicode_str); /* object name */
2381 @REPLY
2382 obj_handle_t handle; /* handle to the desktop */
2383 @END
2386 /* Close a desktop */
2387 @REQ(close_desktop)
2388 obj_handle_t handle; /* handle to the desktop */
2389 @END
2392 /* Get the thread current desktop */
2393 @REQ(get_thread_desktop)
2394 thread_id_t tid; /* thread id */
2395 @REPLY
2396 obj_handle_t handle; /* handle to the desktop */
2397 @END
2400 /* Set the thread current desktop */
2401 @REQ(set_thread_desktop)
2402 obj_handle_t handle; /* handle to the desktop */
2403 @END
2406 /* Get/set information about a user object (window station or desktop) */
2407 @REQ(set_user_object_info)
2408 obj_handle_t handle; /* handle to the object */
2409 unsigned int flags; /* information to set */
2410 unsigned int obj_flags; /* new object flags */
2411 @REPLY
2412 int is_desktop; /* is object a desktop? */
2413 unsigned int old_obj_flags; /* old object flags */
2414 VARARG(name,unicode_str); /* object name */
2415 @END
2416 #define SET_USER_OBJECT_FLAGS 1
2419 /* Attach (or detach) thread inputs */
2420 @REQ(attach_thread_input)
2421 thread_id_t tid_from; /* thread to be attached */
2422 thread_id_t tid_to; /* thread to which tid_from should be attached */
2423 int attach; /* is it an attach? */
2424 @END
2427 /* Get input data for a given thread */
2428 @REQ(get_thread_input)
2429 thread_id_t tid; /* id of thread */
2430 @REPLY
2431 user_handle_t focus; /* handle to the focus window */
2432 user_handle_t capture; /* handle to the capture window */
2433 user_handle_t active; /* handle to the active window */
2434 user_handle_t foreground; /* handle to the global foreground window */
2435 user_handle_t menu_owner; /* handle to the menu owner */
2436 user_handle_t move_size; /* handle to the moving/resizing window */
2437 user_handle_t caret; /* handle to the caret window */
2438 rectangle_t rect; /* caret rectangle */
2439 @END
2442 /* Get the time of the last input event */
2443 @REQ(get_last_input_time)
2444 @REPLY
2445 unsigned int time;
2446 @END
2449 /* Retrieve queue keyboard state for a given thread */
2450 @REQ(get_key_state)
2451 thread_id_t tid; /* id of thread */
2452 int key; /* optional key code or -1 */
2453 @REPLY
2454 unsigned char state; /* state of specified key */
2455 VARARG(keystate,bytes); /* state array for all the keys */
2456 @END
2458 /* Set queue keyboard state for a given thread */
2459 @REQ(set_key_state)
2460 thread_id_t tid; /* id of thread */
2461 VARARG(keystate,bytes); /* state array for all the keys */
2462 @END
2464 /* Set the system foreground window */
2465 @REQ(set_foreground_window)
2466 user_handle_t handle; /* handle to the foreground window */
2467 @REPLY
2468 user_handle_t previous; /* handle to the previous foreground window */
2469 int send_msg_old; /* whether we have to send a msg to the old window */
2470 int send_msg_new; /* whether we have to send a msg to the new window */
2471 @END
2473 /* Set the current thread focus window */
2474 @REQ(set_focus_window)
2475 user_handle_t handle; /* handle to the focus window */
2476 @REPLY
2477 user_handle_t previous; /* handle to the previous focus window */
2478 @END
2480 /* Set the current thread active window */
2481 @REQ(set_active_window)
2482 user_handle_t handle; /* handle to the active window */
2483 @REPLY
2484 user_handle_t previous; /* handle to the previous active window */
2485 @END
2487 /* Set the current thread capture window */
2488 @REQ(set_capture_window)
2489 user_handle_t handle; /* handle to the capture window */
2490 unsigned int flags; /* capture flags (see below) */
2491 @REPLY
2492 user_handle_t previous; /* handle to the previous capture window */
2493 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2494 @END
2495 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2496 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2499 /* Set the current thread caret window */
2500 @REQ(set_caret_window)
2501 user_handle_t handle; /* handle to the caret window */
2502 int width; /* caret width */
2503 int height; /* caret height */
2504 @REPLY
2505 user_handle_t previous; /* handle to the previous caret window */
2506 rectangle_t old_rect; /* previous caret rectangle */
2507 int old_hide; /* previous hide count */
2508 int old_state; /* previous caret state (1=on, 0=off) */
2509 @END
2512 /* Set the current thread caret information */
2513 @REQ(set_caret_info)
2514 unsigned int flags; /* caret flags (see below) */
2515 user_handle_t handle; /* handle to the caret window */
2516 int x; /* caret x position */
2517 int y; /* caret y position */
2518 int hide; /* increment for hide count (can be negative to show it) */
2519 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2520 @REPLY
2521 user_handle_t full_handle; /* handle to the current caret window */
2522 rectangle_t old_rect; /* previous caret rectangle */
2523 int old_hide; /* previous hide count */
2524 int old_state; /* previous caret state (1=on, 0=off) */
2525 @END
2526 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2527 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2528 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2531 /* Set a window hook */
2532 @REQ(set_hook)
2533 int id; /* id of the hook */
2534 process_id_t pid; /* id of process to set the hook into */
2535 thread_id_t tid; /* id of thread to set the hook into */
2536 int event_min;
2537 int event_max;
2538 int flags;
2539 void* proc; /* hook procedure */
2540 int unicode; /* is it a unicode hook? */
2541 VARARG(module,unicode_str); /* module name */
2542 @REPLY
2543 user_handle_t handle; /* handle to the hook */
2544 unsigned int active_hooks; /* active hooks bitmap */
2545 @END
2548 /* Remove a window hook */
2549 @REQ(remove_hook)
2550 user_handle_t handle; /* handle to the hook */
2551 int id; /* id of the hook if handle is 0 */
2552 void* proc; /* hook procedure if handle is 0 */
2553 @REPLY
2554 unsigned int active_hooks; /* active hooks bitmap */
2555 @END
2558 /* Start calling a hook chain */
2559 @REQ(start_hook_chain)
2560 int id; /* id of the hook */
2561 int event; /* signalled event */
2562 user_handle_t window; /* handle to the event window */
2563 int object_id; /* object id for out of context winevent */
2564 int child_id; /* child id for out of context winevent */
2565 @REPLY
2566 user_handle_t handle; /* handle to the next hook */
2567 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2568 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2569 void* proc; /* hook procedure */
2570 int unicode; /* is it a unicode hook? */
2571 unsigned int active_hooks; /* active hooks bitmap */
2572 VARARG(module,unicode_str); /* module name */
2573 @END
2576 /* Finished calling a hook chain */
2577 @REQ(finish_hook_chain)
2578 int id; /* id of the hook */
2579 @END
2582 /* Get the hook information */
2583 @REQ(get_hook_info)
2584 user_handle_t handle; /* handle to the current hook */
2585 int get_next; /* do we want info about current or next hook? */
2586 int event; /* signalled event */
2587 user_handle_t window; /* handle to the event window */
2588 int object_id; /* object id for out of context winevent */
2589 int child_id; /* child id for out of context winevent */
2590 @REPLY
2591 user_handle_t handle; /* handle to the hook */
2592 int id; /* id of the hook */
2593 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2594 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2595 void* proc; /* hook procedure */
2596 int unicode; /* is it a unicode hook? */
2597 VARARG(module,unicode_str); /* module name */
2598 @END
2601 /* Create a window class */
2602 @REQ(create_class)
2603 int local; /* is it a local class? */
2604 atom_t atom; /* class atom */
2605 unsigned int style; /* class style */
2606 void* instance; /* module instance */
2607 int extra; /* number of extra class bytes */
2608 int win_extra; /* number of window extra bytes */
2609 void* client_ptr; /* pointer to class in client address space */
2610 @END
2613 /* Destroy a window class */
2614 @REQ(destroy_class)
2615 atom_t atom; /* class atom */
2616 void* instance; /* module instance */
2617 @REPLY
2618 void* client_ptr; /* pointer to class in client address space */
2619 @END
2622 /* Set some information in a class */
2623 @REQ(set_class_info)
2624 user_handle_t window; /* handle to the window */
2625 unsigned int flags; /* flags for info to set (see below) */
2626 atom_t atom; /* class atom */
2627 unsigned int style; /* class style */
2628 int win_extra; /* number of window extra bytes */
2629 void* instance; /* module instance */
2630 int extra_offset; /* offset to set in extra bytes */
2631 data_size_t extra_size; /* size to set in extra bytes */
2632 unsigned long extra_value; /* value to set in extra bytes */
2633 @REPLY
2634 atom_t old_atom; /* previous class atom */
2635 unsigned int old_style; /* previous class style */
2636 int old_extra; /* previous number of class extra bytes */
2637 int old_win_extra; /* previous number of window extra bytes */
2638 void* old_instance; /* previous module instance */
2639 unsigned long old_extra_value; /* old value in extra bytes */
2640 @END
2641 #define SET_CLASS_ATOM 0x0001
2642 #define SET_CLASS_STYLE 0x0002
2643 #define SET_CLASS_WINEXTRA 0x0004
2644 #define SET_CLASS_INSTANCE 0x0008
2645 #define SET_CLASS_EXTRA 0x0010
2648 /* Set/get clipboard information */
2649 @REQ(set_clipboard_info)
2650 unsigned int flags; /* flags for fields to set (see below) */
2651 user_handle_t clipboard; /* clipboard window */
2652 user_handle_t owner; /* clipboard owner */
2653 user_handle_t viewer; /* first clipboard viewer */
2654 unsigned int seqno; /* change sequence number */
2655 @REPLY
2656 unsigned int flags; /* status flags (see below) */
2657 user_handle_t old_clipboard; /* old clipboard window */
2658 user_handle_t old_owner; /* old clipboard owner */
2659 user_handle_t old_viewer; /* old clipboard viewer */
2660 unsigned int seqno; /* current sequence number */
2661 @END
2663 #define SET_CB_OPEN 0x001
2664 #define SET_CB_OWNER 0x002
2665 #define SET_CB_VIEWER 0x004
2666 #define SET_CB_SEQNO 0x008
2667 #define SET_CB_RELOWNER 0x010
2668 #define SET_CB_CLOSE 0x020
2669 #define CB_OPEN 0x040
2670 #define CB_OWNER 0x080
2671 #define CB_PROCESS 0x100
2674 /* Open a security token */
2675 @REQ(open_token)
2676 obj_handle_t handle; /* handle to the thread or process */
2677 unsigned int access; /* access rights to the new token */
2678 unsigned int attributes;/* object attributes */
2679 unsigned int flags; /* flags (see below) */
2680 @REPLY
2681 obj_handle_t token; /* handle to the token */
2682 @END
2683 #define OPEN_TOKEN_THREAD 1
2684 #define OPEN_TOKEN_AS_SELF 2
2687 /* Set/get the global windows */
2688 @REQ(set_global_windows)
2689 unsigned int flags; /* flags for fields to set (see below) */
2690 user_handle_t shell_window; /* handle to the new shell window */
2691 user_handle_t shell_listview; /* handle to the new shell listview window */
2692 user_handle_t progman_window; /* handle to the new program manager window */
2693 user_handle_t taskman_window; /* handle to the new task manager window */
2694 @REPLY
2695 user_handle_t old_shell_window; /* handle to the shell window */
2696 user_handle_t old_shell_listview; /* handle to the shell listview window */
2697 user_handle_t old_progman_window; /* handle to the new program manager window */
2698 user_handle_t old_taskman_window; /* handle to the new task manager window */
2699 @END
2700 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2701 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2702 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2704 /* Adjust the privileges held by a token */
2705 @REQ(adjust_token_privileges)
2706 obj_handle_t handle; /* handle to the token */
2707 int disable_all; /* disable all privileges? */
2708 int get_modified_state; /* get modified privileges? */
2709 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2710 @REPLY
2711 unsigned int len; /* total length in bytes required to store token privileges */
2712 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2713 @END
2715 /* Retrieves the set of privileges held by or available to a token */
2716 @REQ(get_token_privileges)
2717 obj_handle_t handle; /* handle to the token */
2718 @REPLY
2719 unsigned int len; /* total length in bytes required to store token privileges */
2720 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2721 @END
2723 /* Check the token has the required privileges */
2724 @REQ(check_token_privileges)
2725 obj_handle_t handle; /* handle to the token */
2726 int all_required; /* are all the privileges required for the check to succeed? */
2727 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2728 @REPLY
2729 int has_privileges; /* does the token have the required privileges? */
2730 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2731 @END
2733 @REQ(duplicate_token)
2734 obj_handle_t handle; /* handle to the token to duplicate */
2735 unsigned int access; /* access rights to the new token */
2736 unsigned int attributes; /* object attributes */
2737 int primary; /* is the new token to be a primary one? */
2738 int impersonation_level; /* impersonation level of the new token */
2739 @REPLY
2740 obj_handle_t new_handle; /* duplicated handle */
2741 @END
2743 @REQ(access_check)
2744 obj_handle_t handle; /* handle to the token */
2745 unsigned int desired_access; /* desired access to the object */
2746 unsigned int mapping_read; /* mapping from generic read to specific rights */
2747 unsigned int mapping_write; /* mapping from generic write to specific rights */
2748 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2749 unsigned int mapping_all; /* mapping from generic all to specific rights */
2750 VARARG(sd,security_descriptor); /* security descriptor to check */
2751 @REPLY
2752 unsigned int access_granted; /* access rights actually granted */
2753 unsigned int access_status; /* was access granted? */
2754 unsigned int privileges_len; /* length needed to store privileges */
2755 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2756 @END
2758 @REQ(get_token_user)
2759 obj_handle_t handle; /* handle to the token */
2760 @REPLY
2761 data_size_t user_len; /* length needed to store user */
2762 VARARG(user,SID); /* sid of the user the token represents */
2763 @END
2765 @REQ(get_token_groups)
2766 obj_handle_t handle; /* handle to the token */
2767 @REPLY
2768 data_size_t user_len; /* length needed to store user */
2769 VARARG(user,token_groups); /* groups the token's user belongs to */
2770 @END
2772 @REQ(set_security_object)
2773 obj_handle_t handle; /* handle to the object */
2774 unsigned int security_info; /* which parts of security descriptor to set */
2775 VARARG(sd,security_descriptor); /* security descriptor to set */
2776 @END
2778 /* Create a mailslot */
2779 @REQ(create_mailslot)
2780 unsigned int access; /* wanted access rights */
2781 unsigned int attributes; /* object attributes */
2782 obj_handle_t rootdir; /* root directory */
2783 unsigned int max_msgsize;
2784 int read_timeout;
2785 VARARG(name,unicode_str); /* mailslot name */
2786 @REPLY
2787 obj_handle_t handle; /* handle to the mailslot */
2788 @END
2791 /* Set mailslot information */
2792 @REQ(set_mailslot_info)
2793 obj_handle_t handle; /* handle to the mailslot */
2794 unsigned int flags;
2795 int read_timeout;
2796 @REPLY
2797 unsigned int max_msgsize;
2798 int read_timeout;
2799 @END
2800 #define MAILSLOT_SET_READ_TIMEOUT 1
2803 /* Create a directory object */
2804 @REQ(create_directory)
2805 unsigned int access; /* access flags */
2806 unsigned int attributes; /* object attributes */
2807 obj_handle_t rootdir; /* root directory */
2808 VARARG(directory_name,unicode_str); /* Directory name */
2809 @REPLY
2810 obj_handle_t handle; /* handle to the directory */
2811 @END
2814 /* Open a directory object */
2815 @REQ(open_directory)
2816 unsigned int access; /* access flags */
2817 unsigned int attributes; /* object attributes */
2818 obj_handle_t rootdir; /* root directory */
2819 VARARG(directory_name,unicode_str); /* Directory name */
2820 @REPLY
2821 obj_handle_t handle; /* handle to the directory */
2822 @END
2825 /* Create a symbolic link object */
2826 @REQ(create_symlink)
2827 unsigned int access; /* access flags */
2828 unsigned int attributes; /* object attributes */
2829 obj_handle_t rootdir; /* root directory */
2830 data_size_t name_len; /* length of the symlink name in bytes */
2831 VARARG(name,unicode_str,name_len); /* symlink name */
2832 VARARG(target_name,unicode_str); /* target name */
2833 @REPLY
2834 obj_handle_t handle; /* handle to the symlink */
2835 @END
2838 /* Open a symbolic link object */
2839 @REQ(open_symlink)
2840 unsigned int access; /* access flags */
2841 unsigned int attributes; /* object attributes */
2842 obj_handle_t rootdir; /* root directory */
2843 VARARG(name,unicode_str); /* symlink name */
2844 @REPLY
2845 obj_handle_t handle; /* handle to the symlink */
2846 @END
2849 /* Query a symbolic link object */
2850 @REQ(query_symlink)
2851 obj_handle_t handle; /* handle to the symlink */
2852 @REPLY
2853 VARARG(target_name,unicode_str); /* target name */
2854 @END
2857 /* Query basic object information */
2858 @REQ(get_object_info)
2859 obj_handle_t handle; /* handle to the object */
2860 @REPLY
2861 unsigned int access; /* granted access mask */
2862 unsigned int ref_count; /* object ref count */
2863 @END
2865 /* Query the impersonation level of an impersonation token */
2866 @REQ(get_token_impersonation_level)
2867 obj_handle_t handle; /* handle to the object */
2868 @REPLY
2869 int impersonation_level; /* impersonation level of the impersonation token */
2870 @END
2872 /* Allocate a locally-unique identifier */
2873 @REQ(allocate_locally_unique_id)
2874 @REPLY
2875 luid_t luid;
2876 @END