advapi32: Fix one byte array overflow during DES unhash.
[wine/dibdrv.git] / server / protocol.def
blob02dee2def5f2827a86ee34a5136e12dda9b8be71
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;
40 typedef unsigned int ioctl_code_t;
42 struct request_header
44 int req; /* request code */
45 data_size_t request_size; /* request variable part size */
46 data_size_t reply_size; /* reply variable part maximum size */
49 struct reply_header
51 unsigned int error; /* error result */
52 data_size_t reply_size; /* reply variable part size */
55 /* placeholder structure for the maximum allowed request size */
56 /* this is used to construct the generic_request union */
57 struct request_max_size
59 int pad[16]; /* the max request size is 16 ints */
62 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
63 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
66 /* definitions of the event data depending on the event code */
67 struct debug_event_exception
69 EXCEPTION_RECORD record; /* exception record */
70 int first; /* first chance exception? */
72 struct debug_event_create_thread
74 obj_handle_t handle; /* handle to the new thread */
75 void *teb; /* thread teb (in debugged process address space) */
76 void *start; /* thread startup routine */
78 struct debug_event_create_process
80 obj_handle_t file; /* handle to the process exe file */
81 obj_handle_t process; /* handle to the new process */
82 obj_handle_t thread; /* handle to the new thread */
83 void *base; /* base of executable image */
84 int dbg_offset; /* offset of debug info in file */
85 int dbg_size; /* size of debug info */
86 void *teb; /* thread teb (in debugged process address space) */
87 void *start; /* thread startup routine */
88 void *name; /* image name (optional) */
89 int unicode; /* is it Unicode? */
91 struct debug_event_exit
93 int exit_code; /* thread or process exit code */
95 struct debug_event_load_dll
97 obj_handle_t handle; /* file handle for the dll */
98 void *base; /* base address of the dll */
99 int dbg_offset; /* offset of debug info in file */
100 int dbg_size; /* size of debug info */
101 void *name; /* image name (optional) */
102 int unicode; /* is it Unicode? */
104 struct debug_event_unload_dll
106 void *base; /* base address of the dll */
108 struct debug_event_output_string
110 void *string; /* string to display (in debugged process address space) */
111 int unicode; /* is it Unicode? */
112 int length; /* string length */
114 struct debug_event_rip_info
116 int error; /* ??? */
117 int type; /* ??? */
119 union debug_event_data
121 struct debug_event_exception exception;
122 struct debug_event_create_thread create_thread;
123 struct debug_event_create_process create_process;
124 struct debug_event_exit exit;
125 struct debug_event_load_dll load_dll;
126 struct debug_event_unload_dll unload_dll;
127 struct debug_event_output_string output_string;
128 struct debug_event_rip_info rip_info;
131 /* debug event data */
132 typedef struct
134 int code; /* event code */
135 union debug_event_data info; /* event information */
136 } debug_event_t;
138 /* structure used in sending an fd from client to server */
139 struct send_fd
141 thread_id_t tid; /* thread id */
142 int fd; /* file descriptor on client-side */
145 /* structure sent by the server on the wait fifo */
146 struct wake_up_reply
148 void *cookie; /* magic cookie that was passed in select_request */
149 int signaled; /* wait result */
152 /* NT-style timeout, in 100ns units, negative means relative timeout */
153 typedef __int64 timeout_t;
154 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
156 /* structure returned in the list of window properties */
157 typedef struct
159 atom_t atom; /* property atom */
160 short string; /* was atom a string originally? */
161 obj_handle_t handle; /* handle stored in property */
162 } property_data_t;
164 /* structure to specify window rectangles */
165 typedef struct
167 int left;
168 int top;
169 int right;
170 int bottom;
171 } rectangle_t;
173 /* structure for parameters of async I/O calls */
174 typedef struct
176 void *callback; /* client-side callback to call upon end of async */
177 void *iosb; /* I/O status block in client addr space */
178 void *arg; /* opaque user data to pass to callback */
179 void *apc; /* user apc to call */
180 void *apc_arg; /* argument for user apc */
181 obj_handle_t event; /* event to signal when done */
182 } async_data_t;
184 /* structures for extra message data */
186 struct callback_msg_data
188 void *callback; /* callback function */
189 unsigned long data; /* user data for callback */
190 unsigned long result; /* message result */
193 struct winevent_msg_data
195 user_handle_t hook; /* hook handle */
196 thread_id_t tid; /* thread id */
197 void *hook_proc; /* hook proc address */
198 /* followed by module name if any */
201 typedef union
203 unsigned char bytes[1]; /* raw data for sent messages */
204 struct callback_msg_data callback;
205 struct winevent_msg_data winevent;
206 } message_data_t;
208 /* structure for console char/attribute info */
209 typedef struct
211 WCHAR ch;
212 unsigned short attr;
213 } char_info_t;
215 typedef struct
217 unsigned int low_part;
218 int high_part;
219 } luid_t;
221 #define MAX_ACL_LEN 65535
223 struct security_descriptor
225 unsigned int control; /* SE_ flags */
226 data_size_t owner_len;
227 data_size_t group_len;
228 data_size_t sacl_len;
229 data_size_t dacl_len;
230 /* VARARGS(owner,SID); */
231 /* VARARGS(group,SID); */
232 /* VARARGS(sacl,ACL); */
233 /* VARARGS(dacl,ACL); */
236 struct token_groups
238 unsigned int count;
239 /* unsigned int attributes[count]; */
240 /* VARARGS(sids,SID); */
243 enum apc_type
245 APC_NONE,
246 APC_USER,
247 APC_TIMER,
248 APC_ASYNC_IO,
249 APC_VIRTUAL_ALLOC,
250 APC_VIRTUAL_FREE,
251 APC_VIRTUAL_QUERY,
252 APC_VIRTUAL_PROTECT,
253 APC_VIRTUAL_FLUSH,
254 APC_VIRTUAL_LOCK,
255 APC_VIRTUAL_UNLOCK,
256 APC_MAP_VIEW,
257 APC_UNMAP_VIEW,
258 APC_CREATE_THREAD
261 typedef union
263 enum apc_type type;
264 struct
266 enum apc_type type; /* APC_USER */
267 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
268 unsigned long args[3]; /* arguments for user function */
269 } user;
270 struct
272 enum apc_type type; /* APC_TIMER */
273 void (__stdcall *func)(void*, unsigned int, unsigned int);
274 timeout_t time; /* absolute time of expiration */
275 void *arg; /* user argument */
276 } timer;
277 struct
279 enum apc_type type; /* APC_ASYNC_IO */
280 unsigned int (*func)(void*, void*, unsigned int);
281 void *user; /* user pointer */
282 void *sb; /* status block */
283 unsigned int status; /* I/O status */
284 } async_io;
285 struct
287 enum apc_type type; /* APC_VIRTUAL_ALLOC */
288 void *addr; /* requested address */
289 unsigned long size; /* allocation size */
290 unsigned int zero_bits; /* allocation alignment */
291 unsigned int op_type; /* type of operation */
292 unsigned int prot; /* memory protection flags */
293 } virtual_alloc;
294 struct
296 enum apc_type type; /* APC_VIRTUAL_FREE */
297 void *addr; /* requested address */
298 unsigned long size; /* allocation size */
299 unsigned int op_type; /* type of operation */
300 } virtual_free;
301 struct
303 enum apc_type type; /* APC_VIRTUAL_QUERY */
304 const void *addr; /* requested address */
305 } virtual_query;
306 struct
308 enum apc_type type; /* APC_VIRTUAL_PROTECT */
309 void *addr; /* requested address */
310 unsigned long size; /* requested address */
311 unsigned int prot; /* new protection flags */
312 } virtual_protect;
313 struct
315 enum apc_type type; /* APC_VIRTUAL_FLUSH */
316 const void *addr; /* requested address */
317 unsigned long size; /* requested address */
318 } virtual_flush;
319 struct
321 enum apc_type type; /* APC_VIRTUAL_LOCK */
322 void *addr; /* requested address */
323 unsigned long size; /* requested address */
324 } virtual_lock;
325 struct
327 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
328 void *addr; /* requested address */
329 unsigned long size; /* requested address */
330 } virtual_unlock;
331 struct
333 enum apc_type type; /* APC_MAP_VIEW */
334 obj_handle_t handle; /* mapping handle */
335 void *addr; /* requested address */
336 unsigned long size; /* allocation size */
337 unsigned int offset_low;/* file offset */
338 unsigned int offset_high;
339 unsigned int zero_bits; /* allocation alignment */
340 unsigned int alloc_type;/* allocation type */
341 unsigned int prot; /* memory protection flags */
342 } map_view;
343 struct
345 enum apc_type type; /* APC_UNMAP_VIEW */
346 void *addr; /* view address */
347 } unmap_view;
348 struct
350 enum apc_type type; /* APC_CREATE_THREAD */
351 void (__stdcall *func)(void*); /* start function */
352 void *arg; /* argument for start function */
353 unsigned long reserve; /* reserve size for thread stack */
354 unsigned long commit; /* commit size for thread stack */
355 int suspend; /* suspended thread? */
356 } create_thread;
357 } apc_call_t;
359 typedef union
361 enum apc_type type;
362 struct
364 enum apc_type type; /* APC_ASYNC_IO */
365 unsigned int status; /* new status of async operation */
366 } async_io;
367 struct
369 enum apc_type type; /* APC_VIRTUAL_ALLOC */
370 unsigned int status; /* status returned by call */
371 void *addr; /* resulting address */
372 unsigned long size; /* resulting size */
373 } virtual_alloc;
374 struct
376 enum apc_type type; /* APC_VIRTUAL_FREE */
377 unsigned int status; /* status returned by call */
378 void *addr; /* resulting address */
379 unsigned long size; /* resulting size */
380 } virtual_free;
381 struct
383 enum apc_type type; /* APC_VIRTUAL_QUERY */
384 unsigned int status; /* status returned by call */
385 void *base; /* resulting base address */
386 void *alloc_base;/* resulting allocation base */
387 unsigned long size; /* resulting region size */
388 unsigned int state; /* resulting region state */
389 unsigned int prot; /* resulting region protection */
390 unsigned int alloc_prot;/* resulting allocation protection */
391 unsigned int alloc_type;/* resulting region allocation type */
392 } virtual_query;
393 struct
395 enum apc_type type; /* APC_VIRTUAL_PROTECT */
396 unsigned int status; /* status returned by call */
397 void *addr; /* resulting address */
398 unsigned long size; /* resulting size */
399 unsigned int prot; /* old protection flags */
400 } virtual_protect;
401 struct
403 enum apc_type type; /* APC_VIRTUAL_FLUSH */
404 unsigned int status; /* status returned by call */
405 const void *addr; /* resulting address */
406 unsigned long size; /* resulting size */
407 } virtual_flush;
408 struct
410 enum apc_type type; /* APC_VIRTUAL_LOCK */
411 unsigned int status; /* status returned by call */
412 void *addr; /* resulting address */
413 unsigned long size; /* resulting size */
414 } virtual_lock;
415 struct
417 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
418 unsigned int status; /* status returned by call */
419 void *addr; /* resulting address */
420 unsigned long size; /* resulting size */
421 } virtual_unlock;
422 struct
424 enum apc_type type; /* APC_MAP_VIEW */
425 unsigned int status; /* status returned by call */
426 void *addr; /* resulting address */
427 unsigned long size; /* resulting size */
428 } map_view;
429 struct
431 enum apc_type type; /* APC_MAP_VIEW */
432 unsigned int status; /* status returned by call */
433 } unmap_view;
434 struct
436 enum apc_type type; /* APC_CREATE_THREAD */
437 unsigned int status; /* status returned by call */
438 thread_id_t tid; /* thread id */
439 obj_handle_t handle; /* handle to new thread */
440 } create_thread;
441 } apc_result_t;
443 /****************************************************************/
444 /* Request declarations */
446 /* Create a new process from the context of the parent */
447 @REQ(new_process)
448 int inherit_all; /* inherit all handles from parent */
449 unsigned int create_flags; /* creation flags */
450 int socket_fd; /* file descriptor for process socket */
451 obj_handle_t exe_file; /* file handle for main exe */
452 obj_handle_t hstdin; /* handle for stdin */
453 obj_handle_t hstdout; /* handle for stdout */
454 obj_handle_t hstderr; /* handle for stderr */
455 unsigned int process_access; /* access rights for process object */
456 unsigned int process_attr; /* attributes for process object */
457 unsigned int thread_access; /* access rights for thread object */
458 unsigned int thread_attr; /* attributes for thread object */
459 VARARG(info,startup_info); /* startup information */
460 VARARG(env,unicode_str); /* environment for new process */
461 @REPLY
462 obj_handle_t info; /* new process info handle */
463 process_id_t pid; /* process id */
464 obj_handle_t phandle; /* process handle (in the current process) */
465 thread_id_t tid; /* thread id */
466 obj_handle_t thandle; /* thread handle (in the current process) */
467 @END
470 /* Retrieve information about a newly started process */
471 @REQ(get_new_process_info)
472 obj_handle_t info; /* info handle returned from new_process_request */
473 @REPLY
474 int success; /* did the process start successfully? */
475 int exit_code; /* process exit code if failed */
476 @END
479 /* Create a new thread from the context of the parent */
480 @REQ(new_thread)
481 unsigned int access; /* wanted access rights */
482 unsigned int attributes; /* object attributes */
483 int suspend; /* new thread should be suspended on creation */
484 int request_fd; /* fd for request pipe */
485 @REPLY
486 thread_id_t tid; /* thread id */
487 obj_handle_t handle; /* thread handle (in the current process) */
488 @END
491 /* Retrieve the new process startup info */
492 @REQ(get_startup_info)
493 @REPLY
494 obj_handle_t exe_file; /* file handle for main exe */
495 obj_handle_t hstdin; /* handle for stdin */
496 obj_handle_t hstdout; /* handle for stdout */
497 obj_handle_t hstderr; /* handle for stderr */
498 VARARG(info,startup_info); /* startup information */
499 VARARG(env,unicode_str); /* environment */
500 @END
503 /* Signal the end of the process initialization */
504 @REQ(init_process_done)
505 void* module; /* main module base address */
506 void* entry; /* process entry point */
507 int gui; /* is it a GUI process? */
508 @END
511 /* Initialize a thread; called from the child after fork()/clone() */
512 @REQ(init_thread)
513 int unix_pid; /* Unix pid of new thread */
514 int unix_tid; /* Unix tid of new thread */
515 int debug_level; /* new debug level */
516 void* teb; /* TEB of new thread (in thread address space) */
517 void* peb; /* address of PEB (in thread address space) */
518 void* entry; /* thread entry point (in thread address space) */
519 void* ldt_copy; /* address of LDT copy (in thread address space) */
520 int reply_fd; /* fd for reply pipe */
521 int wait_fd; /* fd for blocking calls pipe */
522 @REPLY
523 process_id_t pid; /* process id of the new thread's process */
524 thread_id_t tid; /* thread id of the new thread */
525 data_size_t info_size; /* total size of startup info */
526 timeout_t server_start; /* server start time */
527 int version; /* protocol version */
528 @END
531 /* Terminate a process */
532 @REQ(terminate_process)
533 obj_handle_t handle; /* process handle to terminate */
534 int exit_code; /* process exit code */
535 @REPLY
536 int self; /* suicide? */
537 @END
540 /* Terminate a thread */
541 @REQ(terminate_thread)
542 obj_handle_t handle; /* thread handle to terminate */
543 int exit_code; /* thread exit code */
544 @REPLY
545 int self; /* suicide? */
546 int last; /* last thread in this process? */
547 @END
550 /* Retrieve information about a process */
551 @REQ(get_process_info)
552 obj_handle_t handle; /* process handle */
553 @REPLY
554 process_id_t pid; /* server process id */
555 process_id_t ppid; /* server process id of parent */
556 int exit_code; /* process exit code */
557 int priority; /* priority class */
558 int affinity; /* process affinity mask */
559 void* peb; /* PEB address in process address space */
560 timeout_t start_time; /* process start time */
561 timeout_t end_time; /* process end time */
562 @END
565 /* Set a process informations */
566 @REQ(set_process_info)
567 obj_handle_t handle; /* process handle */
568 int mask; /* setting mask (see below) */
569 int priority; /* priority class */
570 int affinity; /* affinity mask */
571 @END
572 #define SET_PROCESS_INFO_PRIORITY 0x01
573 #define SET_PROCESS_INFO_AFFINITY 0x02
576 /* Retrieve information about a thread */
577 @REQ(get_thread_info)
578 obj_handle_t handle; /* thread handle */
579 thread_id_t tid_in; /* thread id (optional) */
580 @REPLY
581 process_id_t pid; /* server process id */
582 thread_id_t tid; /* server thread id */
583 void* teb; /* thread teb pointer */
584 int exit_code; /* thread exit code */
585 int priority; /* thread priority level */
586 int affinity; /* thread affinity mask */
587 timeout_t creation_time; /* thread creation time */
588 timeout_t exit_time; /* thread exit time */
589 int last; /* last thread in process */
590 @END
593 /* Set a thread informations */
594 @REQ(set_thread_info)
595 obj_handle_t handle; /* thread handle */
596 int mask; /* setting mask (see below) */
597 int priority; /* priority class */
598 int affinity; /* affinity mask */
599 obj_handle_t token; /* impersonation token */
600 @END
601 #define SET_THREAD_INFO_PRIORITY 0x01
602 #define SET_THREAD_INFO_AFFINITY 0x02
603 #define SET_THREAD_INFO_TOKEN 0x04
606 /* Retrieve information about a module */
607 @REQ(get_dll_info)
608 obj_handle_t handle; /* process handle */
609 void* base_address; /* base address of module */
610 @REPLY
611 size_t size; /* module size */
612 void* entry_point;
613 VARARG(filename,unicode_str); /* file name of module */
614 @END
617 /* Suspend a thread */
618 @REQ(suspend_thread)
619 obj_handle_t handle; /* thread handle */
620 @REPLY
621 int count; /* new suspend count */
622 @END
625 /* Resume a thread */
626 @REQ(resume_thread)
627 obj_handle_t handle; /* thread handle */
628 @REPLY
629 int count; /* new suspend count */
630 @END
633 /* Notify the server that a dll has been loaded */
634 @REQ(load_dll)
635 obj_handle_t handle; /* file handle */
636 void* base; /* base address */
637 size_t size; /* dll size */
638 int dbg_offset; /* debug info offset */
639 int dbg_size; /* debug info size */
640 void* name; /* ptr to ptr to name (in process addr space) */
641 VARARG(filename,unicode_str); /* file name of dll */
642 @END
645 /* Notify the server that a dll is being unloaded */
646 @REQ(unload_dll)
647 void* base; /* base address */
648 @END
651 /* Queue an APC for a thread or process */
652 @REQ(queue_apc)
653 obj_handle_t thread; /* thread handle */
654 obj_handle_t process; /* process handle */
655 apc_call_t call; /* call arguments */
656 @REPLY
657 obj_handle_t handle; /* APC handle */
658 int self; /* run APC in caller itself? */
659 @END
662 /* Get next APC to call */
663 @REQ(get_apc)
664 int alertable; /* is thread alertable? */
665 obj_handle_t prev; /* handle to previous APC */
666 apc_result_t result; /* result of previous APC */
667 @REPLY
668 obj_handle_t handle; /* handle to APC */
669 apc_call_t call; /* call arguments */
670 @END
673 /* Get the result of an APC call */
674 @REQ(get_apc_result)
675 obj_handle_t handle; /* handle to the APC */
676 @REPLY
677 apc_result_t result; /* result of the APC */
678 @END
681 /* Close a handle for the current process */
682 @REQ(close_handle)
683 obj_handle_t handle; /* handle to close */
684 @END
687 /* Set a handle information */
688 @REQ(set_handle_info)
689 obj_handle_t handle; /* handle we are interested in */
690 int flags; /* new handle flags */
691 int mask; /* mask for flags to set */
692 @REPLY
693 int old_flags; /* old flag value */
694 @END
697 /* Duplicate a handle */
698 @REQ(dup_handle)
699 obj_handle_t src_process; /* src process handle */
700 obj_handle_t src_handle; /* src handle to duplicate */
701 obj_handle_t dst_process; /* dst process handle */
702 unsigned int access; /* wanted access rights */
703 unsigned int attributes; /* object attributes */
704 unsigned int options; /* duplicate options (see below) */
705 @REPLY
706 obj_handle_t handle; /* duplicated handle in dst process */
707 int self; /* is the source the current process? */
708 int closed; /* whether the source handle has been closed */
709 @END
710 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
711 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
712 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
715 /* Open a handle to a process */
716 @REQ(open_process)
717 process_id_t pid; /* process id to open */
718 unsigned int access; /* wanted access rights */
719 unsigned int attributes; /* object attributes */
720 @REPLY
721 obj_handle_t handle; /* handle to the process */
722 @END
725 /* Open a handle to a thread */
726 @REQ(open_thread)
727 thread_id_t tid; /* thread id to open */
728 unsigned int access; /* wanted access rights */
729 unsigned int attributes; /* object attributes */
730 @REPLY
731 obj_handle_t handle; /* handle to the thread */
732 @END
735 /* Wait for handles */
736 @REQ(select)
737 int flags; /* wait flags (see below) */
738 void* cookie; /* magic cookie to return to client */
739 obj_handle_t signal; /* object to signal (0 if none) */
740 timeout_t timeout; /* timeout */
741 VARARG(handles,handles); /* handles to select on */
742 @REPLY
743 timeout_t timeout; /* timeout converted to absolute */
744 @END
745 #define SELECT_ALL 1
746 #define SELECT_ALERTABLE 2
747 #define SELECT_INTERRUPTIBLE 4
750 /* Create an event */
751 @REQ(create_event)
752 unsigned int access; /* wanted access rights */
753 unsigned int attributes; /* object attributes */
754 obj_handle_t rootdir; /* root directory */
755 int manual_reset; /* manual reset event */
756 int initial_state; /* initial state of the event */
757 VARARG(name,unicode_str); /* object name */
758 @REPLY
759 obj_handle_t handle; /* handle to the event */
760 @END
762 /* Event operation */
763 @REQ(event_op)
764 obj_handle_t handle; /* handle to event */
765 int op; /* event operation (see below) */
766 @END
767 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
770 /* Open an event */
771 @REQ(open_event)
772 unsigned int access; /* wanted access rights */
773 unsigned int attributes; /* object attributes */
774 obj_handle_t rootdir; /* root directory */
775 VARARG(name,unicode_str); /* object name */
776 @REPLY
777 obj_handle_t handle; /* handle to the event */
778 @END
781 /* Create a mutex */
782 @REQ(create_mutex)
783 unsigned int access; /* wanted access rights */
784 unsigned int attributes; /* object attributes */
785 obj_handle_t rootdir; /* root directory */
786 int owned; /* initially owned? */
787 VARARG(name,unicode_str); /* object name */
788 @REPLY
789 obj_handle_t handle; /* handle to the mutex */
790 @END
793 /* Release a mutex */
794 @REQ(release_mutex)
795 obj_handle_t handle; /* handle to the mutex */
796 @REPLY
797 unsigned int prev_count; /* value of internal counter, before release */
798 @END
801 /* Open a mutex */
802 @REQ(open_mutex)
803 unsigned int access; /* wanted access rights */
804 unsigned int attributes; /* object attributes */
805 obj_handle_t rootdir; /* root directory */
806 VARARG(name,unicode_str); /* object name */
807 @REPLY
808 obj_handle_t handle; /* handle to the mutex */
809 @END
812 /* Create a semaphore */
813 @REQ(create_semaphore)
814 unsigned int access; /* wanted access rights */
815 unsigned int attributes; /* object attributes */
816 obj_handle_t rootdir; /* root directory */
817 unsigned int initial; /* initial count */
818 unsigned int max; /* maximum count */
819 VARARG(name,unicode_str); /* object name */
820 @REPLY
821 obj_handle_t handle; /* handle to the semaphore */
822 @END
825 /* Release a semaphore */
826 @REQ(release_semaphore)
827 obj_handle_t handle; /* handle to the semaphore */
828 unsigned int count; /* count to add to semaphore */
829 @REPLY
830 unsigned int prev_count; /* previous semaphore count */
831 @END
834 /* Open a semaphore */
835 @REQ(open_semaphore)
836 unsigned int access; /* wanted access rights */
837 unsigned int attributes; /* object attributes */
838 obj_handle_t rootdir; /* root directory */
839 VARARG(name,unicode_str); /* object name */
840 @REPLY
841 obj_handle_t handle; /* handle to the semaphore */
842 @END
845 /* Create a file */
846 @REQ(create_file)
847 unsigned int access; /* wanted access rights */
848 unsigned int attributes; /* object attributes */
849 unsigned int sharing; /* sharing flags */
850 int create; /* file create action */
851 unsigned int options; /* file options */
852 unsigned int attrs; /* file attributes for creation */
853 VARARG(filename,string); /* file name */
854 @REPLY
855 obj_handle_t handle; /* handle to the file */
856 @END
859 /* Open a file object */
860 @REQ(open_file_object)
861 unsigned int access; /* wanted access rights */
862 unsigned int attributes; /* open attributes */
863 obj_handle_t rootdir; /* root directory */
864 unsigned int sharing; /* sharing flags */
865 unsigned int options; /* file options */
866 VARARG(filename,unicode_str); /* file name */
867 @REPLY
868 obj_handle_t handle; /* handle to the file */
869 @END
872 /* Allocate a file handle for a Unix fd */
873 @REQ(alloc_file_handle)
874 unsigned int access; /* wanted access rights */
875 unsigned int attributes; /* object attributes */
876 int fd; /* file descriptor on the client side */
877 @REPLY
878 obj_handle_t handle; /* handle to the file */
879 @END
882 /* Get a Unix fd to access a file */
883 @REQ(get_handle_fd)
884 obj_handle_t handle; /* handle to the file */
885 @REPLY
886 int type; /* file type (see below) */
887 int removable; /* is file removable? */
888 unsigned int access; /* file access rights */
889 unsigned int options; /* file open options */
890 @END
891 enum server_fd_type
893 FD_TYPE_INVALID, /* invalid file (no associated fd) */
894 FD_TYPE_FILE, /* regular file */
895 FD_TYPE_DIR, /* directory */
896 FD_TYPE_SOCKET, /* socket */
897 FD_TYPE_SERIAL, /* serial port */
898 FD_TYPE_PIPE, /* named pipe */
899 FD_TYPE_MAILSLOT, /* mailslot */
900 FD_TYPE_DEVICE, /* Windows device file */
901 FD_TYPE_NB_TYPES
905 /* Flush a file buffers */
906 @REQ(flush_file)
907 obj_handle_t handle; /* handle to the file */
908 @REPLY
909 obj_handle_t event; /* event set when finished */
910 @END
913 /* Lock a region of a file */
914 @REQ(lock_file)
915 obj_handle_t handle; /* handle to the file */
916 unsigned int offset_low; /* offset of start of lock */
917 unsigned int offset_high; /* offset of start of lock */
918 unsigned int count_low; /* count of bytes to lock */
919 unsigned int count_high; /* count of bytes to lock */
920 int shared; /* shared or exclusive lock? */
921 int wait; /* do we want to wait? */
922 @REPLY
923 obj_handle_t handle; /* handle to wait on */
924 int overlapped; /* is it an overlapped I/O handle? */
925 @END
928 /* Unlock a region of a file */
929 @REQ(unlock_file)
930 obj_handle_t handle; /* handle to the file */
931 unsigned int offset_low; /* offset of start of unlock */
932 unsigned int offset_high; /* offset of start of unlock */
933 unsigned int count_low; /* count of bytes to unlock */
934 unsigned int count_high; /* count of bytes to unlock */
935 @END
938 /* Create a socket */
939 @REQ(create_socket)
940 unsigned int access; /* wanted access rights */
941 unsigned int attributes; /* object attributes */
942 int family; /* family, see socket manpage */
943 int type; /* type, see socket manpage */
944 int protocol; /* protocol, see socket manpage */
945 unsigned int flags; /* socket flags */
946 @REPLY
947 obj_handle_t handle; /* handle to the new socket */
948 @END
951 /* Accept a socket */
952 @REQ(accept_socket)
953 obj_handle_t lhandle; /* handle to the listening socket */
954 unsigned int access; /* wanted access rights */
955 unsigned int attributes; /* object attributes */
956 @REPLY
957 obj_handle_t handle; /* handle to the new socket */
958 @END
961 /* Set socket event parameters */
962 @REQ(set_socket_event)
963 obj_handle_t handle; /* handle to the socket */
964 unsigned int mask; /* event mask */
965 obj_handle_t event; /* event object */
966 user_handle_t window; /* window to send the message to */
967 unsigned int msg; /* message to send */
968 @END
971 /* Get socket event parameters */
972 @REQ(get_socket_event)
973 obj_handle_t handle; /* handle to the socket */
974 int service; /* clear pending? */
975 obj_handle_t c_event; /* event to clear */
976 @REPLY
977 unsigned int mask; /* event mask */
978 unsigned int pmask; /* pending events */
979 unsigned int state; /* status bits */
980 VARARG(errors,ints); /* event errors */
981 @END
984 /* Reenable pending socket events */
985 @REQ(enable_socket_event)
986 obj_handle_t handle; /* handle to the socket */
987 unsigned int mask; /* events to re-enable */
988 unsigned int sstate; /* status bits to set */
989 unsigned int cstate; /* status bits to clear */
990 @END
992 @REQ(set_socket_deferred)
993 obj_handle_t handle; /* handle to the socket */
994 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
995 @END
997 /* Allocate a console (only used by a console renderer) */
998 @REQ(alloc_console)
999 unsigned int access; /* wanted access rights */
1000 unsigned int attributes; /* object attributes */
1001 process_id_t pid; /* pid of process which shall be attached to the console */
1002 @REPLY
1003 obj_handle_t handle_in; /* handle to console input */
1004 obj_handle_t event; /* handle to renderer events change notification */
1005 @END
1008 /* Free the console of the current process */
1009 @REQ(free_console)
1010 @END
1013 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1014 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1015 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1016 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1017 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1018 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1019 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1020 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1021 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1022 struct console_renderer_event
1024 short event;
1025 union
1027 struct update
1029 short top;
1030 short bottom;
1031 } update;
1032 struct resize
1034 short width;
1035 short height;
1036 } resize;
1037 struct cursor_pos
1039 short x;
1040 short y;
1041 } cursor_pos;
1042 struct cursor_geom
1044 short visible;
1045 short size;
1046 } cursor_geom;
1047 struct display
1049 short left;
1050 short top;
1051 short width;
1052 short height;
1053 } display;
1054 } u;
1057 /* retrieve console events for the renderer */
1058 @REQ(get_console_renderer_events)
1059 obj_handle_t handle; /* handle to console input events */
1060 @REPLY
1061 VARARG(data,bytes); /* the various console_renderer_events */
1062 @END
1065 /* Open a handle to the process console */
1066 @REQ(open_console)
1067 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1068 /* otherwise console_in handle to get active screen buffer? */
1069 unsigned int access; /* wanted access rights */
1070 unsigned int attributes; /* object attributes */
1071 int share; /* share mask (only for output handles) */
1072 @REPLY
1073 obj_handle_t handle; /* handle to the console */
1074 @END
1077 /* Get the input queue wait event */
1078 @REQ(get_console_wait_event)
1079 @REPLY
1080 obj_handle_t handle;
1081 @END
1083 /* Get a console mode (input or output) */
1084 @REQ(get_console_mode)
1085 obj_handle_t handle; /* handle to the console */
1086 @REPLY
1087 int mode; /* console mode */
1088 @END
1091 /* Set a console mode (input or output) */
1092 @REQ(set_console_mode)
1093 obj_handle_t handle; /* handle to the console */
1094 int mode; /* console mode */
1095 @END
1098 /* Set info about a console (input only) */
1099 @REQ(set_console_input_info)
1100 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1101 int mask; /* setting mask (see below) */
1102 obj_handle_t active_sb; /* active screen buffer */
1103 int history_mode; /* whether we duplicate lines in history */
1104 int history_size; /* number of lines in history */
1105 int edition_mode; /* index to the edition mode flavors */
1106 VARARG(title,unicode_str); /* console title */
1107 @END
1108 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1109 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1110 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1111 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1112 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1115 /* Get info about a console (input only) */
1116 @REQ(get_console_input_info)
1117 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1118 @REPLY
1119 int history_mode; /* whether we duplicate lines in history */
1120 int history_size; /* number of lines in history */
1121 int history_index; /* number of used lines in history */
1122 int edition_mode; /* index to the edition mode flavors */
1123 VARARG(title,unicode_str); /* console title */
1124 @END
1127 /* appends a string to console's history */
1128 @REQ(append_console_input_history)
1129 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1130 VARARG(line,unicode_str); /* line to add */
1131 @END
1134 /* appends a string to console's history */
1135 @REQ(get_console_input_history)
1136 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1137 int index; /* index to get line from */
1138 @REPLY
1139 int total; /* total length of line in Unicode chars */
1140 VARARG(line,unicode_str); /* line to add */
1141 @END
1144 /* creates a new screen buffer on process' console */
1145 @REQ(create_console_output)
1146 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1147 unsigned int access; /* wanted access rights */
1148 unsigned int attributes; /* object attributes */
1149 unsigned int share; /* sharing credentials */
1150 @REPLY
1151 obj_handle_t handle_out; /* handle to the screen buffer */
1152 @END
1155 /* Set info about a console (output only) */
1156 @REQ(set_console_output_info)
1157 obj_handle_t handle; /* handle to the console */
1158 int mask; /* setting mask (see below) */
1159 short int cursor_size; /* size of cursor (percentage filled) */
1160 short int cursor_visible;/* cursor visibility flag */
1161 short int cursor_x; /* position of cursor (x, y) */
1162 short int cursor_y;
1163 short int width; /* width of the screen buffer */
1164 short int height; /* height of the screen buffer */
1165 short int attr; /* default attribute */
1166 short int win_left; /* window actually displayed by renderer */
1167 short int win_top; /* the rect area is expressed withing the */
1168 short int win_right; /* boundaries of the screen buffer */
1169 short int win_bottom;
1170 short int max_width; /* maximum size (width x height) for the window */
1171 short int max_height;
1172 @END
1173 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1174 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1175 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1176 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1177 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1178 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1181 /* Get info about a console (output only) */
1182 @REQ(get_console_output_info)
1183 obj_handle_t handle; /* handle to the console */
1184 @REPLY
1185 short int cursor_size; /* size of cursor (percentage filled) */
1186 short int cursor_visible;/* cursor visibility flag */
1187 short int cursor_x; /* position of cursor (x, y) */
1188 short int cursor_y;
1189 short int width; /* width of the screen buffer */
1190 short int height; /* height of the screen buffer */
1191 short int attr; /* default attribute */
1192 short int win_left; /* window actually displayed by renderer */
1193 short int win_top; /* the rect area is expressed withing the */
1194 short int win_right; /* boundaries of the screen buffer */
1195 short int win_bottom;
1196 short int max_width; /* maximum size (width x height) for the window */
1197 short int max_height;
1198 @END
1200 /* Add input records to a console input queue */
1201 @REQ(write_console_input)
1202 obj_handle_t handle; /* handle to the console input */
1203 VARARG(rec,input_records); /* input records */
1204 @REPLY
1205 int written; /* number of records written */
1206 @END
1209 /* Fetch input records from a console input queue */
1210 @REQ(read_console_input)
1211 obj_handle_t handle; /* handle to the console input */
1212 int flush; /* flush the retrieved records from the queue? */
1213 @REPLY
1214 int read; /* number of records read */
1215 VARARG(rec,input_records); /* input records */
1216 @END
1219 /* write data (chars and/or attributes) in a screen buffer */
1220 @REQ(write_console_output)
1221 obj_handle_t handle; /* handle to the console output */
1222 int x; /* position where to start writing */
1223 int y;
1224 int mode; /* char info (see below) */
1225 int wrap; /* wrap around at end of line? */
1226 VARARG(data,bytes); /* info to write */
1227 @REPLY
1228 int written; /* number of char infos actually written */
1229 int width; /* width of screen buffer */
1230 int height; /* height of screen buffer */
1231 @END
1232 enum char_info_mode
1234 CHAR_INFO_MODE_TEXT, /* characters only */
1235 CHAR_INFO_MODE_ATTR, /* attributes only */
1236 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1237 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1241 /* fill a screen buffer with constant data (chars and/or attributes) */
1242 @REQ(fill_console_output)
1243 obj_handle_t handle; /* handle to the console output */
1244 int x; /* position where to start writing */
1245 int y;
1246 int mode; /* char info mode */
1247 int count; /* number to write */
1248 int wrap; /* wrap around at end of line? */
1249 char_info_t data; /* data to write */
1250 @REPLY
1251 int written; /* number of char infos actually written */
1252 @END
1255 /* read data (chars and/or attributes) from a screen buffer */
1256 @REQ(read_console_output)
1257 obj_handle_t handle; /* handle to the console output */
1258 int x; /* position (x,y) where to start reading */
1259 int y;
1260 int mode; /* char info mode */
1261 int wrap; /* wrap around at end of line? */
1262 @REPLY
1263 int width; /* width of screen buffer */
1264 int height; /* height of screen buffer */
1265 VARARG(data,bytes);
1266 @END
1269 /* move a rect (of data) in screen buffer content */
1270 @REQ(move_console_output)
1271 obj_handle_t handle; /* handle to the console output */
1272 short int x_src; /* position (x, y) of rect to start moving from */
1273 short int y_src;
1274 short int x_dst; /* position (x, y) of rect to move to */
1275 short int y_dst;
1276 short int w; /* size of the rect (width, height) to move */
1277 short int h;
1278 @END
1281 /* Sends a signal to a process group */
1282 @REQ(send_console_signal)
1283 int signal; /* the signal to send */
1284 process_id_t group_id; /* the group to send the signal to */
1285 @END
1288 /* enable directory change notifications */
1289 @REQ(read_directory_changes)
1290 unsigned int filter; /* notification filter */
1291 obj_handle_t handle; /* handle to the directory */
1292 int subtree; /* watch the subtree? */
1293 int want_data; /* flag indicating whether change data should be collected */
1294 async_data_t async; /* async I/O parameters */
1295 @END
1298 @REQ(read_change)
1299 obj_handle_t handle;
1300 @REPLY
1301 int action; /* type of change */
1302 VARARG(name,string); /* name of directory entry that changed */
1303 @END
1306 /* Create a file mapping */
1307 @REQ(create_mapping)
1308 unsigned int access; /* wanted access rights */
1309 unsigned int attributes; /* object attributes */
1310 obj_handle_t rootdir; /* root directory */
1311 int size_high; /* mapping size */
1312 int size_low; /* mapping size */
1313 int protect; /* protection flags (see below) */
1314 obj_handle_t file_handle; /* file handle */
1315 VARARG(name,unicode_str); /* object name */
1316 @REPLY
1317 obj_handle_t handle; /* handle to the mapping */
1318 @END
1319 /* protection flags */
1320 #define VPROT_READ 0x01
1321 #define VPROT_WRITE 0x02
1322 #define VPROT_EXEC 0x04
1323 #define VPROT_WRITECOPY 0x08
1324 #define VPROT_GUARD 0x10
1325 #define VPROT_NOCACHE 0x20
1326 #define VPROT_COMMITTED 0x40
1327 #define VPROT_IMAGE 0x80
1330 /* Open a mapping */
1331 @REQ(open_mapping)
1332 unsigned int access; /* wanted access rights */
1333 unsigned int attributes; /* object attributes */
1334 obj_handle_t rootdir; /* root directory */
1335 VARARG(name,unicode_str); /* object name */
1336 @REPLY
1337 obj_handle_t handle; /* handle to the mapping */
1338 @END
1341 /* Get information about a file mapping */
1342 @REQ(get_mapping_info)
1343 obj_handle_t handle; /* handle to the mapping */
1344 @REPLY
1345 int size_high; /* mapping size */
1346 int size_low; /* mapping size */
1347 int protect; /* protection flags */
1348 int header_size; /* header size (for VPROT_IMAGE mapping) */
1349 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1350 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1351 obj_handle_t shared_file; /* shared mapping file handle */
1352 int shared_size; /* shared mapping size */
1353 @END
1356 #define SNAP_HEAPLIST 0x00000001
1357 #define SNAP_PROCESS 0x00000002
1358 #define SNAP_THREAD 0x00000004
1359 #define SNAP_MODULE 0x00000008
1360 /* Create a snapshot */
1361 @REQ(create_snapshot)
1362 unsigned int attributes; /* object attributes */
1363 int flags; /* snapshot flags (SNAP_*) */
1364 process_id_t pid; /* process id */
1365 @REPLY
1366 obj_handle_t handle; /* handle to the snapshot */
1367 @END
1370 /* Get the next process from a snapshot */
1371 @REQ(next_process)
1372 obj_handle_t handle; /* handle to the snapshot */
1373 int reset; /* reset snapshot position? */
1374 @REPLY
1375 int count; /* process usage count */
1376 process_id_t pid; /* process id */
1377 process_id_t ppid; /* parent process id */
1378 void* heap; /* heap base */
1379 void* module; /* main module */
1380 int threads; /* number of threads */
1381 int priority; /* process priority */
1382 int handles; /* number of handles */
1383 VARARG(filename,unicode_str); /* file name of main exe */
1384 @END
1387 /* Get the next thread from a snapshot */
1388 @REQ(next_thread)
1389 obj_handle_t handle; /* handle to the snapshot */
1390 int reset; /* reset snapshot position? */
1391 @REPLY
1392 int count; /* thread usage count */
1393 process_id_t pid; /* process id */
1394 thread_id_t tid; /* thread id */
1395 int base_pri; /* base priority */
1396 int delta_pri; /* delta priority */
1397 @END
1400 /* Get the next module from a snapshot */
1401 @REQ(next_module)
1402 obj_handle_t handle; /* handle to the snapshot */
1403 int reset; /* reset snapshot position? */
1404 @REPLY
1405 process_id_t pid; /* process id */
1406 void* base; /* module base address */
1407 size_t size; /* module size */
1408 VARARG(filename,unicode_str); /* file name of module */
1409 @END
1412 /* Wait for a debug event */
1413 @REQ(wait_debug_event)
1414 int get_handle; /* should we alloc a handle for waiting? */
1415 @REPLY
1416 process_id_t pid; /* process id */
1417 thread_id_t tid; /* thread id */
1418 obj_handle_t wait; /* wait handle if no event ready */
1419 VARARG(event,debug_event); /* debug event data */
1420 @END
1423 /* Queue an exception event */
1424 @REQ(queue_exception_event)
1425 int first; /* first chance exception? */
1426 VARARG(record,exc_event); /* thread context followed by exception record */
1427 @REPLY
1428 obj_handle_t handle; /* handle to the queued event */
1429 @END
1432 /* Retrieve the status of an exception event */
1433 @REQ(get_exception_status)
1434 obj_handle_t handle; /* handle to the queued event */
1435 @REPLY
1436 VARARG(context,context); /* modified thread context */
1437 @END
1440 /* Send an output string to the debugger */
1441 @REQ(output_debug_string)
1442 void* string; /* string to display (in debugged process address space) */
1443 int unicode; /* is it Unicode? */
1444 int length; /* string length */
1445 @END
1448 /* Continue a debug event */
1449 @REQ(continue_debug_event)
1450 process_id_t pid; /* process id to continue */
1451 thread_id_t tid; /* thread id to continue */
1452 int status; /* continuation status */
1453 @END
1456 /* Start/stop debugging an existing process */
1457 @REQ(debug_process)
1458 process_id_t pid; /* id of the process to debug */
1459 int attach; /* 1=attaching / 0=detaching from the process */
1460 @END
1463 /* Simulate a breakpoint in a process */
1464 @REQ(debug_break)
1465 obj_handle_t handle; /* process handle */
1466 @REPLY
1467 int self; /* was it the caller itself? */
1468 @END
1471 /* Set debugger kill on exit flag */
1472 @REQ(set_debugger_kill_on_exit)
1473 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1474 @END
1477 /* Read data from a process address space */
1478 @REQ(read_process_memory)
1479 obj_handle_t handle; /* process handle */
1480 void* addr; /* addr to read from */
1481 @REPLY
1482 VARARG(data,bytes); /* result data */
1483 @END
1486 /* Write data to a process address space */
1487 @REQ(write_process_memory)
1488 obj_handle_t handle; /* process handle */
1489 void* addr; /* addr to write to */
1490 VARARG(data,bytes); /* data to write */
1491 @END
1494 /* Create a registry key */
1495 @REQ(create_key)
1496 obj_handle_t parent; /* handle to the parent key */
1497 unsigned int access; /* desired access rights */
1498 unsigned int attributes; /* object attributes */
1499 unsigned int options; /* creation options */
1500 time_t modif; /* last modification time */
1501 data_size_t namelen; /* length of key name in bytes */
1502 VARARG(name,unicode_str,namelen); /* key name */
1503 VARARG(class,unicode_str); /* class name */
1504 @REPLY
1505 obj_handle_t hkey; /* handle to the created key */
1506 int created; /* has it been newly created? */
1507 @END
1509 /* Open a registry key */
1510 @REQ(open_key)
1511 obj_handle_t parent; /* handle to the parent key */
1512 unsigned int access; /* desired access rights */
1513 unsigned int attributes; /* object attributes */
1514 VARARG(name,unicode_str); /* key name */
1515 @REPLY
1516 obj_handle_t hkey; /* handle to the open key */
1517 @END
1520 /* Delete a registry key */
1521 @REQ(delete_key)
1522 obj_handle_t hkey; /* handle to the key */
1523 @END
1526 /* Flush a registry key */
1527 @REQ(flush_key)
1528 obj_handle_t hkey; /* handle to the key */
1529 @END
1532 /* Enumerate registry subkeys */
1533 @REQ(enum_key)
1534 obj_handle_t hkey; /* handle to registry key */
1535 int index; /* index of subkey (or -1 for current key) */
1536 int info_class; /* requested information class */
1537 @REPLY
1538 int subkeys; /* number of subkeys */
1539 int max_subkey; /* longest subkey name */
1540 int max_class; /* longest class name */
1541 int values; /* number of values */
1542 int max_value; /* longest value name */
1543 int max_data; /* longest value data */
1544 time_t modif; /* last modification time */
1545 data_size_t total; /* total length needed for full name and class */
1546 data_size_t namelen; /* length of key name in bytes */
1547 VARARG(name,unicode_str,namelen); /* key name */
1548 VARARG(class,unicode_str); /* class name */
1549 @END
1552 /* Set a value of a registry key */
1553 @REQ(set_key_value)
1554 obj_handle_t hkey; /* handle to registry key */
1555 int type; /* value type */
1556 data_size_t namelen; /* length of value name in bytes */
1557 VARARG(name,unicode_str,namelen); /* value name */
1558 VARARG(data,bytes); /* value data */
1559 @END
1562 /* Retrieve the value of a registry key */
1563 @REQ(get_key_value)
1564 obj_handle_t hkey; /* handle to registry key */
1565 VARARG(name,unicode_str); /* value name */
1566 @REPLY
1567 int type; /* value type */
1568 data_size_t total; /* total length needed for data */
1569 VARARG(data,bytes); /* value data */
1570 @END
1573 /* Enumerate a value of a registry key */
1574 @REQ(enum_key_value)
1575 obj_handle_t hkey; /* handle to registry key */
1576 int index; /* value index */
1577 int info_class; /* requested information class */
1578 @REPLY
1579 int type; /* value type */
1580 data_size_t total; /* total length needed for full name and data */
1581 data_size_t namelen; /* length of value name in bytes */
1582 VARARG(name,unicode_str,namelen); /* value name */
1583 VARARG(data,bytes); /* value data */
1584 @END
1587 /* Delete a value of a registry key */
1588 @REQ(delete_key_value)
1589 obj_handle_t hkey; /* handle to registry key */
1590 VARARG(name,unicode_str); /* value name */
1591 @END
1594 /* Load a registry branch from a file */
1595 @REQ(load_registry)
1596 obj_handle_t hkey; /* root key to load to */
1597 obj_handle_t file; /* file to load from */
1598 VARARG(name,unicode_str); /* subkey name */
1599 @END
1602 /* UnLoad a registry branch from a file */
1603 @REQ(unload_registry)
1604 obj_handle_t hkey; /* root key to unload to */
1605 @END
1608 /* Save a registry branch to a file */
1609 @REQ(save_registry)
1610 obj_handle_t hkey; /* key to save */
1611 obj_handle_t file; /* file to save to */
1612 @END
1615 /* Add a registry key change notification */
1616 @REQ(set_registry_notification)
1617 obj_handle_t hkey; /* key to watch for changes */
1618 obj_handle_t event; /* event to set */
1619 int subtree; /* should we watch the whole subtree? */
1620 unsigned int filter; /* things to watch */
1621 @END
1624 /* Create a waitable timer */
1625 @REQ(create_timer)
1626 unsigned int access; /* wanted access rights */
1627 unsigned int attributes; /* object attributes */
1628 obj_handle_t rootdir; /* root directory */
1629 int manual; /* manual reset */
1630 VARARG(name,unicode_str); /* object name */
1631 @REPLY
1632 obj_handle_t handle; /* handle to the timer */
1633 @END
1636 /* Open a waitable timer */
1637 @REQ(open_timer)
1638 unsigned int access; /* wanted access rights */
1639 unsigned int attributes; /* object attributes */
1640 obj_handle_t rootdir; /* root directory */
1641 VARARG(name,unicode_str); /* object name */
1642 @REPLY
1643 obj_handle_t handle; /* handle to the timer */
1644 @END
1646 /* Set a waitable timer */
1647 @REQ(set_timer)
1648 obj_handle_t handle; /* handle to the timer */
1649 timeout_t expire; /* next expiration absolute time */
1650 int period; /* timer period in ms */
1651 void* callback; /* callback function */
1652 void* arg; /* callback argument */
1653 @REPLY
1654 int signaled; /* was the timer signaled before this call ? */
1655 @END
1657 /* Cancel a waitable timer */
1658 @REQ(cancel_timer)
1659 obj_handle_t handle; /* handle to the timer */
1660 @REPLY
1661 int signaled; /* was the timer signaled before this calltime ? */
1662 @END
1664 /* Get information on a waitable timer */
1665 @REQ(get_timer_info)
1666 obj_handle_t handle; /* handle to the timer */
1667 @REPLY
1668 timeout_t when; /* absolute time when the timer next expires */
1669 int signaled; /* is the timer signaled? */
1670 @END
1673 /* Retrieve the current context of a thread */
1674 @REQ(get_thread_context)
1675 obj_handle_t handle; /* thread handle */
1676 unsigned int flags; /* context flags */
1677 int suspend; /* if getting context during suspend */
1678 @REPLY
1679 int self; /* was it a handle to the current thread? */
1680 VARARG(context,context); /* thread context */
1681 @END
1684 /* Set the current context of a thread */
1685 @REQ(set_thread_context)
1686 obj_handle_t handle; /* thread handle */
1687 unsigned int flags; /* context flags */
1688 int suspend; /* if setting context during suspend */
1689 VARARG(context,context); /* thread context */
1690 @REPLY
1691 int self; /* was it a handle to the current thread? */
1692 @END
1695 /* Fetch a selector entry for a thread */
1696 @REQ(get_selector_entry)
1697 obj_handle_t handle; /* thread handle */
1698 int entry; /* LDT entry */
1699 @REPLY
1700 unsigned int base; /* selector base */
1701 unsigned int limit; /* selector limit */
1702 unsigned char flags; /* selector flags */
1703 @END
1706 /* Add an atom */
1707 @REQ(add_atom)
1708 obj_handle_t table; /* which table to add atom to */
1709 VARARG(name,unicode_str); /* atom name */
1710 @REPLY
1711 atom_t atom; /* resulting atom */
1712 @END
1715 /* Delete an atom */
1716 @REQ(delete_atom)
1717 obj_handle_t table; /* which table to delete atom from */
1718 atom_t atom; /* atom handle */
1719 @END
1722 /* Find an atom */
1723 @REQ(find_atom)
1724 obj_handle_t table; /* which table to find atom from */
1725 VARARG(name,unicode_str); /* atom name */
1726 @REPLY
1727 atom_t atom; /* atom handle */
1728 @END
1731 /* Get information about an atom */
1732 @REQ(get_atom_information)
1733 obj_handle_t table; /* which table to find atom from */
1734 atom_t atom; /* atom handle */
1735 @REPLY
1736 int count; /* atom lock count */
1737 int pinned; /* whether the atom has been pinned */
1738 data_size_t total; /* actual length of atom name */
1739 VARARG(name,unicode_str); /* atom name */
1740 @END
1743 /* Set information about an atom */
1744 @REQ(set_atom_information)
1745 obj_handle_t table; /* which table to find atom from */
1746 atom_t atom; /* atom handle */
1747 int pinned; /* whether to bump atom information */
1748 @END
1751 /* Empty an atom table */
1752 @REQ(empty_atom_table)
1753 obj_handle_t table; /* which table to find atom from */
1754 int if_pinned; /* whether to delete pinned atoms */
1755 @END
1758 /* Init an atom table */
1759 @REQ(init_atom_table)
1760 int entries; /* number of entries (only for local) */
1761 @REPLY
1762 obj_handle_t table; /* handle to the atom table */
1763 @END
1766 /* Get the message queue of the current thread */
1767 @REQ(get_msg_queue)
1768 @REPLY
1769 obj_handle_t handle; /* handle to the queue */
1770 @END
1773 /* Set the file descriptor associated to the current thread queue */
1774 @REQ(set_queue_fd)
1775 obj_handle_t handle; /* handle to the file descriptor */
1776 @END
1779 /* Set the current message queue wakeup mask */
1780 @REQ(set_queue_mask)
1781 unsigned int wake_mask; /* wakeup bits mask */
1782 unsigned int changed_mask; /* changed bits mask */
1783 int skip_wait; /* will we skip waiting if signaled? */
1784 @REPLY
1785 unsigned int wake_bits; /* current wake bits */
1786 unsigned int changed_bits; /* current changed bits */
1787 @END
1790 /* Get the current message queue status */
1791 @REQ(get_queue_status)
1792 int clear; /* should we clear the change bits? */
1793 @REPLY
1794 unsigned int wake_bits; /* wake bits */
1795 unsigned int changed_bits; /* changed bits since last time */
1796 @END
1799 /* Retrieve the process idle event */
1800 @REQ(get_process_idle_event)
1801 obj_handle_t handle; /* process handle */
1802 @REPLY
1803 obj_handle_t event; /* handle to idle event */
1804 @END
1807 /* Send a message to a thread queue */
1808 @REQ(send_message)
1809 thread_id_t id; /* thread id */
1810 int type; /* message type (see below) */
1811 int flags; /* message flags (see below) */
1812 user_handle_t win; /* window handle */
1813 unsigned int msg; /* message code */
1814 unsigned long wparam; /* parameters */
1815 unsigned long lparam; /* parameters */
1816 timeout_t timeout; /* timeout for reply */
1817 VARARG(data,message_data); /* message data for sent messages */
1818 @END
1820 @REQ(post_quit_message)
1821 int exit_code; /* exit code to return */
1822 @END
1824 enum message_type
1826 MSG_ASCII, /* Ascii message (from SendMessageA) */
1827 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1828 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1829 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1830 MSG_CALLBACK_RESULT,/* result of a callback message */
1831 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1832 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1833 MSG_HARDWARE, /* hardware message */
1834 MSG_WINEVENT /* winevent message */
1836 #define SEND_MSG_ABORT_IF_HUNG 0x01
1839 /* Send a hardware message to a thread queue */
1840 @REQ(send_hardware_message)
1841 thread_id_t id; /* thread id */
1842 user_handle_t win; /* window handle */
1843 unsigned int msg; /* message code */
1844 unsigned int time; /* message time */
1845 unsigned long wparam; /* parameters */
1846 unsigned long lparam; /* parameters */
1847 unsigned long info; /* extra info */
1848 int x; /* x position */
1849 int y; /* y position */
1850 @END
1853 /* Get a message from the current queue */
1854 @REQ(get_message)
1855 unsigned int flags; /* PM_* flags */
1856 user_handle_t get_win; /* window handle to get */
1857 unsigned int get_first; /* first message code to get */
1858 unsigned int get_last; /* last message code to get */
1859 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1860 @REPLY
1861 user_handle_t win; /* window handle */
1862 int type; /* message type */
1863 unsigned int msg; /* message code */
1864 unsigned long wparam; /* parameters */
1865 unsigned long lparam; /* parameters */
1866 unsigned long info; /* extra info */
1867 int x; /* x position */
1868 int y; /* y position */
1869 unsigned int time; /* message time */
1870 unsigned int hw_id; /* id if hardware message */
1871 unsigned int active_hooks; /* active hooks bitmap */
1872 data_size_t total; /* total size of extra data */
1873 VARARG(data,message_data); /* message data for sent messages */
1874 @END
1877 /* Reply to a sent message */
1878 @REQ(reply_message)
1879 unsigned int result; /* message result */
1880 int remove; /* should we remove the message? */
1881 VARARG(data,bytes); /* message data for sent messages */
1882 @END
1885 /* Accept the current hardware message */
1886 @REQ(accept_hardware_message)
1887 unsigned int hw_id; /* id of the hardware message */
1888 int remove; /* should we remove the message? */
1889 user_handle_t new_win; /* new destination window for current message */
1890 @END
1893 /* Retrieve the reply for the last message sent */
1894 @REQ(get_message_reply)
1895 int cancel; /* cancel message if not ready? */
1896 @REPLY
1897 unsigned int result; /* message result */
1898 VARARG(data,bytes); /* message data for sent messages */
1899 @END
1902 /* Set a window timer */
1903 @REQ(set_win_timer)
1904 user_handle_t win; /* window handle */
1905 unsigned int msg; /* message to post */
1906 unsigned int rate; /* timer rate in ms */
1907 unsigned long id; /* timer id */
1908 unsigned long lparam; /* message lparam (callback proc) */
1909 @REPLY
1910 unsigned long id; /* timer id */
1911 @END
1914 /* Kill a window timer */
1915 @REQ(kill_win_timer)
1916 user_handle_t win; /* window handle */
1917 unsigned int msg; /* message to post */
1918 unsigned long id; /* timer id */
1919 @END
1922 /* Retrieve info about a serial port */
1923 @REQ(get_serial_info)
1924 obj_handle_t handle; /* handle to comm port */
1925 @REPLY
1926 unsigned int readinterval;
1927 unsigned int readconst;
1928 unsigned int readmult;
1929 unsigned int writeconst;
1930 unsigned int writemult;
1931 unsigned int eventmask;
1932 @END
1935 /* Set info about a serial port */
1936 @REQ(set_serial_info)
1937 obj_handle_t handle; /* handle to comm port */
1938 int flags; /* bitmask to set values (see below) */
1939 unsigned int readinterval;
1940 unsigned int readconst;
1941 unsigned int readmult;
1942 unsigned int writeconst;
1943 unsigned int writemult;
1944 unsigned int eventmask;
1945 @END
1946 #define SERIALINFO_SET_TIMEOUTS 0x01
1947 #define SERIALINFO_SET_MASK 0x02
1950 /* Create an async I/O */
1951 @REQ(register_async)
1952 obj_handle_t handle; /* handle to comm port, socket or file */
1953 int type; /* type of queue to look after */
1954 int count; /* count - usually # of bytes to be read/written */
1955 async_data_t async; /* async I/O parameters */
1956 @END
1957 #define ASYNC_TYPE_READ 0x01
1958 #define ASYNC_TYPE_WRITE 0x02
1959 #define ASYNC_TYPE_WAIT 0x03
1962 /* Cancel all async op on a fd */
1963 @REQ(cancel_async)
1964 obj_handle_t handle; /* handle to comm port, socket or file */
1965 @END
1968 /* Perform an ioctl on a file */
1969 @REQ(ioctl)
1970 obj_handle_t handle; /* handle to the device */
1971 ioctl_code_t code; /* ioctl code */
1972 async_data_t async; /* async I/O parameters */
1973 VARARG(in_data,bytes); /* ioctl input data */
1974 @REPLY
1975 VARARG(out_data,bytes); /* ioctl output data */
1976 @END
1979 /* Create a named pipe */
1980 @REQ(create_named_pipe)
1981 unsigned int access;
1982 unsigned int attributes; /* object attributes */
1983 obj_handle_t rootdir; /* root directory */
1984 unsigned int options;
1985 unsigned int flags;
1986 unsigned int maxinstances;
1987 unsigned int outsize;
1988 unsigned int insize;
1989 timeout_t timeout;
1990 VARARG(name,unicode_str); /* pipe name */
1991 @REPLY
1992 obj_handle_t handle; /* handle to the pipe */
1993 @END
1995 /* flags in create_named_pipe and get_named_pipe_info */
1996 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1997 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
1998 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
1999 #define NAMED_PIPE_SERVER_END 0x8000
2002 @REQ(get_named_pipe_info)
2003 obj_handle_t handle;
2004 @REPLY
2005 unsigned int flags;
2006 unsigned int maxinstances;
2007 unsigned int instances;
2008 unsigned int outsize;
2009 unsigned int insize;
2010 @END
2013 /* Create a window */
2014 @REQ(create_window)
2015 user_handle_t parent; /* parent window */
2016 user_handle_t owner; /* owner window */
2017 atom_t atom; /* class atom */
2018 void* instance; /* module instance */
2019 @REPLY
2020 user_handle_t handle; /* created window */
2021 user_handle_t parent; /* full handle of parent */
2022 user_handle_t owner; /* full handle of owner */
2023 int extra; /* number of extra bytes */
2024 void* class_ptr; /* pointer to class in client address space */
2025 @END
2028 /* Destroy a window */
2029 @REQ(destroy_window)
2030 user_handle_t handle; /* handle to the window */
2031 @END
2034 /* Retrieve the desktop window for the current thread */
2035 @REQ(get_desktop_window)
2036 int force; /* force creation if it doesn't exist */
2037 @REPLY
2038 user_handle_t handle; /* handle to the desktop window */
2039 @END
2042 /* Set a window owner */
2043 @REQ(set_window_owner)
2044 user_handle_t handle; /* handle to the window */
2045 user_handle_t owner; /* new owner */
2046 @REPLY
2047 user_handle_t full_owner; /* full handle of new owner */
2048 user_handle_t prev_owner; /* full handle of previous owner */
2049 @END
2052 /* Get information from a window handle */
2053 @REQ(get_window_info)
2054 user_handle_t handle; /* handle to the window */
2055 @REPLY
2056 user_handle_t full_handle; /* full 32-bit handle */
2057 user_handle_t last_active; /* last active popup */
2058 process_id_t pid; /* process owning the window */
2059 thread_id_t tid; /* thread owning the window */
2060 atom_t atom; /* class atom */
2061 int is_unicode; /* ANSI or unicode */
2062 @END
2065 /* Set some information in a window */
2066 @REQ(set_window_info)
2067 unsigned int flags; /* flags for fields to set (see below) */
2068 user_handle_t handle; /* handle to the window */
2069 unsigned int style; /* window style */
2070 unsigned int ex_style; /* window extended style */
2071 unsigned int id; /* window id */
2072 int is_unicode; /* ANSI or unicode */
2073 void* instance; /* creator instance */
2074 unsigned long user_data; /* user-specific data */
2075 int extra_offset; /* offset to set in extra bytes */
2076 data_size_t extra_size; /* size to set in extra bytes */
2077 unsigned long extra_value; /* value to set in extra bytes */
2078 @REPLY
2079 unsigned int old_style; /* old window style */
2080 unsigned int old_ex_style; /* old window extended style */
2081 unsigned int old_id; /* old window id */
2082 void* old_instance; /* old creator instance */
2083 unsigned long old_user_data; /* old user-specific data */
2084 unsigned long old_extra_value; /* old value in extra bytes */
2085 @END
2086 #define SET_WIN_STYLE 0x01
2087 #define SET_WIN_EXSTYLE 0x02
2088 #define SET_WIN_ID 0x04
2089 #define SET_WIN_INSTANCE 0x08
2090 #define SET_WIN_USERDATA 0x10
2091 #define SET_WIN_EXTRA 0x20
2092 #define SET_WIN_UNICODE 0x40
2095 /* Set the parent of a window */
2096 @REQ(set_parent)
2097 user_handle_t handle; /* handle to the window */
2098 user_handle_t parent; /* handle to the parent */
2099 @REPLY
2100 user_handle_t old_parent; /* old parent window */
2101 user_handle_t full_parent; /* full handle of new parent */
2102 @END
2105 /* Get a list of the window parents, up to the root of the tree */
2106 @REQ(get_window_parents)
2107 user_handle_t handle; /* handle to the window */
2108 @REPLY
2109 int count; /* total count of parents */
2110 VARARG(parents,user_handles); /* parent handles */
2111 @END
2114 /* Get a list of the window children */
2115 @REQ(get_window_children)
2116 user_handle_t parent; /* parent window */
2117 atom_t atom; /* class atom for the listed children */
2118 thread_id_t tid; /* thread owning the listed children */
2119 @REPLY
2120 int count; /* total count of children */
2121 VARARG(children,user_handles); /* children handles */
2122 @END
2125 /* Get a list of the window children that contain a given point */
2126 @REQ(get_window_children_from_point)
2127 user_handle_t parent; /* parent window */
2128 int x; /* point in parent coordinates */
2129 int y;
2130 @REPLY
2131 int count; /* total count of children */
2132 VARARG(children,user_handles); /* children handles */
2133 @END
2136 /* Get window tree information from a window handle */
2137 @REQ(get_window_tree)
2138 user_handle_t handle; /* handle to the window */
2139 @REPLY
2140 user_handle_t parent; /* parent window */
2141 user_handle_t owner; /* owner window */
2142 user_handle_t next_sibling; /* next sibling in Z-order */
2143 user_handle_t prev_sibling; /* prev sibling in Z-order */
2144 user_handle_t first_sibling; /* first sibling in Z-order */
2145 user_handle_t last_sibling; /* last sibling in Z-order */
2146 user_handle_t first_child; /* first child */
2147 user_handle_t last_child; /* last child */
2148 @END
2150 /* Set the position and Z order of a window */
2151 @REQ(set_window_pos)
2152 unsigned int flags; /* SWP_* flags */
2153 user_handle_t handle; /* handle to the window */
2154 user_handle_t previous; /* previous window in Z order */
2155 rectangle_t window; /* window rectangle */
2156 rectangle_t client; /* client rectangle */
2157 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
2158 @REPLY
2159 unsigned int new_style; /* new window style */
2160 @END
2163 /* Get the window and client rectangles of a window */
2164 @REQ(get_window_rectangles)
2165 user_handle_t handle; /* handle to the window */
2166 @REPLY
2167 rectangle_t window; /* window rectangle */
2168 rectangle_t visible; /* visible part of the window rectangle */
2169 rectangle_t client; /* client rectangle */
2170 @END
2173 /* Get the window text */
2174 @REQ(get_window_text)
2175 user_handle_t handle; /* handle to the window */
2176 @REPLY
2177 VARARG(text,unicode_str); /* window text */
2178 @END
2181 /* Set the window text */
2182 @REQ(set_window_text)
2183 user_handle_t handle; /* handle to the window */
2184 VARARG(text,unicode_str); /* window text */
2185 @END
2188 /* Get the coordinates offset between two windows */
2189 @REQ(get_windows_offset)
2190 user_handle_t from; /* handle to the first window */
2191 user_handle_t to; /* handle to the second window */
2192 @REPLY
2193 int x; /* x coordinate offset */
2194 int y; /* y coordinate offset */
2195 @END
2198 /* Get the visible region of a window */
2199 @REQ(get_visible_region)
2200 user_handle_t window; /* handle to the window */
2201 unsigned int flags; /* DCX flags */
2202 @REPLY
2203 user_handle_t top_win; /* top window to clip against */
2204 rectangle_t top_rect; /* top window visible rect with screen coords */
2205 rectangle_t win_rect; /* window rect in screen coords */
2206 data_size_t total_size; /* total size of the resulting region */
2207 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2208 @END
2211 /* Get the window region */
2212 @REQ(get_window_region)
2213 user_handle_t window; /* handle to the window */
2214 @REPLY
2215 data_size_t total_size; /* total size of the resulting region */
2216 VARARG(region,rectangles); /* list of rectangles for the region */
2217 @END
2220 /* Set the window region */
2221 @REQ(set_window_region)
2222 user_handle_t window; /* handle to the window */
2223 int redraw; /* redraw the window? */
2224 VARARG(region,rectangles); /* list of rectangles for the region */
2225 @END
2228 /* Get the window update region */
2229 @REQ(get_update_region)
2230 user_handle_t window; /* handle to the window */
2231 user_handle_t from_child; /* child to start searching from */
2232 unsigned int flags; /* update flags (see below) */
2233 @REPLY
2234 user_handle_t child; /* child to repaint (or window itself) */
2235 unsigned int flags; /* resulting update flags (see below) */
2236 data_size_t total_size; /* total size of the resulting region */
2237 VARARG(region,rectangles); /* list of rectangles for the region */
2238 @END
2239 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2240 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2241 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2242 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2243 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2244 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2245 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2248 /* Update the z order of a window so that a given rectangle is fully visible */
2249 @REQ(update_window_zorder)
2250 user_handle_t window; /* handle to the window */
2251 rectangle_t rect; /* rectangle that must be visible */
2252 @END
2255 /* Mark parts of a window as needing a redraw */
2256 @REQ(redraw_window)
2257 user_handle_t window; /* handle to the window */
2258 unsigned int flags; /* RDW_* flags */
2259 VARARG(region,rectangles); /* list of rectangles for the region */
2260 @END
2263 /* Set a window property */
2264 @REQ(set_window_property)
2265 user_handle_t window; /* handle to the window */
2266 atom_t atom; /* property atom (if no name specified) */
2267 obj_handle_t handle; /* handle to store */
2268 VARARG(name,unicode_str); /* property name */
2269 @END
2272 /* Remove a window property */
2273 @REQ(remove_window_property)
2274 user_handle_t window; /* handle to the window */
2275 atom_t atom; /* property atom (if no name specified) */
2276 VARARG(name,unicode_str); /* property name */
2277 @REPLY
2278 obj_handle_t handle; /* handle stored in property */
2279 @END
2282 /* Get a window property */
2283 @REQ(get_window_property)
2284 user_handle_t window; /* handle to the window */
2285 atom_t atom; /* property atom (if no name specified) */
2286 VARARG(name,unicode_str); /* property name */
2287 @REPLY
2288 obj_handle_t handle; /* handle stored in property */
2289 @END
2292 /* Get the list of properties of a window */
2293 @REQ(get_window_properties)
2294 user_handle_t window; /* handle to the window */
2295 @REPLY
2296 int total; /* total number of properties */
2297 VARARG(props,properties); /* list of properties */
2298 @END
2301 /* Create a window station */
2302 @REQ(create_winstation)
2303 unsigned int flags; /* window station flags */
2304 unsigned int access; /* wanted access rights */
2305 unsigned int attributes; /* object attributes */
2306 VARARG(name,unicode_str); /* object name */
2307 @REPLY
2308 obj_handle_t handle; /* handle to the window station */
2309 @END
2312 /* Open a handle to a window station */
2313 @REQ(open_winstation)
2314 unsigned int access; /* wanted access rights */
2315 unsigned int attributes; /* object attributes */
2316 VARARG(name,unicode_str); /* object name */
2317 @REPLY
2318 obj_handle_t handle; /* handle to the window station */
2319 @END
2322 /* Close a window station */
2323 @REQ(close_winstation)
2324 obj_handle_t handle; /* handle to the window station */
2325 @END
2328 /* Get the process current window station */
2329 @REQ(get_process_winstation)
2330 @REPLY
2331 obj_handle_t handle; /* handle to the window station */
2332 @END
2335 /* Set the process current window station */
2336 @REQ(set_process_winstation)
2337 obj_handle_t handle; /* handle to the window station */
2338 @END
2341 /* Create a desktop */
2342 @REQ(create_desktop)
2343 unsigned int flags; /* desktop flags */
2344 unsigned int access; /* wanted access rights */
2345 unsigned int attributes; /* object attributes */
2346 VARARG(name,unicode_str); /* object name */
2347 @REPLY
2348 obj_handle_t handle; /* handle to the desktop */
2349 @END
2352 /* Open a handle to a desktop */
2353 @REQ(open_desktop)
2354 unsigned int flags; /* desktop flags */
2355 unsigned int access; /* wanted access rights */
2356 unsigned int attributes; /* object attributes */
2357 VARARG(name,unicode_str); /* object name */
2358 @REPLY
2359 obj_handle_t handle; /* handle to the desktop */
2360 @END
2363 /* Close a desktop */
2364 @REQ(close_desktop)
2365 obj_handle_t handle; /* handle to the desktop */
2366 @END
2369 /* Get the thread current desktop */
2370 @REQ(get_thread_desktop)
2371 thread_id_t tid; /* thread id */
2372 @REPLY
2373 obj_handle_t handle; /* handle to the desktop */
2374 @END
2377 /* Set the thread current desktop */
2378 @REQ(set_thread_desktop)
2379 obj_handle_t handle; /* handle to the desktop */
2380 @END
2383 /* Get/set information about a user object (window station or desktop) */
2384 @REQ(set_user_object_info)
2385 obj_handle_t handle; /* handle to the object */
2386 unsigned int flags; /* information to set */
2387 unsigned int obj_flags; /* new object flags */
2388 @REPLY
2389 int is_desktop; /* is object a desktop? */
2390 unsigned int old_obj_flags; /* old object flags */
2391 VARARG(name,unicode_str); /* object name */
2392 @END
2393 #define SET_USER_OBJECT_FLAGS 1
2396 /* Attach (or detach) thread inputs */
2397 @REQ(attach_thread_input)
2398 thread_id_t tid_from; /* thread to be attached */
2399 thread_id_t tid_to; /* thread to which tid_from should be attached */
2400 int attach; /* is it an attach? */
2401 @END
2404 /* Get input data for a given thread */
2405 @REQ(get_thread_input)
2406 thread_id_t tid; /* id of thread */
2407 @REPLY
2408 user_handle_t focus; /* handle to the focus window */
2409 user_handle_t capture; /* handle to the capture window */
2410 user_handle_t active; /* handle to the active window */
2411 user_handle_t foreground; /* handle to the global foreground window */
2412 user_handle_t menu_owner; /* handle to the menu owner */
2413 user_handle_t move_size; /* handle to the moving/resizing window */
2414 user_handle_t caret; /* handle to the caret window */
2415 rectangle_t rect; /* caret rectangle */
2416 @END
2419 /* Get the time of the last input event */
2420 @REQ(get_last_input_time)
2421 @REPLY
2422 unsigned int time;
2423 @END
2426 /* Retrieve queue keyboard state for a given thread */
2427 @REQ(get_key_state)
2428 thread_id_t tid; /* id of thread */
2429 int key; /* optional key code or -1 */
2430 @REPLY
2431 unsigned char state; /* state of specified key */
2432 VARARG(keystate,bytes); /* state array for all the keys */
2433 @END
2435 /* Set queue keyboard state for a given thread */
2436 @REQ(set_key_state)
2437 thread_id_t tid; /* id of thread */
2438 VARARG(keystate,bytes); /* state array for all the keys */
2439 @END
2441 /* Set the system foreground window */
2442 @REQ(set_foreground_window)
2443 user_handle_t handle; /* handle to the foreground window */
2444 @REPLY
2445 user_handle_t previous; /* handle to the previous foreground window */
2446 int send_msg_old; /* whether we have to send a msg to the old window */
2447 int send_msg_new; /* whether we have to send a msg to the new window */
2448 @END
2450 /* Set the current thread focus window */
2451 @REQ(set_focus_window)
2452 user_handle_t handle; /* handle to the focus window */
2453 @REPLY
2454 user_handle_t previous; /* handle to the previous focus window */
2455 @END
2457 /* Set the current thread active window */
2458 @REQ(set_active_window)
2459 user_handle_t handle; /* handle to the active window */
2460 @REPLY
2461 user_handle_t previous; /* handle to the previous active window */
2462 @END
2464 /* Set the current thread capture window */
2465 @REQ(set_capture_window)
2466 user_handle_t handle; /* handle to the capture window */
2467 unsigned int flags; /* capture flags (see below) */
2468 @REPLY
2469 user_handle_t previous; /* handle to the previous capture window */
2470 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2471 @END
2472 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2473 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2476 /* Set the current thread caret window */
2477 @REQ(set_caret_window)
2478 user_handle_t handle; /* handle to the caret window */
2479 int width; /* caret width */
2480 int height; /* caret height */
2481 @REPLY
2482 user_handle_t previous; /* handle to the previous caret window */
2483 rectangle_t old_rect; /* previous caret rectangle */
2484 int old_hide; /* previous hide count */
2485 int old_state; /* previous caret state (1=on, 0=off) */
2486 @END
2489 /* Set the current thread caret information */
2490 @REQ(set_caret_info)
2491 unsigned int flags; /* caret flags (see below) */
2492 user_handle_t handle; /* handle to the caret window */
2493 int x; /* caret x position */
2494 int y; /* caret y position */
2495 int hide; /* increment for hide count (can be negative to show it) */
2496 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2497 @REPLY
2498 user_handle_t full_handle; /* handle to the current caret window */
2499 rectangle_t old_rect; /* previous caret rectangle */
2500 int old_hide; /* previous hide count */
2501 int old_state; /* previous caret state (1=on, 0=off) */
2502 @END
2503 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2504 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2505 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2508 /* Set a window hook */
2509 @REQ(set_hook)
2510 int id; /* id of the hook */
2511 process_id_t pid; /* id of process to set the hook into */
2512 thread_id_t tid; /* id of thread to set the hook into */
2513 int event_min;
2514 int event_max;
2515 int flags;
2516 void* proc; /* hook procedure */
2517 int unicode; /* is it a unicode hook? */
2518 VARARG(module,unicode_str); /* module name */
2519 @REPLY
2520 user_handle_t handle; /* handle to the hook */
2521 unsigned int active_hooks; /* active hooks bitmap */
2522 @END
2525 /* Remove a window hook */
2526 @REQ(remove_hook)
2527 user_handle_t handle; /* handle to the hook */
2528 int id; /* id of the hook if handle is 0 */
2529 void* proc; /* hook procedure if handle is 0 */
2530 @REPLY
2531 unsigned int active_hooks; /* active hooks bitmap */
2532 @END
2535 /* Start calling a hook chain */
2536 @REQ(start_hook_chain)
2537 int id; /* id of the hook */
2538 int event; /* signalled event */
2539 user_handle_t window; /* handle to the event window */
2540 int object_id; /* object id for out of context winevent */
2541 int child_id; /* child id for out of context winevent */
2542 @REPLY
2543 user_handle_t handle; /* handle to the next hook */
2544 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2545 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2546 void* proc; /* hook procedure */
2547 int unicode; /* is it a unicode hook? */
2548 unsigned int active_hooks; /* active hooks bitmap */
2549 VARARG(module,unicode_str); /* module name */
2550 @END
2553 /* Finished calling a hook chain */
2554 @REQ(finish_hook_chain)
2555 int id; /* id of the hook */
2556 @END
2559 /* Get the hook information */
2560 @REQ(get_hook_info)
2561 user_handle_t handle; /* handle to the current hook */
2562 int get_next; /* do we want info about current or next hook? */
2563 int event; /* signalled event */
2564 user_handle_t window; /* handle to the event window */
2565 int object_id; /* object id for out of context winevent */
2566 int child_id; /* child id for out of context winevent */
2567 @REPLY
2568 user_handle_t handle; /* handle to the hook */
2569 int id; /* id of the hook */
2570 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2571 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2572 void* proc; /* hook procedure */
2573 int unicode; /* is it a unicode hook? */
2574 VARARG(module,unicode_str); /* module name */
2575 @END
2578 /* Create a window class */
2579 @REQ(create_class)
2580 int local; /* is it a local class? */
2581 atom_t atom; /* class atom */
2582 unsigned int style; /* class style */
2583 void* instance; /* module instance */
2584 int extra; /* number of extra class bytes */
2585 int win_extra; /* number of window extra bytes */
2586 void* client_ptr; /* pointer to class in client address space */
2587 @END
2590 /* Destroy a window class */
2591 @REQ(destroy_class)
2592 atom_t atom; /* class atom */
2593 void* instance; /* module instance */
2594 @REPLY
2595 void* client_ptr; /* pointer to class in client address space */
2596 @END
2599 /* Set some information in a class */
2600 @REQ(set_class_info)
2601 user_handle_t window; /* handle to the window */
2602 unsigned int flags; /* flags for info to set (see below) */
2603 atom_t atom; /* class atom */
2604 unsigned int style; /* class style */
2605 int win_extra; /* number of window extra bytes */
2606 void* instance; /* module instance */
2607 int extra_offset; /* offset to set in extra bytes */
2608 data_size_t extra_size; /* size to set in extra bytes */
2609 unsigned long extra_value; /* value to set in extra bytes */
2610 @REPLY
2611 atom_t old_atom; /* previous class atom */
2612 unsigned int old_style; /* previous class style */
2613 int old_extra; /* previous number of class extra bytes */
2614 int old_win_extra; /* previous number of window extra bytes */
2615 void* old_instance; /* previous module instance */
2616 unsigned long old_extra_value; /* old value in extra bytes */
2617 @END
2618 #define SET_CLASS_ATOM 0x0001
2619 #define SET_CLASS_STYLE 0x0002
2620 #define SET_CLASS_WINEXTRA 0x0004
2621 #define SET_CLASS_INSTANCE 0x0008
2622 #define SET_CLASS_EXTRA 0x0010
2625 /* Set/get clipboard information */
2626 @REQ(set_clipboard_info)
2627 unsigned int flags; /* flags for fields to set (see below) */
2628 user_handle_t clipboard; /* clipboard window */
2629 user_handle_t owner; /* clipboard owner */
2630 user_handle_t viewer; /* first clipboard viewer */
2631 unsigned int seqno; /* change sequence number */
2632 @REPLY
2633 unsigned int flags; /* status flags (see below) */
2634 user_handle_t old_clipboard; /* old clipboard window */
2635 user_handle_t old_owner; /* old clipboard owner */
2636 user_handle_t old_viewer; /* old clipboard viewer */
2637 unsigned int seqno; /* current sequence number */
2638 @END
2640 #define SET_CB_OPEN 0x001
2641 #define SET_CB_OWNER 0x002
2642 #define SET_CB_VIEWER 0x004
2643 #define SET_CB_SEQNO 0x008
2644 #define SET_CB_RELOWNER 0x010
2645 #define SET_CB_CLOSE 0x020
2646 #define CB_OPEN 0x040
2647 #define CB_OWNER 0x080
2648 #define CB_PROCESS 0x100
2651 /* Open a security token */
2652 @REQ(open_token)
2653 obj_handle_t handle; /* handle to the thread or process */
2654 unsigned int access; /* access rights to the new token */
2655 unsigned int attributes;/* object attributes */
2656 unsigned int flags; /* flags (see below) */
2657 @REPLY
2658 obj_handle_t token; /* handle to the token */
2659 @END
2660 #define OPEN_TOKEN_THREAD 1
2661 #define OPEN_TOKEN_AS_SELF 2
2664 /* Set/get the global windows */
2665 @REQ(set_global_windows)
2666 unsigned int flags; /* flags for fields to set (see below) */
2667 user_handle_t shell_window; /* handle to the new shell window */
2668 user_handle_t shell_listview; /* handle to the new shell listview window */
2669 user_handle_t progman_window; /* handle to the new program manager window */
2670 user_handle_t taskman_window; /* handle to the new task manager window */
2671 @REPLY
2672 user_handle_t old_shell_window; /* handle to the shell window */
2673 user_handle_t old_shell_listview; /* handle to the shell listview window */
2674 user_handle_t old_progman_window; /* handle to the new program manager window */
2675 user_handle_t old_taskman_window; /* handle to the new task manager window */
2676 @END
2677 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2678 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2679 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2681 /* Adjust the privileges held by a token */
2682 @REQ(adjust_token_privileges)
2683 obj_handle_t handle; /* handle to the token */
2684 int disable_all; /* disable all privileges? */
2685 int get_modified_state; /* get modified privileges? */
2686 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2687 @REPLY
2688 unsigned int len; /* total length in bytes required to store token privileges */
2689 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2690 @END
2692 /* Retrieves the set of privileges held by or available to a token */
2693 @REQ(get_token_privileges)
2694 obj_handle_t handle; /* handle to the token */
2695 @REPLY
2696 unsigned int len; /* total length in bytes required to store token privileges */
2697 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2698 @END
2700 /* Check the token has the required privileges */
2701 @REQ(check_token_privileges)
2702 obj_handle_t handle; /* handle to the token */
2703 int all_required; /* are all the privileges required for the check to succeed? */
2704 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2705 @REPLY
2706 int has_privileges; /* does the token have the required privileges? */
2707 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2708 @END
2710 @REQ(duplicate_token)
2711 obj_handle_t handle; /* handle to the token to duplicate */
2712 unsigned int access; /* access rights to the new token */
2713 unsigned int attributes; /* object attributes */
2714 int primary; /* is the new token to be a primary one? */
2715 int impersonation_level; /* impersonation level of the new token */
2716 @REPLY
2717 obj_handle_t new_handle; /* duplicated handle */
2718 @END
2720 @REQ(access_check)
2721 obj_handle_t handle; /* handle to the token */
2722 unsigned int desired_access; /* desired access to the object */
2723 unsigned int mapping_read; /* mapping from generic read to specific rights */
2724 unsigned int mapping_write; /* mapping from generic write to specific rights */
2725 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2726 unsigned int mapping_all; /* mapping from generic all to specific rights */
2727 VARARG(sd,security_descriptor); /* security descriptor to check */
2728 @REPLY
2729 unsigned int access_granted; /* access rights actually granted */
2730 unsigned int access_status; /* was access granted? */
2731 unsigned int privileges_len; /* length needed to store privileges */
2732 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2733 @END
2735 @REQ(get_token_user)
2736 obj_handle_t handle; /* handle to the token */
2737 @REPLY
2738 data_size_t user_len; /* length needed to store user */
2739 VARARG(user,SID); /* sid of the user the token represents */
2740 @END
2742 @REQ(get_token_groups)
2743 obj_handle_t handle; /* handle to the token */
2744 @REPLY
2745 data_size_t user_len; /* length needed to store user */
2746 VARARG(user,token_groups); /* groups the token's user belongs to */
2747 @END
2749 @REQ(set_security_object)
2750 obj_handle_t handle; /* handle to the object */
2751 unsigned int security_info; /* which parts of security descriptor to set */
2752 VARARG(sd,security_descriptor); /* security descriptor to set */
2753 @END
2755 /* Create a mailslot */
2756 @REQ(create_mailslot)
2757 unsigned int access; /* wanted access rights */
2758 unsigned int attributes; /* object attributes */
2759 obj_handle_t rootdir; /* root directory */
2760 unsigned int max_msgsize;
2761 timeout_t read_timeout;
2762 VARARG(name,unicode_str); /* mailslot name */
2763 @REPLY
2764 obj_handle_t handle; /* handle to the mailslot */
2765 @END
2768 /* Set mailslot information */
2769 @REQ(set_mailslot_info)
2770 obj_handle_t handle; /* handle to the mailslot */
2771 unsigned int flags;
2772 timeout_t read_timeout;
2773 @REPLY
2774 unsigned int max_msgsize;
2775 timeout_t read_timeout;
2776 @END
2777 #define MAILSLOT_SET_READ_TIMEOUT 1
2780 /* Create a directory object */
2781 @REQ(create_directory)
2782 unsigned int access; /* access flags */
2783 unsigned int attributes; /* object attributes */
2784 obj_handle_t rootdir; /* root directory */
2785 VARARG(directory_name,unicode_str); /* Directory name */
2786 @REPLY
2787 obj_handle_t handle; /* handle to the directory */
2788 @END
2791 /* Open a directory object */
2792 @REQ(open_directory)
2793 unsigned int access; /* access flags */
2794 unsigned int attributes; /* object attributes */
2795 obj_handle_t rootdir; /* root directory */
2796 VARARG(directory_name,unicode_str); /* Directory name */
2797 @REPLY
2798 obj_handle_t handle; /* handle to the directory */
2799 @END
2802 /* Create a symbolic link object */
2803 @REQ(create_symlink)
2804 unsigned int access; /* access flags */
2805 unsigned int attributes; /* object attributes */
2806 obj_handle_t rootdir; /* root directory */
2807 data_size_t name_len; /* length of the symlink name in bytes */
2808 VARARG(name,unicode_str,name_len); /* symlink name */
2809 VARARG(target_name,unicode_str); /* target name */
2810 @REPLY
2811 obj_handle_t handle; /* handle to the symlink */
2812 @END
2815 /* Open a symbolic link object */
2816 @REQ(open_symlink)
2817 unsigned int access; /* access flags */
2818 unsigned int attributes; /* object attributes */
2819 obj_handle_t rootdir; /* root directory */
2820 VARARG(name,unicode_str); /* symlink name */
2821 @REPLY
2822 obj_handle_t handle; /* handle to the symlink */
2823 @END
2826 /* Query a symbolic link object */
2827 @REQ(query_symlink)
2828 obj_handle_t handle; /* handle to the symlink */
2829 @REPLY
2830 VARARG(target_name,unicode_str); /* target name */
2831 @END
2834 /* Query basic object information */
2835 @REQ(get_object_info)
2836 obj_handle_t handle; /* handle to the object */
2837 @REPLY
2838 unsigned int access; /* granted access mask */
2839 unsigned int ref_count; /* object ref count */
2840 @END
2842 /* Query the impersonation level of an impersonation token */
2843 @REQ(get_token_impersonation_level)
2844 obj_handle_t handle; /* handle to the object */
2845 @REPLY
2846 int impersonation_level; /* impersonation level of the impersonation token */
2847 @END
2849 /* Allocate a locally-unique identifier */
2850 @REQ(allocate_locally_unique_id)
2851 @REPLY
2852 luid_t luid;
2853 @END