ddraw: Create textures for swapchain surfaces.
[wine.git] / server / protocol.def
blob3c3b0b53e12baf68768a5a61a7f119d7fa539406
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 data_size_t info_size; /* size of startup info */
685 VARARG(info,startup_info,info_size); /* startup information */
686 VARARG(env,unicode_str); /* environment for new process */
687 @REPLY
688 obj_handle_t info; /* new process info handle */
689 process_id_t pid; /* process id */
690 obj_handle_t phandle; /* process handle (in the current process) */
691 thread_id_t tid; /* thread id */
692 obj_handle_t thandle; /* thread handle (in the current process) */
693 @END
696 /* Retrieve information about a newly started process */
697 @REQ(get_new_process_info)
698 obj_handle_t info; /* info handle returned from new_process_request */
699 @REPLY
700 int success; /* did the process start successfully? */
701 int exit_code; /* process exit code if failed */
702 @END
705 /* Create a new thread from the context of the parent */
706 @REQ(new_thread)
707 unsigned int access; /* wanted access rights */
708 unsigned int attributes; /* object attributes */
709 int suspend; /* new thread should be suspended on creation */
710 int request_fd; /* fd for request pipe */
711 @REPLY
712 thread_id_t tid; /* thread id */
713 obj_handle_t handle; /* thread handle (in the current process) */
714 @END
717 /* Retrieve the new process startup info */
718 @REQ(get_startup_info)
719 @REPLY
720 obj_handle_t exe_file; /* file handle for main exe */
721 data_size_t info_size; /* size of startup info */
722 VARARG(info,startup_info,info_size); /* startup information */
723 VARARG(env,unicode_str); /* environment */
724 @END
727 /* Signal the end of the process initialization */
728 @REQ(init_process_done)
729 int gui; /* is it a GUI process? */
730 mod_handle_t module; /* main module base address */
731 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
732 client_ptr_t entry; /* process entry point */
733 @END
736 /* Initialize a thread; called from the child after fork()/clone() */
737 @REQ(init_thread)
738 int unix_pid; /* Unix pid of new thread */
739 int unix_tid; /* Unix tid of new thread */
740 int debug_level; /* new debug level */
741 client_ptr_t teb; /* TEB of new thread (in thread address space) */
742 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
743 int reply_fd; /* fd for reply pipe */
744 int wait_fd; /* fd for blocking calls pipe */
745 cpu_type_t cpu; /* CPU that this thread is running on */
746 @REPLY
747 process_id_t pid; /* process id of the new thread's process */
748 thread_id_t tid; /* thread id of the new thread */
749 timeout_t server_start; /* server start time */
750 data_size_t info_size; /* total size of startup info */
751 int version; /* protocol version */
752 unsigned int all_cpus; /* bitset of supported CPUs */
753 @END
756 /* Terminate a process */
757 @REQ(terminate_process)
758 obj_handle_t handle; /* process handle to terminate */
759 int exit_code; /* process exit code */
760 @REPLY
761 int self; /* suicide? */
762 @END
765 /* Terminate a thread */
766 @REQ(terminate_thread)
767 obj_handle_t handle; /* thread handle to terminate */
768 int exit_code; /* thread exit code */
769 @REPLY
770 int self; /* suicide? */
771 int last; /* last thread in this process? */
772 @END
775 /* Retrieve information about a process */
776 @REQ(get_process_info)
777 obj_handle_t handle; /* process handle */
778 @REPLY
779 process_id_t pid; /* server process id */
780 process_id_t ppid; /* server process id of parent */
781 affinity_t affinity; /* process affinity mask */
782 client_ptr_t peb; /* PEB address in process address space */
783 timeout_t start_time; /* process start time */
784 timeout_t end_time; /* process end time */
785 int exit_code; /* process exit code */
786 int priority; /* priority class */
787 cpu_type_t cpu; /* CPU that this process is running on */
788 int debugger_present; /* process is being debugged */
789 @END
792 /* Set a process information */
793 @REQ(set_process_info)
794 obj_handle_t handle; /* process handle */
795 int mask; /* setting mask (see below) */
796 int priority; /* priority class */
797 affinity_t affinity; /* affinity mask */
798 @END
799 #define SET_PROCESS_INFO_PRIORITY 0x01
800 #define SET_PROCESS_INFO_AFFINITY 0x02
803 /* Retrieve information about a thread */
804 @REQ(get_thread_info)
805 obj_handle_t handle; /* thread handle */
806 thread_id_t tid_in; /* thread id (optional) */
807 @REPLY
808 process_id_t pid; /* server process id */
809 thread_id_t tid; /* server thread id */
810 client_ptr_t teb; /* thread teb pointer */
811 affinity_t affinity; /* thread affinity mask */
812 timeout_t creation_time; /* thread creation time */
813 timeout_t exit_time; /* thread exit time */
814 int exit_code; /* thread exit code */
815 int priority; /* thread priority level */
816 int last; /* last thread in process */
817 @END
820 /* Set a thread information */
821 @REQ(set_thread_info)
822 obj_handle_t handle; /* thread handle */
823 int mask; /* setting mask (see below) */
824 int priority; /* priority class */
825 affinity_t affinity; /* affinity mask */
826 obj_handle_t token; /* impersonation token */
827 @END
828 #define SET_THREAD_INFO_PRIORITY 0x01
829 #define SET_THREAD_INFO_AFFINITY 0x02
830 #define SET_THREAD_INFO_TOKEN 0x04
833 /* Retrieve information about a module */
834 @REQ(get_dll_info)
835 obj_handle_t handle; /* process handle */
836 mod_handle_t base_address; /* base address of module */
837 @REPLY
838 client_ptr_t entry_point;
839 data_size_t size; /* module size */
840 data_size_t filename_len; /* buffer len in bytes required to store filename */
841 VARARG(filename,unicode_str); /* file name of module */
842 @END
845 /* Suspend a thread */
846 @REQ(suspend_thread)
847 obj_handle_t handle; /* thread handle */
848 @REPLY
849 int count; /* new suspend count */
850 @END
853 /* Resume a thread */
854 @REQ(resume_thread)
855 obj_handle_t handle; /* thread handle */
856 @REPLY
857 int count; /* new suspend count */
858 @END
861 /* Notify the server that a dll has been loaded */
862 @REQ(load_dll)
863 obj_handle_t mapping; /* file mapping handle */
864 mod_handle_t base; /* base address */
865 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
866 data_size_t size; /* dll size */
867 int dbg_offset; /* debug info offset */
868 int dbg_size; /* debug info size */
869 VARARG(filename,unicode_str); /* file name of dll */
870 @END
873 /* Notify the server that a dll is being unloaded */
874 @REQ(unload_dll)
875 mod_handle_t base; /* base address */
876 @END
879 /* Queue an APC for a thread or process */
880 @REQ(queue_apc)
881 obj_handle_t handle; /* thread or process handle */
882 apc_call_t call; /* call arguments */
883 @REPLY
884 obj_handle_t handle; /* APC handle */
885 int self; /* run APC in caller itself? */
886 @END
889 /* Get the result of an APC call */
890 @REQ(get_apc_result)
891 obj_handle_t handle; /* handle to the APC */
892 @REPLY
893 apc_result_t result; /* result of the APC */
894 @END
897 /* Close a handle for the current process */
898 @REQ(close_handle)
899 obj_handle_t handle; /* handle to close */
900 @END
903 /* Set a handle information */
904 @REQ(set_handle_info)
905 obj_handle_t handle; /* handle we are interested in */
906 int flags; /* new handle flags */
907 int mask; /* mask for flags to set */
908 @REPLY
909 int old_flags; /* old flag value */
910 @END
913 /* Duplicate a handle */
914 @REQ(dup_handle)
915 obj_handle_t src_process; /* src process handle */
916 obj_handle_t src_handle; /* src handle to duplicate */
917 obj_handle_t dst_process; /* dst process handle */
918 unsigned int access; /* wanted access rights */
919 unsigned int attributes; /* object attributes */
920 unsigned int options; /* duplicate options (see below) */
921 @REPLY
922 obj_handle_t handle; /* duplicated handle in dst process */
923 int self; /* is the source the current process? */
924 int closed; /* whether the source handle has been closed */
925 @END
926 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
927 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
928 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
931 /* Open a handle to a process */
932 @REQ(open_process)
933 process_id_t pid; /* process id to open */
934 unsigned int access; /* wanted access rights */
935 unsigned int attributes; /* object attributes */
936 @REPLY
937 obj_handle_t handle; /* handle to the process */
938 @END
941 /* Open a handle to a thread */
942 @REQ(open_thread)
943 thread_id_t tid; /* thread id to open */
944 unsigned int access; /* wanted access rights */
945 unsigned int attributes; /* object attributes */
946 @REPLY
947 obj_handle_t handle; /* handle to the thread */
948 @END
951 /* Wait for handles */
952 @REQ(select)
953 int flags; /* wait flags (see below) */
954 client_ptr_t cookie; /* magic cookie to return to client */
955 timeout_t timeout; /* timeout */
956 obj_handle_t prev_apc; /* handle to previous APC */
957 VARARG(result,apc_result); /* result of previous APC */
958 VARARG(data,select_op); /* operation-specific data */
959 @REPLY
960 timeout_t timeout; /* timeout converted to absolute */
961 apc_call_t call; /* APC call arguments */
962 obj_handle_t apc_handle; /* handle to next APC */
963 @END
964 #define SELECT_ALERTABLE 1
965 #define SELECT_INTERRUPTIBLE 2
968 /* Create an event */
969 @REQ(create_event)
970 unsigned int access; /* wanted access rights */
971 unsigned int attributes; /* object attributes */
972 int manual_reset; /* manual reset event */
973 int initial_state; /* initial state of the event */
974 VARARG(objattr,object_attributes); /* object attributes */
975 @REPLY
976 obj_handle_t handle; /* handle to the event */
977 @END
979 /* Event operation */
980 @REQ(event_op)
981 obj_handle_t handle; /* handle to event */
982 int op; /* event operation (see below) */
983 @END
984 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
986 @REQ(query_event)
987 obj_handle_t handle; /* handle to event */
988 @REPLY
989 int manual_reset; /* manual reset event */
990 int state; /* current state of the event */
991 @END
993 /* Open an event */
994 @REQ(open_event)
995 unsigned int access; /* wanted access rights */
996 unsigned int attributes; /* object attributes */
997 obj_handle_t rootdir; /* root directory */
998 VARARG(name,unicode_str); /* object name */
999 @REPLY
1000 obj_handle_t handle; /* handle to the event */
1001 @END
1004 /* Create a keyed event */
1005 @REQ(create_keyed_event)
1006 unsigned int access; /* wanted access rights */
1007 unsigned int attributes; /* object attributes */
1008 VARARG(objattr,object_attributes); /* object attributes */
1009 @REPLY
1010 obj_handle_t handle; /* handle to the event */
1011 @END
1013 /* Open a keyed event */
1014 @REQ(open_keyed_event)
1015 unsigned int access; /* wanted access rights */
1016 unsigned int attributes; /* object attributes */
1017 obj_handle_t rootdir; /* root directory */
1018 VARARG(name,unicode_str); /* object name */
1019 @REPLY
1020 obj_handle_t handle; /* handle to the event */
1021 @END
1024 /* Create a mutex */
1025 @REQ(create_mutex)
1026 unsigned int access; /* wanted access rights */
1027 unsigned int attributes; /* object attributes */
1028 int owned; /* initially owned? */
1029 VARARG(objattr,object_attributes); /* object attributes */
1030 @REPLY
1031 obj_handle_t handle; /* handle to the mutex */
1032 @END
1035 /* Release a mutex */
1036 @REQ(release_mutex)
1037 obj_handle_t handle; /* handle to the mutex */
1038 @REPLY
1039 unsigned int prev_count; /* value of internal counter, before release */
1040 @END
1043 /* Open a mutex */
1044 @REQ(open_mutex)
1045 unsigned int access; /* wanted access rights */
1046 unsigned int attributes; /* object attributes */
1047 obj_handle_t rootdir; /* root directory */
1048 VARARG(name,unicode_str); /* object name */
1049 @REPLY
1050 obj_handle_t handle; /* handle to the mutex */
1051 @END
1054 /* Create a semaphore */
1055 @REQ(create_semaphore)
1056 unsigned int access; /* wanted access rights */
1057 unsigned int attributes; /* object attributes */
1058 unsigned int initial; /* initial count */
1059 unsigned int max; /* maximum count */
1060 VARARG(objattr,object_attributes); /* object attributes */
1061 @REPLY
1062 obj_handle_t handle; /* handle to the semaphore */
1063 @END
1066 /* Release a semaphore */
1067 @REQ(release_semaphore)
1068 obj_handle_t handle; /* handle to the semaphore */
1069 unsigned int count; /* count to add to semaphore */
1070 @REPLY
1071 unsigned int prev_count; /* previous semaphore count */
1072 @END
1075 /* Open a semaphore */
1076 @REQ(open_semaphore)
1077 unsigned int access; /* wanted access rights */
1078 unsigned int attributes; /* object attributes */
1079 obj_handle_t rootdir; /* root directory */
1080 VARARG(name,unicode_str); /* object name */
1081 @REPLY
1082 obj_handle_t handle; /* handle to the semaphore */
1083 @END
1086 /* Create a file */
1087 @REQ(create_file)
1088 unsigned int access; /* wanted access rights */
1089 unsigned int attributes; /* object attributes */
1090 unsigned int sharing; /* sharing flags */
1091 int create; /* file create action */
1092 unsigned int options; /* file options */
1093 unsigned int attrs; /* file attributes for creation */
1094 VARARG(objattr,object_attributes); /* object attributes */
1095 VARARG(filename,string); /* file name */
1096 @REPLY
1097 obj_handle_t handle; /* handle to the file */
1098 @END
1101 /* Open a file object */
1102 @REQ(open_file_object)
1103 unsigned int access; /* wanted access rights */
1104 unsigned int attributes; /* open attributes */
1105 obj_handle_t rootdir; /* root directory */
1106 unsigned int sharing; /* sharing flags */
1107 unsigned int options; /* file options */
1108 VARARG(filename,unicode_str); /* file name */
1109 @REPLY
1110 obj_handle_t handle; /* handle to the file */
1111 @END
1114 /* Allocate a file handle for a Unix fd */
1115 @REQ(alloc_file_handle)
1116 unsigned int access; /* wanted access rights */
1117 unsigned int attributes; /* object attributes */
1118 int fd; /* file descriptor on the client side */
1119 @REPLY
1120 obj_handle_t handle; /* handle to the file */
1121 @END
1124 /* Get the Unix name from a file handle */
1125 @REQ(get_handle_unix_name)
1126 obj_handle_t handle; /* file handle */
1127 @REPLY
1128 data_size_t name_len; /* unix name length */
1129 VARARG(name,string); /* unix name */
1130 @END
1133 /* Get a Unix fd to access a file */
1134 @REQ(get_handle_fd)
1135 obj_handle_t handle; /* handle to the file */
1136 @REPLY
1137 int type; /* file type (see below) */
1138 int cacheable; /* can fd be cached in the client? */
1139 unsigned int access; /* file access rights */
1140 unsigned int options; /* file open options */
1141 @END
1142 enum server_fd_type
1144 FD_TYPE_INVALID, /* invalid file (no associated fd) */
1145 FD_TYPE_FILE, /* regular file */
1146 FD_TYPE_DIR, /* directory */
1147 FD_TYPE_SOCKET, /* socket */
1148 FD_TYPE_SERIAL, /* serial port */
1149 FD_TYPE_PIPE, /* named pipe */
1150 FD_TYPE_MAILSLOT, /* mailslot */
1151 FD_TYPE_CHAR, /* unspecified char device */
1152 FD_TYPE_DEVICE, /* Windows device file */
1153 FD_TYPE_NB_TYPES
1157 /* Flush a file buffers */
1158 @REQ(flush_file)
1159 obj_handle_t handle; /* handle to the file */
1160 @REPLY
1161 obj_handle_t event; /* event set when finished */
1162 @END
1165 /* Lock a region of a file */
1166 @REQ(lock_file)
1167 obj_handle_t handle; /* handle to the file */
1168 file_pos_t offset; /* offset of start of lock */
1169 file_pos_t count; /* count of bytes to lock */
1170 int shared; /* shared or exclusive lock? */
1171 int wait; /* do we want to wait? */
1172 @REPLY
1173 obj_handle_t handle; /* handle to wait on */
1174 int overlapped; /* is it an overlapped I/O handle? */
1175 @END
1178 /* Unlock a region of a file */
1179 @REQ(unlock_file)
1180 obj_handle_t handle; /* handle to the file */
1181 file_pos_t offset; /* offset of start of unlock */
1182 file_pos_t count; /* count of bytes to unlock */
1183 @END
1186 /* Create a socket */
1187 @REQ(create_socket)
1188 unsigned int access; /* wanted access rights */
1189 unsigned int attributes; /* object attributes */
1190 int family; /* family, see socket manpage */
1191 int type; /* type, see socket manpage */
1192 int protocol; /* protocol, see socket manpage */
1193 unsigned int flags; /* socket flags */
1194 @REPLY
1195 obj_handle_t handle; /* handle to the new socket */
1196 @END
1199 /* Accept a socket */
1200 @REQ(accept_socket)
1201 obj_handle_t lhandle; /* handle to the listening socket */
1202 unsigned int access; /* wanted access rights */
1203 unsigned int attributes; /* object attributes */
1204 @REPLY
1205 obj_handle_t handle; /* handle to the new socket */
1206 @END
1209 /* Accept into an initialized socket */
1210 @REQ(accept_into_socket)
1211 obj_handle_t lhandle; /* handle to the listening socket */
1212 obj_handle_t ahandle; /* handle to the accepting socket */
1213 @END
1216 /* Set socket event parameters */
1217 @REQ(set_socket_event)
1218 obj_handle_t handle; /* handle to the socket */
1219 unsigned int mask; /* event mask */
1220 obj_handle_t event; /* event object */
1221 user_handle_t window; /* window to send the message to */
1222 unsigned int msg; /* message to send */
1223 @END
1226 /* Get socket event parameters */
1227 @REQ(get_socket_event)
1228 obj_handle_t handle; /* handle to the socket */
1229 int service; /* clear pending? */
1230 obj_handle_t c_event; /* event to clear */
1231 @REPLY
1232 unsigned int mask; /* event mask */
1233 unsigned int pmask; /* pending events */
1234 unsigned int state; /* status bits */
1235 VARARG(errors,ints); /* event errors */
1236 @END
1239 /* Get socket info */
1240 @REQ(get_socket_info)
1241 obj_handle_t handle; /* handle to the socket */
1242 @REPLY
1243 int family; /* family, see socket manpage */
1244 int type; /* type, see socket manpage */
1245 int protocol; /* protocol, see socket manpage */
1246 @END
1249 /* Re-enable pending socket events */
1250 @REQ(enable_socket_event)
1251 obj_handle_t handle; /* handle to the socket */
1252 unsigned int mask; /* events to re-enable */
1253 unsigned int sstate; /* status bits to set */
1254 unsigned int cstate; /* status bits to clear */
1255 @END
1257 @REQ(set_socket_deferred)
1258 obj_handle_t handle; /* handle to the socket */
1259 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1260 @END
1262 /* Allocate a console (only used by a console renderer) */
1263 @REQ(alloc_console)
1264 unsigned int access; /* wanted access rights */
1265 unsigned int attributes; /* object attributes */
1266 process_id_t pid; /* pid of process which shall be attached to the console */
1267 int input_fd; /* if pid=-1 (bare console to current process), fd for input */
1268 @REPLY
1269 obj_handle_t handle_in; /* handle to console input */
1270 obj_handle_t event; /* handle to renderer events change notification */
1271 @END
1274 /* Free the console of the current process */
1275 @REQ(free_console)
1276 @END
1279 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1280 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1281 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1282 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1283 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1284 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1285 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1286 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1287 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1288 struct console_renderer_event
1290 short event;
1291 union
1293 struct update
1295 short top;
1296 short bottom;
1297 } update;
1298 struct resize
1300 short width;
1301 short height;
1302 } resize;
1303 struct cursor_pos
1305 short x;
1306 short y;
1307 } cursor_pos;
1308 struct cursor_geom
1310 short visible;
1311 short size;
1312 } cursor_geom;
1313 struct display
1315 short left;
1316 short top;
1317 short width;
1318 short height;
1319 } display;
1320 } u;
1323 /* retrieve console events for the renderer */
1324 @REQ(get_console_renderer_events)
1325 obj_handle_t handle; /* handle to console input events */
1326 @REPLY
1327 VARARG(data,bytes); /* the various console_renderer_events */
1328 @END
1331 /* Open a handle to the process console */
1332 @REQ(open_console)
1333 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1334 /* otherwise console_in handle to get active screen buffer? */
1335 unsigned int access; /* wanted access rights */
1336 unsigned int attributes; /* object attributes */
1337 int share; /* share mask (only for output handles) */
1338 @REPLY
1339 obj_handle_t handle; /* handle to the console */
1340 @END
1343 /* Get the input queue wait event */
1344 @REQ(get_console_wait_event)
1345 @REPLY
1346 obj_handle_t handle;
1347 @END
1349 /* Get a console mode (input or output) */
1350 @REQ(get_console_mode)
1351 obj_handle_t handle; /* handle to the console */
1352 @REPLY
1353 int mode; /* console mode */
1354 @END
1357 /* Set a console mode (input or output) */
1358 @REQ(set_console_mode)
1359 obj_handle_t handle; /* handle to the console */
1360 int mode; /* console mode */
1361 @END
1364 /* Set info about a console (input only) */
1365 @REQ(set_console_input_info)
1366 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1367 int mask; /* setting mask (see below) */
1368 obj_handle_t active_sb; /* active screen buffer */
1369 int history_mode; /* whether we duplicate lines in history */
1370 int history_size; /* number of lines in history */
1371 int edition_mode; /* index to the edition mode flavors */
1372 int input_cp; /* console input codepage */
1373 int output_cp; /* console output codepage */
1374 user_handle_t win; /* console window if backend supports it */
1375 VARARG(title,unicode_str); /* console title */
1376 @END
1377 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1378 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1379 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1380 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1381 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1382 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1383 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1384 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1387 /* Get info about a console (input only) */
1388 @REQ(get_console_input_info)
1389 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1390 @REPLY
1391 int history_mode; /* whether we duplicate lines in history */
1392 int history_size; /* number of lines in history */
1393 int history_index; /* number of used lines in history */
1394 int edition_mode; /* index to the edition mode flavors */
1395 int input_cp; /* console input codepage */
1396 int output_cp; /* console output codepage */
1397 user_handle_t win; /* console window if backend supports it */
1398 VARARG(title,unicode_str); /* console title */
1399 @END
1402 /* appends a string to console's history */
1403 @REQ(append_console_input_history)
1404 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1405 VARARG(line,unicode_str); /* line to add */
1406 @END
1409 /* appends a string to console's history */
1410 @REQ(get_console_input_history)
1411 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1412 int index; /* index to get line from */
1413 @REPLY
1414 int total; /* total length of line in Unicode chars */
1415 VARARG(line,unicode_str); /* line to add */
1416 @END
1419 /* creates a new screen buffer on process' console */
1420 @REQ(create_console_output)
1421 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1422 unsigned int access; /* wanted access rights */
1423 unsigned int attributes; /* object attributes */
1424 unsigned int share; /* sharing credentials */
1425 int fd; /* for bare consoles, fd the screen-buffer is attached to */
1426 @REPLY
1427 obj_handle_t handle_out; /* handle to the screen buffer */
1428 @END
1431 /* Set info about a console (output only) */
1432 @REQ(set_console_output_info)
1433 obj_handle_t handle; /* handle to the console */
1434 int mask; /* setting mask (see below) */
1435 short int cursor_size; /* size of cursor (percentage filled) */
1436 short int cursor_visible;/* cursor visibility flag */
1437 short int cursor_x; /* position of cursor (x, y) */
1438 short int cursor_y;
1439 short int width; /* width of the screen buffer */
1440 short int height; /* height of the screen buffer */
1441 short int attr; /* default attribute */
1442 short int win_left; /* window actually displayed by renderer */
1443 short int win_top; /* the rect area is expressed within the */
1444 short int win_right; /* boundaries of the screen buffer */
1445 short int win_bottom;
1446 short int max_width; /* maximum size (width x height) for the window */
1447 short int max_height;
1448 @END
1449 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1450 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1451 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1452 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1453 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1454 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1457 /* Get info about a console (output only) */
1458 @REQ(get_console_output_info)
1459 obj_handle_t handle; /* handle to the console */
1460 @REPLY
1461 short int cursor_size; /* size of cursor (percentage filled) */
1462 short int cursor_visible;/* cursor visibility flag */
1463 short int cursor_x; /* position of cursor (x, y) */
1464 short int cursor_y;
1465 short int width; /* width of the screen buffer */
1466 short int height; /* height of the screen buffer */
1467 short int attr; /* default attribute */
1468 short int win_left; /* window actually displayed by renderer */
1469 short int win_top; /* the rect area is expressed within the */
1470 short int win_right; /* boundaries of the screen buffer */
1471 short int win_bottom;
1472 short int max_width; /* maximum size (width x height) for the window */
1473 short int max_height;
1474 @END
1476 /* Add input records to a console input queue */
1477 @REQ(write_console_input)
1478 obj_handle_t handle; /* handle to the console input */
1479 VARARG(rec,input_records); /* input records */
1480 @REPLY
1481 int written; /* number of records written */
1482 @END
1485 /* Fetch input records from a console input queue */
1486 @REQ(read_console_input)
1487 obj_handle_t handle; /* handle to the console input */
1488 int flush; /* flush the retrieved records from the queue? */
1489 @REPLY
1490 int read; /* number of records read */
1491 VARARG(rec,input_records); /* input records */
1492 @END
1495 /* write data (chars and/or attributes) in a screen buffer */
1496 @REQ(write_console_output)
1497 obj_handle_t handle; /* handle to the console output */
1498 int x; /* position where to start writing */
1499 int y;
1500 int mode; /* char info (see below) */
1501 int wrap; /* wrap around at end of line? */
1502 VARARG(data,bytes); /* info to write */
1503 @REPLY
1504 int written; /* number of char infos actually written */
1505 int width; /* width of screen buffer */
1506 int height; /* height of screen buffer */
1507 @END
1508 enum char_info_mode
1510 CHAR_INFO_MODE_TEXT, /* characters only */
1511 CHAR_INFO_MODE_ATTR, /* attributes only */
1512 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1513 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1517 /* fill a screen buffer with constant data (chars and/or attributes) */
1518 @REQ(fill_console_output)
1519 obj_handle_t handle; /* handle to the console output */
1520 int x; /* position where to start writing */
1521 int y;
1522 int mode; /* char info mode */
1523 int count; /* number to write */
1524 int wrap; /* wrap around at end of line? */
1525 char_info_t data; /* data to write */
1526 @REPLY
1527 int written; /* number of char infos actually written */
1528 @END
1531 /* read data (chars and/or attributes) from a screen buffer */
1532 @REQ(read_console_output)
1533 obj_handle_t handle; /* handle to the console output */
1534 int x; /* position (x,y) where to start reading */
1535 int y;
1536 int mode; /* char info mode */
1537 int wrap; /* wrap around at end of line? */
1538 @REPLY
1539 int width; /* width of screen buffer */
1540 int height; /* height of screen buffer */
1541 VARARG(data,bytes);
1542 @END
1545 /* move a rect (of data) in screen buffer content */
1546 @REQ(move_console_output)
1547 obj_handle_t handle; /* handle to the console output */
1548 short int x_src; /* position (x, y) of rect to start moving from */
1549 short int y_src;
1550 short int x_dst; /* position (x, y) of rect to move to */
1551 short int y_dst;
1552 short int w; /* size of the rect (width, height) to move */
1553 short int h;
1554 @END
1557 /* Sends a signal to a process group */
1558 @REQ(send_console_signal)
1559 int signal; /* the signal to send */
1560 process_id_t group_id; /* the group to send the signal to */
1561 @END
1564 /* enable directory change notifications */
1565 @REQ(read_directory_changes)
1566 unsigned int filter; /* notification filter */
1567 int subtree; /* watch the subtree? */
1568 int want_data; /* flag indicating whether change data should be collected */
1569 async_data_t async; /* async I/O parameters */
1570 @END
1573 @REQ(read_change)
1574 obj_handle_t handle;
1575 @REPLY
1576 VARARG(events,filesystem_event); /* collected filesystem events */
1577 @END
1580 /* Create a file mapping */
1581 @REQ(create_mapping)
1582 unsigned int access; /* wanted access rights */
1583 unsigned int attributes; /* object attributes */
1584 unsigned int protect; /* protection flags (see below) */
1585 mem_size_t size; /* mapping size */
1586 obj_handle_t file_handle; /* file handle */
1587 VARARG(objattr,object_attributes); /* object attributes */
1588 @REPLY
1589 obj_handle_t handle; /* handle to the mapping */
1590 @END
1591 /* per-page protection flags */
1592 #define VPROT_READ 0x01
1593 #define VPROT_WRITE 0x02
1594 #define VPROT_EXEC 0x04
1595 #define VPROT_WRITECOPY 0x08
1596 #define VPROT_GUARD 0x10
1597 #define VPROT_NOCACHE 0x20
1598 #define VPROT_COMMITTED 0x40
1599 #define VPROT_WRITEWATCH 0x80
1600 /* per-mapping protection flags */
1601 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1602 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1603 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1604 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1607 /* Open a mapping */
1608 @REQ(open_mapping)
1609 unsigned int access; /* wanted access rights */
1610 unsigned int attributes; /* object attributes */
1611 obj_handle_t rootdir; /* root directory */
1612 VARARG(name,unicode_str); /* object name */
1613 @REPLY
1614 obj_handle_t handle; /* handle to the mapping */
1615 @END
1618 /* Get information about a file mapping */
1619 @REQ(get_mapping_info)
1620 obj_handle_t handle; /* handle to the mapping */
1621 unsigned int access; /* wanted access rights */
1622 @REPLY
1623 mem_size_t size; /* mapping size */
1624 int protect; /* protection flags */
1625 int header_size; /* header size (for VPROT_IMAGE mapping) */
1626 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1627 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1628 obj_handle_t shared_file; /* shared mapping file handle */
1629 @END
1632 /* Get a range of committed pages in a file mapping */
1633 @REQ(get_mapping_committed_range)
1634 obj_handle_t handle; /* handle to the mapping */
1635 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1636 @REPLY
1637 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1638 int committed; /* whether it is a committed range */
1639 @END
1642 /* Add a range to the committed pages in a file mapping */
1643 @REQ(add_mapping_committed_range)
1644 obj_handle_t handle; /* handle to the mapping */
1645 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1646 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1647 @END
1650 #define SNAP_PROCESS 0x00000001
1651 #define SNAP_THREAD 0x00000002
1652 /* Create a snapshot */
1653 @REQ(create_snapshot)
1654 unsigned int attributes; /* object attributes */
1655 unsigned int flags; /* snapshot flags (SNAP_*) */
1656 @REPLY
1657 obj_handle_t handle; /* handle to the snapshot */
1658 @END
1661 /* Get the next process from a snapshot */
1662 @REQ(next_process)
1663 obj_handle_t handle; /* handle to the snapshot */
1664 int reset; /* reset snapshot position? */
1665 @REPLY
1666 int count; /* process usage count */
1667 process_id_t pid; /* process id */
1668 process_id_t ppid; /* parent process id */
1669 int threads; /* number of threads */
1670 int priority; /* process priority */
1671 int handles; /* number of handles */
1672 int unix_pid; /* Unix pid */
1673 VARARG(filename,unicode_str); /* file name of main exe */
1674 @END
1677 /* Get the next thread from a snapshot */
1678 @REQ(next_thread)
1679 obj_handle_t handle; /* handle to the snapshot */
1680 int reset; /* reset snapshot position? */
1681 @REPLY
1682 int count; /* thread usage count */
1683 process_id_t pid; /* process id */
1684 thread_id_t tid; /* thread id */
1685 int base_pri; /* base priority */
1686 int delta_pri; /* delta priority */
1687 @END
1690 /* Wait for a debug event */
1691 @REQ(wait_debug_event)
1692 int get_handle; /* should we alloc a handle for waiting? */
1693 @REPLY
1694 process_id_t pid; /* process id */
1695 thread_id_t tid; /* thread id */
1696 obj_handle_t wait; /* wait handle if no event ready */
1697 VARARG(event,debug_event); /* debug event data */
1698 @END
1701 /* Queue an exception event */
1702 @REQ(queue_exception_event)
1703 int first; /* first chance exception? */
1704 unsigned int code; /* exception code */
1705 unsigned int flags; /* exception flags */
1706 client_ptr_t record; /* exception record */
1707 client_ptr_t address; /* exception address */
1708 data_size_t len; /* size of parameters */
1709 VARARG(params,uints64,len);/* exception parameters */
1710 VARARG(context,context); /* thread context */
1711 @REPLY
1712 obj_handle_t handle; /* handle to the queued event */
1713 @END
1716 /* Retrieve the status of an exception event */
1717 @REQ(get_exception_status)
1718 obj_handle_t handle; /* handle to the queued event */
1719 @REPLY
1720 VARARG(context,context); /* modified thread context */
1721 @END
1724 /* Send an output string to the debugger */
1725 @REQ(output_debug_string)
1726 data_size_t length; /* string length */
1727 client_ptr_t string; /* string to display (in debugged process address space) */
1728 @END
1731 /* Continue a debug event */
1732 @REQ(continue_debug_event)
1733 process_id_t pid; /* process id to continue */
1734 thread_id_t tid; /* thread id to continue */
1735 int status; /* continuation status */
1736 @END
1739 /* Start/stop debugging an existing process */
1740 @REQ(debug_process)
1741 process_id_t pid; /* id of the process to debug */
1742 int attach; /* 1=attaching / 0=detaching from the process */
1743 @END
1746 /* Simulate a breakpoint in a process */
1747 @REQ(debug_break)
1748 obj_handle_t handle; /* process handle */
1749 @REPLY
1750 int self; /* was it the caller itself? */
1751 @END
1754 /* Set debugger kill on exit flag */
1755 @REQ(set_debugger_kill_on_exit)
1756 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1757 @END
1760 /* Read data from a process address space */
1761 @REQ(read_process_memory)
1762 obj_handle_t handle; /* process handle */
1763 client_ptr_t addr; /* addr to read from */
1764 @REPLY
1765 VARARG(data,bytes); /* result data */
1766 @END
1769 /* Write data to a process address space */
1770 @REQ(write_process_memory)
1771 obj_handle_t handle; /* process handle */
1772 client_ptr_t addr; /* addr to write to */
1773 VARARG(data,bytes); /* data to write */
1774 @END
1777 /* Create a registry key */
1778 @REQ(create_key)
1779 obj_handle_t parent; /* handle to the parent key */
1780 unsigned int access; /* desired access rights */
1781 unsigned int attributes; /* object attributes */
1782 unsigned int options; /* creation options */
1783 data_size_t namelen; /* length of key name in bytes */
1784 VARARG(name,unicode_str,namelen); /* key name */
1785 VARARG(class,unicode_str); /* class name */
1786 @REPLY
1787 obj_handle_t hkey; /* handle to the created key */
1788 int created; /* has it been newly created? */
1789 @END
1791 /* Open a registry key */
1792 @REQ(open_key)
1793 obj_handle_t parent; /* handle to the parent key */
1794 unsigned int access; /* desired access rights */
1795 unsigned int attributes; /* object attributes */
1796 VARARG(name,unicode_str); /* key name */
1797 @REPLY
1798 obj_handle_t hkey; /* handle to the open key */
1799 @END
1802 /* Delete a registry key */
1803 @REQ(delete_key)
1804 obj_handle_t hkey; /* handle to the key */
1805 @END
1808 /* Flush a registry key */
1809 @REQ(flush_key)
1810 obj_handle_t hkey; /* handle to the key */
1811 @END
1814 /* Enumerate registry subkeys */
1815 @REQ(enum_key)
1816 obj_handle_t hkey; /* handle to registry key */
1817 int index; /* index of subkey (or -1 for current key) */
1818 int info_class; /* requested information class */
1819 @REPLY
1820 int subkeys; /* number of subkeys */
1821 int max_subkey; /* longest subkey name */
1822 int max_class; /* longest class name */
1823 int values; /* number of values */
1824 int max_value; /* longest value name */
1825 int max_data; /* longest value data */
1826 timeout_t modif; /* last modification time */
1827 data_size_t total; /* total length needed for full name and class */
1828 data_size_t namelen; /* length of key name in bytes */
1829 VARARG(name,unicode_str,namelen); /* key name */
1830 VARARG(class,unicode_str); /* class name */
1831 @END
1834 /* Set a value of a registry key */
1835 @REQ(set_key_value)
1836 obj_handle_t hkey; /* handle to registry key */
1837 int type; /* value type */
1838 data_size_t namelen; /* length of value name in bytes */
1839 VARARG(name,unicode_str,namelen); /* value name */
1840 VARARG(data,bytes); /* value data */
1841 @END
1844 /* Retrieve the value of a registry key */
1845 @REQ(get_key_value)
1846 obj_handle_t hkey; /* handle to registry key */
1847 VARARG(name,unicode_str); /* value name */
1848 @REPLY
1849 int type; /* value type */
1850 data_size_t total; /* total length needed for data */
1851 VARARG(data,bytes); /* value data */
1852 @END
1855 /* Enumerate a value of a registry key */
1856 @REQ(enum_key_value)
1857 obj_handle_t hkey; /* handle to registry key */
1858 int index; /* value index */
1859 int info_class; /* requested information class */
1860 @REPLY
1861 int type; /* value type */
1862 data_size_t total; /* total length needed for full name and data */
1863 data_size_t namelen; /* length of value name in bytes */
1864 VARARG(name,unicode_str,namelen); /* value name */
1865 VARARG(data,bytes); /* value data */
1866 @END
1869 /* Delete a value of a registry key */
1870 @REQ(delete_key_value)
1871 obj_handle_t hkey; /* handle to registry key */
1872 VARARG(name,unicode_str); /* value name */
1873 @END
1876 /* Load a registry branch from a file */
1877 @REQ(load_registry)
1878 obj_handle_t hkey; /* root key to load to */
1879 obj_handle_t file; /* file to load from */
1880 VARARG(name,unicode_str); /* subkey name */
1881 @END
1884 /* UnLoad a registry branch from a file */
1885 @REQ(unload_registry)
1886 obj_handle_t hkey; /* root key to unload to */
1887 @END
1890 /* Save a registry branch to a file */
1891 @REQ(save_registry)
1892 obj_handle_t hkey; /* key to save */
1893 obj_handle_t file; /* file to save to */
1894 @END
1897 /* Add a registry key change notification */
1898 @REQ(set_registry_notification)
1899 obj_handle_t hkey; /* key to watch for changes */
1900 obj_handle_t event; /* event to set */
1901 int subtree; /* should we watch the whole subtree? */
1902 unsigned int filter; /* things to watch */
1903 @END
1906 /* Create a waitable timer */
1907 @REQ(create_timer)
1908 unsigned int access; /* wanted access rights */
1909 unsigned int attributes; /* object attributes */
1910 obj_handle_t rootdir; /* root directory */
1911 int manual; /* manual reset */
1912 VARARG(name,unicode_str); /* object name */
1913 @REPLY
1914 obj_handle_t handle; /* handle to the timer */
1915 @END
1918 /* Open a waitable timer */
1919 @REQ(open_timer)
1920 unsigned int access; /* wanted access rights */
1921 unsigned int attributes; /* object attributes */
1922 obj_handle_t rootdir; /* root directory */
1923 VARARG(name,unicode_str); /* object name */
1924 @REPLY
1925 obj_handle_t handle; /* handle to the timer */
1926 @END
1928 /* Set a waitable timer */
1929 @REQ(set_timer)
1930 obj_handle_t handle; /* handle to the timer */
1931 timeout_t expire; /* next expiration absolute time */
1932 client_ptr_t callback; /* callback function */
1933 client_ptr_t arg; /* callback argument */
1934 int period; /* timer period in ms */
1935 @REPLY
1936 int signaled; /* was the timer signaled before this call ? */
1937 @END
1939 /* Cancel a waitable timer */
1940 @REQ(cancel_timer)
1941 obj_handle_t handle; /* handle to the timer */
1942 @REPLY
1943 int signaled; /* was the timer signaled before this calltime ? */
1944 @END
1946 /* Get information on a waitable timer */
1947 @REQ(get_timer_info)
1948 obj_handle_t handle; /* handle to the timer */
1949 @REPLY
1950 timeout_t when; /* absolute time when the timer next expires */
1951 int signaled; /* is the timer signaled? */
1952 @END
1955 /* Retrieve the current context of a thread */
1956 @REQ(get_thread_context)
1957 obj_handle_t handle; /* thread handle */
1958 unsigned int flags; /* context flags */
1959 int suspend; /* suspend the thread if needed */
1960 @REPLY
1961 int self; /* was it a handle to the current thread? */
1962 VARARG(context,context); /* thread context */
1963 @END
1966 /* Set the current context of a thread */
1967 @REQ(set_thread_context)
1968 obj_handle_t handle; /* thread handle */
1969 int suspend; /* suspend the thread if needed */
1970 VARARG(context,context); /* thread context */
1971 @REPLY
1972 int self; /* was it a handle to the current thread? */
1973 @END
1976 /* Fetch a selector entry for a thread */
1977 @REQ(get_selector_entry)
1978 obj_handle_t handle; /* thread handle */
1979 int entry; /* LDT entry */
1980 @REPLY
1981 unsigned int base; /* selector base */
1982 unsigned int limit; /* selector limit */
1983 unsigned char flags; /* selector flags */
1984 @END
1987 /* Add an atom */
1988 @REQ(add_atom)
1989 obj_handle_t table; /* which table to add atom to */
1990 VARARG(name,unicode_str); /* atom name */
1991 @REPLY
1992 atom_t atom; /* resulting atom */
1993 @END
1996 /* Delete an atom */
1997 @REQ(delete_atom)
1998 obj_handle_t table; /* which table to delete atom from */
1999 atom_t atom; /* atom handle */
2000 @END
2003 /* Find an atom */
2004 @REQ(find_atom)
2005 obj_handle_t table; /* which table to find atom from */
2006 VARARG(name,unicode_str); /* atom name */
2007 @REPLY
2008 atom_t atom; /* atom handle */
2009 @END
2012 /* Get information about an atom */
2013 @REQ(get_atom_information)
2014 obj_handle_t table; /* which table to find atom from */
2015 atom_t atom; /* atom handle */
2016 @REPLY
2017 int count; /* atom lock count */
2018 int pinned; /* whether the atom has been pinned */
2019 data_size_t total; /* actual length of atom name */
2020 VARARG(name,unicode_str); /* atom name */
2021 @END
2024 /* Set information about an atom */
2025 @REQ(set_atom_information)
2026 obj_handle_t table; /* which table to find atom from */
2027 atom_t atom; /* atom handle */
2028 int pinned; /* whether to bump atom information */
2029 @END
2032 /* Empty an atom table */
2033 @REQ(empty_atom_table)
2034 obj_handle_t table; /* which table to find atom from */
2035 int if_pinned; /* whether to delete pinned atoms */
2036 @END
2039 /* Init an atom table */
2040 @REQ(init_atom_table)
2041 int entries; /* number of entries (only for local) */
2042 @REPLY
2043 obj_handle_t table; /* handle to the atom table */
2044 @END
2047 /* Get the message queue of the current thread */
2048 @REQ(get_msg_queue)
2049 @REPLY
2050 obj_handle_t handle; /* handle to the queue */
2051 @END
2054 /* Set the file descriptor associated to the current thread queue */
2055 @REQ(set_queue_fd)
2056 obj_handle_t handle; /* handle to the file descriptor */
2057 @END
2060 /* Set the current message queue wakeup mask */
2061 @REQ(set_queue_mask)
2062 unsigned int wake_mask; /* wakeup bits mask */
2063 unsigned int changed_mask; /* changed bits mask */
2064 int skip_wait; /* will we skip waiting if signaled? */
2065 @REPLY
2066 unsigned int wake_bits; /* current wake bits */
2067 unsigned int changed_bits; /* current changed bits */
2068 @END
2071 /* Get the current message queue status */
2072 @REQ(get_queue_status)
2073 int clear; /* should we clear the change bits? */
2074 @REPLY
2075 unsigned int wake_bits; /* wake bits */
2076 unsigned int changed_bits; /* changed bits since last time */
2077 @END
2080 /* Retrieve the process idle event */
2081 @REQ(get_process_idle_event)
2082 obj_handle_t handle; /* process handle */
2083 @REPLY
2084 obj_handle_t event; /* handle to idle event */
2085 @END
2088 /* Send a message to a thread queue */
2089 @REQ(send_message)
2090 thread_id_t id; /* thread id */
2091 int type; /* message type (see below) */
2092 int flags; /* message flags (see below) */
2093 user_handle_t win; /* window handle */
2094 unsigned int msg; /* message code */
2095 lparam_t wparam; /* parameters */
2096 lparam_t lparam; /* parameters */
2097 timeout_t timeout; /* timeout for reply */
2098 VARARG(data,message_data); /* message data for sent messages */
2099 @END
2101 @REQ(post_quit_message)
2102 int exit_code; /* exit code to return */
2103 @END
2105 enum message_type
2107 MSG_ASCII, /* Ascii message (from SendMessageA) */
2108 MSG_UNICODE, /* Unicode message (from SendMessageW) */
2109 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
2110 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
2111 MSG_CALLBACK_RESULT,/* result of a callback message */
2112 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
2113 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
2114 MSG_HARDWARE, /* hardware message */
2115 MSG_WINEVENT, /* winevent message */
2116 MSG_HOOK_LL /* low-level hardware hook */
2118 #define SEND_MSG_ABORT_IF_HUNG 0x01
2121 /* Send a hardware message to a thread queue */
2122 @REQ(send_hardware_message)
2123 user_handle_t win; /* window handle */
2124 hw_input_t input; /* input data */
2125 unsigned int flags; /* flags (see below) */
2126 @REPLY
2127 int wait; /* do we need to wait for a reply? */
2128 int prev_x; /* previous cursor position */
2129 int prev_y;
2130 int new_x; /* new cursor position */
2131 int new_y;
2132 VARARG(keystate,bytes); /* global state array for all the keys */
2133 @END
2134 #define SEND_HWMSG_INJECTED 0x01
2137 /* Get a message from the current queue */
2138 @REQ(get_message)
2139 unsigned int flags; /* PM_* flags */
2140 user_handle_t get_win; /* window handle to get */
2141 unsigned int get_first; /* first message code to get */
2142 unsigned int get_last; /* last message code to get */
2143 unsigned int hw_id; /* id of the previous hardware message (or 0) */
2144 unsigned int wake_mask; /* wakeup bits mask */
2145 unsigned int changed_mask; /* changed bits mask */
2146 @REPLY
2147 user_handle_t win; /* window handle */
2148 unsigned int msg; /* message code */
2149 lparam_t wparam; /* parameters */
2150 lparam_t lparam; /* parameters */
2151 int type; /* message type */
2152 unsigned int time; /* message time */
2153 unsigned int active_hooks; /* active hooks bitmap */
2154 data_size_t total; /* total size of extra data */
2155 VARARG(data,message_data); /* message data for sent messages */
2156 @END
2159 /* Reply to a sent message */
2160 @REQ(reply_message)
2161 int remove; /* should we remove the message? */
2162 lparam_t result; /* message result */
2163 VARARG(data,bytes); /* message data for sent messages */
2164 @END
2167 /* Accept the current hardware message */
2168 @REQ(accept_hardware_message)
2169 unsigned int hw_id; /* id of the hardware message */
2170 int remove; /* should we remove the message? */
2171 user_handle_t new_win; /* new destination window for current message */
2172 @END
2175 /* Retrieve the reply for the last message sent */
2176 @REQ(get_message_reply)
2177 int cancel; /* cancel message if not ready? */
2178 @REPLY
2179 lparam_t result; /* message result */
2180 VARARG(data,bytes); /* message data for sent messages */
2181 @END
2184 /* Set a window timer */
2185 @REQ(set_win_timer)
2186 user_handle_t win; /* window handle */
2187 unsigned int msg; /* message to post */
2188 unsigned int rate; /* timer rate in ms */
2189 lparam_t id; /* timer id */
2190 lparam_t lparam; /* message lparam (callback proc) */
2191 @REPLY
2192 lparam_t id; /* timer id */
2193 @END
2196 /* Kill a window timer */
2197 @REQ(kill_win_timer)
2198 user_handle_t win; /* window handle */
2199 lparam_t id; /* timer id */
2200 unsigned int msg; /* message to post */
2201 @END
2204 /* check if the thread owning the window is hung */
2205 @REQ(is_window_hung)
2206 user_handle_t win; /* window handle */
2207 @REPLY
2208 int is_hung;
2209 @END
2212 /* Retrieve info about a serial port */
2213 @REQ(get_serial_info)
2214 obj_handle_t handle; /* handle to comm port */
2215 int flags;
2216 @REPLY
2217 unsigned int readinterval;
2218 unsigned int readconst;
2219 unsigned int readmult;
2220 unsigned int writeconst;
2221 unsigned int writemult;
2222 unsigned int eventmask;
2223 unsigned int cookie;
2224 unsigned int pending_write;
2225 @END
2228 /* Set info about a serial port */
2229 @REQ(set_serial_info)
2230 obj_handle_t handle; /* handle to comm port */
2231 int flags; /* bitmask to set values (see below) */
2232 unsigned int readinterval;
2233 unsigned int readconst;
2234 unsigned int readmult;
2235 unsigned int writeconst;
2236 unsigned int writemult;
2237 unsigned int eventmask;
2238 @END
2239 #define SERIALINFO_SET_TIMEOUTS 0x01
2240 #define SERIALINFO_SET_MASK 0x02
2241 #define SERIALINFO_PENDING_WRITE 0x04
2242 #define SERIALINFO_PENDING_WAIT 0x08
2245 /* Create an async I/O */
2246 @REQ(register_async)
2247 int type; /* type of queue to look after */
2248 async_data_t async; /* async I/O parameters */
2249 int count; /* count - usually # of bytes to be read/written */
2250 @END
2251 #define ASYNC_TYPE_READ 0x01
2252 #define ASYNC_TYPE_WRITE 0x02
2253 #define ASYNC_TYPE_WAIT 0x03
2256 /* Cancel all async op on a fd */
2257 @REQ(cancel_async)
2258 obj_handle_t handle; /* handle to comm port, socket or file */
2259 client_ptr_t iosb; /* I/O status block (NULL=all) */
2260 int only_thread; /* cancel matching this thread */
2261 @END
2264 /* Perform an ioctl on a file */
2265 @REQ(ioctl)
2266 ioctl_code_t code; /* ioctl code */
2267 async_data_t async; /* async I/O parameters */
2268 int blocking; /* whether it's a blocking ioctl */
2269 VARARG(in_data,bytes); /* ioctl input data */
2270 @REPLY
2271 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2272 unsigned int options; /* device open options */
2273 VARARG(out_data,bytes); /* ioctl output data */
2274 @END
2277 /* Retrieve results of an async ioctl */
2278 @REQ(get_ioctl_result)
2279 obj_handle_t handle; /* handle to the device */
2280 client_ptr_t user_arg; /* user arg used to identify the request */
2281 @REPLY
2282 VARARG(out_data,bytes); /* ioctl output data */
2283 @END
2286 /* Create a named pipe */
2287 @REQ(create_named_pipe)
2288 unsigned int access;
2289 unsigned int attributes; /* object attributes */
2290 obj_handle_t rootdir; /* root directory */
2291 unsigned int options;
2292 unsigned int sharing;
2293 unsigned int maxinstances;
2294 unsigned int outsize;
2295 unsigned int insize;
2296 timeout_t timeout;
2297 unsigned int flags;
2298 VARARG(name,unicode_str); /* pipe name */
2299 @REPLY
2300 obj_handle_t handle; /* handle to the pipe */
2301 @END
2303 /* flags in create_named_pipe and get_named_pipe_info */
2304 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2305 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2306 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2307 #define NAMED_PIPE_SERVER_END 0x8000
2310 @REQ(get_named_pipe_info)
2311 obj_handle_t handle;
2312 @REPLY
2313 unsigned int flags;
2314 unsigned int sharing;
2315 unsigned int maxinstances;
2316 unsigned int instances;
2317 unsigned int outsize;
2318 unsigned int insize;
2319 @END
2322 /* Create a window */
2323 @REQ(create_window)
2324 user_handle_t parent; /* parent window */
2325 user_handle_t owner; /* owner window */
2326 atom_t atom; /* class atom */
2327 mod_handle_t instance; /* module instance */
2328 VARARG(class,unicode_str); /* class name */
2329 @REPLY
2330 user_handle_t handle; /* created window */
2331 user_handle_t parent; /* full handle of parent */
2332 user_handle_t owner; /* full handle of owner */
2333 int extra; /* number of extra bytes */
2334 client_ptr_t class_ptr; /* pointer to class in client address space */
2335 @END
2338 /* Destroy a window */
2339 @REQ(destroy_window)
2340 user_handle_t handle; /* handle to the window */
2341 @END
2344 /* Retrieve the desktop window for the current thread */
2345 @REQ(get_desktop_window)
2346 int force; /* force creation if it doesn't exist */
2347 @REPLY
2348 user_handle_t top_window; /* handle to the desktop window */
2349 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2350 @END
2353 /* Set a window owner */
2354 @REQ(set_window_owner)
2355 user_handle_t handle; /* handle to the window */
2356 user_handle_t owner; /* new owner */
2357 @REPLY
2358 user_handle_t full_owner; /* full handle of new owner */
2359 user_handle_t prev_owner; /* full handle of previous owner */
2360 @END
2363 /* Get information from a window handle */
2364 @REQ(get_window_info)
2365 user_handle_t handle; /* handle to the window */
2366 @REPLY
2367 user_handle_t full_handle; /* full 32-bit handle */
2368 user_handle_t last_active; /* last active popup */
2369 process_id_t pid; /* process owning the window */
2370 thread_id_t tid; /* thread owning the window */
2371 atom_t atom; /* class atom */
2372 int is_unicode; /* ANSI or unicode */
2373 @END
2376 /* Set some information in a window */
2377 @REQ(set_window_info)
2378 unsigned short flags; /* flags for fields to set (see below) */
2379 short int is_unicode; /* ANSI or unicode */
2380 user_handle_t handle; /* handle to the window */
2381 unsigned int style; /* window style */
2382 unsigned int ex_style; /* window extended style */
2383 unsigned int id; /* window id */
2384 mod_handle_t instance; /* creator instance */
2385 lparam_t user_data; /* user-specific data */
2386 int extra_offset; /* offset to set in extra bytes */
2387 data_size_t extra_size; /* size to set in extra bytes */
2388 lparam_t extra_value; /* value to set in extra bytes */
2389 @REPLY
2390 unsigned int old_style; /* old window style */
2391 unsigned int old_ex_style; /* old window extended style */
2392 mod_handle_t old_instance; /* old creator instance */
2393 lparam_t old_user_data; /* old user-specific data */
2394 lparam_t old_extra_value; /* old value in extra bytes */
2395 unsigned int old_id; /* old window id */
2396 @END
2397 #define SET_WIN_STYLE 0x01
2398 #define SET_WIN_EXSTYLE 0x02
2399 #define SET_WIN_ID 0x04
2400 #define SET_WIN_INSTANCE 0x08
2401 #define SET_WIN_USERDATA 0x10
2402 #define SET_WIN_EXTRA 0x20
2403 #define SET_WIN_UNICODE 0x40
2406 /* Set the parent of a window */
2407 @REQ(set_parent)
2408 user_handle_t handle; /* handle to the window */
2409 user_handle_t parent; /* handle to the parent */
2410 @REPLY
2411 user_handle_t old_parent; /* old parent window */
2412 user_handle_t full_parent; /* full handle of new parent */
2413 @END
2416 /* Get a list of the window parents, up to the root of the tree */
2417 @REQ(get_window_parents)
2418 user_handle_t handle; /* handle to the window */
2419 @REPLY
2420 int count; /* total count of parents */
2421 VARARG(parents,user_handles); /* parent handles */
2422 @END
2425 /* Get a list of the window children */
2426 @REQ(get_window_children)
2427 obj_handle_t desktop; /* handle to desktop */
2428 user_handle_t parent; /* parent window */
2429 atom_t atom; /* class atom for the listed children */
2430 thread_id_t tid; /* thread owning the listed children */
2431 VARARG(class,unicode_str); /* class name */
2432 @REPLY
2433 int count; /* total count of children */
2434 VARARG(children,user_handles); /* children handles */
2435 @END
2438 /* Get a list of the window children that contain a given point */
2439 @REQ(get_window_children_from_point)
2440 user_handle_t parent; /* parent window */
2441 int x; /* point in parent coordinates */
2442 int y;
2443 @REPLY
2444 int count; /* total count of children */
2445 VARARG(children,user_handles); /* children handles */
2446 @END
2449 /* Get window tree information from a window handle */
2450 @REQ(get_window_tree)
2451 user_handle_t handle; /* handle to the window */
2452 @REPLY
2453 user_handle_t parent; /* parent window */
2454 user_handle_t owner; /* owner window */
2455 user_handle_t next_sibling; /* next sibling in Z-order */
2456 user_handle_t prev_sibling; /* prev sibling in Z-order */
2457 user_handle_t first_sibling; /* first sibling in Z-order */
2458 user_handle_t last_sibling; /* last sibling in Z-order */
2459 user_handle_t first_child; /* first child */
2460 user_handle_t last_child; /* last child */
2461 @END
2463 /* Set the position and Z order of a window */
2464 @REQ(set_window_pos)
2465 unsigned short swp_flags; /* SWP_* flags */
2466 unsigned short paint_flags; /* paint flags (see below) */
2467 user_handle_t handle; /* handle to the window */
2468 user_handle_t previous; /* previous window in Z order */
2469 rectangle_t window; /* window rectangle (in parent coords) */
2470 rectangle_t client; /* client rectangle (in parent coords) */
2471 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2472 @REPLY
2473 unsigned int new_style; /* new window style */
2474 unsigned int new_ex_style; /* new window extended style */
2475 user_handle_t surface_win; /* window that needs a surface update */
2476 @END
2477 #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */
2478 #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */
2480 /* Get the window and client rectangles of a window */
2481 @REQ(get_window_rectangles)
2482 user_handle_t handle; /* handle to the window */
2483 int relative; /* coords relative to (see below) */
2484 @REPLY
2485 rectangle_t window; /* window rectangle */
2486 rectangle_t visible; /* visible part of the window rectangle */
2487 rectangle_t client; /* client rectangle */
2488 @END
2489 enum coords_relative
2491 COORDS_CLIENT, /* relative to client area */
2492 COORDS_WINDOW, /* relative to whole window area */
2493 COORDS_PARENT, /* relative to parent's client area */
2494 COORDS_SCREEN /* relative to screen origin */
2498 /* Get the window text */
2499 @REQ(get_window_text)
2500 user_handle_t handle; /* handle to the window */
2501 @REPLY
2502 VARARG(text,unicode_str); /* window text */
2503 @END
2506 /* Set the window text */
2507 @REQ(set_window_text)
2508 user_handle_t handle; /* handle to the window */
2509 VARARG(text,unicode_str); /* window text */
2510 @END
2513 /* Get the coordinates offset between two windows */
2514 @REQ(get_windows_offset)
2515 user_handle_t from; /* handle to the first window */
2516 user_handle_t to; /* handle to the second window */
2517 @REPLY
2518 int x; /* x coordinate offset */
2519 int y; /* y coordinate offset */
2520 int mirror; /* whether to mirror the x coordinate */
2521 @END
2524 /* Get the visible region of a window */
2525 @REQ(get_visible_region)
2526 user_handle_t window; /* handle to the window */
2527 unsigned int flags; /* DCX flags */
2528 @REPLY
2529 user_handle_t top_win; /* top window to clip against */
2530 rectangle_t top_rect; /* top window visible rect with screen coords */
2531 rectangle_t win_rect; /* window rect in screen coords */
2532 unsigned int paint_flags; /* paint flags (from SET_WINPOS_* flags) */
2533 data_size_t total_size; /* total size of the resulting region */
2534 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2535 @END
2538 /* Get the visible surface region of a window */
2539 @REQ(get_surface_region)
2540 user_handle_t window; /* handle to the window */
2541 @REPLY
2542 rectangle_t visible_rect; /* window visible rect in screen coords */
2543 data_size_t total_size; /* total size of the resulting region */
2544 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2545 @END
2548 /* Get the window region */
2549 @REQ(get_window_region)
2550 user_handle_t window; /* handle to the window */
2551 @REPLY
2552 data_size_t total_size; /* total size of the resulting region */
2553 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2554 @END
2557 /* Set the window region */
2558 @REQ(set_window_region)
2559 user_handle_t window; /* handle to the window */
2560 int redraw; /* redraw the window? */
2561 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2562 @END
2565 /* Get the window update region */
2566 @REQ(get_update_region)
2567 user_handle_t window; /* handle to the window */
2568 user_handle_t from_child; /* child to start searching from */
2569 unsigned int flags; /* update flags (see below) */
2570 @REPLY
2571 user_handle_t child; /* child to repaint (or window itself) */
2572 unsigned int flags; /* resulting update flags (see below) */
2573 data_size_t total_size; /* total size of the resulting region */
2574 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2575 @END
2576 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2577 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2578 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2579 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2580 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2581 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2582 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2583 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2586 /* Update the z order of a window so that a given rectangle is fully visible */
2587 @REQ(update_window_zorder)
2588 user_handle_t window; /* handle to the window */
2589 rectangle_t rect; /* rectangle that must be visible (in client coords) */
2590 @END
2593 /* Mark parts of a window as needing a redraw */
2594 @REQ(redraw_window)
2595 user_handle_t window; /* handle to the window */
2596 unsigned int flags; /* RDW_* flags */
2597 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2598 @END
2601 /* Set a window property */
2602 @REQ(set_window_property)
2603 user_handle_t window; /* handle to the window */
2604 lparam_t data; /* data to store */
2605 atom_t atom; /* property atom (if no name specified) */
2606 VARARG(name,unicode_str); /* property name */
2607 @END
2610 /* Remove a window property */
2611 @REQ(remove_window_property)
2612 user_handle_t window; /* handle to the window */
2613 atom_t atom; /* property atom (if no name specified) */
2614 VARARG(name,unicode_str); /* property name */
2615 @REPLY
2616 lparam_t data; /* data stored in property */
2617 @END
2620 /* Get a window property */
2621 @REQ(get_window_property)
2622 user_handle_t window; /* handle to the window */
2623 atom_t atom; /* property atom (if no name specified) */
2624 VARARG(name,unicode_str); /* property name */
2625 @REPLY
2626 lparam_t data; /* data stored in property */
2627 @END
2630 /* Get the list of properties of a window */
2631 @REQ(get_window_properties)
2632 user_handle_t window; /* handle to the window */
2633 @REPLY
2634 int total; /* total number of properties */
2635 VARARG(props,properties); /* list of properties */
2636 @END
2639 /* Create a window station */
2640 @REQ(create_winstation)
2641 unsigned int flags; /* window station flags */
2642 unsigned int access; /* wanted access rights */
2643 unsigned int attributes; /* object attributes */
2644 VARARG(name,unicode_str); /* object name */
2645 @REPLY
2646 obj_handle_t handle; /* handle to the window station */
2647 @END
2650 /* Open a handle to a window station */
2651 @REQ(open_winstation)
2652 unsigned int access; /* wanted access rights */
2653 unsigned int attributes; /* object attributes */
2654 VARARG(name,unicode_str); /* object name */
2655 @REPLY
2656 obj_handle_t handle; /* handle to the window station */
2657 @END
2660 /* Close a window station */
2661 @REQ(close_winstation)
2662 obj_handle_t handle; /* handle to the window station */
2663 @END
2666 /* Get the process current window station */
2667 @REQ(get_process_winstation)
2668 @REPLY
2669 obj_handle_t handle; /* handle to the window station */
2670 @END
2673 /* Set the process current window station */
2674 @REQ(set_process_winstation)
2675 obj_handle_t handle; /* handle to the window station */
2676 @END
2679 /* Enumerate window stations */
2680 @REQ(enum_winstation)
2681 unsigned int index; /* current index */
2682 @REPLY
2683 unsigned int next; /* next index */
2684 VARARG(name,unicode_str); /* window station name */
2685 @END
2688 /* Create a desktop */
2689 @REQ(create_desktop)
2690 unsigned int flags; /* desktop flags */
2691 unsigned int access; /* wanted access rights */
2692 unsigned int attributes; /* object attributes */
2693 VARARG(name,unicode_str); /* object name */
2694 @REPLY
2695 obj_handle_t handle; /* handle to the desktop */
2696 @END
2699 /* Open a handle to a desktop */
2700 @REQ(open_desktop)
2701 obj_handle_t winsta; /* window station to open (null allowed) */
2702 unsigned int flags; /* desktop flags */
2703 unsigned int access; /* wanted access rights */
2704 unsigned int attributes; /* object attributes */
2705 VARARG(name,unicode_str); /* object name */
2706 @REPLY
2707 obj_handle_t handle; /* handle to the desktop */
2708 @END
2711 /* Open a handle to current input desktop */
2712 @REQ(open_input_desktop)
2713 unsigned int flags; /* desktop flags */
2714 unsigned int access; /* wanted access rights */
2715 unsigned int attributes; /* object attributes */
2716 @REPLY
2717 obj_handle_t handle; /* handle to the desktop */
2718 @END
2721 /* Close a desktop */
2722 @REQ(close_desktop)
2723 obj_handle_t handle; /* handle to the desktop */
2724 @END
2727 /* Get the thread current desktop */
2728 @REQ(get_thread_desktop)
2729 thread_id_t tid; /* thread id */
2730 @REPLY
2731 obj_handle_t handle; /* handle to the desktop */
2732 @END
2735 /* Set the thread current desktop */
2736 @REQ(set_thread_desktop)
2737 obj_handle_t handle; /* handle to the desktop */
2738 @END
2741 /* Enumerate desktops */
2742 @REQ(enum_desktop)
2743 obj_handle_t winstation; /* handle to the window station */
2744 unsigned int index; /* current index */
2745 @REPLY
2746 unsigned int next; /* next index */
2747 VARARG(name,unicode_str); /* window station name */
2748 @END
2751 /* Get/set information about a user object (window station or desktop) */
2752 @REQ(set_user_object_info)
2753 obj_handle_t handle; /* handle to the object */
2754 unsigned int flags; /* information to set */
2755 unsigned int obj_flags; /* new object flags */
2756 @REPLY
2757 int is_desktop; /* is object a desktop? */
2758 unsigned int old_obj_flags; /* old object flags */
2759 VARARG(name,unicode_str); /* object name */
2760 @END
2761 #define SET_USER_OBJECT_FLAGS 1
2764 /* Register a hotkey */
2765 @REQ(register_hotkey)
2766 user_handle_t window; /* handle to the window */
2767 int id; /* hotkey identifier */
2768 unsigned int flags; /* modifier keys */
2769 unsigned int vkey; /* virtual key code */
2770 @REPLY
2771 int replaced; /* did we replace an existing hotkey? */
2772 unsigned int flags; /* flags of replaced hotkey */
2773 unsigned int vkey; /* virtual key code of replaced hotkey */
2774 @END
2777 /* Unregister a hotkey */
2778 @REQ(unregister_hotkey)
2779 user_handle_t window; /* handle to the window */
2780 int id; /* hotkey identifier */
2781 @REPLY
2782 unsigned int flags; /* flags of removed hotkey */
2783 unsigned int vkey; /* virtual key code of removed hotkey */
2784 @END
2787 /* Attach (or detach) thread inputs */
2788 @REQ(attach_thread_input)
2789 thread_id_t tid_from; /* thread to be attached */
2790 thread_id_t tid_to; /* thread to which tid_from should be attached */
2791 int attach; /* is it an attach? */
2792 @END
2795 /* Get input data for a given thread */
2796 @REQ(get_thread_input)
2797 thread_id_t tid; /* id of thread */
2798 @REPLY
2799 user_handle_t focus; /* handle to the focus window */
2800 user_handle_t capture; /* handle to the capture window */
2801 user_handle_t active; /* handle to the active window */
2802 user_handle_t foreground; /* handle to the global foreground window */
2803 user_handle_t menu_owner; /* handle to the menu owner */
2804 user_handle_t move_size; /* handle to the moving/resizing window */
2805 user_handle_t caret; /* handle to the caret window */
2806 user_handle_t cursor; /* handle to the cursor */
2807 int show_count; /* cursor show count */
2808 rectangle_t rect; /* caret rectangle */
2809 @END
2812 /* Get the time of the last input event */
2813 @REQ(get_last_input_time)
2814 @REPLY
2815 unsigned int time;
2816 @END
2819 /* Retrieve queue keyboard state for a given thread */
2820 @REQ(get_key_state)
2821 thread_id_t tid; /* id of thread */
2822 int key; /* optional key code or -1 */
2823 @REPLY
2824 unsigned char state; /* state of specified key */
2825 VARARG(keystate,bytes); /* state array for all the keys */
2826 @END
2828 /* Set queue keyboard state for a given thread */
2829 @REQ(set_key_state)
2830 thread_id_t tid; /* id of thread */
2831 int async; /* whether to change the async state too */
2832 VARARG(keystate,bytes); /* state array for all the keys */
2833 @END
2835 /* Set the system foreground window */
2836 @REQ(set_foreground_window)
2837 user_handle_t handle; /* handle to the foreground window */
2838 @REPLY
2839 user_handle_t previous; /* handle to the previous foreground window */
2840 int send_msg_old; /* whether we have to send a msg to the old window */
2841 int send_msg_new; /* whether we have to send a msg to the new window */
2842 @END
2844 /* Set the current thread focus window */
2845 @REQ(set_focus_window)
2846 user_handle_t handle; /* handle to the focus window */
2847 @REPLY
2848 user_handle_t previous; /* handle to the previous focus window */
2849 @END
2851 /* Set the current thread active window */
2852 @REQ(set_active_window)
2853 user_handle_t handle; /* handle to the active window */
2854 @REPLY
2855 user_handle_t previous; /* handle to the previous active window */
2856 @END
2858 /* Set the current thread capture window */
2859 @REQ(set_capture_window)
2860 user_handle_t handle; /* handle to the capture window */
2861 unsigned int flags; /* capture flags (see below) */
2862 @REPLY
2863 user_handle_t previous; /* handle to the previous capture window */
2864 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2865 @END
2866 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2867 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2870 /* Set the current thread caret window */
2871 @REQ(set_caret_window)
2872 user_handle_t handle; /* handle to the caret window */
2873 int width; /* caret width */
2874 int height; /* caret height */
2875 @REPLY
2876 user_handle_t previous; /* handle to the previous caret window */
2877 rectangle_t old_rect; /* previous caret rectangle */
2878 int old_hide; /* previous hide count */
2879 int old_state; /* previous caret state (1=on, 0=off) */
2880 @END
2883 /* Set the current thread caret information */
2884 @REQ(set_caret_info)
2885 unsigned int flags; /* caret flags (see below) */
2886 user_handle_t handle; /* handle to the caret window */
2887 int x; /* caret x position */
2888 int y; /* caret y position */
2889 int hide; /* increment for hide count (can be negative to show it) */
2890 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2891 @REPLY
2892 user_handle_t full_handle; /* handle to the current caret window */
2893 rectangle_t old_rect; /* previous caret rectangle */
2894 int old_hide; /* previous hide count */
2895 int old_state; /* previous caret state (1=on, 0=off) */
2896 @END
2897 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2898 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2899 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2902 /* Set a window hook */
2903 @REQ(set_hook)
2904 int id; /* id of the hook */
2905 process_id_t pid; /* id of process to set the hook into */
2906 thread_id_t tid; /* id of thread to set the hook into */
2907 int event_min;
2908 int event_max;
2909 client_ptr_t proc; /* hook procedure */
2910 int flags;
2911 int unicode; /* is it a unicode hook? */
2912 VARARG(module,unicode_str); /* module name */
2913 @REPLY
2914 user_handle_t handle; /* handle to the hook */
2915 unsigned int active_hooks; /* active hooks bitmap */
2916 @END
2919 /* Remove a window hook */
2920 @REQ(remove_hook)
2921 user_handle_t handle; /* handle to the hook */
2922 client_ptr_t proc; /* hook procedure if handle is 0 */
2923 int id; /* id of the hook if handle is 0 */
2924 @REPLY
2925 unsigned int active_hooks; /* active hooks bitmap */
2926 @END
2929 /* Start calling a hook chain */
2930 @REQ(start_hook_chain)
2931 int id; /* id of the hook */
2932 int event; /* signalled event */
2933 user_handle_t window; /* handle to the event window */
2934 int object_id; /* object id for out of context winevent */
2935 int child_id; /* child id for out of context winevent */
2936 @REPLY
2937 user_handle_t handle; /* handle to the next hook */
2938 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2939 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2940 int unicode; /* is it a unicode hook? */
2941 client_ptr_t proc; /* hook procedure */
2942 unsigned int active_hooks; /* active hooks bitmap */
2943 VARARG(module,unicode_str); /* module name */
2944 @END
2947 /* Finished calling a hook chain */
2948 @REQ(finish_hook_chain)
2949 int id; /* id of the hook */
2950 @END
2953 /* Get the hook information */
2954 @REQ(get_hook_info)
2955 user_handle_t handle; /* handle to the current hook */
2956 int get_next; /* do we want info about current or next hook? */
2957 int event; /* signalled event */
2958 user_handle_t window; /* handle to the event window */
2959 int object_id; /* object id for out of context winevent */
2960 int child_id; /* child id for out of context winevent */
2961 @REPLY
2962 user_handle_t handle; /* handle to the hook */
2963 int id; /* id of the hook */
2964 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2965 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2966 client_ptr_t proc; /* hook procedure */
2967 int unicode; /* is it a unicode hook? */
2968 VARARG(module,unicode_str); /* module name */
2969 @END
2972 /* Create a window class */
2973 @REQ(create_class)
2974 int local; /* is it a local class? */
2975 atom_t atom; /* class atom */
2976 unsigned int style; /* class style */
2977 mod_handle_t instance; /* module instance */
2978 int extra; /* number of extra class bytes */
2979 int win_extra; /* number of window extra bytes */
2980 client_ptr_t client_ptr; /* pointer to class in client address space */
2981 VARARG(name,unicode_str); /* class name */
2982 @REPLY
2983 atom_t atom; /* resulting class atom */
2984 @END
2987 /* Destroy a window class */
2988 @REQ(destroy_class)
2989 atom_t atom; /* class atom */
2990 mod_handle_t instance; /* module instance */
2991 VARARG(name,unicode_str); /* class name */
2992 @REPLY
2993 client_ptr_t client_ptr; /* pointer to class in client address space */
2994 @END
2997 /* Set some information in a class */
2998 @REQ(set_class_info)
2999 user_handle_t window; /* handle to the window */
3000 unsigned int flags; /* flags for info to set (see below) */
3001 atom_t atom; /* class atom */
3002 unsigned int style; /* class style */
3003 int win_extra; /* number of window extra bytes */
3004 mod_handle_t instance; /* module instance */
3005 int extra_offset; /* offset to set in extra bytes */
3006 data_size_t extra_size; /* size to set in extra bytes */
3007 lparam_t extra_value; /* value to set in extra bytes */
3008 @REPLY
3009 atom_t old_atom; /* previous class atom */
3010 unsigned int old_style; /* previous class style */
3011 int old_extra; /* previous number of class extra bytes */
3012 int old_win_extra; /* previous number of window extra bytes */
3013 mod_handle_t old_instance; /* previous module instance */
3014 lparam_t old_extra_value; /* old value in extra bytes */
3015 @END
3016 #define SET_CLASS_ATOM 0x0001
3017 #define SET_CLASS_STYLE 0x0002
3018 #define SET_CLASS_WINEXTRA 0x0004
3019 #define SET_CLASS_INSTANCE 0x0008
3020 #define SET_CLASS_EXTRA 0x0010
3023 /* Set/get clipboard information */
3024 @REQ(set_clipboard_info)
3025 unsigned int flags; /* flags for fields to set (see below) */
3026 user_handle_t clipboard; /* clipboard window */
3027 user_handle_t owner; /* clipboard owner */
3028 user_handle_t viewer; /* first clipboard viewer */
3029 unsigned int seqno; /* change sequence number */
3030 @REPLY
3031 unsigned int flags; /* status flags (see below) */
3032 user_handle_t old_clipboard; /* old clipboard window */
3033 user_handle_t old_owner; /* old clipboard owner */
3034 user_handle_t old_viewer; /* old clipboard viewer */
3035 unsigned int seqno; /* current sequence number */
3036 @END
3038 #define SET_CB_OPEN 0x001
3039 #define SET_CB_OWNER 0x002
3040 #define SET_CB_VIEWER 0x004
3041 #define SET_CB_SEQNO 0x008
3042 #define SET_CB_RELOWNER 0x010
3043 #define SET_CB_CLOSE 0x020
3044 #define CB_OPEN 0x040
3045 #define CB_OWNER 0x080
3046 #define CB_PROCESS 0x100
3049 /* Open a security token */
3050 @REQ(open_token)
3051 obj_handle_t handle; /* handle to the thread or process */
3052 unsigned int access; /* access rights to the new token */
3053 unsigned int attributes;/* object attributes */
3054 unsigned int flags; /* flags (see below) */
3055 @REPLY
3056 obj_handle_t token; /* handle to the token */
3057 @END
3058 #define OPEN_TOKEN_THREAD 1
3059 #define OPEN_TOKEN_AS_SELF 2
3062 /* Set/get the global windows */
3063 @REQ(set_global_windows)
3064 unsigned int flags; /* flags for fields to set (see below) */
3065 user_handle_t shell_window; /* handle to the new shell window */
3066 user_handle_t shell_listview; /* handle to the new shell listview window */
3067 user_handle_t progman_window; /* handle to the new program manager window */
3068 user_handle_t taskman_window; /* handle to the new task manager window */
3069 @REPLY
3070 user_handle_t old_shell_window; /* handle to the shell window */
3071 user_handle_t old_shell_listview; /* handle to the shell listview window */
3072 user_handle_t old_progman_window; /* handle to the new program manager window */
3073 user_handle_t old_taskman_window; /* handle to the new task manager window */
3074 @END
3075 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
3076 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
3077 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
3079 /* Adjust the privileges held by a token */
3080 @REQ(adjust_token_privileges)
3081 obj_handle_t handle; /* handle to the token */
3082 int disable_all; /* disable all privileges? */
3083 int get_modified_state; /* get modified privileges? */
3084 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
3085 @REPLY
3086 unsigned int len; /* total length in bytes required to store token privileges */
3087 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
3088 @END
3090 /* Retrieves the set of privileges held by or available to a token */
3091 @REQ(get_token_privileges)
3092 obj_handle_t handle; /* handle to the token */
3093 @REPLY
3094 unsigned int len; /* total length in bytes required to store token privileges */
3095 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3096 @END
3098 /* Check the token has the required privileges */
3099 @REQ(check_token_privileges)
3100 obj_handle_t handle; /* handle to the token */
3101 int all_required; /* are all the privileges required for the check to succeed? */
3102 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
3103 @REPLY
3104 int has_privileges; /* does the token have the required privileges? */
3105 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3106 @END
3108 @REQ(duplicate_token)
3109 obj_handle_t handle; /* handle to the token to duplicate */
3110 unsigned int access; /* access rights to the new token */
3111 unsigned int attributes; /* object attributes */
3112 int primary; /* is the new token to be a primary one? */
3113 int impersonation_level; /* impersonation level of the new token */
3114 @REPLY
3115 obj_handle_t new_handle; /* duplicated handle */
3116 @END
3118 @REQ(access_check)
3119 obj_handle_t handle; /* handle to the token */
3120 unsigned int desired_access; /* desired access to the object */
3121 unsigned int mapping_read; /* mapping from generic read to specific rights */
3122 unsigned int mapping_write; /* mapping from generic write to specific rights */
3123 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
3124 unsigned int mapping_all; /* mapping from generic all to specific rights */
3125 VARARG(sd,security_descriptor); /* security descriptor to check */
3126 @REPLY
3127 unsigned int access_granted; /* access rights actually granted */
3128 unsigned int access_status; /* was access granted? */
3129 unsigned int privileges_len; /* length needed to store privileges */
3130 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
3131 @END
3133 @REQ(get_token_sid)
3134 obj_handle_t handle; /* handle to the token */
3135 unsigned int which_sid; /* which SID to retrieve from the token */
3136 @REPLY
3137 data_size_t sid_len; /* length needed to store sid */
3138 VARARG(sid,SID); /* the sid specified by which_sid from the token */
3139 @END
3141 @REQ(get_token_groups)
3142 obj_handle_t handle; /* handle to the token */
3143 @REPLY
3144 data_size_t user_len; /* length needed to store user */
3145 VARARG(user,token_groups); /* groups the token's user belongs to */
3146 @END
3148 @REQ(get_token_default_dacl)
3149 obj_handle_t handle; /* handle to the token */
3150 @REPLY
3151 data_size_t acl_len; /* length needed to store access control list */
3152 VARARG(acl,ACL); /* access control list */
3153 @END
3155 @REQ(set_token_default_dacl)
3156 obj_handle_t handle; /* handle to the token */
3157 VARARG(acl,ACL); /* default dacl to set */
3158 @END
3160 @REQ(set_security_object)
3161 obj_handle_t handle; /* handle to the object */
3162 unsigned int security_info; /* which parts of security descriptor to set */
3163 VARARG(sd,security_descriptor); /* security descriptor to set */
3164 @END
3166 @REQ(get_security_object)
3167 obj_handle_t handle; /* handle to the object */
3168 unsigned int security_info; /* which parts of security descriptor to get */
3169 @REPLY
3170 unsigned int sd_len; /* buffer size needed for sd */
3171 VARARG(sd,security_descriptor); /* retrieved security descriptor */
3172 @END
3174 /* Create a mailslot */
3175 @REQ(create_mailslot)
3176 unsigned int access; /* wanted access rights */
3177 unsigned int attributes; /* object attributes */
3178 obj_handle_t rootdir; /* root directory */
3179 timeout_t read_timeout;
3180 unsigned int max_msgsize;
3181 VARARG(name,unicode_str); /* mailslot name */
3182 @REPLY
3183 obj_handle_t handle; /* handle to the mailslot */
3184 @END
3187 /* Set mailslot information */
3188 @REQ(set_mailslot_info)
3189 obj_handle_t handle; /* handle to the mailslot */
3190 timeout_t read_timeout;
3191 unsigned int flags;
3192 @REPLY
3193 timeout_t read_timeout;
3194 unsigned int max_msgsize;
3195 @END
3196 #define MAILSLOT_SET_READ_TIMEOUT 1
3199 /* Create a directory object */
3200 @REQ(create_directory)
3201 unsigned int access; /* access flags */
3202 unsigned int attributes; /* object attributes */
3203 obj_handle_t rootdir; /* root directory */
3204 VARARG(directory_name,unicode_str); /* Directory name */
3205 @REPLY
3206 obj_handle_t handle; /* handle to the directory */
3207 @END
3210 /* Open a directory object */
3211 @REQ(open_directory)
3212 unsigned int access; /* access flags */
3213 unsigned int attributes; /* object attributes */
3214 obj_handle_t rootdir; /* root directory */
3215 VARARG(directory_name,unicode_str); /* Directory name */
3216 @REPLY
3217 obj_handle_t handle; /* handle to the directory */
3218 @END
3221 /* Get a directory entry by index */
3222 @REQ(get_directory_entry)
3223 obj_handle_t handle; /* handle to the directory */
3224 unsigned int index; /* entry index */
3225 @REPLY
3226 data_size_t name_len; /* length of the entry name in bytes */
3227 VARARG(name,unicode_str,name_len); /* entry name */
3228 VARARG(type,unicode_str); /* entry type */
3229 @END
3232 /* Create a symbolic link object */
3233 @REQ(create_symlink)
3234 unsigned int access; /* access flags */
3235 unsigned int attributes; /* object attributes */
3236 obj_handle_t rootdir; /* root directory */
3237 data_size_t name_len; /* length of the symlink name in bytes */
3238 VARARG(name,unicode_str,name_len); /* symlink name */
3239 VARARG(target_name,unicode_str); /* target name */
3240 @REPLY
3241 obj_handle_t handle; /* handle to the symlink */
3242 @END
3245 /* Open a symbolic link object */
3246 @REQ(open_symlink)
3247 unsigned int access; /* access flags */
3248 unsigned int attributes; /* object attributes */
3249 obj_handle_t rootdir; /* root directory */
3250 VARARG(name,unicode_str); /* symlink name */
3251 @REPLY
3252 obj_handle_t handle; /* handle to the symlink */
3253 @END
3256 /* Query a symbolic link object */
3257 @REQ(query_symlink)
3258 obj_handle_t handle; /* handle to the symlink */
3259 @REPLY
3260 data_size_t total; /* total needed size for name */
3261 VARARG(target_name,unicode_str); /* target name */
3262 @END
3265 /* Query basic object information */
3266 @REQ(get_object_info)
3267 obj_handle_t handle; /* handle to the object */
3268 @REPLY
3269 unsigned int access; /* granted access mask */
3270 unsigned int ref_count; /* object ref count */
3271 data_size_t total; /* total needed size for name */
3272 VARARG(name,unicode_str); /* object name */
3273 @END
3276 /* Unlink a named object */
3277 @REQ(unlink_object)
3278 obj_handle_t handle; /* handle to the object */
3279 @END
3282 /* Query the impersonation level of an impersonation token */
3283 @REQ(get_token_impersonation_level)
3284 obj_handle_t handle; /* handle to the object */
3285 @REPLY
3286 int impersonation_level; /* impersonation level of the impersonation token */
3287 @END
3289 /* Allocate a locally-unique identifier */
3290 @REQ(allocate_locally_unique_id)
3291 @REPLY
3292 luid_t luid;
3293 @END
3296 /* Create a device manager */
3297 @REQ(create_device_manager)
3298 unsigned int access; /* wanted access rights */
3299 unsigned int attributes; /* object attributes */
3300 @REPLY
3301 obj_handle_t handle; /* handle to the device */
3302 @END
3305 /* Create a device */
3306 @REQ(create_device)
3307 unsigned int access; /* wanted access rights */
3308 unsigned int attributes; /* object attributes */
3309 obj_handle_t rootdir; /* root directory */
3310 client_ptr_t user_ptr; /* opaque ptr for use by client */
3311 obj_handle_t manager; /* device manager */
3312 VARARG(name,unicode_str); /* object name */
3313 @REPLY
3314 obj_handle_t handle; /* handle to the device */
3315 @END
3318 /* Delete a device */
3319 @REQ(delete_device)
3320 obj_handle_t handle; /* handle to the device */
3321 @END
3324 /* Retrieve the next pending device ioctl request */
3325 @REQ(get_next_device_request)
3326 obj_handle_t manager; /* handle to the device manager */
3327 obj_handle_t prev; /* handle to the previous ioctl */
3328 unsigned int status; /* status of the previous ioctl */
3329 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3330 @REPLY
3331 obj_handle_t next; /* handle to the next ioctl */
3332 ioctl_code_t code; /* ioctl code */
3333 client_ptr_t user_ptr; /* opaque ptr for the device */
3334 process_id_t client_pid; /* pid of process calling ioctl */
3335 thread_id_t client_tid; /* tid of thread calling ioctl */
3336 data_size_t in_size; /* total needed input size */
3337 data_size_t out_size; /* needed output size */
3338 VARARG(next_data,bytes); /* input data of the next ioctl */
3339 @END
3342 /* Make the current process a system process */
3343 @REQ(make_process_system)
3344 @REPLY
3345 obj_handle_t event; /* event signaled when all user processes have exited */
3346 @END
3349 /* Get detailed fixed-size information about a token */
3350 @REQ(get_token_statistics)
3351 obj_handle_t handle; /* handle to the object */
3352 @REPLY
3353 luid_t token_id; /* locally-unique identifier of the token */
3354 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3355 int primary; /* is the token primary or impersonation? */
3356 int impersonation_level; /* level of impersonation */
3357 int group_count; /* the number of groups the token is a member of */
3358 int privilege_count; /* the number of privileges the token has */
3359 @END
3362 /* Create I/O completion port */
3363 @REQ(create_completion)
3364 unsigned int access; /* desired access to a port */
3365 unsigned int attributes; /* object attributes */
3366 unsigned int concurrent; /* max number of concurrent active threads */
3367 obj_handle_t rootdir; /* root directory */
3368 VARARG(filename,string); /* port name */
3369 @REPLY
3370 obj_handle_t handle; /* port handle */
3371 @END
3374 /* Open I/O completion port */
3375 @REQ(open_completion)
3376 unsigned int access; /* desired access to a port */
3377 unsigned int attributes; /* object attributes */
3378 obj_handle_t rootdir; /* root directory */
3379 VARARG(filename,string); /* port name */
3380 @REPLY
3381 obj_handle_t handle; /* port handle */
3382 @END
3385 /* add completion to completion port */
3386 @REQ(add_completion)
3387 obj_handle_t handle; /* port handle */
3388 apc_param_t ckey; /* completion key */
3389 apc_param_t cvalue; /* completion value */
3390 apc_param_t information; /* IO_STATUS_BLOCK Information */
3391 unsigned int status; /* completion result */
3392 @END
3395 /* get completion from completion port queue */
3396 @REQ(remove_completion)
3397 obj_handle_t handle; /* port handle */
3398 @REPLY
3399 apc_param_t ckey; /* completion key */
3400 apc_param_t cvalue; /* completion value */
3401 apc_param_t information; /* IO_STATUS_BLOCK Information */
3402 unsigned int status; /* completion result */
3403 @END
3406 /* get completion queue depth */
3407 @REQ(query_completion)
3408 obj_handle_t handle; /* port handle */
3409 @REPLY
3410 unsigned int depth; /* completion queue depth */
3411 @END
3414 /* associate object with completion port */
3415 @REQ(set_completion_info)
3416 obj_handle_t handle; /* object handle */
3417 apc_param_t ckey; /* completion key */
3418 obj_handle_t chandle; /* port handle */
3419 @END
3422 /* check for associated completion and push msg */
3423 @REQ(add_fd_completion)
3424 obj_handle_t handle; /* async' object */
3425 apc_param_t cvalue; /* completion value */
3426 apc_param_t information; /* IO_STATUS_BLOCK Information */
3427 unsigned int status; /* completion status */
3428 @END
3431 /* Retrieve layered info for a window */
3432 @REQ(get_window_layered_info)
3433 user_handle_t handle; /* handle to the window */
3434 @REPLY
3435 unsigned int color_key; /* color key */
3436 unsigned int alpha; /* alpha (0..255) */
3437 unsigned int flags; /* LWA_* flags */
3438 @END
3441 /* Set layered info for a window */
3442 @REQ(set_window_layered_info)
3443 user_handle_t handle; /* handle to the window */
3444 unsigned int color_key; /* color key */
3445 unsigned int alpha; /* alpha (0..255) */
3446 unsigned int flags; /* LWA_* flags */
3447 @END
3450 /* Allocate an arbitrary user handle */
3451 @REQ(alloc_user_handle)
3452 @REPLY
3453 user_handle_t handle; /* allocated handle */
3454 @END
3457 /* Free an arbitrary user handle */
3458 @REQ(free_user_handle)
3459 user_handle_t handle; /* handle to free*/
3460 @END
3463 /* Set/get the current cursor */
3464 @REQ(set_cursor)
3465 unsigned int flags; /* flags for fields to set (see below) */
3466 user_handle_t handle; /* handle to the cursor */
3467 int show_count; /* show count increment/decrement */
3468 int x; /* cursor position */
3469 int y;
3470 rectangle_t clip; /* cursor clip rectangle */
3471 unsigned int clip_msg; /* message to post on cursor clip changes */
3472 @REPLY
3473 user_handle_t prev_handle; /* previous handle */
3474 int prev_count; /* previous show count */
3475 int prev_x; /* previous position */
3476 int prev_y;
3477 int new_x; /* new position */
3478 int new_y;
3479 rectangle_t new_clip; /* new clip rectangle */
3480 unsigned int last_change; /* time of last position change */
3481 @END
3482 #define SET_CURSOR_HANDLE 0x01
3483 #define SET_CURSOR_COUNT 0x02
3484 #define SET_CURSOR_POS 0x04
3485 #define SET_CURSOR_CLIP 0x08
3486 #define SET_CURSOR_NOCLIP 0x10
3489 /* Modify the list of registered rawinput devices */
3490 @REQ(update_rawinput_devices)
3491 VARARG(devices,rawinput_devices);
3492 @END
3495 /* Retrieve the suspended context of a thread */
3496 @REQ(get_suspend_context)
3497 @REPLY
3498 VARARG(context,context); /* thread context */
3499 @END
3502 /* Store the suspend context of a thread */
3503 @REQ(set_suspend_context)
3504 VARARG(context,context); /* thread context */
3505 @END