riched20: Fix crash undoing a paste.
[wine/wine64.git] / server / protocol.def
bloba71bceebaa9e173c1e7c0ca39bf5dbf9b91b8b70
1 /* -*- C -*-
3 * Wine server protocol definition
5 * Copyright (C) 2001 Alexandre Julliard
7 * This file is used by tools/make_requests to build the
8 * protocol structures in include/wine/server_protocol.h
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 @HEADER /* start of C declarations */
27 #include <stdarg.h>
28 #include <stdlib.h>
29 #include <time.h>
31 #include <windef.h>
32 #include <winbase.h>
34 typedef void *obj_handle_t;
35 typedef void *user_handle_t;
36 typedef unsigned short atom_t;
37 typedef unsigned int process_id_t;
38 typedef unsigned int thread_id_t;
39 typedef unsigned int data_size_t;
41 struct request_header
43 int req; /* request code */
44 data_size_t request_size; /* request variable part size */
45 data_size_t reply_size; /* reply variable part maximum size */
48 struct reply_header
50 unsigned int error; /* error result */
51 data_size_t reply_size; /* reply variable part size */
54 /* placeholder structure for the maximum allowed request size */
55 /* this is used to construct the generic_request union */
56 struct request_max_size
58 int pad[16]; /* the max request size is 16 ints */
61 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
62 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
65 /* definitions of the event data depending on the event code */
66 struct debug_event_exception
68 EXCEPTION_RECORD record; /* exception record */
69 int first; /* first chance exception? */
71 struct debug_event_create_thread
73 obj_handle_t handle; /* handle to the new thread */
74 void *teb; /* thread teb (in debugged process address space) */
75 void *start; /* thread startup routine */
77 struct debug_event_create_process
79 obj_handle_t file; /* handle to the process exe file */
80 obj_handle_t process; /* handle to the new process */
81 obj_handle_t thread; /* handle to the new thread */
82 void *base; /* base of executable image */
83 int dbg_offset; /* offset of debug info in file */
84 int dbg_size; /* size of debug info */
85 void *teb; /* thread teb (in debugged process address space) */
86 void *start; /* thread startup routine */
87 void *name; /* image name (optional) */
88 int unicode; /* is it Unicode? */
90 struct debug_event_exit
92 int exit_code; /* thread or process exit code */
94 struct debug_event_load_dll
96 obj_handle_t handle; /* file handle for the dll */
97 void *base; /* base address of the dll */
98 int dbg_offset; /* offset of debug info in file */
99 int dbg_size; /* size of debug info */
100 void *name; /* image name (optional) */
101 int unicode; /* is it Unicode? */
103 struct debug_event_unload_dll
105 void *base; /* base address of the dll */
107 struct debug_event_output_string
109 void *string; /* string to display (in debugged process address space) */
110 int unicode; /* is it Unicode? */
111 int length; /* string length */
113 struct debug_event_rip_info
115 int error; /* ??? */
116 int type; /* ??? */
118 union debug_event_data
120 struct debug_event_exception exception;
121 struct debug_event_create_thread create_thread;
122 struct debug_event_create_process create_process;
123 struct debug_event_exit exit;
124 struct debug_event_load_dll load_dll;
125 struct debug_event_unload_dll unload_dll;
126 struct debug_event_output_string output_string;
127 struct debug_event_rip_info rip_info;
130 /* debug event data */
131 typedef struct
133 int code; /* event code */
134 union debug_event_data info; /* event information */
135 } debug_event_t;
137 /* structure used in sending an fd from client to server */
138 struct send_fd
140 thread_id_t tid; /* thread id */
141 int fd; /* file descriptor on client-side */
144 /* structure sent by the server on the wait fifo */
145 struct wake_up_reply
147 void *cookie; /* magic cookie that was passed in select_request */
148 int signaled; /* wait result */
151 /* structure for absolute timeouts */
152 typedef struct
154 int sec; /* seconds since Unix epoch */
155 int usec; /* microseconds */
156 } abs_time_t;
158 /* structure returned in the list of window properties */
159 typedef struct
161 atom_t atom; /* property atom */
162 short string; /* was atom a string originally? */
163 obj_handle_t handle; /* handle stored in property */
164 } property_data_t;
166 /* structure to specify window rectangles */
167 typedef struct
169 int left;
170 int top;
171 int right;
172 int bottom;
173 } rectangle_t;
175 /* structures for extra message data */
177 struct callback_msg_data
179 void *callback; /* callback function */
180 unsigned long data; /* user data for callback */
181 unsigned long result; /* message result */
184 struct winevent_msg_data
186 user_handle_t hook; /* hook handle */
187 thread_id_t tid; /* thread id */
188 void *hook_proc; /* hook proc address */
189 /* followed by module name if any */
192 typedef union
194 unsigned char bytes[1]; /* raw data for sent messages */
195 struct callback_msg_data callback;
196 struct winevent_msg_data winevent;
197 } message_data_t;
199 /* structure for console char/attribute info */
200 typedef struct
202 WCHAR ch;
203 unsigned short attr;
204 } char_info_t;
206 #define MAX_ACL_LEN 65535
208 struct security_descriptor
210 unsigned int control; /* SE_ flags */
211 data_size_t owner_len;
212 data_size_t group_len;
213 data_size_t sacl_len;
214 data_size_t dacl_len;
215 /* VARARGS(owner,SID); */
216 /* VARARGS(group,SID); */
217 /* VARARGS(sacl,ACL); */
218 /* VARARGS(dacl,ACL); */
221 struct token_groups
223 unsigned int count;
224 /* unsigned int attributes[count]; */
225 /* VARARGS(sids,SID); */
228 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC_IO };
230 typedef union
232 enum apc_type type;
233 struct
235 enum apc_type type; /* APC_USER */
236 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
237 unsigned long args[3]; /* arguments for user function */
238 } user;
239 struct
241 enum apc_type type; /* APC_TIMER */
242 void (__stdcall *func)(void*, unsigned int, unsigned int);
243 abs_time_t time; /* absolute time of expiration */
244 void *arg; /* user argument */
245 } timer;
246 struct
248 enum apc_type type; /* APC_ASYNC_IO */
249 void (__stdcall *func)(void*, void*, unsigned int);
250 void *user; /* user pointer */
251 void *sb; /* status block */
252 unsigned int status; /* I/O status */
253 } async_io;
254 } apc_call_t;
256 /****************************************************************/
257 /* Request declarations */
259 /* Create a new process from the context of the parent */
260 @REQ(new_process)
261 int inherit_all; /* inherit all handles from parent */
262 unsigned int create_flags; /* creation flags */
263 int socket_fd; /* file descriptor for process socket */
264 obj_handle_t exe_file; /* file handle for main exe */
265 obj_handle_t hstdin; /* handle for stdin */
266 obj_handle_t hstdout; /* handle for stdout */
267 obj_handle_t hstderr; /* handle for stderr */
268 unsigned int process_access; /* access rights for process object */
269 unsigned int process_attr; /* attributes for process object */
270 unsigned int thread_access; /* access rights for thread object */
271 unsigned int thread_attr; /* attributes for thread object */
272 VARARG(info,startup_info); /* startup information */
273 VARARG(env,unicode_str); /* environment for new process */
274 @REPLY
275 obj_handle_t info; /* new process info handle */
276 process_id_t pid; /* process id */
277 obj_handle_t phandle; /* process handle (in the current process) */
278 thread_id_t tid; /* thread id */
279 obj_handle_t thandle; /* thread handle (in the current process) */
280 @END
283 /* Retrieve information about a newly started process */
284 @REQ(get_new_process_info)
285 obj_handle_t info; /* info handle returned from new_process_request */
286 @REPLY
287 int success; /* did the process start successfully? */
288 int exit_code; /* process exit code if failed */
289 @END
292 /* Create a new thread from the context of the parent */
293 @REQ(new_thread)
294 unsigned int access; /* wanted access rights */
295 unsigned int attributes; /* object attributes */
296 int suspend; /* new thread should be suspended on creation */
297 int request_fd; /* fd for request pipe */
298 @REPLY
299 thread_id_t tid; /* thread id */
300 obj_handle_t handle; /* thread handle (in the current process) */
301 @END
304 /* Retrieve the new process startup info */
305 @REQ(get_startup_info)
306 @REPLY
307 obj_handle_t exe_file; /* file handle for main exe */
308 obj_handle_t hstdin; /* handle for stdin */
309 obj_handle_t hstdout; /* handle for stdout */
310 obj_handle_t hstderr; /* handle for stderr */
311 VARARG(info,startup_info); /* startup information */
312 VARARG(env,unicode_str); /* environment */
313 @END
316 /* Signal the end of the process initialization */
317 @REQ(init_process_done)
318 void* module; /* main module base address */
319 void* entry; /* process entry point */
320 int gui; /* is it a GUI process? */
321 @END
324 /* Initialize a thread; called from the child after fork()/clone() */
325 @REQ(init_thread)
326 int unix_pid; /* Unix pid of new thread */
327 int unix_tid; /* Unix tid of new thread */
328 int debug_level; /* new debug level */
329 void* teb; /* TEB of new thread (in thread address space) */
330 void* peb; /* address of PEB (in thread address space) */
331 void* entry; /* thread entry point (in thread address space) */
332 void* ldt_copy; /* address of LDT copy (in thread address space) */
333 int reply_fd; /* fd for reply pipe */
334 int wait_fd; /* fd for blocking calls pipe */
335 @REPLY
336 process_id_t pid; /* process id of the new thread's process */
337 thread_id_t tid; /* thread id of the new thread */
338 data_size_t info_size; /* total size of startup info */
339 abs_time_t server_start; /* server start time */
340 int version; /* protocol version */
341 @END
344 /* Terminate a process */
345 @REQ(terminate_process)
346 obj_handle_t handle; /* process handle to terminate */
347 int exit_code; /* process exit code */
348 @REPLY
349 int self; /* suicide? */
350 @END
353 /* Terminate a thread */
354 @REQ(terminate_thread)
355 obj_handle_t handle; /* thread handle to terminate */
356 int exit_code; /* thread exit code */
357 @REPLY
358 int self; /* suicide? */
359 int last; /* last thread in this process? */
360 @END
363 /* Retrieve information about a process */
364 @REQ(get_process_info)
365 obj_handle_t handle; /* process handle */
366 @REPLY
367 process_id_t pid; /* server process id */
368 process_id_t ppid; /* server process id of parent */
369 int exit_code; /* process exit code */
370 int priority; /* priority class */
371 int affinity; /* process affinity mask */
372 void* peb; /* PEB address in process address space */
373 abs_time_t start_time; /* process start time */
374 abs_time_t end_time; /* process end time */
375 @END
378 /* Set a process informations */
379 @REQ(set_process_info)
380 obj_handle_t handle; /* process handle */
381 int mask; /* setting mask (see below) */
382 int priority; /* priority class */
383 int affinity; /* affinity mask */
384 @END
385 #define SET_PROCESS_INFO_PRIORITY 0x01
386 #define SET_PROCESS_INFO_AFFINITY 0x02
389 /* Retrieve information about a thread */
390 @REQ(get_thread_info)
391 obj_handle_t handle; /* thread handle */
392 thread_id_t tid_in; /* thread id (optional) */
393 @REPLY
394 process_id_t pid; /* server process id */
395 thread_id_t tid; /* server thread id */
396 void* teb; /* thread teb pointer */
397 int exit_code; /* thread exit code */
398 int priority; /* thread priority level */
399 int affinity; /* thread affinity mask */
400 abs_time_t creation_time; /* thread creation time */
401 abs_time_t exit_time; /* thread exit time */
402 int last; /* last thread in process */
403 @END
406 /* Set a thread informations */
407 @REQ(set_thread_info)
408 obj_handle_t handle; /* thread handle */
409 int mask; /* setting mask (see below) */
410 int priority; /* priority class */
411 int affinity; /* affinity mask */
412 obj_handle_t token; /* impersonation token */
413 @END
414 #define SET_THREAD_INFO_PRIORITY 0x01
415 #define SET_THREAD_INFO_AFFINITY 0x02
416 #define SET_THREAD_INFO_TOKEN 0x04
419 /* Retrieve information about a module */
420 @REQ(get_dll_info)
421 obj_handle_t handle; /* process handle */
422 void* base_address; /* base address of module */
423 @REPLY
424 size_t size; /* module size */
425 void* entry_point;
426 VARARG(filename,unicode_str); /* file name of module */
427 @END
430 /* Suspend a thread */
431 @REQ(suspend_thread)
432 obj_handle_t handle; /* thread handle */
433 @REPLY
434 int count; /* new suspend count */
435 @END
438 /* Resume a thread */
439 @REQ(resume_thread)
440 obj_handle_t handle; /* thread handle */
441 @REPLY
442 int count; /* new suspend count */
443 @END
446 /* Notify the server that a dll has been loaded */
447 @REQ(load_dll)
448 obj_handle_t handle; /* file handle */
449 void* base; /* base address */
450 size_t size; /* dll size */
451 int dbg_offset; /* debug info offset */
452 int dbg_size; /* debug info size */
453 void* name; /* ptr to ptr to name (in process addr space) */
454 VARARG(filename,unicode_str); /* file name of dll */
455 @END
458 /* Notify the server that a dll is being unloaded */
459 @REQ(unload_dll)
460 void* base; /* base address */
461 @END
464 /* Queue an APC for a thread */
465 @REQ(queue_apc)
466 obj_handle_t handle; /* thread handle */
467 apc_call_t call; /* call arguments */
468 @END
471 /* Get next APC to call */
472 @REQ(get_apc)
473 int alertable; /* is thread alertable? */
474 obj_handle_t prev; /* handle to previous APC */
475 @REPLY
476 obj_handle_t handle; /* handle to APC */
477 apc_call_t call; /* call arguments */
478 @END
481 /* Close a handle for the current process */
482 @REQ(close_handle)
483 obj_handle_t handle; /* handle to close */
484 @END
487 /* Set a handle information */
488 @REQ(set_handle_info)
489 obj_handle_t handle; /* handle we are interested in */
490 int flags; /* new handle flags */
491 int mask; /* mask for flags to set */
492 @REPLY
493 int old_flags; /* old flag value */
494 @END
497 /* Duplicate a handle */
498 @REQ(dup_handle)
499 obj_handle_t src_process; /* src process handle */
500 obj_handle_t src_handle; /* src handle to duplicate */
501 obj_handle_t dst_process; /* dst process handle */
502 unsigned int access; /* wanted access rights */
503 unsigned int attributes; /* object attributes */
504 unsigned int options; /* duplicate options (see below) */
505 @REPLY
506 obj_handle_t handle; /* duplicated handle in dst process */
507 int closed; /* whether the source handle has been closed */
508 @END
509 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
510 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
511 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
514 /* Open a handle to a process */
515 @REQ(open_process)
516 process_id_t pid; /* process id to open */
517 unsigned int access; /* wanted access rights */
518 unsigned int attributes; /* object attributes */
519 @REPLY
520 obj_handle_t handle; /* handle to the process */
521 @END
524 /* Open a handle to a thread */
525 @REQ(open_thread)
526 thread_id_t tid; /* thread id to open */
527 unsigned int access; /* wanted access rights */
528 unsigned int attributes; /* object attributes */
529 @REPLY
530 obj_handle_t handle; /* handle to the thread */
531 @END
534 /* Wait for handles */
535 @REQ(select)
536 int flags; /* wait flags (see below) */
537 void* cookie; /* magic cookie to return to client */
538 obj_handle_t signal; /* object to signal (0 if none) */
539 abs_time_t timeout; /* absolute timeout */
540 VARARG(handles,handles); /* handles to select on */
541 @END
542 #define SELECT_ALL 1
543 #define SELECT_ALERTABLE 2
544 #define SELECT_INTERRUPTIBLE 4
545 #define SELECT_TIMEOUT 8
548 /* Create an event */
549 @REQ(create_event)
550 unsigned int access; /* wanted access rights */
551 unsigned int attributes; /* object attributes */
552 obj_handle_t rootdir; /* root directory */
553 int manual_reset; /* manual reset event */
554 int initial_state; /* initial state of the event */
555 VARARG(name,unicode_str); /* object name */
556 @REPLY
557 obj_handle_t handle; /* handle to the event */
558 @END
560 /* Event operation */
561 @REQ(event_op)
562 obj_handle_t handle; /* handle to event */
563 int op; /* event operation (see below) */
564 @END
565 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
568 /* Open an event */
569 @REQ(open_event)
570 unsigned int access; /* wanted access rights */
571 unsigned int attributes; /* object attributes */
572 obj_handle_t rootdir; /* root directory */
573 VARARG(name,unicode_str); /* object name */
574 @REPLY
575 obj_handle_t handle; /* handle to the event */
576 @END
579 /* Create a mutex */
580 @REQ(create_mutex)
581 unsigned int access; /* wanted access rights */
582 unsigned int attributes; /* object attributes */
583 obj_handle_t rootdir; /* root directory */
584 int owned; /* initially owned? */
585 VARARG(name,unicode_str); /* object name */
586 @REPLY
587 obj_handle_t handle; /* handle to the mutex */
588 @END
591 /* Release a mutex */
592 @REQ(release_mutex)
593 obj_handle_t handle; /* handle to the mutex */
594 @REPLY
595 unsigned int prev_count; /* value of internal counter, before release */
596 @END
599 /* Open a mutex */
600 @REQ(open_mutex)
601 unsigned int access; /* wanted access rights */
602 unsigned int attributes; /* object attributes */
603 obj_handle_t rootdir; /* root directory */
604 VARARG(name,unicode_str); /* object name */
605 @REPLY
606 obj_handle_t handle; /* handle to the mutex */
607 @END
610 /* Create a semaphore */
611 @REQ(create_semaphore)
612 unsigned int access; /* wanted access rights */
613 unsigned int attributes; /* object attributes */
614 obj_handle_t rootdir; /* root directory */
615 unsigned int initial; /* initial count */
616 unsigned int max; /* maximum count */
617 VARARG(name,unicode_str); /* object name */
618 @REPLY
619 obj_handle_t handle; /* handle to the semaphore */
620 @END
623 /* Release a semaphore */
624 @REQ(release_semaphore)
625 obj_handle_t handle; /* handle to the semaphore */
626 unsigned int count; /* count to add to semaphore */
627 @REPLY
628 unsigned int prev_count; /* previous semaphore count */
629 @END
632 /* Open a semaphore */
633 @REQ(open_semaphore)
634 unsigned int access; /* wanted access rights */
635 unsigned int attributes; /* object attributes */
636 obj_handle_t rootdir; /* root directory */
637 VARARG(name,unicode_str); /* object name */
638 @REPLY
639 obj_handle_t handle; /* handle to the semaphore */
640 @END
643 /* Create a file */
644 @REQ(create_file)
645 unsigned int access; /* wanted access rights */
646 unsigned int attributes; /* object attributes */
647 unsigned int sharing; /* sharing flags */
648 int create; /* file create action */
649 unsigned int options; /* file options */
650 unsigned int attrs; /* file attributes for creation */
651 VARARG(filename,string); /* file name */
652 @REPLY
653 obj_handle_t handle; /* handle to the file */
654 @END
657 /* Open a file object */
658 @REQ(open_file_object)
659 unsigned int access; /* wanted access rights */
660 unsigned int attributes; /* open attributes */
661 obj_handle_t rootdir; /* root directory */
662 unsigned int sharing; /* sharing flags */
663 VARARG(filename,unicode_str); /* file name */
664 @REPLY
665 obj_handle_t handle; /* handle to the file */
666 @END
669 /* Allocate a file handle for a Unix fd */
670 @REQ(alloc_file_handle)
671 unsigned int access; /* wanted access rights */
672 unsigned int attributes; /* object attributes */
673 int fd; /* file descriptor on the client side */
674 @REPLY
675 obj_handle_t handle; /* handle to the file */
676 @END
679 /* Get a Unix fd to access a file */
680 @REQ(get_handle_fd)
681 obj_handle_t handle; /* handle to the file */
682 unsigned int access; /* wanted access rights */
683 int cached; /* is it cached on the client already? */
684 @REPLY
685 int type; /* file type (see below) */
686 int flags; /* file read/write flags (see below) */
687 @END
688 enum server_fd_type
690 FD_TYPE_INVALID, /* invalid file (no associated fd) */
691 FD_TYPE_FILE, /* regular file */
692 FD_TYPE_DIR, /* directory */
693 FD_TYPE_SOCKET, /* socket */
694 FD_TYPE_SERIAL, /* serial port */
695 FD_TYPE_PIPE, /* named pipe */
696 FD_TYPE_MAILSLOT, /* mailslot */
697 FD_TYPE_DEVICE, /* Windows device file */
698 FD_TYPE_NB_TYPES
700 #define FD_FLAG_OVERLAPPED 0x01 /* fd opened in overlapped mode */
701 #define FD_FLAG_TIMEOUT 0x02 /* read/write is synchronous */
702 #define FD_FLAG_RECV_SHUTDOWN 0x04
703 #define FD_FLAG_SEND_SHUTDOWN 0x08
704 #define FD_FLAG_AVAILABLE 0x10 /* in overlap read/write operation,
705 * only handle available data (don't wait) */
706 #define FD_FLAG_REMOVABLE 0x20 /* is it on a removable device? */
708 /* Flush a file buffers */
709 @REQ(flush_file)
710 obj_handle_t handle; /* handle to the file */
711 @REPLY
712 obj_handle_t event; /* event set when finished */
713 @END
716 /* Lock a region of a file */
717 @REQ(lock_file)
718 obj_handle_t handle; /* handle to the file */
719 unsigned int offset_low; /* offset of start of lock */
720 unsigned int offset_high; /* offset of start of lock */
721 unsigned int count_low; /* count of bytes to lock */
722 unsigned int count_high; /* count of bytes to lock */
723 int shared; /* shared or exclusive lock? */
724 int wait; /* do we want to wait? */
725 @REPLY
726 obj_handle_t handle; /* handle to wait on */
727 int overlapped; /* is it an overlapped I/O handle? */
728 @END
731 /* Unlock a region of a file */
732 @REQ(unlock_file)
733 obj_handle_t handle; /* handle to the file */
734 unsigned int offset_low; /* offset of start of unlock */
735 unsigned int offset_high; /* offset of start of unlock */
736 unsigned int count_low; /* count of bytes to unlock */
737 unsigned int count_high; /* count of bytes to unlock */
738 @END
741 /* Get ready to unmount a Unix device */
742 @REQ(unmount_device)
743 obj_handle_t handle; /* handle to a file on the device */
744 @END
747 /* Create a socket */
748 @REQ(create_socket)
749 unsigned int access; /* wanted access rights */
750 unsigned int attributes; /* object attributes */
751 int family; /* family, see socket manpage */
752 int type; /* type, see socket manpage */
753 int protocol; /* protocol, see socket manpage */
754 unsigned int flags; /* socket flags */
755 @REPLY
756 obj_handle_t handle; /* handle to the new socket */
757 @END
760 /* Accept a socket */
761 @REQ(accept_socket)
762 obj_handle_t lhandle; /* handle to the listening socket */
763 unsigned int access; /* wanted access rights */
764 unsigned int attributes; /* object attributes */
765 @REPLY
766 obj_handle_t handle; /* handle to the new socket */
767 @END
770 /* Set socket event parameters */
771 @REQ(set_socket_event)
772 obj_handle_t handle; /* handle to the socket */
773 unsigned int mask; /* event mask */
774 obj_handle_t event; /* event object */
775 user_handle_t window; /* window to send the message to */
776 unsigned int msg; /* message to send */
777 @END
780 /* Get socket event parameters */
781 @REQ(get_socket_event)
782 obj_handle_t handle; /* handle to the socket */
783 int service; /* clear pending? */
784 obj_handle_t c_event; /* event to clear */
785 @REPLY
786 unsigned int mask; /* event mask */
787 unsigned int pmask; /* pending events */
788 unsigned int state; /* status bits */
789 VARARG(errors,ints); /* event errors */
790 @END
793 /* Reenable pending socket events */
794 @REQ(enable_socket_event)
795 obj_handle_t handle; /* handle to the socket */
796 unsigned int mask; /* events to re-enable */
797 unsigned int sstate; /* status bits to set */
798 unsigned int cstate; /* status bits to clear */
799 @END
801 @REQ(set_socket_deferred)
802 obj_handle_t handle; /* handle to the socket */
803 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
804 @END
806 /* Allocate a console (only used by a console renderer) */
807 @REQ(alloc_console)
808 unsigned int access; /* wanted access rights */
809 unsigned int attributes; /* object attributes */
810 process_id_t pid; /* pid of process which shall be attached to the console */
811 @REPLY
812 obj_handle_t handle_in; /* handle to console input */
813 obj_handle_t event; /* handle to renderer events change notification */
814 @END
817 /* Free the console of the current process */
818 @REQ(free_console)
819 @END
822 #define CONSOLE_RENDERER_NONE_EVENT 0x00
823 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
824 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
825 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
826 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
827 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
828 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
829 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
830 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
831 struct console_renderer_event
833 short event;
834 union
836 struct update
838 short top;
839 short bottom;
840 } update;
841 struct resize
843 short width;
844 short height;
845 } resize;
846 struct cursor_pos
848 short x;
849 short y;
850 } cursor_pos;
851 struct cursor_geom
853 short visible;
854 short size;
855 } cursor_geom;
856 struct display
858 short left;
859 short top;
860 short width;
861 short height;
862 } display;
863 } u;
866 /* retrieve console events for the renderer */
867 @REQ(get_console_renderer_events)
868 obj_handle_t handle; /* handle to console input events */
869 @REPLY
870 VARARG(data,bytes); /* the various console_renderer_events */
871 @END
874 /* Open a handle to the process console */
875 @REQ(open_console)
876 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
877 /* otherwise console_in handle to get active screen buffer? */
878 unsigned int access; /* wanted access rights */
879 unsigned int attributes; /* object attributes */
880 int share; /* share mask (only for output handles) */
881 @REPLY
882 obj_handle_t handle; /* handle to the console */
883 @END
886 /* Get the input queue wait event */
887 @REQ(get_console_wait_event)
888 @REPLY
889 obj_handle_t handle;
890 @END
892 /* Get a console mode (input or output) */
893 @REQ(get_console_mode)
894 obj_handle_t handle; /* handle to the console */
895 @REPLY
896 int mode; /* console mode */
897 @END
900 /* Set a console mode (input or output) */
901 @REQ(set_console_mode)
902 obj_handle_t handle; /* handle to the console */
903 int mode; /* console mode */
904 @END
907 /* Set info about a console (input only) */
908 @REQ(set_console_input_info)
909 obj_handle_t handle; /* handle to console input, or 0 for process' console */
910 int mask; /* setting mask (see below) */
911 obj_handle_t active_sb; /* active screen buffer */
912 int history_mode; /* whether we duplicate lines in history */
913 int history_size; /* number of lines in history */
914 int edition_mode; /* index to the edition mode flavors */
915 VARARG(title,unicode_str); /* console title */
916 @END
917 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
918 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
919 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
920 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
921 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
924 /* Get info about a console (input only) */
925 @REQ(get_console_input_info)
926 obj_handle_t handle; /* handle to console input, or 0 for process' console */
927 @REPLY
928 int history_mode; /* whether we duplicate lines in history */
929 int history_size; /* number of lines in history */
930 int history_index; /* number of used lines in history */
931 int edition_mode; /* index to the edition mode flavors */
932 VARARG(title,unicode_str); /* console title */
933 @END
936 /* appends a string to console's history */
937 @REQ(append_console_input_history)
938 obj_handle_t handle; /* handle to console input, or 0 for process' console */
939 VARARG(line,unicode_str); /* line to add */
940 @END
943 /* appends a string to console's history */
944 @REQ(get_console_input_history)
945 obj_handle_t handle; /* handle to console input, or 0 for process' console */
946 int index; /* index to get line from */
947 @REPLY
948 int total; /* total length of line in Unicode chars */
949 VARARG(line,unicode_str); /* line to add */
950 @END
953 /* creates a new screen buffer on process' console */
954 @REQ(create_console_output)
955 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
956 unsigned int access; /* wanted access rights */
957 unsigned int attributes; /* object attributes */
958 unsigned int share; /* sharing credentials */
959 @REPLY
960 obj_handle_t handle_out; /* handle to the screen buffer */
961 @END
964 /* Set info about a console (output only) */
965 @REQ(set_console_output_info)
966 obj_handle_t handle; /* handle to the console */
967 int mask; /* setting mask (see below) */
968 short int cursor_size; /* size of cursor (percentage filled) */
969 short int cursor_visible;/* cursor visibility flag */
970 short int cursor_x; /* position of cursor (x, y) */
971 short int cursor_y;
972 short int width; /* width of the screen buffer */
973 short int height; /* height of the screen buffer */
974 short int attr; /* default attribute */
975 short int win_left; /* window actually displayed by renderer */
976 short int win_top; /* the rect area is expressed withing the */
977 short int win_right; /* boundaries of the screen buffer */
978 short int win_bottom;
979 short int max_width; /* maximum size (width x height) for the window */
980 short int max_height;
981 @END
982 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
983 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
984 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
985 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
986 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
987 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
990 /* Get info about a console (output only) */
991 @REQ(get_console_output_info)
992 obj_handle_t handle; /* handle to the console */
993 @REPLY
994 short int cursor_size; /* size of cursor (percentage filled) */
995 short int cursor_visible;/* cursor visibility flag */
996 short int cursor_x; /* position of cursor (x, y) */
997 short int cursor_y;
998 short int width; /* width of the screen buffer */
999 short int height; /* height of the screen buffer */
1000 short int attr; /* default attribute */
1001 short int win_left; /* window actually displayed by renderer */
1002 short int win_top; /* the rect area is expressed withing the */
1003 short int win_right; /* boundaries of the screen buffer */
1004 short int win_bottom;
1005 short int max_width; /* maximum size (width x height) for the window */
1006 short int max_height;
1007 @END
1009 /* Add input records to a console input queue */
1010 @REQ(write_console_input)
1011 obj_handle_t handle; /* handle to the console input */
1012 VARARG(rec,input_records); /* input records */
1013 @REPLY
1014 int written; /* number of records written */
1015 @END
1018 /* Fetch input records from a console input queue */
1019 @REQ(read_console_input)
1020 obj_handle_t handle; /* handle to the console input */
1021 int flush; /* flush the retrieved records from the queue? */
1022 @REPLY
1023 int read; /* number of records read */
1024 VARARG(rec,input_records); /* input records */
1025 @END
1028 /* write data (chars and/or attributes) in a screen buffer */
1029 @REQ(write_console_output)
1030 obj_handle_t handle; /* handle to the console output */
1031 int x; /* position where to start writing */
1032 int y;
1033 int mode; /* char info (see below) */
1034 int wrap; /* wrap around at end of line? */
1035 VARARG(data,bytes); /* info to write */
1036 @REPLY
1037 int written; /* number of char infos actually written */
1038 int width; /* width of screen buffer */
1039 int height; /* height of screen buffer */
1040 @END
1041 enum char_info_mode
1043 CHAR_INFO_MODE_TEXT, /* characters only */
1044 CHAR_INFO_MODE_ATTR, /* attributes only */
1045 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1046 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1050 /* fill a screen buffer with constant data (chars and/or attributes) */
1051 @REQ(fill_console_output)
1052 obj_handle_t handle; /* handle to the console output */
1053 int x; /* position where to start writing */
1054 int y;
1055 int mode; /* char info mode */
1056 int count; /* number to write */
1057 int wrap; /* wrap around at end of line? */
1058 char_info_t data; /* data to write */
1059 @REPLY
1060 int written; /* number of char infos actually written */
1061 @END
1064 /* read data (chars and/or attributes) from a screen buffer */
1065 @REQ(read_console_output)
1066 obj_handle_t handle; /* handle to the console output */
1067 int x; /* position (x,y) where to start reading */
1068 int y;
1069 int mode; /* char info mode */
1070 int wrap; /* wrap around at end of line? */
1071 @REPLY
1072 int width; /* width of screen buffer */
1073 int height; /* height of screen buffer */
1074 VARARG(data,bytes);
1075 @END
1078 /* move a rect (of data) in screen buffer content */
1079 @REQ(move_console_output)
1080 obj_handle_t handle; /* handle to the console output */
1081 short int x_src; /* position (x, y) of rect to start moving from */
1082 short int y_src;
1083 short int x_dst; /* position (x, y) of rect to move to */
1084 short int y_dst;
1085 short int w; /* size of the rect (width, height) to move */
1086 short int h;
1087 @END
1090 /* Sends a signal to a process group */
1091 @REQ(send_console_signal)
1092 int signal; /* the signal to send */
1093 process_id_t group_id; /* the group to send the signal to */
1094 @END
1097 /* enable directory change notifications */
1098 @REQ(read_directory_changes)
1099 unsigned int filter; /* notification filter */
1100 obj_handle_t handle; /* handle to the directory */
1101 obj_handle_t event; /* handle to the event */
1102 int subtree; /* watch the subtree? */
1103 int want_data; /* flag indicating whether change data should be collected */
1104 void* io_apc; /* APC routine to queue upon end of async */
1105 void* io_sb; /* I/O status block (unique across all async on this handle) */
1106 void* io_user; /* data to pass back to caller */
1107 @END
1110 @REQ(read_change)
1111 obj_handle_t handle;
1112 @REPLY
1113 int action; /* type of change */
1114 VARARG(name,string); /* name of directory entry that changed */
1115 @END
1118 /* Create a file mapping */
1119 @REQ(create_mapping)
1120 unsigned int access; /* wanted access rights */
1121 unsigned int attributes; /* object attributes */
1122 obj_handle_t rootdir; /* root directory */
1123 int size_high; /* mapping size */
1124 int size_low; /* mapping size */
1125 int protect; /* protection flags (see below) */
1126 obj_handle_t file_handle; /* file handle */
1127 VARARG(name,unicode_str); /* object name */
1128 @REPLY
1129 obj_handle_t handle; /* handle to the mapping */
1130 @END
1131 /* protection flags */
1132 #define VPROT_READ 0x01
1133 #define VPROT_WRITE 0x02
1134 #define VPROT_EXEC 0x04
1135 #define VPROT_WRITECOPY 0x08
1136 #define VPROT_GUARD 0x10
1137 #define VPROT_NOCACHE 0x20
1138 #define VPROT_COMMITTED 0x40
1139 #define VPROT_IMAGE 0x80
1142 /* Open a mapping */
1143 @REQ(open_mapping)
1144 unsigned int access; /* wanted access rights */
1145 unsigned int attributes; /* object attributes */
1146 obj_handle_t rootdir; /* root directory */
1147 VARARG(name,unicode_str); /* object name */
1148 @REPLY
1149 obj_handle_t handle; /* handle to the mapping */
1150 @END
1153 /* Get information about a file mapping */
1154 @REQ(get_mapping_info)
1155 obj_handle_t handle; /* handle to the mapping */
1156 @REPLY
1157 int size_high; /* mapping size */
1158 int size_low; /* mapping size */
1159 int protect; /* protection flags */
1160 int header_size; /* header size (for VPROT_IMAGE mapping) */
1161 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1162 obj_handle_t shared_file; /* shared mapping file handle */
1163 int shared_size; /* shared mapping size */
1164 @END
1167 #define SNAP_HEAPLIST 0x00000001
1168 #define SNAP_PROCESS 0x00000002
1169 #define SNAP_THREAD 0x00000004
1170 #define SNAP_MODULE 0x00000008
1171 /* Create a snapshot */
1172 @REQ(create_snapshot)
1173 unsigned int attributes; /* object attributes */
1174 int flags; /* snapshot flags (SNAP_*) */
1175 process_id_t pid; /* process id */
1176 @REPLY
1177 obj_handle_t handle; /* handle to the snapshot */
1178 @END
1181 /* Get the next process from a snapshot */
1182 @REQ(next_process)
1183 obj_handle_t handle; /* handle to the snapshot */
1184 int reset; /* reset snapshot position? */
1185 @REPLY
1186 int count; /* process usage count */
1187 process_id_t pid; /* process id */
1188 process_id_t ppid; /* parent process id */
1189 void* heap; /* heap base */
1190 void* module; /* main module */
1191 int threads; /* number of threads */
1192 int priority; /* process priority */
1193 int handles; /* number of handles */
1194 VARARG(filename,unicode_str); /* file name of main exe */
1195 @END
1198 /* Get the next thread from a snapshot */
1199 @REQ(next_thread)
1200 obj_handle_t handle; /* handle to the snapshot */
1201 int reset; /* reset snapshot position? */
1202 @REPLY
1203 int count; /* thread usage count */
1204 process_id_t pid; /* process id */
1205 thread_id_t tid; /* thread id */
1206 int base_pri; /* base priority */
1207 int delta_pri; /* delta priority */
1208 @END
1211 /* Get the next module from a snapshot */
1212 @REQ(next_module)
1213 obj_handle_t handle; /* handle to the snapshot */
1214 int reset; /* reset snapshot position? */
1215 @REPLY
1216 process_id_t pid; /* process id */
1217 void* base; /* module base address */
1218 size_t size; /* module size */
1219 VARARG(filename,unicode_str); /* file name of module */
1220 @END
1223 /* Wait for a debug event */
1224 @REQ(wait_debug_event)
1225 int get_handle; /* should we alloc a handle for waiting? */
1226 @REPLY
1227 process_id_t pid; /* process id */
1228 thread_id_t tid; /* thread id */
1229 obj_handle_t wait; /* wait handle if no event ready */
1230 VARARG(event,debug_event); /* debug event data */
1231 @END
1234 /* Queue an exception event */
1235 @REQ(queue_exception_event)
1236 int first; /* first chance exception? */
1237 VARARG(record,exc_event); /* thread context followed by exception record */
1238 @REPLY
1239 obj_handle_t handle; /* handle to the queued event */
1240 @END
1243 /* Retrieve the status of an exception event */
1244 @REQ(get_exception_status)
1245 obj_handle_t handle; /* handle to the queued event */
1246 @REPLY
1247 VARARG(context,context); /* modified thread context */
1248 @END
1251 /* Send an output string to the debugger */
1252 @REQ(output_debug_string)
1253 void* string; /* string to display (in debugged process address space) */
1254 int unicode; /* is it Unicode? */
1255 int length; /* string length */
1256 @END
1259 /* Continue a debug event */
1260 @REQ(continue_debug_event)
1261 process_id_t pid; /* process id to continue */
1262 thread_id_t tid; /* thread id to continue */
1263 int status; /* continuation status */
1264 @END
1267 /* Start/stop debugging an existing process */
1268 @REQ(debug_process)
1269 process_id_t pid; /* id of the process to debug */
1270 int attach; /* 1=attaching / 0=detaching from the process */
1271 @END
1274 /* Simulate a breakpoint in a process */
1275 @REQ(debug_break)
1276 obj_handle_t handle; /* process handle */
1277 @REPLY
1278 int self; /* was it the caller itself? */
1279 @END
1282 /* Set debugger kill on exit flag */
1283 @REQ(set_debugger_kill_on_exit)
1284 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1285 @END
1288 /* Read data from a process address space */
1289 @REQ(read_process_memory)
1290 obj_handle_t handle; /* process handle */
1291 void* addr; /* addr to read from */
1292 @REPLY
1293 VARARG(data,bytes); /* result data */
1294 @END
1297 /* Write data to a process address space */
1298 @REQ(write_process_memory)
1299 obj_handle_t handle; /* process handle */
1300 void* addr; /* addr to write to */
1301 VARARG(data,bytes); /* data to write */
1302 @END
1305 /* Create a registry key */
1306 @REQ(create_key)
1307 obj_handle_t parent; /* handle to the parent key */
1308 unsigned int access; /* desired access rights */
1309 unsigned int attributes; /* object attributes */
1310 unsigned int options; /* creation options */
1311 time_t modif; /* last modification time */
1312 data_size_t namelen; /* length of key name in bytes */
1313 VARARG(name,unicode_str,namelen); /* key name */
1314 VARARG(class,unicode_str); /* class name */
1315 @REPLY
1316 obj_handle_t hkey; /* handle to the created key */
1317 int created; /* has it been newly created? */
1318 @END
1320 /* Open a registry key */
1321 @REQ(open_key)
1322 obj_handle_t parent; /* handle to the parent key */
1323 unsigned int access; /* desired access rights */
1324 unsigned int attributes; /* object attributes */
1325 VARARG(name,unicode_str); /* key name */
1326 @REPLY
1327 obj_handle_t hkey; /* handle to the open key */
1328 @END
1331 /* Delete a registry key */
1332 @REQ(delete_key)
1333 obj_handle_t hkey; /* handle to the key */
1334 @END
1337 /* Flush a registry key */
1338 @REQ(flush_key)
1339 obj_handle_t hkey; /* handle to the key */
1340 @END
1343 /* Enumerate registry subkeys */
1344 @REQ(enum_key)
1345 obj_handle_t hkey; /* handle to registry key */
1346 int index; /* index of subkey (or -1 for current key) */
1347 int info_class; /* requested information class */
1348 @REPLY
1349 int subkeys; /* number of subkeys */
1350 int max_subkey; /* longest subkey name */
1351 int max_class; /* longest class name */
1352 int values; /* number of values */
1353 int max_value; /* longest value name */
1354 int max_data; /* longest value data */
1355 time_t modif; /* last modification time */
1356 data_size_t total; /* total length needed for full name and class */
1357 data_size_t namelen; /* length of key name in bytes */
1358 VARARG(name,unicode_str,namelen); /* key name */
1359 VARARG(class,unicode_str); /* class name */
1360 @END
1363 /* Set a value of a registry key */
1364 @REQ(set_key_value)
1365 obj_handle_t hkey; /* handle to registry key */
1366 int type; /* value type */
1367 data_size_t namelen; /* length of value name in bytes */
1368 VARARG(name,unicode_str,namelen); /* value name */
1369 VARARG(data,bytes); /* value data */
1370 @END
1373 /* Retrieve the value of a registry key */
1374 @REQ(get_key_value)
1375 obj_handle_t hkey; /* handle to registry key */
1376 VARARG(name,unicode_str); /* value name */
1377 @REPLY
1378 int type; /* value type */
1379 data_size_t total; /* total length needed for data */
1380 VARARG(data,bytes); /* value data */
1381 @END
1384 /* Enumerate a value of a registry key */
1385 @REQ(enum_key_value)
1386 obj_handle_t hkey; /* handle to registry key */
1387 int index; /* value index */
1388 int info_class; /* requested information class */
1389 @REPLY
1390 int type; /* value type */
1391 data_size_t total; /* total length needed for full name and data */
1392 data_size_t namelen; /* length of value name in bytes */
1393 VARARG(name,unicode_str,namelen); /* value name */
1394 VARARG(data,bytes); /* value data */
1395 @END
1398 /* Delete a value of a registry key */
1399 @REQ(delete_key_value)
1400 obj_handle_t hkey; /* handle to registry key */
1401 VARARG(name,unicode_str); /* value name */
1402 @END
1405 /* Load a registry branch from a file */
1406 @REQ(load_registry)
1407 obj_handle_t hkey; /* root key to load to */
1408 obj_handle_t file; /* file to load from */
1409 VARARG(name,unicode_str); /* subkey name */
1410 @END
1413 /* UnLoad a registry branch from a file */
1414 @REQ(unload_registry)
1415 obj_handle_t hkey; /* root key to unload to */
1416 @END
1419 /* Save a registry branch to a file */
1420 @REQ(save_registry)
1421 obj_handle_t hkey; /* key to save */
1422 obj_handle_t file; /* file to save to */
1423 @END
1426 /* Add a registry key change notification */
1427 @REQ(set_registry_notification)
1428 obj_handle_t hkey; /* key to watch for changes */
1429 obj_handle_t event; /* event to set */
1430 int subtree; /* should we watch the whole subtree? */
1431 unsigned int filter; /* things to watch */
1432 @END
1435 /* Create a waitable timer */
1436 @REQ(create_timer)
1437 unsigned int access; /* wanted access rights */
1438 unsigned int attributes; /* object attributes */
1439 obj_handle_t rootdir; /* root directory */
1440 int manual; /* manual reset */
1441 VARARG(name,unicode_str); /* object name */
1442 @REPLY
1443 obj_handle_t handle; /* handle to the timer */
1444 @END
1447 /* Open a waitable timer */
1448 @REQ(open_timer)
1449 unsigned int access; /* wanted access rights */
1450 unsigned int attributes; /* object attributes */
1451 obj_handle_t rootdir; /* root directory */
1452 VARARG(name,unicode_str); /* object name */
1453 @REPLY
1454 obj_handle_t handle; /* handle to the timer */
1455 @END
1457 /* Set a waitable timer */
1458 @REQ(set_timer)
1459 obj_handle_t handle; /* handle to the timer */
1460 abs_time_t expire; /* next expiration absolute time */
1461 int period; /* timer period in ms */
1462 void* callback; /* callback function */
1463 void* arg; /* callback argument */
1464 @REPLY
1465 int signaled; /* was the timer signaled before this call ? */
1466 @END
1468 /* Cancel a waitable timer */
1469 @REQ(cancel_timer)
1470 obj_handle_t handle; /* handle to the timer */
1471 @REPLY
1472 int signaled; /* was the timer signaled before this calltime ? */
1473 @END
1475 /* Get information on a waitable timer */
1476 @REQ(get_timer_info)
1477 obj_handle_t handle; /* handle to the timer */
1478 @REPLY
1479 abs_time_t when; /* absolute time when the timer next expires */
1480 int signaled; /* is the timer signaled? */
1481 @END
1484 /* Retrieve the current context of a thread */
1485 @REQ(get_thread_context)
1486 obj_handle_t handle; /* thread handle */
1487 unsigned int flags; /* context flags */
1488 int suspend; /* if getting context during suspend */
1489 @REPLY
1490 int self; /* was it a handle to the current thread? */
1491 VARARG(context,context); /* thread context */
1492 @END
1495 /* Set the current context of a thread */
1496 @REQ(set_thread_context)
1497 obj_handle_t handle; /* thread handle */
1498 unsigned int flags; /* context flags */
1499 int suspend; /* if setting context during suspend */
1500 VARARG(context,context); /* thread context */
1501 @REPLY
1502 int self; /* was it a handle to the current thread? */
1503 @END
1506 /* Fetch a selector entry for a thread */
1507 @REQ(get_selector_entry)
1508 obj_handle_t handle; /* thread handle */
1509 int entry; /* LDT entry */
1510 @REPLY
1511 unsigned int base; /* selector base */
1512 unsigned int limit; /* selector limit */
1513 unsigned char flags; /* selector flags */
1514 @END
1517 /* Add an atom */
1518 @REQ(add_atom)
1519 obj_handle_t table; /* which table to add atom to */
1520 VARARG(name,unicode_str); /* atom name */
1521 @REPLY
1522 atom_t atom; /* resulting atom */
1523 @END
1526 /* Delete an atom */
1527 @REQ(delete_atom)
1528 obj_handle_t table; /* which table to delete atom from */
1529 atom_t atom; /* atom handle */
1530 @END
1533 /* Find an atom */
1534 @REQ(find_atom)
1535 obj_handle_t table; /* which table to find atom from */
1536 VARARG(name,unicode_str); /* atom name */
1537 @REPLY
1538 atom_t atom; /* atom handle */
1539 @END
1542 /* Get information about an atom */
1543 @REQ(get_atom_information)
1544 obj_handle_t table; /* which table to find atom from */
1545 atom_t atom; /* atom handle */
1546 @REPLY
1547 int count; /* atom lock count */
1548 int pinned; /* whether the atom has been pinned */
1549 data_size_t total; /* actual length of atom name */
1550 VARARG(name,unicode_str); /* atom name */
1551 @END
1554 /* Set information about an atom */
1555 @REQ(set_atom_information)
1556 obj_handle_t table; /* which table to find atom from */
1557 atom_t atom; /* atom handle */
1558 int pinned; /* whether to bump atom information */
1559 @END
1562 /* Empty an atom table */
1563 @REQ(empty_atom_table)
1564 obj_handle_t table; /* which table to find atom from */
1565 int if_pinned; /* whether to delete pinned atoms */
1566 @END
1569 /* Init an atom table */
1570 @REQ(init_atom_table)
1571 int entries; /* number of entries (only for local) */
1572 @REPLY
1573 obj_handle_t table; /* handle to the atom table */
1574 @END
1577 /* Get the message queue of the current thread */
1578 @REQ(get_msg_queue)
1579 @REPLY
1580 obj_handle_t handle; /* handle to the queue */
1581 @END
1584 /* Set the current message queue wakeup mask */
1585 @REQ(set_queue_mask)
1586 unsigned int wake_mask; /* wakeup bits mask */
1587 unsigned int changed_mask; /* changed bits mask */
1588 int skip_wait; /* will we skip waiting if signaled? */
1589 @REPLY
1590 unsigned int wake_bits; /* current wake bits */
1591 unsigned int changed_bits; /* current changed bits */
1592 @END
1595 /* Get the current message queue status */
1596 @REQ(get_queue_status)
1597 int clear; /* should we clear the change bits? */
1598 @REPLY
1599 unsigned int wake_bits; /* wake bits */
1600 unsigned int changed_bits; /* changed bits since last time */
1601 @END
1604 /* Retrieve the process idle event */
1605 @REQ(get_process_idle_event)
1606 obj_handle_t handle; /* process handle */
1607 @REPLY
1608 obj_handle_t event; /* handle to idle event */
1609 @END
1612 /* Send a message to a thread queue */
1613 @REQ(send_message)
1614 thread_id_t id; /* thread id */
1615 int type; /* message type (see below) */
1616 int flags; /* message flags (see below) */
1617 user_handle_t win; /* window handle */
1618 unsigned int msg; /* message code */
1619 unsigned long wparam; /* parameters */
1620 unsigned long lparam; /* parameters */
1621 int timeout; /* timeout for reply */
1622 VARARG(data,message_data); /* message data for sent messages */
1623 @END
1625 @REQ(post_quit_message)
1626 int exit_code; /* exit code to return */
1627 @END
1629 enum message_type
1631 MSG_ASCII, /* Ascii message (from SendMessageA) */
1632 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1633 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1634 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1635 MSG_CALLBACK_RESULT,/* result of a callback message */
1636 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1637 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1638 MSG_HARDWARE, /* hardware message */
1639 MSG_WINEVENT /* winevent message */
1641 #define SEND_MSG_ABORT_IF_HUNG 0x01
1644 /* Send a hardware message to a thread queue */
1645 @REQ(send_hardware_message)
1646 thread_id_t id; /* thread id */
1647 user_handle_t win; /* window handle */
1648 unsigned int msg; /* message code */
1649 unsigned int time; /* message time */
1650 unsigned long wparam; /* parameters */
1651 unsigned long lparam; /* parameters */
1652 unsigned long info; /* extra info */
1653 int x; /* x position */
1654 int y; /* y position */
1655 @END
1658 /* Get a message from the current queue */
1659 @REQ(get_message)
1660 int flags; /* see below */
1661 user_handle_t get_win; /* window handle to get */
1662 unsigned int get_first; /* first message code to get */
1663 unsigned int get_last; /* last message code to get */
1664 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1665 @REPLY
1666 user_handle_t win; /* window handle */
1667 int type; /* message type */
1668 unsigned int msg; /* message code */
1669 unsigned long wparam; /* parameters */
1670 unsigned long lparam; /* parameters */
1671 unsigned long info; /* extra info */
1672 int x; /* x position */
1673 int y; /* y position */
1674 unsigned int time; /* message time */
1675 unsigned int hw_id; /* id if hardware message */
1676 unsigned int active_hooks; /* active hooks bitmap */
1677 data_size_t total; /* total size of extra data */
1678 VARARG(data,message_data); /* message data for sent messages */
1679 @END
1680 #define GET_MSG_REMOVE 1 /* remove the message */
1681 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1683 /* Reply to a sent message */
1684 @REQ(reply_message)
1685 unsigned int result; /* message result */
1686 int remove; /* should we remove the message? */
1687 VARARG(data,bytes); /* message data for sent messages */
1688 @END
1691 /* Accept the current hardware message */
1692 @REQ(accept_hardware_message)
1693 unsigned int hw_id; /* id of the hardware message */
1694 int remove; /* should we remove the message? */
1695 user_handle_t new_win; /* new destination window for current message */
1696 @END
1699 /* Retrieve the reply for the last message sent */
1700 @REQ(get_message_reply)
1701 int cancel; /* cancel message if not ready? */
1702 @REPLY
1703 unsigned int result; /* message result */
1704 VARARG(data,bytes); /* message data for sent messages */
1705 @END
1708 /* Set a window timer */
1709 @REQ(set_win_timer)
1710 user_handle_t win; /* window handle */
1711 unsigned int msg; /* message to post */
1712 unsigned int rate; /* timer rate in ms */
1713 unsigned long id; /* timer id */
1714 unsigned long lparam; /* message lparam (callback proc) */
1715 @REPLY
1716 unsigned long id; /* timer id */
1717 @END
1720 /* Kill a window timer */
1721 @REQ(kill_win_timer)
1722 user_handle_t win; /* window handle */
1723 unsigned int msg; /* message to post */
1724 unsigned long id; /* timer id */
1725 @END
1728 /* Retrieve info about a serial port */
1729 @REQ(get_serial_info)
1730 obj_handle_t handle; /* handle to comm port */
1731 @REPLY
1732 unsigned int readinterval;
1733 unsigned int readconst;
1734 unsigned int readmult;
1735 unsigned int writeconst;
1736 unsigned int writemult;
1737 unsigned int eventmask;
1738 @END
1741 /* Set info about a serial port */
1742 @REQ(set_serial_info)
1743 obj_handle_t handle; /* handle to comm port */
1744 int flags; /* bitmask to set values (see below) */
1745 unsigned int readinterval;
1746 unsigned int readconst;
1747 unsigned int readmult;
1748 unsigned int writeconst;
1749 unsigned int writemult;
1750 unsigned int eventmask;
1751 @END
1752 #define SERIALINFO_SET_TIMEOUTS 0x01
1753 #define SERIALINFO_SET_MASK 0x02
1756 /* Create an async I/O */
1757 @REQ(register_async)
1758 obj_handle_t handle; /* handle to comm port, socket or file */
1759 int type; /* type of queue to look after */
1760 void* io_apc; /* APC routine to queue upon end of async */
1761 void* io_sb; /* I/O status block (unique across all async on this handle) */
1762 void* io_user; /* data to pass back to caller */
1763 int count; /* count - usually # of bytes to be read/written */
1764 @END
1765 #define ASYNC_TYPE_READ 0x01
1766 #define ASYNC_TYPE_WRITE 0x02
1767 #define ASYNC_TYPE_WAIT 0x03
1770 /* Cancel all async op on a fd */
1771 @REQ(cancel_async)
1772 obj_handle_t handle; /* handle to comm port, socket or file */
1773 @END
1776 /* Create a named pipe */
1777 @REQ(create_named_pipe)
1778 unsigned int access;
1779 unsigned int attributes; /* object attributes */
1780 obj_handle_t rootdir; /* root directory */
1781 unsigned int options;
1782 unsigned int flags;
1783 unsigned int maxinstances;
1784 unsigned int outsize;
1785 unsigned int insize;
1786 unsigned int timeout;
1787 VARARG(name,unicode_str); /* pipe name */
1788 @REPLY
1789 obj_handle_t handle; /* handle to the pipe */
1790 @END
1792 /* flags in create_named_pipe and get_named_pipe_info */
1793 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1794 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
1795 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
1796 #define NAMED_PIPE_SERVER_END 0x8000
1798 /* Open an existing named pipe */
1799 @REQ(open_named_pipe)
1800 unsigned int access;
1801 unsigned int attributes; /* object attributes */
1802 obj_handle_t rootdir; /* root directory */
1803 unsigned int flags; /* file flags */
1804 VARARG(name,unicode_str); /* pipe name */
1805 @REPLY
1806 obj_handle_t handle; /* handle to the pipe */
1807 @END
1810 /* Connect to a named pipe */
1811 @REQ(connect_named_pipe)
1812 obj_handle_t handle;
1813 obj_handle_t event;
1814 void* func;
1815 @END
1818 /* Wait for a named pipe */
1819 @REQ(wait_named_pipe)
1820 obj_handle_t handle;
1821 unsigned int timeout;
1822 obj_handle_t event;
1823 void* func;
1824 VARARG(name,unicode_str); /* pipe name */
1825 @END
1828 /* Disconnect a named pipe */
1829 @REQ(disconnect_named_pipe)
1830 obj_handle_t handle;
1831 @END
1834 @REQ(get_named_pipe_info)
1835 obj_handle_t handle;
1836 @REPLY
1837 unsigned int flags;
1838 unsigned int maxinstances;
1839 unsigned int instances;
1840 unsigned int outsize;
1841 unsigned int insize;
1842 @END
1845 /* Create a window */
1846 @REQ(create_window)
1847 user_handle_t parent; /* parent window */
1848 user_handle_t owner; /* owner window */
1849 atom_t atom; /* class atom */
1850 void* instance; /* module instance */
1851 @REPLY
1852 user_handle_t handle; /* created window */
1853 user_handle_t parent; /* full handle of parent */
1854 user_handle_t owner; /* full handle of owner */
1855 int extra; /* number of extra bytes */
1856 void* class_ptr; /* pointer to class in client address space */
1857 @END
1860 /* Destroy a window */
1861 @REQ(destroy_window)
1862 user_handle_t handle; /* handle to the window */
1863 @END
1866 /* Retrieve the desktop window for the current thread */
1867 @REQ(get_desktop_window)
1868 int force; /* force creation if it doesn't exist */
1869 @REPLY
1870 user_handle_t handle; /* handle to the desktop window */
1871 @END
1874 /* Set a window owner */
1875 @REQ(set_window_owner)
1876 user_handle_t handle; /* handle to the window */
1877 user_handle_t owner; /* new owner */
1878 @REPLY
1879 user_handle_t full_owner; /* full handle of new owner */
1880 user_handle_t prev_owner; /* full handle of previous owner */
1881 @END
1884 /* Get information from a window handle */
1885 @REQ(get_window_info)
1886 user_handle_t handle; /* handle to the window */
1887 @REPLY
1888 user_handle_t full_handle; /* full 32-bit handle */
1889 user_handle_t last_active; /* last active popup */
1890 process_id_t pid; /* process owning the window */
1891 thread_id_t tid; /* thread owning the window */
1892 atom_t atom; /* class atom */
1893 int is_unicode; /* ANSI or unicode */
1894 @END
1897 /* Set some information in a window */
1898 @REQ(set_window_info)
1899 unsigned int flags; /* flags for fields to set (see below) */
1900 user_handle_t handle; /* handle to the window */
1901 unsigned int style; /* window style */
1902 unsigned int ex_style; /* window extended style */
1903 unsigned int id; /* window id */
1904 int is_unicode; /* ANSI or unicode */
1905 void* instance; /* creator instance */
1906 unsigned long user_data; /* user-specific data */
1907 int extra_offset; /* offset to set in extra bytes */
1908 data_size_t extra_size; /* size to set in extra bytes */
1909 unsigned long extra_value; /* value to set in extra bytes */
1910 @REPLY
1911 unsigned int old_style; /* old window style */
1912 unsigned int old_ex_style; /* old window extended style */
1913 unsigned int old_id; /* old window id */
1914 void* old_instance; /* old creator instance */
1915 unsigned long old_user_data; /* old user-specific data */
1916 unsigned long old_extra_value; /* old value in extra bytes */
1917 @END
1918 #define SET_WIN_STYLE 0x01
1919 #define SET_WIN_EXSTYLE 0x02
1920 #define SET_WIN_ID 0x04
1921 #define SET_WIN_INSTANCE 0x08
1922 #define SET_WIN_USERDATA 0x10
1923 #define SET_WIN_EXTRA 0x20
1924 #define SET_WIN_UNICODE 0x40
1927 /* Set the parent of a window */
1928 @REQ(set_parent)
1929 user_handle_t handle; /* handle to the window */
1930 user_handle_t parent; /* handle to the parent */
1931 @REPLY
1932 user_handle_t old_parent; /* old parent window */
1933 user_handle_t full_parent; /* full handle of new parent */
1934 @END
1937 /* Get a list of the window parents, up to the root of the tree */
1938 @REQ(get_window_parents)
1939 user_handle_t handle; /* handle to the window */
1940 @REPLY
1941 int count; /* total count of parents */
1942 VARARG(parents,user_handles); /* parent handles */
1943 @END
1946 /* Get a list of the window children */
1947 @REQ(get_window_children)
1948 user_handle_t parent; /* parent window */
1949 atom_t atom; /* class atom for the listed children */
1950 thread_id_t tid; /* thread owning the listed children */
1951 @REPLY
1952 int count; /* total count of children */
1953 VARARG(children,user_handles); /* children handles */
1954 @END
1957 /* Get a list of the window children that contain a given point */
1958 @REQ(get_window_children_from_point)
1959 user_handle_t parent; /* parent window */
1960 int x; /* point in parent coordinates */
1961 int y;
1962 @REPLY
1963 int count; /* total count of children */
1964 VARARG(children,user_handles); /* children handles */
1965 @END
1968 /* Get window tree information from a window handle */
1969 @REQ(get_window_tree)
1970 user_handle_t handle; /* handle to the window */
1971 @REPLY
1972 user_handle_t parent; /* parent window */
1973 user_handle_t owner; /* owner window */
1974 user_handle_t next_sibling; /* next sibling in Z-order */
1975 user_handle_t prev_sibling; /* prev sibling in Z-order */
1976 user_handle_t first_sibling; /* first sibling in Z-order */
1977 user_handle_t last_sibling; /* last sibling in Z-order */
1978 user_handle_t first_child; /* first child */
1979 user_handle_t last_child; /* last child */
1980 @END
1982 /* Set the position and Z order of a window */
1983 @REQ(set_window_pos)
1984 unsigned int flags; /* SWP_* flags */
1985 user_handle_t handle; /* handle to the window */
1986 user_handle_t previous; /* previous window in Z order */
1987 rectangle_t window; /* window rectangle */
1988 rectangle_t client; /* client rectangle */
1989 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
1990 @REPLY
1991 unsigned int new_style; /* new window style */
1992 @END
1995 /* Get the window and client rectangles of a window */
1996 @REQ(get_window_rectangles)
1997 user_handle_t handle; /* handle to the window */
1998 @REPLY
1999 rectangle_t window; /* window rectangle */
2000 rectangle_t visible; /* visible part of the window rectangle */
2001 rectangle_t client; /* client rectangle */
2002 @END
2005 /* Get the window text */
2006 @REQ(get_window_text)
2007 user_handle_t handle; /* handle to the window */
2008 @REPLY
2009 VARARG(text,unicode_str); /* window text */
2010 @END
2013 /* Set the window text */
2014 @REQ(set_window_text)
2015 user_handle_t handle; /* handle to the window */
2016 VARARG(text,unicode_str); /* window text */
2017 @END
2020 /* Get the coordinates offset between two windows */
2021 @REQ(get_windows_offset)
2022 user_handle_t from; /* handle to the first window */
2023 user_handle_t to; /* handle to the second window */
2024 @REPLY
2025 int x; /* x coordinate offset */
2026 int y; /* y coordinate offset */
2027 @END
2030 /* Get the visible region of a window */
2031 @REQ(get_visible_region)
2032 user_handle_t window; /* handle to the window */
2033 unsigned int flags; /* DCX flags */
2034 @REPLY
2035 user_handle_t top_win; /* top window to clip against */
2036 rectangle_t top_rect; /* top window visible rect with screen coords */
2037 rectangle_t win_rect; /* window rect in screen coords */
2038 data_size_t total_size; /* total size of the resulting region */
2039 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2040 @END
2043 /* Get the window region */
2044 @REQ(get_window_region)
2045 user_handle_t window; /* handle to the window */
2046 @REPLY
2047 data_size_t total_size; /* total size of the resulting region */
2048 VARARG(region,rectangles); /* list of rectangles for the region */
2049 @END
2052 /* Set the window region */
2053 @REQ(set_window_region)
2054 user_handle_t window; /* handle to the window */
2055 VARARG(region,rectangles); /* list of rectangles for the region */
2056 @END
2059 /* Get the window update region */
2060 @REQ(get_update_region)
2061 user_handle_t window; /* handle to the window */
2062 user_handle_t from_child; /* child to start searching from */
2063 unsigned int flags; /* update flags (see below) */
2064 @REPLY
2065 user_handle_t child; /* child to repaint (or window itself) */
2066 unsigned int flags; /* resulting update flags (see below) */
2067 data_size_t total_size; /* total size of the resulting region */
2068 VARARG(region,rectangles); /* list of rectangles for the region */
2069 @END
2070 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2071 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2072 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2073 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2074 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2075 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2076 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2079 /* Update the z order of a window so that a given rectangle is fully visible */
2080 @REQ(update_window_zorder)
2081 user_handle_t window; /* handle to the window */
2082 rectangle_t rect; /* rectangle that must be visible */
2083 @END
2086 /* Mark parts of a window as needing a redraw */
2087 @REQ(redraw_window)
2088 user_handle_t window; /* handle to the window */
2089 unsigned int flags; /* RDW_* flags */
2090 VARARG(region,rectangles); /* list of rectangles for the region */
2091 @END
2094 /* Set a window property */
2095 @REQ(set_window_property)
2096 user_handle_t window; /* handle to the window */
2097 atom_t atom; /* property atom (if no name specified) */
2098 obj_handle_t handle; /* handle to store */
2099 VARARG(name,unicode_str); /* property name */
2100 @END
2103 /* Remove a window property */
2104 @REQ(remove_window_property)
2105 user_handle_t window; /* handle to the window */
2106 atom_t atom; /* property atom (if no name specified) */
2107 VARARG(name,unicode_str); /* property name */
2108 @REPLY
2109 obj_handle_t handle; /* handle stored in property */
2110 @END
2113 /* Get a window property */
2114 @REQ(get_window_property)
2115 user_handle_t window; /* handle to the window */
2116 atom_t atom; /* property atom (if no name specified) */
2117 VARARG(name,unicode_str); /* property name */
2118 @REPLY
2119 obj_handle_t handle; /* handle stored in property */
2120 @END
2123 /* Get the list of properties of a window */
2124 @REQ(get_window_properties)
2125 user_handle_t window; /* handle to the window */
2126 @REPLY
2127 int total; /* total number of properties */
2128 VARARG(props,properties); /* list of properties */
2129 @END
2132 /* Create a window station */
2133 @REQ(create_winstation)
2134 unsigned int flags; /* window station flags */
2135 unsigned int access; /* wanted access rights */
2136 unsigned int attributes; /* object attributes */
2137 VARARG(name,unicode_str); /* object name */
2138 @REPLY
2139 obj_handle_t handle; /* handle to the window station */
2140 @END
2143 /* Open a handle to a window station */
2144 @REQ(open_winstation)
2145 unsigned int access; /* wanted access rights */
2146 unsigned int attributes; /* object attributes */
2147 VARARG(name,unicode_str); /* object name */
2148 @REPLY
2149 obj_handle_t handle; /* handle to the window station */
2150 @END
2153 /* Close a window station */
2154 @REQ(close_winstation)
2155 obj_handle_t handle; /* handle to the window station */
2156 @END
2159 /* Get the process current window station */
2160 @REQ(get_process_winstation)
2161 @REPLY
2162 obj_handle_t handle; /* handle to the window station */
2163 @END
2166 /* Set the process current window station */
2167 @REQ(set_process_winstation)
2168 obj_handle_t handle; /* handle to the window station */
2169 @END
2172 /* Create a desktop */
2173 @REQ(create_desktop)
2174 unsigned int flags; /* desktop flags */
2175 unsigned int access; /* wanted access rights */
2176 unsigned int attributes; /* object attributes */
2177 VARARG(name,unicode_str); /* object name */
2178 @REPLY
2179 obj_handle_t handle; /* handle to the desktop */
2180 @END
2183 /* Open a handle to a desktop */
2184 @REQ(open_desktop)
2185 unsigned int flags; /* desktop flags */
2186 unsigned int access; /* wanted access rights */
2187 unsigned int attributes; /* object attributes */
2188 VARARG(name,unicode_str); /* object name */
2189 @REPLY
2190 obj_handle_t handle; /* handle to the desktop */
2191 @END
2194 /* Close a desktop */
2195 @REQ(close_desktop)
2196 obj_handle_t handle; /* handle to the desktop */
2197 @END
2200 /* Get the thread current desktop */
2201 @REQ(get_thread_desktop)
2202 thread_id_t tid; /* thread id */
2203 @REPLY
2204 obj_handle_t handle; /* handle to the desktop */
2205 @END
2208 /* Set the thread current desktop */
2209 @REQ(set_thread_desktop)
2210 obj_handle_t handle; /* handle to the desktop */
2211 @END
2214 /* Get/set information about a user object (window station or desktop) */
2215 @REQ(set_user_object_info)
2216 obj_handle_t handle; /* handle to the object */
2217 unsigned int flags; /* information to set */
2218 unsigned int obj_flags; /* new object flags */
2219 @REPLY
2220 int is_desktop; /* is object a desktop? */
2221 unsigned int old_obj_flags; /* old object flags */
2222 VARARG(name,unicode_str); /* object name */
2223 @END
2224 #define SET_USER_OBJECT_FLAGS 1
2227 /* Attach (or detach) thread inputs */
2228 @REQ(attach_thread_input)
2229 thread_id_t tid_from; /* thread to be attached */
2230 thread_id_t tid_to; /* thread to which tid_from should be attached */
2231 int attach; /* is it an attach? */
2232 @END
2235 /* Get input data for a given thread */
2236 @REQ(get_thread_input)
2237 thread_id_t tid; /* id of thread */
2238 @REPLY
2239 user_handle_t focus; /* handle to the focus window */
2240 user_handle_t capture; /* handle to the capture window */
2241 user_handle_t active; /* handle to the active window */
2242 user_handle_t foreground; /* handle to the global foreground window */
2243 user_handle_t menu_owner; /* handle to the menu owner */
2244 user_handle_t move_size; /* handle to the moving/resizing window */
2245 user_handle_t caret; /* handle to the caret window */
2246 rectangle_t rect; /* caret rectangle */
2247 @END
2250 /* Get the time of the last input event */
2251 @REQ(get_last_input_time)
2252 @REPLY
2253 unsigned int time;
2254 @END
2257 /* Retrieve queue keyboard state for a given thread */
2258 @REQ(get_key_state)
2259 thread_id_t tid; /* id of thread */
2260 int key; /* optional key code or -1 */
2261 @REPLY
2262 unsigned char state; /* state of specified key */
2263 VARARG(keystate,bytes); /* state array for all the keys */
2264 @END
2266 /* Set queue keyboard state for a given thread */
2267 @REQ(set_key_state)
2268 thread_id_t tid; /* id of thread */
2269 VARARG(keystate,bytes); /* state array for all the keys */
2270 @END
2272 /* Set the system foreground window */
2273 @REQ(set_foreground_window)
2274 user_handle_t handle; /* handle to the foreground window */
2275 @REPLY
2276 user_handle_t previous; /* handle to the previous foreground window */
2277 int send_msg_old; /* whether we have to send a msg to the old window */
2278 int send_msg_new; /* whether we have to send a msg to the new window */
2279 @END
2281 /* Set the current thread focus window */
2282 @REQ(set_focus_window)
2283 user_handle_t handle; /* handle to the focus window */
2284 @REPLY
2285 user_handle_t previous; /* handle to the previous focus window */
2286 @END
2288 /* Set the current thread active window */
2289 @REQ(set_active_window)
2290 user_handle_t handle; /* handle to the active window */
2291 @REPLY
2292 user_handle_t previous; /* handle to the previous active window */
2293 @END
2295 /* Set the current thread capture window */
2296 @REQ(set_capture_window)
2297 user_handle_t handle; /* handle to the capture window */
2298 unsigned int flags; /* capture flags (see below) */
2299 @REPLY
2300 user_handle_t previous; /* handle to the previous capture window */
2301 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2302 @END
2303 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2304 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2307 /* Set the current thread caret window */
2308 @REQ(set_caret_window)
2309 user_handle_t handle; /* handle to the caret window */
2310 int width; /* caret width */
2311 int height; /* caret height */
2312 @REPLY
2313 user_handle_t previous; /* handle to the previous caret window */
2314 rectangle_t old_rect; /* previous caret rectangle */
2315 int old_hide; /* previous hide count */
2316 int old_state; /* previous caret state (1=on, 0=off) */
2317 @END
2320 /* Set the current thread caret information */
2321 @REQ(set_caret_info)
2322 unsigned int flags; /* caret flags (see below) */
2323 user_handle_t handle; /* handle to the caret window */
2324 int x; /* caret x position */
2325 int y; /* caret y position */
2326 int hide; /* increment for hide count (can be negative to show it) */
2327 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2328 @REPLY
2329 user_handle_t full_handle; /* handle to the current caret window */
2330 rectangle_t old_rect; /* previous caret rectangle */
2331 int old_hide; /* previous hide count */
2332 int old_state; /* previous caret state (1=on, 0=off) */
2333 @END
2334 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2335 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2336 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2339 /* Set a window hook */
2340 @REQ(set_hook)
2341 int id; /* id of the hook */
2342 process_id_t pid; /* id of process to set the hook into */
2343 thread_id_t tid; /* id of thread to set the hook into */
2344 int event_min;
2345 int event_max;
2346 int flags;
2347 void* proc; /* hook procedure */
2348 int unicode; /* is it a unicode hook? */
2349 VARARG(module,unicode_str); /* module name */
2350 @REPLY
2351 user_handle_t handle; /* handle to the hook */
2352 unsigned int active_hooks; /* active hooks bitmap */
2353 @END
2356 /* Remove a window hook */
2357 @REQ(remove_hook)
2358 user_handle_t handle; /* handle to the hook */
2359 int id; /* id of the hook if handle is 0 */
2360 void* proc; /* hook procedure if handle is 0 */
2361 @REPLY
2362 unsigned int active_hooks; /* active hooks bitmap */
2363 @END
2366 /* Start calling a hook chain */
2367 @REQ(start_hook_chain)
2368 int id; /* id of the hook */
2369 int event; /* signalled event */
2370 user_handle_t window; /* handle to the event window */
2371 int object_id; /* object id for out of context winevent */
2372 int child_id; /* child id for out of context winevent */
2373 @REPLY
2374 user_handle_t handle; /* handle to the next hook */
2375 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2376 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2377 void* proc; /* hook procedure */
2378 int unicode; /* is it a unicode hook? */
2379 unsigned int active_hooks; /* active hooks bitmap */
2380 VARARG(module,unicode_str); /* module name */
2381 @END
2384 /* Finished calling a hook chain */
2385 @REQ(finish_hook_chain)
2386 int id; /* id of the hook */
2387 @END
2390 /* Get the hook information */
2391 @REQ(get_hook_info)
2392 user_handle_t handle; /* handle to the current hook */
2393 int get_next; /* do we want info about current or next hook? */
2394 int event; /* signalled event */
2395 user_handle_t window; /* handle to the event window */
2396 int object_id; /* object id for out of context winevent */
2397 int child_id; /* child id for out of context winevent */
2398 @REPLY
2399 user_handle_t handle; /* handle to the hook */
2400 int id; /* id of the hook */
2401 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2402 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2403 void* proc; /* hook procedure */
2404 int unicode; /* is it a unicode hook? */
2405 VARARG(module,unicode_str); /* module name */
2406 @END
2409 /* Create a window class */
2410 @REQ(create_class)
2411 int local; /* is it a local class? */
2412 atom_t atom; /* class atom */
2413 unsigned int style; /* class style */
2414 void* instance; /* module instance */
2415 int extra; /* number of extra class bytes */
2416 int win_extra; /* number of window extra bytes */
2417 void* client_ptr; /* pointer to class in client address space */
2418 @END
2421 /* Destroy a window class */
2422 @REQ(destroy_class)
2423 atom_t atom; /* class atom */
2424 void* instance; /* module instance */
2425 @REPLY
2426 void* client_ptr; /* pointer to class in client address space */
2427 @END
2430 /* Set some information in a class */
2431 @REQ(set_class_info)
2432 user_handle_t window; /* handle to the window */
2433 unsigned int flags; /* flags for info to set (see below) */
2434 atom_t atom; /* class atom */
2435 unsigned int style; /* class style */
2436 int win_extra; /* number of window extra bytes */
2437 void* instance; /* module instance */
2438 int extra_offset; /* offset to set in extra bytes */
2439 data_size_t extra_size; /* size to set in extra bytes */
2440 unsigned long extra_value; /* value to set in extra bytes */
2441 @REPLY
2442 atom_t old_atom; /* previous class atom */
2443 unsigned int old_style; /* previous class style */
2444 int old_extra; /* previous number of class extra bytes */
2445 int old_win_extra; /* previous number of window extra bytes */
2446 void* old_instance; /* previous module instance */
2447 unsigned long old_extra_value; /* old value in extra bytes */
2448 @END
2449 #define SET_CLASS_ATOM 0x0001
2450 #define SET_CLASS_STYLE 0x0002
2451 #define SET_CLASS_WINEXTRA 0x0004
2452 #define SET_CLASS_INSTANCE 0x0008
2453 #define SET_CLASS_EXTRA 0x0010
2456 /* Set/get clipboard information */
2457 @REQ(set_clipboard_info)
2458 unsigned int flags; /* flags for fields to set (see below) */
2459 user_handle_t clipboard; /* clipboard window */
2460 user_handle_t owner; /* clipboard owner */
2461 user_handle_t viewer; /* first clipboard viewer */
2462 unsigned int seqno; /* change sequence number */
2463 @REPLY
2464 unsigned int flags; /* status flags (see below) */
2465 user_handle_t old_clipboard; /* old clipboard window */
2466 user_handle_t old_owner; /* old clipboard owner */
2467 user_handle_t old_viewer; /* old clipboard viewer */
2468 unsigned int seqno; /* current sequence number */
2469 @END
2471 #define SET_CB_OPEN 0x001
2472 #define SET_CB_OWNER 0x002
2473 #define SET_CB_VIEWER 0x004
2474 #define SET_CB_SEQNO 0x008
2475 #define SET_CB_RELOWNER 0x010
2476 #define SET_CB_CLOSE 0x020
2477 #define CB_OPEN 0x040
2478 #define CB_OWNER 0x080
2479 #define CB_PROCESS 0x100
2482 /* Open a security token */
2483 @REQ(open_token)
2484 obj_handle_t handle; /* handle to the thread or process */
2485 unsigned int access; /* access rights to the new token */
2486 unsigned int attributes;/* object attributes */
2487 unsigned int flags; /* flags (see below) */
2488 @REPLY
2489 obj_handle_t token; /* handle to the token */
2490 @END
2491 #define OPEN_TOKEN_THREAD 1
2492 #define OPEN_TOKEN_AS_SELF 2
2495 /* Set/get the global windows */
2496 @REQ(set_global_windows)
2497 unsigned int flags; /* flags for fields to set (see below) */
2498 user_handle_t shell_window; /* handle to the new shell window */
2499 user_handle_t shell_listview; /* handle to the new shell listview window */
2500 user_handle_t progman_window; /* handle to the new program manager window */
2501 user_handle_t taskman_window; /* handle to the new task manager window */
2502 @REPLY
2503 user_handle_t old_shell_window; /* handle to the shell window */
2504 user_handle_t old_shell_listview; /* handle to the shell listview window */
2505 user_handle_t old_progman_window; /* handle to the new program manager window */
2506 user_handle_t old_taskman_window; /* handle to the new task manager window */
2507 @END
2508 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2509 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2510 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2512 /* Adjust the privileges held by a token */
2513 @REQ(adjust_token_privileges)
2514 obj_handle_t handle; /* handle to the token */
2515 int disable_all; /* disable all privileges? */
2516 int get_modified_state; /* get modified privileges? */
2517 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2518 @REPLY
2519 unsigned int len; /* total length in bytes required to store token privileges */
2520 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2521 @END
2523 /* Retrieves the set of privileges held by or available to a token */
2524 @REQ(get_token_privileges)
2525 obj_handle_t handle; /* handle to the token */
2526 @REPLY
2527 unsigned int len; /* total length in bytes required to store token privileges */
2528 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2529 @END
2531 /* Check the token has the required privileges */
2532 @REQ(check_token_privileges)
2533 obj_handle_t handle; /* handle to the token */
2534 int all_required; /* are all the privileges required for the check to succeed? */
2535 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2536 @REPLY
2537 int has_privileges; /* does the token have the required privileges? */
2538 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2539 @END
2541 @REQ(duplicate_token)
2542 obj_handle_t handle; /* handle to the token to duplicate */
2543 unsigned int access; /* access rights to the new token */
2544 unsigned int attributes; /* object attributes */
2545 int primary; /* is the new token to be a primary one? */
2546 int impersonation_level; /* impersonation level of the new token */
2547 @REPLY
2548 obj_handle_t new_handle; /* duplicated handle */
2549 @END
2551 @REQ(access_check)
2552 obj_handle_t handle; /* handle to the token */
2553 unsigned int desired_access; /* desired access to the object */
2554 unsigned int mapping_read; /* mapping from generic read to specific rights */
2555 unsigned int mapping_write; /* mapping from generic write to specific rights */
2556 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2557 unsigned int mapping_all; /* mapping from generic all to specific rights */
2558 VARARG(sd,security_descriptor); /* security descriptor to check */
2559 @REPLY
2560 unsigned int access_granted; /* access rights actually granted */
2561 unsigned int access_status; /* was access granted? */
2562 unsigned int privileges_len; /* length needed to store privileges */
2563 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2564 @END
2566 @REQ(get_token_user)
2567 obj_handle_t handle; /* handle to the token */
2568 @REPLY
2569 data_size_t user_len; /* length needed to store user */
2570 VARARG(user,SID); /* sid of the user the token represents */
2571 @END
2573 @REQ(get_token_groups)
2574 obj_handle_t handle; /* handle to the token */
2575 @REPLY
2576 data_size_t user_len; /* length needed to store user */
2577 VARARG(user,token_groups); /* groups the token's user belongs to */
2578 @END
2580 /* Create a mailslot */
2581 @REQ(create_mailslot)
2582 unsigned int access; /* wanted access rights */
2583 unsigned int attributes; /* object attributes */
2584 obj_handle_t rootdir; /* root directory */
2585 unsigned int max_msgsize;
2586 int read_timeout;
2587 VARARG(name,unicode_str); /* mailslot name */
2588 @REPLY
2589 obj_handle_t handle; /* handle to the mailslot */
2590 @END
2593 /* Open an existing mailslot */
2594 @REQ(open_mailslot)
2595 unsigned int access;
2596 unsigned int attributes; /* object attributes */
2597 obj_handle_t rootdir; /* root directory */
2598 unsigned int sharing; /* sharing mode */
2599 VARARG(name,unicode_str); /* mailslot name */
2600 @REPLY
2601 obj_handle_t handle; /* handle to the mailslot */
2602 @END
2605 /* Set mailslot information */
2606 @REQ(set_mailslot_info)
2607 obj_handle_t handle; /* handle to the mailslot */
2608 unsigned int flags;
2609 int read_timeout;
2610 @REPLY
2611 unsigned int max_msgsize;
2612 int read_timeout;
2613 @END
2614 #define MAILSLOT_SET_READ_TIMEOUT 1
2617 /* Create a directory object */
2618 @REQ(create_directory)
2619 unsigned int access; /* access flags */
2620 unsigned int attributes; /* object attributes */
2621 obj_handle_t rootdir; /* root directory */
2622 VARARG(directory_name,unicode_str); /* Directory name */
2623 @REPLY
2624 obj_handle_t handle; /* handle to the directory */
2625 @END
2628 /* Open a directory object */
2629 @REQ(open_directory)
2630 unsigned int access; /* access flags */
2631 unsigned int attributes; /* object attributes */
2632 obj_handle_t rootdir; /* root directory */
2633 VARARG(directory_name,unicode_str); /* Directory name */
2634 @REPLY
2635 obj_handle_t handle; /* handle to the directory */
2636 @END
2639 /* Create a symbolic link object */
2640 @REQ(create_symlink)
2641 unsigned int access; /* access flags */
2642 unsigned int attributes; /* object attributes */
2643 obj_handle_t rootdir; /* root directory */
2644 data_size_t name_len; /* length of the symlink name in bytes */
2645 VARARG(name,unicode_str,name_len); /* symlink name */
2646 VARARG(target_name,unicode_str); /* target name */
2647 @REPLY
2648 obj_handle_t handle; /* handle to the symlink */
2649 @END
2652 /* Open a symbolic link object */
2653 @REQ(open_symlink)
2654 unsigned int access; /* access flags */
2655 unsigned int attributes; /* object attributes */
2656 obj_handle_t rootdir; /* root directory */
2657 VARARG(name,unicode_str); /* symlink name */
2658 @REPLY
2659 obj_handle_t handle; /* handle to the symlink */
2660 @END
2663 /* Query a symbolic link object */
2664 @REQ(query_symlink)
2665 obj_handle_t handle; /* handle to the symlink */
2666 @REPLY
2667 VARARG(target_name,unicode_str); /* target name */
2668 @END