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 */
34 typedef void *obj_handle_t;
35 typedef void *user_handle_t;
36 typedef unsigned short atom_t;
37 typedef unsigned int process_id_t;
38 typedef unsigned int thread_id_t;
39 typedef unsigned int data_size_t;
40 typedef unsigned int ioctl_code_t;
41 typedef unsigned __int64 file_pos_t;
45 int req; /* request code */
46 data_size_t request_size; /* request variable part size */
47 data_size_t reply_size; /* reply variable part maximum size */
52 unsigned int error; /* error result */
53 data_size_t reply_size; /* reply variable part size */
56 /* placeholder structure for the maximum allowed request size */
57 /* this is used to construct the generic_request union */
58 struct request_max_size
60 int pad[16]; /* the max request size is 16 ints */
63 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
64 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
67 /* definitions of the event data depending on the event code */
68 struct debug_event_exception
70 EXCEPTION_RECORD record; /* exception record */
71 int first; /* first chance exception? */
73 struct debug_event_create_thread
75 obj_handle_t handle; /* handle to the new thread */
76 void *teb; /* thread teb (in debugged process address space) */
77 void *start; /* thread startup routine */
79 struct debug_event_create_process
81 obj_handle_t file; /* handle to the process exe file */
82 obj_handle_t process; /* handle to the new process */
83 obj_handle_t thread; /* handle to the new thread */
84 void *base; /* base of executable image */
85 int dbg_offset; /* offset of debug info in file */
86 int dbg_size; /* size of debug info */
87 void *teb; /* thread teb (in debugged process address space) */
88 void *start; /* thread startup routine */
89 void *name; /* image name (optional) */
90 int unicode; /* is it Unicode? */
92 struct debug_event_exit
94 int exit_code; /* thread or process exit code */
96 struct debug_event_load_dll
98 obj_handle_t handle; /* file handle for the dll */
99 void *base; /* base address of the dll */
100 int dbg_offset; /* offset of debug info in file */
101 int dbg_size; /* size of debug info */
102 void *name; /* image name (optional) */
103 int unicode; /* is it Unicode? */
105 struct debug_event_unload_dll
107 void *base; /* base address of the dll */
109 struct debug_event_output_string
111 void *string; /* string to display (in debugged process address space) */
112 int unicode; /* is it Unicode? */
113 int length; /* string length */
115 struct debug_event_rip_info
120 union debug_event_data
122 struct debug_event_exception exception;
123 struct debug_event_create_thread create_thread;
124 struct debug_event_create_process create_process;
125 struct debug_event_exit exit;
126 struct debug_event_load_dll load_dll;
127 struct debug_event_unload_dll unload_dll;
128 struct debug_event_output_string output_string;
129 struct debug_event_rip_info rip_info;
132 /* debug event data */
135 int code; /* event code */
136 union debug_event_data info; /* event information */
139 /* structure used in sending an fd from client to server */
142 thread_id_t tid; /* thread id */
143 int fd; /* file descriptor on client-side */
146 /* structure sent by the server on the wait fifo */
149 void *cookie; /* magic cookie that was passed in select_request */
150 int signaled; /* wait result */
153 /* NT-style timeout, in 100ns units, negative means relative timeout */
154 typedef __int64 timeout_t;
155 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
157 /* structure returned in the list of window properties */
160 atom_t atom; /* property atom */
161 short string; /* was atom a string originally? */
162 obj_handle_t handle; /* handle stored in property */
165 /* structure to specify window rectangles */
174 /* structure for parameters of async I/O calls */
177 void *callback; /* client-side callback to call upon end of async */
178 void *iosb; /* I/O status block in client addr space */
179 void *arg; /* opaque user data to pass to callback */
180 void *apc; /* user apc to call */
181 obj_handle_t event; /* event to signal when done */
182 unsigned long cvalue; /* completion value to use for completion events */
185 /* structures for extra message data */
187 struct callback_msg_data
189 void *callback; /* callback function */
190 unsigned long data; /* user data for callback */
191 unsigned long result; /* message result */
194 struct winevent_msg_data
196 user_handle_t hook; /* hook handle */
197 thread_id_t tid; /* thread id */
198 void *hook_proc; /* hook proc address */
199 /* followed by module name if any */
204 unsigned char bytes[1]; /* raw data for sent messages */
205 struct callback_msg_data callback;
206 struct winevent_msg_data winevent;
209 /* structure for console char/attribute info */
218 unsigned int low_part;
222 #define MAX_ACL_LEN 65535
224 struct security_descriptor
226 unsigned int control; /* SE_ flags */
227 data_size_t owner_len;
228 data_size_t group_len;
229 data_size_t sacl_len;
230 data_size_t dacl_len;
231 /* VARARG(owner,SID); */
232 /* VARARG(group,SID); */
233 /* VARARG(sacl,ACL); */
234 /* VARARG(dacl,ACL); */
237 struct object_attributes
239 obj_handle_t rootdir; /* root directory */
240 data_size_t sd_len; /* length of security_descriptor data. may be 0 */
241 data_size_t name_len; /* length of the name string. may be 0 */
242 /* VARARG(sd,security_descriptor); */
243 /* VARARG(name,unicode_str); */
249 /* unsigned int attributes[count]; */
250 /* VARARG(sids,SID); */
276 enum apc_type type; /* APC_USER */
277 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
278 unsigned long args[3]; /* arguments for user function */
282 enum apc_type type; /* APC_TIMER */
283 void (__stdcall *func)(void*, unsigned int, unsigned int);
284 timeout_t time; /* absolute time of expiration */
285 void *arg; /* user argument */
289 enum apc_type type; /* APC_ASYNC_IO */
290 unsigned int (*func)(void*, void*, unsigned int, unsigned long *);
291 void *user; /* user pointer */
292 void *sb; /* status block */
293 unsigned int status; /* I/O status */
297 enum apc_type type; /* APC_VIRTUAL_ALLOC */
298 void *addr; /* requested address */
299 unsigned long size; /* allocation size */
300 unsigned int zero_bits; /* allocation alignment */
301 unsigned int op_type; /* type of operation */
302 unsigned int prot; /* memory protection flags */
306 enum apc_type type; /* APC_VIRTUAL_FREE */
307 void *addr; /* requested address */
308 unsigned long size; /* allocation size */
309 unsigned int op_type; /* type of operation */
313 enum apc_type type; /* APC_VIRTUAL_QUERY */
314 const void *addr; /* requested address */
318 enum apc_type type; /* APC_VIRTUAL_PROTECT */
319 void *addr; /* requested address */
320 unsigned long size; /* requested address */
321 unsigned int prot; /* new protection flags */
325 enum apc_type type; /* APC_VIRTUAL_FLUSH */
326 const void *addr; /* requested address */
327 unsigned long size; /* requested address */
331 enum apc_type type; /* APC_VIRTUAL_LOCK */
332 void *addr; /* requested address */
333 unsigned long size; /* requested address */
337 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
338 void *addr; /* requested address */
339 unsigned long size; /* requested address */
343 enum apc_type type; /* APC_MAP_VIEW */
344 obj_handle_t handle; /* mapping handle */
345 void *addr; /* requested address */
346 unsigned long size; /* allocation size */
347 file_pos_t offset; /* file offset */
348 unsigned int zero_bits; /* allocation alignment */
349 unsigned int alloc_type;/* allocation type */
350 unsigned int prot; /* memory protection flags */
354 enum apc_type type; /* APC_UNMAP_VIEW */
355 void *addr; /* view address */
359 enum apc_type type; /* APC_CREATE_THREAD */
360 void (__stdcall *func)(void*); /* start function */
361 void *arg; /* argument for start function */
362 unsigned long reserve; /* reserve size for thread stack */
363 unsigned long commit; /* commit size for thread stack */
364 int suspend; /* suspended thread? */
373 enum apc_type type; /* APC_ASYNC_IO */
374 unsigned int status; /* new status of async operation */
375 unsigned long total; /* bytes transferred */
379 enum apc_type type; /* APC_VIRTUAL_ALLOC */
380 unsigned int status; /* status returned by call */
381 void *addr; /* resulting address */
382 unsigned long size; /* resulting size */
386 enum apc_type type; /* APC_VIRTUAL_FREE */
387 unsigned int status; /* status returned by call */
388 void *addr; /* resulting address */
389 unsigned long size; /* resulting size */
393 enum apc_type type; /* APC_VIRTUAL_QUERY */
394 unsigned int status; /* status returned by call */
395 void *base; /* resulting base address */
396 void *alloc_base;/* resulting allocation base */
397 unsigned long size; /* resulting region size */
398 unsigned int state; /* resulting region state */
399 unsigned int prot; /* resulting region protection */
400 unsigned int alloc_prot;/* resulting allocation protection */
401 unsigned int alloc_type;/* resulting region allocation type */
405 enum apc_type type; /* APC_VIRTUAL_PROTECT */
406 unsigned int status; /* status returned by call */
407 void *addr; /* resulting address */
408 unsigned long size; /* resulting size */
409 unsigned int prot; /* old protection flags */
413 enum apc_type type; /* APC_VIRTUAL_FLUSH */
414 unsigned int status; /* status returned by call */
415 const void *addr; /* resulting address */
416 unsigned long size; /* resulting size */
420 enum apc_type type; /* APC_VIRTUAL_LOCK */
421 unsigned int status; /* status returned by call */
422 void *addr; /* resulting address */
423 unsigned long size; /* resulting size */
427 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
428 unsigned int status; /* status returned by call */
429 void *addr; /* resulting address */
430 unsigned long size; /* resulting size */
434 enum apc_type type; /* APC_MAP_VIEW */
435 unsigned int status; /* status returned by call */
436 void *addr; /* resulting address */
437 unsigned long size; /* resulting size */
441 enum apc_type type; /* APC_MAP_VIEW */
442 unsigned int status; /* status returned by call */
446 enum apc_type type; /* APC_CREATE_THREAD */
447 unsigned int status; /* status returned by call */
448 thread_id_t tid; /* thread id */
449 obj_handle_t handle; /* handle to new thread */
453 /****************************************************************/
454 /* Request declarations */
456 /* Create a new process from the context of the parent */
458 int inherit_all; /* inherit all handles from parent */
459 unsigned int create_flags; /* creation flags */
460 int socket_fd; /* file descriptor for process socket */
461 obj_handle_t exe_file; /* file handle for main exe */
462 obj_handle_t hstdin; /* handle for stdin */
463 obj_handle_t hstdout; /* handle for stdout */
464 obj_handle_t hstderr; /* handle for stderr */
465 unsigned int process_access; /* access rights for process object */
466 unsigned int process_attr; /* attributes for process object */
467 unsigned int thread_access; /* access rights for thread object */
468 unsigned int thread_attr; /* attributes for thread object */
469 VARARG(info,startup_info); /* startup information */
470 VARARG(env,unicode_str); /* environment for new process */
472 obj_handle_t info; /* new process info handle */
473 process_id_t pid; /* process id */
474 obj_handle_t phandle; /* process handle (in the current process) */
475 thread_id_t tid; /* thread id */
476 obj_handle_t thandle; /* thread handle (in the current process) */
480 /* Retrieve information about a newly started process */
481 @REQ(get_new_process_info)
482 obj_handle_t info; /* info handle returned from new_process_request */
484 int success; /* did the process start successfully? */
485 int exit_code; /* process exit code if failed */
489 /* Create a new thread from the context of the parent */
491 unsigned int access; /* wanted access rights */
492 unsigned int attributes; /* object attributes */
493 int suspend; /* new thread should be suspended on creation */
494 int request_fd; /* fd for request pipe */
496 thread_id_t tid; /* thread id */
497 obj_handle_t handle; /* thread handle (in the current process) */
501 /* Retrieve the new process startup info */
502 @REQ(get_startup_info)
504 obj_handle_t exe_file; /* file handle for main exe */
505 obj_handle_t hstdin; /* handle for stdin */
506 obj_handle_t hstdout; /* handle for stdout */
507 obj_handle_t hstderr; /* handle for stderr */
508 VARARG(info,startup_info); /* startup information */
509 VARARG(env,unicode_str); /* environment */
513 /* Signal the end of the process initialization */
514 @REQ(init_process_done)
515 void* module; /* main module base address */
516 void* entry; /* process entry point */
517 int gui; /* is it a GUI process? */
521 /* Initialize a thread; called from the child after fork()/clone() */
523 int unix_pid; /* Unix pid of new thread */
524 int unix_tid; /* Unix tid of new thread */
525 int debug_level; /* new debug level */
526 void* teb; /* TEB of new thread (in thread address space) */
527 void* peb; /* address of PEB (in thread address space) */
528 void* entry; /* thread entry point (in thread address space) */
529 void* ldt_copy; /* address of LDT copy (in thread address space) */
530 int reply_fd; /* fd for reply pipe */
531 int wait_fd; /* fd for blocking calls pipe */
533 process_id_t pid; /* process id of the new thread's process */
534 thread_id_t tid; /* thread id of the new thread */
535 data_size_t info_size; /* total size of startup info */
536 timeout_t server_start; /* server start time */
537 int version; /* protocol version */
541 /* Terminate a process */
542 @REQ(terminate_process)
543 obj_handle_t handle; /* process handle to terminate */
544 int exit_code; /* process exit code */
546 int self; /* suicide? */
550 /* Terminate a thread */
551 @REQ(terminate_thread)
552 obj_handle_t handle; /* thread handle to terminate */
553 int exit_code; /* thread exit code */
555 int self; /* suicide? */
556 int last; /* last thread in this process? */
560 /* Retrieve information about a process */
561 @REQ(get_process_info)
562 obj_handle_t handle; /* process handle */
564 process_id_t pid; /* server process id */
565 process_id_t ppid; /* server process id of parent */
566 int exit_code; /* process exit code */
567 int priority; /* priority class */
568 unsigned int affinity; /* process affinity mask */
569 void* peb; /* PEB address in process address space */
570 timeout_t start_time; /* process start time */
571 timeout_t end_time; /* process end time */
575 /* Set a process informations */
576 @REQ(set_process_info)
577 obj_handle_t handle; /* process handle */
578 int mask; /* setting mask (see below) */
579 int priority; /* priority class */
580 unsigned int affinity; /* affinity mask */
582 #define SET_PROCESS_INFO_PRIORITY 0x01
583 #define SET_PROCESS_INFO_AFFINITY 0x02
586 /* Retrieve information about a thread */
587 @REQ(get_thread_info)
588 obj_handle_t handle; /* thread handle */
589 thread_id_t tid_in; /* thread id (optional) */
591 process_id_t pid; /* server process id */
592 thread_id_t tid; /* server thread id */
593 void* teb; /* thread teb pointer */
594 int exit_code; /* thread exit code */
595 int priority; /* thread priority level */
596 unsigned int affinity; /* thread affinity mask */
597 timeout_t creation_time; /* thread creation time */
598 timeout_t exit_time; /* thread exit time */
599 int last; /* last thread in process */
603 /* Set a thread informations */
604 @REQ(set_thread_info)
605 obj_handle_t handle; /* thread handle */
606 int mask; /* setting mask (see below) */
607 int priority; /* priority class */
608 unsigned int affinity; /* affinity mask */
609 obj_handle_t token; /* impersonation token */
611 #define SET_THREAD_INFO_PRIORITY 0x01
612 #define SET_THREAD_INFO_AFFINITY 0x02
613 #define SET_THREAD_INFO_TOKEN 0x04
616 /* Retrieve information about a module */
618 obj_handle_t handle; /* process handle */
619 void* base_address; /* base address of module */
621 size_t size; /* module size */
623 data_size_t filename_len; /* buffer len in bytes required to store filename */
624 VARARG(filename,unicode_str); /* file name of module */
628 /* Suspend a thread */
630 obj_handle_t handle; /* thread handle */
632 int count; /* new suspend count */
636 /* Resume a thread */
638 obj_handle_t handle; /* thread handle */
640 int count; /* new suspend count */
644 /* Notify the server that a dll has been loaded */
646 obj_handle_t handle; /* file handle */
647 void* base; /* base address */
648 size_t size; /* dll size */
649 int dbg_offset; /* debug info offset */
650 int dbg_size; /* debug info size */
651 void* name; /* ptr to ptr to name (in process addr space) */
652 VARARG(filename,unicode_str); /* file name of dll */
656 /* Notify the server that a dll is being unloaded */
658 void* base; /* base address */
662 /* Queue an APC for a thread or process */
664 obj_handle_t thread; /* thread handle */
665 obj_handle_t process; /* process handle */
666 apc_call_t call; /* call arguments */
668 obj_handle_t handle; /* APC handle */
669 int self; /* run APC in caller itself? */
673 /* Get the result of an APC call */
675 obj_handle_t handle; /* handle to the APC */
677 apc_result_t result; /* result of the APC */
681 /* Close a handle for the current process */
683 obj_handle_t handle; /* handle to close */
687 /* Set a handle information */
688 @REQ(set_handle_info)
689 obj_handle_t handle; /* handle we are interested in */
690 int flags; /* new handle flags */
691 int mask; /* mask for flags to set */
693 int old_flags; /* old flag value */
697 /* Duplicate a handle */
699 obj_handle_t src_process; /* src process handle */
700 obj_handle_t src_handle; /* src handle to duplicate */
701 obj_handle_t dst_process; /* dst process handle */
702 unsigned int access; /* wanted access rights */
703 unsigned int attributes; /* object attributes */
704 unsigned int options; /* duplicate options (see below) */
706 obj_handle_t handle; /* duplicated handle in dst process */
707 int self; /* is the source the current process? */
708 int closed; /* whether the source handle has been closed */
710 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
711 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
712 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
715 /* Open a handle to a process */
717 process_id_t pid; /* process id to open */
718 unsigned int access; /* wanted access rights */
719 unsigned int attributes; /* object attributes */
721 obj_handle_t handle; /* handle to the process */
725 /* Open a handle to a thread */
727 thread_id_t tid; /* thread id to open */
728 unsigned int access; /* wanted access rights */
729 unsigned int attributes; /* object attributes */
731 obj_handle_t handle; /* handle to the thread */
735 /* Wait for handles */
737 int flags; /* wait flags (see below) */
738 void* cookie; /* magic cookie to return to client */
739 obj_handle_t signal; /* object to signal (0 if none) */
740 obj_handle_t prev_apc; /* handle to previous APC */
741 timeout_t timeout; /* timeout */
742 VARARG(result,apc_result); /* result of previous APC */
743 VARARG(handles,handles); /* handles to select on */
745 obj_handle_t apc_handle; /* handle to next APC */
746 timeout_t timeout; /* timeout converted to absolute */
747 apc_call_t call; /* APC call arguments */
750 #define SELECT_ALERTABLE 2
751 #define SELECT_INTERRUPTIBLE 4
754 /* Create an event */
756 unsigned int access; /* wanted access rights */
757 unsigned int attributes; /* object attributes */
758 int manual_reset; /* manual reset event */
759 int initial_state; /* initial state of the event */
760 VARARG(objattr,object_attributes); /* object attributes */
762 obj_handle_t handle; /* handle to the event */
765 /* Event operation */
767 obj_handle_t handle; /* handle to event */
768 int op; /* event operation (see below) */
770 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
775 unsigned int access; /* wanted access rights */
776 unsigned int attributes; /* object attributes */
777 obj_handle_t rootdir; /* root directory */
778 VARARG(name,unicode_str); /* object name */
780 obj_handle_t handle; /* handle to the event */
786 unsigned int access; /* wanted access rights */
787 unsigned int attributes; /* object attributes */
788 int owned; /* initially owned? */
789 VARARG(objattr,object_attributes); /* object attributes */
791 obj_handle_t handle; /* handle to the mutex */
795 /* Release a mutex */
797 obj_handle_t handle; /* handle to the mutex */
799 unsigned int prev_count; /* value of internal counter, before release */
805 unsigned int access; /* wanted access rights */
806 unsigned int attributes; /* object attributes */
807 obj_handle_t rootdir; /* root directory */
808 VARARG(name,unicode_str); /* object name */
810 obj_handle_t handle; /* handle to the mutex */
814 /* Create a semaphore */
815 @REQ(create_semaphore)
816 unsigned int access; /* wanted access rights */
817 unsigned int attributes; /* object attributes */
818 unsigned int initial; /* initial count */
819 unsigned int max; /* maximum count */
820 VARARG(objattr,object_attributes); /* object attributes */
822 obj_handle_t handle; /* handle to the semaphore */
826 /* Release a semaphore */
827 @REQ(release_semaphore)
828 obj_handle_t handle; /* handle to the semaphore */
829 unsigned int count; /* count to add to semaphore */
831 unsigned int prev_count; /* previous semaphore count */
835 /* Open a semaphore */
837 unsigned int access; /* wanted access rights */
838 unsigned int attributes; /* object attributes */
839 obj_handle_t rootdir; /* root directory */
840 VARARG(name,unicode_str); /* object name */
842 obj_handle_t handle; /* handle to the semaphore */
848 unsigned int access; /* wanted access rights */
849 unsigned int attributes; /* object attributes */
850 unsigned int sharing; /* sharing flags */
851 int create; /* file create action */
852 unsigned int options; /* file options */
853 unsigned int attrs; /* file attributes for creation */
854 VARARG(objattr,object_attributes); /* object attributes */
855 VARARG(filename,string); /* file name */
857 obj_handle_t handle; /* handle to the file */
861 /* Open a file object */
862 @REQ(open_file_object)
863 unsigned int access; /* wanted access rights */
864 unsigned int attributes; /* open attributes */
865 obj_handle_t rootdir; /* root directory */
866 unsigned int sharing; /* sharing flags */
867 unsigned int options; /* file options */
868 VARARG(filename,unicode_str); /* file name */
870 obj_handle_t handle; /* handle to the file */
874 /* Allocate a file handle for a Unix fd */
875 @REQ(alloc_file_handle)
876 unsigned int access; /* wanted access rights */
877 unsigned int attributes; /* object attributes */
878 int fd; /* file descriptor on the client side */
880 obj_handle_t handle; /* handle to the file */
884 /* Get a Unix fd to access a file */
886 obj_handle_t handle; /* handle to the file */
888 int type; /* file type (see below) */
889 int removable; /* is file removable? */
890 unsigned int access; /* file access rights */
891 unsigned int options; /* file open options */
895 FD_TYPE_INVALID, /* invalid file (no associated fd) */
896 FD_TYPE_FILE, /* regular file */
897 FD_TYPE_DIR, /* directory */
898 FD_TYPE_SOCKET, /* socket */
899 FD_TYPE_SERIAL, /* serial port */
900 FD_TYPE_PIPE, /* named pipe */
901 FD_TYPE_MAILSLOT, /* mailslot */
902 FD_TYPE_CHAR, /* unspecified char device */
903 FD_TYPE_DEVICE, /* Windows device file */
908 /* Flush a file buffers */
910 obj_handle_t handle; /* handle to the file */
912 obj_handle_t event; /* event set when finished */
916 /* Lock a region of a file */
918 obj_handle_t handle; /* handle to the file */
919 file_pos_t offset; /* offset of start of lock */
920 file_pos_t count; /* count of bytes to lock */
921 int shared; /* shared or exclusive lock? */
922 int wait; /* do we want to wait? */
924 obj_handle_t handle; /* handle to wait on */
925 int overlapped; /* is it an overlapped I/O handle? */
929 /* Unlock a region of a file */
931 obj_handle_t handle; /* handle to the file */
932 file_pos_t offset; /* offset of start of unlock */
933 file_pos_t count; /* count of bytes to unlock */
937 /* Create a socket */
939 unsigned int access; /* wanted access rights */
940 unsigned int attributes; /* object attributes */
941 int family; /* family, see socket manpage */
942 int type; /* type, see socket manpage */
943 int protocol; /* protocol, see socket manpage */
944 unsigned int flags; /* socket flags */
946 obj_handle_t handle; /* handle to the new socket */
950 /* Accept a socket */
952 obj_handle_t lhandle; /* handle to the listening socket */
953 unsigned int access; /* wanted access rights */
954 unsigned int attributes; /* object attributes */
956 obj_handle_t handle; /* handle to the new socket */
960 /* Set socket event parameters */
961 @REQ(set_socket_event)
962 obj_handle_t handle; /* handle to the socket */
963 unsigned int mask; /* event mask */
964 obj_handle_t event; /* event object */
965 user_handle_t window; /* window to send the message to */
966 unsigned int msg; /* message to send */
970 /* Get socket event parameters */
971 @REQ(get_socket_event)
972 obj_handle_t handle; /* handle to the socket */
973 int service; /* clear pending? */
974 obj_handle_t c_event; /* event to clear */
976 unsigned int mask; /* event mask */
977 unsigned int pmask; /* pending events */
978 unsigned int state; /* status bits */
979 VARARG(errors,ints); /* event errors */
983 /* Reenable pending socket events */
984 @REQ(enable_socket_event)
985 obj_handle_t handle; /* handle to the socket */
986 unsigned int mask; /* events to re-enable */
987 unsigned int sstate; /* status bits to set */
988 unsigned int cstate; /* status bits to clear */
991 @REQ(set_socket_deferred)
992 obj_handle_t handle; /* handle to the socket */
993 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
996 /* Allocate a console (only used by a console renderer) */
998 unsigned int access; /* wanted access rights */
999 unsigned int attributes; /* object attributes */
1000 process_id_t pid; /* pid of process which shall be attached to the console */
1002 obj_handle_t handle_in; /* handle to console input */
1003 obj_handle_t event; /* handle to renderer events change notification */
1007 /* Free the console of the current process */
1012 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1013 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1014 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1015 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1016 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1017 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1018 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1019 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1020 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1021 struct console_renderer_event
1056 /* retrieve console events for the renderer */
1057 @REQ(get_console_renderer_events)
1058 obj_handle_t handle; /* handle to console input events */
1060 VARARG(data,bytes); /* the various console_renderer_events */
1064 /* Open a handle to the process console */
1066 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1067 /* otherwise console_in handle to get active screen buffer? */
1068 unsigned int access; /* wanted access rights */
1069 unsigned int attributes; /* object attributes */
1070 int share; /* share mask (only for output handles) */
1072 obj_handle_t handle; /* handle to the console */
1076 /* Get the input queue wait event */
1077 @REQ(get_console_wait_event)
1079 obj_handle_t handle;
1082 /* Get a console mode (input or output) */
1083 @REQ(get_console_mode)
1084 obj_handle_t handle; /* handle to the console */
1086 int mode; /* console mode */
1090 /* Set a console mode (input or output) */
1091 @REQ(set_console_mode)
1092 obj_handle_t handle; /* handle to the console */
1093 int mode; /* console mode */
1097 /* Set info about a console (input only) */
1098 @REQ(set_console_input_info)
1099 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1100 int mask; /* setting mask (see below) */
1101 obj_handle_t active_sb; /* active screen buffer */
1102 int history_mode; /* whether we duplicate lines in history */
1103 int history_size; /* number of lines in history */
1104 int edition_mode; /* index to the edition mode flavors */
1105 int input_cp; /* console input codepage */
1106 int output_cp; /* console output codepage */
1107 user_handle_t win; /* console window if backend supports it */
1108 VARARG(title,unicode_str); /* console title */
1110 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1111 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1112 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1113 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1114 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1115 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1116 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1117 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1120 /* Get info about a console (input only) */
1121 @REQ(get_console_input_info)
1122 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1124 int history_mode; /* whether we duplicate lines in history */
1125 int history_size; /* number of lines in history */
1126 int history_index; /* number of used lines in history */
1127 int edition_mode; /* index to the edition mode flavors */
1128 int input_cp; /* console input codepage */
1129 int output_cp; /* console output codepage */
1130 user_handle_t win; /* console window if backend supports it */
1131 VARARG(title,unicode_str); /* console title */
1135 /* appends a string to console's history */
1136 @REQ(append_console_input_history)
1137 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1138 VARARG(line,unicode_str); /* line to add */
1142 /* appends a string to console's history */
1143 @REQ(get_console_input_history)
1144 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1145 int index; /* index to get line from */
1147 int total; /* total length of line in Unicode chars */
1148 VARARG(line,unicode_str); /* line to add */
1152 /* creates a new screen buffer on process' console */
1153 @REQ(create_console_output)
1154 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1155 unsigned int access; /* wanted access rights */
1156 unsigned int attributes; /* object attributes */
1157 unsigned int share; /* sharing credentials */
1159 obj_handle_t handle_out; /* handle to the screen buffer */
1163 /* Set info about a console (output only) */
1164 @REQ(set_console_output_info)
1165 obj_handle_t handle; /* handle to the console */
1166 int mask; /* setting mask (see below) */
1167 short int cursor_size; /* size of cursor (percentage filled) */
1168 short int cursor_visible;/* cursor visibility flag */
1169 short int cursor_x; /* position of cursor (x, y) */
1171 short int width; /* width of the screen buffer */
1172 short int height; /* height of the screen buffer */
1173 short int attr; /* default attribute */
1174 short int win_left; /* window actually displayed by renderer */
1175 short int win_top; /* the rect area is expressed withing the */
1176 short int win_right; /* boundaries of the screen buffer */
1177 short int win_bottom;
1178 short int max_width; /* maximum size (width x height) for the window */
1179 short int max_height;
1181 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1182 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1183 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1184 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1185 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1186 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1189 /* Get info about a console (output only) */
1190 @REQ(get_console_output_info)
1191 obj_handle_t handle; /* handle to the console */
1193 short int cursor_size; /* size of cursor (percentage filled) */
1194 short int cursor_visible;/* cursor visibility flag */
1195 short int cursor_x; /* position of cursor (x, y) */
1197 short int width; /* width of the screen buffer */
1198 short int height; /* height of the screen buffer */
1199 short int attr; /* default attribute */
1200 short int win_left; /* window actually displayed by renderer */
1201 short int win_top; /* the rect area is expressed withing the */
1202 short int win_right; /* boundaries of the screen buffer */
1203 short int win_bottom;
1204 short int max_width; /* maximum size (width x height) for the window */
1205 short int max_height;
1208 /* Add input records to a console input queue */
1209 @REQ(write_console_input)
1210 obj_handle_t handle; /* handle to the console input */
1211 VARARG(rec,input_records); /* input records */
1213 int written; /* number of records written */
1217 /* Fetch input records from a console input queue */
1218 @REQ(read_console_input)
1219 obj_handle_t handle; /* handle to the console input */
1220 int flush; /* flush the retrieved records from the queue? */
1222 int read; /* number of records read */
1223 VARARG(rec,input_records); /* input records */
1227 /* write data (chars and/or attributes) in a screen buffer */
1228 @REQ(write_console_output)
1229 obj_handle_t handle; /* handle to the console output */
1230 int x; /* position where to start writing */
1232 int mode; /* char info (see below) */
1233 int wrap; /* wrap around at end of line? */
1234 VARARG(data,bytes); /* info to write */
1236 int written; /* number of char infos actually written */
1237 int width; /* width of screen buffer */
1238 int height; /* height of screen buffer */
1242 CHAR_INFO_MODE_TEXT, /* characters only */
1243 CHAR_INFO_MODE_ATTR, /* attributes only */
1244 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1245 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1249 /* fill a screen buffer with constant data (chars and/or attributes) */
1250 @REQ(fill_console_output)
1251 obj_handle_t handle; /* handle to the console output */
1252 int x; /* position where to start writing */
1254 int mode; /* char info mode */
1255 int count; /* number to write */
1256 int wrap; /* wrap around at end of line? */
1257 char_info_t data; /* data to write */
1259 int written; /* number of char infos actually written */
1263 /* read data (chars and/or attributes) from a screen buffer */
1264 @REQ(read_console_output)
1265 obj_handle_t handle; /* handle to the console output */
1266 int x; /* position (x,y) where to start reading */
1268 int mode; /* char info mode */
1269 int wrap; /* wrap around at end of line? */
1271 int width; /* width of screen buffer */
1272 int height; /* height of screen buffer */
1277 /* move a rect (of data) in screen buffer content */
1278 @REQ(move_console_output)
1279 obj_handle_t handle; /* handle to the console output */
1280 short int x_src; /* position (x, y) of rect to start moving from */
1282 short int x_dst; /* position (x, y) of rect to move to */
1284 short int w; /* size of the rect (width, height) to move */
1289 /* Sends a signal to a process group */
1290 @REQ(send_console_signal)
1291 int signal; /* the signal to send */
1292 process_id_t group_id; /* the group to send the signal to */
1296 /* enable directory change notifications */
1297 @REQ(read_directory_changes)
1298 unsigned int filter; /* notification filter */
1299 obj_handle_t handle; /* handle to the directory */
1300 int subtree; /* watch the subtree? */
1301 int want_data; /* flag indicating whether change data should be collected */
1302 async_data_t async; /* async I/O parameters */
1307 obj_handle_t handle;
1309 int action; /* type of change */
1310 VARARG(name,string); /* name of directory entry that changed */
1314 /* Create a file mapping */
1315 @REQ(create_mapping)
1316 unsigned int access; /* wanted access rights */
1317 unsigned int attributes; /* object attributes */
1318 file_pos_t size; /* mapping size */
1319 int protect; /* protection flags (see below) */
1320 obj_handle_t file_handle; /* file handle */
1321 VARARG(objattr,object_attributes); /* object attributes */
1323 obj_handle_t handle; /* handle to the mapping */
1325 /* protection flags */
1326 #define VPROT_READ 0x01
1327 #define VPROT_WRITE 0x02
1328 #define VPROT_EXEC 0x04
1329 #define VPROT_WRITECOPY 0x08
1330 #define VPROT_GUARD 0x10
1331 #define VPROT_NOCACHE 0x20
1332 #define VPROT_COMMITTED 0x40
1333 #define VPROT_IMAGE 0x80
1336 /* Open a mapping */
1338 unsigned int access; /* wanted access rights */
1339 unsigned int attributes; /* object attributes */
1340 obj_handle_t rootdir; /* root directory */
1341 VARARG(name,unicode_str); /* object name */
1343 obj_handle_t handle; /* handle to the mapping */
1347 /* Get information about a file mapping */
1348 @REQ(get_mapping_info)
1349 obj_handle_t handle; /* handle to the mapping */
1351 file_pos_t size; /* mapping size */
1352 int protect; /* protection flags */
1353 int header_size; /* header size (for VPROT_IMAGE mapping) */
1354 void* base; /* default base addr (for VPROT_IMAGE mapping) */
1355 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1356 obj_handle_t shared_file; /* shared mapping file handle */
1360 #define SNAP_HEAPLIST 0x00000001
1361 #define SNAP_PROCESS 0x00000002
1362 #define SNAP_THREAD 0x00000004
1363 #define SNAP_MODULE 0x00000008
1364 /* Create a snapshot */
1365 @REQ(create_snapshot)
1366 unsigned int attributes; /* object attributes */
1367 int flags; /* snapshot flags (SNAP_*) */
1368 process_id_t pid; /* process id */
1370 obj_handle_t handle; /* handle to the snapshot */
1374 /* Get the next process from a snapshot */
1376 obj_handle_t handle; /* handle to the snapshot */
1377 int reset; /* reset snapshot position? */
1379 int count; /* process usage count */
1380 process_id_t pid; /* process id */
1381 process_id_t ppid; /* parent process id */
1382 void* heap; /* heap base */
1383 void* module; /* main module */
1384 int threads; /* number of threads */
1385 int priority; /* process priority */
1386 int handles; /* number of handles */
1387 VARARG(filename,unicode_str); /* file name of main exe */
1391 /* Get the next thread from a snapshot */
1393 obj_handle_t handle; /* handle to the snapshot */
1394 int reset; /* reset snapshot position? */
1396 int count; /* thread usage count */
1397 process_id_t pid; /* process id */
1398 thread_id_t tid; /* thread id */
1399 int base_pri; /* base priority */
1400 int delta_pri; /* delta priority */
1404 /* Get the next module from a snapshot */
1406 obj_handle_t handle; /* handle to the snapshot */
1407 int reset; /* reset snapshot position? */
1409 process_id_t pid; /* process id */
1410 void* base; /* module base address */
1411 size_t size; /* module size */
1412 VARARG(filename,unicode_str); /* file name of module */
1416 /* Wait for a debug event */
1417 @REQ(wait_debug_event)
1418 int get_handle; /* should we alloc a handle for waiting? */
1420 process_id_t pid; /* process id */
1421 thread_id_t tid; /* thread id */
1422 obj_handle_t wait; /* wait handle if no event ready */
1423 VARARG(event,debug_event); /* debug event data */
1427 /* Queue an exception event */
1428 @REQ(queue_exception_event)
1429 int first; /* first chance exception? */
1430 VARARG(record,exc_event); /* thread context followed by exception record */
1432 obj_handle_t handle; /* handle to the queued event */
1436 /* Retrieve the status of an exception event */
1437 @REQ(get_exception_status)
1438 obj_handle_t handle; /* handle to the queued event */
1440 VARARG(context,context); /* modified thread context */
1444 /* Send an output string to the debugger */
1445 @REQ(output_debug_string)
1446 void* string; /* string to display (in debugged process address space) */
1447 int unicode; /* is it Unicode? */
1448 int length; /* string length */
1452 /* Continue a debug event */
1453 @REQ(continue_debug_event)
1454 process_id_t pid; /* process id to continue */
1455 thread_id_t tid; /* thread id to continue */
1456 int status; /* continuation status */
1460 /* Start/stop debugging an existing process */
1462 process_id_t pid; /* id of the process to debug */
1463 int attach; /* 1=attaching / 0=detaching from the process */
1467 /* Simulate a breakpoint in a process */
1469 obj_handle_t handle; /* process handle */
1471 int self; /* was it the caller itself? */
1475 /* Set debugger kill on exit flag */
1476 @REQ(set_debugger_kill_on_exit)
1477 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1481 /* Read data from a process address space */
1482 @REQ(read_process_memory)
1483 obj_handle_t handle; /* process handle */
1484 void* addr; /* addr to read from */
1486 VARARG(data,bytes); /* result data */
1490 /* Write data to a process address space */
1491 @REQ(write_process_memory)
1492 obj_handle_t handle; /* process handle */
1493 void* addr; /* addr to write to */
1494 VARARG(data,bytes); /* data to write */
1498 /* Create a registry key */
1500 obj_handle_t parent; /* handle to the parent key */
1501 unsigned int access; /* desired access rights */
1502 unsigned int attributes; /* object attributes */
1503 unsigned int options; /* creation options */
1504 time_t modif; /* last modification time */
1505 data_size_t namelen; /* length of key name in bytes */
1506 VARARG(name,unicode_str,namelen); /* key name */
1507 VARARG(class,unicode_str); /* class name */
1509 obj_handle_t hkey; /* handle to the created key */
1510 int created; /* has it been newly created? */
1513 /* Open a registry key */
1515 obj_handle_t parent; /* handle to the parent key */
1516 unsigned int access; /* desired access rights */
1517 unsigned int attributes; /* object attributes */
1518 VARARG(name,unicode_str); /* key name */
1520 obj_handle_t hkey; /* handle to the open key */
1524 /* Delete a registry key */
1526 obj_handle_t hkey; /* handle to the key */
1530 /* Flush a registry key */
1532 obj_handle_t hkey; /* handle to the key */
1536 /* Enumerate registry subkeys */
1538 obj_handle_t hkey; /* handle to registry key */
1539 int index; /* index of subkey (or -1 for current key) */
1540 int info_class; /* requested information class */
1542 int subkeys; /* number of subkeys */
1543 int max_subkey; /* longest subkey name */
1544 int max_class; /* longest class name */
1545 int values; /* number of values */
1546 int max_value; /* longest value name */
1547 int max_data; /* longest value data */
1548 time_t modif; /* last modification time */
1549 data_size_t total; /* total length needed for full name and class */
1550 data_size_t namelen; /* length of key name in bytes */
1551 VARARG(name,unicode_str,namelen); /* key name */
1552 VARARG(class,unicode_str); /* class name */
1556 /* Set a value of a registry key */
1558 obj_handle_t hkey; /* handle to registry key */
1559 int type; /* value type */
1560 data_size_t namelen; /* length of value name in bytes */
1561 VARARG(name,unicode_str,namelen); /* value name */
1562 VARARG(data,bytes); /* value data */
1566 /* Retrieve the value of a registry key */
1568 obj_handle_t hkey; /* handle to registry key */
1569 VARARG(name,unicode_str); /* value name */
1571 int type; /* value type */
1572 data_size_t total; /* total length needed for data */
1573 VARARG(data,bytes); /* value data */
1577 /* Enumerate a value of a registry key */
1578 @REQ(enum_key_value)
1579 obj_handle_t hkey; /* handle to registry key */
1580 int index; /* value index */
1581 int info_class; /* requested information class */
1583 int type; /* value type */
1584 data_size_t total; /* total length needed for full name and data */
1585 data_size_t namelen; /* length of value name in bytes */
1586 VARARG(name,unicode_str,namelen); /* value name */
1587 VARARG(data,bytes); /* value data */
1591 /* Delete a value of a registry key */
1592 @REQ(delete_key_value)
1593 obj_handle_t hkey; /* handle to registry key */
1594 VARARG(name,unicode_str); /* value name */
1598 /* Load a registry branch from a file */
1600 obj_handle_t hkey; /* root key to load to */
1601 obj_handle_t file; /* file to load from */
1602 VARARG(name,unicode_str); /* subkey name */
1606 /* UnLoad a registry branch from a file */
1607 @REQ(unload_registry)
1608 obj_handle_t hkey; /* root key to unload to */
1612 /* Save a registry branch to a file */
1614 obj_handle_t hkey; /* key to save */
1615 obj_handle_t file; /* file to save to */
1619 /* Add a registry key change notification */
1620 @REQ(set_registry_notification)
1621 obj_handle_t hkey; /* key to watch for changes */
1622 obj_handle_t event; /* event to set */
1623 int subtree; /* should we watch the whole subtree? */
1624 unsigned int filter; /* things to watch */
1628 /* Create a waitable timer */
1630 unsigned int access; /* wanted access rights */
1631 unsigned int attributes; /* object attributes */
1632 obj_handle_t rootdir; /* root directory */
1633 int manual; /* manual reset */
1634 VARARG(name,unicode_str); /* object name */
1636 obj_handle_t handle; /* handle to the timer */
1640 /* Open a waitable timer */
1642 unsigned int access; /* wanted access rights */
1643 unsigned int attributes; /* object attributes */
1644 obj_handle_t rootdir; /* root directory */
1645 VARARG(name,unicode_str); /* object name */
1647 obj_handle_t handle; /* handle to the timer */
1650 /* Set a waitable timer */
1652 obj_handle_t handle; /* handle to the timer */
1653 timeout_t expire; /* next expiration absolute time */
1654 int period; /* timer period in ms */
1655 void* callback; /* callback function */
1656 void* arg; /* callback argument */
1658 int signaled; /* was the timer signaled before this call ? */
1661 /* Cancel a waitable timer */
1663 obj_handle_t handle; /* handle to the timer */
1665 int signaled; /* was the timer signaled before this calltime ? */
1668 /* Get information on a waitable timer */
1669 @REQ(get_timer_info)
1670 obj_handle_t handle; /* handle to the timer */
1672 timeout_t when; /* absolute time when the timer next expires */
1673 int signaled; /* is the timer signaled? */
1677 /* Retrieve the current context of a thread */
1678 @REQ(get_thread_context)
1679 obj_handle_t handle; /* thread handle */
1680 unsigned int flags; /* context flags */
1681 int suspend; /* if getting context during suspend */
1683 int self; /* was it a handle to the current thread? */
1684 VARARG(context,context); /* thread context */
1688 /* Set the current context of a thread */
1689 @REQ(set_thread_context)
1690 obj_handle_t handle; /* thread handle */
1691 unsigned int flags; /* context flags */
1692 int suspend; /* if setting context during suspend */
1693 VARARG(context,context); /* thread context */
1695 int self; /* was it a handle to the current thread? */
1699 /* Fetch a selector entry for a thread */
1700 @REQ(get_selector_entry)
1701 obj_handle_t handle; /* thread handle */
1702 int entry; /* LDT entry */
1704 unsigned int base; /* selector base */
1705 unsigned int limit; /* selector limit */
1706 unsigned char flags; /* selector flags */
1712 obj_handle_t table; /* which table to add atom to */
1713 VARARG(name,unicode_str); /* atom name */
1715 atom_t atom; /* resulting atom */
1719 /* Delete an atom */
1721 obj_handle_t table; /* which table to delete atom from */
1722 atom_t atom; /* atom handle */
1728 obj_handle_t table; /* which table to find atom from */
1729 VARARG(name,unicode_str); /* atom name */
1731 atom_t atom; /* atom handle */
1735 /* Get information about an atom */
1736 @REQ(get_atom_information)
1737 obj_handle_t table; /* which table to find atom from */
1738 atom_t atom; /* atom handle */
1740 int count; /* atom lock count */
1741 int pinned; /* whether the atom has been pinned */
1742 data_size_t total; /* actual length of atom name */
1743 VARARG(name,unicode_str); /* atom name */
1747 /* Set information about an atom */
1748 @REQ(set_atom_information)
1749 obj_handle_t table; /* which table to find atom from */
1750 atom_t atom; /* atom handle */
1751 int pinned; /* whether to bump atom information */
1755 /* Empty an atom table */
1756 @REQ(empty_atom_table)
1757 obj_handle_t table; /* which table to find atom from */
1758 int if_pinned; /* whether to delete pinned atoms */
1762 /* Init an atom table */
1763 @REQ(init_atom_table)
1764 int entries; /* number of entries (only for local) */
1766 obj_handle_t table; /* handle to the atom table */
1770 /* Get the message queue of the current thread */
1773 obj_handle_t handle; /* handle to the queue */
1777 /* Set the file descriptor associated to the current thread queue */
1779 obj_handle_t handle; /* handle to the file descriptor */
1783 /* Set the current message queue wakeup mask */
1784 @REQ(set_queue_mask)
1785 unsigned int wake_mask; /* wakeup bits mask */
1786 unsigned int changed_mask; /* changed bits mask */
1787 int skip_wait; /* will we skip waiting if signaled? */
1789 unsigned int wake_bits; /* current wake bits */
1790 unsigned int changed_bits; /* current changed bits */
1794 /* Get the current message queue status */
1795 @REQ(get_queue_status)
1796 int clear; /* should we clear the change bits? */
1798 unsigned int wake_bits; /* wake bits */
1799 unsigned int changed_bits; /* changed bits since last time */
1803 /* Retrieve the process idle event */
1804 @REQ(get_process_idle_event)
1805 obj_handle_t handle; /* process handle */
1807 obj_handle_t event; /* handle to idle event */
1811 /* Send a message to a thread queue */
1813 thread_id_t id; /* thread id */
1814 int type; /* message type (see below) */
1815 int flags; /* message flags (see below) */
1816 user_handle_t win; /* window handle */
1817 unsigned int msg; /* message code */
1818 unsigned long wparam; /* parameters */
1819 unsigned long lparam; /* parameters */
1820 timeout_t timeout; /* timeout for reply */
1821 VARARG(data,message_data); /* message data for sent messages */
1824 @REQ(post_quit_message)
1825 int exit_code; /* exit code to return */
1830 MSG_ASCII, /* Ascii message (from SendMessageA) */
1831 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1832 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1833 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1834 MSG_CALLBACK_RESULT,/* result of a callback message */
1835 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1836 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1837 MSG_HARDWARE, /* hardware message */
1838 MSG_WINEVENT /* winevent message */
1840 #define SEND_MSG_ABORT_IF_HUNG 0x01
1843 /* Send a hardware message to a thread queue */
1844 @REQ(send_hardware_message)
1845 thread_id_t id; /* thread id */
1846 user_handle_t win; /* window handle */
1847 unsigned int msg; /* message code */
1848 unsigned int time; /* message time */
1849 unsigned long wparam; /* parameters */
1850 unsigned long lparam; /* parameters */
1851 unsigned long info; /* extra info */
1852 int x; /* x position */
1853 int y; /* y position */
1857 /* Get a message from the current queue */
1859 unsigned int flags; /* PM_* flags */
1860 user_handle_t get_win; /* window handle to get */
1861 unsigned int get_first; /* first message code to get */
1862 unsigned int get_last; /* last message code to get */
1863 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1864 unsigned int wake_mask; /* wakeup bits mask */
1865 unsigned int changed_mask; /* changed bits mask */
1867 user_handle_t win; /* window handle */
1868 int type; /* message type */
1869 unsigned int msg; /* message code */
1870 unsigned long wparam; /* parameters */
1871 unsigned long lparam; /* parameters */
1872 unsigned long info; /* extra info */
1873 int x; /* x position */
1874 int y; /* y position */
1875 unsigned int time; /* message time */
1876 unsigned int hw_id; /* id if hardware message */
1877 unsigned int active_hooks; /* active hooks bitmap */
1878 data_size_t total; /* total size of extra data */
1879 VARARG(data,message_data); /* message data for sent messages */
1883 /* Reply to a sent message */
1885 unsigned long result; /* message result */
1886 int remove; /* should we remove the message? */
1887 VARARG(data,bytes); /* message data for sent messages */
1891 /* Accept the current hardware message */
1892 @REQ(accept_hardware_message)
1893 unsigned int hw_id; /* id of the hardware message */
1894 int remove; /* should we remove the message? */
1895 user_handle_t new_win; /* new destination window for current message */
1899 /* Retrieve the reply for the last message sent */
1900 @REQ(get_message_reply)
1901 int cancel; /* cancel message if not ready? */
1903 unsigned long result; /* message result */
1904 VARARG(data,bytes); /* message data for sent messages */
1908 /* Set a window timer */
1910 user_handle_t win; /* window handle */
1911 unsigned int msg; /* message to post */
1912 unsigned int rate; /* timer rate in ms */
1913 unsigned long id; /* timer id */
1914 unsigned long lparam; /* message lparam (callback proc) */
1916 unsigned long id; /* timer id */
1920 /* Kill a window timer */
1921 @REQ(kill_win_timer)
1922 user_handle_t win; /* window handle */
1923 unsigned int msg; /* message to post */
1924 unsigned long id; /* timer id */
1928 /* check if the thread owning the window is hung */
1929 @REQ(is_window_hung)
1930 user_handle_t win; /* window handle */
1936 /* Retrieve info about a serial port */
1937 @REQ(get_serial_info)
1938 obj_handle_t handle; /* handle to comm port */
1940 unsigned int readinterval;
1941 unsigned int readconst;
1942 unsigned int readmult;
1943 unsigned int writeconst;
1944 unsigned int writemult;
1945 unsigned int eventmask;
1949 /* Set info about a serial port */
1950 @REQ(set_serial_info)
1951 obj_handle_t handle; /* handle to comm port */
1952 int flags; /* bitmask to set values (see below) */
1953 unsigned int readinterval;
1954 unsigned int readconst;
1955 unsigned int readmult;
1956 unsigned int writeconst;
1957 unsigned int writemult;
1958 unsigned int eventmask;
1960 #define SERIALINFO_SET_TIMEOUTS 0x01
1961 #define SERIALINFO_SET_MASK 0x02
1964 /* Create an async I/O */
1965 @REQ(register_async)
1966 obj_handle_t handle; /* handle to comm port, socket or file */
1967 int type; /* type of queue to look after */
1968 int count; /* count - usually # of bytes to be read/written */
1969 async_data_t async; /* async I/O parameters */
1971 #define ASYNC_TYPE_READ 0x01
1972 #define ASYNC_TYPE_WRITE 0x02
1973 #define ASYNC_TYPE_WAIT 0x03
1976 /* Cancel all async op on a fd */
1978 obj_handle_t handle; /* handle to comm port, socket or file */
1982 /* Perform an ioctl on a file */
1984 obj_handle_t handle; /* handle to the device */
1985 ioctl_code_t code; /* ioctl code */
1986 async_data_t async; /* async I/O parameters */
1987 VARARG(in_data,bytes); /* ioctl input data */
1989 obj_handle_t wait; /* handle to wait on for blocking ioctl */
1990 unsigned int options; /* device open options */
1991 VARARG(out_data,bytes); /* ioctl output data */
1995 /* Retrieve results of an async ioctl */
1996 @REQ(get_ioctl_result)
1997 obj_handle_t handle; /* handle to the device */
1998 void* user_arg; /* user arg used to identify the request */
2000 VARARG(out_data,bytes); /* ioctl output data */
2004 /* Create a named pipe */
2005 @REQ(create_named_pipe)
2006 unsigned int access;
2007 unsigned int attributes; /* object attributes */
2008 obj_handle_t rootdir; /* root directory */
2009 unsigned int options;
2011 unsigned int maxinstances;
2012 unsigned int outsize;
2013 unsigned int insize;
2015 VARARG(name,unicode_str); /* pipe name */
2017 obj_handle_t handle; /* handle to the pipe */
2020 /* flags in create_named_pipe and get_named_pipe_info */
2021 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2022 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2023 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2024 #define NAMED_PIPE_SERVER_END 0x8000
2027 @REQ(get_named_pipe_info)
2028 obj_handle_t handle;
2031 unsigned int maxinstances;
2032 unsigned int instances;
2033 unsigned int outsize;
2034 unsigned int insize;
2038 /* Create a window */
2040 user_handle_t parent; /* parent window */
2041 user_handle_t owner; /* owner window */
2042 atom_t atom; /* class atom */
2043 void* instance; /* module instance */
2044 VARARG(class,unicode_str); /* class name */
2046 user_handle_t handle; /* created window */
2047 user_handle_t parent; /* full handle of parent */
2048 user_handle_t owner; /* full handle of owner */
2049 int extra; /* number of extra bytes */
2050 void* class_ptr; /* pointer to class in client address space */
2054 /* Destroy a window */
2055 @REQ(destroy_window)
2056 user_handle_t handle; /* handle to the window */
2060 /* Retrieve the desktop window for the current thread */
2061 @REQ(get_desktop_window)
2062 int force; /* force creation if it doesn't exist */
2064 user_handle_t handle; /* handle to the desktop window */
2068 /* Set a window owner */
2069 @REQ(set_window_owner)
2070 user_handle_t handle; /* handle to the window */
2071 user_handle_t owner; /* new owner */
2073 user_handle_t full_owner; /* full handle of new owner */
2074 user_handle_t prev_owner; /* full handle of previous owner */
2078 /* Get information from a window handle */
2079 @REQ(get_window_info)
2080 user_handle_t handle; /* handle to the window */
2082 user_handle_t full_handle; /* full 32-bit handle */
2083 user_handle_t last_active; /* last active popup */
2084 process_id_t pid; /* process owning the window */
2085 thread_id_t tid; /* thread owning the window */
2086 atom_t atom; /* class atom */
2087 int is_unicode; /* ANSI or unicode */
2091 /* Set some information in a window */
2092 @REQ(set_window_info)
2093 unsigned int flags; /* flags for fields to set (see below) */
2094 user_handle_t handle; /* handle to the window */
2095 unsigned int style; /* window style */
2096 unsigned int ex_style; /* window extended style */
2097 unsigned int id; /* window id */
2098 int is_unicode; /* ANSI or unicode */
2099 void* instance; /* creator instance */
2100 unsigned long user_data; /* user-specific data */
2101 int extra_offset; /* offset to set in extra bytes */
2102 data_size_t extra_size; /* size to set in extra bytes */
2103 unsigned long extra_value; /* value to set in extra bytes */
2105 unsigned int old_style; /* old window style */
2106 unsigned int old_ex_style; /* old window extended style */
2107 unsigned int old_id; /* old window id */
2108 void* old_instance; /* old creator instance */
2109 unsigned long old_user_data; /* old user-specific data */
2110 unsigned long old_extra_value; /* old value in extra bytes */
2112 #define SET_WIN_STYLE 0x01
2113 #define SET_WIN_EXSTYLE 0x02
2114 #define SET_WIN_ID 0x04
2115 #define SET_WIN_INSTANCE 0x08
2116 #define SET_WIN_USERDATA 0x10
2117 #define SET_WIN_EXTRA 0x20
2118 #define SET_WIN_UNICODE 0x40
2121 /* Set the parent of a window */
2123 user_handle_t handle; /* handle to the window */
2124 user_handle_t parent; /* handle to the parent */
2126 user_handle_t old_parent; /* old parent window */
2127 user_handle_t full_parent; /* full handle of new parent */
2131 /* Get a list of the window parents, up to the root of the tree */
2132 @REQ(get_window_parents)
2133 user_handle_t handle; /* handle to the window */
2135 int count; /* total count of parents */
2136 VARARG(parents,user_handles); /* parent handles */
2140 /* Get a list of the window children */
2141 @REQ(get_window_children)
2142 obj_handle_t desktop; /* handle to desktop */
2143 user_handle_t parent; /* parent window */
2144 atom_t atom; /* class atom for the listed children */
2145 thread_id_t tid; /* thread owning the listed children */
2146 VARARG(class,unicode_str); /* class name */
2148 int count; /* total count of children */
2149 VARARG(children,user_handles); /* children handles */
2153 /* Get a list of the window children that contain a given point */
2154 @REQ(get_window_children_from_point)
2155 user_handle_t parent; /* parent window */
2156 int x; /* point in parent coordinates */
2159 int count; /* total count of children */
2160 VARARG(children,user_handles); /* children handles */
2164 /* Get window tree information from a window handle */
2165 @REQ(get_window_tree)
2166 user_handle_t handle; /* handle to the window */
2168 user_handle_t parent; /* parent window */
2169 user_handle_t owner; /* owner window */
2170 user_handle_t next_sibling; /* next sibling in Z-order */
2171 user_handle_t prev_sibling; /* prev sibling in Z-order */
2172 user_handle_t first_sibling; /* first sibling in Z-order */
2173 user_handle_t last_sibling; /* last sibling in Z-order */
2174 user_handle_t first_child; /* first child */
2175 user_handle_t last_child; /* last child */
2178 /* Set the position and Z order of a window */
2179 @REQ(set_window_pos)
2180 unsigned int flags; /* SWP_* flags */
2181 user_handle_t handle; /* handle to the window */
2182 user_handle_t previous; /* previous window in Z order */
2183 rectangle_t window; /* window rectangle */
2184 rectangle_t client; /* client rectangle */
2185 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
2187 unsigned int new_style; /* new window style */
2188 unsigned int new_ex_style; /* new window extended style */
2189 rectangle_t visible; /* new visible rectangle */
2193 /* Set the visible rectangle of a window */
2194 @REQ(set_window_visible_rect)
2195 unsigned int flags; /* SWP_* flags */
2196 user_handle_t handle; /* handle to the window */
2197 rectangle_t visible; /* visible rectangle */
2201 /* Get the window and client rectangles of a window */
2202 @REQ(get_window_rectangles)
2203 user_handle_t handle; /* handle to the window */
2205 rectangle_t window; /* window rectangle */
2206 rectangle_t visible; /* visible part of the window rectangle */
2207 rectangle_t client; /* client rectangle */
2211 /* Get the window text */
2212 @REQ(get_window_text)
2213 user_handle_t handle; /* handle to the window */
2215 VARARG(text,unicode_str); /* window text */
2219 /* Set the window text */
2220 @REQ(set_window_text)
2221 user_handle_t handle; /* handle to the window */
2222 VARARG(text,unicode_str); /* window text */
2226 /* Get the coordinates offset between two windows */
2227 @REQ(get_windows_offset)
2228 user_handle_t from; /* handle to the first window */
2229 user_handle_t to; /* handle to the second window */
2231 int x; /* x coordinate offset */
2232 int y; /* y coordinate offset */
2236 /* Get the visible region of a window */
2237 @REQ(get_visible_region)
2238 user_handle_t window; /* handle to the window */
2239 unsigned int flags; /* DCX flags */
2241 user_handle_t top_win; /* top window to clip against */
2242 rectangle_t top_rect; /* top window visible rect with screen coords */
2243 rectangle_t win_rect; /* window rect in screen coords */
2244 data_size_t total_size; /* total size of the resulting region */
2245 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2249 /* Get the window region */
2250 @REQ(get_window_region)
2251 user_handle_t window; /* handle to the window */
2253 data_size_t total_size; /* total size of the resulting region */
2254 VARARG(region,rectangles); /* list of rectangles for the region */
2258 /* Set the window region */
2259 @REQ(set_window_region)
2260 user_handle_t window; /* handle to the window */
2261 int redraw; /* redraw the window? */
2262 VARARG(region,rectangles); /* list of rectangles for the region */
2266 /* Get the window update region */
2267 @REQ(get_update_region)
2268 user_handle_t window; /* handle to the window */
2269 user_handle_t from_child; /* child to start searching from */
2270 unsigned int flags; /* update flags (see below) */
2272 user_handle_t child; /* child to repaint (or window itself) */
2273 unsigned int flags; /* resulting update flags (see below) */
2274 data_size_t total_size; /* total size of the resulting region */
2275 VARARG(region,rectangles); /* list of rectangles for the region */
2277 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2278 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2279 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2280 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2281 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2282 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2283 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2284 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2287 /* Update the z order of a window so that a given rectangle is fully visible */
2288 @REQ(update_window_zorder)
2289 user_handle_t window; /* handle to the window */
2290 rectangle_t rect; /* rectangle that must be visible */
2294 /* Mark parts of a window as needing a redraw */
2296 user_handle_t window; /* handle to the window */
2297 unsigned int flags; /* RDW_* flags */
2298 VARARG(region,rectangles); /* list of rectangles for the region */
2302 /* Set a window property */
2303 @REQ(set_window_property)
2304 user_handle_t window; /* handle to the window */
2305 atom_t atom; /* property atom (if no name specified) */
2306 obj_handle_t handle; /* handle to store */
2307 VARARG(name,unicode_str); /* property name */
2311 /* Remove a window property */
2312 @REQ(remove_window_property)
2313 user_handle_t window; /* handle to the window */
2314 atom_t atom; /* property atom (if no name specified) */
2315 VARARG(name,unicode_str); /* property name */
2317 obj_handle_t handle; /* handle stored in property */
2321 /* Get a window property */
2322 @REQ(get_window_property)
2323 user_handle_t window; /* handle to the window */
2324 atom_t atom; /* property atom (if no name specified) */
2325 VARARG(name,unicode_str); /* property name */
2327 obj_handle_t handle; /* handle stored in property */
2331 /* Get the list of properties of a window */
2332 @REQ(get_window_properties)
2333 user_handle_t window; /* handle to the window */
2335 int total; /* total number of properties */
2336 VARARG(props,properties); /* list of properties */
2340 /* Create a window station */
2341 @REQ(create_winstation)
2342 unsigned int flags; /* window station flags */
2343 unsigned int access; /* wanted access rights */
2344 unsigned int attributes; /* object attributes */
2345 VARARG(name,unicode_str); /* object name */
2347 obj_handle_t handle; /* handle to the window station */
2351 /* Open a handle to a window station */
2352 @REQ(open_winstation)
2353 unsigned int access; /* wanted access rights */
2354 unsigned int attributes; /* object attributes */
2355 VARARG(name,unicode_str); /* object name */
2357 obj_handle_t handle; /* handle to the window station */
2361 /* Close a window station */
2362 @REQ(close_winstation)
2363 obj_handle_t handle; /* handle to the window station */
2367 /* Get the process current window station */
2368 @REQ(get_process_winstation)
2370 obj_handle_t handle; /* handle to the window station */
2374 /* Set the process current window station */
2375 @REQ(set_process_winstation)
2376 obj_handle_t handle; /* handle to the window station */
2380 /* Enumerate window stations */
2381 @REQ(enum_winstation)
2382 unsigned int index; /* current index */
2384 unsigned int next; /* next index */
2385 VARARG(name,unicode_str); /* window station name */
2389 /* Create a desktop */
2390 @REQ(create_desktop)
2391 unsigned int flags; /* desktop flags */
2392 unsigned int access; /* wanted access rights */
2393 unsigned int attributes; /* object attributes */
2394 VARARG(name,unicode_str); /* object name */
2396 obj_handle_t handle; /* handle to the desktop */
2400 /* Open a handle to a desktop */
2402 unsigned int flags; /* desktop flags */
2403 unsigned int access; /* wanted access rights */
2404 unsigned int attributes; /* object attributes */
2405 VARARG(name,unicode_str); /* object name */
2407 obj_handle_t handle; /* handle to the desktop */
2411 /* Close a desktop */
2413 obj_handle_t handle; /* handle to the desktop */
2417 /* Get the thread current desktop */
2418 @REQ(get_thread_desktop)
2419 thread_id_t tid; /* thread id */
2421 obj_handle_t handle; /* handle to the desktop */
2425 /* Set the thread current desktop */
2426 @REQ(set_thread_desktop)
2427 obj_handle_t handle; /* handle to the desktop */
2431 /* Enumerate desktops */
2433 obj_handle_t winstation; /* handle to the window station */
2434 unsigned int index; /* current index */
2436 unsigned int next; /* next index */
2437 VARARG(name,unicode_str); /* window station name */
2441 /* Get/set information about a user object (window station or desktop) */
2442 @REQ(set_user_object_info)
2443 obj_handle_t handle; /* handle to the object */
2444 unsigned int flags; /* information to set */
2445 unsigned int obj_flags; /* new object flags */
2447 int is_desktop; /* is object a desktop? */
2448 unsigned int old_obj_flags; /* old object flags */
2449 VARARG(name,unicode_str); /* object name */
2451 #define SET_USER_OBJECT_FLAGS 1
2454 /* Attach (or detach) thread inputs */
2455 @REQ(attach_thread_input)
2456 thread_id_t tid_from; /* thread to be attached */
2457 thread_id_t tid_to; /* thread to which tid_from should be attached */
2458 int attach; /* is it an attach? */
2462 /* Get input data for a given thread */
2463 @REQ(get_thread_input)
2464 thread_id_t tid; /* id of thread */
2466 user_handle_t focus; /* handle to the focus window */
2467 user_handle_t capture; /* handle to the capture window */
2468 user_handle_t active; /* handle to the active window */
2469 user_handle_t foreground; /* handle to the global foreground window */
2470 user_handle_t menu_owner; /* handle to the menu owner */
2471 user_handle_t move_size; /* handle to the moving/resizing window */
2472 user_handle_t caret; /* handle to the caret window */
2473 rectangle_t rect; /* caret rectangle */
2477 /* Get the time of the last input event */
2478 @REQ(get_last_input_time)
2484 /* Retrieve queue keyboard state for a given thread */
2486 thread_id_t tid; /* id of thread */
2487 int key; /* optional key code or -1 */
2489 unsigned char state; /* state of specified key */
2490 VARARG(keystate,bytes); /* state array for all the keys */
2493 /* Set queue keyboard state for a given thread */
2495 thread_id_t tid; /* id of thread */
2496 VARARG(keystate,bytes); /* state array for all the keys */
2499 /* Set the system foreground window */
2500 @REQ(set_foreground_window)
2501 user_handle_t handle; /* handle to the foreground window */
2503 user_handle_t previous; /* handle to the previous foreground window */
2504 int send_msg_old; /* whether we have to send a msg to the old window */
2505 int send_msg_new; /* whether we have to send a msg to the new window */
2508 /* Set the current thread focus window */
2509 @REQ(set_focus_window)
2510 user_handle_t handle; /* handle to the focus window */
2512 user_handle_t previous; /* handle to the previous focus window */
2515 /* Set the current thread active window */
2516 @REQ(set_active_window)
2517 user_handle_t handle; /* handle to the active window */
2519 user_handle_t previous; /* handle to the previous active window */
2522 /* Set the current thread capture window */
2523 @REQ(set_capture_window)
2524 user_handle_t handle; /* handle to the capture window */
2525 unsigned int flags; /* capture flags (see below) */
2527 user_handle_t previous; /* handle to the previous capture window */
2528 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2530 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2531 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2534 /* Set the current thread caret window */
2535 @REQ(set_caret_window)
2536 user_handle_t handle; /* handle to the caret window */
2537 int width; /* caret width */
2538 int height; /* caret height */
2540 user_handle_t previous; /* handle to the previous caret window */
2541 rectangle_t old_rect; /* previous caret rectangle */
2542 int old_hide; /* previous hide count */
2543 int old_state; /* previous caret state (1=on, 0=off) */
2547 /* Set the current thread caret information */
2548 @REQ(set_caret_info)
2549 unsigned int flags; /* caret flags (see below) */
2550 user_handle_t handle; /* handle to the caret window */
2551 int x; /* caret x position */
2552 int y; /* caret y position */
2553 int hide; /* increment for hide count (can be negative to show it) */
2554 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2556 user_handle_t full_handle; /* handle to the current caret window */
2557 rectangle_t old_rect; /* previous caret rectangle */
2558 int old_hide; /* previous hide count */
2559 int old_state; /* previous caret state (1=on, 0=off) */
2561 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2562 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2563 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2566 /* Set a window hook */
2568 int id; /* id of the hook */
2569 process_id_t pid; /* id of process to set the hook into */
2570 thread_id_t tid; /* id of thread to set the hook into */
2574 void* proc; /* hook procedure */
2575 int unicode; /* is it a unicode hook? */
2576 VARARG(module,unicode_str); /* module name */
2578 user_handle_t handle; /* handle to the hook */
2579 unsigned int active_hooks; /* active hooks bitmap */
2583 /* Remove a window hook */
2585 user_handle_t handle; /* handle to the hook */
2586 int id; /* id of the hook if handle is 0 */
2587 void* proc; /* hook procedure if handle is 0 */
2589 unsigned int active_hooks; /* active hooks bitmap */
2593 /* Start calling a hook chain */
2594 @REQ(start_hook_chain)
2595 int id; /* id of the hook */
2596 int event; /* signalled event */
2597 user_handle_t window; /* handle to the event window */
2598 int object_id; /* object id for out of context winevent */
2599 int child_id; /* child id for out of context winevent */
2601 user_handle_t handle; /* handle to the next hook */
2602 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2603 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2604 void* proc; /* hook procedure */
2605 int unicode; /* is it a unicode hook? */
2606 unsigned int active_hooks; /* active hooks bitmap */
2607 VARARG(module,unicode_str); /* module name */
2611 /* Finished calling a hook chain */
2612 @REQ(finish_hook_chain)
2613 int id; /* id of the hook */
2617 /* Get the hook information */
2619 user_handle_t handle; /* handle to the current hook */
2620 int get_next; /* do we want info about current or next hook? */
2621 int event; /* signalled event */
2622 user_handle_t window; /* handle to the event window */
2623 int object_id; /* object id for out of context winevent */
2624 int child_id; /* child id for out of context winevent */
2626 user_handle_t handle; /* handle to the hook */
2627 int id; /* id of the hook */
2628 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2629 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2630 void* proc; /* hook procedure */
2631 int unicode; /* is it a unicode hook? */
2632 VARARG(module,unicode_str); /* module name */
2636 /* Create a window class */
2638 int local; /* is it a local class? */
2639 atom_t atom; /* class atom */
2640 unsigned int style; /* class style */
2641 void* instance; /* module instance */
2642 int extra; /* number of extra class bytes */
2643 int win_extra; /* number of window extra bytes */
2644 void* client_ptr; /* pointer to class in client address space */
2645 VARARG(name,unicode_str); /* class name */
2647 atom_t atom; /* resulting class atom */
2651 /* Destroy a window class */
2653 atom_t atom; /* class atom */
2654 void* instance; /* module instance */
2655 VARARG(name,unicode_str); /* class name */
2657 void* client_ptr; /* pointer to class in client address space */
2661 /* Set some information in a class */
2662 @REQ(set_class_info)
2663 user_handle_t window; /* handle to the window */
2664 unsigned int flags; /* flags for info to set (see below) */
2665 atom_t atom; /* class atom */
2666 unsigned int style; /* class style */
2667 int win_extra; /* number of window extra bytes */
2668 void* instance; /* module instance */
2669 int extra_offset; /* offset to set in extra bytes */
2670 data_size_t extra_size; /* size to set in extra bytes */
2671 unsigned long extra_value; /* value to set in extra bytes */
2673 atom_t old_atom; /* previous class atom */
2674 unsigned int old_style; /* previous class style */
2675 int old_extra; /* previous number of class extra bytes */
2676 int old_win_extra; /* previous number of window extra bytes */
2677 void* old_instance; /* previous module instance */
2678 unsigned long old_extra_value; /* old value in extra bytes */
2680 #define SET_CLASS_ATOM 0x0001
2681 #define SET_CLASS_STYLE 0x0002
2682 #define SET_CLASS_WINEXTRA 0x0004
2683 #define SET_CLASS_INSTANCE 0x0008
2684 #define SET_CLASS_EXTRA 0x0010
2687 /* Set/get clipboard information */
2688 @REQ(set_clipboard_info)
2689 unsigned int flags; /* flags for fields to set (see below) */
2690 user_handle_t clipboard; /* clipboard window */
2691 user_handle_t owner; /* clipboard owner */
2692 user_handle_t viewer; /* first clipboard viewer */
2693 unsigned int seqno; /* change sequence number */
2695 unsigned int flags; /* status flags (see below) */
2696 user_handle_t old_clipboard; /* old clipboard window */
2697 user_handle_t old_owner; /* old clipboard owner */
2698 user_handle_t old_viewer; /* old clipboard viewer */
2699 unsigned int seqno; /* current sequence number */
2702 #define SET_CB_OPEN 0x001
2703 #define SET_CB_OWNER 0x002
2704 #define SET_CB_VIEWER 0x004
2705 #define SET_CB_SEQNO 0x008
2706 #define SET_CB_RELOWNER 0x010
2707 #define SET_CB_CLOSE 0x020
2708 #define CB_OPEN 0x040
2709 #define CB_OWNER 0x080
2710 #define CB_PROCESS 0x100
2713 /* Open a security token */
2715 obj_handle_t handle; /* handle to the thread or process */
2716 unsigned int access; /* access rights to the new token */
2717 unsigned int attributes;/* object attributes */
2718 unsigned int flags; /* flags (see below) */
2720 obj_handle_t token; /* handle to the token */
2722 #define OPEN_TOKEN_THREAD 1
2723 #define OPEN_TOKEN_AS_SELF 2
2726 /* Set/get the global windows */
2727 @REQ(set_global_windows)
2728 unsigned int flags; /* flags for fields to set (see below) */
2729 user_handle_t shell_window; /* handle to the new shell window */
2730 user_handle_t shell_listview; /* handle to the new shell listview window */
2731 user_handle_t progman_window; /* handle to the new program manager window */
2732 user_handle_t taskman_window; /* handle to the new task manager window */
2734 user_handle_t old_shell_window; /* handle to the shell window */
2735 user_handle_t old_shell_listview; /* handle to the shell listview window */
2736 user_handle_t old_progman_window; /* handle to the new program manager window */
2737 user_handle_t old_taskman_window; /* handle to the new task manager window */
2739 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2740 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2741 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2743 /* Adjust the privileges held by a token */
2744 @REQ(adjust_token_privileges)
2745 obj_handle_t handle; /* handle to the token */
2746 int disable_all; /* disable all privileges? */
2747 int get_modified_state; /* get modified privileges? */
2748 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2750 unsigned int len; /* total length in bytes required to store token privileges */
2751 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2754 /* Retrieves the set of privileges held by or available to a token */
2755 @REQ(get_token_privileges)
2756 obj_handle_t handle; /* handle to the token */
2758 unsigned int len; /* total length in bytes required to store token privileges */
2759 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2762 /* Check the token has the required privileges */
2763 @REQ(check_token_privileges)
2764 obj_handle_t handle; /* handle to the token */
2765 int all_required; /* are all the privileges required for the check to succeed? */
2766 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2768 int has_privileges; /* does the token have the required privileges? */
2769 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2772 @REQ(duplicate_token)
2773 obj_handle_t handle; /* handle to the token to duplicate */
2774 unsigned int access; /* access rights to the new token */
2775 unsigned int attributes; /* object attributes */
2776 int primary; /* is the new token to be a primary one? */
2777 int impersonation_level; /* impersonation level of the new token */
2779 obj_handle_t new_handle; /* duplicated handle */
2783 obj_handle_t handle; /* handle to the token */
2784 unsigned int desired_access; /* desired access to the object */
2785 unsigned int mapping_read; /* mapping from generic read to specific rights */
2786 unsigned int mapping_write; /* mapping from generic write to specific rights */
2787 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2788 unsigned int mapping_all; /* mapping from generic all to specific rights */
2789 VARARG(sd,security_descriptor); /* security descriptor to check */
2791 unsigned int access_granted; /* access rights actually granted */
2792 unsigned int access_status; /* was access granted? */
2793 unsigned int privileges_len; /* length needed to store privileges */
2794 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2797 @REQ(get_token_user)
2798 obj_handle_t handle; /* handle to the token */
2800 data_size_t user_len; /* length needed to store user */
2801 VARARG(user,SID); /* sid of the user the token represents */
2804 @REQ(get_token_groups)
2805 obj_handle_t handle; /* handle to the token */
2807 data_size_t user_len; /* length needed to store user */
2808 VARARG(user,token_groups); /* groups the token's user belongs to */
2811 @REQ(set_security_object)
2812 obj_handle_t handle; /* handle to the object */
2813 unsigned int security_info; /* which parts of security descriptor to set */
2814 VARARG(sd,security_descriptor); /* security descriptor to set */
2817 @REQ(get_security_object)
2818 obj_handle_t handle; /* handle to the object */
2819 unsigned int security_info; /* which parts of security descriptor to get */
2821 unsigned int sd_len; /* buffer size needed for sd */
2822 VARARG(sd,security_descriptor); /* retrieved security descriptor */
2825 /* Create a mailslot */
2826 @REQ(create_mailslot)
2827 unsigned int access; /* wanted access rights */
2828 unsigned int attributes; /* object attributes */
2829 obj_handle_t rootdir; /* root directory */
2830 unsigned int max_msgsize;
2831 timeout_t read_timeout;
2832 VARARG(name,unicode_str); /* mailslot name */
2834 obj_handle_t handle; /* handle to the mailslot */
2838 /* Set mailslot information */
2839 @REQ(set_mailslot_info)
2840 obj_handle_t handle; /* handle to the mailslot */
2842 timeout_t read_timeout;
2844 unsigned int max_msgsize;
2845 timeout_t read_timeout;
2847 #define MAILSLOT_SET_READ_TIMEOUT 1
2850 /* Create a directory object */
2851 @REQ(create_directory)
2852 unsigned int access; /* access flags */
2853 unsigned int attributes; /* object attributes */
2854 obj_handle_t rootdir; /* root directory */
2855 VARARG(directory_name,unicode_str); /* Directory name */
2857 obj_handle_t handle; /* handle to the directory */
2861 /* Open a directory object */
2862 @REQ(open_directory)
2863 unsigned int access; /* access flags */
2864 unsigned int attributes; /* object attributes */
2865 obj_handle_t rootdir; /* root directory */
2866 VARARG(directory_name,unicode_str); /* Directory name */
2868 obj_handle_t handle; /* handle to the directory */
2872 /* Get a directory entry by index */
2873 @REQ(get_directory_entry)
2874 obj_handle_t handle; /* handle to the directory */
2875 unsigned int index; /* entry index */
2877 size_t name_len; /* length of the entry name in bytes */
2878 VARARG(name,unicode_str,name_len); /* entry name */
2879 VARARG(type,unicode_str); /* entry type */
2883 /* Create a symbolic link object */
2884 @REQ(create_symlink)
2885 unsigned int access; /* access flags */
2886 unsigned int attributes; /* object attributes */
2887 obj_handle_t rootdir; /* root directory */
2888 data_size_t name_len; /* length of the symlink name in bytes */
2889 VARARG(name,unicode_str,name_len); /* symlink name */
2890 VARARG(target_name,unicode_str); /* target name */
2892 obj_handle_t handle; /* handle to the symlink */
2896 /* Open a symbolic link object */
2898 unsigned int access; /* access flags */
2899 unsigned int attributes; /* object attributes */
2900 obj_handle_t rootdir; /* root directory */
2901 VARARG(name,unicode_str); /* symlink name */
2903 obj_handle_t handle; /* handle to the symlink */
2907 /* Query a symbolic link object */
2909 obj_handle_t handle; /* handle to the symlink */
2911 VARARG(target_name,unicode_str); /* target name */
2915 /* Query basic object information */
2916 @REQ(get_object_info)
2917 obj_handle_t handle; /* handle to the object */
2919 unsigned int access; /* granted access mask */
2920 unsigned int ref_count; /* object ref count */
2923 /* Query the impersonation level of an impersonation token */
2924 @REQ(get_token_impersonation_level)
2925 obj_handle_t handle; /* handle to the object */
2927 int impersonation_level; /* impersonation level of the impersonation token */
2930 /* Allocate a locally-unique identifier */
2931 @REQ(allocate_locally_unique_id)
2937 /* Create a device manager */
2938 @REQ(create_device_manager)
2939 unsigned int access; /* wanted access rights */
2940 unsigned int attributes; /* object attributes */
2942 obj_handle_t handle; /* handle to the device */
2946 /* Create a device */
2948 unsigned int access; /* wanted access rights */
2949 unsigned int attributes; /* object attributes */
2950 obj_handle_t rootdir; /* root directory */
2951 obj_handle_t manager; /* device manager */
2952 void* user_ptr; /* opaque ptr for use by client */
2953 VARARG(name,unicode_str); /* object name */
2955 obj_handle_t handle; /* handle to the device */
2959 /* Delete a device */
2961 obj_handle_t handle; /* handle to the device */
2965 /* Retrieve the next pending device ioctl request */
2966 @REQ(get_next_device_request)
2967 obj_handle_t manager; /* handle to the device manager */
2968 obj_handle_t prev; /* handle to the previous ioctl */
2969 unsigned int status; /* status of the previous ioctl */
2970 VARARG(prev_data,bytes); /* output data of the previous ioctl */
2972 obj_handle_t next; /* handle to the next ioctl */
2973 ioctl_code_t code; /* ioctl code */
2974 void* user_ptr; /* opaque ptr for the device */
2975 data_size_t in_size; /* total needed input size */
2976 data_size_t out_size; /* needed output size */
2977 VARARG(next_data,bytes); /* input data of the next ioctl */
2981 /* Make the current process a system process */
2982 @REQ(make_process_system)
2984 obj_handle_t event; /* event signaled when all user processes have exited */
2988 /* Get detailed fixed-size information about a token */
2989 @REQ(get_token_statistics)
2990 obj_handle_t handle; /* handle to the object */
2992 luid_t token_id; /* locally-unique identifier of the token */
2993 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
2994 int primary; /* is the token primary or impersonation? */
2995 int impersonation_level; /* level of impersonation */
2996 int group_count; /* the number of groups the token is a member of */
2997 int privilege_count; /* the number of privileges the token has */
3001 /* Create I/O completion port */
3002 @REQ(create_completion)
3003 unsigned int access; /* desired access to a port */
3004 unsigned int attributes; /* object attributes */
3005 unsigned int concurrent; /* max number of concurrent active threads */
3006 obj_handle_t rootdir; /* root directory */
3007 VARARG(filename,string); /* port name */
3009 obj_handle_t handle; /* port handle */
3013 /* Open I/O completion port */
3014 @REQ(open_completion)
3015 unsigned int access; /* desired access to a port */
3016 unsigned int attributes; /* object attributes */
3017 obj_handle_t rootdir; /* root directory */
3018 VARARG(filename,string); /* port name */
3020 obj_handle_t handle; /* port handle */
3024 /* add completion to completion port */
3025 @REQ(add_completion)
3026 obj_handle_t handle; /* port handle */
3027 unsigned long ckey; /* completion key */
3028 unsigned long cvalue; /* completion value */
3029 unsigned long information; /* IO_STATUS_BLOCK Information */
3030 unsigned int status; /* completion result */
3034 /* get completion from completion port queue */
3035 @REQ(remove_completion)
3036 obj_handle_t handle; /* port handle */
3038 unsigned long ckey; /* completion key */
3039 unsigned long cvalue; /* completion value */
3040 unsigned long information; /* IO_STATUS_BLOCK Information */
3041 unsigned int status; /* completion result */
3045 /* get completion queue depth */
3046 @REQ(query_completion)
3047 obj_handle_t handle; /* port handle */
3049 unsigned int depth; /* completion queue depth */
3053 /* associate object with completion port */
3054 @REQ(set_completion_info)
3055 obj_handle_t handle; /* object handle */
3056 obj_handle_t chandle; /* port handle */
3057 unsigned long ckey; /* completion key */
3061 /* check for associated completion and push msg */
3062 @REQ(add_fd_completion)
3063 obj_handle_t handle; /* async' object */
3064 unsigned long cvalue; /* completion value */
3065 unsigned int status; /* completion status */
3066 unsigned long information; /* IO_STATUS_BLOCK Information */