ntdll: Duplicate the mapping handle on the server side for NtMapViewOfSection.
[wine.git] / server / protocol.def
blob3f7fbd5a8a92083f83ce5a7dad9f58211f095d26
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 mapping; /* duplicate mapping handle unless removable */
1163 obj_handle_t shared_file; /* shared mapping file handle */
1164 int shared_size; /* shared mapping size */
1165 @END
1168 #define SNAP_HEAPLIST 0x00000001
1169 #define SNAP_PROCESS 0x00000002
1170 #define SNAP_THREAD 0x00000004
1171 #define SNAP_MODULE 0x00000008
1172 /* Create a snapshot */
1173 @REQ(create_snapshot)
1174 unsigned int attributes; /* object attributes */
1175 int flags; /* snapshot flags (SNAP_*) */
1176 process_id_t pid; /* process id */
1177 @REPLY
1178 obj_handle_t handle; /* handle to the snapshot */
1179 @END
1182 /* Get the next process from a snapshot */
1183 @REQ(next_process)
1184 obj_handle_t handle; /* handle to the snapshot */
1185 int reset; /* reset snapshot position? */
1186 @REPLY
1187 int count; /* process usage count */
1188 process_id_t pid; /* process id */
1189 process_id_t ppid; /* parent process id */
1190 void* heap; /* heap base */
1191 void* module; /* main module */
1192 int threads; /* number of threads */
1193 int priority; /* process priority */
1194 int handles; /* number of handles */
1195 VARARG(filename,unicode_str); /* file name of main exe */
1196 @END
1199 /* Get the next thread from a snapshot */
1200 @REQ(next_thread)
1201 obj_handle_t handle; /* handle to the snapshot */
1202 int reset; /* reset snapshot position? */
1203 @REPLY
1204 int count; /* thread usage count */
1205 process_id_t pid; /* process id */
1206 thread_id_t tid; /* thread id */
1207 int base_pri; /* base priority */
1208 int delta_pri; /* delta priority */
1209 @END
1212 /* Get the next module from a snapshot */
1213 @REQ(next_module)
1214 obj_handle_t handle; /* handle to the snapshot */
1215 int reset; /* reset snapshot position? */
1216 @REPLY
1217 process_id_t pid; /* process id */
1218 void* base; /* module base address */
1219 size_t size; /* module size */
1220 VARARG(filename,unicode_str); /* file name of module */
1221 @END
1224 /* Wait for a debug event */
1225 @REQ(wait_debug_event)
1226 int get_handle; /* should we alloc a handle for waiting? */
1227 @REPLY
1228 process_id_t pid; /* process id */
1229 thread_id_t tid; /* thread id */
1230 obj_handle_t wait; /* wait handle if no event ready */
1231 VARARG(event,debug_event); /* debug event data */
1232 @END
1235 /* Queue an exception event */
1236 @REQ(queue_exception_event)
1237 int first; /* first chance exception? */
1238 VARARG(record,exc_event); /* thread context followed by exception record */
1239 @REPLY
1240 obj_handle_t handle; /* handle to the queued event */
1241 @END
1244 /* Retrieve the status of an exception event */
1245 @REQ(get_exception_status)
1246 obj_handle_t handle; /* handle to the queued event */
1247 @REPLY
1248 VARARG(context,context); /* modified thread context */
1249 @END
1252 /* Send an output string to the debugger */
1253 @REQ(output_debug_string)
1254 void* string; /* string to display (in debugged process address space) */
1255 int unicode; /* is it Unicode? */
1256 int length; /* string length */
1257 @END
1260 /* Continue a debug event */
1261 @REQ(continue_debug_event)
1262 process_id_t pid; /* process id to continue */
1263 thread_id_t tid; /* thread id to continue */
1264 int status; /* continuation status */
1265 @END
1268 /* Start/stop debugging an existing process */
1269 @REQ(debug_process)
1270 process_id_t pid; /* id of the process to debug */
1271 int attach; /* 1=attaching / 0=detaching from the process */
1272 @END
1275 /* Simulate a breakpoint in a process */
1276 @REQ(debug_break)
1277 obj_handle_t handle; /* process handle */
1278 @REPLY
1279 int self; /* was it the caller itself? */
1280 @END
1283 /* Set debugger kill on exit flag */
1284 @REQ(set_debugger_kill_on_exit)
1285 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1286 @END
1289 /* Read data from a process address space */
1290 @REQ(read_process_memory)
1291 obj_handle_t handle; /* process handle */
1292 void* addr; /* addr to read from */
1293 @REPLY
1294 VARARG(data,bytes); /* result data */
1295 @END
1298 /* Write data to a process address space */
1299 @REQ(write_process_memory)
1300 obj_handle_t handle; /* process handle */
1301 void* addr; /* addr to write to */
1302 VARARG(data,bytes); /* data to write */
1303 @END
1306 /* Create a registry key */
1307 @REQ(create_key)
1308 obj_handle_t parent; /* handle to the parent key */
1309 unsigned int access; /* desired access rights */
1310 unsigned int attributes; /* object attributes */
1311 unsigned int options; /* creation options */
1312 time_t modif; /* last modification time */
1313 data_size_t namelen; /* length of key name in bytes */
1314 VARARG(name,unicode_str,namelen); /* key name */
1315 VARARG(class,unicode_str); /* class name */
1316 @REPLY
1317 obj_handle_t hkey; /* handle to the created key */
1318 int created; /* has it been newly created? */
1319 @END
1321 /* Open a registry key */
1322 @REQ(open_key)
1323 obj_handle_t parent; /* handle to the parent key */
1324 unsigned int access; /* desired access rights */
1325 unsigned int attributes; /* object attributes */
1326 VARARG(name,unicode_str); /* key name */
1327 @REPLY
1328 obj_handle_t hkey; /* handle to the open key */
1329 @END
1332 /* Delete a registry key */
1333 @REQ(delete_key)
1334 obj_handle_t hkey; /* handle to the key */
1335 @END
1338 /* Flush a registry key */
1339 @REQ(flush_key)
1340 obj_handle_t hkey; /* handle to the key */
1341 @END
1344 /* Enumerate registry subkeys */
1345 @REQ(enum_key)
1346 obj_handle_t hkey; /* handle to registry key */
1347 int index; /* index of subkey (or -1 for current key) */
1348 int info_class; /* requested information class */
1349 @REPLY
1350 int subkeys; /* number of subkeys */
1351 int max_subkey; /* longest subkey name */
1352 int max_class; /* longest class name */
1353 int values; /* number of values */
1354 int max_value; /* longest value name */
1355 int max_data; /* longest value data */
1356 time_t modif; /* last modification time */
1357 data_size_t total; /* total length needed for full name and class */
1358 data_size_t namelen; /* length of key name in bytes */
1359 VARARG(name,unicode_str,namelen); /* key name */
1360 VARARG(class,unicode_str); /* class name */
1361 @END
1364 /* Set a value of a registry key */
1365 @REQ(set_key_value)
1366 obj_handle_t hkey; /* handle to registry key */
1367 int type; /* value type */
1368 data_size_t namelen; /* length of value name in bytes */
1369 VARARG(name,unicode_str,namelen); /* value name */
1370 VARARG(data,bytes); /* value data */
1371 @END
1374 /* Retrieve the value of a registry key */
1375 @REQ(get_key_value)
1376 obj_handle_t hkey; /* handle to registry key */
1377 VARARG(name,unicode_str); /* value name */
1378 @REPLY
1379 int type; /* value type */
1380 data_size_t total; /* total length needed for data */
1381 VARARG(data,bytes); /* value data */
1382 @END
1385 /* Enumerate a value of a registry key */
1386 @REQ(enum_key_value)
1387 obj_handle_t hkey; /* handle to registry key */
1388 int index; /* value index */
1389 int info_class; /* requested information class */
1390 @REPLY
1391 int type; /* value type */
1392 data_size_t total; /* total length needed for full name and data */
1393 data_size_t namelen; /* length of value name in bytes */
1394 VARARG(name,unicode_str,namelen); /* value name */
1395 VARARG(data,bytes); /* value data */
1396 @END
1399 /* Delete a value of a registry key */
1400 @REQ(delete_key_value)
1401 obj_handle_t hkey; /* handle to registry key */
1402 VARARG(name,unicode_str); /* value name */
1403 @END
1406 /* Load a registry branch from a file */
1407 @REQ(load_registry)
1408 obj_handle_t hkey; /* root key to load to */
1409 obj_handle_t file; /* file to load from */
1410 VARARG(name,unicode_str); /* subkey name */
1411 @END
1414 /* UnLoad a registry branch from a file */
1415 @REQ(unload_registry)
1416 obj_handle_t hkey; /* root key to unload to */
1417 @END
1420 /* Save a registry branch to a file */
1421 @REQ(save_registry)
1422 obj_handle_t hkey; /* key to save */
1423 obj_handle_t file; /* file to save to */
1424 @END
1427 /* Add a registry key change notification */
1428 @REQ(set_registry_notification)
1429 obj_handle_t hkey; /* key to watch for changes */
1430 obj_handle_t event; /* event to set */
1431 int subtree; /* should we watch the whole subtree? */
1432 unsigned int filter; /* things to watch */
1433 @END
1436 /* Create a waitable timer */
1437 @REQ(create_timer)
1438 unsigned int access; /* wanted access rights */
1439 unsigned int attributes; /* object attributes */
1440 obj_handle_t rootdir; /* root directory */
1441 int manual; /* manual reset */
1442 VARARG(name,unicode_str); /* object name */
1443 @REPLY
1444 obj_handle_t handle; /* handle to the timer */
1445 @END
1448 /* Open a waitable timer */
1449 @REQ(open_timer)
1450 unsigned int access; /* wanted access rights */
1451 unsigned int attributes; /* object attributes */
1452 obj_handle_t rootdir; /* root directory */
1453 VARARG(name,unicode_str); /* object name */
1454 @REPLY
1455 obj_handle_t handle; /* handle to the timer */
1456 @END
1458 /* Set a waitable timer */
1459 @REQ(set_timer)
1460 obj_handle_t handle; /* handle to the timer */
1461 abs_time_t expire; /* next expiration absolute time */
1462 int period; /* timer period in ms */
1463 void* callback; /* callback function */
1464 void* arg; /* callback argument */
1465 @REPLY
1466 int signaled; /* was the timer signaled before this call ? */
1467 @END
1469 /* Cancel a waitable timer */
1470 @REQ(cancel_timer)
1471 obj_handle_t handle; /* handle to the timer */
1472 @REPLY
1473 int signaled; /* was the timer signaled before this calltime ? */
1474 @END
1476 /* Get information on a waitable timer */
1477 @REQ(get_timer_info)
1478 obj_handle_t handle; /* handle to the timer */
1479 @REPLY
1480 abs_time_t when; /* absolute time when the timer next expires */
1481 int signaled; /* is the timer signaled? */
1482 @END
1485 /* Retrieve the current context of a thread */
1486 @REQ(get_thread_context)
1487 obj_handle_t handle; /* thread handle */
1488 unsigned int flags; /* context flags */
1489 int suspend; /* if getting context during suspend */
1490 @REPLY
1491 int self; /* was it a handle to the current thread? */
1492 VARARG(context,context); /* thread context */
1493 @END
1496 /* Set the current context of a thread */
1497 @REQ(set_thread_context)
1498 obj_handle_t handle; /* thread handle */
1499 unsigned int flags; /* context flags */
1500 int suspend; /* if setting context during suspend */
1501 VARARG(context,context); /* thread context */
1502 @REPLY
1503 int self; /* was it a handle to the current thread? */
1504 @END
1507 /* Fetch a selector entry for a thread */
1508 @REQ(get_selector_entry)
1509 obj_handle_t handle; /* thread handle */
1510 int entry; /* LDT entry */
1511 @REPLY
1512 unsigned int base; /* selector base */
1513 unsigned int limit; /* selector limit */
1514 unsigned char flags; /* selector flags */
1515 @END
1518 /* Add an atom */
1519 @REQ(add_atom)
1520 obj_handle_t table; /* which table to add atom to */
1521 VARARG(name,unicode_str); /* atom name */
1522 @REPLY
1523 atom_t atom; /* resulting atom */
1524 @END
1527 /* Delete an atom */
1528 @REQ(delete_atom)
1529 obj_handle_t table; /* which table to delete atom from */
1530 atom_t atom; /* atom handle */
1531 @END
1534 /* Find an atom */
1535 @REQ(find_atom)
1536 obj_handle_t table; /* which table to find atom from */
1537 VARARG(name,unicode_str); /* atom name */
1538 @REPLY
1539 atom_t atom; /* atom handle */
1540 @END
1543 /* Get information about an atom */
1544 @REQ(get_atom_information)
1545 obj_handle_t table; /* which table to find atom from */
1546 atom_t atom; /* atom handle */
1547 @REPLY
1548 int count; /* atom lock count */
1549 int pinned; /* whether the atom has been pinned */
1550 data_size_t total; /* actual length of atom name */
1551 VARARG(name,unicode_str); /* atom name */
1552 @END
1555 /* Set information about an atom */
1556 @REQ(set_atom_information)
1557 obj_handle_t table; /* which table to find atom from */
1558 atom_t atom; /* atom handle */
1559 int pinned; /* whether to bump atom information */
1560 @END
1563 /* Empty an atom table */
1564 @REQ(empty_atom_table)
1565 obj_handle_t table; /* which table to find atom from */
1566 int if_pinned; /* whether to delete pinned atoms */
1567 @END
1570 /* Init an atom table */
1571 @REQ(init_atom_table)
1572 int entries; /* number of entries (only for local) */
1573 @REPLY
1574 obj_handle_t table; /* handle to the atom table */
1575 @END
1578 /* Get the message queue of the current thread */
1579 @REQ(get_msg_queue)
1580 @REPLY
1581 obj_handle_t handle; /* handle to the queue */
1582 @END
1585 /* Set the current message queue wakeup mask */
1586 @REQ(set_queue_mask)
1587 unsigned int wake_mask; /* wakeup bits mask */
1588 unsigned int changed_mask; /* changed bits mask */
1589 int skip_wait; /* will we skip waiting if signaled? */
1590 @REPLY
1591 unsigned int wake_bits; /* current wake bits */
1592 unsigned int changed_bits; /* current changed bits */
1593 @END
1596 /* Get the current message queue status */
1597 @REQ(get_queue_status)
1598 int clear; /* should we clear the change bits? */
1599 @REPLY
1600 unsigned int wake_bits; /* wake bits */
1601 unsigned int changed_bits; /* changed bits since last time */
1602 @END
1605 /* Retrieve the process idle event */
1606 @REQ(get_process_idle_event)
1607 obj_handle_t handle; /* process handle */
1608 @REPLY
1609 obj_handle_t event; /* handle to idle event */
1610 @END
1613 /* Send a message to a thread queue */
1614 @REQ(send_message)
1615 thread_id_t id; /* thread id */
1616 int type; /* message type (see below) */
1617 int flags; /* message flags (see below) */
1618 user_handle_t win; /* window handle */
1619 unsigned int msg; /* message code */
1620 unsigned long wparam; /* parameters */
1621 unsigned long lparam; /* parameters */
1622 int timeout; /* timeout for reply */
1623 VARARG(data,message_data); /* message data for sent messages */
1624 @END
1626 @REQ(post_quit_message)
1627 int exit_code; /* exit code to return */
1628 @END
1630 enum message_type
1632 MSG_ASCII, /* Ascii message (from SendMessageA) */
1633 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1634 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1635 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1636 MSG_CALLBACK_RESULT,/* result of a callback message */
1637 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1638 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1639 MSG_HARDWARE, /* hardware message */
1640 MSG_WINEVENT /* winevent message */
1642 #define SEND_MSG_ABORT_IF_HUNG 0x01
1645 /* Send a hardware message to a thread queue */
1646 @REQ(send_hardware_message)
1647 thread_id_t id; /* thread id */
1648 user_handle_t win; /* window handle */
1649 unsigned int msg; /* message code */
1650 unsigned int time; /* message time */
1651 unsigned long wparam; /* parameters */
1652 unsigned long lparam; /* parameters */
1653 unsigned long info; /* extra info */
1654 int x; /* x position */
1655 int y; /* y position */
1656 @END
1659 /* Get a message from the current queue */
1660 @REQ(get_message)
1661 int flags; /* see below */
1662 user_handle_t get_win; /* window handle to get */
1663 unsigned int get_first; /* first message code to get */
1664 unsigned int get_last; /* last message code to get */
1665 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1666 @REPLY
1667 user_handle_t win; /* window handle */
1668 int type; /* message type */
1669 unsigned int msg; /* message code */
1670 unsigned long wparam; /* parameters */
1671 unsigned long lparam; /* parameters */
1672 unsigned long info; /* extra info */
1673 int x; /* x position */
1674 int y; /* y position */
1675 unsigned int time; /* message time */
1676 unsigned int hw_id; /* id if hardware message */
1677 unsigned int active_hooks; /* active hooks bitmap */
1678 data_size_t total; /* total size of extra data */
1679 VARARG(data,message_data); /* message data for sent messages */
1680 @END
1681 #define GET_MSG_REMOVE 1 /* remove the message */
1682 #define GET_MSG_SENT_ONLY 2 /* only get sent messages */
1684 /* Reply to a sent message */
1685 @REQ(reply_message)
1686 unsigned int result; /* message result */
1687 int remove; /* should we remove the message? */
1688 VARARG(data,bytes); /* message data for sent messages */
1689 @END
1692 /* Accept the current hardware message */
1693 @REQ(accept_hardware_message)
1694 unsigned int hw_id; /* id of the hardware message */
1695 int remove; /* should we remove the message? */
1696 user_handle_t new_win; /* new destination window for current message */
1697 @END
1700 /* Retrieve the reply for the last message sent */
1701 @REQ(get_message_reply)
1702 int cancel; /* cancel message if not ready? */
1703 @REPLY
1704 unsigned int result; /* message result */
1705 VARARG(data,bytes); /* message data for sent messages */
1706 @END
1709 /* Set a window timer */
1710 @REQ(set_win_timer)
1711 user_handle_t win; /* window handle */
1712 unsigned int msg; /* message to post */
1713 unsigned int rate; /* timer rate in ms */
1714 unsigned long id; /* timer id */
1715 unsigned long lparam; /* message lparam (callback proc) */
1716 @REPLY
1717 unsigned long id; /* timer id */
1718 @END
1721 /* Kill a window timer */
1722 @REQ(kill_win_timer)
1723 user_handle_t win; /* window handle */
1724 unsigned int msg; /* message to post */
1725 unsigned long id; /* timer id */
1726 @END
1729 /* Retrieve info about a serial port */
1730 @REQ(get_serial_info)
1731 obj_handle_t handle; /* handle to comm port */
1732 @REPLY
1733 unsigned int readinterval;
1734 unsigned int readconst;
1735 unsigned int readmult;
1736 unsigned int writeconst;
1737 unsigned int writemult;
1738 unsigned int eventmask;
1739 @END
1742 /* Set info about a serial port */
1743 @REQ(set_serial_info)
1744 obj_handle_t handle; /* handle to comm port */
1745 int flags; /* bitmask to set values (see below) */
1746 unsigned int readinterval;
1747 unsigned int readconst;
1748 unsigned int readmult;
1749 unsigned int writeconst;
1750 unsigned int writemult;
1751 unsigned int eventmask;
1752 @END
1753 #define SERIALINFO_SET_TIMEOUTS 0x01
1754 #define SERIALINFO_SET_MASK 0x02
1757 /* Create an async I/O */
1758 @REQ(register_async)
1759 obj_handle_t handle; /* handle to comm port, socket or file */
1760 int type; /* type of queue to look after */
1761 void* io_apc; /* APC routine to queue upon end of async */
1762 void* io_sb; /* I/O status block (unique across all async on this handle) */
1763 void* io_user; /* data to pass back to caller */
1764 int count; /* count - usually # of bytes to be read/written */
1765 @END
1766 #define ASYNC_TYPE_READ 0x01
1767 #define ASYNC_TYPE_WRITE 0x02
1768 #define ASYNC_TYPE_WAIT 0x03
1771 /* Cancel all async op on a fd */
1772 @REQ(cancel_async)
1773 obj_handle_t handle; /* handle to comm port, socket or file */
1774 @END
1777 /* Create a named pipe */
1778 @REQ(create_named_pipe)
1779 unsigned int access;
1780 unsigned int attributes; /* object attributes */
1781 obj_handle_t rootdir; /* root directory */
1782 unsigned int options;
1783 unsigned int flags;
1784 unsigned int maxinstances;
1785 unsigned int outsize;
1786 unsigned int insize;
1787 unsigned int timeout;
1788 VARARG(name,unicode_str); /* pipe name */
1789 @REPLY
1790 obj_handle_t handle; /* handle to the pipe */
1791 @END
1793 /* flags in create_named_pipe and get_named_pipe_info */
1794 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
1795 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
1796 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
1797 #define NAMED_PIPE_SERVER_END 0x8000
1799 /* Open an existing named pipe */
1800 @REQ(open_named_pipe)
1801 unsigned int access;
1802 unsigned int attributes; /* object attributes */
1803 obj_handle_t rootdir; /* root directory */
1804 unsigned int flags; /* file flags */
1805 VARARG(name,unicode_str); /* pipe name */
1806 @REPLY
1807 obj_handle_t handle; /* handle to the pipe */
1808 @END
1811 /* Connect to a named pipe */
1812 @REQ(connect_named_pipe)
1813 obj_handle_t handle;
1814 obj_handle_t event;
1815 void* func;
1816 @END
1819 /* Wait for a named pipe */
1820 @REQ(wait_named_pipe)
1821 obj_handle_t handle;
1822 unsigned int timeout;
1823 obj_handle_t event;
1824 void* func;
1825 VARARG(name,unicode_str); /* pipe name */
1826 @END
1829 /* Disconnect a named pipe */
1830 @REQ(disconnect_named_pipe)
1831 obj_handle_t handle;
1832 @END
1835 @REQ(get_named_pipe_info)
1836 obj_handle_t handle;
1837 @REPLY
1838 unsigned int flags;
1839 unsigned int maxinstances;
1840 unsigned int instances;
1841 unsigned int outsize;
1842 unsigned int insize;
1843 @END
1846 /* Create a window */
1847 @REQ(create_window)
1848 user_handle_t parent; /* parent window */
1849 user_handle_t owner; /* owner window */
1850 atom_t atom; /* class atom */
1851 void* instance; /* module instance */
1852 @REPLY
1853 user_handle_t handle; /* created window */
1854 user_handle_t parent; /* full handle of parent */
1855 user_handle_t owner; /* full handle of owner */
1856 int extra; /* number of extra bytes */
1857 void* class_ptr; /* pointer to class in client address space */
1858 @END
1861 /* Destroy a window */
1862 @REQ(destroy_window)
1863 user_handle_t handle; /* handle to the window */
1864 @END
1867 /* Retrieve the desktop window for the current thread */
1868 @REQ(get_desktop_window)
1869 int force; /* force creation if it doesn't exist */
1870 @REPLY
1871 user_handle_t handle; /* handle to the desktop window */
1872 @END
1875 /* Set a window owner */
1876 @REQ(set_window_owner)
1877 user_handle_t handle; /* handle to the window */
1878 user_handle_t owner; /* new owner */
1879 @REPLY
1880 user_handle_t full_owner; /* full handle of new owner */
1881 user_handle_t prev_owner; /* full handle of previous owner */
1882 @END
1885 /* Get information from a window handle */
1886 @REQ(get_window_info)
1887 user_handle_t handle; /* handle to the window */
1888 @REPLY
1889 user_handle_t full_handle; /* full 32-bit handle */
1890 user_handle_t last_active; /* last active popup */
1891 process_id_t pid; /* process owning the window */
1892 thread_id_t tid; /* thread owning the window */
1893 atom_t atom; /* class atom */
1894 int is_unicode; /* ANSI or unicode */
1895 @END
1898 /* Set some information in a window */
1899 @REQ(set_window_info)
1900 unsigned int flags; /* flags for fields to set (see below) */
1901 user_handle_t handle; /* handle to the window */
1902 unsigned int style; /* window style */
1903 unsigned int ex_style; /* window extended style */
1904 unsigned int id; /* window id */
1905 int is_unicode; /* ANSI or unicode */
1906 void* instance; /* creator instance */
1907 unsigned long user_data; /* user-specific data */
1908 int extra_offset; /* offset to set in extra bytes */
1909 data_size_t extra_size; /* size to set in extra bytes */
1910 unsigned long extra_value; /* value to set in extra bytes */
1911 @REPLY
1912 unsigned int old_style; /* old window style */
1913 unsigned int old_ex_style; /* old window extended style */
1914 unsigned int old_id; /* old window id */
1915 void* old_instance; /* old creator instance */
1916 unsigned long old_user_data; /* old user-specific data */
1917 unsigned long old_extra_value; /* old value in extra bytes */
1918 @END
1919 #define SET_WIN_STYLE 0x01
1920 #define SET_WIN_EXSTYLE 0x02
1921 #define SET_WIN_ID 0x04
1922 #define SET_WIN_INSTANCE 0x08
1923 #define SET_WIN_USERDATA 0x10
1924 #define SET_WIN_EXTRA 0x20
1925 #define SET_WIN_UNICODE 0x40
1928 /* Set the parent of a window */
1929 @REQ(set_parent)
1930 user_handle_t handle; /* handle to the window */
1931 user_handle_t parent; /* handle to the parent */
1932 @REPLY
1933 user_handle_t old_parent; /* old parent window */
1934 user_handle_t full_parent; /* full handle of new parent */
1935 @END
1938 /* Get a list of the window parents, up to the root of the tree */
1939 @REQ(get_window_parents)
1940 user_handle_t handle; /* handle to the window */
1941 @REPLY
1942 int count; /* total count of parents */
1943 VARARG(parents,user_handles); /* parent handles */
1944 @END
1947 /* Get a list of the window children */
1948 @REQ(get_window_children)
1949 user_handle_t parent; /* parent window */
1950 atom_t atom; /* class atom for the listed children */
1951 thread_id_t tid; /* thread owning the listed children */
1952 @REPLY
1953 int count; /* total count of children */
1954 VARARG(children,user_handles); /* children handles */
1955 @END
1958 /* Get a list of the window children that contain a given point */
1959 @REQ(get_window_children_from_point)
1960 user_handle_t parent; /* parent window */
1961 int x; /* point in parent coordinates */
1962 int y;
1963 @REPLY
1964 int count; /* total count of children */
1965 VARARG(children,user_handles); /* children handles */
1966 @END
1969 /* Get window tree information from a window handle */
1970 @REQ(get_window_tree)
1971 user_handle_t handle; /* handle to the window */
1972 @REPLY
1973 user_handle_t parent; /* parent window */
1974 user_handle_t owner; /* owner window */
1975 user_handle_t next_sibling; /* next sibling in Z-order */
1976 user_handle_t prev_sibling; /* prev sibling in Z-order */
1977 user_handle_t first_sibling; /* first sibling in Z-order */
1978 user_handle_t last_sibling; /* last sibling in Z-order */
1979 user_handle_t first_child; /* first child */
1980 user_handle_t last_child; /* last child */
1981 @END
1983 /* Set the position and Z order of a window */
1984 @REQ(set_window_pos)
1985 unsigned int flags; /* SWP_* flags */
1986 user_handle_t handle; /* handle to the window */
1987 user_handle_t previous; /* previous window in Z order */
1988 rectangle_t window; /* window rectangle */
1989 rectangle_t client; /* client rectangle */
1990 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
1991 @REPLY
1992 unsigned int new_style; /* new window style */
1993 @END
1996 /* Get the window and client rectangles of a window */
1997 @REQ(get_window_rectangles)
1998 user_handle_t handle; /* handle to the window */
1999 @REPLY
2000 rectangle_t window; /* window rectangle */
2001 rectangle_t visible; /* visible part of the window rectangle */
2002 rectangle_t client; /* client rectangle */
2003 @END
2006 /* Get the window text */
2007 @REQ(get_window_text)
2008 user_handle_t handle; /* handle to the window */
2009 @REPLY
2010 VARARG(text,unicode_str); /* window text */
2011 @END
2014 /* Set the window text */
2015 @REQ(set_window_text)
2016 user_handle_t handle; /* handle to the window */
2017 VARARG(text,unicode_str); /* window text */
2018 @END
2021 /* Get the coordinates offset between two windows */
2022 @REQ(get_windows_offset)
2023 user_handle_t from; /* handle to the first window */
2024 user_handle_t to; /* handle to the second window */
2025 @REPLY
2026 int x; /* x coordinate offset */
2027 int y; /* y coordinate offset */
2028 @END
2031 /* Get the visible region of a window */
2032 @REQ(get_visible_region)
2033 user_handle_t window; /* handle to the window */
2034 unsigned int flags; /* DCX flags */
2035 @REPLY
2036 user_handle_t top_win; /* top window to clip against */
2037 rectangle_t top_rect; /* top window visible rect with screen coords */
2038 rectangle_t win_rect; /* window rect in screen coords */
2039 data_size_t total_size; /* total size of the resulting region */
2040 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2041 @END
2044 /* Get the window region */
2045 @REQ(get_window_region)
2046 user_handle_t window; /* handle to the window */
2047 @REPLY
2048 data_size_t total_size; /* total size of the resulting region */
2049 VARARG(region,rectangles); /* list of rectangles for the region */
2050 @END
2053 /* Set the window region */
2054 @REQ(set_window_region)
2055 user_handle_t window; /* handle to the window */
2056 VARARG(region,rectangles); /* list of rectangles for the region */
2057 @END
2060 /* Get the window update region */
2061 @REQ(get_update_region)
2062 user_handle_t window; /* handle to the window */
2063 user_handle_t from_child; /* child to start searching from */
2064 unsigned int flags; /* update flags (see below) */
2065 @REPLY
2066 user_handle_t child; /* child to repaint (or window itself) */
2067 unsigned int flags; /* resulting update flags (see below) */
2068 data_size_t total_size; /* total size of the resulting region */
2069 VARARG(region,rectangles); /* list of rectangles for the region */
2070 @END
2071 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2072 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2073 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2074 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2075 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2076 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2077 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2080 /* Update the z order of a window so that a given rectangle is fully visible */
2081 @REQ(update_window_zorder)
2082 user_handle_t window; /* handle to the window */
2083 rectangle_t rect; /* rectangle that must be visible */
2084 @END
2087 /* Mark parts of a window as needing a redraw */
2088 @REQ(redraw_window)
2089 user_handle_t window; /* handle to the window */
2090 unsigned int flags; /* RDW_* flags */
2091 VARARG(region,rectangles); /* list of rectangles for the region */
2092 @END
2095 /* Set a window property */
2096 @REQ(set_window_property)
2097 user_handle_t window; /* handle to the window */
2098 atom_t atom; /* property atom (if no name specified) */
2099 obj_handle_t handle; /* handle to store */
2100 VARARG(name,unicode_str); /* property name */
2101 @END
2104 /* Remove a window property */
2105 @REQ(remove_window_property)
2106 user_handle_t window; /* handle to the window */
2107 atom_t atom; /* property atom (if no name specified) */
2108 VARARG(name,unicode_str); /* property name */
2109 @REPLY
2110 obj_handle_t handle; /* handle stored in property */
2111 @END
2114 /* Get a window property */
2115 @REQ(get_window_property)
2116 user_handle_t window; /* handle to the window */
2117 atom_t atom; /* property atom (if no name specified) */
2118 VARARG(name,unicode_str); /* property name */
2119 @REPLY
2120 obj_handle_t handle; /* handle stored in property */
2121 @END
2124 /* Get the list of properties of a window */
2125 @REQ(get_window_properties)
2126 user_handle_t window; /* handle to the window */
2127 @REPLY
2128 int total; /* total number of properties */
2129 VARARG(props,properties); /* list of properties */
2130 @END
2133 /* Create a window station */
2134 @REQ(create_winstation)
2135 unsigned int flags; /* window station flags */
2136 unsigned int access; /* wanted access rights */
2137 unsigned int attributes; /* object attributes */
2138 VARARG(name,unicode_str); /* object name */
2139 @REPLY
2140 obj_handle_t handle; /* handle to the window station */
2141 @END
2144 /* Open a handle to a window station */
2145 @REQ(open_winstation)
2146 unsigned int access; /* wanted access rights */
2147 unsigned int attributes; /* object attributes */
2148 VARARG(name,unicode_str); /* object name */
2149 @REPLY
2150 obj_handle_t handle; /* handle to the window station */
2151 @END
2154 /* Close a window station */
2155 @REQ(close_winstation)
2156 obj_handle_t handle; /* handle to the window station */
2157 @END
2160 /* Get the process current window station */
2161 @REQ(get_process_winstation)
2162 @REPLY
2163 obj_handle_t handle; /* handle to the window station */
2164 @END
2167 /* Set the process current window station */
2168 @REQ(set_process_winstation)
2169 obj_handle_t handle; /* handle to the window station */
2170 @END
2173 /* Create a desktop */
2174 @REQ(create_desktop)
2175 unsigned int flags; /* desktop flags */
2176 unsigned int access; /* wanted access rights */
2177 unsigned int attributes; /* object attributes */
2178 VARARG(name,unicode_str); /* object name */
2179 @REPLY
2180 obj_handle_t handle; /* handle to the desktop */
2181 @END
2184 /* Open a handle to a desktop */
2185 @REQ(open_desktop)
2186 unsigned int flags; /* desktop flags */
2187 unsigned int access; /* wanted access rights */
2188 unsigned int attributes; /* object attributes */
2189 VARARG(name,unicode_str); /* object name */
2190 @REPLY
2191 obj_handle_t handle; /* handle to the desktop */
2192 @END
2195 /* Close a desktop */
2196 @REQ(close_desktop)
2197 obj_handle_t handle; /* handle to the desktop */
2198 @END
2201 /* Get the thread current desktop */
2202 @REQ(get_thread_desktop)
2203 thread_id_t tid; /* thread id */
2204 @REPLY
2205 obj_handle_t handle; /* handle to the desktop */
2206 @END
2209 /* Set the thread current desktop */
2210 @REQ(set_thread_desktop)
2211 obj_handle_t handle; /* handle to the desktop */
2212 @END
2215 /* Get/set information about a user object (window station or desktop) */
2216 @REQ(set_user_object_info)
2217 obj_handle_t handle; /* handle to the object */
2218 unsigned int flags; /* information to set */
2219 unsigned int obj_flags; /* new object flags */
2220 @REPLY
2221 int is_desktop; /* is object a desktop? */
2222 unsigned int old_obj_flags; /* old object flags */
2223 VARARG(name,unicode_str); /* object name */
2224 @END
2225 #define SET_USER_OBJECT_FLAGS 1
2228 /* Attach (or detach) thread inputs */
2229 @REQ(attach_thread_input)
2230 thread_id_t tid_from; /* thread to be attached */
2231 thread_id_t tid_to; /* thread to which tid_from should be attached */
2232 int attach; /* is it an attach? */
2233 @END
2236 /* Get input data for a given thread */
2237 @REQ(get_thread_input)
2238 thread_id_t tid; /* id of thread */
2239 @REPLY
2240 user_handle_t focus; /* handle to the focus window */
2241 user_handle_t capture; /* handle to the capture window */
2242 user_handle_t active; /* handle to the active window */
2243 user_handle_t foreground; /* handle to the global foreground window */
2244 user_handle_t menu_owner; /* handle to the menu owner */
2245 user_handle_t move_size; /* handle to the moving/resizing window */
2246 user_handle_t caret; /* handle to the caret window */
2247 rectangle_t rect; /* caret rectangle */
2248 @END
2251 /* Get the time of the last input event */
2252 @REQ(get_last_input_time)
2253 @REPLY
2254 unsigned int time;
2255 @END
2258 /* Retrieve queue keyboard state for a given thread */
2259 @REQ(get_key_state)
2260 thread_id_t tid; /* id of thread */
2261 int key; /* optional key code or -1 */
2262 @REPLY
2263 unsigned char state; /* state of specified key */
2264 VARARG(keystate,bytes); /* state array for all the keys */
2265 @END
2267 /* Set queue keyboard state for a given thread */
2268 @REQ(set_key_state)
2269 thread_id_t tid; /* id of thread */
2270 VARARG(keystate,bytes); /* state array for all the keys */
2271 @END
2273 /* Set the system foreground window */
2274 @REQ(set_foreground_window)
2275 user_handle_t handle; /* handle to the foreground window */
2276 @REPLY
2277 user_handle_t previous; /* handle to the previous foreground window */
2278 int send_msg_old; /* whether we have to send a msg to the old window */
2279 int send_msg_new; /* whether we have to send a msg to the new window */
2280 @END
2282 /* Set the current thread focus window */
2283 @REQ(set_focus_window)
2284 user_handle_t handle; /* handle to the focus window */
2285 @REPLY
2286 user_handle_t previous; /* handle to the previous focus window */
2287 @END
2289 /* Set the current thread active window */
2290 @REQ(set_active_window)
2291 user_handle_t handle; /* handle to the active window */
2292 @REPLY
2293 user_handle_t previous; /* handle to the previous active window */
2294 @END
2296 /* Set the current thread capture window */
2297 @REQ(set_capture_window)
2298 user_handle_t handle; /* handle to the capture window */
2299 unsigned int flags; /* capture flags (see below) */
2300 @REPLY
2301 user_handle_t previous; /* handle to the previous capture window */
2302 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2303 @END
2304 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2305 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2308 /* Set the current thread caret window */
2309 @REQ(set_caret_window)
2310 user_handle_t handle; /* handle to the caret window */
2311 int width; /* caret width */
2312 int height; /* caret height */
2313 @REPLY
2314 user_handle_t previous; /* handle to the previous caret window */
2315 rectangle_t old_rect; /* previous caret rectangle */
2316 int old_hide; /* previous hide count */
2317 int old_state; /* previous caret state (1=on, 0=off) */
2318 @END
2321 /* Set the current thread caret information */
2322 @REQ(set_caret_info)
2323 unsigned int flags; /* caret flags (see below) */
2324 user_handle_t handle; /* handle to the caret window */
2325 int x; /* caret x position */
2326 int y; /* caret y position */
2327 int hide; /* increment for hide count (can be negative to show it) */
2328 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2329 @REPLY
2330 user_handle_t full_handle; /* handle to the current caret window */
2331 rectangle_t old_rect; /* previous caret rectangle */
2332 int old_hide; /* previous hide count */
2333 int old_state; /* previous caret state (1=on, 0=off) */
2334 @END
2335 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2336 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2337 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2340 /* Set a window hook */
2341 @REQ(set_hook)
2342 int id; /* id of the hook */
2343 process_id_t pid; /* id of process to set the hook into */
2344 thread_id_t tid; /* id of thread to set the hook into */
2345 int event_min;
2346 int event_max;
2347 int flags;
2348 void* proc; /* hook procedure */
2349 int unicode; /* is it a unicode hook? */
2350 VARARG(module,unicode_str); /* module name */
2351 @REPLY
2352 user_handle_t handle; /* handle to the hook */
2353 unsigned int active_hooks; /* active hooks bitmap */
2354 @END
2357 /* Remove a window hook */
2358 @REQ(remove_hook)
2359 user_handle_t handle; /* handle to the hook */
2360 int id; /* id of the hook if handle is 0 */
2361 void* proc; /* hook procedure if handle is 0 */
2362 @REPLY
2363 unsigned int active_hooks; /* active hooks bitmap */
2364 @END
2367 /* Start calling a hook chain */
2368 @REQ(start_hook_chain)
2369 int id; /* id of the hook */
2370 int event; /* signalled event */
2371 user_handle_t window; /* handle to the event window */
2372 int object_id; /* object id for out of context winevent */
2373 int child_id; /* child id for out of context winevent */
2374 @REPLY
2375 user_handle_t handle; /* handle to the next hook */
2376 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2377 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2378 void* proc; /* hook procedure */
2379 int unicode; /* is it a unicode hook? */
2380 unsigned int active_hooks; /* active hooks bitmap */
2381 VARARG(module,unicode_str); /* module name */
2382 @END
2385 /* Finished calling a hook chain */
2386 @REQ(finish_hook_chain)
2387 int id; /* id of the hook */
2388 @END
2391 /* Get the hook information */
2392 @REQ(get_hook_info)
2393 user_handle_t handle; /* handle to the current hook */
2394 int get_next; /* do we want info about current or next hook? */
2395 int event; /* signalled event */
2396 user_handle_t window; /* handle to the event window */
2397 int object_id; /* object id for out of context winevent */
2398 int child_id; /* child id for out of context winevent */
2399 @REPLY
2400 user_handle_t handle; /* handle to the hook */
2401 int id; /* id of the hook */
2402 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2403 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2404 void* proc; /* hook procedure */
2405 int unicode; /* is it a unicode hook? */
2406 VARARG(module,unicode_str); /* module name */
2407 @END
2410 /* Create a window class */
2411 @REQ(create_class)
2412 int local; /* is it a local class? */
2413 atom_t atom; /* class atom */
2414 unsigned int style; /* class style */
2415 void* instance; /* module instance */
2416 int extra; /* number of extra class bytes */
2417 int win_extra; /* number of window extra bytes */
2418 void* client_ptr; /* pointer to class in client address space */
2419 @END
2422 /* Destroy a window class */
2423 @REQ(destroy_class)
2424 atom_t atom; /* class atom */
2425 void* instance; /* module instance */
2426 @REPLY
2427 void* client_ptr; /* pointer to class in client address space */
2428 @END
2431 /* Set some information in a class */
2432 @REQ(set_class_info)
2433 user_handle_t window; /* handle to the window */
2434 unsigned int flags; /* flags for info to set (see below) */
2435 atom_t atom; /* class atom */
2436 unsigned int style; /* class style */
2437 int win_extra; /* number of window extra bytes */
2438 void* instance; /* module instance */
2439 int extra_offset; /* offset to set in extra bytes */
2440 data_size_t extra_size; /* size to set in extra bytes */
2441 unsigned long extra_value; /* value to set in extra bytes */
2442 @REPLY
2443 atom_t old_atom; /* previous class atom */
2444 unsigned int old_style; /* previous class style */
2445 int old_extra; /* previous number of class extra bytes */
2446 int old_win_extra; /* previous number of window extra bytes */
2447 void* old_instance; /* previous module instance */
2448 unsigned long old_extra_value; /* old value in extra bytes */
2449 @END
2450 #define SET_CLASS_ATOM 0x0001
2451 #define SET_CLASS_STYLE 0x0002
2452 #define SET_CLASS_WINEXTRA 0x0004
2453 #define SET_CLASS_INSTANCE 0x0008
2454 #define SET_CLASS_EXTRA 0x0010
2457 /* Set/get clipboard information */
2458 @REQ(set_clipboard_info)
2459 unsigned int flags; /* flags for fields to set (see below) */
2460 user_handle_t clipboard; /* clipboard window */
2461 user_handle_t owner; /* clipboard owner */
2462 user_handle_t viewer; /* first clipboard viewer */
2463 unsigned int seqno; /* change sequence number */
2464 @REPLY
2465 unsigned int flags; /* status flags (see below) */
2466 user_handle_t old_clipboard; /* old clipboard window */
2467 user_handle_t old_owner; /* old clipboard owner */
2468 user_handle_t old_viewer; /* old clipboard viewer */
2469 unsigned int seqno; /* current sequence number */
2470 @END
2472 #define SET_CB_OPEN 0x001
2473 #define SET_CB_OWNER 0x002
2474 #define SET_CB_VIEWER 0x004
2475 #define SET_CB_SEQNO 0x008
2476 #define SET_CB_RELOWNER 0x010
2477 #define SET_CB_CLOSE 0x020
2478 #define CB_OPEN 0x040
2479 #define CB_OWNER 0x080
2480 #define CB_PROCESS 0x100
2483 /* Open a security token */
2484 @REQ(open_token)
2485 obj_handle_t handle; /* handle to the thread or process */
2486 unsigned int access; /* access rights to the new token */
2487 unsigned int attributes;/* object attributes */
2488 unsigned int flags; /* flags (see below) */
2489 @REPLY
2490 obj_handle_t token; /* handle to the token */
2491 @END
2492 #define OPEN_TOKEN_THREAD 1
2493 #define OPEN_TOKEN_AS_SELF 2
2496 /* Set/get the global windows */
2497 @REQ(set_global_windows)
2498 unsigned int flags; /* flags for fields to set (see below) */
2499 user_handle_t shell_window; /* handle to the new shell window */
2500 user_handle_t shell_listview; /* handle to the new shell listview window */
2501 user_handle_t progman_window; /* handle to the new program manager window */
2502 user_handle_t taskman_window; /* handle to the new task manager window */
2503 @REPLY
2504 user_handle_t old_shell_window; /* handle to the shell window */
2505 user_handle_t old_shell_listview; /* handle to the shell listview window */
2506 user_handle_t old_progman_window; /* handle to the new program manager window */
2507 user_handle_t old_taskman_window; /* handle to the new task manager window */
2508 @END
2509 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2510 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2511 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2513 /* Adjust the privileges held by a token */
2514 @REQ(adjust_token_privileges)
2515 obj_handle_t handle; /* handle to the token */
2516 int disable_all; /* disable all privileges? */
2517 int get_modified_state; /* get modified privileges? */
2518 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2519 @REPLY
2520 unsigned int len; /* total length in bytes required to store token privileges */
2521 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2522 @END
2524 /* Retrieves the set of privileges held by or available to a token */
2525 @REQ(get_token_privileges)
2526 obj_handle_t handle; /* handle to the token */
2527 @REPLY
2528 unsigned int len; /* total length in bytes required to store token privileges */
2529 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2530 @END
2532 /* Check the token has the required privileges */
2533 @REQ(check_token_privileges)
2534 obj_handle_t handle; /* handle to the token */
2535 int all_required; /* are all the privileges required for the check to succeed? */
2536 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2537 @REPLY
2538 int has_privileges; /* does the token have the required privileges? */
2539 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2540 @END
2542 @REQ(duplicate_token)
2543 obj_handle_t handle; /* handle to the token to duplicate */
2544 unsigned int access; /* access rights to the new token */
2545 unsigned int attributes; /* object attributes */
2546 int primary; /* is the new token to be a primary one? */
2547 int impersonation_level; /* impersonation level of the new token */
2548 @REPLY
2549 obj_handle_t new_handle; /* duplicated handle */
2550 @END
2552 @REQ(access_check)
2553 obj_handle_t handle; /* handle to the token */
2554 unsigned int desired_access; /* desired access to the object */
2555 unsigned int mapping_read; /* mapping from generic read to specific rights */
2556 unsigned int mapping_write; /* mapping from generic write to specific rights */
2557 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2558 unsigned int mapping_all; /* mapping from generic all to specific rights */
2559 VARARG(sd,security_descriptor); /* security descriptor to check */
2560 @REPLY
2561 unsigned int access_granted; /* access rights actually granted */
2562 unsigned int access_status; /* was access granted? */
2563 unsigned int privileges_len; /* length needed to store privileges */
2564 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2565 @END
2567 @REQ(get_token_user)
2568 obj_handle_t handle; /* handle to the token */
2569 @REPLY
2570 data_size_t user_len; /* length needed to store user */
2571 VARARG(user,SID); /* sid of the user the token represents */
2572 @END
2574 @REQ(get_token_groups)
2575 obj_handle_t handle; /* handle to the token */
2576 @REPLY
2577 data_size_t user_len; /* length needed to store user */
2578 VARARG(user,token_groups); /* groups the token's user belongs to */
2579 @END
2581 /* Create a mailslot */
2582 @REQ(create_mailslot)
2583 unsigned int access; /* wanted access rights */
2584 unsigned int attributes; /* object attributes */
2585 obj_handle_t rootdir; /* root directory */
2586 unsigned int max_msgsize;
2587 int read_timeout;
2588 VARARG(name,unicode_str); /* mailslot name */
2589 @REPLY
2590 obj_handle_t handle; /* handle to the mailslot */
2591 @END
2594 /* Open an existing mailslot */
2595 @REQ(open_mailslot)
2596 unsigned int access;
2597 unsigned int attributes; /* object attributes */
2598 obj_handle_t rootdir; /* root directory */
2599 unsigned int sharing; /* sharing mode */
2600 VARARG(name,unicode_str); /* mailslot name */
2601 @REPLY
2602 obj_handle_t handle; /* handle to the mailslot */
2603 @END
2606 /* Set mailslot information */
2607 @REQ(set_mailslot_info)
2608 obj_handle_t handle; /* handle to the mailslot */
2609 unsigned int flags;
2610 int read_timeout;
2611 @REPLY
2612 unsigned int max_msgsize;
2613 int read_timeout;
2614 @END
2615 #define MAILSLOT_SET_READ_TIMEOUT 1
2618 /* Create a directory object */
2619 @REQ(create_directory)
2620 unsigned int access; /* access flags */
2621 unsigned int attributes; /* object attributes */
2622 obj_handle_t rootdir; /* root directory */
2623 VARARG(directory_name,unicode_str); /* Directory name */
2624 @REPLY
2625 obj_handle_t handle; /* handle to the directory */
2626 @END
2629 /* Open a directory object */
2630 @REQ(open_directory)
2631 unsigned int access; /* access flags */
2632 unsigned int attributes; /* object attributes */
2633 obj_handle_t rootdir; /* root directory */
2634 VARARG(directory_name,unicode_str); /* Directory name */
2635 @REPLY
2636 obj_handle_t handle; /* handle to the directory */
2637 @END
2640 /* Create a symbolic link object */
2641 @REQ(create_symlink)
2642 unsigned int access; /* access flags */
2643 unsigned int attributes; /* object attributes */
2644 obj_handle_t rootdir; /* root directory */
2645 data_size_t name_len; /* length of the symlink name in bytes */
2646 VARARG(name,unicode_str,name_len); /* symlink name */
2647 VARARG(target_name,unicode_str); /* target name */
2648 @REPLY
2649 obj_handle_t handle; /* handle to the symlink */
2650 @END
2653 /* Open a symbolic link object */
2654 @REQ(open_symlink)
2655 unsigned int access; /* access flags */
2656 unsigned int attributes; /* object attributes */
2657 obj_handle_t rootdir; /* root directory */
2658 VARARG(name,unicode_str); /* symlink name */
2659 @REPLY
2660 obj_handle_t handle; /* handle to the symlink */
2661 @END
2664 /* Query a symbolic link object */
2665 @REQ(query_symlink)
2666 obj_handle_t handle; /* handle to the symlink */
2667 @REPLY
2668 VARARG(target_name,unicode_str); /* target name */
2669 @END