msvcr100/tests: Add _SpinWait tests.
[wine.git] / server / protocol.def
blob61b9ed51cea3b7abdf73ec093e5b38b01a6c1ab4
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; /* RIP_EVENT */
134 int error; /* ??? */
135 int type; /* ??? */
136 } rip_info;
137 } debug_event_t;
139 /* supported CPU types */
140 enum cpu_type
142 CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64
144 typedef int cpu_type_t;
146 /* context data */
147 typedef struct
149 cpu_type_t cpu; /* cpu type */
150 unsigned int flags; /* SERVER_CTX_* flags */
151 union
153 struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
154 struct { unsigned __int64 rip, rbp, rsp;
155 unsigned int cs, ss, flags, __pad; } x86_64_regs;
156 struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc_regs;
157 struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
158 struct { unsigned __int64 sp, pc, pstate; } arm64_regs;
159 } ctl; /* selected by SERVER_CTX_CONTROL */
160 union
162 struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
163 struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
164 r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
165 struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
166 struct { unsigned int r[13]; } arm_regs;
167 struct { unsigned __int64 x[31]; } arm64_regs;
168 } integer; /* selected by SERVER_CTX_INTEGER */
169 union
171 struct { unsigned int ds, es, fs, gs; } i386_regs;
172 struct { unsigned int ds, es, fs, gs; } x86_64_regs;
173 } seg; /* selected by SERVER_CTX_SEGMENTS */
174 union
176 struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
177 unsigned char regs[80]; } i386_regs;
178 struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
179 struct { double fpr[32], fpscr; } powerpc_regs;
180 } fp; /* selected by SERVER_CTX_FLOATING_POINT */
181 union
183 struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
184 struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
185 struct { unsigned int dr[8]; } powerpc_regs;
186 } debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
187 union
189 unsigned char i386_regs[512];
190 } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */
191 } context_t;
193 #define SERVER_CTX_CONTROL 0x01
194 #define SERVER_CTX_INTEGER 0x02
195 #define SERVER_CTX_SEGMENTS 0x04
196 #define SERVER_CTX_FLOATING_POINT 0x08
197 #define SERVER_CTX_DEBUG_REGISTERS 0x10
198 #define SERVER_CTX_EXTENDED_REGISTERS 0x20
200 /* structure used in sending an fd from client to server */
201 struct send_fd
203 thread_id_t tid; /* thread id */
204 int fd; /* file descriptor on client-side */
207 /* structure sent by the server on the wait fifo */
208 struct wake_up_reply
210 client_ptr_t cookie; /* magic cookie that was passed in select_request */
211 int signaled; /* wait result */
212 int __pad;
215 /* NT-style timeout, in 100ns units, negative means relative timeout */
216 typedef __int64 timeout_t;
217 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
219 /* structure for process startup info */
220 typedef struct
222 unsigned int debug_flags;
223 unsigned int console_flags;
224 obj_handle_t console;
225 obj_handle_t hstdin;
226 obj_handle_t hstdout;
227 obj_handle_t hstderr;
228 unsigned int x;
229 unsigned int y;
230 unsigned int xsize;
231 unsigned int ysize;
232 unsigned int xchars;
233 unsigned int ychars;
234 unsigned int attribute;
235 unsigned int flags;
236 unsigned int show;
237 data_size_t curdir_len;
238 data_size_t dllpath_len;
239 data_size_t imagepath_len;
240 data_size_t cmdline_len;
241 data_size_t title_len;
242 data_size_t desktop_len;
243 data_size_t shellinfo_len;
244 data_size_t runtime_len;
245 /* VARARG(curdir,unicode_str,curdir_len); */
246 /* VARARG(dllpath,unicode_str,dllpath_len); */
247 /* VARARG(imagepath,unicode_str,imagepath_len); */
248 /* VARARG(cmdline,unicode_str,cmdline_len); */
249 /* VARARG(title,unicode_str,title_len); */
250 /* VARARG(desktop,unicode_str,desktop_len); */
251 /* VARARG(shellinfo,unicode_str,shellinfo_len); */
252 /* VARARG(runtime,unicode_str,runtime_len); */
253 } startup_info_t;
255 /* structure returned in the list of window properties */
256 typedef struct
258 atom_t atom; /* property atom */
259 int string; /* was atom a string originally? */
260 lparam_t data; /* data stored in property */
261 } property_data_t;
263 /* structure to specify window rectangles */
264 typedef struct
266 int left;
267 int top;
268 int right;
269 int bottom;
270 } rectangle_t;
272 /* structure for parameters of async I/O calls */
273 typedef struct
275 obj_handle_t handle; /* object to perform I/O on */
276 obj_handle_t event; /* event to signal when done */
277 client_ptr_t callback; /* client-side callback to call upon end of async */
278 client_ptr_t iosb; /* I/O status block in client addr space */
279 client_ptr_t arg; /* opaque user data to pass to callback */
280 apc_param_t cvalue; /* completion value to use for completion events */
281 } async_data_t;
283 /* structures for extra message data */
285 struct hardware_msg_data
287 lparam_t info; /* extra info */
288 int x; /* x position */
289 int y; /* y position */
290 unsigned int hw_id; /* unique id */
291 unsigned int flags; /* hook flags */
292 union
294 int type;
295 struct
297 int type; /* RIM_TYPEKEYBOARD */
298 unsigned int message; /* message generated by this rawinput event */
299 unsigned short vkey; /* virtual key code */
300 unsigned short scan; /* scan code */
301 } kbd;
302 struct
304 int type; /* RIM_TYPEMOUSE */
305 int x; /* x coordinate */
306 int y; /* y coordinate */
307 unsigned int data; /* mouse data */
308 } mouse;
309 } rawinput;
312 struct callback_msg_data
314 client_ptr_t callback; /* callback function */
315 lparam_t data; /* user data for callback */
316 lparam_t result; /* message result */
319 struct winevent_msg_data
321 user_handle_t hook; /* hook handle */
322 thread_id_t tid; /* thread id */
323 client_ptr_t hook_proc; /* hook proc address */
324 /* followed by module name if any */
327 typedef union
329 int type;
330 struct
332 int type; /* INPUT_KEYBOARD */
333 unsigned short vkey; /* virtual key code */
334 unsigned short scan; /* scan code */
335 unsigned int flags; /* event flags */
336 unsigned int time; /* event time */
337 lparam_t info; /* extra info */
338 } kbd;
339 struct
341 int type; /* INPUT_MOUSE */
342 int x; /* coordinates */
343 int y;
344 unsigned int data; /* mouse data */
345 unsigned int flags; /* event flags */
346 unsigned int time; /* event time */
347 lparam_t info; /* extra info */
348 } mouse;
349 struct
351 int type; /* INPUT_HARDWARE */
352 unsigned int msg; /* message code */
353 lparam_t lparam; /* message param */
354 } hw;
355 } hw_input_t;
357 typedef union
359 unsigned char bytes[1]; /* raw data for sent messages */
360 struct hardware_msg_data hardware;
361 struct callback_msg_data callback;
362 struct winevent_msg_data winevent;
363 } message_data_t;
365 /* structure for console char/attribute info */
366 typedef struct
368 WCHAR ch;
369 unsigned short attr;
370 } char_info_t;
372 /* structure returned in filesystem events */
373 struct filesystem_event
375 int action;
376 data_size_t len;
377 char name[1];
380 typedef struct
382 unsigned int low_part;
383 int high_part;
384 } luid_t;
386 #define MAX_ACL_LEN 65535
388 struct security_descriptor
390 unsigned int control; /* SE_ flags */
391 data_size_t owner_len;
392 data_size_t group_len;
393 data_size_t sacl_len;
394 data_size_t dacl_len;
395 /* VARARG(owner,SID); */
396 /* VARARG(group,SID); */
397 /* VARARG(sacl,ACL); */
398 /* VARARG(dacl,ACL); */
401 struct object_attributes
403 obj_handle_t rootdir; /* root directory */
404 data_size_t sd_len; /* length of security_descriptor data. may be 0 */
405 data_size_t name_len; /* length of the name string. may be 0 */
406 /* VARARG(sd,security_descriptor); */
407 /* VARARG(name,unicode_str); */
410 struct token_groups
412 unsigned int count;
413 /* unsigned int attributes[count]; */
414 /* VARARG(sids,SID); */
417 enum select_op
419 SELECT_NONE,
420 SELECT_WAIT,
421 SELECT_WAIT_ALL,
422 SELECT_SIGNAL_AND_WAIT,
423 SELECT_KEYED_EVENT_WAIT,
424 SELECT_KEYED_EVENT_RELEASE
427 typedef union
429 enum select_op op;
430 struct
432 enum select_op op; /* SELECT_WAIT or SELECT_WAIT_ALL */
433 obj_handle_t handles[MAXIMUM_WAIT_OBJECTS];
434 } wait;
435 struct
437 enum select_op op; /* SELECT_SIGNAL_AND_WAIT */
438 obj_handle_t wait;
439 obj_handle_t signal; /* must be last in the structure so we can remove it on retries */
440 } signal_and_wait;
441 struct
443 enum select_op op; /* SELECT_KEYED_EVENT_WAIT or SELECT_KEYED_EVENT_RELEASE */
444 obj_handle_t handle;
445 client_ptr_t key;
446 } keyed_event;
447 } select_op_t;
449 enum apc_type
451 APC_NONE,
452 APC_USER,
453 APC_TIMER,
454 APC_ASYNC_IO,
455 APC_VIRTUAL_ALLOC,
456 APC_VIRTUAL_FREE,
457 APC_VIRTUAL_QUERY,
458 APC_VIRTUAL_PROTECT,
459 APC_VIRTUAL_FLUSH,
460 APC_VIRTUAL_LOCK,
461 APC_VIRTUAL_UNLOCK,
462 APC_MAP_VIEW,
463 APC_UNMAP_VIEW,
464 APC_CREATE_THREAD
467 typedef union
469 enum apc_type type;
470 struct
472 enum apc_type type; /* APC_USER */
473 int __pad;
474 client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
475 apc_param_t args[3]; /* arguments for user function */
476 } user;
477 struct
479 enum apc_type type; /* APC_TIMER */
480 int __pad;
481 client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
482 timeout_t time; /* absolute time of expiration */
483 client_ptr_t arg; /* user argument */
484 } timer;
485 struct
487 enum apc_type type; /* APC_ASYNC_IO */
488 unsigned int status; /* I/O status */
489 client_ptr_t func; /* unsigned int (*func)(void*, void*, unsigned int, void **); */
490 client_ptr_t user; /* user pointer */
491 client_ptr_t sb; /* status block */
492 } async_io;
493 struct
495 enum apc_type type; /* APC_VIRTUAL_ALLOC */
496 unsigned int op_type; /* type of operation */
497 client_ptr_t addr; /* requested address */
498 mem_size_t size; /* allocation size */
499 unsigned int zero_bits; /* allocation alignment */
500 unsigned int prot; /* memory protection flags */
501 } virtual_alloc;
502 struct
504 enum apc_type type; /* APC_VIRTUAL_FREE */
505 unsigned int op_type; /* type of operation */
506 client_ptr_t addr; /* requested address */
507 mem_size_t size; /* allocation size */
508 } virtual_free;
509 struct
511 enum apc_type type; /* APC_VIRTUAL_QUERY */
512 int __pad;
513 client_ptr_t addr; /* requested address */
514 } virtual_query;
515 struct
517 enum apc_type type; /* APC_VIRTUAL_PROTECT */
518 unsigned int prot; /* new protection flags */
519 client_ptr_t addr; /* requested address */
520 mem_size_t size; /* requested size */
521 } virtual_protect;
522 struct
524 enum apc_type type; /* APC_VIRTUAL_FLUSH */
525 int __pad;
526 client_ptr_t addr; /* requested address */
527 mem_size_t size; /* requested size */
528 } virtual_flush;
529 struct
531 enum apc_type type; /* APC_VIRTUAL_LOCK */
532 int __pad;
533 client_ptr_t addr; /* requested address */
534 mem_size_t size; /* requested size */
535 } virtual_lock;
536 struct
538 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
539 int __pad;
540 client_ptr_t addr; /* requested address */
541 mem_size_t size; /* requested size */
542 } virtual_unlock;
543 struct
545 enum apc_type type; /* APC_MAP_VIEW */
546 obj_handle_t handle; /* mapping handle */
547 client_ptr_t addr; /* requested address */
548 mem_size_t size; /* allocation size */
549 file_pos_t offset; /* file offset */
550 unsigned int alloc_type;/* allocation type */
551 unsigned short zero_bits; /* allocation alignment */
552 unsigned short prot; /* memory protection flags */
553 } map_view;
554 struct
556 enum apc_type type; /* APC_UNMAP_VIEW */
557 int __pad;
558 client_ptr_t addr; /* view address */
559 } unmap_view;
560 struct
562 enum apc_type type; /* APC_CREATE_THREAD */
563 int suspend; /* suspended thread? */
564 client_ptr_t func; /* void (__stdcall *func)(void*); start function */
565 client_ptr_t arg; /* argument for start function */
566 mem_size_t reserve; /* reserve size for thread stack */
567 mem_size_t commit; /* commit size for thread stack */
568 } create_thread;
569 } apc_call_t;
571 typedef union
573 enum apc_type type;
574 struct
576 enum apc_type type; /* APC_ASYNC_IO */
577 unsigned int status; /* new status of async operation */
578 client_ptr_t apc; /* user APC to call */
579 unsigned int total; /* bytes transferred */
580 } async_io;
581 struct
583 enum apc_type type; /* APC_VIRTUAL_ALLOC */
584 unsigned int status; /* status returned by call */
585 client_ptr_t addr; /* resulting address */
586 mem_size_t size; /* resulting size */
587 } virtual_alloc;
588 struct
590 enum apc_type type; /* APC_VIRTUAL_FREE */
591 unsigned int status; /* status returned by call */
592 client_ptr_t addr; /* resulting address */
593 mem_size_t size; /* resulting size */
594 } virtual_free;
595 struct
597 enum apc_type type; /* APC_VIRTUAL_QUERY */
598 unsigned int status; /* status returned by call */
599 client_ptr_t base; /* resulting base address */
600 client_ptr_t alloc_base;/* resulting allocation base */
601 mem_size_t size; /* resulting region size */
602 unsigned short state; /* resulting region state */
603 unsigned short prot; /* resulting region protection */
604 unsigned short alloc_prot;/* resulting allocation protection */
605 unsigned short alloc_type;/* resulting region allocation type */
606 } virtual_query;
607 struct
609 enum apc_type type; /* APC_VIRTUAL_PROTECT */
610 unsigned int status; /* status returned by call */
611 client_ptr_t addr; /* resulting address */
612 mem_size_t size; /* resulting size */
613 unsigned int prot; /* old protection flags */
614 } virtual_protect;
615 struct
617 enum apc_type type; /* APC_VIRTUAL_FLUSH */
618 unsigned int status; /* status returned by call */
619 client_ptr_t addr; /* resulting address */
620 mem_size_t size; /* resulting size */
621 } virtual_flush;
622 struct
624 enum apc_type type; /* APC_VIRTUAL_LOCK */
625 unsigned int status; /* status returned by call */
626 client_ptr_t addr; /* resulting address */
627 mem_size_t size; /* resulting size */
628 } virtual_lock;
629 struct
631 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
632 unsigned int status; /* status returned by call */
633 client_ptr_t addr; /* resulting address */
634 mem_size_t size; /* resulting size */
635 } virtual_unlock;
636 struct
638 enum apc_type type; /* APC_MAP_VIEW */
639 unsigned int status; /* status returned by call */
640 client_ptr_t addr; /* resulting address */
641 mem_size_t size; /* resulting size */
642 } map_view;
643 struct
645 enum apc_type type; /* APC_MAP_VIEW */
646 unsigned int status; /* status returned by call */
647 } unmap_view;
648 struct
650 enum apc_type type; /* APC_CREATE_THREAD */
651 unsigned int status; /* status returned by call */
652 thread_id_t tid; /* thread id */
653 obj_handle_t handle; /* handle to new thread */
654 } create_thread;
655 } apc_result_t;
657 struct rawinput_device
659 unsigned short usage_page;
660 unsigned short usage;
661 unsigned int flags;
662 user_handle_t target;
665 /****************************************************************/
666 /* Request declarations */
668 /* Create a new process from the context of the parent */
669 @REQ(new_process)
670 int inherit_all; /* inherit all handles from parent */
671 unsigned int create_flags; /* creation flags */
672 int socket_fd; /* file descriptor for process socket */
673 obj_handle_t exe_file; /* file handle for main exe */
674 unsigned int process_access; /* access rights for process object */
675 unsigned int process_attr; /* attributes for process object */
676 unsigned int thread_access; /* access rights for thread object */
677 unsigned int thread_attr; /* attributes for thread object */
678 cpu_type_t cpu; /* CPU that the new process will use */
679 data_size_t info_size; /* size of startup info */
680 VARARG(info,startup_info,info_size); /* startup information */
681 VARARG(env,unicode_str); /* environment for new process */
682 @REPLY
683 obj_handle_t info; /* new process info handle */
684 process_id_t pid; /* process id */
685 obj_handle_t phandle; /* process handle (in the current process) */
686 thread_id_t tid; /* thread id */
687 obj_handle_t thandle; /* thread handle (in the current process) */
688 @END
691 /* Retrieve information about a newly started process */
692 @REQ(get_new_process_info)
693 obj_handle_t info; /* info handle returned from new_process_request */
694 @REPLY
695 int success; /* did the process start successfully? */
696 int exit_code; /* process exit code if failed */
697 @END
700 /* Create a new thread from the context of the parent */
701 @REQ(new_thread)
702 unsigned int access; /* wanted access rights */
703 unsigned int attributes; /* object attributes */
704 int suspend; /* new thread should be suspended on creation */
705 int request_fd; /* fd for request pipe */
706 @REPLY
707 thread_id_t tid; /* thread id */
708 obj_handle_t handle; /* thread handle (in the current process) */
709 @END
712 /* Retrieve the new process startup info */
713 @REQ(get_startup_info)
714 @REPLY
715 obj_handle_t exe_file; /* file handle for main exe */
716 data_size_t info_size; /* size of startup info */
717 VARARG(info,startup_info,info_size); /* startup information */
718 VARARG(env,unicode_str); /* environment */
719 @END
722 /* Signal the end of the process initialization */
723 @REQ(init_process_done)
724 int gui; /* is it a GUI process? */
725 mod_handle_t module; /* main module base address */
726 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
727 client_ptr_t entry; /* process entry point */
728 @END
731 /* Initialize a thread; called from the child after fork()/clone() */
732 @REQ(init_thread)
733 int unix_pid; /* Unix pid of new thread */
734 int unix_tid; /* Unix tid of new thread */
735 int debug_level; /* new debug level */
736 client_ptr_t teb; /* TEB of new thread (in thread address space) */
737 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
738 int reply_fd; /* fd for reply pipe */
739 int wait_fd; /* fd for blocking calls pipe */
740 cpu_type_t cpu; /* CPU that this thread is running on */
741 @REPLY
742 process_id_t pid; /* process id of the new thread's process */
743 thread_id_t tid; /* thread id of the new thread */
744 timeout_t server_start; /* server start time */
745 data_size_t info_size; /* total size of startup info */
746 int version; /* protocol version */
747 unsigned int all_cpus; /* bitset of supported CPUs */
748 @END
751 /* Terminate a process */
752 @REQ(terminate_process)
753 obj_handle_t handle; /* process handle to terminate */
754 int exit_code; /* process exit code */
755 @REPLY
756 int self; /* suicide? */
757 @END
760 /* Terminate a thread */
761 @REQ(terminate_thread)
762 obj_handle_t handle; /* thread handle to terminate */
763 int exit_code; /* thread exit code */
764 @REPLY
765 int self; /* suicide? */
766 int last; /* last thread in this process? */
767 @END
770 /* Retrieve information about a process */
771 @REQ(get_process_info)
772 obj_handle_t handle; /* process handle */
773 @REPLY
774 process_id_t pid; /* server process id */
775 process_id_t ppid; /* server process id of parent */
776 affinity_t affinity; /* process affinity mask */
777 client_ptr_t peb; /* PEB address in process address space */
778 timeout_t start_time; /* process start time */
779 timeout_t end_time; /* process end time */
780 int exit_code; /* process exit code */
781 int priority; /* priority class */
782 cpu_type_t cpu; /* CPU that this process is running on */
783 int debugger_present; /* process is being debugged */
784 @END
787 /* Set a process information */
788 @REQ(set_process_info)
789 obj_handle_t handle; /* process handle */
790 int mask; /* setting mask (see below) */
791 int priority; /* priority class */
792 affinity_t affinity; /* affinity mask */
793 @END
794 #define SET_PROCESS_INFO_PRIORITY 0x01
795 #define SET_PROCESS_INFO_AFFINITY 0x02
798 /* Retrieve information about a thread */
799 @REQ(get_thread_info)
800 obj_handle_t handle; /* thread handle */
801 thread_id_t tid_in; /* thread id (optional) */
802 @REPLY
803 process_id_t pid; /* server process id */
804 thread_id_t tid; /* server thread id */
805 client_ptr_t teb; /* thread teb pointer */
806 affinity_t affinity; /* thread affinity mask */
807 timeout_t creation_time; /* thread creation time */
808 timeout_t exit_time; /* thread exit time */
809 int exit_code; /* thread exit code */
810 int priority; /* thread priority level */
811 int last; /* last thread in process */
812 @END
815 /* Set a thread information */
816 @REQ(set_thread_info)
817 obj_handle_t handle; /* thread handle */
818 int mask; /* setting mask (see below) */
819 int priority; /* priority class */
820 affinity_t affinity; /* affinity mask */
821 obj_handle_t token; /* impersonation token */
822 @END
823 #define SET_THREAD_INFO_PRIORITY 0x01
824 #define SET_THREAD_INFO_AFFINITY 0x02
825 #define SET_THREAD_INFO_TOKEN 0x04
828 /* Retrieve information about a module */
829 @REQ(get_dll_info)
830 obj_handle_t handle; /* process handle */
831 mod_handle_t base_address; /* base address of module */
832 @REPLY
833 client_ptr_t entry_point;
834 data_size_t size; /* module size */
835 data_size_t filename_len; /* buffer len in bytes required to store filename */
836 VARARG(filename,unicode_str); /* file name of module */
837 @END
840 /* Suspend a thread */
841 @REQ(suspend_thread)
842 obj_handle_t handle; /* thread handle */
843 @REPLY
844 int count; /* new suspend count */
845 @END
848 /* Resume a thread */
849 @REQ(resume_thread)
850 obj_handle_t handle; /* thread handle */
851 @REPLY
852 int count; /* new suspend count */
853 @END
856 /* Notify the server that a dll has been loaded */
857 @REQ(load_dll)
858 obj_handle_t mapping; /* file mapping handle */
859 mod_handle_t base; /* base address */
860 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
861 data_size_t size; /* dll size */
862 int dbg_offset; /* debug info offset */
863 int dbg_size; /* debug info size */
864 VARARG(filename,unicode_str); /* file name of dll */
865 @END
868 /* Notify the server that a dll is being unloaded */
869 @REQ(unload_dll)
870 mod_handle_t base; /* base address */
871 @END
874 /* Queue an APC for a thread or process */
875 @REQ(queue_apc)
876 obj_handle_t handle; /* thread or process handle */
877 apc_call_t call; /* call arguments */
878 @REPLY
879 obj_handle_t handle; /* APC handle */
880 int self; /* run APC in caller itself? */
881 @END
884 /* Get the result of an APC call */
885 @REQ(get_apc_result)
886 obj_handle_t handle; /* handle to the APC */
887 @REPLY
888 apc_result_t result; /* result of the APC */
889 @END
892 /* Close a handle for the current process */
893 @REQ(close_handle)
894 obj_handle_t handle; /* handle to close */
895 @END
898 /* Set a handle information */
899 @REQ(set_handle_info)
900 obj_handle_t handle; /* handle we are interested in */
901 int flags; /* new handle flags */
902 int mask; /* mask for flags to set */
903 @REPLY
904 int old_flags; /* old flag value */
905 @END
908 /* Duplicate a handle */
909 @REQ(dup_handle)
910 obj_handle_t src_process; /* src process handle */
911 obj_handle_t src_handle; /* src handle to duplicate */
912 obj_handle_t dst_process; /* dst process handle */
913 unsigned int access; /* wanted access rights */
914 unsigned int attributes; /* object attributes */
915 unsigned int options; /* duplicate options (see below) */
916 @REPLY
917 obj_handle_t handle; /* duplicated handle in dst process */
918 int self; /* is the source the current process? */
919 int closed; /* whether the source handle has been closed */
920 @END
921 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
922 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
923 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
926 /* Open a handle to a process */
927 @REQ(open_process)
928 process_id_t pid; /* process id to open */
929 unsigned int access; /* wanted access rights */
930 unsigned int attributes; /* object attributes */
931 @REPLY
932 obj_handle_t handle; /* handle to the process */
933 @END
936 /* Open a handle to a thread */
937 @REQ(open_thread)
938 thread_id_t tid; /* thread id to open */
939 unsigned int access; /* wanted access rights */
940 unsigned int attributes; /* object attributes */
941 @REPLY
942 obj_handle_t handle; /* handle to the thread */
943 @END
946 /* Wait for handles */
947 @REQ(select)
948 int flags; /* wait flags (see below) */
949 client_ptr_t cookie; /* magic cookie to return to client */
950 timeout_t timeout; /* timeout */
951 obj_handle_t prev_apc; /* handle to previous APC */
952 VARARG(result,apc_result); /* result of previous APC */
953 VARARG(data,select_op); /* operation-specific data */
954 @REPLY
955 timeout_t timeout; /* timeout converted to absolute */
956 apc_call_t call; /* APC call arguments */
957 obj_handle_t apc_handle; /* handle to next APC */
958 @END
959 #define SELECT_ALERTABLE 1
960 #define SELECT_INTERRUPTIBLE 2
963 /* Create an event */
964 @REQ(create_event)
965 unsigned int access; /* wanted access rights */
966 unsigned int attributes; /* object attributes */
967 int manual_reset; /* manual reset event */
968 int initial_state; /* initial state of the event */
969 VARARG(objattr,object_attributes); /* object attributes */
970 @REPLY
971 obj_handle_t handle; /* handle to the event */
972 @END
974 /* Event operation */
975 @REQ(event_op)
976 obj_handle_t handle; /* handle to event */
977 int op; /* event operation (see below) */
978 @END
979 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
981 @REQ(query_event)
982 obj_handle_t handle; /* handle to event */
983 @REPLY
984 int manual_reset; /* manual reset event */
985 int state; /* current state of the event */
986 @END
988 /* Open an event */
989 @REQ(open_event)
990 unsigned int access; /* wanted access rights */
991 unsigned int attributes; /* object attributes */
992 obj_handle_t rootdir; /* root directory */
993 VARARG(name,unicode_str); /* object name */
994 @REPLY
995 obj_handle_t handle; /* handle to the event */
996 @END
999 /* Create a keyed event */
1000 @REQ(create_keyed_event)
1001 unsigned int access; /* wanted access rights */
1002 unsigned int attributes; /* object attributes */
1003 VARARG(objattr,object_attributes); /* object attributes */
1004 @REPLY
1005 obj_handle_t handle; /* handle to the event */
1006 @END
1008 /* Open a keyed event */
1009 @REQ(open_keyed_event)
1010 unsigned int access; /* wanted access rights */
1011 unsigned int attributes; /* object attributes */
1012 obj_handle_t rootdir; /* root directory */
1013 VARARG(name,unicode_str); /* object name */
1014 @REPLY
1015 obj_handle_t handle; /* handle to the event */
1016 @END
1019 /* Create a mutex */
1020 @REQ(create_mutex)
1021 unsigned int access; /* wanted access rights */
1022 unsigned int attributes; /* object attributes */
1023 int owned; /* initially owned? */
1024 VARARG(objattr,object_attributes); /* object attributes */
1025 @REPLY
1026 obj_handle_t handle; /* handle to the mutex */
1027 @END
1030 /* Release a mutex */
1031 @REQ(release_mutex)
1032 obj_handle_t handle; /* handle to the mutex */
1033 @REPLY
1034 unsigned int prev_count; /* value of internal counter, before release */
1035 @END
1038 /* Open a mutex */
1039 @REQ(open_mutex)
1040 unsigned int access; /* wanted access rights */
1041 unsigned int attributes; /* object attributes */
1042 obj_handle_t rootdir; /* root directory */
1043 VARARG(name,unicode_str); /* object name */
1044 @REPLY
1045 obj_handle_t handle; /* handle to the mutex */
1046 @END
1049 /* Create a semaphore */
1050 @REQ(create_semaphore)
1051 unsigned int access; /* wanted access rights */
1052 unsigned int attributes; /* object attributes */
1053 unsigned int initial; /* initial count */
1054 unsigned int max; /* maximum count */
1055 VARARG(objattr,object_attributes); /* object attributes */
1056 @REPLY
1057 obj_handle_t handle; /* handle to the semaphore */
1058 @END
1061 /* Release a semaphore */
1062 @REQ(release_semaphore)
1063 obj_handle_t handle; /* handle to the semaphore */
1064 unsigned int count; /* count to add to semaphore */
1065 @REPLY
1066 unsigned int prev_count; /* previous semaphore count */
1067 @END
1069 @REQ(query_semaphore)
1070 obj_handle_t handle; /* handle to the semaphore */
1071 @REPLY
1072 unsigned int current; /* current count */
1073 unsigned int max; /* maximum count */
1074 @END
1076 /* Open a semaphore */
1077 @REQ(open_semaphore)
1078 unsigned int access; /* wanted access rights */
1079 unsigned int attributes; /* object attributes */
1080 obj_handle_t rootdir; /* root directory */
1081 VARARG(name,unicode_str); /* object name */
1082 @REPLY
1083 obj_handle_t handle; /* handle to the semaphore */
1084 @END
1087 /* Create a file */
1088 @REQ(create_file)
1089 unsigned int access; /* wanted access rights */
1090 unsigned int attributes; /* object attributes */
1091 unsigned int sharing; /* sharing flags */
1092 int create; /* file create action */
1093 unsigned int options; /* file options */
1094 unsigned int attrs; /* file attributes for creation */
1095 VARARG(objattr,object_attributes); /* object attributes */
1096 VARARG(filename,string); /* file name */
1097 @REPLY
1098 obj_handle_t handle; /* handle to the file */
1099 @END
1102 /* Open a file object */
1103 @REQ(open_file_object)
1104 unsigned int access; /* wanted access rights */
1105 unsigned int attributes; /* open attributes */
1106 obj_handle_t rootdir; /* root directory */
1107 unsigned int sharing; /* sharing flags */
1108 unsigned int options; /* file options */
1109 VARARG(filename,unicode_str); /* file name */
1110 @REPLY
1111 obj_handle_t handle; /* handle to the file */
1112 @END
1115 /* Allocate a file handle for a Unix fd */
1116 @REQ(alloc_file_handle)
1117 unsigned int access; /* wanted access rights */
1118 unsigned int attributes; /* object attributes */
1119 int fd; /* file descriptor on the client side */
1120 @REPLY
1121 obj_handle_t handle; /* handle to the file */
1122 @END
1125 /* Get the Unix name from a file handle */
1126 @REQ(get_handle_unix_name)
1127 obj_handle_t handle; /* file handle */
1128 @REPLY
1129 data_size_t name_len; /* unix name length */
1130 VARARG(name,string); /* unix name */
1131 @END
1134 /* Get a Unix fd to access a file */
1135 @REQ(get_handle_fd)
1136 obj_handle_t handle; /* handle to the file */
1137 @REPLY
1138 int type; /* file type (see below) */
1139 int cacheable; /* can fd be cached in the client? */
1140 unsigned int access; /* file access rights */
1141 unsigned int options; /* file open options */
1142 @END
1143 enum server_fd_type
1145 FD_TYPE_INVALID, /* invalid file (no associated fd) */
1146 FD_TYPE_FILE, /* regular file */
1147 FD_TYPE_DIR, /* directory */
1148 FD_TYPE_SOCKET, /* socket */
1149 FD_TYPE_SERIAL, /* serial port */
1150 FD_TYPE_PIPE, /* named pipe */
1151 FD_TYPE_MAILSLOT, /* mailslot */
1152 FD_TYPE_CHAR, /* unspecified char device */
1153 FD_TYPE_DEVICE, /* Windows device file */
1154 FD_TYPE_NB_TYPES
1158 /* Flush a file buffers */
1159 @REQ(flush_file)
1160 obj_handle_t handle; /* handle to the file */
1161 @REPLY
1162 obj_handle_t event; /* event set when finished */
1163 @END
1166 /* Lock a region of a file */
1167 @REQ(lock_file)
1168 obj_handle_t handle; /* handle to the file */
1169 file_pos_t offset; /* offset of start of lock */
1170 file_pos_t count; /* count of bytes to lock */
1171 int shared; /* shared or exclusive lock? */
1172 int wait; /* do we want to wait? */
1173 @REPLY
1174 obj_handle_t handle; /* handle to wait on */
1175 int overlapped; /* is it an overlapped I/O handle? */
1176 @END
1179 /* Unlock a region of a file */
1180 @REQ(unlock_file)
1181 obj_handle_t handle; /* handle to the file */
1182 file_pos_t offset; /* offset of start of unlock */
1183 file_pos_t count; /* count of bytes to unlock */
1184 @END
1187 /* Create a socket */
1188 @REQ(create_socket)
1189 unsigned int access; /* wanted access rights */
1190 unsigned int attributes; /* object attributes */
1191 int family; /* family, see socket manpage */
1192 int type; /* type, see socket manpage */
1193 int protocol; /* protocol, see socket manpage */
1194 unsigned int flags; /* socket flags */
1195 @REPLY
1196 obj_handle_t handle; /* handle to the new socket */
1197 @END
1200 /* Accept a socket */
1201 @REQ(accept_socket)
1202 obj_handle_t lhandle; /* handle to the listening socket */
1203 unsigned int access; /* wanted access rights */
1204 unsigned int attributes; /* object attributes */
1205 @REPLY
1206 obj_handle_t handle; /* handle to the new socket */
1207 @END
1210 /* Accept into an initialized socket */
1211 @REQ(accept_into_socket)
1212 obj_handle_t lhandle; /* handle to the listening socket */
1213 obj_handle_t ahandle; /* handle to the accepting socket */
1214 @END
1217 /* Set socket event parameters */
1218 @REQ(set_socket_event)
1219 obj_handle_t handle; /* handle to the socket */
1220 unsigned int mask; /* event mask */
1221 obj_handle_t event; /* event object */
1222 user_handle_t window; /* window to send the message to */
1223 unsigned int msg; /* message to send */
1224 @END
1227 /* Get socket event parameters */
1228 @REQ(get_socket_event)
1229 obj_handle_t handle; /* handle to the socket */
1230 int service; /* clear pending? */
1231 obj_handle_t c_event; /* event to clear */
1232 @REPLY
1233 unsigned int mask; /* event mask */
1234 unsigned int pmask; /* pending events */
1235 unsigned int state; /* status bits */
1236 VARARG(errors,ints); /* event errors */
1237 @END
1240 /* Get socket info */
1241 @REQ(get_socket_info)
1242 obj_handle_t handle; /* handle to the socket */
1243 @REPLY
1244 int family; /* family, see socket manpage */
1245 int type; /* type, see socket manpage */
1246 int protocol; /* protocol, see socket manpage */
1247 @END
1250 /* Re-enable pending socket events */
1251 @REQ(enable_socket_event)
1252 obj_handle_t handle; /* handle to the socket */
1253 unsigned int mask; /* events to re-enable */
1254 unsigned int sstate; /* status bits to set */
1255 unsigned int cstate; /* status bits to clear */
1256 @END
1258 @REQ(set_socket_deferred)
1259 obj_handle_t handle; /* handle to the socket */
1260 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1261 @END
1263 /* Allocate a console (only used by a console renderer) */
1264 @REQ(alloc_console)
1265 unsigned int access; /* wanted access rights */
1266 unsigned int attributes; /* object attributes */
1267 process_id_t pid; /* pid of process which shall be attached to the console */
1268 int input_fd; /* if pid=-1 (bare console to current process), fd for input */
1269 @REPLY
1270 obj_handle_t handle_in; /* handle to console input */
1271 obj_handle_t event; /* handle to renderer events change notification */
1272 @END
1275 /* Free the console of the current process */
1276 @REQ(free_console)
1277 @END
1280 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1281 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1282 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1283 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1284 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1285 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1286 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1287 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1288 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1289 struct console_renderer_event
1291 short event;
1292 union
1294 struct update
1296 short top;
1297 short bottom;
1298 } update;
1299 struct resize
1301 short width;
1302 short height;
1303 } resize;
1304 struct cursor_pos
1306 short x;
1307 short y;
1308 } cursor_pos;
1309 struct cursor_geom
1311 short visible;
1312 short size;
1313 } cursor_geom;
1314 struct display
1316 short left;
1317 short top;
1318 short width;
1319 short height;
1320 } display;
1321 } u;
1324 /* retrieve console events for the renderer */
1325 @REQ(get_console_renderer_events)
1326 obj_handle_t handle; /* handle to console input events */
1327 @REPLY
1328 VARARG(data,bytes); /* the various console_renderer_events */
1329 @END
1332 /* Open a handle to the process console */
1333 @REQ(open_console)
1334 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1335 /* otherwise console_in handle to get active screen buffer? */
1336 unsigned int access; /* wanted access rights */
1337 unsigned int attributes; /* object attributes */
1338 int share; /* share mask (only for output handles) */
1339 @REPLY
1340 obj_handle_t handle; /* handle to the console */
1341 @END
1344 /* Get the input queue wait event */
1345 @REQ(get_console_wait_event)
1346 @REPLY
1347 obj_handle_t handle;
1348 @END
1350 /* Get a console mode (input or output) */
1351 @REQ(get_console_mode)
1352 obj_handle_t handle; /* handle to the console */
1353 @REPLY
1354 int mode; /* console mode */
1355 @END
1358 /* Set a console mode (input or output) */
1359 @REQ(set_console_mode)
1360 obj_handle_t handle; /* handle to the console */
1361 int mode; /* console mode */
1362 @END
1365 /* Set info about a console (input only) */
1366 @REQ(set_console_input_info)
1367 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1368 int mask; /* setting mask (see below) */
1369 obj_handle_t active_sb; /* active screen buffer */
1370 int history_mode; /* whether we duplicate lines in history */
1371 int history_size; /* number of lines in history */
1372 int edition_mode; /* index to the edition mode flavors */
1373 int input_cp; /* console input codepage */
1374 int output_cp; /* console output codepage */
1375 user_handle_t win; /* console window if backend supports it */
1376 VARARG(title,unicode_str); /* console title */
1377 @END
1378 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1379 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1380 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1381 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1382 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1383 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1384 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1385 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1388 /* Get info about a console (input only) */
1389 @REQ(get_console_input_info)
1390 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1391 @REPLY
1392 int history_mode; /* whether we duplicate lines in history */
1393 int history_size; /* number of lines in history */
1394 int history_index; /* number of used lines in history */
1395 int edition_mode; /* index to the edition mode flavors */
1396 int input_cp; /* console input codepage */
1397 int output_cp; /* console output codepage */
1398 user_handle_t win; /* console window if backend supports it */
1399 VARARG(title,unicode_str); /* console title */
1400 @END
1403 /* appends a string to console's history */
1404 @REQ(append_console_input_history)
1405 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1406 VARARG(line,unicode_str); /* line to add */
1407 @END
1410 /* appends a string to console's history */
1411 @REQ(get_console_input_history)
1412 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1413 int index; /* index to get line from */
1414 @REPLY
1415 int total; /* total length of line in Unicode chars */
1416 VARARG(line,unicode_str); /* line to add */
1417 @END
1420 /* creates a new screen buffer on process' console */
1421 @REQ(create_console_output)
1422 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1423 unsigned int access; /* wanted access rights */
1424 unsigned int attributes; /* object attributes */
1425 unsigned int share; /* sharing credentials */
1426 int fd; /* for bare consoles, fd the screen-buffer is attached to */
1427 @REPLY
1428 obj_handle_t handle_out; /* handle to the screen buffer */
1429 @END
1432 /* Set info about a console (output only) */
1433 @REQ(set_console_output_info)
1434 obj_handle_t handle; /* handle to the console */
1435 int mask; /* setting mask (see below) */
1436 short int cursor_size; /* size of cursor (percentage filled) */
1437 short int cursor_visible;/* cursor visibility flag */
1438 short int cursor_x; /* position of cursor (x, y) */
1439 short int cursor_y;
1440 short int width; /* width of the screen buffer */
1441 short int height; /* height of the screen buffer */
1442 short int attr; /* default attribute */
1443 short int win_left; /* window actually displayed by renderer */
1444 short int win_top; /* the rect area is expressed within the */
1445 short int win_right; /* boundaries of the screen buffer */
1446 short int win_bottom;
1447 short int max_width; /* maximum size (width x height) for the window */
1448 short int max_height;
1449 @END
1450 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1451 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1452 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1453 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1454 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1455 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1458 /* Get info about a console (output only) */
1459 @REQ(get_console_output_info)
1460 obj_handle_t handle; /* handle to the console */
1461 @REPLY
1462 short int cursor_size; /* size of cursor (percentage filled) */
1463 short int cursor_visible;/* cursor visibility flag */
1464 short int cursor_x; /* position of cursor (x, y) */
1465 short int cursor_y;
1466 short int width; /* width of the screen buffer */
1467 short int height; /* height of the screen buffer */
1468 short int attr; /* default attribute */
1469 short int win_left; /* window actually displayed by renderer */
1470 short int win_top; /* the rect area is expressed within the */
1471 short int win_right; /* boundaries of the screen buffer */
1472 short int win_bottom;
1473 short int max_width; /* maximum size (width x height) for the window */
1474 short int max_height;
1475 @END
1477 /* Add input records to a console input queue */
1478 @REQ(write_console_input)
1479 obj_handle_t handle; /* handle to the console input */
1480 VARARG(rec,input_records); /* input records */
1481 @REPLY
1482 int written; /* number of records written */
1483 @END
1486 /* Fetch input records from a console input queue */
1487 @REQ(read_console_input)
1488 obj_handle_t handle; /* handle to the console input */
1489 int flush; /* flush the retrieved records from the queue? */
1490 @REPLY
1491 int read; /* number of records read */
1492 VARARG(rec,input_records); /* input records */
1493 @END
1496 /* write data (chars and/or attributes) in a screen buffer */
1497 @REQ(write_console_output)
1498 obj_handle_t handle; /* handle to the console output */
1499 int x; /* position where to start writing */
1500 int y;
1501 int mode; /* char info (see below) */
1502 int wrap; /* wrap around at end of line? */
1503 VARARG(data,bytes); /* info to write */
1504 @REPLY
1505 int written; /* number of char infos actually written */
1506 int width; /* width of screen buffer */
1507 int height; /* height of screen buffer */
1508 @END
1509 enum char_info_mode
1511 CHAR_INFO_MODE_TEXT, /* characters only */
1512 CHAR_INFO_MODE_ATTR, /* attributes only */
1513 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1514 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1518 /* fill a screen buffer with constant data (chars and/or attributes) */
1519 @REQ(fill_console_output)
1520 obj_handle_t handle; /* handle to the console output */
1521 int x; /* position where to start writing */
1522 int y;
1523 int mode; /* char info mode */
1524 int count; /* number to write */
1525 int wrap; /* wrap around at end of line? */
1526 char_info_t data; /* data to write */
1527 @REPLY
1528 int written; /* number of char infos actually written */
1529 @END
1532 /* read data (chars and/or attributes) from a screen buffer */
1533 @REQ(read_console_output)
1534 obj_handle_t handle; /* handle to the console output */
1535 int x; /* position (x,y) where to start reading */
1536 int y;
1537 int mode; /* char info mode */
1538 int wrap; /* wrap around at end of line? */
1539 @REPLY
1540 int width; /* width of screen buffer */
1541 int height; /* height of screen buffer */
1542 VARARG(data,bytes);
1543 @END
1546 /* move a rect (of data) in screen buffer content */
1547 @REQ(move_console_output)
1548 obj_handle_t handle; /* handle to the console output */
1549 short int x_src; /* position (x, y) of rect to start moving from */
1550 short int y_src;
1551 short int x_dst; /* position (x, y) of rect to move to */
1552 short int y_dst;
1553 short int w; /* size of the rect (width, height) to move */
1554 short int h;
1555 @END
1558 /* Sends a signal to a process group */
1559 @REQ(send_console_signal)
1560 int signal; /* the signal to send */
1561 process_id_t group_id; /* the group to send the signal to */
1562 @END
1565 /* enable directory change notifications */
1566 @REQ(read_directory_changes)
1567 unsigned int filter; /* notification filter */
1568 int subtree; /* watch the subtree? */
1569 int want_data; /* flag indicating whether change data should be collected */
1570 async_data_t async; /* async I/O parameters */
1571 @END
1574 @REQ(read_change)
1575 obj_handle_t handle;
1576 @REPLY
1577 VARARG(events,filesystem_event); /* collected filesystem events */
1578 @END
1581 /* Create a file mapping */
1582 @REQ(create_mapping)
1583 unsigned int access; /* wanted access rights */
1584 unsigned int attributes; /* object attributes */
1585 unsigned int protect; /* protection flags (see below) */
1586 mem_size_t size; /* mapping size */
1587 obj_handle_t file_handle; /* file handle */
1588 VARARG(objattr,object_attributes); /* object attributes */
1589 @REPLY
1590 obj_handle_t handle; /* handle to the mapping */
1591 @END
1592 /* per-page protection flags */
1593 #define VPROT_READ 0x01
1594 #define VPROT_WRITE 0x02
1595 #define VPROT_EXEC 0x04
1596 #define VPROT_WRITECOPY 0x08
1597 #define VPROT_GUARD 0x10
1598 #define VPROT_NOCACHE 0x20
1599 #define VPROT_COMMITTED 0x40
1600 #define VPROT_WRITEWATCH 0x80
1601 /* per-mapping protection flags */
1602 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1603 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1604 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1605 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1608 /* Open a mapping */
1609 @REQ(open_mapping)
1610 unsigned int access; /* wanted access rights */
1611 unsigned int attributes; /* object attributes */
1612 obj_handle_t rootdir; /* root directory */
1613 VARARG(name,unicode_str); /* object name */
1614 @REPLY
1615 obj_handle_t handle; /* handle to the mapping */
1616 @END
1619 /* Get information about a file mapping */
1620 @REQ(get_mapping_info)
1621 obj_handle_t handle; /* handle to the mapping */
1622 unsigned int access; /* wanted access rights */
1623 @REPLY
1624 mem_size_t size; /* mapping size */
1625 int protect; /* protection flags */
1626 int header_size; /* header size (for VPROT_IMAGE mapping) */
1627 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1628 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1629 obj_handle_t shared_file; /* shared mapping file handle */
1630 @END
1633 /* Get a range of committed pages in a file mapping */
1634 @REQ(get_mapping_committed_range)
1635 obj_handle_t handle; /* handle to the mapping */
1636 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1637 @REPLY
1638 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1639 int committed; /* whether it is a committed range */
1640 @END
1643 /* Add a range to the committed pages in a file mapping */
1644 @REQ(add_mapping_committed_range)
1645 obj_handle_t handle; /* handle to the mapping */
1646 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1647 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1648 @END
1651 #define SNAP_PROCESS 0x00000001
1652 #define SNAP_THREAD 0x00000002
1653 /* Create a snapshot */
1654 @REQ(create_snapshot)
1655 unsigned int attributes; /* object attributes */
1656 unsigned int flags; /* snapshot flags (SNAP_*) */
1657 @REPLY
1658 obj_handle_t handle; /* handle to the snapshot */
1659 @END
1662 /* Get the next process from a snapshot */
1663 @REQ(next_process)
1664 obj_handle_t handle; /* handle to the snapshot */
1665 int reset; /* reset snapshot position? */
1666 @REPLY
1667 int count; /* process usage count */
1668 process_id_t pid; /* process id */
1669 process_id_t ppid; /* parent process id */
1670 int threads; /* number of threads */
1671 int priority; /* process priority */
1672 int handles; /* number of handles */
1673 int unix_pid; /* Unix pid */
1674 VARARG(filename,unicode_str); /* file name of main exe */
1675 @END
1678 /* Get the next thread from a snapshot */
1679 @REQ(next_thread)
1680 obj_handle_t handle; /* handle to the snapshot */
1681 int reset; /* reset snapshot position? */
1682 @REPLY
1683 int count; /* thread usage count */
1684 process_id_t pid; /* process id */
1685 thread_id_t tid; /* thread id */
1686 int base_pri; /* base priority */
1687 int delta_pri; /* delta priority */
1688 @END
1691 /* Wait for a debug event */
1692 @REQ(wait_debug_event)
1693 int get_handle; /* should we alloc a handle for waiting? */
1694 @REPLY
1695 process_id_t pid; /* process id */
1696 thread_id_t tid; /* thread id */
1697 obj_handle_t wait; /* wait handle if no event ready */
1698 VARARG(event,debug_event); /* debug event data */
1699 @END
1702 /* Queue an exception event */
1703 @REQ(queue_exception_event)
1704 int first; /* first chance exception? */
1705 unsigned int code; /* exception code */
1706 unsigned int flags; /* exception flags */
1707 client_ptr_t record; /* exception record */
1708 client_ptr_t address; /* exception address */
1709 data_size_t len; /* size of parameters */
1710 VARARG(params,uints64,len);/* exception parameters */
1711 VARARG(context,context); /* thread context */
1712 @REPLY
1713 obj_handle_t handle; /* handle to the queued event */
1714 @END
1717 /* Retrieve the status of an exception event */
1718 @REQ(get_exception_status)
1719 obj_handle_t handle; /* handle to the queued event */
1720 @REPLY
1721 VARARG(context,context); /* modified thread context */
1722 @END
1725 /* Continue a debug event */
1726 @REQ(continue_debug_event)
1727 process_id_t pid; /* process id to continue */
1728 thread_id_t tid; /* thread id to continue */
1729 int status; /* continuation status */
1730 @END
1733 /* Start/stop debugging an existing process */
1734 @REQ(debug_process)
1735 process_id_t pid; /* id of the process to debug */
1736 int attach; /* 1=attaching / 0=detaching from the process */
1737 @END
1740 /* Simulate a breakpoint in a process */
1741 @REQ(debug_break)
1742 obj_handle_t handle; /* process handle */
1743 @REPLY
1744 int self; /* was it the caller itself? */
1745 @END
1748 /* Set debugger kill on exit flag */
1749 @REQ(set_debugger_kill_on_exit)
1750 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1751 @END
1754 /* Read data from a process address space */
1755 @REQ(read_process_memory)
1756 obj_handle_t handle; /* process handle */
1757 client_ptr_t addr; /* addr to read from */
1758 @REPLY
1759 VARARG(data,bytes); /* result data */
1760 @END
1763 /* Write data to a process address space */
1764 @REQ(write_process_memory)
1765 obj_handle_t handle; /* process handle */
1766 client_ptr_t addr; /* addr to write to */
1767 VARARG(data,bytes); /* data to write */
1768 @END
1771 /* Create a registry key */
1772 @REQ(create_key)
1773 obj_handle_t parent; /* handle to the parent key */
1774 unsigned int access; /* desired access rights */
1775 unsigned int attributes; /* object attributes */
1776 unsigned int options; /* creation options */
1777 data_size_t namelen; /* length of key name in bytes */
1778 VARARG(name,unicode_str,namelen); /* key name */
1779 VARARG(class,unicode_str); /* class name */
1780 @REPLY
1781 obj_handle_t hkey; /* handle to the created key */
1782 int created; /* has it been newly created? */
1783 @END
1785 /* Open a registry key */
1786 @REQ(open_key)
1787 obj_handle_t parent; /* handle to the parent key */
1788 unsigned int access; /* desired access rights */
1789 unsigned int attributes; /* object attributes */
1790 VARARG(name,unicode_str); /* key name */
1791 @REPLY
1792 obj_handle_t hkey; /* handle to the open key */
1793 @END
1796 /* Delete a registry key */
1797 @REQ(delete_key)
1798 obj_handle_t hkey; /* handle to the key */
1799 @END
1802 /* Flush a registry key */
1803 @REQ(flush_key)
1804 obj_handle_t hkey; /* handle to the key */
1805 @END
1808 /* Enumerate registry subkeys */
1809 @REQ(enum_key)
1810 obj_handle_t hkey; /* handle to registry key */
1811 int index; /* index of subkey (or -1 for current key) */
1812 int info_class; /* requested information class */
1813 @REPLY
1814 int subkeys; /* number of subkeys */
1815 int max_subkey; /* longest subkey name */
1816 int max_class; /* longest class name */
1817 int values; /* number of values */
1818 int max_value; /* longest value name */
1819 int max_data; /* longest value data */
1820 timeout_t modif; /* last modification time */
1821 data_size_t total; /* total length needed for full name and class */
1822 data_size_t namelen; /* length of key name in bytes */
1823 VARARG(name,unicode_str,namelen); /* key name */
1824 VARARG(class,unicode_str); /* class name */
1825 @END
1828 /* Set a value of a registry key */
1829 @REQ(set_key_value)
1830 obj_handle_t hkey; /* handle to registry key */
1831 int type; /* value type */
1832 data_size_t namelen; /* length of value name in bytes */
1833 VARARG(name,unicode_str,namelen); /* value name */
1834 VARARG(data,bytes); /* value data */
1835 @END
1838 /* Retrieve the value of a registry key */
1839 @REQ(get_key_value)
1840 obj_handle_t hkey; /* handle to registry key */
1841 VARARG(name,unicode_str); /* value name */
1842 @REPLY
1843 int type; /* value type */
1844 data_size_t total; /* total length needed for data */
1845 VARARG(data,bytes); /* value data */
1846 @END
1849 /* Enumerate a value of a registry key */
1850 @REQ(enum_key_value)
1851 obj_handle_t hkey; /* handle to registry key */
1852 int index; /* value index */
1853 int info_class; /* requested information class */
1854 @REPLY
1855 int type; /* value type */
1856 data_size_t total; /* total length needed for full name and data */
1857 data_size_t namelen; /* length of value name in bytes */
1858 VARARG(name,unicode_str,namelen); /* value name */
1859 VARARG(data,bytes); /* value data */
1860 @END
1863 /* Delete a value of a registry key */
1864 @REQ(delete_key_value)
1865 obj_handle_t hkey; /* handle to registry key */
1866 VARARG(name,unicode_str); /* value name */
1867 @END
1870 /* Load a registry branch from a file */
1871 @REQ(load_registry)
1872 obj_handle_t hkey; /* root key to load to */
1873 obj_handle_t file; /* file to load from */
1874 VARARG(name,unicode_str); /* subkey name */
1875 @END
1878 /* UnLoad a registry branch from a file */
1879 @REQ(unload_registry)
1880 obj_handle_t hkey; /* root key to unload to */
1881 @END
1884 /* Save a registry branch to a file */
1885 @REQ(save_registry)
1886 obj_handle_t hkey; /* key to save */
1887 obj_handle_t file; /* file to save to */
1888 @END
1891 /* Add a registry key change notification */
1892 @REQ(set_registry_notification)
1893 obj_handle_t hkey; /* key to watch for changes */
1894 obj_handle_t event; /* event to set */
1895 int subtree; /* should we watch the whole subtree? */
1896 unsigned int filter; /* things to watch */
1897 @END
1900 /* Create a waitable timer */
1901 @REQ(create_timer)
1902 unsigned int access; /* wanted access rights */
1903 unsigned int attributes; /* object attributes */
1904 obj_handle_t rootdir; /* root directory */
1905 int manual; /* manual reset */
1906 VARARG(name,unicode_str); /* object name */
1907 @REPLY
1908 obj_handle_t handle; /* handle to the timer */
1909 @END
1912 /* Open a waitable timer */
1913 @REQ(open_timer)
1914 unsigned int access; /* wanted access rights */
1915 unsigned int attributes; /* object attributes */
1916 obj_handle_t rootdir; /* root directory */
1917 VARARG(name,unicode_str); /* object name */
1918 @REPLY
1919 obj_handle_t handle; /* handle to the timer */
1920 @END
1922 /* Set a waitable timer */
1923 @REQ(set_timer)
1924 obj_handle_t handle; /* handle to the timer */
1925 timeout_t expire; /* next expiration absolute time */
1926 client_ptr_t callback; /* callback function */
1927 client_ptr_t arg; /* callback argument */
1928 int period; /* timer period in ms */
1929 @REPLY
1930 int signaled; /* was the timer signaled before this call ? */
1931 @END
1933 /* Cancel a waitable timer */
1934 @REQ(cancel_timer)
1935 obj_handle_t handle; /* handle to the timer */
1936 @REPLY
1937 int signaled; /* was the timer signaled before this calltime ? */
1938 @END
1940 /* Get information on a waitable timer */
1941 @REQ(get_timer_info)
1942 obj_handle_t handle; /* handle to the timer */
1943 @REPLY
1944 timeout_t when; /* absolute time when the timer next expires */
1945 int signaled; /* is the timer signaled? */
1946 @END
1949 /* Retrieve the current context of a thread */
1950 @REQ(get_thread_context)
1951 obj_handle_t handle; /* thread handle */
1952 unsigned int flags; /* context flags */
1953 int suspend; /* suspend the thread if needed */
1954 @REPLY
1955 int self; /* was it a handle to the current thread? */
1956 VARARG(context,context); /* thread context */
1957 @END
1960 /* Set the current context of a thread */
1961 @REQ(set_thread_context)
1962 obj_handle_t handle; /* thread handle */
1963 int suspend; /* suspend the thread if needed */
1964 VARARG(context,context); /* thread context */
1965 @REPLY
1966 int self; /* was it a handle to the current thread? */
1967 @END
1970 /* Fetch a selector entry for a thread */
1971 @REQ(get_selector_entry)
1972 obj_handle_t handle; /* thread handle */
1973 int entry; /* LDT entry */
1974 @REPLY
1975 unsigned int base; /* selector base */
1976 unsigned int limit; /* selector limit */
1977 unsigned char flags; /* selector flags */
1978 @END
1981 /* Add an atom */
1982 @REQ(add_atom)
1983 obj_handle_t table; /* which table to add atom to */
1984 VARARG(name,unicode_str); /* atom name */
1985 @REPLY
1986 atom_t atom; /* resulting atom */
1987 @END
1990 /* Delete an atom */
1991 @REQ(delete_atom)
1992 obj_handle_t table; /* which table to delete atom from */
1993 atom_t atom; /* atom handle */
1994 @END
1997 /* Find an atom */
1998 @REQ(find_atom)
1999 obj_handle_t table; /* which table to find atom from */
2000 VARARG(name,unicode_str); /* atom name */
2001 @REPLY
2002 atom_t atom; /* atom handle */
2003 @END
2006 /* Get information about an atom */
2007 @REQ(get_atom_information)
2008 obj_handle_t table; /* which table to find atom from */
2009 atom_t atom; /* atom handle */
2010 @REPLY
2011 int count; /* atom lock count */
2012 int pinned; /* whether the atom has been pinned */
2013 data_size_t total; /* actual length of atom name */
2014 VARARG(name,unicode_str); /* atom name */
2015 @END
2018 /* Set information about an atom */
2019 @REQ(set_atom_information)
2020 obj_handle_t table; /* which table to find atom from */
2021 atom_t atom; /* atom handle */
2022 int pinned; /* whether to bump atom information */
2023 @END
2026 /* Empty an atom table */
2027 @REQ(empty_atom_table)
2028 obj_handle_t table; /* which table to find atom from */
2029 int if_pinned; /* whether to delete pinned atoms */
2030 @END
2033 /* Init an atom table */
2034 @REQ(init_atom_table)
2035 int entries; /* number of entries (only for local) */
2036 @REPLY
2037 obj_handle_t table; /* handle to the atom table */
2038 @END
2041 /* Get the message queue of the current thread */
2042 @REQ(get_msg_queue)
2043 @REPLY
2044 obj_handle_t handle; /* handle to the queue */
2045 @END
2048 /* Set the file descriptor associated to the current thread queue */
2049 @REQ(set_queue_fd)
2050 obj_handle_t handle; /* handle to the file descriptor */
2051 @END
2054 /* Set the current message queue wakeup mask */
2055 @REQ(set_queue_mask)
2056 unsigned int wake_mask; /* wakeup bits mask */
2057 unsigned int changed_mask; /* changed bits mask */
2058 int skip_wait; /* will we skip waiting if signaled? */
2059 @REPLY
2060 unsigned int wake_bits; /* current wake bits */
2061 unsigned int changed_bits; /* current changed bits */
2062 @END
2065 /* Get the current message queue status */
2066 @REQ(get_queue_status)
2067 int clear; /* should we clear the change bits? */
2068 @REPLY
2069 unsigned int wake_bits; /* wake bits */
2070 unsigned int changed_bits; /* changed bits since last time */
2071 @END
2074 /* Retrieve the process idle event */
2075 @REQ(get_process_idle_event)
2076 obj_handle_t handle; /* process handle */
2077 @REPLY
2078 obj_handle_t event; /* handle to idle event */
2079 @END
2082 /* Send a message to a thread queue */
2083 @REQ(send_message)
2084 thread_id_t id; /* thread id */
2085 int type; /* message type (see below) */
2086 int flags; /* message flags (see below) */
2087 user_handle_t win; /* window handle */
2088 unsigned int msg; /* message code */
2089 lparam_t wparam; /* parameters */
2090 lparam_t lparam; /* parameters */
2091 timeout_t timeout; /* timeout for reply */
2092 VARARG(data,message_data); /* message data for sent messages */
2093 @END
2095 @REQ(post_quit_message)
2096 int exit_code; /* exit code to return */
2097 @END
2099 enum message_type
2101 MSG_ASCII, /* Ascii message (from SendMessageA) */
2102 MSG_UNICODE, /* Unicode message (from SendMessageW) */
2103 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
2104 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
2105 MSG_CALLBACK_RESULT,/* result of a callback message */
2106 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
2107 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
2108 MSG_HARDWARE, /* hardware message */
2109 MSG_WINEVENT, /* winevent message */
2110 MSG_HOOK_LL /* low-level hardware hook */
2112 #define SEND_MSG_ABORT_IF_HUNG 0x01
2115 /* Send a hardware message to a thread queue */
2116 @REQ(send_hardware_message)
2117 user_handle_t win; /* window handle */
2118 hw_input_t input; /* input data */
2119 unsigned int flags; /* flags (see below) */
2120 @REPLY
2121 int wait; /* do we need to wait for a reply? */
2122 int prev_x; /* previous cursor position */
2123 int prev_y;
2124 int new_x; /* new cursor position */
2125 int new_y;
2126 VARARG(keystate,bytes); /* global state array for all the keys */
2127 @END
2128 #define SEND_HWMSG_INJECTED 0x01
2131 /* Get a message from the current queue */
2132 @REQ(get_message)
2133 unsigned int flags; /* PM_* flags */
2134 user_handle_t get_win; /* window handle to get */
2135 unsigned int get_first; /* first message code to get */
2136 unsigned int get_last; /* last message code to get */
2137 unsigned int hw_id; /* id of the previous hardware message (or 0) */
2138 unsigned int wake_mask; /* wakeup bits mask */
2139 unsigned int changed_mask; /* changed bits mask */
2140 @REPLY
2141 user_handle_t win; /* window handle */
2142 unsigned int msg; /* message code */
2143 lparam_t wparam; /* parameters */
2144 lparam_t lparam; /* parameters */
2145 int type; /* message type */
2146 unsigned int time; /* message time */
2147 unsigned int active_hooks; /* active hooks bitmap */
2148 data_size_t total; /* total size of extra data */
2149 VARARG(data,message_data); /* message data for sent messages */
2150 @END
2153 /* Reply to a sent message */
2154 @REQ(reply_message)
2155 int remove; /* should we remove the message? */
2156 lparam_t result; /* message result */
2157 VARARG(data,bytes); /* message data for sent messages */
2158 @END
2161 /* Accept the current hardware message */
2162 @REQ(accept_hardware_message)
2163 unsigned int hw_id; /* id of the hardware message */
2164 int remove; /* should we remove the message? */
2165 user_handle_t new_win; /* new destination window for current message */
2166 @END
2169 /* Retrieve the reply for the last message sent */
2170 @REQ(get_message_reply)
2171 int cancel; /* cancel message if not ready? */
2172 @REPLY
2173 lparam_t result; /* message result */
2174 VARARG(data,bytes); /* message data for sent messages */
2175 @END
2178 /* Set a window timer */
2179 @REQ(set_win_timer)
2180 user_handle_t win; /* window handle */
2181 unsigned int msg; /* message to post */
2182 unsigned int rate; /* timer rate in ms */
2183 lparam_t id; /* timer id */
2184 lparam_t lparam; /* message lparam (callback proc) */
2185 @REPLY
2186 lparam_t id; /* timer id */
2187 @END
2190 /* Kill a window timer */
2191 @REQ(kill_win_timer)
2192 user_handle_t win; /* window handle */
2193 lparam_t id; /* timer id */
2194 unsigned int msg; /* message to post */
2195 @END
2198 /* check if the thread owning the window is hung */
2199 @REQ(is_window_hung)
2200 user_handle_t win; /* window handle */
2201 @REPLY
2202 int is_hung;
2203 @END
2206 /* Retrieve info about a serial port */
2207 @REQ(get_serial_info)
2208 obj_handle_t handle; /* handle to comm port */
2209 int flags;
2210 @REPLY
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 unsigned int cookie;
2218 unsigned int pending_write;
2219 @END
2222 /* Set info about a serial port */
2223 @REQ(set_serial_info)
2224 obj_handle_t handle; /* handle to comm port */
2225 int flags; /* bitmask to set values (see below) */
2226 unsigned int readinterval;
2227 unsigned int readconst;
2228 unsigned int readmult;
2229 unsigned int writeconst;
2230 unsigned int writemult;
2231 unsigned int eventmask;
2232 @END
2233 #define SERIALINFO_SET_TIMEOUTS 0x01
2234 #define SERIALINFO_SET_MASK 0x02
2235 #define SERIALINFO_PENDING_WRITE 0x04
2236 #define SERIALINFO_PENDING_WAIT 0x08
2239 /* Create an async I/O */
2240 @REQ(register_async)
2241 int type; /* type of queue to look after */
2242 async_data_t async; /* async I/O parameters */
2243 int count; /* count - usually # of bytes to be read/written */
2244 @END
2245 #define ASYNC_TYPE_READ 0x01
2246 #define ASYNC_TYPE_WRITE 0x02
2247 #define ASYNC_TYPE_WAIT 0x03
2250 /* Cancel all async op on a fd */
2251 @REQ(cancel_async)
2252 obj_handle_t handle; /* handle to comm port, socket or file */
2253 client_ptr_t iosb; /* I/O status block (NULL=all) */
2254 int only_thread; /* cancel matching this thread */
2255 @END
2258 /* Perform an ioctl on a file */
2259 @REQ(ioctl)
2260 ioctl_code_t code; /* ioctl code */
2261 async_data_t async; /* async I/O parameters */
2262 int blocking; /* whether it's a blocking ioctl */
2263 VARARG(in_data,bytes); /* ioctl input data */
2264 @REPLY
2265 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2266 unsigned int options; /* device open options */
2267 VARARG(out_data,bytes); /* ioctl output data */
2268 @END
2271 /* Retrieve results of an async ioctl */
2272 @REQ(get_ioctl_result)
2273 obj_handle_t handle; /* handle to the device */
2274 client_ptr_t user_arg; /* user arg used to identify the request */
2275 @REPLY
2276 VARARG(out_data,bytes); /* ioctl output data */
2277 @END
2280 /* Create a named pipe */
2281 @REQ(create_named_pipe)
2282 unsigned int access;
2283 unsigned int attributes; /* object attributes */
2284 obj_handle_t rootdir; /* root directory */
2285 unsigned int options;
2286 unsigned int sharing;
2287 unsigned int maxinstances;
2288 unsigned int outsize;
2289 unsigned int insize;
2290 timeout_t timeout;
2291 unsigned int flags;
2292 VARARG(name,unicode_str); /* pipe name */
2293 @REPLY
2294 obj_handle_t handle; /* handle to the pipe */
2295 @END
2297 /* flags in create_named_pipe and get_named_pipe_info */
2298 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2299 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2300 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2301 #define NAMED_PIPE_SERVER_END 0x8000
2304 @REQ(get_named_pipe_info)
2305 obj_handle_t handle;
2306 @REPLY
2307 unsigned int flags;
2308 unsigned int sharing;
2309 unsigned int maxinstances;
2310 unsigned int instances;
2311 unsigned int outsize;
2312 unsigned int insize;
2313 @END
2316 /* Create a window */
2317 @REQ(create_window)
2318 user_handle_t parent; /* parent window */
2319 user_handle_t owner; /* owner window */
2320 atom_t atom; /* class atom */
2321 mod_handle_t instance; /* module instance */
2322 VARARG(class,unicode_str); /* class name */
2323 @REPLY
2324 user_handle_t handle; /* created window */
2325 user_handle_t parent; /* full handle of parent */
2326 user_handle_t owner; /* full handle of owner */
2327 int extra; /* number of extra bytes */
2328 client_ptr_t class_ptr; /* pointer to class in client address space */
2329 @END
2332 /* Destroy a window */
2333 @REQ(destroy_window)
2334 user_handle_t handle; /* handle to the window */
2335 @END
2338 /* Retrieve the desktop window for the current thread */
2339 @REQ(get_desktop_window)
2340 int force; /* force creation if it doesn't exist */
2341 @REPLY
2342 user_handle_t top_window; /* handle to the desktop window */
2343 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2344 @END
2347 /* Set a window owner */
2348 @REQ(set_window_owner)
2349 user_handle_t handle; /* handle to the window */
2350 user_handle_t owner; /* new owner */
2351 @REPLY
2352 user_handle_t full_owner; /* full handle of new owner */
2353 user_handle_t prev_owner; /* full handle of previous owner */
2354 @END
2357 /* Get information from a window handle */
2358 @REQ(get_window_info)
2359 user_handle_t handle; /* handle to the window */
2360 @REPLY
2361 user_handle_t full_handle; /* full 32-bit handle */
2362 user_handle_t last_active; /* last active popup */
2363 process_id_t pid; /* process owning the window */
2364 thread_id_t tid; /* thread owning the window */
2365 atom_t atom; /* class atom */
2366 int is_unicode; /* ANSI or unicode */
2367 @END
2370 /* Set some information in a window */
2371 @REQ(set_window_info)
2372 unsigned short flags; /* flags for fields to set (see below) */
2373 short int is_unicode; /* ANSI or unicode */
2374 user_handle_t handle; /* handle to the window */
2375 unsigned int style; /* window style */
2376 unsigned int ex_style; /* window extended style */
2377 unsigned int id; /* window id */
2378 mod_handle_t instance; /* creator instance */
2379 lparam_t user_data; /* user-specific data */
2380 int extra_offset; /* offset to set in extra bytes */
2381 data_size_t extra_size; /* size to set in extra bytes */
2382 lparam_t extra_value; /* value to set in extra bytes */
2383 @REPLY
2384 unsigned int old_style; /* old window style */
2385 unsigned int old_ex_style; /* old window extended style */
2386 mod_handle_t old_instance; /* old creator instance */
2387 lparam_t old_user_data; /* old user-specific data */
2388 lparam_t old_extra_value; /* old value in extra bytes */
2389 unsigned int old_id; /* old window id */
2390 @END
2391 #define SET_WIN_STYLE 0x01
2392 #define SET_WIN_EXSTYLE 0x02
2393 #define SET_WIN_ID 0x04
2394 #define SET_WIN_INSTANCE 0x08
2395 #define SET_WIN_USERDATA 0x10
2396 #define SET_WIN_EXTRA 0x20
2397 #define SET_WIN_UNICODE 0x40
2400 /* Set the parent of a window */
2401 @REQ(set_parent)
2402 user_handle_t handle; /* handle to the window */
2403 user_handle_t parent; /* handle to the parent */
2404 @REPLY
2405 user_handle_t old_parent; /* old parent window */
2406 user_handle_t full_parent; /* full handle of new parent */
2407 @END
2410 /* Get a list of the window parents, up to the root of the tree */
2411 @REQ(get_window_parents)
2412 user_handle_t handle; /* handle to the window */
2413 @REPLY
2414 int count; /* total count of parents */
2415 VARARG(parents,user_handles); /* parent handles */
2416 @END
2419 /* Get a list of the window children */
2420 @REQ(get_window_children)
2421 obj_handle_t desktop; /* handle to desktop */
2422 user_handle_t parent; /* parent window */
2423 atom_t atom; /* class atom for the listed children */
2424 thread_id_t tid; /* thread owning the listed children */
2425 VARARG(class,unicode_str); /* class name */
2426 @REPLY
2427 int count; /* total count of children */
2428 VARARG(children,user_handles); /* children handles */
2429 @END
2432 /* Get a list of the window children that contain a given point */
2433 @REQ(get_window_children_from_point)
2434 user_handle_t parent; /* parent window */
2435 int x; /* point in parent coordinates */
2436 int y;
2437 @REPLY
2438 int count; /* total count of children */
2439 VARARG(children,user_handles); /* children handles */
2440 @END
2443 /* Get window tree information from a window handle */
2444 @REQ(get_window_tree)
2445 user_handle_t handle; /* handle to the window */
2446 @REPLY
2447 user_handle_t parent; /* parent window */
2448 user_handle_t owner; /* owner window */
2449 user_handle_t next_sibling; /* next sibling in Z-order */
2450 user_handle_t prev_sibling; /* prev sibling in Z-order */
2451 user_handle_t first_sibling; /* first sibling in Z-order */
2452 user_handle_t last_sibling; /* last sibling in Z-order */
2453 user_handle_t first_child; /* first child */
2454 user_handle_t last_child; /* last child */
2455 @END
2457 /* Set the position and Z order of a window */
2458 @REQ(set_window_pos)
2459 unsigned short swp_flags; /* SWP_* flags */
2460 unsigned short paint_flags; /* paint flags (see below) */
2461 user_handle_t handle; /* handle to the window */
2462 user_handle_t previous; /* previous window in Z order */
2463 rectangle_t window; /* window rectangle (in parent coords) */
2464 rectangle_t client; /* client rectangle (in parent coords) */
2465 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2466 @REPLY
2467 unsigned int new_style; /* new window style */
2468 unsigned int new_ex_style; /* new window extended style */
2469 user_handle_t surface_win; /* window that needs a surface update */
2470 @END
2471 #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */
2472 #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */
2474 /* Get the window and client rectangles of a window */
2475 @REQ(get_window_rectangles)
2476 user_handle_t handle; /* handle to the window */
2477 int relative; /* coords relative to (see below) */
2478 @REPLY
2479 rectangle_t window; /* window rectangle */
2480 rectangle_t visible; /* visible part of the window rectangle */
2481 rectangle_t client; /* client rectangle */
2482 @END
2483 enum coords_relative
2485 COORDS_CLIENT, /* relative to client area */
2486 COORDS_WINDOW, /* relative to whole window area */
2487 COORDS_PARENT, /* relative to parent's client area */
2488 COORDS_SCREEN /* relative to screen origin */
2492 /* Get the window text */
2493 @REQ(get_window_text)
2494 user_handle_t handle; /* handle to the window */
2495 @REPLY
2496 VARARG(text,unicode_str); /* window text */
2497 @END
2500 /* Set the window text */
2501 @REQ(set_window_text)
2502 user_handle_t handle; /* handle to the window */
2503 VARARG(text,unicode_str); /* window text */
2504 @END
2507 /* Get the coordinates offset between two windows */
2508 @REQ(get_windows_offset)
2509 user_handle_t from; /* handle to the first window */
2510 user_handle_t to; /* handle to the second window */
2511 @REPLY
2512 int x; /* x coordinate offset */
2513 int y; /* y coordinate offset */
2514 int mirror; /* whether to mirror the x coordinate */
2515 @END
2518 /* Get the visible region of a window */
2519 @REQ(get_visible_region)
2520 user_handle_t window; /* handle to the window */
2521 unsigned int flags; /* DCX flags */
2522 @REPLY
2523 user_handle_t top_win; /* top window to clip against */
2524 rectangle_t top_rect; /* top window visible rect with screen coords */
2525 rectangle_t win_rect; /* window rect in screen coords */
2526 unsigned int paint_flags; /* paint flags (from SET_WINPOS_* flags) */
2527 data_size_t total_size; /* total size of the resulting region */
2528 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2529 @END
2532 /* Get the visible surface region of a window */
2533 @REQ(get_surface_region)
2534 user_handle_t window; /* handle to the window */
2535 @REPLY
2536 rectangle_t visible_rect; /* window visible rect in screen coords */
2537 data_size_t total_size; /* total size of the resulting region */
2538 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2539 @END
2542 /* Get the window region */
2543 @REQ(get_window_region)
2544 user_handle_t window; /* handle to the window */
2545 @REPLY
2546 data_size_t total_size; /* total size of the resulting region */
2547 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2548 @END
2551 /* Set the window region */
2552 @REQ(set_window_region)
2553 user_handle_t window; /* handle to the window */
2554 int redraw; /* redraw the window? */
2555 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2556 @END
2559 /* Get the window update region */
2560 @REQ(get_update_region)
2561 user_handle_t window; /* handle to the window */
2562 user_handle_t from_child; /* child to start searching from */
2563 unsigned int flags; /* update flags (see below) */
2564 @REPLY
2565 user_handle_t child; /* child to repaint (or window itself) */
2566 unsigned int flags; /* resulting update flags (see below) */
2567 data_size_t total_size; /* total size of the resulting region */
2568 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2569 @END
2570 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2571 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2572 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2573 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2574 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2575 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2576 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2577 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2580 /* Update the z order of a window so that a given rectangle is fully visible */
2581 @REQ(update_window_zorder)
2582 user_handle_t window; /* handle to the window */
2583 rectangle_t rect; /* rectangle that must be visible (in client coords) */
2584 @END
2587 /* Mark parts of a window as needing a redraw */
2588 @REQ(redraw_window)
2589 user_handle_t window; /* handle to the window */
2590 unsigned int flags; /* RDW_* flags */
2591 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2592 @END
2595 /* Set a window property */
2596 @REQ(set_window_property)
2597 user_handle_t window; /* handle to the window */
2598 lparam_t data; /* data to store */
2599 atom_t atom; /* property atom (if no name specified) */
2600 VARARG(name,unicode_str); /* property name */
2601 @END
2604 /* Remove a window property */
2605 @REQ(remove_window_property)
2606 user_handle_t window; /* handle to the window */
2607 atom_t atom; /* property atom (if no name specified) */
2608 VARARG(name,unicode_str); /* property name */
2609 @REPLY
2610 lparam_t data; /* data stored in property */
2611 @END
2614 /* Get a window property */
2615 @REQ(get_window_property)
2616 user_handle_t window; /* handle to the window */
2617 atom_t atom; /* property atom (if no name specified) */
2618 VARARG(name,unicode_str); /* property name */
2619 @REPLY
2620 lparam_t data; /* data stored in property */
2621 @END
2624 /* Get the list of properties of a window */
2625 @REQ(get_window_properties)
2626 user_handle_t window; /* handle to the window */
2627 @REPLY
2628 int total; /* total number of properties */
2629 VARARG(props,properties); /* list of properties */
2630 @END
2633 /* Create a window station */
2634 @REQ(create_winstation)
2635 unsigned int flags; /* window station flags */
2636 unsigned int access; /* wanted access rights */
2637 unsigned int attributes; /* object attributes */
2638 VARARG(name,unicode_str); /* object name */
2639 @REPLY
2640 obj_handle_t handle; /* handle to the window station */
2641 @END
2644 /* Open a handle to a window station */
2645 @REQ(open_winstation)
2646 unsigned int access; /* wanted access rights */
2647 unsigned int attributes; /* object attributes */
2648 VARARG(name,unicode_str); /* object name */
2649 @REPLY
2650 obj_handle_t handle; /* handle to the window station */
2651 @END
2654 /* Close a window station */
2655 @REQ(close_winstation)
2656 obj_handle_t handle; /* handle to the window station */
2657 @END
2660 /* Get the process current window station */
2661 @REQ(get_process_winstation)
2662 @REPLY
2663 obj_handle_t handle; /* handle to the window station */
2664 @END
2667 /* Set the process current window station */
2668 @REQ(set_process_winstation)
2669 obj_handle_t handle; /* handle to the window station */
2670 @END
2673 /* Enumerate window stations */
2674 @REQ(enum_winstation)
2675 unsigned int index; /* current index */
2676 @REPLY
2677 unsigned int next; /* next index */
2678 VARARG(name,unicode_str); /* window station name */
2679 @END
2682 /* Create a desktop */
2683 @REQ(create_desktop)
2684 unsigned int flags; /* desktop flags */
2685 unsigned int access; /* wanted access rights */
2686 unsigned int attributes; /* object attributes */
2687 VARARG(name,unicode_str); /* object name */
2688 @REPLY
2689 obj_handle_t handle; /* handle to the desktop */
2690 @END
2693 /* Open a handle to a desktop */
2694 @REQ(open_desktop)
2695 obj_handle_t winsta; /* window station to open (null allowed) */
2696 unsigned int flags; /* desktop flags */
2697 unsigned int access; /* wanted access rights */
2698 unsigned int attributes; /* object attributes */
2699 VARARG(name,unicode_str); /* object name */
2700 @REPLY
2701 obj_handle_t handle; /* handle to the desktop */
2702 @END
2705 /* Open a handle to current input desktop */
2706 @REQ(open_input_desktop)
2707 unsigned int flags; /* desktop flags */
2708 unsigned int access; /* wanted access rights */
2709 unsigned int attributes; /* object attributes */
2710 @REPLY
2711 obj_handle_t handle; /* handle to the desktop */
2712 @END
2715 /* Close a desktop */
2716 @REQ(close_desktop)
2717 obj_handle_t handle; /* handle to the desktop */
2718 @END
2721 /* Get the thread current desktop */
2722 @REQ(get_thread_desktop)
2723 thread_id_t tid; /* thread id */
2724 @REPLY
2725 obj_handle_t handle; /* handle to the desktop */
2726 @END
2729 /* Set the thread current desktop */
2730 @REQ(set_thread_desktop)
2731 obj_handle_t handle; /* handle to the desktop */
2732 @END
2735 /* Enumerate desktops */
2736 @REQ(enum_desktop)
2737 obj_handle_t winstation; /* handle to the window station */
2738 unsigned int index; /* current index */
2739 @REPLY
2740 unsigned int next; /* next index */
2741 VARARG(name,unicode_str); /* window station name */
2742 @END
2745 /* Get/set information about a user object (window station or desktop) */
2746 @REQ(set_user_object_info)
2747 obj_handle_t handle; /* handle to the object */
2748 unsigned int flags; /* information to set */
2749 unsigned int obj_flags; /* new object flags */
2750 @REPLY
2751 int is_desktop; /* is object a desktop? */
2752 unsigned int old_obj_flags; /* old object flags */
2753 VARARG(name,unicode_str); /* object name */
2754 @END
2755 #define SET_USER_OBJECT_FLAGS 1
2758 /* Register a hotkey */
2759 @REQ(register_hotkey)
2760 user_handle_t window; /* handle to the window */
2761 int id; /* hotkey identifier */
2762 unsigned int flags; /* modifier keys */
2763 unsigned int vkey; /* virtual key code */
2764 @REPLY
2765 int replaced; /* did we replace an existing hotkey? */
2766 unsigned int flags; /* flags of replaced hotkey */
2767 unsigned int vkey; /* virtual key code of replaced hotkey */
2768 @END
2771 /* Unregister a hotkey */
2772 @REQ(unregister_hotkey)
2773 user_handle_t window; /* handle to the window */
2774 int id; /* hotkey identifier */
2775 @REPLY
2776 unsigned int flags; /* flags of removed hotkey */
2777 unsigned int vkey; /* virtual key code of removed hotkey */
2778 @END
2781 /* Attach (or detach) thread inputs */
2782 @REQ(attach_thread_input)
2783 thread_id_t tid_from; /* thread to be attached */
2784 thread_id_t tid_to; /* thread to which tid_from should be attached */
2785 int attach; /* is it an attach? */
2786 @END
2789 /* Get input data for a given thread */
2790 @REQ(get_thread_input)
2791 thread_id_t tid; /* id of thread */
2792 @REPLY
2793 user_handle_t focus; /* handle to the focus window */
2794 user_handle_t capture; /* handle to the capture window */
2795 user_handle_t active; /* handle to the active window */
2796 user_handle_t foreground; /* handle to the global foreground window */
2797 user_handle_t menu_owner; /* handle to the menu owner */
2798 user_handle_t move_size; /* handle to the moving/resizing window */
2799 user_handle_t caret; /* handle to the caret window */
2800 user_handle_t cursor; /* handle to the cursor */
2801 int show_count; /* cursor show count */
2802 rectangle_t rect; /* caret rectangle */
2803 @END
2806 /* Get the time of the last input event */
2807 @REQ(get_last_input_time)
2808 @REPLY
2809 unsigned int time;
2810 @END
2813 /* Retrieve queue keyboard state for a given thread */
2814 @REQ(get_key_state)
2815 thread_id_t tid; /* id of thread */
2816 int key; /* optional key code or -1 */
2817 @REPLY
2818 unsigned char state; /* state of specified key */
2819 VARARG(keystate,bytes); /* state array for all the keys */
2820 @END
2822 /* Set queue keyboard state for a given thread */
2823 @REQ(set_key_state)
2824 thread_id_t tid; /* id of thread */
2825 int async; /* whether to change the async state too */
2826 VARARG(keystate,bytes); /* state array for all the keys */
2827 @END
2829 /* Set the system foreground window */
2830 @REQ(set_foreground_window)
2831 user_handle_t handle; /* handle to the foreground window */
2832 @REPLY
2833 user_handle_t previous; /* handle to the previous foreground window */
2834 int send_msg_old; /* whether we have to send a msg to the old window */
2835 int send_msg_new; /* whether we have to send a msg to the new window */
2836 @END
2838 /* Set the current thread focus window */
2839 @REQ(set_focus_window)
2840 user_handle_t handle; /* handle to the focus window */
2841 @REPLY
2842 user_handle_t previous; /* handle to the previous focus window */
2843 @END
2845 /* Set the current thread active window */
2846 @REQ(set_active_window)
2847 user_handle_t handle; /* handle to the active window */
2848 @REPLY
2849 user_handle_t previous; /* handle to the previous active window */
2850 @END
2852 /* Set the current thread capture window */
2853 @REQ(set_capture_window)
2854 user_handle_t handle; /* handle to the capture window */
2855 unsigned int flags; /* capture flags (see below) */
2856 @REPLY
2857 user_handle_t previous; /* handle to the previous capture window */
2858 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2859 @END
2860 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2861 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2864 /* Set the current thread caret window */
2865 @REQ(set_caret_window)
2866 user_handle_t handle; /* handle to the caret window */
2867 int width; /* caret width */
2868 int height; /* caret height */
2869 @REPLY
2870 user_handle_t previous; /* handle to the previous caret window */
2871 rectangle_t old_rect; /* previous caret rectangle */
2872 int old_hide; /* previous hide count */
2873 int old_state; /* previous caret state (1=on, 0=off) */
2874 @END
2877 /* Set the current thread caret information */
2878 @REQ(set_caret_info)
2879 unsigned int flags; /* caret flags (see below) */
2880 user_handle_t handle; /* handle to the caret window */
2881 int x; /* caret x position */
2882 int y; /* caret y position */
2883 int hide; /* increment for hide count (can be negative to show it) */
2884 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2885 @REPLY
2886 user_handle_t full_handle; /* handle to the current caret window */
2887 rectangle_t old_rect; /* previous caret rectangle */
2888 int old_hide; /* previous hide count */
2889 int old_state; /* previous caret state (1=on, 0=off) */
2890 @END
2891 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2892 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2893 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2896 /* Set a window hook */
2897 @REQ(set_hook)
2898 int id; /* id of the hook */
2899 process_id_t pid; /* id of process to set the hook into */
2900 thread_id_t tid; /* id of thread to set the hook into */
2901 int event_min;
2902 int event_max;
2903 client_ptr_t proc; /* hook procedure */
2904 int flags;
2905 int unicode; /* is it a unicode hook? */
2906 VARARG(module,unicode_str); /* module name */
2907 @REPLY
2908 user_handle_t handle; /* handle to the hook */
2909 unsigned int active_hooks; /* active hooks bitmap */
2910 @END
2913 /* Remove a window hook */
2914 @REQ(remove_hook)
2915 user_handle_t handle; /* handle to the hook */
2916 client_ptr_t proc; /* hook procedure if handle is 0 */
2917 int id; /* id of the hook if handle is 0 */
2918 @REPLY
2919 unsigned int active_hooks; /* active hooks bitmap */
2920 @END
2923 /* Start calling a hook chain */
2924 @REQ(start_hook_chain)
2925 int id; /* id of the hook */
2926 int event; /* signalled event */
2927 user_handle_t window; /* handle to the event window */
2928 int object_id; /* object id for out of context winevent */
2929 int child_id; /* child id for out of context winevent */
2930 @REPLY
2931 user_handle_t handle; /* handle to the next hook */
2932 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2933 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2934 int unicode; /* is it a unicode hook? */
2935 client_ptr_t proc; /* hook procedure */
2936 unsigned int active_hooks; /* active hooks bitmap */
2937 VARARG(module,unicode_str); /* module name */
2938 @END
2941 /* Finished calling a hook chain */
2942 @REQ(finish_hook_chain)
2943 int id; /* id of the hook */
2944 @END
2947 /* Get the hook information */
2948 @REQ(get_hook_info)
2949 user_handle_t handle; /* handle to the current hook */
2950 int get_next; /* do we want info about current or next hook? */
2951 int event; /* signalled event */
2952 user_handle_t window; /* handle to the event window */
2953 int object_id; /* object id for out of context winevent */
2954 int child_id; /* child id for out of context winevent */
2955 @REPLY
2956 user_handle_t handle; /* handle to the hook */
2957 int id; /* id of the hook */
2958 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2959 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2960 client_ptr_t proc; /* hook procedure */
2961 int unicode; /* is it a unicode hook? */
2962 VARARG(module,unicode_str); /* module name */
2963 @END
2966 /* Create a window class */
2967 @REQ(create_class)
2968 int local; /* is it a local class? */
2969 atom_t atom; /* class atom */
2970 unsigned int style; /* class style */
2971 mod_handle_t instance; /* module instance */
2972 int extra; /* number of extra class bytes */
2973 int win_extra; /* number of window extra bytes */
2974 client_ptr_t client_ptr; /* pointer to class in client address space */
2975 VARARG(name,unicode_str); /* class name */
2976 @REPLY
2977 atom_t atom; /* resulting class atom */
2978 @END
2981 /* Destroy a window class */
2982 @REQ(destroy_class)
2983 atom_t atom; /* class atom */
2984 mod_handle_t instance; /* module instance */
2985 VARARG(name,unicode_str); /* class name */
2986 @REPLY
2987 client_ptr_t client_ptr; /* pointer to class in client address space */
2988 @END
2991 /* Set some information in a class */
2992 @REQ(set_class_info)
2993 user_handle_t window; /* handle to the window */
2994 unsigned int flags; /* flags for info to set (see below) */
2995 atom_t atom; /* class atom */
2996 unsigned int style; /* class style */
2997 int win_extra; /* number of window extra bytes */
2998 mod_handle_t instance; /* module instance */
2999 int extra_offset; /* offset to set in extra bytes */
3000 data_size_t extra_size; /* size to set in extra bytes */
3001 lparam_t extra_value; /* value to set in extra bytes */
3002 @REPLY
3003 atom_t old_atom; /* previous class atom */
3004 unsigned int old_style; /* previous class style */
3005 int old_extra; /* previous number of class extra bytes */
3006 int old_win_extra; /* previous number of window extra bytes */
3007 mod_handle_t old_instance; /* previous module instance */
3008 lparam_t old_extra_value; /* old value in extra bytes */
3009 @END
3010 #define SET_CLASS_ATOM 0x0001
3011 #define SET_CLASS_STYLE 0x0002
3012 #define SET_CLASS_WINEXTRA 0x0004
3013 #define SET_CLASS_INSTANCE 0x0008
3014 #define SET_CLASS_EXTRA 0x0010
3017 /* Set/get clipboard information */
3018 @REQ(set_clipboard_info)
3019 unsigned int flags; /* flags for fields to set (see below) */
3020 user_handle_t clipboard; /* clipboard window */
3021 user_handle_t owner; /* clipboard owner */
3022 user_handle_t viewer; /* first clipboard viewer */
3023 unsigned int seqno; /* change sequence number */
3024 @REPLY
3025 unsigned int flags; /* status flags (see below) */
3026 user_handle_t old_clipboard; /* old clipboard window */
3027 user_handle_t old_owner; /* old clipboard owner */
3028 user_handle_t old_viewer; /* old clipboard viewer */
3029 unsigned int seqno; /* current sequence number */
3030 @END
3032 #define SET_CB_OPEN 0x001
3033 #define SET_CB_OWNER 0x002
3034 #define SET_CB_VIEWER 0x004
3035 #define SET_CB_SEQNO 0x008
3036 #define SET_CB_RELOWNER 0x010
3037 #define SET_CB_CLOSE 0x020
3038 #define CB_OPEN 0x040
3039 #define CB_OWNER 0x080
3040 #define CB_PROCESS 0x100
3043 /* Open a security token */
3044 @REQ(open_token)
3045 obj_handle_t handle; /* handle to the thread or process */
3046 unsigned int access; /* access rights to the new token */
3047 unsigned int attributes;/* object attributes */
3048 unsigned int flags; /* flags (see below) */
3049 @REPLY
3050 obj_handle_t token; /* handle to the token */
3051 @END
3052 #define OPEN_TOKEN_THREAD 1
3053 #define OPEN_TOKEN_AS_SELF 2
3056 /* Set/get the global windows */
3057 @REQ(set_global_windows)
3058 unsigned int flags; /* flags for fields to set (see below) */
3059 user_handle_t shell_window; /* handle to the new shell window */
3060 user_handle_t shell_listview; /* handle to the new shell listview window */
3061 user_handle_t progman_window; /* handle to the new program manager window */
3062 user_handle_t taskman_window; /* handle to the new task manager window */
3063 @REPLY
3064 user_handle_t old_shell_window; /* handle to the shell window */
3065 user_handle_t old_shell_listview; /* handle to the shell listview window */
3066 user_handle_t old_progman_window; /* handle to the new program manager window */
3067 user_handle_t old_taskman_window; /* handle to the new task manager window */
3068 @END
3069 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
3070 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
3071 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
3073 /* Adjust the privileges held by a token */
3074 @REQ(adjust_token_privileges)
3075 obj_handle_t handle; /* handle to the token */
3076 int disable_all; /* disable all privileges? */
3077 int get_modified_state; /* get modified privileges? */
3078 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
3079 @REPLY
3080 unsigned int len; /* total length in bytes required to store token privileges */
3081 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
3082 @END
3084 /* Retrieves the set of privileges held by or available to a token */
3085 @REQ(get_token_privileges)
3086 obj_handle_t handle; /* handle to the token */
3087 @REPLY
3088 unsigned int len; /* total length in bytes required to store token privileges */
3089 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3090 @END
3092 /* Check the token has the required privileges */
3093 @REQ(check_token_privileges)
3094 obj_handle_t handle; /* handle to the token */
3095 int all_required; /* are all the privileges required for the check to succeed? */
3096 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
3097 @REPLY
3098 int has_privileges; /* does the token have the required privileges? */
3099 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3100 @END
3102 @REQ(duplicate_token)
3103 obj_handle_t handle; /* handle to the token to duplicate */
3104 unsigned int access; /* access rights to the new token */
3105 unsigned int attributes; /* object attributes */
3106 int primary; /* is the new token to be a primary one? */
3107 int impersonation_level; /* impersonation level of the new token */
3108 @REPLY
3109 obj_handle_t new_handle; /* duplicated handle */
3110 @END
3112 @REQ(access_check)
3113 obj_handle_t handle; /* handle to the token */
3114 unsigned int desired_access; /* desired access to the object */
3115 unsigned int mapping_read; /* mapping from generic read to specific rights */
3116 unsigned int mapping_write; /* mapping from generic write to specific rights */
3117 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
3118 unsigned int mapping_all; /* mapping from generic all to specific rights */
3119 VARARG(sd,security_descriptor); /* security descriptor to check */
3120 @REPLY
3121 unsigned int access_granted; /* access rights actually granted */
3122 unsigned int access_status; /* was access granted? */
3123 unsigned int privileges_len; /* length needed to store privileges */
3124 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
3125 @END
3127 @REQ(get_token_sid)
3128 obj_handle_t handle; /* handle to the token */
3129 unsigned int which_sid; /* which SID to retrieve from the token */
3130 @REPLY
3131 data_size_t sid_len; /* length needed to store sid */
3132 VARARG(sid,SID); /* the sid specified by which_sid from the token */
3133 @END
3135 @REQ(get_token_groups)
3136 obj_handle_t handle; /* handle to the token */
3137 @REPLY
3138 data_size_t user_len; /* length needed to store user */
3139 VARARG(user,token_groups); /* groups the token's user belongs to */
3140 @END
3142 @REQ(get_token_default_dacl)
3143 obj_handle_t handle; /* handle to the token */
3144 @REPLY
3145 data_size_t acl_len; /* length needed to store access control list */
3146 VARARG(acl,ACL); /* access control list */
3147 @END
3149 @REQ(set_token_default_dacl)
3150 obj_handle_t handle; /* handle to the token */
3151 VARARG(acl,ACL); /* default dacl to set */
3152 @END
3154 @REQ(set_security_object)
3155 obj_handle_t handle; /* handle to the object */
3156 unsigned int security_info; /* which parts of security descriptor to set */
3157 VARARG(sd,security_descriptor); /* security descriptor to set */
3158 @END
3160 @REQ(get_security_object)
3161 obj_handle_t handle; /* handle to the object */
3162 unsigned int security_info; /* which parts of security descriptor to get */
3163 @REPLY
3164 unsigned int sd_len; /* buffer size needed for sd */
3165 VARARG(sd,security_descriptor); /* retrieved security descriptor */
3166 @END
3168 /* Create a mailslot */
3169 @REQ(create_mailslot)
3170 unsigned int access; /* wanted access rights */
3171 unsigned int attributes; /* object attributes */
3172 obj_handle_t rootdir; /* root directory */
3173 timeout_t read_timeout;
3174 unsigned int max_msgsize;
3175 VARARG(name,unicode_str); /* mailslot name */
3176 @REPLY
3177 obj_handle_t handle; /* handle to the mailslot */
3178 @END
3181 /* Set mailslot information */
3182 @REQ(set_mailslot_info)
3183 obj_handle_t handle; /* handle to the mailslot */
3184 timeout_t read_timeout;
3185 unsigned int flags;
3186 @REPLY
3187 timeout_t read_timeout;
3188 unsigned int max_msgsize;
3189 @END
3190 #define MAILSLOT_SET_READ_TIMEOUT 1
3193 /* Create a directory object */
3194 @REQ(create_directory)
3195 unsigned int access; /* access flags */
3196 unsigned int attributes; /* object attributes */
3197 obj_handle_t rootdir; /* root directory */
3198 VARARG(directory_name,unicode_str); /* Directory name */
3199 @REPLY
3200 obj_handle_t handle; /* handle to the directory */
3201 @END
3204 /* Open a directory object */
3205 @REQ(open_directory)
3206 unsigned int access; /* access flags */
3207 unsigned int attributes; /* object attributes */
3208 obj_handle_t rootdir; /* root directory */
3209 VARARG(directory_name,unicode_str); /* Directory name */
3210 @REPLY
3211 obj_handle_t handle; /* handle to the directory */
3212 @END
3215 /* Get a directory entry by index */
3216 @REQ(get_directory_entry)
3217 obj_handle_t handle; /* handle to the directory */
3218 unsigned int index; /* entry index */
3219 @REPLY
3220 data_size_t name_len; /* length of the entry name in bytes */
3221 VARARG(name,unicode_str,name_len); /* entry name */
3222 VARARG(type,unicode_str); /* entry type */
3223 @END
3226 /* Create a symbolic link object */
3227 @REQ(create_symlink)
3228 unsigned int access; /* access flags */
3229 unsigned int attributes; /* object attributes */
3230 obj_handle_t rootdir; /* root directory */
3231 data_size_t name_len; /* length of the symlink name in bytes */
3232 VARARG(name,unicode_str,name_len); /* symlink name */
3233 VARARG(target_name,unicode_str); /* target name */
3234 @REPLY
3235 obj_handle_t handle; /* handle to the symlink */
3236 @END
3239 /* Open a symbolic link object */
3240 @REQ(open_symlink)
3241 unsigned int access; /* access flags */
3242 unsigned int attributes; /* object attributes */
3243 obj_handle_t rootdir; /* root directory */
3244 VARARG(name,unicode_str); /* symlink name */
3245 @REPLY
3246 obj_handle_t handle; /* handle to the symlink */
3247 @END
3250 /* Query a symbolic link object */
3251 @REQ(query_symlink)
3252 obj_handle_t handle; /* handle to the symlink */
3253 @REPLY
3254 data_size_t total; /* total needed size for name */
3255 VARARG(target_name,unicode_str); /* target name */
3256 @END
3259 /* Query basic object information */
3260 @REQ(get_object_info)
3261 obj_handle_t handle; /* handle to the object */
3262 @REPLY
3263 unsigned int access; /* granted access mask */
3264 unsigned int ref_count; /* object ref count */
3265 data_size_t total; /* total needed size for name */
3266 VARARG(name,unicode_str); /* object name */
3267 @END
3270 /* Unlink a named object */
3271 @REQ(unlink_object)
3272 obj_handle_t handle; /* handle to the object */
3273 @END
3276 /* Query the impersonation level of an impersonation token */
3277 @REQ(get_token_impersonation_level)
3278 obj_handle_t handle; /* handle to the object */
3279 @REPLY
3280 int impersonation_level; /* impersonation level of the impersonation token */
3281 @END
3283 /* Allocate a locally-unique identifier */
3284 @REQ(allocate_locally_unique_id)
3285 @REPLY
3286 luid_t luid;
3287 @END
3290 /* Create a device manager */
3291 @REQ(create_device_manager)
3292 unsigned int access; /* wanted access rights */
3293 unsigned int attributes; /* object attributes */
3294 @REPLY
3295 obj_handle_t handle; /* handle to the device */
3296 @END
3299 /* Create a device */
3300 @REQ(create_device)
3301 unsigned int access; /* wanted access rights */
3302 unsigned int attributes; /* object attributes */
3303 obj_handle_t rootdir; /* root directory */
3304 client_ptr_t user_ptr; /* opaque ptr for use by client */
3305 obj_handle_t manager; /* device manager */
3306 VARARG(name,unicode_str); /* object name */
3307 @REPLY
3308 obj_handle_t handle; /* handle to the device */
3309 @END
3312 /* Delete a device */
3313 @REQ(delete_device)
3314 obj_handle_t handle; /* handle to the device */
3315 @END
3318 /* Retrieve the next pending device ioctl request */
3319 @REQ(get_next_device_request)
3320 obj_handle_t manager; /* handle to the device manager */
3321 obj_handle_t prev; /* handle to the previous ioctl */
3322 unsigned int status; /* status of the previous ioctl */
3323 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3324 @REPLY
3325 obj_handle_t next; /* handle to the next ioctl */
3326 ioctl_code_t code; /* ioctl code */
3327 client_ptr_t user_ptr; /* opaque ptr for the device */
3328 process_id_t client_pid; /* pid of process calling ioctl */
3329 thread_id_t client_tid; /* tid of thread calling ioctl */
3330 data_size_t in_size; /* total needed input size */
3331 data_size_t out_size; /* needed output size */
3332 VARARG(next_data,bytes); /* input data of the next ioctl */
3333 @END
3336 /* Make the current process a system process */
3337 @REQ(make_process_system)
3338 @REPLY
3339 obj_handle_t event; /* event signaled when all user processes have exited */
3340 @END
3343 /* Get detailed fixed-size information about a token */
3344 @REQ(get_token_statistics)
3345 obj_handle_t handle; /* handle to the object */
3346 @REPLY
3347 luid_t token_id; /* locally-unique identifier of the token */
3348 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3349 int primary; /* is the token primary or impersonation? */
3350 int impersonation_level; /* level of impersonation */
3351 int group_count; /* the number of groups the token is a member of */
3352 int privilege_count; /* the number of privileges the token has */
3353 @END
3356 /* Create I/O completion port */
3357 @REQ(create_completion)
3358 unsigned int access; /* desired access to a port */
3359 unsigned int attributes; /* object attributes */
3360 unsigned int concurrent; /* max number of concurrent active threads */
3361 obj_handle_t rootdir; /* root directory */
3362 VARARG(filename,string); /* port name */
3363 @REPLY
3364 obj_handle_t handle; /* port handle */
3365 @END
3368 /* Open I/O completion port */
3369 @REQ(open_completion)
3370 unsigned int access; /* desired access to a port */
3371 unsigned int attributes; /* object attributes */
3372 obj_handle_t rootdir; /* root directory */
3373 VARARG(filename,string); /* port name */
3374 @REPLY
3375 obj_handle_t handle; /* port handle */
3376 @END
3379 /* add completion to completion port */
3380 @REQ(add_completion)
3381 obj_handle_t handle; /* port handle */
3382 apc_param_t ckey; /* completion key */
3383 apc_param_t cvalue; /* completion value */
3384 apc_param_t information; /* IO_STATUS_BLOCK Information */
3385 unsigned int status; /* completion result */
3386 @END
3389 /* get completion from completion port queue */
3390 @REQ(remove_completion)
3391 obj_handle_t handle; /* port handle */
3392 @REPLY
3393 apc_param_t ckey; /* completion key */
3394 apc_param_t cvalue; /* completion value */
3395 apc_param_t information; /* IO_STATUS_BLOCK Information */
3396 unsigned int status; /* completion result */
3397 @END
3400 /* get completion queue depth */
3401 @REQ(query_completion)
3402 obj_handle_t handle; /* port handle */
3403 @REPLY
3404 unsigned int depth; /* completion queue depth */
3405 @END
3408 /* associate object with completion port */
3409 @REQ(set_completion_info)
3410 obj_handle_t handle; /* object handle */
3411 apc_param_t ckey; /* completion key */
3412 obj_handle_t chandle; /* port handle */
3413 @END
3416 /* check for associated completion and push msg */
3417 @REQ(add_fd_completion)
3418 obj_handle_t handle; /* async' object */
3419 apc_param_t cvalue; /* completion value */
3420 apc_param_t information; /* IO_STATUS_BLOCK Information */
3421 unsigned int status; /* completion status */
3422 @END
3425 /* Retrieve layered info for a window */
3426 @REQ(get_window_layered_info)
3427 user_handle_t handle; /* handle to the window */
3428 @REPLY
3429 unsigned int color_key; /* color key */
3430 unsigned int alpha; /* alpha (0..255) */
3431 unsigned int flags; /* LWA_* flags */
3432 @END
3435 /* Set layered info for a window */
3436 @REQ(set_window_layered_info)
3437 user_handle_t handle; /* handle to the window */
3438 unsigned int color_key; /* color key */
3439 unsigned int alpha; /* alpha (0..255) */
3440 unsigned int flags; /* LWA_* flags */
3441 @END
3444 /* Allocate an arbitrary user handle */
3445 @REQ(alloc_user_handle)
3446 @REPLY
3447 user_handle_t handle; /* allocated handle */
3448 @END
3451 /* Free an arbitrary user handle */
3452 @REQ(free_user_handle)
3453 user_handle_t handle; /* handle to free*/
3454 @END
3457 /* Set/get the current cursor */
3458 @REQ(set_cursor)
3459 unsigned int flags; /* flags for fields to set (see below) */
3460 user_handle_t handle; /* handle to the cursor */
3461 int show_count; /* show count increment/decrement */
3462 int x; /* cursor position */
3463 int y;
3464 rectangle_t clip; /* cursor clip rectangle */
3465 unsigned int clip_msg; /* message to post on cursor clip changes */
3466 @REPLY
3467 user_handle_t prev_handle; /* previous handle */
3468 int prev_count; /* previous show count */
3469 int prev_x; /* previous position */
3470 int prev_y;
3471 int new_x; /* new position */
3472 int new_y;
3473 rectangle_t new_clip; /* new clip rectangle */
3474 unsigned int last_change; /* time of last position change */
3475 @END
3476 #define SET_CURSOR_HANDLE 0x01
3477 #define SET_CURSOR_COUNT 0x02
3478 #define SET_CURSOR_POS 0x04
3479 #define SET_CURSOR_CLIP 0x08
3480 #define SET_CURSOR_NOCLIP 0x10
3483 /* Modify the list of registered rawinput devices */
3484 @REQ(update_rawinput_devices)
3485 VARARG(devices,rawinput_devices);
3486 @END
3489 /* Retrieve the suspended context of a thread */
3490 @REQ(get_suspend_context)
3491 @REPLY
3492 VARARG(context,context); /* thread context */
3493 @END
3496 /* Store the suspend context of a thread */
3497 @REQ(set_suspend_context)
3498 VARARG(context,context); /* thread context */
3499 @END