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