d3d9: Add a LockRect test for DXTn formats.
[wine/gsoc_dplay.git] / server / protocol.def
blobf3175a386cb125cc4bb9c8e24deb9badfa9fe8f3
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 /* structures for extra message data */
177 struct callback_msg_data
179 void *callback; /* callback function */
180 unsigned long data; /* user data for callback */
181 unsigned long result; /* message result */
184 struct winevent_msg_data
186 user_handle_t hook; /* hook handle */
187 thread_id_t tid; /* thread id */
188 void *hook_proc; /* hook proc address */
189 /* followed by module name if any */
192 typedef union
194 unsigned char bytes[1]; /* raw data for sent messages */
195 struct callback_msg_data callback;
196 struct winevent_msg_data winevent;
197 } message_data_t;
199 /* structure for console char/attribute info */
200 typedef struct
202 WCHAR ch;
203 unsigned short attr;
204 } char_info_t;
206 typedef struct
208 unsigned int low_part;
209 int high_part;
210 } luid_t;
212 #define MAX_ACL_LEN 65535
214 struct security_descriptor
216 unsigned int control; /* SE_ flags */
217 data_size_t owner_len;
218 data_size_t group_len;
219 data_size_t sacl_len;
220 data_size_t dacl_len;
221 /* VARARGS(owner,SID); */
222 /* VARARGS(group,SID); */
223 /* VARARGS(sacl,ACL); */
224 /* VARARGS(dacl,ACL); */
227 struct token_groups
229 unsigned int count;
230 /* unsigned int attributes[count]; */
231 /* VARARGS(sids,SID); */
234 enum apc_type
236 APC_NONE,
237 APC_USER,
238 APC_TIMER,
239 APC_ASYNC_IO,
240 APC_VIRTUAL_ALLOC,
241 APC_VIRTUAL_FREE,
242 APC_VIRTUAL_QUERY,
243 APC_VIRTUAL_PROTECT,
244 APC_VIRTUAL_FLUSH,
245 APC_VIRTUAL_LOCK,
246 APC_VIRTUAL_UNLOCK,
247 APC_MAP_VIEW,
248 APC_UNMAP_VIEW,
249 APC_CREATE_THREAD
252 typedef union
254 enum apc_type type;
255 struct
257 enum apc_type type; /* APC_USER */
258 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
259 unsigned long args[3]; /* arguments for user function */
260 } user;
261 struct
263 enum apc_type type; /* APC_TIMER */
264 void (__stdcall *func)(void*, unsigned int, unsigned int);
265 abs_time_t time; /* absolute time of expiration */
266 void *arg; /* user argument */
267 } timer;
268 struct
270 enum apc_type type; /* APC_ASYNC_IO */
271 void (__stdcall *func)(void*, void*, unsigned int);
272 void *user; /* user pointer */
273 void *sb; /* status block */
274 unsigned int status; /* I/O status */
275 } async_io;
276 struct
278 enum apc_type type; /* APC_VIRTUAL_ALLOC */
279 void *addr; /* requested address */
280 unsigned long size; /* allocation size */
281 unsigned int zero_bits; /* allocation alignment */
282 unsigned int op_type; /* type of operation */
283 unsigned int prot; /* memory protection flags */
284 } virtual_alloc;
285 struct
287 enum apc_type type; /* APC_VIRTUAL_FREE */
288 void *addr; /* requested address */
289 unsigned long size; /* allocation size */
290 unsigned int op_type; /* type of operation */
291 } virtual_free;
292 struct
294 enum apc_type type; /* APC_VIRTUAL_QUERY */
295 const void *addr; /* requested address */
296 } virtual_query;
297 struct
299 enum apc_type type; /* APC_VIRTUAL_PROTECT */
300 void *addr; /* requested address */
301 unsigned long size; /* requested address */
302 unsigned int prot; /* new protection flags */
303 } virtual_protect;
304 struct
306 enum apc_type type; /* APC_VIRTUAL_FLUSH */
307 const void *addr; /* requested address */
308 unsigned long size; /* requested address */
309 } virtual_flush;
310 struct
312 enum apc_type type; /* APC_VIRTUAL_LOCK */
313 void *addr; /* requested address */
314 unsigned long size; /* requested address */
315 } virtual_lock;
316 struct
318 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
319 void *addr; /* requested address */
320 unsigned long size; /* requested address */
321 } virtual_unlock;
322 struct
324 enum apc_type type; /* APC_MAP_VIEW */
325 obj_handle_t handle; /* mapping handle */
326 void *addr; /* requested address */
327 unsigned long size; /* allocation size */
328 unsigned int offset_low;/* file offset */
329 unsigned int offset_high;
330 unsigned int zero_bits; /* allocation alignment */
331 unsigned int alloc_type;/* allocation type */
332 unsigned int prot; /* memory protection flags */
333 } map_view;
334 struct
336 enum apc_type type; /* APC_UNMAP_VIEW */
337 void *addr; /* view address */
338 } unmap_view;
339 struct
341 enum apc_type type; /* APC_CREATE_THREAD */
342 void (__stdcall *func)(void*); /* start function */
343 void *arg; /* argument for start function */
344 unsigned long reserve; /* reserve size for thread stack */
345 unsigned long commit; /* commit size for thread stack */
346 int suspend; /* suspended thread? */
347 } create_thread;
348 } apc_call_t;
350 typedef union
352 enum apc_type type;
353 struct
355 enum apc_type type; /* APC_VIRTUAL_ALLOC */
356 unsigned int status; /* status returned by call */
357 void *addr; /* resulting address */
358 unsigned long size; /* resulting size */
359 } virtual_alloc;
360 struct
362 enum apc_type type; /* APC_VIRTUAL_FREE */
363 unsigned int status; /* status returned by call */
364 void *addr; /* resulting address */
365 unsigned long size; /* resulting size */
366 } virtual_free;
367 struct
369 enum apc_type type; /* APC_VIRTUAL_QUERY */
370 unsigned int status; /* status returned by call */
371 void *base; /* resulting base address */
372 void *alloc_base;/* resulting allocation base */
373 unsigned long size; /* resulting region size */
374 unsigned int state; /* resulting region state */
375 unsigned int prot; /* resulting region protection */
376 unsigned int alloc_prot;/* resulting allocation protection */
377 unsigned int alloc_type;/* resulting region allocation type */
378 } virtual_query;
379 struct
381 enum apc_type type; /* APC_VIRTUAL_PROTECT */
382 unsigned int status; /* status returned by call */
383 void *addr; /* resulting address */
384 unsigned long size; /* resulting size */
385 unsigned int prot; /* old protection flags */
386 } virtual_protect;
387 struct
389 enum apc_type type; /* APC_VIRTUAL_FLUSH */
390 unsigned int status; /* status returned by call */
391 const void *addr; /* resulting address */
392 unsigned long size; /* resulting size */
393 } virtual_flush;
394 struct
396 enum apc_type type; /* APC_VIRTUAL_LOCK */
397 unsigned int status; /* status returned by call */
398 void *addr; /* resulting address */
399 unsigned long size; /* resulting size */
400 } virtual_lock;
401 struct
403 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
404 unsigned int status; /* status returned by call */
405 void *addr; /* resulting address */
406 unsigned long size; /* resulting size */
407 } virtual_unlock;
408 struct
410 enum apc_type type; /* APC_MAP_VIEW */
411 unsigned int status; /* status returned by call */
412 void *addr; /* resulting address */
413 unsigned long size; /* resulting size */
414 } map_view;
415 struct
417 enum apc_type type; /* APC_MAP_VIEW */
418 unsigned int status; /* status returned by call */
419 } unmap_view;
420 struct
422 enum apc_type type; /* APC_CREATE_THREAD */
423 unsigned int status; /* status returned by call */
424 thread_id_t tid; /* thread id */
425 obj_handle_t handle; /* handle to new thread */
426 } create_thread;
427 } apc_result_t;
429 /****************************************************************/
430 /* Request declarations */
432 /* Create a new process from the context of the parent */
433 @REQ(new_process)
434 int inherit_all; /* inherit all handles from parent */
435 unsigned int create_flags; /* creation flags */
436 int socket_fd; /* file descriptor for process socket */
437 obj_handle_t exe_file; /* file handle for main exe */
438 obj_handle_t hstdin; /* handle for stdin */
439 obj_handle_t hstdout; /* handle for stdout */
440 obj_handle_t hstderr; /* handle for stderr */
441 unsigned int process_access; /* access rights for process object */
442 unsigned int process_attr; /* attributes for process object */
443 unsigned int thread_access; /* access rights for thread object */
444 unsigned int thread_attr; /* attributes for thread object */
445 VARARG(info,startup_info); /* startup information */
446 VARARG(env,unicode_str); /* environment for new process */
447 @REPLY
448 obj_handle_t info; /* new process info handle */
449 process_id_t pid; /* process id */
450 obj_handle_t phandle; /* process handle (in the current process) */
451 thread_id_t tid; /* thread id */
452 obj_handle_t thandle; /* thread handle (in the current process) */
453 @END
456 /* Retrieve information about a newly started process */
457 @REQ(get_new_process_info)
458 obj_handle_t info; /* info handle returned from new_process_request */
459 @REPLY
460 int success; /* did the process start successfully? */
461 int exit_code; /* process exit code if failed */
462 @END
465 /* Create a new thread from the context of the parent */
466 @REQ(new_thread)
467 unsigned int access; /* wanted access rights */
468 unsigned int attributes; /* object attributes */
469 int suspend; /* new thread should be suspended on creation */
470 int request_fd; /* fd for request pipe */
471 @REPLY
472 thread_id_t tid; /* thread id */
473 obj_handle_t handle; /* thread handle (in the current process) */
474 @END
477 /* Retrieve the new process startup info */
478 @REQ(get_startup_info)
479 @REPLY
480 obj_handle_t exe_file; /* file handle for main exe */
481 obj_handle_t hstdin; /* handle for stdin */
482 obj_handle_t hstdout; /* handle for stdout */
483 obj_handle_t hstderr; /* handle for stderr */
484 VARARG(info,startup_info); /* startup information */
485 VARARG(env,unicode_str); /* environment */
486 @END
489 /* Signal the end of the process initialization */
490 @REQ(init_process_done)
491 void* module; /* main module base address */
492 void* entry; /* process entry point */
493 int gui; /* is it a GUI process? */
494 @END
497 /* Initialize a thread; called from the child after fork()/clone() */
498 @REQ(init_thread)
499 int unix_pid; /* Unix pid of new thread */
500 int unix_tid; /* Unix tid of new thread */
501 int debug_level; /* new debug level */
502 void* teb; /* TEB of new thread (in thread address space) */
503 void* peb; /* address of PEB (in thread address space) */
504 void* entry; /* thread entry point (in thread address space) */
505 void* ldt_copy; /* address of LDT copy (in thread address space) */
506 int reply_fd; /* fd for reply pipe */
507 int wait_fd; /* fd for blocking calls pipe */
508 @REPLY
509 process_id_t pid; /* process id of the new thread's process */
510 thread_id_t tid; /* thread id of the new thread */
511 data_size_t info_size; /* total size of startup info */
512 abs_time_t server_start; /* server start time */
513 int version; /* protocol version */
514 @END
517 /* Terminate a process */
518 @REQ(terminate_process)
519 obj_handle_t handle; /* process handle to terminate */
520 int exit_code; /* process exit code */
521 @REPLY
522 int self; /* suicide? */
523 @END
526 /* Terminate a thread */
527 @REQ(terminate_thread)
528 obj_handle_t handle; /* thread handle to terminate */
529 int exit_code; /* thread exit code */
530 @REPLY
531 int self; /* suicide? */
532 int last; /* last thread in this process? */
533 @END
536 /* Retrieve information about a process */
537 @REQ(get_process_info)
538 obj_handle_t handle; /* process handle */
539 @REPLY
540 process_id_t pid; /* server process id */
541 process_id_t ppid; /* server process id of parent */
542 int exit_code; /* process exit code */
543 int priority; /* priority class */
544 int affinity; /* process affinity mask */
545 void* peb; /* PEB address in process address space */
546 abs_time_t start_time; /* process start time */
547 abs_time_t end_time; /* process end time */
548 @END
551 /* Set a process informations */
552 @REQ(set_process_info)
553 obj_handle_t handle; /* process handle */
554 int mask; /* setting mask (see below) */
555 int priority; /* priority class */
556 int affinity; /* affinity mask */
557 @END
558 #define SET_PROCESS_INFO_PRIORITY 0x01
559 #define SET_PROCESS_INFO_AFFINITY 0x02
562 /* Retrieve information about a thread */
563 @REQ(get_thread_info)
564 obj_handle_t handle; /* thread handle */
565 thread_id_t tid_in; /* thread id (optional) */
566 @REPLY
567 process_id_t pid; /* server process id */
568 thread_id_t tid; /* server thread id */
569 void* teb; /* thread teb pointer */
570 int exit_code; /* thread exit code */
571 int priority; /* thread priority level */
572 int affinity; /* thread affinity mask */
573 abs_time_t creation_time; /* thread creation time */
574 abs_time_t exit_time; /* thread exit time */
575 int last; /* last thread in process */
576 @END
579 /* Set a thread informations */
580 @REQ(set_thread_info)
581 obj_handle_t handle; /* thread handle */
582 int mask; /* setting mask (see below) */
583 int priority; /* priority class */
584 int affinity; /* affinity mask */
585 obj_handle_t token; /* impersonation token */
586 @END
587 #define SET_THREAD_INFO_PRIORITY 0x01
588 #define SET_THREAD_INFO_AFFINITY 0x02
589 #define SET_THREAD_INFO_TOKEN 0x04
592 /* Retrieve information about a module */
593 @REQ(get_dll_info)
594 obj_handle_t handle; /* process handle */
595 void* base_address; /* base address of module */
596 @REPLY
597 size_t size; /* module size */
598 void* entry_point;
599 VARARG(filename,unicode_str); /* file name of module */
600 @END
603 /* Suspend a thread */
604 @REQ(suspend_thread)
605 obj_handle_t handle; /* thread handle */
606 @REPLY
607 int count; /* new suspend count */
608 @END
611 /* Resume a thread */
612 @REQ(resume_thread)
613 obj_handle_t handle; /* thread handle */
614 @REPLY
615 int count; /* new suspend count */
616 @END
619 /* Notify the server that a dll has been loaded */
620 @REQ(load_dll)
621 obj_handle_t handle; /* file handle */
622 void* base; /* base address */
623 size_t size; /* dll size */
624 int dbg_offset; /* debug info offset */
625 int dbg_size; /* debug info size */
626 void* name; /* ptr to ptr to name (in process addr space) */
627 VARARG(filename,unicode_str); /* file name of dll */
628 @END
631 /* Notify the server that a dll is being unloaded */
632 @REQ(unload_dll)
633 void* base; /* base address */
634 @END
637 /* Queue an APC for a thread or process */
638 @REQ(queue_apc)
639 obj_handle_t thread; /* thread handle */
640 obj_handle_t process; /* process handle */
641 apc_call_t call; /* call arguments */
642 @REPLY
643 obj_handle_t handle; /* APC handle */
644 int self; /* run APC in caller itself? */
645 @END
648 /* Get next APC to call */
649 @REQ(get_apc)
650 int alertable; /* is thread alertable? */
651 obj_handle_t prev; /* handle to previous APC */
652 apc_result_t result; /* result of previous APC */
653 @REPLY
654 obj_handle_t handle; /* handle to APC */
655 apc_call_t call; /* call arguments */
656 @END
659 /* Get the result of an APC call */
660 @REQ(get_apc_result)
661 obj_handle_t handle; /* handle to the APC */
662 @REPLY
663 apc_result_t result; /* result of the APC */
664 @END
667 /* Close a handle for the current process */
668 @REQ(close_handle)
669 obj_handle_t handle; /* handle to close */
670 @END
673 /* Set a handle information */
674 @REQ(set_handle_info)
675 obj_handle_t handle; /* handle we are interested in */
676 int flags; /* new handle flags */
677 int mask; /* mask for flags to set */
678 @REPLY
679 int old_flags; /* old flag value */
680 @END
683 /* Duplicate a handle */
684 @REQ(dup_handle)
685 obj_handle_t src_process; /* src process handle */
686 obj_handle_t src_handle; /* src handle to duplicate */
687 obj_handle_t dst_process; /* dst process handle */
688 unsigned int access; /* wanted access rights */
689 unsigned int attributes; /* object attributes */
690 unsigned int options; /* duplicate options (see below) */
691 @REPLY
692 obj_handle_t handle; /* duplicated handle in dst process */
693 int self; /* is the source the current process? */
694 int closed; /* whether the source handle has been closed */
695 @END
696 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
697 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
698 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
701 /* Open a handle to a process */
702 @REQ(open_process)
703 process_id_t pid; /* process id to open */
704 unsigned int access; /* wanted access rights */
705 unsigned int attributes; /* object attributes */
706 @REPLY
707 obj_handle_t handle; /* handle to the process */
708 @END
711 /* Open a handle to a thread */
712 @REQ(open_thread)
713 thread_id_t tid; /* thread id to open */
714 unsigned int access; /* wanted access rights */
715 unsigned int attributes; /* object attributes */
716 @REPLY
717 obj_handle_t handle; /* handle to the thread */
718 @END
721 /* Wait for handles */
722 @REQ(select)
723 int flags; /* wait flags (see below) */
724 void* cookie; /* magic cookie to return to client */
725 obj_handle_t signal; /* object to signal (0 if none) */
726 abs_time_t timeout; /* absolute timeout */
727 VARARG(handles,handles); /* handles to select on */
728 @END
729 #define SELECT_ALL 1
730 #define SELECT_ALERTABLE 2
731 #define SELECT_INTERRUPTIBLE 4
732 #define SELECT_TIMEOUT 8
735 /* Create an event */
736 @REQ(create_event)
737 unsigned int access; /* wanted access rights */
738 unsigned int attributes; /* object attributes */
739 obj_handle_t rootdir; /* root directory */
740 int manual_reset; /* manual reset event */
741 int initial_state; /* initial state of the event */
742 VARARG(name,unicode_str); /* object name */
743 @REPLY
744 obj_handle_t handle; /* handle to the event */
745 @END
747 /* Event operation */
748 @REQ(event_op)
749 obj_handle_t handle; /* handle to event */
750 int op; /* event operation (see below) */
751 @END
752 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
755 /* Open an event */
756 @REQ(open_event)
757 unsigned int access; /* wanted access rights */
758 unsigned int attributes; /* object attributes */
759 obj_handle_t rootdir; /* root directory */
760 VARARG(name,unicode_str); /* object name */
761 @REPLY
762 obj_handle_t handle; /* handle to the event */
763 @END
766 /* Create a mutex */
767 @REQ(create_mutex)
768 unsigned int access; /* wanted access rights */
769 unsigned int attributes; /* object attributes */
770 obj_handle_t rootdir; /* root directory */
771 int owned; /* initially owned? */
772 VARARG(name,unicode_str); /* object name */
773 @REPLY
774 obj_handle_t handle; /* handle to the mutex */
775 @END
778 /* Release a mutex */
779 @REQ(release_mutex)
780 obj_handle_t handle; /* handle to the mutex */
781 @REPLY
782 unsigned int prev_count; /* value of internal counter, before release */
783 @END
786 /* Open a mutex */
787 @REQ(open_mutex)
788 unsigned int access; /* wanted access rights */
789 unsigned int attributes; /* object attributes */
790 obj_handle_t rootdir; /* root directory */
791 VARARG(name,unicode_str); /* object name */
792 @REPLY
793 obj_handle_t handle; /* handle to the mutex */
794 @END
797 /* Create a semaphore */
798 @REQ(create_semaphore)
799 unsigned int access; /* wanted access rights */
800 unsigned int attributes; /* object attributes */
801 obj_handle_t rootdir; /* root directory */
802 unsigned int initial; /* initial count */
803 unsigned int max; /* maximum count */
804 VARARG(name,unicode_str); /* object name */
805 @REPLY
806 obj_handle_t handle; /* handle to the semaphore */
807 @END
810 /* Release a semaphore */
811 @REQ(release_semaphore)
812 obj_handle_t handle; /* handle to the semaphore */
813 unsigned int count; /* count to add to semaphore */
814 @REPLY
815 unsigned int prev_count; /* previous semaphore count */
816 @END
819 /* Open a semaphore */
820 @REQ(open_semaphore)
821 unsigned int access; /* wanted access rights */
822 unsigned int attributes; /* object attributes */
823 obj_handle_t rootdir; /* root directory */
824 VARARG(name,unicode_str); /* object name */
825 @REPLY
826 obj_handle_t handle; /* handle to the semaphore */
827 @END
830 /* Create a file */
831 @REQ(create_file)
832 unsigned int access; /* wanted access rights */
833 unsigned int attributes; /* object attributes */
834 unsigned int sharing; /* sharing flags */
835 int create; /* file create action */
836 unsigned int options; /* file options */
837 unsigned int attrs; /* file attributes for creation */
838 VARARG(filename,string); /* file name */
839 @REPLY
840 obj_handle_t handle; /* handle to the file */
841 @END
844 /* Open a file object */
845 @REQ(open_file_object)
846 unsigned int access; /* wanted access rights */
847 unsigned int attributes; /* open attributes */
848 obj_handle_t rootdir; /* root directory */
849 unsigned int sharing; /* sharing flags */
850 VARARG(filename,unicode_str); /* file name */
851 @REPLY
852 obj_handle_t handle; /* handle to the file */
853 @END
856 /* Allocate a file handle for a Unix fd */
857 @REQ(alloc_file_handle)
858 unsigned int access; /* wanted access rights */
859 unsigned int attributes; /* object attributes */
860 int fd; /* file descriptor on the client side */
861 @REPLY
862 obj_handle_t handle; /* handle to the file */
863 @END
866 /* Get a Unix fd to access a file */
867 @REQ(get_handle_fd)
868 obj_handle_t handle; /* handle to the file */
869 unsigned int access; /* wanted access rights */
870 int cached; /* is it cached on the client already? */
871 @REPLY
872 int type; /* file type (see below) */
873 int flags; /* file read/write flags (see below) */
874 @END
875 enum server_fd_type
877 FD_TYPE_INVALID, /* invalid file (no associated fd) */
878 FD_TYPE_FILE, /* regular file */
879 FD_TYPE_DIR, /* directory */
880 FD_TYPE_SOCKET, /* socket */
881 FD_TYPE_SERIAL, /* serial port */
882 FD_TYPE_PIPE, /* named pipe */
883 FD_TYPE_MAILSLOT, /* mailslot */
884 FD_TYPE_DEVICE, /* Windows device file */
885 FD_TYPE_NB_TYPES
887 #define FD_FLAG_OVERLAPPED 0x01 /* fd opened in overlapped mode */
888 #define FD_FLAG_TIMEOUT 0x02 /* read/write is synchronous */
889 #define FD_FLAG_RECV_SHUTDOWN 0x04
890 #define FD_FLAG_SEND_SHUTDOWN 0x08
891 #define FD_FLAG_AVAILABLE 0x10 /* in overlap read/write operation,
892 * only handle available data (don't wait) */
893 #define FD_FLAG_REMOVABLE 0x20 /* is it on a removable device? */
895 /* Flush a file buffers */
896 @REQ(flush_file)
897 obj_handle_t handle; /* handle to the file */
898 @REPLY
899 obj_handle_t event; /* event set when finished */
900 @END
903 /* Lock a region of a file */
904 @REQ(lock_file)
905 obj_handle_t handle; /* handle to the file */
906 unsigned int offset_low; /* offset of start of lock */
907 unsigned int offset_high; /* offset of start of lock */
908 unsigned int count_low; /* count of bytes to lock */
909 unsigned int count_high; /* count of bytes to lock */
910 int shared; /* shared or exclusive lock? */
911 int wait; /* do we want to wait? */
912 @REPLY
913 obj_handle_t handle; /* handle to wait on */
914 int overlapped; /* is it an overlapped I/O handle? */
915 @END
918 /* Unlock a region of a file */
919 @REQ(unlock_file)
920 obj_handle_t handle; /* handle to the file */
921 unsigned int offset_low; /* offset of start of unlock */
922 unsigned int offset_high; /* offset of start of unlock */
923 unsigned int count_low; /* count of bytes to unlock */
924 unsigned int count_high; /* count of bytes to unlock */
925 @END
928 /* Get ready to unmount a Unix device */
929 @REQ(unmount_device)
930 obj_handle_t handle; /* handle to a file on the device */
931 @END
934 /* Create a socket */
935 @REQ(create_socket)
936 unsigned int access; /* wanted access rights */
937 unsigned int attributes; /* object attributes */
938 int family; /* family, see socket manpage */
939 int type; /* type, see socket manpage */
940 int protocol; /* protocol, see socket manpage */
941 unsigned int flags; /* socket flags */
942 @REPLY
943 obj_handle_t handle; /* handle to the new socket */
944 @END
947 /* Accept a socket */
948 @REQ(accept_socket)
949 obj_handle_t lhandle; /* handle to the listening socket */
950 unsigned int access; /* wanted access rights */
951 unsigned int attributes; /* object attributes */
952 @REPLY
953 obj_handle_t handle; /* handle to the new socket */
954 @END
957 /* Set socket event parameters */
958 @REQ(set_socket_event)
959 obj_handle_t handle; /* handle to the socket */
960 unsigned int mask; /* event mask */
961 obj_handle_t event; /* event object */
962 user_handle_t window; /* window to send the message to */
963 unsigned int msg; /* message to send */
964 @END
967 /* Get socket event parameters */
968 @REQ(get_socket_event)
969 obj_handle_t handle; /* handle to the socket */
970 int service; /* clear pending? */
971 obj_handle_t c_event; /* event to clear */
972 @REPLY
973 unsigned int mask; /* event mask */
974 unsigned int pmask; /* pending events */
975 unsigned int state; /* status bits */
976 VARARG(errors,ints); /* event errors */
977 @END
980 /* Reenable pending socket events */
981 @REQ(enable_socket_event)
982 obj_handle_t handle; /* handle to the socket */
983 unsigned int mask; /* events to re-enable */
984 unsigned int sstate; /* status bits to set */
985 unsigned int cstate; /* status bits to clear */
986 @END
988 @REQ(set_socket_deferred)
989 obj_handle_t handle; /* handle to the socket */
990 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
991 @END
993 /* Allocate a console (only used by a console renderer) */
994 @REQ(alloc_console)
995 unsigned int access; /* wanted access rights */
996 unsigned int attributes; /* object attributes */
997 process_id_t pid; /* pid of process which shall be attached to the console */
998 @REPLY
999 obj_handle_t handle_in; /* handle to console input */
1000 obj_handle_t event; /* handle to renderer events change notification */
1001 @END
1004 /* Free the console of the current process */
1005 @REQ(free_console)
1006 @END
1009 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1010 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1011 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1012 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1013 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1014 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1015 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1016 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1017 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1018 struct console_renderer_event
1020 short event;
1021 union
1023 struct update
1025 short top;
1026 short bottom;
1027 } update;
1028 struct resize
1030 short width;
1031 short height;
1032 } resize;
1033 struct cursor_pos
1035 short x;
1036 short y;
1037 } cursor_pos;
1038 struct cursor_geom
1040 short visible;
1041 short size;
1042 } cursor_geom;
1043 struct display
1045 short left;
1046 short top;
1047 short width;
1048 short height;
1049 } display;
1050 } u;
1053 /* retrieve console events for the renderer */
1054 @REQ(get_console_renderer_events)
1055 obj_handle_t handle; /* handle to console input events */
1056 @REPLY
1057 VARARG(data,bytes); /* the various console_renderer_events */
1058 @END
1061 /* Open a handle to the process console */
1062 @REQ(open_console)
1063 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1064 /* otherwise console_in handle to get active screen buffer? */
1065 unsigned int access; /* wanted access rights */
1066 unsigned int attributes; /* object attributes */
1067 int share; /* share mask (only for output handles) */
1068 @REPLY
1069 obj_handle_t handle; /* handle to the console */
1070 @END
1073 /* Get the input queue wait event */
1074 @REQ(get_console_wait_event)
1075 @REPLY
1076 obj_handle_t handle;
1077 @END
1079 /* Get a console mode (input or output) */
1080 @REQ(get_console_mode)
1081 obj_handle_t handle; /* handle to the console */
1082 @REPLY
1083 int mode; /* console mode */
1084 @END
1087 /* Set a console mode (input or output) */
1088 @REQ(set_console_mode)
1089 obj_handle_t handle; /* handle to the console */
1090 int mode; /* console mode */
1091 @END
1094 /* Set info about a console (input only) */
1095 @REQ(set_console_input_info)
1096 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1097 int mask; /* setting mask (see below) */
1098 obj_handle_t active_sb; /* active screen buffer */
1099 int history_mode; /* whether we duplicate lines in history */
1100 int history_size; /* number of lines in history */
1101 int edition_mode; /* index to the edition mode flavors */
1102 VARARG(title,unicode_str); /* console title */
1103 @END
1104 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1105 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1106 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1107 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1108 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1111 /* Get info about a console (input only) */
1112 @REQ(get_console_input_info)
1113 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1114 @REPLY
1115 int history_mode; /* whether we duplicate lines in history */
1116 int history_size; /* number of lines in history */
1117 int history_index; /* number of used lines in history */
1118 int edition_mode; /* index to the edition mode flavors */
1119 VARARG(title,unicode_str); /* console title */
1120 @END
1123 /* appends a string to console's history */
1124 @REQ(append_console_input_history)
1125 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1126 VARARG(line,unicode_str); /* line to add */
1127 @END
1130 /* appends a string to console's history */
1131 @REQ(get_console_input_history)
1132 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1133 int index; /* index to get line from */
1134 @REPLY
1135 int total; /* total length of line in Unicode chars */
1136 VARARG(line,unicode_str); /* line to add */
1137 @END
1140 /* creates a new screen buffer on process' console */
1141 @REQ(create_console_output)
1142 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1143 unsigned int access; /* wanted access rights */
1144 unsigned int attributes; /* object attributes */
1145 unsigned int share; /* sharing credentials */
1146 @REPLY
1147 obj_handle_t handle_out; /* handle to the screen buffer */
1148 @END
1151 /* Set info about a console (output only) */
1152 @REQ(set_console_output_info)
1153 obj_handle_t handle; /* handle to the console */
1154 int mask; /* setting mask (see below) */
1155 short int cursor_size; /* size of cursor (percentage filled) */
1156 short int cursor_visible;/* cursor visibility flag */
1157 short int cursor_x; /* position of cursor (x, y) */
1158 short int cursor_y;
1159 short int width; /* width of the screen buffer */
1160 short int height; /* height of the screen buffer */
1161 short int attr; /* default attribute */
1162 short int win_left; /* window actually displayed by renderer */
1163 short int win_top; /* the rect area is expressed withing the */
1164 short int win_right; /* boundaries of the screen buffer */
1165 short int win_bottom;
1166 short int max_width; /* maximum size (width x height) for the window */
1167 short int max_height;
1168 @END
1169 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1170 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1171 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1172 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1173 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1174 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1177 /* Get info about a console (output only) */
1178 @REQ(get_console_output_info)
1179 obj_handle_t handle; /* handle to the console */
1180 @REPLY
1181 short int cursor_size; /* size of cursor (percentage filled) */
1182 short int cursor_visible;/* cursor visibility flag */
1183 short int cursor_x; /* position of cursor (x, y) */
1184 short int cursor_y;
1185 short int width; /* width of the screen buffer */
1186 short int height; /* height of the screen buffer */
1187 short int attr; /* default attribute */
1188 short int win_left; /* window actually displayed by renderer */
1189 short int win_top; /* the rect area is expressed withing the */
1190 short int win_right; /* boundaries of the screen buffer */
1191 short int win_bottom;
1192 short int max_width; /* maximum size (width x height) for the window */
1193 short int max_height;
1194 @END
1196 /* Add input records to a console input queue */
1197 @REQ(write_console_input)
1198 obj_handle_t handle; /* handle to the console input */
1199 VARARG(rec,input_records); /* input records */
1200 @REPLY
1201 int written; /* number of records written */
1202 @END
1205 /* Fetch input records from a console input queue */
1206 @REQ(read_console_input)
1207 obj_handle_t handle; /* handle to the console input */
1208 int flush; /* flush the retrieved records from the queue? */
1209 @REPLY
1210 int read; /* number of records read */
1211 VARARG(rec,input_records); /* input records */
1212 @END
1215 /* write data (chars and/or attributes) in a screen buffer */
1216 @REQ(write_console_output)
1217 obj_handle_t handle; /* handle to the console output */
1218 int x; /* position where to start writing */
1219 int y;
1220 int mode; /* char info (see below) */
1221 int wrap; /* wrap around at end of line? */
1222 VARARG(data,bytes); /* info to write */
1223 @REPLY
1224 int written; /* number of char infos actually written */
1225 int width; /* width of screen buffer */
1226 int height; /* height of screen buffer */
1227 @END
1228 enum char_info_mode
1230 CHAR_INFO_MODE_TEXT, /* characters only */
1231 CHAR_INFO_MODE_ATTR, /* attributes only */
1232 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1233 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1237 /* fill a screen buffer with constant data (chars and/or attributes) */
1238 @REQ(fill_console_output)
1239 obj_handle_t handle; /* handle to the console output */
1240 int x; /* position where to start writing */
1241 int y;
1242 int mode; /* char info mode */
1243 int count; /* number to write */
1244 int wrap; /* wrap around at end of line? */
1245 char_info_t data; /* data to write */
1246 @REPLY
1247 int written; /* number of char infos actually written */
1248 @END
1251 /* read data (chars and/or attributes) from a screen buffer */
1252 @REQ(read_console_output)
1253 obj_handle_t handle; /* handle to the console output */
1254 int x; /* position (x,y) where to start reading */
1255 int y;
1256 int mode; /* char info mode */
1257 int wrap; /* wrap around at end of line? */
1258 @REPLY
1259 int width; /* width of screen buffer */
1260 int height; /* height of screen buffer */
1261 VARARG(data,bytes);
1262 @END
1265 /* move a rect (of data) in screen buffer content */
1266 @REQ(move_console_output)
1267 obj_handle_t handle; /* handle to the console output */
1268 short int x_src; /* position (x, y) of rect to start moving from */
1269 short int y_src;
1270 short int x_dst; /* position (x, y) of rect to move to */
1271 short int y_dst;
1272 short int w; /* size of the rect (width, height) to move */
1273 short int h;
1274 @END
1277 /* Sends a signal to a process group */
1278 @REQ(send_console_signal)
1279 int signal; /* the signal to send */
1280 process_id_t group_id; /* the group to send the signal to */
1281 @END
1284 /* enable directory change notifications */
1285 @REQ(read_directory_changes)
1286 unsigned int filter; /* notification filter */
1287 obj_handle_t handle; /* handle to the directory */
1288 obj_handle_t event; /* handle to the event */
1289 int subtree; /* watch the subtree? */
1290 int want_data; /* flag indicating whether change data should be collected */
1291 void* io_apc; /* APC routine to queue upon end of async */
1292 void* io_sb; /* I/O status block (unique across all async on this handle) */
1293 void* io_user; /* data to pass back to caller */
1294 @END
1297 @REQ(read_change)
1298 obj_handle_t handle;
1299 @REPLY
1300 int action; /* type of change */
1301 VARARG(name,string); /* name of directory entry that changed */
1302 @END
1305 /* Create a file mapping */
1306 @REQ(create_mapping)
1307 unsigned int access; /* wanted access rights */
1308 unsigned int attributes; /* object attributes */
1309 obj_handle_t rootdir; /* root directory */
1310 int size_high; /* mapping size */
1311 int size_low; /* mapping size */
1312 int protect; /* protection flags (see below) */
1313 obj_handle_t file_handle; /* file handle */
1314 VARARG(name,unicode_str); /* object name */
1315 @REPLY
1316 obj_handle_t handle; /* handle to the mapping */
1317 @END
1318 /* protection flags */
1319 #define VPROT_READ 0x01
1320 #define VPROT_WRITE 0x02
1321 #define VPROT_EXEC 0x04
1322 #define VPROT_WRITECOPY 0x08
1323 #define VPROT_GUARD 0x10
1324 #define VPROT_NOCACHE 0x20
1325 #define VPROT_COMMITTED 0x40
1326 #define VPROT_IMAGE 0x80
1329 /* Open a mapping */
1330 @REQ(open_mapping)
1331 unsigned int access; /* wanted access rights */
1332 unsigned int attributes; /* object attributes */
1333 obj_handle_t rootdir; /* root directory */
1334 VARARG(name,unicode_str); /* object name */
1335 @REPLY
1336 obj_handle_t handle; /* handle to the mapping */
1337 @END
1340 /* Get information about a file mapping */
1341 @REQ(get_mapping_info)
1342 obj_handle_t handle; /* handle to the mapping */
1343 @REPLY
1344 int size_high; /* mapping size */
1345 int size_low; /* mapping size */
1346 int protect; /* protection flags */
1347 int header_size; /* header size (for VPROT_IMAGE mapping) */
1348 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1349 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1350 obj_handle_t shared_file; /* shared mapping file handle */
1351 int shared_size; /* shared mapping size */
1352 @END
1355 #define SNAP_HEAPLIST 0x00000001
1356 #define SNAP_PROCESS 0x00000002
1357 #define SNAP_THREAD 0x00000004
1358 #define SNAP_MODULE 0x00000008
1359 /* Create a snapshot */
1360 @REQ(create_snapshot)
1361 unsigned int attributes; /* object attributes */
1362 int flags; /* snapshot flags (SNAP_*) */
1363 process_id_t pid; /* process id */
1364 @REPLY
1365 obj_handle_t handle; /* handle to the snapshot */
1366 @END
1369 /* Get the next process from a snapshot */
1370 @REQ(next_process)
1371 obj_handle_t handle; /* handle to the snapshot */
1372 int reset; /* reset snapshot position? */
1373 @REPLY
1374 int count; /* process usage count */
1375 process_id_t pid; /* process id */
1376 process_id_t ppid; /* parent process id */
1377 void* heap; /* heap base */
1378 void* module; /* main module */
1379 int threads; /* number of threads */
1380 int priority; /* process priority */
1381 int handles; /* number of handles */
1382 VARARG(filename,unicode_str); /* file name of main exe */
1383 @END
1386 /* Get the next thread from a snapshot */
1387 @REQ(next_thread)
1388 obj_handle_t handle; /* handle to the snapshot */
1389 int reset; /* reset snapshot position? */
1390 @REPLY
1391 int count; /* thread usage count */
1392 process_id_t pid; /* process id */
1393 thread_id_t tid; /* thread id */
1394 int base_pri; /* base priority */
1395 int delta_pri; /* delta priority */
1396 @END
1399 /* Get the next module from a snapshot */
1400 @REQ(next_module)
1401 obj_handle_t handle; /* handle to the snapshot */
1402 int reset; /* reset snapshot position? */
1403 @REPLY
1404 process_id_t pid; /* process id */
1405 void* base; /* module base address */
1406 size_t size; /* module size */
1407 VARARG(filename,unicode_str); /* file name of module */
1408 @END
1411 /* Wait for a debug event */
1412 @REQ(wait_debug_event)
1413 int get_handle; /* should we alloc a handle for waiting? */
1414 @REPLY
1415 process_id_t pid; /* process id */
1416 thread_id_t tid; /* thread id */
1417 obj_handle_t wait; /* wait handle if no event ready */
1418 VARARG(event,debug_event); /* debug event data */
1419 @END
1422 /* Queue an exception event */
1423 @REQ(queue_exception_event)
1424 int first; /* first chance exception? */
1425 VARARG(record,exc_event); /* thread context followed by exception record */
1426 @REPLY
1427 obj_handle_t handle; /* handle to the queued event */
1428 @END
1431 /* Retrieve the status of an exception event */
1432 @REQ(get_exception_status)
1433 obj_handle_t handle; /* handle to the queued event */
1434 @REPLY
1435 VARARG(context,context); /* modified thread context */
1436 @END
1439 /* Send an output string to the debugger */
1440 @REQ(output_debug_string)
1441 void* string; /* string to display (in debugged process address space) */
1442 int unicode; /* is it Unicode? */
1443 int length; /* string length */
1444 @END
1447 /* Continue a debug event */
1448 @REQ(continue_debug_event)
1449 process_id_t pid; /* process id to continue */
1450 thread_id_t tid; /* thread id to continue */
1451 int status; /* continuation status */
1452 @END
1455 /* Start/stop debugging an existing process */
1456 @REQ(debug_process)
1457 process_id_t pid; /* id of the process to debug */
1458 int attach; /* 1=attaching / 0=detaching from the process */
1459 @END
1462 /* Simulate a breakpoint in a process */
1463 @REQ(debug_break)
1464 obj_handle_t handle; /* process handle */
1465 @REPLY
1466 int self; /* was it the caller itself? */
1467 @END
1470 /* Set debugger kill on exit flag */
1471 @REQ(set_debugger_kill_on_exit)
1472 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1473 @END
1476 /* Read data from a process address space */
1477 @REQ(read_process_memory)
1478 obj_handle_t handle; /* process handle */
1479 void* addr; /* addr to read from */
1480 @REPLY
1481 VARARG(data,bytes); /* result data */
1482 @END
1485 /* Write data to a process address space */
1486 @REQ(write_process_memory)
1487 obj_handle_t handle; /* process handle */
1488 void* addr; /* addr to write to */
1489 VARARG(data,bytes); /* data to write */
1490 @END
1493 /* Create a registry key */
1494 @REQ(create_key)
1495 obj_handle_t parent; /* handle to the parent key */
1496 unsigned int access; /* desired access rights */
1497 unsigned int attributes; /* object attributes */
1498 unsigned int options; /* creation options */
1499 time_t modif; /* last modification time */
1500 data_size_t namelen; /* length of key name in bytes */
1501 VARARG(name,unicode_str,namelen); /* key name */
1502 VARARG(class,unicode_str); /* class name */
1503 @REPLY
1504 obj_handle_t hkey; /* handle to the created key */
1505 int created; /* has it been newly created? */
1506 @END
1508 /* Open a registry key */
1509 @REQ(open_key)
1510 obj_handle_t parent; /* handle to the parent key */
1511 unsigned int access; /* desired access rights */
1512 unsigned int attributes; /* object attributes */
1513 VARARG(name,unicode_str); /* key name */
1514 @REPLY
1515 obj_handle_t hkey; /* handle to the open key */
1516 @END
1519 /* Delete a registry key */
1520 @REQ(delete_key)
1521 obj_handle_t hkey; /* handle to the key */
1522 @END
1525 /* Flush a registry key */
1526 @REQ(flush_key)
1527 obj_handle_t hkey; /* handle to the key */
1528 @END
1531 /* Enumerate registry subkeys */
1532 @REQ(enum_key)
1533 obj_handle_t hkey; /* handle to registry key */
1534 int index; /* index of subkey (or -1 for current key) */
1535 int info_class; /* requested information class */
1536 @REPLY
1537 int subkeys; /* number of subkeys */
1538 int max_subkey; /* longest subkey name */
1539 int max_class; /* longest class name */
1540 int values; /* number of values */
1541 int max_value; /* longest value name */
1542 int max_data; /* longest value data */
1543 time_t modif; /* last modification time */
1544 data_size_t total; /* total length needed for full name and class */
1545 data_size_t namelen; /* length of key name in bytes */
1546 VARARG(name,unicode_str,namelen); /* key name */
1547 VARARG(class,unicode_str); /* class name */
1548 @END
1551 /* Set a value of a registry key */
1552 @REQ(set_key_value)
1553 obj_handle_t hkey; /* handle to registry key */
1554 int type; /* value type */
1555 data_size_t namelen; /* length of value name in bytes */
1556 VARARG(name,unicode_str,namelen); /* value name */
1557 VARARG(data,bytes); /* value data */
1558 @END
1561 /* Retrieve the value of a registry key */
1562 @REQ(get_key_value)
1563 obj_handle_t hkey; /* handle to registry key */
1564 VARARG(name,unicode_str); /* value name */
1565 @REPLY
1566 int type; /* value type */
1567 data_size_t total; /* total length needed for data */
1568 VARARG(data,bytes); /* value data */
1569 @END
1572 /* Enumerate a value of a registry key */
1573 @REQ(enum_key_value)
1574 obj_handle_t hkey; /* handle to registry key */
1575 int index; /* value index */
1576 int info_class; /* requested information class */
1577 @REPLY
1578 int type; /* value type */
1579 data_size_t total; /* total length needed for full name and data */
1580 data_size_t namelen; /* length of value name in bytes */
1581 VARARG(name,unicode_str,namelen); /* value name */
1582 VARARG(data,bytes); /* value data */
1583 @END
1586 /* Delete a value of a registry key */
1587 @REQ(delete_key_value)
1588 obj_handle_t hkey; /* handle to registry key */
1589 VARARG(name,unicode_str); /* value name */
1590 @END
1593 /* Load a registry branch from a file */
1594 @REQ(load_registry)
1595 obj_handle_t hkey; /* root key to load to */
1596 obj_handle_t file; /* file to load from */
1597 VARARG(name,unicode_str); /* subkey name */
1598 @END
1601 /* UnLoad a registry branch from a file */
1602 @REQ(unload_registry)
1603 obj_handle_t hkey; /* root key to unload to */
1604 @END
1607 /* Save a registry branch to a file */
1608 @REQ(save_registry)
1609 obj_handle_t hkey; /* key to save */
1610 obj_handle_t file; /* file to save to */
1611 @END
1614 /* Add a registry key change notification */
1615 @REQ(set_registry_notification)
1616 obj_handle_t hkey; /* key to watch for changes */
1617 obj_handle_t event; /* event to set */
1618 int subtree; /* should we watch the whole subtree? */
1619 unsigned int filter; /* things to watch */
1620 @END
1623 /* Create a waitable timer */
1624 @REQ(create_timer)
1625 unsigned int access; /* wanted access rights */
1626 unsigned int attributes; /* object attributes */
1627 obj_handle_t rootdir; /* root directory */
1628 int manual; /* manual reset */
1629 VARARG(name,unicode_str); /* object name */
1630 @REPLY
1631 obj_handle_t handle; /* handle to the timer */
1632 @END
1635 /* Open a waitable timer */
1636 @REQ(open_timer)
1637 unsigned int access; /* wanted access rights */
1638 unsigned int attributes; /* object attributes */
1639 obj_handle_t rootdir; /* root directory */
1640 VARARG(name,unicode_str); /* object name */
1641 @REPLY
1642 obj_handle_t handle; /* handle to the timer */
1643 @END
1645 /* Set a waitable timer */
1646 @REQ(set_timer)
1647 obj_handle_t handle; /* handle to the timer */
1648 abs_time_t expire; /* next expiration absolute time */
1649 int period; /* timer period in ms */
1650 void* callback; /* callback function */
1651 void* arg; /* callback argument */
1652 @REPLY
1653 int signaled; /* was the timer signaled before this call ? */
1654 @END
1656 /* Cancel a waitable timer */
1657 @REQ(cancel_timer)
1658 obj_handle_t handle; /* handle to the timer */
1659 @REPLY
1660 int signaled; /* was the timer signaled before this calltime ? */
1661 @END
1663 /* Get information on a waitable timer */
1664 @REQ(get_timer_info)
1665 obj_handle_t handle; /* handle to the timer */
1666 @REPLY
1667 abs_time_t when; /* absolute time when the timer next expires */
1668 int signaled; /* is the timer signaled? */
1669 @END
1672 /* Retrieve the current context of a thread */
1673 @REQ(get_thread_context)
1674 obj_handle_t handle; /* thread handle */
1675 unsigned int flags; /* context flags */
1676 int suspend; /* if getting context during suspend */
1677 @REPLY
1678 int self; /* was it a handle to the current thread? */
1679 VARARG(context,context); /* thread context */
1680 @END
1683 /* Set the current context of a thread */
1684 @REQ(set_thread_context)
1685 obj_handle_t handle; /* thread handle */
1686 unsigned int flags; /* context flags */
1687 int suspend; /* if setting context during suspend */
1688 VARARG(context,context); /* thread context */
1689 @REPLY
1690 int self; /* was it a handle to the current thread? */
1691 @END
1694 /* Fetch a selector entry for a thread */
1695 @REQ(get_selector_entry)
1696 obj_handle_t handle; /* thread handle */
1697 int entry; /* LDT entry */
1698 @REPLY
1699 unsigned int base; /* selector base */
1700 unsigned int limit; /* selector limit */
1701 unsigned char flags; /* selector flags */
1702 @END
1705 /* Add an atom */
1706 @REQ(add_atom)
1707 obj_handle_t table; /* which table to add atom to */
1708 VARARG(name,unicode_str); /* atom name */
1709 @REPLY
1710 atom_t atom; /* resulting atom */
1711 @END
1714 /* Delete an atom */
1715 @REQ(delete_atom)
1716 obj_handle_t table; /* which table to delete atom from */
1717 atom_t atom; /* atom handle */
1718 @END
1721 /* Find an atom */
1722 @REQ(find_atom)
1723 obj_handle_t table; /* which table to find atom from */
1724 VARARG(name,unicode_str); /* atom name */
1725 @REPLY
1726 atom_t atom; /* atom handle */
1727 @END
1730 /* Get information about an atom */
1731 @REQ(get_atom_information)
1732 obj_handle_t table; /* which table to find atom from */
1733 atom_t atom; /* atom handle */
1734 @REPLY
1735 int count; /* atom lock count */
1736 int pinned; /* whether the atom has been pinned */
1737 data_size_t total; /* actual length of atom name */
1738 VARARG(name,unicode_str); /* atom name */
1739 @END
1742 /* Set information about an atom */
1743 @REQ(set_atom_information)
1744 obj_handle_t table; /* which table to find atom from */
1745 atom_t atom; /* atom handle */
1746 int pinned; /* whether to bump atom information */
1747 @END
1750 /* Empty an atom table */
1751 @REQ(empty_atom_table)
1752 obj_handle_t table; /* which table to find atom from */
1753 int if_pinned; /* whether to delete pinned atoms */
1754 @END
1757 /* Init an atom table */
1758 @REQ(init_atom_table)
1759 int entries; /* number of entries (only for local) */
1760 @REPLY
1761 obj_handle_t table; /* handle to the atom table */
1762 @END
1765 /* Get the message queue of the current thread */
1766 @REQ(get_msg_queue)
1767 @REPLY
1768 obj_handle_t handle; /* handle to the queue */
1769 @END
1772 /* Set the current message queue wakeup mask */
1773 @REQ(set_queue_mask)
1774 unsigned int wake_mask; /* wakeup bits mask */
1775 unsigned int changed_mask; /* changed bits mask */
1776 int skip_wait; /* will we skip waiting if signaled? */
1777 @REPLY
1778 unsigned int wake_bits; /* current wake bits */
1779 unsigned int changed_bits; /* current changed bits */
1780 @END
1783 /* Get the current message queue status */
1784 @REQ(get_queue_status)
1785 int clear; /* should we clear the change bits? */
1786 @REPLY
1787 unsigned int wake_bits; /* wake bits */
1788 unsigned int changed_bits; /* changed bits since last time */
1789 @END
1792 /* Retrieve the process idle event */
1793 @REQ(get_process_idle_event)
1794 obj_handle_t handle; /* process handle */
1795 @REPLY
1796 obj_handle_t event; /* handle to idle event */
1797 @END
1800 /* Send a message to a thread queue */
1801 @REQ(send_message)
1802 thread_id_t id; /* thread id */
1803 int type; /* message type (see below) */
1804 int flags; /* message flags (see below) */
1805 user_handle_t win; /* window handle */
1806 unsigned int msg; /* message code */
1807 unsigned long wparam; /* parameters */
1808 unsigned long lparam; /* parameters */
1809 int timeout; /* timeout for reply */
1810 VARARG(data,message_data); /* message data for sent messages */
1811 @END
1813 @REQ(post_quit_message)
1814 int exit_code; /* exit code to return */
1815 @END
1817 enum message_type
1819 MSG_ASCII, /* Ascii message (from SendMessageA) */
1820 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1821 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1822 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1823 MSG_CALLBACK_RESULT,/* result of a callback message */
1824 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1825 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1826 MSG_HARDWARE, /* hardware message */
1827 MSG_WINEVENT /* winevent message */
1829 #define SEND_MSG_ABORT_IF_HUNG 0x01
1832 /* Send a hardware message to a thread queue */
1833 @REQ(send_hardware_message)
1834 thread_id_t id; /* thread id */
1835 user_handle_t win; /* window handle */
1836 unsigned int msg; /* message code */
1837 unsigned int time; /* message time */
1838 unsigned long wparam; /* parameters */
1839 unsigned long lparam; /* parameters */
1840 unsigned long info; /* extra info */
1841 int x; /* x position */
1842 int y; /* y position */
1843 @END
1846 /* Get a message from the current queue */
1847 @REQ(get_message)
1848 unsigned int flags; /* PM_* flags */
1849 user_handle_t get_win; /* window handle to get */
1850 unsigned int get_first; /* first message code to get */
1851 unsigned int get_last; /* last message code to get */
1852 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1853 @REPLY
1854 user_handle_t win; /* window handle */
1855 int type; /* message type */
1856 unsigned int msg; /* message code */
1857 unsigned long wparam; /* parameters */
1858 unsigned long lparam; /* parameters */
1859 unsigned long info; /* extra info */
1860 int x; /* x position */
1861 int y; /* y position */
1862 unsigned int time; /* message time */
1863 unsigned int hw_id; /* id if hardware message */
1864 unsigned int active_hooks; /* active hooks bitmap */
1865 data_size_t total; /* total size of extra data */
1866 VARARG(data,message_data); /* message data for sent messages */
1867 @END
1870 /* Reply to a sent message */
1871 @REQ(reply_message)
1872 unsigned int result; /* message result */
1873 int remove; /* should we remove the message? */
1874 VARARG(data,bytes); /* message data for sent messages */
1875 @END
1878 /* Accept the current hardware message */
1879 @REQ(accept_hardware_message)
1880 unsigned int hw_id; /* id of the hardware message */
1881 int remove; /* should we remove the message? */
1882 user_handle_t new_win; /* new destination window for current message */
1883 @END
1886 /* Retrieve the reply for the last message sent */
1887 @REQ(get_message_reply)
1888 int cancel; /* cancel message if not ready? */
1889 @REPLY
1890 unsigned int result; /* message result */
1891 VARARG(data,bytes); /* message data for sent messages */
1892 @END
1895 /* Set a window timer */
1896 @REQ(set_win_timer)
1897 user_handle_t win; /* window handle */
1898 unsigned int msg; /* message to post */
1899 unsigned int rate; /* timer rate in ms */
1900 unsigned long id; /* timer id */
1901 unsigned long lparam; /* message lparam (callback proc) */
1902 @REPLY
1903 unsigned long id; /* timer id */
1904 @END
1907 /* Kill a window timer */
1908 @REQ(kill_win_timer)
1909 user_handle_t win; /* window handle */
1910 unsigned int msg; /* message to post */
1911 unsigned long id; /* timer id */
1912 @END
1915 /* Retrieve info about a serial port */
1916 @REQ(get_serial_info)
1917 obj_handle_t handle; /* handle to comm port */
1918 @REPLY
1919 unsigned int readinterval;
1920 unsigned int readconst;
1921 unsigned int readmult;
1922 unsigned int writeconst;
1923 unsigned int writemult;
1924 unsigned int eventmask;
1925 @END
1928 /* Set info about a serial port */
1929 @REQ(set_serial_info)
1930 obj_handle_t handle; /* handle to comm port */
1931 int flags; /* bitmask to set values (see below) */
1932 unsigned int readinterval;
1933 unsigned int readconst;
1934 unsigned int readmult;
1935 unsigned int writeconst;
1936 unsigned int writemult;
1937 unsigned int eventmask;
1938 @END
1939 #define SERIALINFO_SET_TIMEOUTS 0x01
1940 #define SERIALINFO_SET_MASK 0x02
1943 /* Create an async I/O */
1944 @REQ(register_async)
1945 obj_handle_t handle; /* handle to comm port, socket or file */
1946 int type; /* type of queue to look after */
1947 void* io_apc; /* APC routine to queue upon end of async */
1948 void* io_sb; /* I/O status block (unique across all async on this handle) */
1949 void* io_user; /* data to pass back to caller */
1950 int count; /* count - usually # of bytes to be read/written */
1951 @END
1952 #define ASYNC_TYPE_READ 0x01
1953 #define ASYNC_TYPE_WRITE 0x02
1954 #define ASYNC_TYPE_WAIT 0x03
1957 /* Cancel all async op on a fd */
1958 @REQ(cancel_async)
1959 obj_handle_t handle; /* handle to comm port, socket or file */
1960 @END
1963 /* Create a named pipe */
1964 @REQ(create_named_pipe)
1965 unsigned int access;
1966 unsigned int attributes; /* object attributes */
1967 obj_handle_t rootdir; /* root directory */
1968 unsigned int options;
1969 unsigned int flags;
1970 unsigned int maxinstances;
1971 unsigned int outsize;
1972 unsigned int insize;
1973 unsigned int timeout;
1974 VARARG(name,unicode_str); /* pipe name */
1975 @REPLY
1976 obj_handle_t handle; /* handle to the pipe */
1977 @END
1979 /* flags in create_named_pipe and get_named_pipe_info */
1980 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1981 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
1982 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
1983 #define NAMED_PIPE_SERVER_END 0x8000
1985 /* Open an existing named pipe */
1986 @REQ(open_named_pipe)
1987 unsigned int access;
1988 unsigned int attributes; /* object attributes */
1989 obj_handle_t rootdir; /* root directory */
1990 unsigned int flags; /* file flags */
1991 VARARG(name,unicode_str); /* pipe name */
1992 @REPLY
1993 obj_handle_t handle; /* handle to the pipe */
1994 @END
1997 /* Connect to a named pipe */
1998 @REQ(connect_named_pipe)
1999 obj_handle_t handle;
2000 obj_handle_t event;
2001 void* func;
2002 @END
2005 /* Wait for a named pipe */
2006 @REQ(wait_named_pipe)
2007 obj_handle_t handle;
2008 unsigned int timeout;
2009 obj_handle_t event;
2010 void* func;
2011 VARARG(name,unicode_str); /* pipe name */
2012 @END
2015 /* Disconnect a named pipe */
2016 @REQ(disconnect_named_pipe)
2017 obj_handle_t handle;
2018 @END
2021 @REQ(get_named_pipe_info)
2022 obj_handle_t handle;
2023 @REPLY
2024 unsigned int flags;
2025 unsigned int maxinstances;
2026 unsigned int instances;
2027 unsigned int outsize;
2028 unsigned int insize;
2029 @END
2032 /* Create a window */
2033 @REQ(create_window)
2034 user_handle_t parent; /* parent window */
2035 user_handle_t owner; /* owner window */
2036 atom_t atom; /* class atom */
2037 void* instance; /* module instance */
2038 @REPLY
2039 user_handle_t handle; /* created window */
2040 user_handle_t parent; /* full handle of parent */
2041 user_handle_t owner; /* full handle of owner */
2042 int extra; /* number of extra bytes */
2043 void* class_ptr; /* pointer to class in client address space */
2044 @END
2047 /* Destroy a window */
2048 @REQ(destroy_window)
2049 user_handle_t handle; /* handle to the window */
2050 @END
2053 /* Retrieve the desktop window for the current thread */
2054 @REQ(get_desktop_window)
2055 int force; /* force creation if it doesn't exist */
2056 @REPLY
2057 user_handle_t handle; /* handle to the desktop window */
2058 @END
2061 /* Set a window owner */
2062 @REQ(set_window_owner)
2063 user_handle_t handle; /* handle to the window */
2064 user_handle_t owner; /* new owner */
2065 @REPLY
2066 user_handle_t full_owner; /* full handle of new owner */
2067 user_handle_t prev_owner; /* full handle of previous owner */
2068 @END
2071 /* Get information from a window handle */
2072 @REQ(get_window_info)
2073 user_handle_t handle; /* handle to the window */
2074 @REPLY
2075 user_handle_t full_handle; /* full 32-bit handle */
2076 user_handle_t last_active; /* last active popup */
2077 process_id_t pid; /* process owning the window */
2078 thread_id_t tid; /* thread owning the window */
2079 atom_t atom; /* class atom */
2080 int is_unicode; /* ANSI or unicode */
2081 @END
2084 /* Set some information in a window */
2085 @REQ(set_window_info)
2086 unsigned int flags; /* flags for fields to set (see below) */
2087 user_handle_t handle; /* handle to the window */
2088 unsigned int style; /* window style */
2089 unsigned int ex_style; /* window extended style */
2090 unsigned int id; /* window id */
2091 int is_unicode; /* ANSI or unicode */
2092 void* instance; /* creator instance */
2093 unsigned long user_data; /* user-specific data */
2094 int extra_offset; /* offset to set in extra bytes */
2095 data_size_t extra_size; /* size to set in extra bytes */
2096 unsigned long extra_value; /* value to set in extra bytes */
2097 @REPLY
2098 unsigned int old_style; /* old window style */
2099 unsigned int old_ex_style; /* old window extended style */
2100 unsigned int old_id; /* old window id */
2101 void* old_instance; /* old creator instance */
2102 unsigned long old_user_data; /* old user-specific data */
2103 unsigned long old_extra_value; /* old value in extra bytes */
2104 @END
2105 #define SET_WIN_STYLE 0x01
2106 #define SET_WIN_EXSTYLE 0x02
2107 #define SET_WIN_ID 0x04
2108 #define SET_WIN_INSTANCE 0x08
2109 #define SET_WIN_USERDATA 0x10
2110 #define SET_WIN_EXTRA 0x20
2111 #define SET_WIN_UNICODE 0x40
2114 /* Set the parent of a window */
2115 @REQ(set_parent)
2116 user_handle_t handle; /* handle to the window */
2117 user_handle_t parent; /* handle to the parent */
2118 @REPLY
2119 user_handle_t old_parent; /* old parent window */
2120 user_handle_t full_parent; /* full handle of new parent */
2121 @END
2124 /* Get a list of the window parents, up to the root of the tree */
2125 @REQ(get_window_parents)
2126 user_handle_t handle; /* handle to the window */
2127 @REPLY
2128 int count; /* total count of parents */
2129 VARARG(parents,user_handles); /* parent handles */
2130 @END
2133 /* Get a list of the window children */
2134 @REQ(get_window_children)
2135 user_handle_t parent; /* parent window */
2136 atom_t atom; /* class atom for the listed children */
2137 thread_id_t tid; /* thread owning the listed children */
2138 @REPLY
2139 int count; /* total count of children */
2140 VARARG(children,user_handles); /* children handles */
2141 @END
2144 /* Get a list of the window children that contain a given point */
2145 @REQ(get_window_children_from_point)
2146 user_handle_t parent; /* parent window */
2147 int x; /* point in parent coordinates */
2148 int y;
2149 @REPLY
2150 int count; /* total count of children */
2151 VARARG(children,user_handles); /* children handles */
2152 @END
2155 /* Get window tree information from a window handle */
2156 @REQ(get_window_tree)
2157 user_handle_t handle; /* handle to the window */
2158 @REPLY
2159 user_handle_t parent; /* parent window */
2160 user_handle_t owner; /* owner window */
2161 user_handle_t next_sibling; /* next sibling in Z-order */
2162 user_handle_t prev_sibling; /* prev sibling in Z-order */
2163 user_handle_t first_sibling; /* first sibling in Z-order */
2164 user_handle_t last_sibling; /* last sibling in Z-order */
2165 user_handle_t first_child; /* first child */
2166 user_handle_t last_child; /* last child */
2167 @END
2169 /* Set the position and Z order of a window */
2170 @REQ(set_window_pos)
2171 unsigned int flags; /* SWP_* flags */
2172 user_handle_t handle; /* handle to the window */
2173 user_handle_t previous; /* previous window in Z order */
2174 rectangle_t window; /* window rectangle */
2175 rectangle_t client; /* client rectangle */
2176 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
2177 @REPLY
2178 unsigned int new_style; /* new window style */
2179 @END
2182 /* Get the window and client rectangles of a window */
2183 @REQ(get_window_rectangles)
2184 user_handle_t handle; /* handle to the window */
2185 @REPLY
2186 rectangle_t window; /* window rectangle */
2187 rectangle_t visible; /* visible part of the window rectangle */
2188 rectangle_t client; /* client rectangle */
2189 @END
2192 /* Get the window text */
2193 @REQ(get_window_text)
2194 user_handle_t handle; /* handle to the window */
2195 @REPLY
2196 VARARG(text,unicode_str); /* window text */
2197 @END
2200 /* Set the window text */
2201 @REQ(set_window_text)
2202 user_handle_t handle; /* handle to the window */
2203 VARARG(text,unicode_str); /* window text */
2204 @END
2207 /* Get the coordinates offset between two windows */
2208 @REQ(get_windows_offset)
2209 user_handle_t from; /* handle to the first window */
2210 user_handle_t to; /* handle to the second window */
2211 @REPLY
2212 int x; /* x coordinate offset */
2213 int y; /* y coordinate offset */
2214 @END
2217 /* Get the visible region of a window */
2218 @REQ(get_visible_region)
2219 user_handle_t window; /* handle to the window */
2220 unsigned int flags; /* DCX flags */
2221 @REPLY
2222 user_handle_t top_win; /* top window to clip against */
2223 rectangle_t top_rect; /* top window visible rect with screen coords */
2224 rectangle_t win_rect; /* window rect in screen coords */
2225 data_size_t total_size; /* total size of the resulting region */
2226 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2227 @END
2230 /* Get the window region */
2231 @REQ(get_window_region)
2232 user_handle_t window; /* handle to the window */
2233 @REPLY
2234 data_size_t total_size; /* total size of the resulting region */
2235 VARARG(region,rectangles); /* list of rectangles for the region */
2236 @END
2239 /* Set the window region */
2240 @REQ(set_window_region)
2241 user_handle_t window; /* handle to the window */
2242 int redraw; /* redraw the window? */
2243 VARARG(region,rectangles); /* list of rectangles for the region */
2244 @END
2247 /* Get the window update region */
2248 @REQ(get_update_region)
2249 user_handle_t window; /* handle to the window */
2250 user_handle_t from_child; /* child to start searching from */
2251 unsigned int flags; /* update flags (see below) */
2252 @REPLY
2253 user_handle_t child; /* child to repaint (or window itself) */
2254 unsigned int flags; /* resulting update flags (see below) */
2255 data_size_t total_size; /* total size of the resulting region */
2256 VARARG(region,rectangles); /* list of rectangles for the region */
2257 @END
2258 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2259 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2260 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2261 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2262 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2263 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2264 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2267 /* Update the z order of a window so that a given rectangle is fully visible */
2268 @REQ(update_window_zorder)
2269 user_handle_t window; /* handle to the window */
2270 rectangle_t rect; /* rectangle that must be visible */
2271 @END
2274 /* Mark parts of a window as needing a redraw */
2275 @REQ(redraw_window)
2276 user_handle_t window; /* handle to the window */
2277 unsigned int flags; /* RDW_* flags */
2278 VARARG(region,rectangles); /* list of rectangles for the region */
2279 @END
2282 /* Set a window property */
2283 @REQ(set_window_property)
2284 user_handle_t window; /* handle to the window */
2285 atom_t atom; /* property atom (if no name specified) */
2286 obj_handle_t handle; /* handle to store */
2287 VARARG(name,unicode_str); /* property name */
2288 @END
2291 /* Remove a window property */
2292 @REQ(remove_window_property)
2293 user_handle_t window; /* handle to the window */
2294 atom_t atom; /* property atom (if no name specified) */
2295 VARARG(name,unicode_str); /* property name */
2296 @REPLY
2297 obj_handle_t handle; /* handle stored in property */
2298 @END
2301 /* Get a window property */
2302 @REQ(get_window_property)
2303 user_handle_t window; /* handle to the window */
2304 atom_t atom; /* property atom (if no name specified) */
2305 VARARG(name,unicode_str); /* property name */
2306 @REPLY
2307 obj_handle_t handle; /* handle stored in property */
2308 @END
2311 /* Get the list of properties of a window */
2312 @REQ(get_window_properties)
2313 user_handle_t window; /* handle to the window */
2314 @REPLY
2315 int total; /* total number of properties */
2316 VARARG(props,properties); /* list of properties */
2317 @END
2320 /* Create a window station */
2321 @REQ(create_winstation)
2322 unsigned int flags; /* window station flags */
2323 unsigned int access; /* wanted access rights */
2324 unsigned int attributes; /* object attributes */
2325 VARARG(name,unicode_str); /* object name */
2326 @REPLY
2327 obj_handle_t handle; /* handle to the window station */
2328 @END
2331 /* Open a handle to a window station */
2332 @REQ(open_winstation)
2333 unsigned int access; /* wanted access rights */
2334 unsigned int attributes; /* object attributes */
2335 VARARG(name,unicode_str); /* object name */
2336 @REPLY
2337 obj_handle_t handle; /* handle to the window station */
2338 @END
2341 /* Close a window station */
2342 @REQ(close_winstation)
2343 obj_handle_t handle; /* handle to the window station */
2344 @END
2347 /* Get the process current window station */
2348 @REQ(get_process_winstation)
2349 @REPLY
2350 obj_handle_t handle; /* handle to the window station */
2351 @END
2354 /* Set the process current window station */
2355 @REQ(set_process_winstation)
2356 obj_handle_t handle; /* handle to the window station */
2357 @END
2360 /* Create a desktop */
2361 @REQ(create_desktop)
2362 unsigned int flags; /* desktop flags */
2363 unsigned int access; /* wanted access rights */
2364 unsigned int attributes; /* object attributes */
2365 VARARG(name,unicode_str); /* object name */
2366 @REPLY
2367 obj_handle_t handle; /* handle to the desktop */
2368 @END
2371 /* Open a handle to a desktop */
2372 @REQ(open_desktop)
2373 unsigned int flags; /* desktop flags */
2374 unsigned int access; /* wanted access rights */
2375 unsigned int attributes; /* object attributes */
2376 VARARG(name,unicode_str); /* object name */
2377 @REPLY
2378 obj_handle_t handle; /* handle to the desktop */
2379 @END
2382 /* Close a desktop */
2383 @REQ(close_desktop)
2384 obj_handle_t handle; /* handle to the desktop */
2385 @END
2388 /* Get the thread current desktop */
2389 @REQ(get_thread_desktop)
2390 thread_id_t tid; /* thread id */
2391 @REPLY
2392 obj_handle_t handle; /* handle to the desktop */
2393 @END
2396 /* Set the thread current desktop */
2397 @REQ(set_thread_desktop)
2398 obj_handle_t handle; /* handle to the desktop */
2399 @END
2402 /* Get/set information about a user object (window station or desktop) */
2403 @REQ(set_user_object_info)
2404 obj_handle_t handle; /* handle to the object */
2405 unsigned int flags; /* information to set */
2406 unsigned int obj_flags; /* new object flags */
2407 @REPLY
2408 int is_desktop; /* is object a desktop? */
2409 unsigned int old_obj_flags; /* old object flags */
2410 VARARG(name,unicode_str); /* object name */
2411 @END
2412 #define SET_USER_OBJECT_FLAGS 1
2415 /* Attach (or detach) thread inputs */
2416 @REQ(attach_thread_input)
2417 thread_id_t tid_from; /* thread to be attached */
2418 thread_id_t tid_to; /* thread to which tid_from should be attached */
2419 int attach; /* is it an attach? */
2420 @END
2423 /* Get input data for a given thread */
2424 @REQ(get_thread_input)
2425 thread_id_t tid; /* id of thread */
2426 @REPLY
2427 user_handle_t focus; /* handle to the focus window */
2428 user_handle_t capture; /* handle to the capture window */
2429 user_handle_t active; /* handle to the active window */
2430 user_handle_t foreground; /* handle to the global foreground window */
2431 user_handle_t menu_owner; /* handle to the menu owner */
2432 user_handle_t move_size; /* handle to the moving/resizing window */
2433 user_handle_t caret; /* handle to the caret window */
2434 rectangle_t rect; /* caret rectangle */
2435 @END
2438 /* Get the time of the last input event */
2439 @REQ(get_last_input_time)
2440 @REPLY
2441 unsigned int time;
2442 @END
2445 /* Retrieve queue keyboard state for a given thread */
2446 @REQ(get_key_state)
2447 thread_id_t tid; /* id of thread */
2448 int key; /* optional key code or -1 */
2449 @REPLY
2450 unsigned char state; /* state of specified key */
2451 VARARG(keystate,bytes); /* state array for all the keys */
2452 @END
2454 /* Set queue keyboard state for a given thread */
2455 @REQ(set_key_state)
2456 thread_id_t tid; /* id of thread */
2457 VARARG(keystate,bytes); /* state array for all the keys */
2458 @END
2460 /* Set the system foreground window */
2461 @REQ(set_foreground_window)
2462 user_handle_t handle; /* handle to the foreground window */
2463 @REPLY
2464 user_handle_t previous; /* handle to the previous foreground window */
2465 int send_msg_old; /* whether we have to send a msg to the old window */
2466 int send_msg_new; /* whether we have to send a msg to the new window */
2467 @END
2469 /* Set the current thread focus window */
2470 @REQ(set_focus_window)
2471 user_handle_t handle; /* handle to the focus window */
2472 @REPLY
2473 user_handle_t previous; /* handle to the previous focus window */
2474 @END
2476 /* Set the current thread active window */
2477 @REQ(set_active_window)
2478 user_handle_t handle; /* handle to the active window */
2479 @REPLY
2480 user_handle_t previous; /* handle to the previous active window */
2481 @END
2483 /* Set the current thread capture window */
2484 @REQ(set_capture_window)
2485 user_handle_t handle; /* handle to the capture window */
2486 unsigned int flags; /* capture flags (see below) */
2487 @REPLY
2488 user_handle_t previous; /* handle to the previous capture window */
2489 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2490 @END
2491 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2492 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2495 /* Set the current thread caret window */
2496 @REQ(set_caret_window)
2497 user_handle_t handle; /* handle to the caret window */
2498 int width; /* caret width */
2499 int height; /* caret height */
2500 @REPLY
2501 user_handle_t previous; /* handle to the previous caret window */
2502 rectangle_t old_rect; /* previous caret rectangle */
2503 int old_hide; /* previous hide count */
2504 int old_state; /* previous caret state (1=on, 0=off) */
2505 @END
2508 /* Set the current thread caret information */
2509 @REQ(set_caret_info)
2510 unsigned int flags; /* caret flags (see below) */
2511 user_handle_t handle; /* handle to the caret window */
2512 int x; /* caret x position */
2513 int y; /* caret y position */
2514 int hide; /* increment for hide count (can be negative to show it) */
2515 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2516 @REPLY
2517 user_handle_t full_handle; /* handle to the current caret window */
2518 rectangle_t old_rect; /* previous caret rectangle */
2519 int old_hide; /* previous hide count */
2520 int old_state; /* previous caret state (1=on, 0=off) */
2521 @END
2522 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2523 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2524 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2527 /* Set a window hook */
2528 @REQ(set_hook)
2529 int id; /* id of the hook */
2530 process_id_t pid; /* id of process to set the hook into */
2531 thread_id_t tid; /* id of thread to set the hook into */
2532 int event_min;
2533 int event_max;
2534 int flags;
2535 void* proc; /* hook procedure */
2536 int unicode; /* is it a unicode hook? */
2537 VARARG(module,unicode_str); /* module name */
2538 @REPLY
2539 user_handle_t handle; /* handle to the hook */
2540 unsigned int active_hooks; /* active hooks bitmap */
2541 @END
2544 /* Remove a window hook */
2545 @REQ(remove_hook)
2546 user_handle_t handle; /* handle to the hook */
2547 int id; /* id of the hook if handle is 0 */
2548 void* proc; /* hook procedure if handle is 0 */
2549 @REPLY
2550 unsigned int active_hooks; /* active hooks bitmap */
2551 @END
2554 /* Start calling a hook chain */
2555 @REQ(start_hook_chain)
2556 int id; /* id of the hook */
2557 int event; /* signalled event */
2558 user_handle_t window; /* handle to the event window */
2559 int object_id; /* object id for out of context winevent */
2560 int child_id; /* child id for out of context winevent */
2561 @REPLY
2562 user_handle_t handle; /* handle to the next hook */
2563 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2564 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2565 void* proc; /* hook procedure */
2566 int unicode; /* is it a unicode hook? */
2567 unsigned int active_hooks; /* active hooks bitmap */
2568 VARARG(module,unicode_str); /* module name */
2569 @END
2572 /* Finished calling a hook chain */
2573 @REQ(finish_hook_chain)
2574 int id; /* id of the hook */
2575 @END
2578 /* Get the hook information */
2579 @REQ(get_hook_info)
2580 user_handle_t handle; /* handle to the current hook */
2581 int get_next; /* do we want info about current or next hook? */
2582 int event; /* signalled event */
2583 user_handle_t window; /* handle to the event window */
2584 int object_id; /* object id for out of context winevent */
2585 int child_id; /* child id for out of context winevent */
2586 @REPLY
2587 user_handle_t handle; /* handle to the hook */
2588 int id; /* id of the hook */
2589 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2590 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2591 void* proc; /* hook procedure */
2592 int unicode; /* is it a unicode hook? */
2593 VARARG(module,unicode_str); /* module name */
2594 @END
2597 /* Create a window class */
2598 @REQ(create_class)
2599 int local; /* is it a local class? */
2600 atom_t atom; /* class atom */
2601 unsigned int style; /* class style */
2602 void* instance; /* module instance */
2603 int extra; /* number of extra class bytes */
2604 int win_extra; /* number of window extra bytes */
2605 void* client_ptr; /* pointer to class in client address space */
2606 @END
2609 /* Destroy a window class */
2610 @REQ(destroy_class)
2611 atom_t atom; /* class atom */
2612 void* instance; /* module instance */
2613 @REPLY
2614 void* client_ptr; /* pointer to class in client address space */
2615 @END
2618 /* Set some information in a class */
2619 @REQ(set_class_info)
2620 user_handle_t window; /* handle to the window */
2621 unsigned int flags; /* flags for info to set (see below) */
2622 atom_t atom; /* class atom */
2623 unsigned int style; /* class style */
2624 int win_extra; /* number of window extra bytes */
2625 void* instance; /* module instance */
2626 int extra_offset; /* offset to set in extra bytes */
2627 data_size_t extra_size; /* size to set in extra bytes */
2628 unsigned long extra_value; /* value to set in extra bytes */
2629 @REPLY
2630 atom_t old_atom; /* previous class atom */
2631 unsigned int old_style; /* previous class style */
2632 int old_extra; /* previous number of class extra bytes */
2633 int old_win_extra; /* previous number of window extra bytes */
2634 void* old_instance; /* previous module instance */
2635 unsigned long old_extra_value; /* old value in extra bytes */
2636 @END
2637 #define SET_CLASS_ATOM 0x0001
2638 #define SET_CLASS_STYLE 0x0002
2639 #define SET_CLASS_WINEXTRA 0x0004
2640 #define SET_CLASS_INSTANCE 0x0008
2641 #define SET_CLASS_EXTRA 0x0010
2644 /* Set/get clipboard information */
2645 @REQ(set_clipboard_info)
2646 unsigned int flags; /* flags for fields to set (see below) */
2647 user_handle_t clipboard; /* clipboard window */
2648 user_handle_t owner; /* clipboard owner */
2649 user_handle_t viewer; /* first clipboard viewer */
2650 unsigned int seqno; /* change sequence number */
2651 @REPLY
2652 unsigned int flags; /* status flags (see below) */
2653 user_handle_t old_clipboard; /* old clipboard window */
2654 user_handle_t old_owner; /* old clipboard owner */
2655 user_handle_t old_viewer; /* old clipboard viewer */
2656 unsigned int seqno; /* current sequence number */
2657 @END
2659 #define SET_CB_OPEN 0x001
2660 #define SET_CB_OWNER 0x002
2661 #define SET_CB_VIEWER 0x004
2662 #define SET_CB_SEQNO 0x008
2663 #define SET_CB_RELOWNER 0x010
2664 #define SET_CB_CLOSE 0x020
2665 #define CB_OPEN 0x040
2666 #define CB_OWNER 0x080
2667 #define CB_PROCESS 0x100
2670 /* Open a security token */
2671 @REQ(open_token)
2672 obj_handle_t handle; /* handle to the thread or process */
2673 unsigned int access; /* access rights to the new token */
2674 unsigned int attributes;/* object attributes */
2675 unsigned int flags; /* flags (see below) */
2676 @REPLY
2677 obj_handle_t token; /* handle to the token */
2678 @END
2679 #define OPEN_TOKEN_THREAD 1
2680 #define OPEN_TOKEN_AS_SELF 2
2683 /* Set/get the global windows */
2684 @REQ(set_global_windows)
2685 unsigned int flags; /* flags for fields to set (see below) */
2686 user_handle_t shell_window; /* handle to the new shell window */
2687 user_handle_t shell_listview; /* handle to the new shell listview window */
2688 user_handle_t progman_window; /* handle to the new program manager window */
2689 user_handle_t taskman_window; /* handle to the new task manager window */
2690 @REPLY
2691 user_handle_t old_shell_window; /* handle to the shell window */
2692 user_handle_t old_shell_listview; /* handle to the shell listview window */
2693 user_handle_t old_progman_window; /* handle to the new program manager window */
2694 user_handle_t old_taskman_window; /* handle to the new task manager window */
2695 @END
2696 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2697 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2698 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2700 /* Adjust the privileges held by a token */
2701 @REQ(adjust_token_privileges)
2702 obj_handle_t handle; /* handle to the token */
2703 int disable_all; /* disable all privileges? */
2704 int get_modified_state; /* get modified privileges? */
2705 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2706 @REPLY
2707 unsigned int len; /* total length in bytes required to store token privileges */
2708 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2709 @END
2711 /* Retrieves the set of privileges held by or available to a token */
2712 @REQ(get_token_privileges)
2713 obj_handle_t handle; /* handle to the token */
2714 @REPLY
2715 unsigned int len; /* total length in bytes required to store token privileges */
2716 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2717 @END
2719 /* Check the token has the required privileges */
2720 @REQ(check_token_privileges)
2721 obj_handle_t handle; /* handle to the token */
2722 int all_required; /* are all the privileges required for the check to succeed? */
2723 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2724 @REPLY
2725 int has_privileges; /* does the token have the required privileges? */
2726 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2727 @END
2729 @REQ(duplicate_token)
2730 obj_handle_t handle; /* handle to the token to duplicate */
2731 unsigned int access; /* access rights to the new token */
2732 unsigned int attributes; /* object attributes */
2733 int primary; /* is the new token to be a primary one? */
2734 int impersonation_level; /* impersonation level of the new token */
2735 @REPLY
2736 obj_handle_t new_handle; /* duplicated handle */
2737 @END
2739 @REQ(access_check)
2740 obj_handle_t handle; /* handle to the token */
2741 unsigned int desired_access; /* desired access to the object */
2742 unsigned int mapping_read; /* mapping from generic read to specific rights */
2743 unsigned int mapping_write; /* mapping from generic write to specific rights */
2744 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2745 unsigned int mapping_all; /* mapping from generic all to specific rights */
2746 VARARG(sd,security_descriptor); /* security descriptor to check */
2747 @REPLY
2748 unsigned int access_granted; /* access rights actually granted */
2749 unsigned int access_status; /* was access granted? */
2750 unsigned int privileges_len; /* length needed to store privileges */
2751 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2752 @END
2754 @REQ(get_token_user)
2755 obj_handle_t handle; /* handle to the token */
2756 @REPLY
2757 data_size_t user_len; /* length needed to store user */
2758 VARARG(user,SID); /* sid of the user the token represents */
2759 @END
2761 @REQ(get_token_groups)
2762 obj_handle_t handle; /* handle to the token */
2763 @REPLY
2764 data_size_t user_len; /* length needed to store user */
2765 VARARG(user,token_groups); /* groups the token's user belongs to */
2766 @END
2768 @REQ(set_security_object)
2769 obj_handle_t handle; /* handle to the object */
2770 unsigned int security_info; /* which parts of security descriptor to set */
2771 VARARG(sd,security_descriptor); /* security descriptor to set */
2772 @END
2774 /* Create a mailslot */
2775 @REQ(create_mailslot)
2776 unsigned int access; /* wanted access rights */
2777 unsigned int attributes; /* object attributes */
2778 obj_handle_t rootdir; /* root directory */
2779 unsigned int max_msgsize;
2780 int read_timeout;
2781 VARARG(name,unicode_str); /* mailslot name */
2782 @REPLY
2783 obj_handle_t handle; /* handle to the mailslot */
2784 @END
2787 /* Open an existing mailslot */
2788 @REQ(open_mailslot)
2789 unsigned int access;
2790 unsigned int attributes; /* object attributes */
2791 obj_handle_t rootdir; /* root directory */
2792 unsigned int sharing; /* sharing mode */
2793 VARARG(name,unicode_str); /* mailslot name */
2794 @REPLY
2795 obj_handle_t handle; /* handle to the mailslot */
2796 @END
2799 /* Set mailslot information */
2800 @REQ(set_mailslot_info)
2801 obj_handle_t handle; /* handle to the mailslot */
2802 unsigned int flags;
2803 int read_timeout;
2804 @REPLY
2805 unsigned int max_msgsize;
2806 int read_timeout;
2807 @END
2808 #define MAILSLOT_SET_READ_TIMEOUT 1
2811 /* Create a directory object */
2812 @REQ(create_directory)
2813 unsigned int access; /* access flags */
2814 unsigned int attributes; /* object attributes */
2815 obj_handle_t rootdir; /* root directory */
2816 VARARG(directory_name,unicode_str); /* Directory name */
2817 @REPLY
2818 obj_handle_t handle; /* handle to the directory */
2819 @END
2822 /* Open a directory object */
2823 @REQ(open_directory)
2824 unsigned int access; /* access flags */
2825 unsigned int attributes; /* object attributes */
2826 obj_handle_t rootdir; /* root directory */
2827 VARARG(directory_name,unicode_str); /* Directory name */
2828 @REPLY
2829 obj_handle_t handle; /* handle to the directory */
2830 @END
2833 /* Create a symbolic link object */
2834 @REQ(create_symlink)
2835 unsigned int access; /* access flags */
2836 unsigned int attributes; /* object attributes */
2837 obj_handle_t rootdir; /* root directory */
2838 data_size_t name_len; /* length of the symlink name in bytes */
2839 VARARG(name,unicode_str,name_len); /* symlink name */
2840 VARARG(target_name,unicode_str); /* target name */
2841 @REPLY
2842 obj_handle_t handle; /* handle to the symlink */
2843 @END
2846 /* Open a symbolic link object */
2847 @REQ(open_symlink)
2848 unsigned int access; /* access flags */
2849 unsigned int attributes; /* object attributes */
2850 obj_handle_t rootdir; /* root directory */
2851 VARARG(name,unicode_str); /* symlink name */
2852 @REPLY
2853 obj_handle_t handle; /* handle to the symlink */
2854 @END
2857 /* Query a symbolic link object */
2858 @REQ(query_symlink)
2859 obj_handle_t handle; /* handle to the symlink */
2860 @REPLY
2861 VARARG(target_name,unicode_str); /* target name */
2862 @END
2865 /* Query basic object information */
2866 @REQ(get_object_info)
2867 obj_handle_t handle; /* handle to the object */
2868 @REPLY
2869 unsigned int access; /* granted access mask */
2870 unsigned int ref_count; /* object ref count */
2871 @END
2873 /* Query the impersonation level of an impersonation token */
2874 @REQ(get_token_impersonation_level)
2875 obj_handle_t handle; /* handle to the object */
2876 @REPLY
2877 int impersonation_level; /* impersonation level of the impersonation token */
2878 @END
2880 /* Allocate a locally-unique identifier */
2881 @REQ(allocate_locally_unique_id)
2882 @REPLY
2883 luid_t luid;
2884 @END