oleaut32: Implement ICreateTypeInfo::SetTypeDescAlias.
[wine.git] / server / protocol.def
blob0be065e896c6c78808fc7ae3f7b42060b3cca698
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 unsigned int obj_handle_t;
35 typedef unsigned int user_handle_t;
36 typedef unsigned int 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 lparam_t;
42 typedef unsigned __int64 apc_param_t;
43 typedef unsigned __int64 mem_size_t;
44 typedef unsigned __int64 file_pos_t;
45 typedef unsigned __int64 client_ptr_t;
46 typedef unsigned __int64 affinity_t;
47 typedef client_ptr_t mod_handle_t;
49 struct request_header
51 int req; /* request code */
52 data_size_t request_size; /* request variable part size */
53 data_size_t reply_size; /* reply variable part maximum size */
56 struct reply_header
58 unsigned int error; /* error result */
59 data_size_t reply_size; /* reply variable part size */
62 /* placeholder structure for the maximum allowed request size */
63 /* this is used to construct the generic_request union */
64 struct request_max_size
66 int pad[16]; /* the max request size is 16 ints */
69 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
70 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
73 /* debug event data */
74 typedef union
76 int code; /* event code */
77 struct
79 int code; /* EXCEPTION_DEBUG_EVENT */
80 int first; /* first chance exception? */
81 unsigned int exc_code; /* exception code */
82 unsigned int flags; /* exception flags */
83 client_ptr_t record; /* exception record */
84 client_ptr_t address; /* exception address */
85 int nb_params; /* number of parameters */
86 int __pad;
87 client_ptr_t params[15]; /* parameters */
88 } exception;
89 struct
91 int code; /* CREATE_THREAD_DEBUG_EVENT */
92 obj_handle_t handle; /* handle to the new thread */
93 client_ptr_t teb; /* thread teb (in debugged process address space) */
94 client_ptr_t start; /* thread startup routine */
95 } create_thread;
96 struct
98 int code; /* CREATE_PROCESS_DEBUG_EVENT */
99 obj_handle_t file; /* handle to the process exe file */
100 obj_handle_t process; /* handle to the new process */
101 obj_handle_t thread; /* handle to the new thread */
102 mod_handle_t base; /* base of executable image */
103 int dbg_offset; /* offset of debug info in file */
104 int dbg_size; /* size of debug info */
105 client_ptr_t teb; /* thread teb (in debugged process address space) */
106 client_ptr_t start; /* thread startup routine */
107 client_ptr_t name; /* image name (optional) */
108 int unicode; /* is it Unicode? */
109 } create_process;
110 struct
112 int code; /* EXIT_THREAD_DEBUG_EVENT/EXIT_PROCESS_DEBUG_EVENT */
113 int exit_code; /* thread or process exit code */
114 } exit;
115 struct
117 int code; /* LOAD_DLL_DEBUG_EVENT */
118 obj_handle_t handle; /* file handle for the dll */
119 mod_handle_t base; /* base address of the dll */
120 int dbg_offset; /* offset of debug info in file */
121 int dbg_size; /* size of debug info */
122 client_ptr_t name; /* image name (optional) */
123 int unicode; /* is it Unicode? */
124 } load_dll;
125 struct
127 int code; /* UNLOAD_DLL_DEBUG_EVENT */
128 int __pad;
129 mod_handle_t base; /* base address of the dll */
130 } unload_dll;
131 struct
133 int code; /* OUTPUT_DEBUG_STRING_EVENT */
134 data_size_t length; /* string length */
135 client_ptr_t string; /* string to display (in debugged process address space) */
136 } output_string;
137 struct
139 int code; /* RIP_EVENT */
140 int error; /* ??? */
141 int type; /* ??? */
142 } rip_info;
143 } debug_event_t;
145 /* supported CPU types */
146 enum cpu_type
148 CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64
150 typedef int cpu_type_t;
152 /* context data */
153 typedef struct
155 cpu_type_t cpu; /* cpu type */
156 unsigned int flags; /* SERVER_CTX_* flags */
157 union
159 struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
160 struct { unsigned __int64 rip, rbp, rsp;
161 unsigned int cs, ss, flags, __pad; } x86_64_regs;
162 struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc_regs;
163 struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
164 struct { unsigned __int64 sp, pc, pstate; } arm64_regs;
165 } ctl; /* selected by SERVER_CTX_CONTROL */
166 union
168 struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
169 struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
170 r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
171 struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
172 struct { unsigned int r[13]; } arm_regs;
173 struct { unsigned __int64 x[31]; } arm64_regs;
174 } integer; /* selected by SERVER_CTX_INTEGER */
175 union
177 struct { unsigned int ds, es, fs, gs; } i386_regs;
178 struct { unsigned int ds, es, fs, gs; } x86_64_regs;
179 } seg; /* selected by SERVER_CTX_SEGMENTS */
180 union
182 struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
183 unsigned char regs[80]; } i386_regs;
184 struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
185 struct { double fpr[32], fpscr; } powerpc_regs;
186 } fp; /* selected by SERVER_CTX_FLOATING_POINT */
187 union
189 struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
190 struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
191 struct { unsigned int dr[8]; } powerpc_regs;
192 } debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
193 union
195 unsigned char i386_regs[512];
196 } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */
197 } context_t;
199 #define SERVER_CTX_CONTROL 0x01
200 #define SERVER_CTX_INTEGER 0x02
201 #define SERVER_CTX_SEGMENTS 0x04
202 #define SERVER_CTX_FLOATING_POINT 0x08
203 #define SERVER_CTX_DEBUG_REGISTERS 0x10
204 #define SERVER_CTX_EXTENDED_REGISTERS 0x20
206 /* structure used in sending an fd from client to server */
207 struct send_fd
209 thread_id_t tid; /* thread id */
210 int fd; /* file descriptor on client-side */
213 /* structure sent by the server on the wait fifo */
214 struct wake_up_reply
216 client_ptr_t cookie; /* magic cookie that was passed in select_request */
217 int signaled; /* wait result */
218 int __pad;
221 /* NT-style timeout, in 100ns units, negative means relative timeout */
222 typedef __int64 timeout_t;
223 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
225 /* structure for process startup info */
226 typedef struct
228 unsigned int debug_flags;
229 unsigned int console_flags;
230 obj_handle_t console;
231 obj_handle_t hstdin;
232 obj_handle_t hstdout;
233 obj_handle_t hstderr;
234 unsigned int x;
235 unsigned int y;
236 unsigned int xsize;
237 unsigned int ysize;
238 unsigned int xchars;
239 unsigned int ychars;
240 unsigned int attribute;
241 unsigned int flags;
242 unsigned int show;
243 data_size_t curdir_len;
244 data_size_t dllpath_len;
245 data_size_t imagepath_len;
246 data_size_t cmdline_len;
247 data_size_t title_len;
248 data_size_t desktop_len;
249 data_size_t shellinfo_len;
250 data_size_t runtime_len;
251 /* VARARG(curdir,unicode_str,curdir_len); */
252 /* VARARG(dllpath,unicode_str,dllpath_len); */
253 /* VARARG(imagepath,unicode_str,imagepath_len); */
254 /* VARARG(cmdline,unicode_str,cmdline_len); */
255 /* VARARG(title,unicode_str,title_len); */
256 /* VARARG(desktop,unicode_str,desktop_len); */
257 /* VARARG(shellinfo,unicode_str,shellinfo_len); */
258 /* VARARG(runtime,unicode_str,runtime_len); */
259 } startup_info_t;
261 /* structure returned in the list of window properties */
262 typedef struct
264 atom_t atom; /* property atom */
265 int string; /* was atom a string originally? */
266 lparam_t data; /* data stored in property */
267 } property_data_t;
269 /* structure to specify window rectangles */
270 typedef struct
272 int left;
273 int top;
274 int right;
275 int bottom;
276 } rectangle_t;
278 /* structure for parameters of async I/O calls */
279 typedef struct
281 obj_handle_t handle; /* object to perform I/O on */
282 obj_handle_t event; /* event to signal when done */
283 client_ptr_t callback; /* client-side callback to call upon end of async */
284 client_ptr_t iosb; /* I/O status block in client addr space */
285 client_ptr_t arg; /* opaque user data to pass to callback */
286 apc_param_t cvalue; /* completion value to use for completion events */
287 } async_data_t;
289 /* structures for extra message data */
291 struct hardware_msg_data
293 lparam_t info; /* extra info */
294 int x; /* x position */
295 int y; /* y position */
296 unsigned int hw_id; /* unique id */
297 unsigned int flags; /* hook flags */
298 union
300 int type;
301 struct
303 int type; /* RIM_TYPEKEYBOARD */
304 unsigned int message; /* message generated by this rawinput event */
305 unsigned short vkey; /* virtual key code */
306 unsigned short scan; /* scan code */
307 } kbd;
308 struct
310 int type; /* RIM_TYPEMOUSE */
311 int x; /* x coordinate */
312 int y; /* y coordinate */
313 unsigned int data; /* mouse data */
314 } mouse;
315 } rawinput;
318 struct callback_msg_data
320 client_ptr_t callback; /* callback function */
321 lparam_t data; /* user data for callback */
322 lparam_t result; /* message result */
325 struct winevent_msg_data
327 user_handle_t hook; /* hook handle */
328 thread_id_t tid; /* thread id */
329 client_ptr_t hook_proc; /* hook proc address */
330 /* followed by module name if any */
333 typedef union
335 int type;
336 struct
338 int type; /* INPUT_KEYBOARD */
339 unsigned short vkey; /* virtual key code */
340 unsigned short scan; /* scan code */
341 unsigned int flags; /* event flags */
342 unsigned int time; /* event time */
343 lparam_t info; /* extra info */
344 } kbd;
345 struct
347 int type; /* INPUT_MOUSE */
348 int x; /* coordinates */
349 int y;
350 unsigned int data; /* mouse data */
351 unsigned int flags; /* event flags */
352 unsigned int time; /* event time */
353 lparam_t info; /* extra info */
354 } mouse;
355 struct
357 int type; /* INPUT_HARDWARE */
358 unsigned int msg; /* message code */
359 lparam_t lparam; /* message param */
360 } hw;
361 } hw_input_t;
363 typedef union
365 unsigned char bytes[1]; /* raw data for sent messages */
366 struct hardware_msg_data hardware;
367 struct callback_msg_data callback;
368 struct winevent_msg_data winevent;
369 } message_data_t;
371 /* structure for console char/attribute info */
372 typedef struct
374 WCHAR ch;
375 unsigned short attr;
376 } char_info_t;
378 /* structure returned in filesystem events */
379 struct filesystem_event
381 int action;
382 data_size_t len;
383 char name[1];
386 typedef struct
388 unsigned int low_part;
389 int high_part;
390 } luid_t;
392 #define MAX_ACL_LEN 65535
394 struct security_descriptor
396 unsigned int control; /* SE_ flags */
397 data_size_t owner_len;
398 data_size_t group_len;
399 data_size_t sacl_len;
400 data_size_t dacl_len;
401 /* VARARG(owner,SID); */
402 /* VARARG(group,SID); */
403 /* VARARG(sacl,ACL); */
404 /* VARARG(dacl,ACL); */
407 struct object_attributes
409 obj_handle_t rootdir; /* root directory */
410 data_size_t sd_len; /* length of security_descriptor data. may be 0 */
411 data_size_t name_len; /* length of the name string. may be 0 */
412 /* VARARG(sd,security_descriptor); */
413 /* VARARG(name,unicode_str); */
416 struct token_groups
418 unsigned int count;
419 /* unsigned int attributes[count]; */
420 /* VARARG(sids,SID); */
423 enum select_op
425 SELECT_NONE,
426 SELECT_WAIT,
427 SELECT_WAIT_ALL,
428 SELECT_SIGNAL_AND_WAIT
431 typedef union
433 enum select_op op;
434 struct
436 enum select_op op; /* SELECT_WAIT or SELECT_WAIT_ALL */
437 obj_handle_t handles[MAXIMUM_WAIT_OBJECTS];
438 } wait;
439 struct
441 enum select_op op; /* SELECT_SIGNAL_AND_WAIT */
442 obj_handle_t wait;
443 obj_handle_t signal; /* must be last in the structure so we can remove it on retries */
444 } signal_and_wait;
445 } select_op_t;
447 enum apc_type
449 APC_NONE,
450 APC_USER,
451 APC_TIMER,
452 APC_ASYNC_IO,
453 APC_VIRTUAL_ALLOC,
454 APC_VIRTUAL_FREE,
455 APC_VIRTUAL_QUERY,
456 APC_VIRTUAL_PROTECT,
457 APC_VIRTUAL_FLUSH,
458 APC_VIRTUAL_LOCK,
459 APC_VIRTUAL_UNLOCK,
460 APC_MAP_VIEW,
461 APC_UNMAP_VIEW,
462 APC_CREATE_THREAD
465 typedef union
467 enum apc_type type;
468 struct
470 enum apc_type type; /* APC_USER */
471 int __pad;
472 client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
473 apc_param_t args[3]; /* arguments for user function */
474 } user;
475 struct
477 enum apc_type type; /* APC_TIMER */
478 int __pad;
479 client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
480 timeout_t time; /* absolute time of expiration */
481 client_ptr_t arg; /* user argument */
482 } timer;
483 struct
485 enum apc_type type; /* APC_ASYNC_IO */
486 unsigned int status; /* I/O status */
487 client_ptr_t func; /* unsigned int (*func)(void*, void*, unsigned int, void **); */
488 client_ptr_t user; /* user pointer */
489 client_ptr_t sb; /* status block */
490 } async_io;
491 struct
493 enum apc_type type; /* APC_VIRTUAL_ALLOC */
494 unsigned int op_type; /* type of operation */
495 client_ptr_t addr; /* requested address */
496 mem_size_t size; /* allocation size */
497 unsigned int zero_bits; /* allocation alignment */
498 unsigned int prot; /* memory protection flags */
499 } virtual_alloc;
500 struct
502 enum apc_type type; /* APC_VIRTUAL_FREE */
503 unsigned int op_type; /* type of operation */
504 client_ptr_t addr; /* requested address */
505 mem_size_t size; /* allocation size */
506 } virtual_free;
507 struct
509 enum apc_type type; /* APC_VIRTUAL_QUERY */
510 int __pad;
511 client_ptr_t addr; /* requested address */
512 } virtual_query;
513 struct
515 enum apc_type type; /* APC_VIRTUAL_PROTECT */
516 unsigned int prot; /* new protection flags */
517 client_ptr_t addr; /* requested address */
518 mem_size_t size; /* requested size */
519 } virtual_protect;
520 struct
522 enum apc_type type; /* APC_VIRTUAL_FLUSH */
523 int __pad;
524 client_ptr_t addr; /* requested address */
525 mem_size_t size; /* requested size */
526 } virtual_flush;
527 struct
529 enum apc_type type; /* APC_VIRTUAL_LOCK */
530 int __pad;
531 client_ptr_t addr; /* requested address */
532 mem_size_t size; /* requested size */
533 } virtual_lock;
534 struct
536 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
537 int __pad;
538 client_ptr_t addr; /* requested address */
539 mem_size_t size; /* requested size */
540 } virtual_unlock;
541 struct
543 enum apc_type type; /* APC_MAP_VIEW */
544 obj_handle_t handle; /* mapping handle */
545 client_ptr_t addr; /* requested address */
546 mem_size_t size; /* allocation size */
547 file_pos_t offset; /* file offset */
548 unsigned int alloc_type;/* allocation type */
549 unsigned short zero_bits; /* allocation alignment */
550 unsigned short prot; /* memory protection flags */
551 } map_view;
552 struct
554 enum apc_type type; /* APC_UNMAP_VIEW */
555 int __pad;
556 client_ptr_t addr; /* view address */
557 } unmap_view;
558 struct
560 enum apc_type type; /* APC_CREATE_THREAD */
561 int suspend; /* suspended thread? */
562 client_ptr_t func; /* void (__stdcall *func)(void*); start function */
563 client_ptr_t arg; /* argument for start function */
564 mem_size_t reserve; /* reserve size for thread stack */
565 mem_size_t commit; /* commit size for thread stack */
566 } create_thread;
567 } apc_call_t;
569 typedef union
571 enum apc_type type;
572 struct
574 enum apc_type type; /* APC_ASYNC_IO */
575 unsigned int status; /* new status of async operation */
576 client_ptr_t apc; /* user APC to call */
577 unsigned int total; /* bytes transferred */
578 } async_io;
579 struct
581 enum apc_type type; /* APC_VIRTUAL_ALLOC */
582 unsigned int status; /* status returned by call */
583 client_ptr_t addr; /* resulting address */
584 mem_size_t size; /* resulting size */
585 } virtual_alloc;
586 struct
588 enum apc_type type; /* APC_VIRTUAL_FREE */
589 unsigned int status; /* status returned by call */
590 client_ptr_t addr; /* resulting address */
591 mem_size_t size; /* resulting size */
592 } virtual_free;
593 struct
595 enum apc_type type; /* APC_VIRTUAL_QUERY */
596 unsigned int status; /* status returned by call */
597 client_ptr_t base; /* resulting base address */
598 client_ptr_t alloc_base;/* resulting allocation base */
599 mem_size_t size; /* resulting region size */
600 unsigned short state; /* resulting region state */
601 unsigned short prot; /* resulting region protection */
602 unsigned short alloc_prot;/* resulting allocation protection */
603 unsigned short alloc_type;/* resulting region allocation type */
604 } virtual_query;
605 struct
607 enum apc_type type; /* APC_VIRTUAL_PROTECT */
608 unsigned int status; /* status returned by call */
609 client_ptr_t addr; /* resulting address */
610 mem_size_t size; /* resulting size */
611 unsigned int prot; /* old protection flags */
612 } virtual_protect;
613 struct
615 enum apc_type type; /* APC_VIRTUAL_FLUSH */
616 unsigned int status; /* status returned by call */
617 client_ptr_t addr; /* resulting address */
618 mem_size_t size; /* resulting size */
619 } virtual_flush;
620 struct
622 enum apc_type type; /* APC_VIRTUAL_LOCK */
623 unsigned int status; /* status returned by call */
624 client_ptr_t addr; /* resulting address */
625 mem_size_t size; /* resulting size */
626 } virtual_lock;
627 struct
629 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
630 unsigned int status; /* status returned by call */
631 client_ptr_t addr; /* resulting address */
632 mem_size_t size; /* resulting size */
633 } virtual_unlock;
634 struct
636 enum apc_type type; /* APC_MAP_VIEW */
637 unsigned int status; /* status returned by call */
638 client_ptr_t addr; /* resulting address */
639 mem_size_t size; /* resulting size */
640 } map_view;
641 struct
643 enum apc_type type; /* APC_MAP_VIEW */
644 unsigned int status; /* status returned by call */
645 } unmap_view;
646 struct
648 enum apc_type type; /* APC_CREATE_THREAD */
649 unsigned int status; /* status returned by call */
650 thread_id_t tid; /* thread id */
651 obj_handle_t handle; /* handle to new thread */
652 } create_thread;
653 } apc_result_t;
655 struct rawinput_device
657 unsigned short usage_page;
658 unsigned short usage;
659 unsigned int flags;
660 user_handle_t target;
663 /****************************************************************/
664 /* Request declarations */
666 /* Create a new process from the context of the parent */
667 @REQ(new_process)
668 int inherit_all; /* inherit all handles from parent */
669 unsigned int create_flags; /* creation flags */
670 int socket_fd; /* file descriptor for process socket */
671 obj_handle_t exe_file; /* file handle for main exe */
672 unsigned int process_access; /* access rights for process object */
673 unsigned int process_attr; /* attributes for process object */
674 unsigned int thread_access; /* access rights for thread object */
675 unsigned int thread_attr; /* attributes for thread object */
676 data_size_t info_size; /* size of startup info */
677 VARARG(info,startup_info,info_size); /* startup information */
678 VARARG(env,unicode_str); /* environment for new process */
679 @REPLY
680 obj_handle_t info; /* new process info handle */
681 process_id_t pid; /* process id */
682 obj_handle_t phandle; /* process handle (in the current process) */
683 thread_id_t tid; /* thread id */
684 obj_handle_t thandle; /* thread handle (in the current process) */
685 @END
688 /* Retrieve information about a newly started process */
689 @REQ(get_new_process_info)
690 obj_handle_t info; /* info handle returned from new_process_request */
691 @REPLY
692 int success; /* did the process start successfully? */
693 int exit_code; /* process exit code if failed */
694 @END
697 /* Create a new thread from the context of the parent */
698 @REQ(new_thread)
699 unsigned int access; /* wanted access rights */
700 unsigned int attributes; /* object attributes */
701 int suspend; /* new thread should be suspended on creation */
702 int request_fd; /* fd for request pipe */
703 @REPLY
704 thread_id_t tid; /* thread id */
705 obj_handle_t handle; /* thread handle (in the current process) */
706 @END
709 /* Retrieve the new process startup info */
710 @REQ(get_startup_info)
711 @REPLY
712 obj_handle_t exe_file; /* file handle for main exe */
713 data_size_t info_size; /* size of startup info */
714 VARARG(info,startup_info,info_size); /* startup information */
715 VARARG(env,unicode_str); /* environment */
716 @END
719 /* Signal the end of the process initialization */
720 @REQ(init_process_done)
721 int gui; /* is it a GUI process? */
722 mod_handle_t module; /* main module base address */
723 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
724 client_ptr_t entry; /* process entry point */
725 @END
728 /* Initialize a thread; called from the child after fork()/clone() */
729 @REQ(init_thread)
730 int unix_pid; /* Unix pid of new thread */
731 int unix_tid; /* Unix tid of new thread */
732 int debug_level; /* new debug level */
733 client_ptr_t teb; /* TEB of new thread (in thread address space) */
734 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
735 int reply_fd; /* fd for reply pipe */
736 int wait_fd; /* fd for blocking calls pipe */
737 cpu_type_t cpu; /* CPU that this thread is running on */
738 @REPLY
739 process_id_t pid; /* process id of the new thread's process */
740 thread_id_t tid; /* thread id of the new thread */
741 timeout_t server_start; /* server start time */
742 data_size_t info_size; /* total size of startup info */
743 int version; /* protocol version */
744 unsigned int all_cpus; /* bitset of supported CPUs */
745 @END
748 /* Terminate a process */
749 @REQ(terminate_process)
750 obj_handle_t handle; /* process handle to terminate */
751 int exit_code; /* process exit code */
752 @REPLY
753 int self; /* suicide? */
754 @END
757 /* Terminate a thread */
758 @REQ(terminate_thread)
759 obj_handle_t handle; /* thread handle to terminate */
760 int exit_code; /* thread exit code */
761 @REPLY
762 int self; /* suicide? */
763 int last; /* last thread in this process? */
764 @END
767 /* Retrieve information about a process */
768 @REQ(get_process_info)
769 obj_handle_t handle; /* process handle */
770 @REPLY
771 process_id_t pid; /* server process id */
772 process_id_t ppid; /* server process id of parent */
773 affinity_t affinity; /* process affinity mask */
774 client_ptr_t peb; /* PEB address in process address space */
775 timeout_t start_time; /* process start time */
776 timeout_t end_time; /* process end time */
777 int exit_code; /* process exit code */
778 int priority; /* priority class */
779 cpu_type_t cpu; /* CPU that this process is running on */
780 int debugger_present; /* process is being debugged */
781 @END
784 /* Set a process information */
785 @REQ(set_process_info)
786 obj_handle_t handle; /* process handle */
787 int mask; /* setting mask (see below) */
788 int priority; /* priority class */
789 affinity_t affinity; /* affinity mask */
790 @END
791 #define SET_PROCESS_INFO_PRIORITY 0x01
792 #define SET_PROCESS_INFO_AFFINITY 0x02
795 /* Retrieve information about a thread */
796 @REQ(get_thread_info)
797 obj_handle_t handle; /* thread handle */
798 thread_id_t tid_in; /* thread id (optional) */
799 @REPLY
800 process_id_t pid; /* server process id */
801 thread_id_t tid; /* server thread id */
802 client_ptr_t teb; /* thread teb pointer */
803 affinity_t affinity; /* thread affinity mask */
804 timeout_t creation_time; /* thread creation time */
805 timeout_t exit_time; /* thread exit time */
806 int exit_code; /* thread exit code */
807 int priority; /* thread priority level */
808 int last; /* last thread in process */
809 @END
812 /* Set a thread information */
813 @REQ(set_thread_info)
814 obj_handle_t handle; /* thread handle */
815 int mask; /* setting mask (see below) */
816 int priority; /* priority class */
817 affinity_t affinity; /* affinity mask */
818 obj_handle_t token; /* impersonation token */
819 @END
820 #define SET_THREAD_INFO_PRIORITY 0x01
821 #define SET_THREAD_INFO_AFFINITY 0x02
822 #define SET_THREAD_INFO_TOKEN 0x04
825 /* Retrieve information about a module */
826 @REQ(get_dll_info)
827 obj_handle_t handle; /* process handle */
828 mod_handle_t base_address; /* base address of module */
829 @REPLY
830 client_ptr_t entry_point;
831 data_size_t size; /* module size */
832 data_size_t filename_len; /* buffer len in bytes required to store filename */
833 VARARG(filename,unicode_str); /* file name of module */
834 @END
837 /* Suspend a thread */
838 @REQ(suspend_thread)
839 obj_handle_t handle; /* thread handle */
840 @REPLY
841 int count; /* new suspend count */
842 @END
845 /* Resume a thread */
846 @REQ(resume_thread)
847 obj_handle_t handle; /* thread handle */
848 @REPLY
849 int count; /* new suspend count */
850 @END
853 /* Notify the server that a dll has been loaded */
854 @REQ(load_dll)
855 obj_handle_t mapping; /* file mapping handle */
856 mod_handle_t base; /* base address */
857 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
858 data_size_t size; /* dll size */
859 int dbg_offset; /* debug info offset */
860 int dbg_size; /* debug info size */
861 VARARG(filename,unicode_str); /* file name of dll */
862 @END
865 /* Notify the server that a dll is being unloaded */
866 @REQ(unload_dll)
867 mod_handle_t base; /* base address */
868 @END
871 /* Queue an APC for a thread or process */
872 @REQ(queue_apc)
873 obj_handle_t handle; /* thread or process handle */
874 apc_call_t call; /* call arguments */
875 @REPLY
876 obj_handle_t handle; /* APC handle */
877 int self; /* run APC in caller itself? */
878 @END
881 /* Get the result of an APC call */
882 @REQ(get_apc_result)
883 obj_handle_t handle; /* handle to the APC */
884 @REPLY
885 apc_result_t result; /* result of the APC */
886 @END
889 /* Close a handle for the current process */
890 @REQ(close_handle)
891 obj_handle_t handle; /* handle to close */
892 @END
895 /* Set a handle information */
896 @REQ(set_handle_info)
897 obj_handle_t handle; /* handle we are interested in */
898 int flags; /* new handle flags */
899 int mask; /* mask for flags to set */
900 @REPLY
901 int old_flags; /* old flag value */
902 @END
905 /* Duplicate a handle */
906 @REQ(dup_handle)
907 obj_handle_t src_process; /* src process handle */
908 obj_handle_t src_handle; /* src handle to duplicate */
909 obj_handle_t dst_process; /* dst process handle */
910 unsigned int access; /* wanted access rights */
911 unsigned int attributes; /* object attributes */
912 unsigned int options; /* duplicate options (see below) */
913 @REPLY
914 obj_handle_t handle; /* duplicated handle in dst process */
915 int self; /* is the source the current process? */
916 int closed; /* whether the source handle has been closed */
917 @END
918 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
919 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
920 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
923 /* Open a handle to a process */
924 @REQ(open_process)
925 process_id_t pid; /* process id to open */
926 unsigned int access; /* wanted access rights */
927 unsigned int attributes; /* object attributes */
928 @REPLY
929 obj_handle_t handle; /* handle to the process */
930 @END
933 /* Open a handle to a thread */
934 @REQ(open_thread)
935 thread_id_t tid; /* thread id to open */
936 unsigned int access; /* wanted access rights */
937 unsigned int attributes; /* object attributes */
938 @REPLY
939 obj_handle_t handle; /* handle to the thread */
940 @END
943 /* Wait for handles */
944 @REQ(select)
945 int flags; /* wait flags (see below) */
946 client_ptr_t cookie; /* magic cookie to return to client */
947 timeout_t timeout; /* timeout */
948 obj_handle_t prev_apc; /* handle to previous APC */
949 VARARG(result,apc_result); /* result of previous APC */
950 VARARG(data,select_op); /* operation-specific data */
951 @REPLY
952 timeout_t timeout; /* timeout converted to absolute */
953 apc_call_t call; /* APC call arguments */
954 obj_handle_t apc_handle; /* handle to next APC */
955 @END
956 #define SELECT_ALERTABLE 1
957 #define SELECT_INTERRUPTIBLE 2
960 /* Create an event */
961 @REQ(create_event)
962 unsigned int access; /* wanted access rights */
963 unsigned int attributes; /* object attributes */
964 int manual_reset; /* manual reset event */
965 int initial_state; /* initial state of the event */
966 VARARG(objattr,object_attributes); /* object attributes */
967 @REPLY
968 obj_handle_t handle; /* handle to the event */
969 @END
971 /* Event operation */
972 @REQ(event_op)
973 obj_handle_t handle; /* handle to event */
974 int op; /* event operation (see below) */
975 @END
976 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
978 @REQ(query_event)
979 obj_handle_t handle; /* handle to event */
980 @REPLY
981 int manual_reset; /* manual reset event */
982 int state; /* current state of the event */
983 @END
985 /* Open an event */
986 @REQ(open_event)
987 unsigned int access; /* wanted access rights */
988 unsigned int attributes; /* object attributes */
989 obj_handle_t rootdir; /* root directory */
990 VARARG(name,unicode_str); /* object name */
991 @REPLY
992 obj_handle_t handle; /* handle to the event */
993 @END
996 /* Create a keyed event */
997 @REQ(create_keyed_event)
998 unsigned int access; /* wanted access rights */
999 unsigned int attributes; /* object attributes */
1000 VARARG(objattr,object_attributes); /* object attributes */
1001 @REPLY
1002 obj_handle_t handle; /* handle to the event */
1003 @END
1005 /* Open a keyed event */
1006 @REQ(open_keyed_event)
1007 unsigned int access; /* wanted access rights */
1008 unsigned int attributes; /* object attributes */
1009 obj_handle_t rootdir; /* root directory */
1010 VARARG(name,unicode_str); /* object name */
1011 @REPLY
1012 obj_handle_t handle; /* handle to the event */
1013 @END
1016 /* Create a mutex */
1017 @REQ(create_mutex)
1018 unsigned int access; /* wanted access rights */
1019 unsigned int attributes; /* object attributes */
1020 int owned; /* initially owned? */
1021 VARARG(objattr,object_attributes); /* object attributes */
1022 @REPLY
1023 obj_handle_t handle; /* handle to the mutex */
1024 @END
1027 /* Release a mutex */
1028 @REQ(release_mutex)
1029 obj_handle_t handle; /* handle to the mutex */
1030 @REPLY
1031 unsigned int prev_count; /* value of internal counter, before release */
1032 @END
1035 /* Open a mutex */
1036 @REQ(open_mutex)
1037 unsigned int access; /* wanted access rights */
1038 unsigned int attributes; /* object attributes */
1039 obj_handle_t rootdir; /* root directory */
1040 VARARG(name,unicode_str); /* object name */
1041 @REPLY
1042 obj_handle_t handle; /* handle to the mutex */
1043 @END
1046 /* Create a semaphore */
1047 @REQ(create_semaphore)
1048 unsigned int access; /* wanted access rights */
1049 unsigned int attributes; /* object attributes */
1050 unsigned int initial; /* initial count */
1051 unsigned int max; /* maximum count */
1052 VARARG(objattr,object_attributes); /* object attributes */
1053 @REPLY
1054 obj_handle_t handle; /* handle to the semaphore */
1055 @END
1058 /* Release a semaphore */
1059 @REQ(release_semaphore)
1060 obj_handle_t handle; /* handle to the semaphore */
1061 unsigned int count; /* count to add to semaphore */
1062 @REPLY
1063 unsigned int prev_count; /* previous semaphore count */
1064 @END
1067 /* Open a semaphore */
1068 @REQ(open_semaphore)
1069 unsigned int access; /* wanted access rights */
1070 unsigned int attributes; /* object attributes */
1071 obj_handle_t rootdir; /* root directory */
1072 VARARG(name,unicode_str); /* object name */
1073 @REPLY
1074 obj_handle_t handle; /* handle to the semaphore */
1075 @END
1078 /* Create a file */
1079 @REQ(create_file)
1080 unsigned int access; /* wanted access rights */
1081 unsigned int attributes; /* object attributes */
1082 unsigned int sharing; /* sharing flags */
1083 int create; /* file create action */
1084 unsigned int options; /* file options */
1085 unsigned int attrs; /* file attributes for creation */
1086 VARARG(objattr,object_attributes); /* object attributes */
1087 VARARG(filename,string); /* file name */
1088 @REPLY
1089 obj_handle_t handle; /* handle to the file */
1090 @END
1093 /* Open a file object */
1094 @REQ(open_file_object)
1095 unsigned int access; /* wanted access rights */
1096 unsigned int attributes; /* open attributes */
1097 obj_handle_t rootdir; /* root directory */
1098 unsigned int sharing; /* sharing flags */
1099 unsigned int options; /* file options */
1100 VARARG(filename,unicode_str); /* file name */
1101 @REPLY
1102 obj_handle_t handle; /* handle to the file */
1103 @END
1106 /* Allocate a file handle for a Unix fd */
1107 @REQ(alloc_file_handle)
1108 unsigned int access; /* wanted access rights */
1109 unsigned int attributes; /* object attributes */
1110 int fd; /* file descriptor on the client side */
1111 @REPLY
1112 obj_handle_t handle; /* handle to the file */
1113 @END
1116 /* Get the Unix name from a file handle */
1117 @REQ(get_handle_unix_name)
1118 obj_handle_t handle; /* file handle */
1119 @REPLY
1120 data_size_t name_len; /* unix name length */
1121 VARARG(name,string); /* unix name */
1122 @END
1125 /* Get a Unix fd to access a file */
1126 @REQ(get_handle_fd)
1127 obj_handle_t handle; /* handle to the file */
1128 @REPLY
1129 int type; /* file type (see below) */
1130 int cacheable; /* can fd be cached in the client? */
1131 unsigned int access; /* file access rights */
1132 unsigned int options; /* file open options */
1133 @END
1134 enum server_fd_type
1136 FD_TYPE_INVALID, /* invalid file (no associated fd) */
1137 FD_TYPE_FILE, /* regular file */
1138 FD_TYPE_DIR, /* directory */
1139 FD_TYPE_SOCKET, /* socket */
1140 FD_TYPE_SERIAL, /* serial port */
1141 FD_TYPE_PIPE, /* named pipe */
1142 FD_TYPE_MAILSLOT, /* mailslot */
1143 FD_TYPE_CHAR, /* unspecified char device */
1144 FD_TYPE_DEVICE, /* Windows device file */
1145 FD_TYPE_NB_TYPES
1149 /* Flush a file buffers */
1150 @REQ(flush_file)
1151 obj_handle_t handle; /* handle to the file */
1152 @REPLY
1153 obj_handle_t event; /* event set when finished */
1154 @END
1157 /* Lock a region of a file */
1158 @REQ(lock_file)
1159 obj_handle_t handle; /* handle to the file */
1160 file_pos_t offset; /* offset of start of lock */
1161 file_pos_t count; /* count of bytes to lock */
1162 int shared; /* shared or exclusive lock? */
1163 int wait; /* do we want to wait? */
1164 @REPLY
1165 obj_handle_t handle; /* handle to wait on */
1166 int overlapped; /* is it an overlapped I/O handle? */
1167 @END
1170 /* Unlock a region of a file */
1171 @REQ(unlock_file)
1172 obj_handle_t handle; /* handle to the file */
1173 file_pos_t offset; /* offset of start of unlock */
1174 file_pos_t count; /* count of bytes to unlock */
1175 @END
1178 /* Create a socket */
1179 @REQ(create_socket)
1180 unsigned int access; /* wanted access rights */
1181 unsigned int attributes; /* object attributes */
1182 int family; /* family, see socket manpage */
1183 int type; /* type, see socket manpage */
1184 int protocol; /* protocol, see socket manpage */
1185 unsigned int flags; /* socket flags */
1186 @REPLY
1187 obj_handle_t handle; /* handle to the new socket */
1188 @END
1191 /* Accept a socket */
1192 @REQ(accept_socket)
1193 obj_handle_t lhandle; /* handle to the listening socket */
1194 unsigned int access; /* wanted access rights */
1195 unsigned int attributes; /* object attributes */
1196 @REPLY
1197 obj_handle_t handle; /* handle to the new socket */
1198 @END
1201 /* Accept into an initialized socket */
1202 @REQ(accept_into_socket)
1203 obj_handle_t lhandle; /* handle to the listening socket */
1204 obj_handle_t ahandle; /* handle to the accepting socket */
1205 @END
1208 /* Set socket event parameters */
1209 @REQ(set_socket_event)
1210 obj_handle_t handle; /* handle to the socket */
1211 unsigned int mask; /* event mask */
1212 obj_handle_t event; /* event object */
1213 user_handle_t window; /* window to send the message to */
1214 unsigned int msg; /* message to send */
1215 @END
1218 /* Get socket event parameters */
1219 @REQ(get_socket_event)
1220 obj_handle_t handle; /* handle to the socket */
1221 int service; /* clear pending? */
1222 obj_handle_t c_event; /* event to clear */
1223 @REPLY
1224 unsigned int mask; /* event mask */
1225 unsigned int pmask; /* pending events */
1226 unsigned int state; /* status bits */
1227 VARARG(errors,ints); /* event errors */
1228 @END
1231 /* Re-enable pending socket events */
1232 @REQ(enable_socket_event)
1233 obj_handle_t handle; /* handle to the socket */
1234 unsigned int mask; /* events to re-enable */
1235 unsigned int sstate; /* status bits to set */
1236 unsigned int cstate; /* status bits to clear */
1237 @END
1239 @REQ(set_socket_deferred)
1240 obj_handle_t handle; /* handle to the socket */
1241 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1242 @END
1244 /* Allocate a console (only used by a console renderer) */
1245 @REQ(alloc_console)
1246 unsigned int access; /* wanted access rights */
1247 unsigned int attributes; /* object attributes */
1248 process_id_t pid; /* pid of process which shall be attached to the console */
1249 int input_fd; /* if pid=-1 (bare console to current process), fd for input */
1250 @REPLY
1251 obj_handle_t handle_in; /* handle to console input */
1252 obj_handle_t event; /* handle to renderer events change notification */
1253 @END
1256 /* Free the console of the current process */
1257 @REQ(free_console)
1258 @END
1261 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1262 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1263 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1264 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1265 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1266 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1267 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1268 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1269 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1270 struct console_renderer_event
1272 short event;
1273 union
1275 struct update
1277 short top;
1278 short bottom;
1279 } update;
1280 struct resize
1282 short width;
1283 short height;
1284 } resize;
1285 struct cursor_pos
1287 short x;
1288 short y;
1289 } cursor_pos;
1290 struct cursor_geom
1292 short visible;
1293 short size;
1294 } cursor_geom;
1295 struct display
1297 short left;
1298 short top;
1299 short width;
1300 short height;
1301 } display;
1302 } u;
1305 /* retrieve console events for the renderer */
1306 @REQ(get_console_renderer_events)
1307 obj_handle_t handle; /* handle to console input events */
1308 @REPLY
1309 VARARG(data,bytes); /* the various console_renderer_events */
1310 @END
1313 /* Open a handle to the process console */
1314 @REQ(open_console)
1315 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1316 /* otherwise console_in handle to get active screen buffer? */
1317 unsigned int access; /* wanted access rights */
1318 unsigned int attributes; /* object attributes */
1319 int share; /* share mask (only for output handles) */
1320 @REPLY
1321 obj_handle_t handle; /* handle to the console */
1322 @END
1325 /* Get the input queue wait event */
1326 @REQ(get_console_wait_event)
1327 @REPLY
1328 obj_handle_t handle;
1329 @END
1331 /* Get a console mode (input or output) */
1332 @REQ(get_console_mode)
1333 obj_handle_t handle; /* handle to the console */
1334 @REPLY
1335 int mode; /* console mode */
1336 @END
1339 /* Set a console mode (input or output) */
1340 @REQ(set_console_mode)
1341 obj_handle_t handle; /* handle to the console */
1342 int mode; /* console mode */
1343 @END
1346 /* Set info about a console (input only) */
1347 @REQ(set_console_input_info)
1348 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1349 int mask; /* setting mask (see below) */
1350 obj_handle_t active_sb; /* active screen buffer */
1351 int history_mode; /* whether we duplicate lines in history */
1352 int history_size; /* number of lines in history */
1353 int edition_mode; /* index to the edition mode flavors */
1354 int input_cp; /* console input codepage */
1355 int output_cp; /* console output codepage */
1356 user_handle_t win; /* console window if backend supports it */
1357 VARARG(title,unicode_str); /* console title */
1358 @END
1359 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1360 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1361 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1362 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1363 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1364 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1365 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1366 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1369 /* Get info about a console (input only) */
1370 @REQ(get_console_input_info)
1371 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1372 @REPLY
1373 int history_mode; /* whether we duplicate lines in history */
1374 int history_size; /* number of lines in history */
1375 int history_index; /* number of used lines in history */
1376 int edition_mode; /* index to the edition mode flavors */
1377 int input_cp; /* console input codepage */
1378 int output_cp; /* console output codepage */
1379 user_handle_t win; /* console window if backend supports it */
1380 VARARG(title,unicode_str); /* console title */
1381 @END
1384 /* appends a string to console's history */
1385 @REQ(append_console_input_history)
1386 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1387 VARARG(line,unicode_str); /* line to add */
1388 @END
1391 /* appends a string to console's history */
1392 @REQ(get_console_input_history)
1393 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1394 int index; /* index to get line from */
1395 @REPLY
1396 int total; /* total length of line in Unicode chars */
1397 VARARG(line,unicode_str); /* line to add */
1398 @END
1401 /* creates a new screen buffer on process' console */
1402 @REQ(create_console_output)
1403 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1404 unsigned int access; /* wanted access rights */
1405 unsigned int attributes; /* object attributes */
1406 unsigned int share; /* sharing credentials */
1407 int fd; /* for bare consoles, fd the screen-buffer is attached to */
1408 @REPLY
1409 obj_handle_t handle_out; /* handle to the screen buffer */
1410 @END
1413 /* Set info about a console (output only) */
1414 @REQ(set_console_output_info)
1415 obj_handle_t handle; /* handle to the console */
1416 int mask; /* setting mask (see below) */
1417 short int cursor_size; /* size of cursor (percentage filled) */
1418 short int cursor_visible;/* cursor visibility flag */
1419 short int cursor_x; /* position of cursor (x, y) */
1420 short int cursor_y;
1421 short int width; /* width of the screen buffer */
1422 short int height; /* height of the screen buffer */
1423 short int attr; /* default attribute */
1424 short int win_left; /* window actually displayed by renderer */
1425 short int win_top; /* the rect area is expressed within the */
1426 short int win_right; /* boundaries of the screen buffer */
1427 short int win_bottom;
1428 short int max_width; /* maximum size (width x height) for the window */
1429 short int max_height;
1430 @END
1431 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1432 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1433 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1434 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1435 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1436 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1439 /* Get info about a console (output only) */
1440 @REQ(get_console_output_info)
1441 obj_handle_t handle; /* handle to the console */
1442 @REPLY
1443 short int cursor_size; /* size of cursor (percentage filled) */
1444 short int cursor_visible;/* cursor visibility flag */
1445 short int cursor_x; /* position of cursor (x, y) */
1446 short int cursor_y;
1447 short int width; /* width of the screen buffer */
1448 short int height; /* height of the screen buffer */
1449 short int attr; /* default attribute */
1450 short int win_left; /* window actually displayed by renderer */
1451 short int win_top; /* the rect area is expressed within the */
1452 short int win_right; /* boundaries of the screen buffer */
1453 short int win_bottom;
1454 short int max_width; /* maximum size (width x height) for the window */
1455 short int max_height;
1456 @END
1458 /* Add input records to a console input queue */
1459 @REQ(write_console_input)
1460 obj_handle_t handle; /* handle to the console input */
1461 VARARG(rec,input_records); /* input records */
1462 @REPLY
1463 int written; /* number of records written */
1464 @END
1467 /* Fetch input records from a console input queue */
1468 @REQ(read_console_input)
1469 obj_handle_t handle; /* handle to the console input */
1470 int flush; /* flush the retrieved records from the queue? */
1471 @REPLY
1472 int read; /* number of records read */
1473 VARARG(rec,input_records); /* input records */
1474 @END
1477 /* write data (chars and/or attributes) in a screen buffer */
1478 @REQ(write_console_output)
1479 obj_handle_t handle; /* handle to the console output */
1480 int x; /* position where to start writing */
1481 int y;
1482 int mode; /* char info (see below) */
1483 int wrap; /* wrap around at end of line? */
1484 VARARG(data,bytes); /* info to write */
1485 @REPLY
1486 int written; /* number of char infos actually written */
1487 int width; /* width of screen buffer */
1488 int height; /* height of screen buffer */
1489 @END
1490 enum char_info_mode
1492 CHAR_INFO_MODE_TEXT, /* characters only */
1493 CHAR_INFO_MODE_ATTR, /* attributes only */
1494 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1495 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1499 /* fill a screen buffer with constant data (chars and/or attributes) */
1500 @REQ(fill_console_output)
1501 obj_handle_t handle; /* handle to the console output */
1502 int x; /* position where to start writing */
1503 int y;
1504 int mode; /* char info mode */
1505 int count; /* number to write */
1506 int wrap; /* wrap around at end of line? */
1507 char_info_t data; /* data to write */
1508 @REPLY
1509 int written; /* number of char infos actually written */
1510 @END
1513 /* read data (chars and/or attributes) from a screen buffer */
1514 @REQ(read_console_output)
1515 obj_handle_t handle; /* handle to the console output */
1516 int x; /* position (x,y) where to start reading */
1517 int y;
1518 int mode; /* char info mode */
1519 int wrap; /* wrap around at end of line? */
1520 @REPLY
1521 int width; /* width of screen buffer */
1522 int height; /* height of screen buffer */
1523 VARARG(data,bytes);
1524 @END
1527 /* move a rect (of data) in screen buffer content */
1528 @REQ(move_console_output)
1529 obj_handle_t handle; /* handle to the console output */
1530 short int x_src; /* position (x, y) of rect to start moving from */
1531 short int y_src;
1532 short int x_dst; /* position (x, y) of rect to move to */
1533 short int y_dst;
1534 short int w; /* size of the rect (width, height) to move */
1535 short int h;
1536 @END
1539 /* Sends a signal to a process group */
1540 @REQ(send_console_signal)
1541 int signal; /* the signal to send */
1542 process_id_t group_id; /* the group to send the signal to */
1543 @END
1546 /* enable directory change notifications */
1547 @REQ(read_directory_changes)
1548 unsigned int filter; /* notification filter */
1549 int subtree; /* watch the subtree? */
1550 int want_data; /* flag indicating whether change data should be collected */
1551 async_data_t async; /* async I/O parameters */
1552 @END
1555 @REQ(read_change)
1556 obj_handle_t handle;
1557 @REPLY
1558 VARARG(events,filesystem_event); /* collected filesystem events */
1559 @END
1562 /* Create a file mapping */
1563 @REQ(create_mapping)
1564 unsigned int access; /* wanted access rights */
1565 unsigned int attributes; /* object attributes */
1566 unsigned int protect; /* protection flags (see below) */
1567 mem_size_t size; /* mapping size */
1568 obj_handle_t file_handle; /* file handle */
1569 VARARG(objattr,object_attributes); /* object attributes */
1570 @REPLY
1571 obj_handle_t handle; /* handle to the mapping */
1572 @END
1573 /* per-page protection flags */
1574 #define VPROT_READ 0x01
1575 #define VPROT_WRITE 0x02
1576 #define VPROT_EXEC 0x04
1577 #define VPROT_WRITECOPY 0x08
1578 #define VPROT_GUARD 0x10
1579 #define VPROT_NOCACHE 0x20
1580 #define VPROT_COMMITTED 0x40
1581 #define VPROT_WRITEWATCH 0x80
1582 /* per-mapping protection flags */
1583 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1584 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1585 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1586 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1589 /* Open a mapping */
1590 @REQ(open_mapping)
1591 unsigned int access; /* wanted access rights */
1592 unsigned int attributes; /* object attributes */
1593 obj_handle_t rootdir; /* root directory */
1594 VARARG(name,unicode_str); /* object name */
1595 @REPLY
1596 obj_handle_t handle; /* handle to the mapping */
1597 @END
1600 /* Get information about a file mapping */
1601 @REQ(get_mapping_info)
1602 obj_handle_t handle; /* handle to the mapping */
1603 unsigned int access; /* wanted access rights */
1604 @REPLY
1605 mem_size_t size; /* mapping size */
1606 int protect; /* protection flags */
1607 int header_size; /* header size (for VPROT_IMAGE mapping) */
1608 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1609 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1610 obj_handle_t shared_file; /* shared mapping file handle */
1611 @END
1614 /* Get a range of committed pages in a file mapping */
1615 @REQ(get_mapping_committed_range)
1616 obj_handle_t handle; /* handle to the mapping */
1617 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1618 @REPLY
1619 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1620 int committed; /* whether it is a committed range */
1621 @END
1624 /* Add a range to the committed pages in a file mapping */
1625 @REQ(add_mapping_committed_range)
1626 obj_handle_t handle; /* handle to the mapping */
1627 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1628 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1629 @END
1632 #define SNAP_PROCESS 0x00000001
1633 #define SNAP_THREAD 0x00000002
1634 /* Create a snapshot */
1635 @REQ(create_snapshot)
1636 unsigned int attributes; /* object attributes */
1637 unsigned int flags; /* snapshot flags (SNAP_*) */
1638 @REPLY
1639 obj_handle_t handle; /* handle to the snapshot */
1640 @END
1643 /* Get the next process from a snapshot */
1644 @REQ(next_process)
1645 obj_handle_t handle; /* handle to the snapshot */
1646 int reset; /* reset snapshot position? */
1647 @REPLY
1648 int count; /* process usage count */
1649 process_id_t pid; /* process id */
1650 process_id_t ppid; /* parent process id */
1651 int threads; /* number of threads */
1652 int priority; /* process priority */
1653 int handles; /* number of handles */
1654 int unix_pid; /* Unix pid */
1655 VARARG(filename,unicode_str); /* file name of main exe */
1656 @END
1659 /* Get the next thread from a snapshot */
1660 @REQ(next_thread)
1661 obj_handle_t handle; /* handle to the snapshot */
1662 int reset; /* reset snapshot position? */
1663 @REPLY
1664 int count; /* thread usage count */
1665 process_id_t pid; /* process id */
1666 thread_id_t tid; /* thread id */
1667 int base_pri; /* base priority */
1668 int delta_pri; /* delta priority */
1669 @END
1672 /* Wait for a debug event */
1673 @REQ(wait_debug_event)
1674 int get_handle; /* should we alloc a handle for waiting? */
1675 @REPLY
1676 process_id_t pid; /* process id */
1677 thread_id_t tid; /* thread id */
1678 obj_handle_t wait; /* wait handle if no event ready */
1679 VARARG(event,debug_event); /* debug event data */
1680 @END
1683 /* Queue an exception event */
1684 @REQ(queue_exception_event)
1685 int first; /* first chance exception? */
1686 unsigned int code; /* exception code */
1687 unsigned int flags; /* exception flags */
1688 client_ptr_t record; /* exception record */
1689 client_ptr_t address; /* exception address */
1690 data_size_t len; /* size of parameters */
1691 VARARG(params,uints64,len);/* exception parameters */
1692 VARARG(context,context); /* thread context */
1693 @REPLY
1694 obj_handle_t handle; /* handle to the queued event */
1695 @END
1698 /* Retrieve the status of an exception event */
1699 @REQ(get_exception_status)
1700 obj_handle_t handle; /* handle to the queued event */
1701 @REPLY
1702 VARARG(context,context); /* modified thread context */
1703 @END
1706 /* Send an output string to the debugger */
1707 @REQ(output_debug_string)
1708 data_size_t length; /* string length */
1709 client_ptr_t string; /* string to display (in debugged process address space) */
1710 @END
1713 /* Continue a debug event */
1714 @REQ(continue_debug_event)
1715 process_id_t pid; /* process id to continue */
1716 thread_id_t tid; /* thread id to continue */
1717 int status; /* continuation status */
1718 @END
1721 /* Start/stop debugging an existing process */
1722 @REQ(debug_process)
1723 process_id_t pid; /* id of the process to debug */
1724 int attach; /* 1=attaching / 0=detaching from the process */
1725 @END
1728 /* Simulate a breakpoint in a process */
1729 @REQ(debug_break)
1730 obj_handle_t handle; /* process handle */
1731 @REPLY
1732 int self; /* was it the caller itself? */
1733 @END
1736 /* Set debugger kill on exit flag */
1737 @REQ(set_debugger_kill_on_exit)
1738 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1739 @END
1742 /* Read data from a process address space */
1743 @REQ(read_process_memory)
1744 obj_handle_t handle; /* process handle */
1745 client_ptr_t addr; /* addr to read from */
1746 @REPLY
1747 VARARG(data,bytes); /* result data */
1748 @END
1751 /* Write data to a process address space */
1752 @REQ(write_process_memory)
1753 obj_handle_t handle; /* process handle */
1754 client_ptr_t addr; /* addr to write to */
1755 VARARG(data,bytes); /* data to write */
1756 @END
1759 /* Create a registry key */
1760 @REQ(create_key)
1761 obj_handle_t parent; /* handle to the parent key */
1762 unsigned int access; /* desired access rights */
1763 unsigned int attributes; /* object attributes */
1764 unsigned int options; /* creation options */
1765 data_size_t namelen; /* length of key name in bytes */
1766 VARARG(name,unicode_str,namelen); /* key name */
1767 VARARG(class,unicode_str); /* class name */
1768 @REPLY
1769 obj_handle_t hkey; /* handle to the created key */
1770 int created; /* has it been newly created? */
1771 @END
1773 /* Open a registry key */
1774 @REQ(open_key)
1775 obj_handle_t parent; /* handle to the parent key */
1776 unsigned int access; /* desired access rights */
1777 unsigned int attributes; /* object attributes */
1778 VARARG(name,unicode_str); /* key name */
1779 @REPLY
1780 obj_handle_t hkey; /* handle to the open key */
1781 @END
1784 /* Delete a registry key */
1785 @REQ(delete_key)
1786 obj_handle_t hkey; /* handle to the key */
1787 @END
1790 /* Flush a registry key */
1791 @REQ(flush_key)
1792 obj_handle_t hkey; /* handle to the key */
1793 @END
1796 /* Enumerate registry subkeys */
1797 @REQ(enum_key)
1798 obj_handle_t hkey; /* handle to registry key */
1799 int index; /* index of subkey (or -1 for current key) */
1800 int info_class; /* requested information class */
1801 @REPLY
1802 int subkeys; /* number of subkeys */
1803 int max_subkey; /* longest subkey name */
1804 int max_class; /* longest class name */
1805 int values; /* number of values */
1806 int max_value; /* longest value name */
1807 int max_data; /* longest value data */
1808 timeout_t modif; /* last modification time */
1809 data_size_t total; /* total length needed for full name and class */
1810 data_size_t namelen; /* length of key name in bytes */
1811 VARARG(name,unicode_str,namelen); /* key name */
1812 VARARG(class,unicode_str); /* class name */
1813 @END
1816 /* Set a value of a registry key */
1817 @REQ(set_key_value)
1818 obj_handle_t hkey; /* handle to registry key */
1819 int type; /* value type */
1820 data_size_t namelen; /* length of value name in bytes */
1821 VARARG(name,unicode_str,namelen); /* value name */
1822 VARARG(data,bytes); /* value data */
1823 @END
1826 /* Retrieve the value of a registry key */
1827 @REQ(get_key_value)
1828 obj_handle_t hkey; /* handle to registry key */
1829 VARARG(name,unicode_str); /* value name */
1830 @REPLY
1831 int type; /* value type */
1832 data_size_t total; /* total length needed for data */
1833 VARARG(data,bytes); /* value data */
1834 @END
1837 /* Enumerate a value of a registry key */
1838 @REQ(enum_key_value)
1839 obj_handle_t hkey; /* handle to registry key */
1840 int index; /* value index */
1841 int info_class; /* requested information class */
1842 @REPLY
1843 int type; /* value type */
1844 data_size_t total; /* total length needed for full name and data */
1845 data_size_t namelen; /* length of value name in bytes */
1846 VARARG(name,unicode_str,namelen); /* value name */
1847 VARARG(data,bytes); /* value data */
1848 @END
1851 /* Delete a value of a registry key */
1852 @REQ(delete_key_value)
1853 obj_handle_t hkey; /* handle to registry key */
1854 VARARG(name,unicode_str); /* value name */
1855 @END
1858 /* Load a registry branch from a file */
1859 @REQ(load_registry)
1860 obj_handle_t hkey; /* root key to load to */
1861 obj_handle_t file; /* file to load from */
1862 VARARG(name,unicode_str); /* subkey name */
1863 @END
1866 /* UnLoad a registry branch from a file */
1867 @REQ(unload_registry)
1868 obj_handle_t hkey; /* root key to unload to */
1869 @END
1872 /* Save a registry branch to a file */
1873 @REQ(save_registry)
1874 obj_handle_t hkey; /* key to save */
1875 obj_handle_t file; /* file to save to */
1876 @END
1879 /* Add a registry key change notification */
1880 @REQ(set_registry_notification)
1881 obj_handle_t hkey; /* key to watch for changes */
1882 obj_handle_t event; /* event to set */
1883 int subtree; /* should we watch the whole subtree? */
1884 unsigned int filter; /* things to watch */
1885 @END
1888 /* Create a waitable timer */
1889 @REQ(create_timer)
1890 unsigned int access; /* wanted access rights */
1891 unsigned int attributes; /* object attributes */
1892 obj_handle_t rootdir; /* root directory */
1893 int manual; /* manual reset */
1894 VARARG(name,unicode_str); /* object name */
1895 @REPLY
1896 obj_handle_t handle; /* handle to the timer */
1897 @END
1900 /* Open a waitable timer */
1901 @REQ(open_timer)
1902 unsigned int access; /* wanted access rights */
1903 unsigned int attributes; /* object attributes */
1904 obj_handle_t rootdir; /* root directory */
1905 VARARG(name,unicode_str); /* object name */
1906 @REPLY
1907 obj_handle_t handle; /* handle to the timer */
1908 @END
1910 /* Set a waitable timer */
1911 @REQ(set_timer)
1912 obj_handle_t handle; /* handle to the timer */
1913 timeout_t expire; /* next expiration absolute time */
1914 client_ptr_t callback; /* callback function */
1915 client_ptr_t arg; /* callback argument */
1916 int period; /* timer period in ms */
1917 @REPLY
1918 int signaled; /* was the timer signaled before this call ? */
1919 @END
1921 /* Cancel a waitable timer */
1922 @REQ(cancel_timer)
1923 obj_handle_t handle; /* handle to the timer */
1924 @REPLY
1925 int signaled; /* was the timer signaled before this calltime ? */
1926 @END
1928 /* Get information on a waitable timer */
1929 @REQ(get_timer_info)
1930 obj_handle_t handle; /* handle to the timer */
1931 @REPLY
1932 timeout_t when; /* absolute time when the timer next expires */
1933 int signaled; /* is the timer signaled? */
1934 @END
1937 /* Retrieve the current context of a thread */
1938 @REQ(get_thread_context)
1939 obj_handle_t handle; /* thread handle */
1940 unsigned int flags; /* context flags */
1941 int suspend; /* suspend the thread if needed */
1942 @REPLY
1943 int self; /* was it a handle to the current thread? */
1944 VARARG(context,context); /* thread context */
1945 @END
1948 /* Set the current context of a thread */
1949 @REQ(set_thread_context)
1950 obj_handle_t handle; /* thread handle */
1951 int suspend; /* suspend the thread if needed */
1952 VARARG(context,context); /* thread context */
1953 @REPLY
1954 int self; /* was it a handle to the current thread? */
1955 @END
1958 /* Fetch a selector entry for a thread */
1959 @REQ(get_selector_entry)
1960 obj_handle_t handle; /* thread handle */
1961 int entry; /* LDT entry */
1962 @REPLY
1963 unsigned int base; /* selector base */
1964 unsigned int limit; /* selector limit */
1965 unsigned char flags; /* selector flags */
1966 @END
1969 /* Add an atom */
1970 @REQ(add_atom)
1971 obj_handle_t table; /* which table to add atom to */
1972 VARARG(name,unicode_str); /* atom name */
1973 @REPLY
1974 atom_t atom; /* resulting atom */
1975 @END
1978 /* Delete an atom */
1979 @REQ(delete_atom)
1980 obj_handle_t table; /* which table to delete atom from */
1981 atom_t atom; /* atom handle */
1982 @END
1985 /* Find an atom */
1986 @REQ(find_atom)
1987 obj_handle_t table; /* which table to find atom from */
1988 VARARG(name,unicode_str); /* atom name */
1989 @REPLY
1990 atom_t atom; /* atom handle */
1991 @END
1994 /* Get information about an atom */
1995 @REQ(get_atom_information)
1996 obj_handle_t table; /* which table to find atom from */
1997 atom_t atom; /* atom handle */
1998 @REPLY
1999 int count; /* atom lock count */
2000 int pinned; /* whether the atom has been pinned */
2001 data_size_t total; /* actual length of atom name */
2002 VARARG(name,unicode_str); /* atom name */
2003 @END
2006 /* Set information about an atom */
2007 @REQ(set_atom_information)
2008 obj_handle_t table; /* which table to find atom from */
2009 atom_t atom; /* atom handle */
2010 int pinned; /* whether to bump atom information */
2011 @END
2014 /* Empty an atom table */
2015 @REQ(empty_atom_table)
2016 obj_handle_t table; /* which table to find atom from */
2017 int if_pinned; /* whether to delete pinned atoms */
2018 @END
2021 /* Init an atom table */
2022 @REQ(init_atom_table)
2023 int entries; /* number of entries (only for local) */
2024 @REPLY
2025 obj_handle_t table; /* handle to the atom table */
2026 @END
2029 /* Get the message queue of the current thread */
2030 @REQ(get_msg_queue)
2031 @REPLY
2032 obj_handle_t handle; /* handle to the queue */
2033 @END
2036 /* Set the file descriptor associated to the current thread queue */
2037 @REQ(set_queue_fd)
2038 obj_handle_t handle; /* handle to the file descriptor */
2039 @END
2042 /* Set the current message queue wakeup mask */
2043 @REQ(set_queue_mask)
2044 unsigned int wake_mask; /* wakeup bits mask */
2045 unsigned int changed_mask; /* changed bits mask */
2046 int skip_wait; /* will we skip waiting if signaled? */
2047 @REPLY
2048 unsigned int wake_bits; /* current wake bits */
2049 unsigned int changed_bits; /* current changed bits */
2050 @END
2053 /* Get the current message queue status */
2054 @REQ(get_queue_status)
2055 int clear; /* should we clear the change bits? */
2056 @REPLY
2057 unsigned int wake_bits; /* wake bits */
2058 unsigned int changed_bits; /* changed bits since last time */
2059 @END
2062 /* Retrieve the process idle event */
2063 @REQ(get_process_idle_event)
2064 obj_handle_t handle; /* process handle */
2065 @REPLY
2066 obj_handle_t event; /* handle to idle event */
2067 @END
2070 /* Send a message to a thread queue */
2071 @REQ(send_message)
2072 thread_id_t id; /* thread id */
2073 int type; /* message type (see below) */
2074 int flags; /* message flags (see below) */
2075 user_handle_t win; /* window handle */
2076 unsigned int msg; /* message code */
2077 lparam_t wparam; /* parameters */
2078 lparam_t lparam; /* parameters */
2079 timeout_t timeout; /* timeout for reply */
2080 VARARG(data,message_data); /* message data for sent messages */
2081 @END
2083 @REQ(post_quit_message)
2084 int exit_code; /* exit code to return */
2085 @END
2087 enum message_type
2089 MSG_ASCII, /* Ascii message (from SendMessageA) */
2090 MSG_UNICODE, /* Unicode message (from SendMessageW) */
2091 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
2092 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
2093 MSG_CALLBACK_RESULT,/* result of a callback message */
2094 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
2095 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
2096 MSG_HARDWARE, /* hardware message */
2097 MSG_WINEVENT, /* winevent message */
2098 MSG_HOOK_LL /* low-level hardware hook */
2100 #define SEND_MSG_ABORT_IF_HUNG 0x01
2103 /* Send a hardware message to a thread queue */
2104 @REQ(send_hardware_message)
2105 user_handle_t win; /* window handle */
2106 hw_input_t input; /* input data */
2107 unsigned int flags; /* flags (see below) */
2108 @REPLY
2109 int wait; /* do we need to wait for a reply? */
2110 int prev_x; /* previous cursor position */
2111 int prev_y;
2112 int new_x; /* new cursor position */
2113 int new_y;
2114 VARARG(keystate,bytes); /* global state array for all the keys */
2115 @END
2116 #define SEND_HWMSG_INJECTED 0x01
2119 /* Get a message from the current queue */
2120 @REQ(get_message)
2121 unsigned int flags; /* PM_* flags */
2122 user_handle_t get_win; /* window handle to get */
2123 unsigned int get_first; /* first message code to get */
2124 unsigned int get_last; /* last message code to get */
2125 unsigned int hw_id; /* id of the previous hardware message (or 0) */
2126 unsigned int wake_mask; /* wakeup bits mask */
2127 unsigned int changed_mask; /* changed bits mask */
2128 @REPLY
2129 user_handle_t win; /* window handle */
2130 unsigned int msg; /* message code */
2131 lparam_t wparam; /* parameters */
2132 lparam_t lparam; /* parameters */
2133 int type; /* message type */
2134 unsigned int time; /* message time */
2135 unsigned int active_hooks; /* active hooks bitmap */
2136 data_size_t total; /* total size of extra data */
2137 VARARG(data,message_data); /* message data for sent messages */
2138 @END
2141 /* Reply to a sent message */
2142 @REQ(reply_message)
2143 int remove; /* should we remove the message? */
2144 lparam_t result; /* message result */
2145 VARARG(data,bytes); /* message data for sent messages */
2146 @END
2149 /* Accept the current hardware message */
2150 @REQ(accept_hardware_message)
2151 unsigned int hw_id; /* id of the hardware message */
2152 int remove; /* should we remove the message? */
2153 user_handle_t new_win; /* new destination window for current message */
2154 @END
2157 /* Retrieve the reply for the last message sent */
2158 @REQ(get_message_reply)
2159 int cancel; /* cancel message if not ready? */
2160 @REPLY
2161 lparam_t result; /* message result */
2162 VARARG(data,bytes); /* message data for sent messages */
2163 @END
2166 /* Set a window timer */
2167 @REQ(set_win_timer)
2168 user_handle_t win; /* window handle */
2169 unsigned int msg; /* message to post */
2170 unsigned int rate; /* timer rate in ms */
2171 lparam_t id; /* timer id */
2172 lparam_t lparam; /* message lparam (callback proc) */
2173 @REPLY
2174 lparam_t id; /* timer id */
2175 @END
2178 /* Kill a window timer */
2179 @REQ(kill_win_timer)
2180 user_handle_t win; /* window handle */
2181 lparam_t id; /* timer id */
2182 unsigned int msg; /* message to post */
2183 @END
2186 /* check if the thread owning the window is hung */
2187 @REQ(is_window_hung)
2188 user_handle_t win; /* window handle */
2189 @REPLY
2190 int is_hung;
2191 @END
2194 /* Retrieve info about a serial port */
2195 @REQ(get_serial_info)
2196 obj_handle_t handle; /* handle to comm port */
2197 @REPLY
2198 unsigned int readinterval;
2199 unsigned int readconst;
2200 unsigned int readmult;
2201 unsigned int writeconst;
2202 unsigned int writemult;
2203 unsigned int eventmask;
2204 @END
2207 /* Set info about a serial port */
2208 @REQ(set_serial_info)
2209 obj_handle_t handle; /* handle to comm port */
2210 int flags; /* bitmask to set values (see below) */
2211 unsigned int readinterval;
2212 unsigned int readconst;
2213 unsigned int readmult;
2214 unsigned int writeconst;
2215 unsigned int writemult;
2216 unsigned int eventmask;
2217 @END
2218 #define SERIALINFO_SET_TIMEOUTS 0x01
2219 #define SERIALINFO_SET_MASK 0x02
2222 /* Create an async I/O */
2223 @REQ(register_async)
2224 int type; /* type of queue to look after */
2225 async_data_t async; /* async I/O parameters */
2226 int count; /* count - usually # of bytes to be read/written */
2227 @END
2228 #define ASYNC_TYPE_READ 0x01
2229 #define ASYNC_TYPE_WRITE 0x02
2230 #define ASYNC_TYPE_WAIT 0x03
2233 /* Cancel all async op on a fd */
2234 @REQ(cancel_async)
2235 obj_handle_t handle; /* handle to comm port, socket or file */
2236 client_ptr_t iosb; /* I/O status block (NULL=all) */
2237 int only_thread; /* cancel matching this thread */
2238 @END
2241 /* Perform an ioctl on a file */
2242 @REQ(ioctl)
2243 ioctl_code_t code; /* ioctl code */
2244 async_data_t async; /* async I/O parameters */
2245 int blocking; /* whether it's a blocking ioctl */
2246 VARARG(in_data,bytes); /* ioctl input data */
2247 @REPLY
2248 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2249 unsigned int options; /* device open options */
2250 VARARG(out_data,bytes); /* ioctl output data */
2251 @END
2254 /* Retrieve results of an async ioctl */
2255 @REQ(get_ioctl_result)
2256 obj_handle_t handle; /* handle to the device */
2257 client_ptr_t user_arg; /* user arg used to identify the request */
2258 @REPLY
2259 VARARG(out_data,bytes); /* ioctl output data */
2260 @END
2263 /* Create a named pipe */
2264 @REQ(create_named_pipe)
2265 unsigned int access;
2266 unsigned int attributes; /* object attributes */
2267 obj_handle_t rootdir; /* root directory */
2268 unsigned int options;
2269 unsigned int sharing;
2270 unsigned int maxinstances;
2271 unsigned int outsize;
2272 unsigned int insize;
2273 timeout_t timeout;
2274 unsigned int flags;
2275 VARARG(name,unicode_str); /* pipe name */
2276 @REPLY
2277 obj_handle_t handle; /* handle to the pipe */
2278 @END
2280 /* flags in create_named_pipe and get_named_pipe_info */
2281 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2282 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2283 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2284 #define NAMED_PIPE_SERVER_END 0x8000
2287 @REQ(get_named_pipe_info)
2288 obj_handle_t handle;
2289 @REPLY
2290 unsigned int flags;
2291 unsigned int sharing;
2292 unsigned int maxinstances;
2293 unsigned int instances;
2294 unsigned int outsize;
2295 unsigned int insize;
2296 @END
2299 /* Create a window */
2300 @REQ(create_window)
2301 user_handle_t parent; /* parent window */
2302 user_handle_t owner; /* owner window */
2303 atom_t atom; /* class atom */
2304 mod_handle_t instance; /* module instance */
2305 VARARG(class,unicode_str); /* class name */
2306 @REPLY
2307 user_handle_t handle; /* created window */
2308 user_handle_t parent; /* full handle of parent */
2309 user_handle_t owner; /* full handle of owner */
2310 int extra; /* number of extra bytes */
2311 client_ptr_t class_ptr; /* pointer to class in client address space */
2312 @END
2315 /* Destroy a window */
2316 @REQ(destroy_window)
2317 user_handle_t handle; /* handle to the window */
2318 @END
2321 /* Retrieve the desktop window for the current thread */
2322 @REQ(get_desktop_window)
2323 int force; /* force creation if it doesn't exist */
2324 @REPLY
2325 user_handle_t top_window; /* handle to the desktop window */
2326 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2327 @END
2330 /* Set a window owner */
2331 @REQ(set_window_owner)
2332 user_handle_t handle; /* handle to the window */
2333 user_handle_t owner; /* new owner */
2334 @REPLY
2335 user_handle_t full_owner; /* full handle of new owner */
2336 user_handle_t prev_owner; /* full handle of previous owner */
2337 @END
2340 /* Get information from a window handle */
2341 @REQ(get_window_info)
2342 user_handle_t handle; /* handle to the window */
2343 @REPLY
2344 user_handle_t full_handle; /* full 32-bit handle */
2345 user_handle_t last_active; /* last active popup */
2346 process_id_t pid; /* process owning the window */
2347 thread_id_t tid; /* thread owning the window */
2348 atom_t atom; /* class atom */
2349 int is_unicode; /* ANSI or unicode */
2350 @END
2353 /* Set some information in a window */
2354 @REQ(set_window_info)
2355 unsigned short flags; /* flags for fields to set (see below) */
2356 short int is_unicode; /* ANSI or unicode */
2357 user_handle_t handle; /* handle to the window */
2358 unsigned int style; /* window style */
2359 unsigned int ex_style; /* window extended style */
2360 unsigned int id; /* window id */
2361 mod_handle_t instance; /* creator instance */
2362 lparam_t user_data; /* user-specific data */
2363 int extra_offset; /* offset to set in extra bytes */
2364 data_size_t extra_size; /* size to set in extra bytes */
2365 lparam_t extra_value; /* value to set in extra bytes */
2366 @REPLY
2367 unsigned int old_style; /* old window style */
2368 unsigned int old_ex_style; /* old window extended style */
2369 mod_handle_t old_instance; /* old creator instance */
2370 lparam_t old_user_data; /* old user-specific data */
2371 lparam_t old_extra_value; /* old value in extra bytes */
2372 unsigned int old_id; /* old window id */
2373 @END
2374 #define SET_WIN_STYLE 0x01
2375 #define SET_WIN_EXSTYLE 0x02
2376 #define SET_WIN_ID 0x04
2377 #define SET_WIN_INSTANCE 0x08
2378 #define SET_WIN_USERDATA 0x10
2379 #define SET_WIN_EXTRA 0x20
2380 #define SET_WIN_UNICODE 0x40
2383 /* Set the parent of a window */
2384 @REQ(set_parent)
2385 user_handle_t handle; /* handle to the window */
2386 user_handle_t parent; /* handle to the parent */
2387 @REPLY
2388 user_handle_t old_parent; /* old parent window */
2389 user_handle_t full_parent; /* full handle of new parent */
2390 @END
2393 /* Get a list of the window parents, up to the root of the tree */
2394 @REQ(get_window_parents)
2395 user_handle_t handle; /* handle to the window */
2396 @REPLY
2397 int count; /* total count of parents */
2398 VARARG(parents,user_handles); /* parent handles */
2399 @END
2402 /* Get a list of the window children */
2403 @REQ(get_window_children)
2404 obj_handle_t desktop; /* handle to desktop */
2405 user_handle_t parent; /* parent window */
2406 atom_t atom; /* class atom for the listed children */
2407 thread_id_t tid; /* thread owning the listed children */
2408 VARARG(class,unicode_str); /* class name */
2409 @REPLY
2410 int count; /* total count of children */
2411 VARARG(children,user_handles); /* children handles */
2412 @END
2415 /* Get a list of the window children that contain a given point */
2416 @REQ(get_window_children_from_point)
2417 user_handle_t parent; /* parent window */
2418 int x; /* point in parent coordinates */
2419 int y;
2420 @REPLY
2421 int count; /* total count of children */
2422 VARARG(children,user_handles); /* children handles */
2423 @END
2426 /* Get window tree information from a window handle */
2427 @REQ(get_window_tree)
2428 user_handle_t handle; /* handle to the window */
2429 @REPLY
2430 user_handle_t parent; /* parent window */
2431 user_handle_t owner; /* owner window */
2432 user_handle_t next_sibling; /* next sibling in Z-order */
2433 user_handle_t prev_sibling; /* prev sibling in Z-order */
2434 user_handle_t first_sibling; /* first sibling in Z-order */
2435 user_handle_t last_sibling; /* last sibling in Z-order */
2436 user_handle_t first_child; /* first child */
2437 user_handle_t last_child; /* last child */
2438 @END
2440 /* Set the position and Z order of a window */
2441 @REQ(set_window_pos)
2442 unsigned short swp_flags; /* SWP_* flags */
2443 unsigned short paint_flags; /* paint flags (see below) */
2444 user_handle_t handle; /* handle to the window */
2445 user_handle_t previous; /* previous window in Z order */
2446 rectangle_t window; /* window rectangle (in parent coords) */
2447 rectangle_t client; /* client rectangle (in parent coords) */
2448 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2449 @REPLY
2450 unsigned int new_style; /* new window style */
2451 unsigned int new_ex_style; /* new window extended style */
2452 user_handle_t surface_win; /* window that needs a surface update */
2453 @END
2454 #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */
2455 #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */
2457 /* Get the window and client rectangles of a window */
2458 @REQ(get_window_rectangles)
2459 user_handle_t handle; /* handle to the window */
2460 int relative; /* coords relative to (see below) */
2461 @REPLY
2462 rectangle_t window; /* window rectangle */
2463 rectangle_t visible; /* visible part of the window rectangle */
2464 rectangle_t client; /* client rectangle */
2465 @END
2466 enum coords_relative
2468 COORDS_CLIENT, /* relative to client area */
2469 COORDS_WINDOW, /* relative to whole window area */
2470 COORDS_PARENT, /* relative to parent's client area */
2471 COORDS_SCREEN /* relative to screen origin */
2475 /* Get the window text */
2476 @REQ(get_window_text)
2477 user_handle_t handle; /* handle to the window */
2478 @REPLY
2479 VARARG(text,unicode_str); /* window text */
2480 @END
2483 /* Set the window text */
2484 @REQ(set_window_text)
2485 user_handle_t handle; /* handle to the window */
2486 VARARG(text,unicode_str); /* window text */
2487 @END
2490 /* Get the coordinates offset between two windows */
2491 @REQ(get_windows_offset)
2492 user_handle_t from; /* handle to the first window */
2493 user_handle_t to; /* handle to the second window */
2494 @REPLY
2495 int x; /* x coordinate offset */
2496 int y; /* y coordinate offset */
2497 int mirror; /* whether to mirror the x coordinate */
2498 @END
2501 /* Get the visible region of a window */
2502 @REQ(get_visible_region)
2503 user_handle_t window; /* handle to the window */
2504 unsigned int flags; /* DCX flags */
2505 @REPLY
2506 user_handle_t top_win; /* top window to clip against */
2507 rectangle_t top_rect; /* top window visible rect with screen coords */
2508 rectangle_t win_rect; /* window rect in screen coords */
2509 unsigned int paint_flags; /* paint flags (from SET_WINPOS_* flags) */
2510 data_size_t total_size; /* total size of the resulting region */
2511 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2512 @END
2515 /* Get the visible surface region of a window */
2516 @REQ(get_surface_region)
2517 user_handle_t window; /* handle to the window */
2518 @REPLY
2519 rectangle_t visible_rect; /* window visible rect in screen coords */
2520 data_size_t total_size; /* total size of the resulting region */
2521 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2522 @END
2525 /* Get the window region */
2526 @REQ(get_window_region)
2527 user_handle_t window; /* handle to the window */
2528 @REPLY
2529 data_size_t total_size; /* total size of the resulting region */
2530 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2531 @END
2534 /* Set the window region */
2535 @REQ(set_window_region)
2536 user_handle_t window; /* handle to the window */
2537 int redraw; /* redraw the window? */
2538 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2539 @END
2542 /* Get the window update region */
2543 @REQ(get_update_region)
2544 user_handle_t window; /* handle to the window */
2545 user_handle_t from_child; /* child to start searching from */
2546 unsigned int flags; /* update flags (see below) */
2547 @REPLY
2548 user_handle_t child; /* child to repaint (or window itself) */
2549 unsigned int flags; /* resulting update flags (see below) */
2550 data_size_t total_size; /* total size of the resulting region */
2551 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2552 @END
2553 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2554 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2555 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2556 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2557 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2558 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2559 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2560 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2563 /* Update the z order of a window so that a given rectangle is fully visible */
2564 @REQ(update_window_zorder)
2565 user_handle_t window; /* handle to the window */
2566 rectangle_t rect; /* rectangle that must be visible (in client coords) */
2567 @END
2570 /* Mark parts of a window as needing a redraw */
2571 @REQ(redraw_window)
2572 user_handle_t window; /* handle to the window */
2573 unsigned int flags; /* RDW_* flags */
2574 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2575 @END
2578 /* Set a window property */
2579 @REQ(set_window_property)
2580 user_handle_t window; /* handle to the window */
2581 lparam_t data; /* data to store */
2582 atom_t atom; /* property atom (if no name specified) */
2583 VARARG(name,unicode_str); /* property name */
2584 @END
2587 /* Remove a window property */
2588 @REQ(remove_window_property)
2589 user_handle_t window; /* handle to the window */
2590 atom_t atom; /* property atom (if no name specified) */
2591 VARARG(name,unicode_str); /* property name */
2592 @REPLY
2593 lparam_t data; /* data stored in property */
2594 @END
2597 /* Get a window property */
2598 @REQ(get_window_property)
2599 user_handle_t window; /* handle to the window */
2600 atom_t atom; /* property atom (if no name specified) */
2601 VARARG(name,unicode_str); /* property name */
2602 @REPLY
2603 lparam_t data; /* data stored in property */
2604 @END
2607 /* Get the list of properties of a window */
2608 @REQ(get_window_properties)
2609 user_handle_t window; /* handle to the window */
2610 @REPLY
2611 int total; /* total number of properties */
2612 VARARG(props,properties); /* list of properties */
2613 @END
2616 /* Create a window station */
2617 @REQ(create_winstation)
2618 unsigned int flags; /* window station flags */
2619 unsigned int access; /* wanted access rights */
2620 unsigned int attributes; /* object attributes */
2621 VARARG(name,unicode_str); /* object name */
2622 @REPLY
2623 obj_handle_t handle; /* handle to the window station */
2624 @END
2627 /* Open a handle to a window station */
2628 @REQ(open_winstation)
2629 unsigned int access; /* wanted access rights */
2630 unsigned int attributes; /* object attributes */
2631 VARARG(name,unicode_str); /* object name */
2632 @REPLY
2633 obj_handle_t handle; /* handle to the window station */
2634 @END
2637 /* Close a window station */
2638 @REQ(close_winstation)
2639 obj_handle_t handle; /* handle to the window station */
2640 @END
2643 /* Get the process current window station */
2644 @REQ(get_process_winstation)
2645 @REPLY
2646 obj_handle_t handle; /* handle to the window station */
2647 @END
2650 /* Set the process current window station */
2651 @REQ(set_process_winstation)
2652 obj_handle_t handle; /* handle to the window station */
2653 @END
2656 /* Enumerate window stations */
2657 @REQ(enum_winstation)
2658 unsigned int index; /* current index */
2659 @REPLY
2660 unsigned int next; /* next index */
2661 VARARG(name,unicode_str); /* window station name */
2662 @END
2665 /* Create a desktop */
2666 @REQ(create_desktop)
2667 unsigned int flags; /* desktop flags */
2668 unsigned int access; /* wanted access rights */
2669 unsigned int attributes; /* object attributes */
2670 VARARG(name,unicode_str); /* object name */
2671 @REPLY
2672 obj_handle_t handle; /* handle to the desktop */
2673 @END
2676 /* Open a handle to a desktop */
2677 @REQ(open_desktop)
2678 obj_handle_t winsta; /* window station to open (null allowed) */
2679 unsigned int flags; /* desktop flags */
2680 unsigned int access; /* wanted access rights */
2681 unsigned int attributes; /* object attributes */
2682 VARARG(name,unicode_str); /* object name */
2683 @REPLY
2684 obj_handle_t handle; /* handle to the desktop */
2685 @END
2688 /* Close a desktop */
2689 @REQ(close_desktop)
2690 obj_handle_t handle; /* handle to the desktop */
2691 @END
2694 /* Get the thread current desktop */
2695 @REQ(get_thread_desktop)
2696 thread_id_t tid; /* thread id */
2697 @REPLY
2698 obj_handle_t handle; /* handle to the desktop */
2699 @END
2702 /* Set the thread current desktop */
2703 @REQ(set_thread_desktop)
2704 obj_handle_t handle; /* handle to the desktop */
2705 @END
2708 /* Enumerate desktops */
2709 @REQ(enum_desktop)
2710 obj_handle_t winstation; /* handle to the window station */
2711 unsigned int index; /* current index */
2712 @REPLY
2713 unsigned int next; /* next index */
2714 VARARG(name,unicode_str); /* window station name */
2715 @END
2718 /* Get/set information about a user object (window station or desktop) */
2719 @REQ(set_user_object_info)
2720 obj_handle_t handle; /* handle to the object */
2721 unsigned int flags; /* information to set */
2722 unsigned int obj_flags; /* new object flags */
2723 @REPLY
2724 int is_desktop; /* is object a desktop? */
2725 unsigned int old_obj_flags; /* old object flags */
2726 VARARG(name,unicode_str); /* object name */
2727 @END
2728 #define SET_USER_OBJECT_FLAGS 1
2731 /* Register a hotkey */
2732 @REQ(register_hotkey)
2733 user_handle_t window; /* handle to the window */
2734 int id; /* hotkey identifier */
2735 unsigned int flags; /* modifier keys */
2736 unsigned int vkey; /* virtual key code */
2737 @REPLY
2738 int replaced; /* did we replace an existing hotkey? */
2739 unsigned int flags; /* flags of replaced hotkey */
2740 unsigned int vkey; /* virtual key code of replaced hotkey */
2741 @END
2744 /* Unregister a hotkey */
2745 @REQ(unregister_hotkey)
2746 user_handle_t window; /* handle to the window */
2747 int id; /* hotkey identifier */
2748 @REPLY
2749 unsigned int flags; /* flags of removed hotkey */
2750 unsigned int vkey; /* virtual key code of removed hotkey */
2751 @END
2754 /* Attach (or detach) thread inputs */
2755 @REQ(attach_thread_input)
2756 thread_id_t tid_from; /* thread to be attached */
2757 thread_id_t tid_to; /* thread to which tid_from should be attached */
2758 int attach; /* is it an attach? */
2759 @END
2762 /* Get input data for a given thread */
2763 @REQ(get_thread_input)
2764 thread_id_t tid; /* id of thread */
2765 @REPLY
2766 user_handle_t focus; /* handle to the focus window */
2767 user_handle_t capture; /* handle to the capture window */
2768 user_handle_t active; /* handle to the active window */
2769 user_handle_t foreground; /* handle to the global foreground window */
2770 user_handle_t menu_owner; /* handle to the menu owner */
2771 user_handle_t move_size; /* handle to the moving/resizing window */
2772 user_handle_t caret; /* handle to the caret window */
2773 user_handle_t cursor; /* handle to the cursor */
2774 int show_count; /* cursor show count */
2775 rectangle_t rect; /* caret rectangle */
2776 @END
2779 /* Get the time of the last input event */
2780 @REQ(get_last_input_time)
2781 @REPLY
2782 unsigned int time;
2783 @END
2786 /* Retrieve queue keyboard state for a given thread */
2787 @REQ(get_key_state)
2788 thread_id_t tid; /* id of thread */
2789 int key; /* optional key code or -1 */
2790 @REPLY
2791 unsigned char state; /* state of specified key */
2792 VARARG(keystate,bytes); /* state array for all the keys */
2793 @END
2795 /* Set queue keyboard state for a given thread */
2796 @REQ(set_key_state)
2797 thread_id_t tid; /* id of thread */
2798 int async; /* whether to change the async state too */
2799 VARARG(keystate,bytes); /* state array for all the keys */
2800 @END
2802 /* Set the system foreground window */
2803 @REQ(set_foreground_window)
2804 user_handle_t handle; /* handle to the foreground window */
2805 @REPLY
2806 user_handle_t previous; /* handle to the previous foreground window */
2807 int send_msg_old; /* whether we have to send a msg to the old window */
2808 int send_msg_new; /* whether we have to send a msg to the new window */
2809 @END
2811 /* Set the current thread focus window */
2812 @REQ(set_focus_window)
2813 user_handle_t handle; /* handle to the focus window */
2814 @REPLY
2815 user_handle_t previous; /* handle to the previous focus window */
2816 @END
2818 /* Set the current thread active window */
2819 @REQ(set_active_window)
2820 user_handle_t handle; /* handle to the active window */
2821 @REPLY
2822 user_handle_t previous; /* handle to the previous active window */
2823 @END
2825 /* Set the current thread capture window */
2826 @REQ(set_capture_window)
2827 user_handle_t handle; /* handle to the capture window */
2828 unsigned int flags; /* capture flags (see below) */
2829 @REPLY
2830 user_handle_t previous; /* handle to the previous capture window */
2831 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2832 @END
2833 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2834 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2837 /* Set the current thread caret window */
2838 @REQ(set_caret_window)
2839 user_handle_t handle; /* handle to the caret window */
2840 int width; /* caret width */
2841 int height; /* caret height */
2842 @REPLY
2843 user_handle_t previous; /* handle to the previous caret window */
2844 rectangle_t old_rect; /* previous caret rectangle */
2845 int old_hide; /* previous hide count */
2846 int old_state; /* previous caret state (1=on, 0=off) */
2847 @END
2850 /* Set the current thread caret information */
2851 @REQ(set_caret_info)
2852 unsigned int flags; /* caret flags (see below) */
2853 user_handle_t handle; /* handle to the caret window */
2854 int x; /* caret x position */
2855 int y; /* caret y position */
2856 int hide; /* increment for hide count (can be negative to show it) */
2857 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2858 @REPLY
2859 user_handle_t full_handle; /* handle to the current caret window */
2860 rectangle_t old_rect; /* previous caret rectangle */
2861 int old_hide; /* previous hide count */
2862 int old_state; /* previous caret state (1=on, 0=off) */
2863 @END
2864 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2865 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2866 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2869 /* Set a window hook */
2870 @REQ(set_hook)
2871 int id; /* id of the hook */
2872 process_id_t pid; /* id of process to set the hook into */
2873 thread_id_t tid; /* id of thread to set the hook into */
2874 int event_min;
2875 int event_max;
2876 client_ptr_t proc; /* hook procedure */
2877 int flags;
2878 int unicode; /* is it a unicode hook? */
2879 VARARG(module,unicode_str); /* module name */
2880 @REPLY
2881 user_handle_t handle; /* handle to the hook */
2882 unsigned int active_hooks; /* active hooks bitmap */
2883 @END
2886 /* Remove a window hook */
2887 @REQ(remove_hook)
2888 user_handle_t handle; /* handle to the hook */
2889 client_ptr_t proc; /* hook procedure if handle is 0 */
2890 int id; /* id of the hook if handle is 0 */
2891 @REPLY
2892 unsigned int active_hooks; /* active hooks bitmap */
2893 @END
2896 /* Start calling a hook chain */
2897 @REQ(start_hook_chain)
2898 int id; /* id of the hook */
2899 int event; /* signalled event */
2900 user_handle_t window; /* handle to the event window */
2901 int object_id; /* object id for out of context winevent */
2902 int child_id; /* child id for out of context winevent */
2903 @REPLY
2904 user_handle_t handle; /* handle to the next hook */
2905 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2906 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2907 int unicode; /* is it a unicode hook? */
2908 client_ptr_t proc; /* hook procedure */
2909 unsigned int active_hooks; /* active hooks bitmap */
2910 VARARG(module,unicode_str); /* module name */
2911 @END
2914 /* Finished calling a hook chain */
2915 @REQ(finish_hook_chain)
2916 int id; /* id of the hook */
2917 @END
2920 /* Get the hook information */
2921 @REQ(get_hook_info)
2922 user_handle_t handle; /* handle to the current hook */
2923 int get_next; /* do we want info about current or next hook? */
2924 int event; /* signalled event */
2925 user_handle_t window; /* handle to the event window */
2926 int object_id; /* object id for out of context winevent */
2927 int child_id; /* child id for out of context winevent */
2928 @REPLY
2929 user_handle_t handle; /* handle to the hook */
2930 int id; /* id of the hook */
2931 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2932 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2933 client_ptr_t proc; /* hook procedure */
2934 int unicode; /* is it a unicode hook? */
2935 VARARG(module,unicode_str); /* module name */
2936 @END
2939 /* Create a window class */
2940 @REQ(create_class)
2941 int local; /* is it a local class? */
2942 atom_t atom; /* class atom */
2943 unsigned int style; /* class style */
2944 mod_handle_t instance; /* module instance */
2945 int extra; /* number of extra class bytes */
2946 int win_extra; /* number of window extra bytes */
2947 client_ptr_t client_ptr; /* pointer to class in client address space */
2948 VARARG(name,unicode_str); /* class name */
2949 @REPLY
2950 atom_t atom; /* resulting class atom */
2951 @END
2954 /* Destroy a window class */
2955 @REQ(destroy_class)
2956 atom_t atom; /* class atom */
2957 mod_handle_t instance; /* module instance */
2958 VARARG(name,unicode_str); /* class name */
2959 @REPLY
2960 client_ptr_t client_ptr; /* pointer to class in client address space */
2961 @END
2964 /* Set some information in a class */
2965 @REQ(set_class_info)
2966 user_handle_t window; /* handle to the window */
2967 unsigned int flags; /* flags for info to set (see below) */
2968 atom_t atom; /* class atom */
2969 unsigned int style; /* class style */
2970 int win_extra; /* number of window extra bytes */
2971 mod_handle_t instance; /* module instance */
2972 int extra_offset; /* offset to set in extra bytes */
2973 data_size_t extra_size; /* size to set in extra bytes */
2974 lparam_t extra_value; /* value to set in extra bytes */
2975 @REPLY
2976 atom_t old_atom; /* previous class atom */
2977 unsigned int old_style; /* previous class style */
2978 int old_extra; /* previous number of class extra bytes */
2979 int old_win_extra; /* previous number of window extra bytes */
2980 mod_handle_t old_instance; /* previous module instance */
2981 lparam_t old_extra_value; /* old value in extra bytes */
2982 @END
2983 #define SET_CLASS_ATOM 0x0001
2984 #define SET_CLASS_STYLE 0x0002
2985 #define SET_CLASS_WINEXTRA 0x0004
2986 #define SET_CLASS_INSTANCE 0x0008
2987 #define SET_CLASS_EXTRA 0x0010
2990 /* Set/get clipboard information */
2991 @REQ(set_clipboard_info)
2992 unsigned int flags; /* flags for fields to set (see below) */
2993 user_handle_t clipboard; /* clipboard window */
2994 user_handle_t owner; /* clipboard owner */
2995 user_handle_t viewer; /* first clipboard viewer */
2996 unsigned int seqno; /* change sequence number */
2997 @REPLY
2998 unsigned int flags; /* status flags (see below) */
2999 user_handle_t old_clipboard; /* old clipboard window */
3000 user_handle_t old_owner; /* old clipboard owner */
3001 user_handle_t old_viewer; /* old clipboard viewer */
3002 unsigned int seqno; /* current sequence number */
3003 @END
3005 #define SET_CB_OPEN 0x001
3006 #define SET_CB_OWNER 0x002
3007 #define SET_CB_VIEWER 0x004
3008 #define SET_CB_SEQNO 0x008
3009 #define SET_CB_RELOWNER 0x010
3010 #define SET_CB_CLOSE 0x020
3011 #define CB_OPEN 0x040
3012 #define CB_OWNER 0x080
3013 #define CB_PROCESS 0x100
3016 /* Open a security token */
3017 @REQ(open_token)
3018 obj_handle_t handle; /* handle to the thread or process */
3019 unsigned int access; /* access rights to the new token */
3020 unsigned int attributes;/* object attributes */
3021 unsigned int flags; /* flags (see below) */
3022 @REPLY
3023 obj_handle_t token; /* handle to the token */
3024 @END
3025 #define OPEN_TOKEN_THREAD 1
3026 #define OPEN_TOKEN_AS_SELF 2
3029 /* Set/get the global windows */
3030 @REQ(set_global_windows)
3031 unsigned int flags; /* flags for fields to set (see below) */
3032 user_handle_t shell_window; /* handle to the new shell window */
3033 user_handle_t shell_listview; /* handle to the new shell listview window */
3034 user_handle_t progman_window; /* handle to the new program manager window */
3035 user_handle_t taskman_window; /* handle to the new task manager window */
3036 @REPLY
3037 user_handle_t old_shell_window; /* handle to the shell window */
3038 user_handle_t old_shell_listview; /* handle to the shell listview window */
3039 user_handle_t old_progman_window; /* handle to the new program manager window */
3040 user_handle_t old_taskman_window; /* handle to the new task manager window */
3041 @END
3042 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
3043 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
3044 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
3046 /* Adjust the privileges held by a token */
3047 @REQ(adjust_token_privileges)
3048 obj_handle_t handle; /* handle to the token */
3049 int disable_all; /* disable all privileges? */
3050 int get_modified_state; /* get modified privileges? */
3051 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
3052 @REPLY
3053 unsigned int len; /* total length in bytes required to store token privileges */
3054 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
3055 @END
3057 /* Retrieves the set of privileges held by or available to a token */
3058 @REQ(get_token_privileges)
3059 obj_handle_t handle; /* handle to the token */
3060 @REPLY
3061 unsigned int len; /* total length in bytes required to store token privileges */
3062 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3063 @END
3065 /* Check the token has the required privileges */
3066 @REQ(check_token_privileges)
3067 obj_handle_t handle; /* handle to the token */
3068 int all_required; /* are all the privileges required for the check to succeed? */
3069 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
3070 @REPLY
3071 int has_privileges; /* does the token have the required privileges? */
3072 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3073 @END
3075 @REQ(duplicate_token)
3076 obj_handle_t handle; /* handle to the token to duplicate */
3077 unsigned int access; /* access rights to the new token */
3078 unsigned int attributes; /* object attributes */
3079 int primary; /* is the new token to be a primary one? */
3080 int impersonation_level; /* impersonation level of the new token */
3081 @REPLY
3082 obj_handle_t new_handle; /* duplicated handle */
3083 @END
3085 @REQ(access_check)
3086 obj_handle_t handle; /* handle to the token */
3087 unsigned int desired_access; /* desired access to the object */
3088 unsigned int mapping_read; /* mapping from generic read to specific rights */
3089 unsigned int mapping_write; /* mapping from generic write to specific rights */
3090 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
3091 unsigned int mapping_all; /* mapping from generic all to specific rights */
3092 VARARG(sd,security_descriptor); /* security descriptor to check */
3093 @REPLY
3094 unsigned int access_granted; /* access rights actually granted */
3095 unsigned int access_status; /* was access granted? */
3096 unsigned int privileges_len; /* length needed to store privileges */
3097 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
3098 @END
3100 @REQ(get_token_sid)
3101 obj_handle_t handle; /* handle to the token */
3102 unsigned int which_sid; /* which SID to retrieve from the token */
3103 @REPLY
3104 data_size_t sid_len; /* length needed to store sid */
3105 VARARG(sid,SID); /* the sid specified by which_sid from the token */
3106 @END
3108 @REQ(get_token_groups)
3109 obj_handle_t handle; /* handle to the token */
3110 @REPLY
3111 data_size_t user_len; /* length needed to store user */
3112 VARARG(user,token_groups); /* groups the token's user belongs to */
3113 @END
3115 @REQ(get_token_default_dacl)
3116 obj_handle_t handle; /* handle to the token */
3117 @REPLY
3118 data_size_t acl_len; /* length needed to store access control list */
3119 VARARG(acl,ACL); /* access control list */
3120 @END
3122 @REQ(set_token_default_dacl)
3123 obj_handle_t handle; /* handle to the token */
3124 VARARG(acl,ACL); /* default dacl to set */
3125 @END
3127 @REQ(set_security_object)
3128 obj_handle_t handle; /* handle to the object */
3129 unsigned int security_info; /* which parts of security descriptor to set */
3130 VARARG(sd,security_descriptor); /* security descriptor to set */
3131 @END
3133 @REQ(get_security_object)
3134 obj_handle_t handle; /* handle to the object */
3135 unsigned int security_info; /* which parts of security descriptor to get */
3136 @REPLY
3137 unsigned int sd_len; /* buffer size needed for sd */
3138 VARARG(sd,security_descriptor); /* retrieved security descriptor */
3139 @END
3141 /* Create a mailslot */
3142 @REQ(create_mailslot)
3143 unsigned int access; /* wanted access rights */
3144 unsigned int attributes; /* object attributes */
3145 obj_handle_t rootdir; /* root directory */
3146 timeout_t read_timeout;
3147 unsigned int max_msgsize;
3148 VARARG(name,unicode_str); /* mailslot name */
3149 @REPLY
3150 obj_handle_t handle; /* handle to the mailslot */
3151 @END
3154 /* Set mailslot information */
3155 @REQ(set_mailslot_info)
3156 obj_handle_t handle; /* handle to the mailslot */
3157 timeout_t read_timeout;
3158 unsigned int flags;
3159 @REPLY
3160 timeout_t read_timeout;
3161 unsigned int max_msgsize;
3162 @END
3163 #define MAILSLOT_SET_READ_TIMEOUT 1
3166 /* Create a directory object */
3167 @REQ(create_directory)
3168 unsigned int access; /* access flags */
3169 unsigned int attributes; /* object attributes */
3170 obj_handle_t rootdir; /* root directory */
3171 VARARG(directory_name,unicode_str); /* Directory name */
3172 @REPLY
3173 obj_handle_t handle; /* handle to the directory */
3174 @END
3177 /* Open a directory object */
3178 @REQ(open_directory)
3179 unsigned int access; /* access flags */
3180 unsigned int attributes; /* object attributes */
3181 obj_handle_t rootdir; /* root directory */
3182 VARARG(directory_name,unicode_str); /* Directory name */
3183 @REPLY
3184 obj_handle_t handle; /* handle to the directory */
3185 @END
3188 /* Get a directory entry by index */
3189 @REQ(get_directory_entry)
3190 obj_handle_t handle; /* handle to the directory */
3191 unsigned int index; /* entry index */
3192 @REPLY
3193 data_size_t name_len; /* length of the entry name in bytes */
3194 VARARG(name,unicode_str,name_len); /* entry name */
3195 VARARG(type,unicode_str); /* entry type */
3196 @END
3199 /* Create a symbolic link object */
3200 @REQ(create_symlink)
3201 unsigned int access; /* access flags */
3202 unsigned int attributes; /* object attributes */
3203 obj_handle_t rootdir; /* root directory */
3204 data_size_t name_len; /* length of the symlink name in bytes */
3205 VARARG(name,unicode_str,name_len); /* symlink name */
3206 VARARG(target_name,unicode_str); /* target name */
3207 @REPLY
3208 obj_handle_t handle; /* handle to the symlink */
3209 @END
3212 /* Open a symbolic link object */
3213 @REQ(open_symlink)
3214 unsigned int access; /* access flags */
3215 unsigned int attributes; /* object attributes */
3216 obj_handle_t rootdir; /* root directory */
3217 VARARG(name,unicode_str); /* symlink name */
3218 @REPLY
3219 obj_handle_t handle; /* handle to the symlink */
3220 @END
3223 /* Query a symbolic link object */
3224 @REQ(query_symlink)
3225 obj_handle_t handle; /* handle to the symlink */
3226 @REPLY
3227 data_size_t total; /* total needed size for name */
3228 VARARG(target_name,unicode_str); /* target name */
3229 @END
3232 /* Query basic object information */
3233 @REQ(get_object_info)
3234 obj_handle_t handle; /* handle to the object */
3235 @REPLY
3236 unsigned int access; /* granted access mask */
3237 unsigned int ref_count; /* object ref count */
3238 data_size_t total; /* total needed size for name */
3239 VARARG(name,unicode_str); /* object name */
3240 @END
3243 /* Unlink a named object */
3244 @REQ(unlink_object)
3245 obj_handle_t handle; /* handle to the object */
3246 @END
3249 /* Query the impersonation level of an impersonation token */
3250 @REQ(get_token_impersonation_level)
3251 obj_handle_t handle; /* handle to the object */
3252 @REPLY
3253 int impersonation_level; /* impersonation level of the impersonation token */
3254 @END
3256 /* Allocate a locally-unique identifier */
3257 @REQ(allocate_locally_unique_id)
3258 @REPLY
3259 luid_t luid;
3260 @END
3263 /* Create a device manager */
3264 @REQ(create_device_manager)
3265 unsigned int access; /* wanted access rights */
3266 unsigned int attributes; /* object attributes */
3267 @REPLY
3268 obj_handle_t handle; /* handle to the device */
3269 @END
3272 /* Create a device */
3273 @REQ(create_device)
3274 unsigned int access; /* wanted access rights */
3275 unsigned int attributes; /* object attributes */
3276 obj_handle_t rootdir; /* root directory */
3277 client_ptr_t user_ptr; /* opaque ptr for use by client */
3278 obj_handle_t manager; /* device manager */
3279 VARARG(name,unicode_str); /* object name */
3280 @REPLY
3281 obj_handle_t handle; /* handle to the device */
3282 @END
3285 /* Delete a device */
3286 @REQ(delete_device)
3287 obj_handle_t handle; /* handle to the device */
3288 @END
3291 /* Retrieve the next pending device ioctl request */
3292 @REQ(get_next_device_request)
3293 obj_handle_t manager; /* handle to the device manager */
3294 obj_handle_t prev; /* handle to the previous ioctl */
3295 unsigned int status; /* status of the previous ioctl */
3296 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3297 @REPLY
3298 obj_handle_t next; /* handle to the next ioctl */
3299 ioctl_code_t code; /* ioctl code */
3300 client_ptr_t user_ptr; /* opaque ptr for the device */
3301 process_id_t client_pid; /* pid of process calling ioctl */
3302 thread_id_t client_tid; /* tid of thread calling ioctl */
3303 data_size_t in_size; /* total needed input size */
3304 data_size_t out_size; /* needed output size */
3305 VARARG(next_data,bytes); /* input data of the next ioctl */
3306 @END
3309 /* Make the current process a system process */
3310 @REQ(make_process_system)
3311 @REPLY
3312 obj_handle_t event; /* event signaled when all user processes have exited */
3313 @END
3316 /* Get detailed fixed-size information about a token */
3317 @REQ(get_token_statistics)
3318 obj_handle_t handle; /* handle to the object */
3319 @REPLY
3320 luid_t token_id; /* locally-unique identifier of the token */
3321 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3322 int primary; /* is the token primary or impersonation? */
3323 int impersonation_level; /* level of impersonation */
3324 int group_count; /* the number of groups the token is a member of */
3325 int privilege_count; /* the number of privileges the token has */
3326 @END
3329 /* Create I/O completion port */
3330 @REQ(create_completion)
3331 unsigned int access; /* desired access to a port */
3332 unsigned int attributes; /* object attributes */
3333 unsigned int concurrent; /* max number of concurrent active threads */
3334 obj_handle_t rootdir; /* root directory */
3335 VARARG(filename,string); /* port name */
3336 @REPLY
3337 obj_handle_t handle; /* port handle */
3338 @END
3341 /* Open I/O completion port */
3342 @REQ(open_completion)
3343 unsigned int access; /* desired access to a port */
3344 unsigned int attributes; /* object attributes */
3345 obj_handle_t rootdir; /* root directory */
3346 VARARG(filename,string); /* port name */
3347 @REPLY
3348 obj_handle_t handle; /* port handle */
3349 @END
3352 /* add completion to completion port */
3353 @REQ(add_completion)
3354 obj_handle_t handle; /* port handle */
3355 apc_param_t ckey; /* completion key */
3356 apc_param_t cvalue; /* completion value */
3357 apc_param_t information; /* IO_STATUS_BLOCK Information */
3358 unsigned int status; /* completion result */
3359 @END
3362 /* get completion from completion port queue */
3363 @REQ(remove_completion)
3364 obj_handle_t handle; /* port handle */
3365 @REPLY
3366 apc_param_t ckey; /* completion key */
3367 apc_param_t cvalue; /* completion value */
3368 apc_param_t information; /* IO_STATUS_BLOCK Information */
3369 unsigned int status; /* completion result */
3370 @END
3373 /* get completion queue depth */
3374 @REQ(query_completion)
3375 obj_handle_t handle; /* port handle */
3376 @REPLY
3377 unsigned int depth; /* completion queue depth */
3378 @END
3381 /* associate object with completion port */
3382 @REQ(set_completion_info)
3383 obj_handle_t handle; /* object handle */
3384 apc_param_t ckey; /* completion key */
3385 obj_handle_t chandle; /* port handle */
3386 @END
3389 /* check for associated completion and push msg */
3390 @REQ(add_fd_completion)
3391 obj_handle_t handle; /* async' object */
3392 apc_param_t cvalue; /* completion value */
3393 apc_param_t information; /* IO_STATUS_BLOCK Information */
3394 unsigned int status; /* completion status */
3395 @END
3398 /* Retrieve layered info for a window */
3399 @REQ(get_window_layered_info)
3400 user_handle_t handle; /* handle to the window */
3401 @REPLY
3402 unsigned int color_key; /* color key */
3403 unsigned int alpha; /* alpha (0..255) */
3404 unsigned int flags; /* LWA_* flags */
3405 @END
3408 /* Set layered info for a window */
3409 @REQ(set_window_layered_info)
3410 user_handle_t handle; /* handle to the window */
3411 unsigned int color_key; /* color key */
3412 unsigned int alpha; /* alpha (0..255) */
3413 unsigned int flags; /* LWA_* flags */
3414 @END
3417 /* Allocate an arbitrary user handle */
3418 @REQ(alloc_user_handle)
3419 @REPLY
3420 user_handle_t handle; /* allocated handle */
3421 @END
3424 /* Free an arbitrary user handle */
3425 @REQ(free_user_handle)
3426 user_handle_t handle; /* handle to free*/
3427 @END
3430 /* Set/get the current cursor */
3431 @REQ(set_cursor)
3432 unsigned int flags; /* flags for fields to set (see below) */
3433 user_handle_t handle; /* handle to the cursor */
3434 int show_count; /* show count increment/decrement */
3435 int x; /* cursor position */
3436 int y;
3437 rectangle_t clip; /* cursor clip rectangle */
3438 unsigned int clip_msg; /* message to post on cursor clip changes */
3439 @REPLY
3440 user_handle_t prev_handle; /* previous handle */
3441 int prev_count; /* previous show count */
3442 int prev_x; /* previous position */
3443 int prev_y;
3444 int new_x; /* new position */
3445 int new_y;
3446 rectangle_t new_clip; /* new clip rectangle */
3447 unsigned int last_change; /* time of last position change */
3448 @END
3449 #define SET_CURSOR_HANDLE 0x01
3450 #define SET_CURSOR_COUNT 0x02
3451 #define SET_CURSOR_POS 0x04
3452 #define SET_CURSOR_CLIP 0x08
3453 #define SET_CURSOR_NOCLIP 0x10
3456 /* Modify the list of registered rawinput devices */
3457 @REQ(update_rawinput_devices)
3458 VARARG(devices,rawinput_devices);
3459 @END
3462 /* Retrieve the suspended context of a thread */
3463 @REQ(get_suspend_context)
3464 @REPLY
3465 VARARG(context,context); /* thread context */
3466 @END
3469 /* Store the suspend context of a thread */
3470 @REQ(set_suspend_context)
3471 VARARG(context,context); /* thread context */
3472 @END