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