comsvcs: Add stub dll.
[wine/multimedia.git] / server / protocol.def
blob6748e5d149e1c652b0a6a17cf1c4e53fad707070
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 apc_type
425 APC_NONE,
426 APC_USER,
427 APC_TIMER,
428 APC_ASYNC_IO,
429 APC_VIRTUAL_ALLOC,
430 APC_VIRTUAL_FREE,
431 APC_VIRTUAL_QUERY,
432 APC_VIRTUAL_PROTECT,
433 APC_VIRTUAL_FLUSH,
434 APC_VIRTUAL_LOCK,
435 APC_VIRTUAL_UNLOCK,
436 APC_MAP_VIEW,
437 APC_UNMAP_VIEW,
438 APC_CREATE_THREAD
441 typedef union
443 enum apc_type type;
444 struct
446 enum apc_type type; /* APC_USER */
447 int __pad;
448 client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
449 apc_param_t args[3]; /* arguments for user function */
450 } user;
451 struct
453 enum apc_type type; /* APC_TIMER */
454 int __pad;
455 client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
456 timeout_t time; /* absolute time of expiration */
457 client_ptr_t arg; /* user argument */
458 } timer;
459 struct
461 enum apc_type type; /* APC_ASYNC_IO */
462 unsigned int status; /* I/O status */
463 client_ptr_t func; /* unsigned int (*func)(void*, void*, unsigned int, void **); */
464 client_ptr_t user; /* user pointer */
465 client_ptr_t sb; /* status block */
466 } async_io;
467 struct
469 enum apc_type type; /* APC_VIRTUAL_ALLOC */
470 unsigned int op_type; /* type of operation */
471 client_ptr_t addr; /* requested address */
472 mem_size_t size; /* allocation size */
473 unsigned int zero_bits; /* allocation alignment */
474 unsigned int prot; /* memory protection flags */
475 } virtual_alloc;
476 struct
478 enum apc_type type; /* APC_VIRTUAL_FREE */
479 unsigned int op_type; /* type of operation */
480 client_ptr_t addr; /* requested address */
481 mem_size_t size; /* allocation size */
482 } virtual_free;
483 struct
485 enum apc_type type; /* APC_VIRTUAL_QUERY */
486 int __pad;
487 client_ptr_t addr; /* requested address */
488 } virtual_query;
489 struct
491 enum apc_type type; /* APC_VIRTUAL_PROTECT */
492 unsigned int prot; /* new protection flags */
493 client_ptr_t addr; /* requested address */
494 mem_size_t size; /* requested size */
495 } virtual_protect;
496 struct
498 enum apc_type type; /* APC_VIRTUAL_FLUSH */
499 int __pad;
500 client_ptr_t addr; /* requested address */
501 mem_size_t size; /* requested size */
502 } virtual_flush;
503 struct
505 enum apc_type type; /* APC_VIRTUAL_LOCK */
506 int __pad;
507 client_ptr_t addr; /* requested address */
508 mem_size_t size; /* requested size */
509 } virtual_lock;
510 struct
512 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
513 int __pad;
514 client_ptr_t addr; /* requested address */
515 mem_size_t size; /* requested size */
516 } virtual_unlock;
517 struct
519 enum apc_type type; /* APC_MAP_VIEW */
520 obj_handle_t handle; /* mapping handle */
521 client_ptr_t addr; /* requested address */
522 mem_size_t size; /* allocation size */
523 file_pos_t offset; /* file offset */
524 unsigned int alloc_type;/* allocation type */
525 unsigned short zero_bits; /* allocation alignment */
526 unsigned short prot; /* memory protection flags */
527 } map_view;
528 struct
530 enum apc_type type; /* APC_UNMAP_VIEW */
531 int __pad;
532 client_ptr_t addr; /* view address */
533 } unmap_view;
534 struct
536 enum apc_type type; /* APC_CREATE_THREAD */
537 int suspend; /* suspended thread? */
538 client_ptr_t func; /* void (__stdcall *func)(void*); start function */
539 client_ptr_t arg; /* argument for start function */
540 mem_size_t reserve; /* reserve size for thread stack */
541 mem_size_t commit; /* commit size for thread stack */
542 } create_thread;
543 } apc_call_t;
545 typedef union
547 enum apc_type type;
548 struct
550 enum apc_type type; /* APC_ASYNC_IO */
551 unsigned int status; /* new status of async operation */
552 client_ptr_t apc; /* user APC to call */
553 unsigned int total; /* bytes transferred */
554 } async_io;
555 struct
557 enum apc_type type; /* APC_VIRTUAL_ALLOC */
558 unsigned int status; /* status returned by call */
559 client_ptr_t addr; /* resulting address */
560 mem_size_t size; /* resulting size */
561 } virtual_alloc;
562 struct
564 enum apc_type type; /* APC_VIRTUAL_FREE */
565 unsigned int status; /* status returned by call */
566 client_ptr_t addr; /* resulting address */
567 mem_size_t size; /* resulting size */
568 } virtual_free;
569 struct
571 enum apc_type type; /* APC_VIRTUAL_QUERY */
572 unsigned int status; /* status returned by call */
573 client_ptr_t base; /* resulting base address */
574 client_ptr_t alloc_base;/* resulting allocation base */
575 mem_size_t size; /* resulting region size */
576 unsigned short state; /* resulting region state */
577 unsigned short prot; /* resulting region protection */
578 unsigned short alloc_prot;/* resulting allocation protection */
579 unsigned short alloc_type;/* resulting region allocation type */
580 } virtual_query;
581 struct
583 enum apc_type type; /* APC_VIRTUAL_PROTECT */
584 unsigned int status; /* status returned by call */
585 client_ptr_t addr; /* resulting address */
586 mem_size_t size; /* resulting size */
587 unsigned int prot; /* old protection flags */
588 } virtual_protect;
589 struct
591 enum apc_type type; /* APC_VIRTUAL_FLUSH */
592 unsigned int status; /* status returned by call */
593 client_ptr_t addr; /* resulting address */
594 mem_size_t size; /* resulting size */
595 } virtual_flush;
596 struct
598 enum apc_type type; /* APC_VIRTUAL_LOCK */
599 unsigned int status; /* status returned by call */
600 client_ptr_t addr; /* resulting address */
601 mem_size_t size; /* resulting size */
602 } virtual_lock;
603 struct
605 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
606 unsigned int status; /* status returned by call */
607 client_ptr_t addr; /* resulting address */
608 mem_size_t size; /* resulting size */
609 } virtual_unlock;
610 struct
612 enum apc_type type; /* APC_MAP_VIEW */
613 unsigned int status; /* status returned by call */
614 client_ptr_t addr; /* resulting address */
615 mem_size_t size; /* resulting size */
616 } map_view;
617 struct
619 enum apc_type type; /* APC_MAP_VIEW */
620 unsigned int status; /* status returned by call */
621 } unmap_view;
622 struct
624 enum apc_type type; /* APC_CREATE_THREAD */
625 unsigned int status; /* status returned by call */
626 thread_id_t tid; /* thread id */
627 obj_handle_t handle; /* handle to new thread */
628 } create_thread;
629 } apc_result_t;
631 struct rawinput_device
633 unsigned short usage_page;
634 unsigned short usage;
635 unsigned int flags;
636 user_handle_t target;
639 /****************************************************************/
640 /* Request declarations */
642 /* Create a new process from the context of the parent */
643 @REQ(new_process)
644 int inherit_all; /* inherit all handles from parent */
645 unsigned int create_flags; /* creation flags */
646 int socket_fd; /* file descriptor for process socket */
647 obj_handle_t exe_file; /* file handle for main exe */
648 unsigned int process_access; /* access rights for process object */
649 unsigned int process_attr; /* attributes for process object */
650 unsigned int thread_access; /* access rights for thread object */
651 unsigned int thread_attr; /* attributes for thread object */
652 data_size_t info_size; /* size of startup info */
653 VARARG(info,startup_info,info_size); /* startup information */
654 VARARG(env,unicode_str); /* environment for new process */
655 @REPLY
656 obj_handle_t info; /* new process info handle */
657 process_id_t pid; /* process id */
658 obj_handle_t phandle; /* process handle (in the current process) */
659 thread_id_t tid; /* thread id */
660 obj_handle_t thandle; /* thread handle (in the current process) */
661 @END
664 /* Retrieve information about a newly started process */
665 @REQ(get_new_process_info)
666 obj_handle_t info; /* info handle returned from new_process_request */
667 @REPLY
668 int success; /* did the process start successfully? */
669 int exit_code; /* process exit code if failed */
670 @END
673 /* Create a new thread from the context of the parent */
674 @REQ(new_thread)
675 unsigned int access; /* wanted access rights */
676 unsigned int attributes; /* object attributes */
677 int suspend; /* new thread should be suspended on creation */
678 int request_fd; /* fd for request pipe */
679 @REPLY
680 thread_id_t tid; /* thread id */
681 obj_handle_t handle; /* thread handle (in the current process) */
682 @END
685 /* Retrieve the new process startup info */
686 @REQ(get_startup_info)
687 @REPLY
688 obj_handle_t exe_file; /* file handle for main exe */
689 data_size_t info_size; /* size of startup info */
690 VARARG(info,startup_info,info_size); /* startup information */
691 VARARG(env,unicode_str); /* environment */
692 @END
695 /* Signal the end of the process initialization */
696 @REQ(init_process_done)
697 int gui; /* is it a GUI process? */
698 mod_handle_t module; /* main module base address */
699 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
700 client_ptr_t entry; /* process entry point */
701 @END
704 /* Initialize a thread; called from the child after fork()/clone() */
705 @REQ(init_thread)
706 int unix_pid; /* Unix pid of new thread */
707 int unix_tid; /* Unix tid of new thread */
708 int debug_level; /* new debug level */
709 client_ptr_t teb; /* TEB of new thread (in thread address space) */
710 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
711 int reply_fd; /* fd for reply pipe */
712 int wait_fd; /* fd for blocking calls pipe */
713 cpu_type_t cpu; /* CPU that this thread is running on */
714 @REPLY
715 process_id_t pid; /* process id of the new thread's process */
716 thread_id_t tid; /* thread id of the new thread */
717 timeout_t server_start; /* server start time */
718 data_size_t info_size; /* total size of startup info */
719 int version; /* protocol version */
720 unsigned int all_cpus; /* bitset of supported CPUs */
721 @END
724 /* Terminate a process */
725 @REQ(terminate_process)
726 obj_handle_t handle; /* process handle to terminate */
727 int exit_code; /* process exit code */
728 @REPLY
729 int self; /* suicide? */
730 @END
733 /* Terminate a thread */
734 @REQ(terminate_thread)
735 obj_handle_t handle; /* thread handle to terminate */
736 int exit_code; /* thread exit code */
737 @REPLY
738 int self; /* suicide? */
739 int last; /* last thread in this process? */
740 @END
743 /* Retrieve information about a process */
744 @REQ(get_process_info)
745 obj_handle_t handle; /* process handle */
746 @REPLY
747 process_id_t pid; /* server process id */
748 process_id_t ppid; /* server process id of parent */
749 affinity_t affinity; /* process affinity mask */
750 client_ptr_t peb; /* PEB address in process address space */
751 timeout_t start_time; /* process start time */
752 timeout_t end_time; /* process end time */
753 int exit_code; /* process exit code */
754 int priority; /* priority class */
755 cpu_type_t cpu; /* CPU that this process is running on */
756 int debugger_present; /* process is being debugged */
757 @END
760 /* Set a process information */
761 @REQ(set_process_info)
762 obj_handle_t handle; /* process handle */
763 int mask; /* setting mask (see below) */
764 int priority; /* priority class */
765 affinity_t affinity; /* affinity mask */
766 @END
767 #define SET_PROCESS_INFO_PRIORITY 0x01
768 #define SET_PROCESS_INFO_AFFINITY 0x02
771 /* Retrieve information about a thread */
772 @REQ(get_thread_info)
773 obj_handle_t handle; /* thread handle */
774 thread_id_t tid_in; /* thread id (optional) */
775 @REPLY
776 process_id_t pid; /* server process id */
777 thread_id_t tid; /* server thread id */
778 client_ptr_t teb; /* thread teb pointer */
779 affinity_t affinity; /* thread affinity mask */
780 timeout_t creation_time; /* thread creation time */
781 timeout_t exit_time; /* thread exit time */
782 int exit_code; /* thread exit code */
783 int priority; /* thread priority level */
784 int last; /* last thread in process */
785 @END
788 /* Set a thread information */
789 @REQ(set_thread_info)
790 obj_handle_t handle; /* thread handle */
791 int mask; /* setting mask (see below) */
792 int priority; /* priority class */
793 affinity_t affinity; /* affinity mask */
794 obj_handle_t token; /* impersonation token */
795 @END
796 #define SET_THREAD_INFO_PRIORITY 0x01
797 #define SET_THREAD_INFO_AFFINITY 0x02
798 #define SET_THREAD_INFO_TOKEN 0x04
801 /* Retrieve information about a module */
802 @REQ(get_dll_info)
803 obj_handle_t handle; /* process handle */
804 mod_handle_t base_address; /* base address of module */
805 @REPLY
806 client_ptr_t entry_point;
807 data_size_t size; /* module size */
808 data_size_t filename_len; /* buffer len in bytes required to store filename */
809 VARARG(filename,unicode_str); /* file name of module */
810 @END
813 /* Suspend a thread */
814 @REQ(suspend_thread)
815 obj_handle_t handle; /* thread handle */
816 @REPLY
817 int count; /* new suspend count */
818 @END
821 /* Resume a thread */
822 @REQ(resume_thread)
823 obj_handle_t handle; /* thread handle */
824 @REPLY
825 int count; /* new suspend count */
826 @END
829 /* Notify the server that a dll has been loaded */
830 @REQ(load_dll)
831 obj_handle_t mapping; /* file mapping handle */
832 mod_handle_t base; /* base address */
833 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
834 data_size_t size; /* dll size */
835 int dbg_offset; /* debug info offset */
836 int dbg_size; /* debug info size */
837 VARARG(filename,unicode_str); /* file name of dll */
838 @END
841 /* Notify the server that a dll is being unloaded */
842 @REQ(unload_dll)
843 mod_handle_t base; /* base address */
844 @END
847 /* Queue an APC for a thread or process */
848 @REQ(queue_apc)
849 obj_handle_t handle; /* thread or process handle */
850 apc_call_t call; /* call arguments */
851 @REPLY
852 obj_handle_t handle; /* APC handle */
853 int self; /* run APC in caller itself? */
854 @END
857 /* Get the result of an APC call */
858 @REQ(get_apc_result)
859 obj_handle_t handle; /* handle to the APC */
860 @REPLY
861 apc_result_t result; /* result of the APC */
862 @END
865 /* Close a handle for the current process */
866 @REQ(close_handle)
867 obj_handle_t handle; /* handle to close */
868 @END
871 /* Set a handle information */
872 @REQ(set_handle_info)
873 obj_handle_t handle; /* handle we are interested in */
874 int flags; /* new handle flags */
875 int mask; /* mask for flags to set */
876 @REPLY
877 int old_flags; /* old flag value */
878 @END
881 /* Duplicate a handle */
882 @REQ(dup_handle)
883 obj_handle_t src_process; /* src process handle */
884 obj_handle_t src_handle; /* src handle to duplicate */
885 obj_handle_t dst_process; /* dst process handle */
886 unsigned int access; /* wanted access rights */
887 unsigned int attributes; /* object attributes */
888 unsigned int options; /* duplicate options (see below) */
889 @REPLY
890 obj_handle_t handle; /* duplicated handle in dst process */
891 int self; /* is the source the current process? */
892 int closed; /* whether the source handle has been closed */
893 @END
894 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
895 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
896 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
899 /* Open a handle to a process */
900 @REQ(open_process)
901 process_id_t pid; /* process id to open */
902 unsigned int access; /* wanted access rights */
903 unsigned int attributes; /* object attributes */
904 @REPLY
905 obj_handle_t handle; /* handle to the process */
906 @END
909 /* Open a handle to a thread */
910 @REQ(open_thread)
911 thread_id_t tid; /* thread id to open */
912 unsigned int access; /* wanted access rights */
913 unsigned int attributes; /* object attributes */
914 @REPLY
915 obj_handle_t handle; /* handle to the thread */
916 @END
919 /* Wait for handles */
920 @REQ(select)
921 int flags; /* wait flags (see below) */
922 client_ptr_t cookie; /* magic cookie to return to client */
923 obj_handle_t signal; /* object to signal (0 if none) */
924 obj_handle_t prev_apc; /* handle to previous APC */
925 timeout_t timeout; /* timeout */
926 VARARG(result,apc_result); /* result of previous APC */
927 VARARG(handles,handles); /* handles to select on */
928 @REPLY
929 timeout_t timeout; /* timeout converted to absolute */
930 apc_call_t call; /* APC call arguments */
931 obj_handle_t apc_handle; /* handle to next APC */
932 @END
933 #define SELECT_ALL 1
934 #define SELECT_ALERTABLE 2
935 #define SELECT_INTERRUPTIBLE 4
938 /* Create an event */
939 @REQ(create_event)
940 unsigned int access; /* wanted access rights */
941 unsigned int attributes; /* object attributes */
942 int manual_reset; /* manual reset event */
943 int initial_state; /* initial state of the event */
944 VARARG(objattr,object_attributes); /* object attributes */
945 @REPLY
946 obj_handle_t handle; /* handle to the event */
947 @END
949 /* Event operation */
950 @REQ(event_op)
951 obj_handle_t handle; /* handle to event */
952 int op; /* event operation (see below) */
953 @END
954 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
956 @REQ(query_event)
957 obj_handle_t handle; /* handle to event */
958 @REPLY
959 int manual_reset; /* manual reset event */
960 int state; /* current state of the event */
961 @END
963 /* Open an event */
964 @REQ(open_event)
965 unsigned int access; /* wanted access rights */
966 unsigned int attributes; /* object attributes */
967 obj_handle_t rootdir; /* root directory */
968 VARARG(name,unicode_str); /* object name */
969 @REPLY
970 obj_handle_t handle; /* handle to the event */
971 @END
974 /* Create a keyed event */
975 @REQ(create_keyed_event)
976 unsigned int access; /* wanted access rights */
977 unsigned int attributes; /* object attributes */
978 VARARG(objattr,object_attributes); /* object attributes */
979 @REPLY
980 obj_handle_t handle; /* handle to the event */
981 @END
983 /* Open a keyed event */
984 @REQ(open_keyed_event)
985 unsigned int access; /* wanted access rights */
986 unsigned int attributes; /* object attributes */
987 obj_handle_t rootdir; /* root directory */
988 VARARG(name,unicode_str); /* object name */
989 @REPLY
990 obj_handle_t handle; /* handle to the event */
991 @END
994 /* Create a mutex */
995 @REQ(create_mutex)
996 unsigned int access; /* wanted access rights */
997 unsigned int attributes; /* object attributes */
998 int owned; /* initially owned? */
999 VARARG(objattr,object_attributes); /* object attributes */
1000 @REPLY
1001 obj_handle_t handle; /* handle to the mutex */
1002 @END
1005 /* Release a mutex */
1006 @REQ(release_mutex)
1007 obj_handle_t handle; /* handle to the mutex */
1008 @REPLY
1009 unsigned int prev_count; /* value of internal counter, before release */
1010 @END
1013 /* Open a mutex */
1014 @REQ(open_mutex)
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 mutex */
1021 @END
1024 /* Create a semaphore */
1025 @REQ(create_semaphore)
1026 unsigned int access; /* wanted access rights */
1027 unsigned int attributes; /* object attributes */
1028 unsigned int initial; /* initial count */
1029 unsigned int max; /* maximum count */
1030 VARARG(objattr,object_attributes); /* object attributes */
1031 @REPLY
1032 obj_handle_t handle; /* handle to the semaphore */
1033 @END
1036 /* Release a semaphore */
1037 @REQ(release_semaphore)
1038 obj_handle_t handle; /* handle to the semaphore */
1039 unsigned int count; /* count to add to semaphore */
1040 @REPLY
1041 unsigned int prev_count; /* previous semaphore count */
1042 @END
1045 /* Open a semaphore */
1046 @REQ(open_semaphore)
1047 unsigned int access; /* wanted access rights */
1048 unsigned int attributes; /* object attributes */
1049 obj_handle_t rootdir; /* root directory */
1050 VARARG(name,unicode_str); /* object name */
1051 @REPLY
1052 obj_handle_t handle; /* handle to the semaphore */
1053 @END
1056 /* Create a file */
1057 @REQ(create_file)
1058 unsigned int access; /* wanted access rights */
1059 unsigned int attributes; /* object attributes */
1060 unsigned int sharing; /* sharing flags */
1061 int create; /* file create action */
1062 unsigned int options; /* file options */
1063 unsigned int attrs; /* file attributes for creation */
1064 VARARG(objattr,object_attributes); /* object attributes */
1065 VARARG(filename,string); /* file name */
1066 @REPLY
1067 obj_handle_t handle; /* handle to the file */
1068 @END
1071 /* Open a file object */
1072 @REQ(open_file_object)
1073 unsigned int access; /* wanted access rights */
1074 unsigned int attributes; /* open attributes */
1075 obj_handle_t rootdir; /* root directory */
1076 unsigned int sharing; /* sharing flags */
1077 unsigned int options; /* file options */
1078 VARARG(filename,unicode_str); /* file name */
1079 @REPLY
1080 obj_handle_t handle; /* handle to the file */
1081 @END
1084 /* Allocate a file handle for a Unix fd */
1085 @REQ(alloc_file_handle)
1086 unsigned int access; /* wanted access rights */
1087 unsigned int attributes; /* object attributes */
1088 int fd; /* file descriptor on the client side */
1089 @REPLY
1090 obj_handle_t handle; /* handle to the file */
1091 @END
1094 /* Get the Unix name from a file handle */
1095 @REQ(get_handle_unix_name)
1096 obj_handle_t handle; /* file handle */
1097 @REPLY
1098 data_size_t name_len; /* unix name length */
1099 VARARG(name,string); /* unix name */
1100 @END
1103 /* Get a Unix fd to access a file */
1104 @REQ(get_handle_fd)
1105 obj_handle_t handle; /* handle to the file */
1106 @REPLY
1107 int type; /* file type (see below) */
1108 int cacheable; /* can fd be cached in the client? */
1109 unsigned int access; /* file access rights */
1110 unsigned int options; /* file open options */
1111 @END
1112 enum server_fd_type
1114 FD_TYPE_INVALID, /* invalid file (no associated fd) */
1115 FD_TYPE_FILE, /* regular file */
1116 FD_TYPE_DIR, /* directory */
1117 FD_TYPE_SOCKET, /* socket */
1118 FD_TYPE_SERIAL, /* serial port */
1119 FD_TYPE_PIPE, /* named pipe */
1120 FD_TYPE_MAILSLOT, /* mailslot */
1121 FD_TYPE_CHAR, /* unspecified char device */
1122 FD_TYPE_DEVICE, /* Windows device file */
1123 FD_TYPE_NB_TYPES
1127 /* Flush a file buffers */
1128 @REQ(flush_file)
1129 obj_handle_t handle; /* handle to the file */
1130 @REPLY
1131 obj_handle_t event; /* event set when finished */
1132 @END
1135 /* Lock a region of a file */
1136 @REQ(lock_file)
1137 obj_handle_t handle; /* handle to the file */
1138 file_pos_t offset; /* offset of start of lock */
1139 file_pos_t count; /* count of bytes to lock */
1140 int shared; /* shared or exclusive lock? */
1141 int wait; /* do we want to wait? */
1142 @REPLY
1143 obj_handle_t handle; /* handle to wait on */
1144 int overlapped; /* is it an overlapped I/O handle? */
1145 @END
1148 /* Unlock a region of a file */
1149 @REQ(unlock_file)
1150 obj_handle_t handle; /* handle to the file */
1151 file_pos_t offset; /* offset of start of unlock */
1152 file_pos_t count; /* count of bytes to unlock */
1153 @END
1156 /* Create a socket */
1157 @REQ(create_socket)
1158 unsigned int access; /* wanted access rights */
1159 unsigned int attributes; /* object attributes */
1160 int family; /* family, see socket manpage */
1161 int type; /* type, see socket manpage */
1162 int protocol; /* protocol, see socket manpage */
1163 unsigned int flags; /* socket flags */
1164 @REPLY
1165 obj_handle_t handle; /* handle to the new socket */
1166 @END
1169 /* Accept a socket */
1170 @REQ(accept_socket)
1171 obj_handle_t lhandle; /* handle to the listening socket */
1172 unsigned int access; /* wanted access rights */
1173 unsigned int attributes; /* object attributes */
1174 @REPLY
1175 obj_handle_t handle; /* handle to the new socket */
1176 @END
1179 /* Accept into an initialized socket */
1180 @REQ(accept_into_socket)
1181 obj_handle_t lhandle; /* handle to the listening socket */
1182 obj_handle_t ahandle; /* handle to the accepting socket */
1183 @END
1186 /* Set socket event parameters */
1187 @REQ(set_socket_event)
1188 obj_handle_t handle; /* handle to the socket */
1189 unsigned int mask; /* event mask */
1190 obj_handle_t event; /* event object */
1191 user_handle_t window; /* window to send the message to */
1192 unsigned int msg; /* message to send */
1193 @END
1196 /* Get socket event parameters */
1197 @REQ(get_socket_event)
1198 obj_handle_t handle; /* handle to the socket */
1199 int service; /* clear pending? */
1200 obj_handle_t c_event; /* event to clear */
1201 @REPLY
1202 unsigned int mask; /* event mask */
1203 unsigned int pmask; /* pending events */
1204 unsigned int state; /* status bits */
1205 VARARG(errors,ints); /* event errors */
1206 @END
1209 /* Re-enable pending socket events */
1210 @REQ(enable_socket_event)
1211 obj_handle_t handle; /* handle to the socket */
1212 unsigned int mask; /* events to re-enable */
1213 unsigned int sstate; /* status bits to set */
1214 unsigned int cstate; /* status bits to clear */
1215 @END
1217 @REQ(set_socket_deferred)
1218 obj_handle_t handle; /* handle to the socket */
1219 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1220 @END
1222 /* Allocate a console (only used by a console renderer) */
1223 @REQ(alloc_console)
1224 unsigned int access; /* wanted access rights */
1225 unsigned int attributes; /* object attributes */
1226 process_id_t pid; /* pid of process which shall be attached to the console */
1227 int input_fd; /* if pid=-1 (bare console to current process), fd for input */
1228 @REPLY
1229 obj_handle_t handle_in; /* handle to console input */
1230 obj_handle_t event; /* handle to renderer events change notification */
1231 @END
1234 /* Free the console of the current process */
1235 @REQ(free_console)
1236 @END
1239 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1240 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1241 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1242 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1243 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1244 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1245 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1246 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1247 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1248 struct console_renderer_event
1250 short event;
1251 union
1253 struct update
1255 short top;
1256 short bottom;
1257 } update;
1258 struct resize
1260 short width;
1261 short height;
1262 } resize;
1263 struct cursor_pos
1265 short x;
1266 short y;
1267 } cursor_pos;
1268 struct cursor_geom
1270 short visible;
1271 short size;
1272 } cursor_geom;
1273 struct display
1275 short left;
1276 short top;
1277 short width;
1278 short height;
1279 } display;
1280 } u;
1283 /* retrieve console events for the renderer */
1284 @REQ(get_console_renderer_events)
1285 obj_handle_t handle; /* handle to console input events */
1286 @REPLY
1287 VARARG(data,bytes); /* the various console_renderer_events */
1288 @END
1291 /* Open a handle to the process console */
1292 @REQ(open_console)
1293 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1294 /* otherwise console_in handle to get active screen buffer? */
1295 unsigned int access; /* wanted access rights */
1296 unsigned int attributes; /* object attributes */
1297 int share; /* share mask (only for output handles) */
1298 @REPLY
1299 obj_handle_t handle; /* handle to the console */
1300 @END
1303 /* Get the input queue wait event */
1304 @REQ(get_console_wait_event)
1305 @REPLY
1306 obj_handle_t handle;
1307 @END
1309 /* Get a console mode (input or output) */
1310 @REQ(get_console_mode)
1311 obj_handle_t handle; /* handle to the console */
1312 @REPLY
1313 int mode; /* console mode */
1314 @END
1317 /* Set a console mode (input or output) */
1318 @REQ(set_console_mode)
1319 obj_handle_t handle; /* handle to the console */
1320 int mode; /* console mode */
1321 @END
1324 /* Set info about a console (input only) */
1325 @REQ(set_console_input_info)
1326 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1327 int mask; /* setting mask (see below) */
1328 obj_handle_t active_sb; /* active screen buffer */
1329 int history_mode; /* whether we duplicate lines in history */
1330 int history_size; /* number of lines in history */
1331 int edition_mode; /* index to the edition mode flavors */
1332 int input_cp; /* console input codepage */
1333 int output_cp; /* console output codepage */
1334 user_handle_t win; /* console window if backend supports it */
1335 VARARG(title,unicode_str); /* console title */
1336 @END
1337 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1338 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1339 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1340 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1341 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1342 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1343 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1344 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1347 /* Get info about a console (input only) */
1348 @REQ(get_console_input_info)
1349 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1350 @REPLY
1351 int history_mode; /* whether we duplicate lines in history */
1352 int history_size; /* number of lines in history */
1353 int history_index; /* number of used lines in history */
1354 int edition_mode; /* index to the edition mode flavors */
1355 int input_cp; /* console input codepage */
1356 int output_cp; /* console output codepage */
1357 user_handle_t win; /* console window if backend supports it */
1358 VARARG(title,unicode_str); /* console title */
1359 @END
1362 /* appends a string to console's history */
1363 @REQ(append_console_input_history)
1364 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1365 VARARG(line,unicode_str); /* line to add */
1366 @END
1369 /* appends a string to console's history */
1370 @REQ(get_console_input_history)
1371 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1372 int index; /* index to get line from */
1373 @REPLY
1374 int total; /* total length of line in Unicode chars */
1375 VARARG(line,unicode_str); /* line to add */
1376 @END
1379 /* creates a new screen buffer on process' console */
1380 @REQ(create_console_output)
1381 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1382 unsigned int access; /* wanted access rights */
1383 unsigned int attributes; /* object attributes */
1384 unsigned int share; /* sharing credentials */
1385 int fd; /* for bare consoles, fd the screen-buffer is attached to */
1386 @REPLY
1387 obj_handle_t handle_out; /* handle to the screen buffer */
1388 @END
1391 /* Set info about a console (output only) */
1392 @REQ(set_console_output_info)
1393 obj_handle_t handle; /* handle to the console */
1394 int mask; /* setting mask (see below) */
1395 short int cursor_size; /* size of cursor (percentage filled) */
1396 short int cursor_visible;/* cursor visibility flag */
1397 short int cursor_x; /* position of cursor (x, y) */
1398 short int cursor_y;
1399 short int width; /* width of the screen buffer */
1400 short int height; /* height of the screen buffer */
1401 short int attr; /* default attribute */
1402 short int win_left; /* window actually displayed by renderer */
1403 short int win_top; /* the rect area is expressed within the */
1404 short int win_right; /* boundaries of the screen buffer */
1405 short int win_bottom;
1406 short int max_width; /* maximum size (width x height) for the window */
1407 short int max_height;
1408 @END
1409 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1410 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1411 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1412 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1413 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1414 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1417 /* Get info about a console (output only) */
1418 @REQ(get_console_output_info)
1419 obj_handle_t handle; /* handle to the console */
1420 @REPLY
1421 short int cursor_size; /* size of cursor (percentage filled) */
1422 short int cursor_visible;/* cursor visibility flag */
1423 short int cursor_x; /* position of cursor (x, y) */
1424 short int cursor_y;
1425 short int width; /* width of the screen buffer */
1426 short int height; /* height of the screen buffer */
1427 short int attr; /* default attribute */
1428 short int win_left; /* window actually displayed by renderer */
1429 short int win_top; /* the rect area is expressed within the */
1430 short int win_right; /* boundaries of the screen buffer */
1431 short int win_bottom;
1432 short int max_width; /* maximum size (width x height) for the window */
1433 short int max_height;
1434 @END
1436 /* Add input records to a console input queue */
1437 @REQ(write_console_input)
1438 obj_handle_t handle; /* handle to the console input */
1439 VARARG(rec,input_records); /* input records */
1440 @REPLY
1441 int written; /* number of records written */
1442 @END
1445 /* Fetch input records from a console input queue */
1446 @REQ(read_console_input)
1447 obj_handle_t handle; /* handle to the console input */
1448 int flush; /* flush the retrieved records from the queue? */
1449 @REPLY
1450 int read; /* number of records read */
1451 VARARG(rec,input_records); /* input records */
1452 @END
1455 /* write data (chars and/or attributes) in a screen buffer */
1456 @REQ(write_console_output)
1457 obj_handle_t handle; /* handle to the console output */
1458 int x; /* position where to start writing */
1459 int y;
1460 int mode; /* char info (see below) */
1461 int wrap; /* wrap around at end of line? */
1462 VARARG(data,bytes); /* info to write */
1463 @REPLY
1464 int written; /* number of char infos actually written */
1465 int width; /* width of screen buffer */
1466 int height; /* height of screen buffer */
1467 @END
1468 enum char_info_mode
1470 CHAR_INFO_MODE_TEXT, /* characters only */
1471 CHAR_INFO_MODE_ATTR, /* attributes only */
1472 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1473 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1477 /* fill a screen buffer with constant data (chars and/or attributes) */
1478 @REQ(fill_console_output)
1479 obj_handle_t handle; /* handle to the console output */
1480 int x; /* position where to start writing */
1481 int y;
1482 int mode; /* char info mode */
1483 int count; /* number to write */
1484 int wrap; /* wrap around at end of line? */
1485 char_info_t data; /* data to write */
1486 @REPLY
1487 int written; /* number of char infos actually written */
1488 @END
1491 /* read data (chars and/or attributes) from a screen buffer */
1492 @REQ(read_console_output)
1493 obj_handle_t handle; /* handle to the console output */
1494 int x; /* position (x,y) where to start reading */
1495 int y;
1496 int mode; /* char info mode */
1497 int wrap; /* wrap around at end of line? */
1498 @REPLY
1499 int width; /* width of screen buffer */
1500 int height; /* height of screen buffer */
1501 VARARG(data,bytes);
1502 @END
1505 /* move a rect (of data) in screen buffer content */
1506 @REQ(move_console_output)
1507 obj_handle_t handle; /* handle to the console output */
1508 short int x_src; /* position (x, y) of rect to start moving from */
1509 short int y_src;
1510 short int x_dst; /* position (x, y) of rect to move to */
1511 short int y_dst;
1512 short int w; /* size of the rect (width, height) to move */
1513 short int h;
1514 @END
1517 /* Sends a signal to a process group */
1518 @REQ(send_console_signal)
1519 int signal; /* the signal to send */
1520 process_id_t group_id; /* the group to send the signal to */
1521 @END
1524 /* enable directory change notifications */
1525 @REQ(read_directory_changes)
1526 unsigned int filter; /* notification filter */
1527 int subtree; /* watch the subtree? */
1528 int want_data; /* flag indicating whether change data should be collected */
1529 async_data_t async; /* async I/O parameters */
1530 @END
1533 @REQ(read_change)
1534 obj_handle_t handle;
1535 @REPLY
1536 VARARG(events,filesystem_event); /* collected filesystem events */
1537 @END
1540 /* Create a file mapping */
1541 @REQ(create_mapping)
1542 unsigned int access; /* wanted access rights */
1543 unsigned int attributes; /* object attributes */
1544 unsigned int protect; /* protection flags (see below) */
1545 mem_size_t size; /* mapping size */
1546 obj_handle_t file_handle; /* file handle */
1547 VARARG(objattr,object_attributes); /* object attributes */
1548 @REPLY
1549 obj_handle_t handle; /* handle to the mapping */
1550 @END
1551 /* per-page protection flags */
1552 #define VPROT_READ 0x01
1553 #define VPROT_WRITE 0x02
1554 #define VPROT_EXEC 0x04
1555 #define VPROT_WRITECOPY 0x08
1556 #define VPROT_GUARD 0x10
1557 #define VPROT_NOCACHE 0x20
1558 #define VPROT_COMMITTED 0x40
1559 #define VPROT_WRITEWATCH 0x80
1560 /* per-mapping protection flags */
1561 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1562 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1563 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1564 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1567 /* Open a mapping */
1568 @REQ(open_mapping)
1569 unsigned int access; /* wanted access rights */
1570 unsigned int attributes; /* object attributes */
1571 obj_handle_t rootdir; /* root directory */
1572 VARARG(name,unicode_str); /* object name */
1573 @REPLY
1574 obj_handle_t handle; /* handle to the mapping */
1575 @END
1578 /* Get information about a file mapping */
1579 @REQ(get_mapping_info)
1580 obj_handle_t handle; /* handle to the mapping */
1581 unsigned int access; /* wanted access rights */
1582 @REPLY
1583 mem_size_t size; /* mapping size */
1584 int protect; /* protection flags */
1585 int header_size; /* header size (for VPROT_IMAGE mapping) */
1586 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1587 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1588 obj_handle_t shared_file; /* shared mapping file handle */
1589 @END
1592 /* Get a range of committed pages in a file mapping */
1593 @REQ(get_mapping_committed_range)
1594 obj_handle_t handle; /* handle to the mapping */
1595 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1596 @REPLY
1597 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1598 int committed; /* whether it is a committed range */
1599 @END
1602 /* Add a range to the committed pages in a file mapping */
1603 @REQ(add_mapping_committed_range)
1604 obj_handle_t handle; /* handle to the mapping */
1605 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1606 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1607 @END
1610 #define SNAP_PROCESS 0x00000001
1611 #define SNAP_THREAD 0x00000002
1612 /* Create a snapshot */
1613 @REQ(create_snapshot)
1614 unsigned int attributes; /* object attributes */
1615 unsigned int flags; /* snapshot flags (SNAP_*) */
1616 @REPLY
1617 obj_handle_t handle; /* handle to the snapshot */
1618 @END
1621 /* Get the next process from a snapshot */
1622 @REQ(next_process)
1623 obj_handle_t handle; /* handle to the snapshot */
1624 int reset; /* reset snapshot position? */
1625 @REPLY
1626 int count; /* process usage count */
1627 process_id_t pid; /* process id */
1628 process_id_t ppid; /* parent process id */
1629 int threads; /* number of threads */
1630 int priority; /* process priority */
1631 int handles; /* number of handles */
1632 int unix_pid; /* Unix pid */
1633 VARARG(filename,unicode_str); /* file name of main exe */
1634 @END
1637 /* Get the next thread from a snapshot */
1638 @REQ(next_thread)
1639 obj_handle_t handle; /* handle to the snapshot */
1640 int reset; /* reset snapshot position? */
1641 @REPLY
1642 int count; /* thread usage count */
1643 process_id_t pid; /* process id */
1644 thread_id_t tid; /* thread id */
1645 int base_pri; /* base priority */
1646 int delta_pri; /* delta priority */
1647 @END
1650 /* Wait for a debug event */
1651 @REQ(wait_debug_event)
1652 int get_handle; /* should we alloc a handle for waiting? */
1653 @REPLY
1654 process_id_t pid; /* process id */
1655 thread_id_t tid; /* thread id */
1656 obj_handle_t wait; /* wait handle if no event ready */
1657 VARARG(event,debug_event); /* debug event data */
1658 @END
1661 /* Queue an exception event */
1662 @REQ(queue_exception_event)
1663 int first; /* first chance exception? */
1664 unsigned int code; /* exception code */
1665 unsigned int flags; /* exception flags */
1666 client_ptr_t record; /* exception record */
1667 client_ptr_t address; /* exception address */
1668 data_size_t len; /* size of parameters */
1669 VARARG(params,uints64,len);/* exception parameters */
1670 VARARG(context,context); /* thread context */
1671 @REPLY
1672 obj_handle_t handle; /* handle to the queued event */
1673 @END
1676 /* Retrieve the status of an exception event */
1677 @REQ(get_exception_status)
1678 obj_handle_t handle; /* handle to the queued event */
1679 @REPLY
1680 VARARG(context,context); /* modified thread context */
1681 @END
1684 /* Send an output string to the debugger */
1685 @REQ(output_debug_string)
1686 data_size_t length; /* string length */
1687 client_ptr_t string; /* string to display (in debugged process address space) */
1688 @END
1691 /* Continue a debug event */
1692 @REQ(continue_debug_event)
1693 process_id_t pid; /* process id to continue */
1694 thread_id_t tid; /* thread id to continue */
1695 int status; /* continuation status */
1696 @END
1699 /* Start/stop debugging an existing process */
1700 @REQ(debug_process)
1701 process_id_t pid; /* id of the process to debug */
1702 int attach; /* 1=attaching / 0=detaching from the process */
1703 @END
1706 /* Simulate a breakpoint in a process */
1707 @REQ(debug_break)
1708 obj_handle_t handle; /* process handle */
1709 @REPLY
1710 int self; /* was it the caller itself? */
1711 @END
1714 /* Set debugger kill on exit flag */
1715 @REQ(set_debugger_kill_on_exit)
1716 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1717 @END
1720 /* Read data from a process address space */
1721 @REQ(read_process_memory)
1722 obj_handle_t handle; /* process handle */
1723 client_ptr_t addr; /* addr to read from */
1724 @REPLY
1725 VARARG(data,bytes); /* result data */
1726 @END
1729 /* Write data to a process address space */
1730 @REQ(write_process_memory)
1731 obj_handle_t handle; /* process handle */
1732 client_ptr_t addr; /* addr to write to */
1733 VARARG(data,bytes); /* data to write */
1734 @END
1737 /* Create a registry key */
1738 @REQ(create_key)
1739 obj_handle_t parent; /* handle to the parent key */
1740 unsigned int access; /* desired access rights */
1741 unsigned int attributes; /* object attributes */
1742 unsigned int options; /* creation options */
1743 data_size_t namelen; /* length of key name in bytes */
1744 VARARG(name,unicode_str,namelen); /* key name */
1745 VARARG(class,unicode_str); /* class name */
1746 @REPLY
1747 obj_handle_t hkey; /* handle to the created key */
1748 int created; /* has it been newly created? */
1749 @END
1751 /* Open a registry key */
1752 @REQ(open_key)
1753 obj_handle_t parent; /* handle to the parent key */
1754 unsigned int access; /* desired access rights */
1755 unsigned int attributes; /* object attributes */
1756 VARARG(name,unicode_str); /* key name */
1757 @REPLY
1758 obj_handle_t hkey; /* handle to the open key */
1759 @END
1762 /* Delete a registry key */
1763 @REQ(delete_key)
1764 obj_handle_t hkey; /* handle to the key */
1765 @END
1768 /* Flush a registry key */
1769 @REQ(flush_key)
1770 obj_handle_t hkey; /* handle to the key */
1771 @END
1774 /* Enumerate registry subkeys */
1775 @REQ(enum_key)
1776 obj_handle_t hkey; /* handle to registry key */
1777 int index; /* index of subkey (or -1 for current key) */
1778 int info_class; /* requested information class */
1779 @REPLY
1780 int subkeys; /* number of subkeys */
1781 int max_subkey; /* longest subkey name */
1782 int max_class; /* longest class name */
1783 int values; /* number of values */
1784 int max_value; /* longest value name */
1785 int max_data; /* longest value data */
1786 timeout_t modif; /* last modification time */
1787 data_size_t total; /* total length needed for full name and class */
1788 data_size_t namelen; /* length of key name in bytes */
1789 VARARG(name,unicode_str,namelen); /* key name */
1790 VARARG(class,unicode_str); /* class name */
1791 @END
1794 /* Set a value of a registry key */
1795 @REQ(set_key_value)
1796 obj_handle_t hkey; /* handle to registry key */
1797 int type; /* value type */
1798 data_size_t namelen; /* length of value name in bytes */
1799 VARARG(name,unicode_str,namelen); /* value name */
1800 VARARG(data,bytes); /* value data */
1801 @END
1804 /* Retrieve the value of a registry key */
1805 @REQ(get_key_value)
1806 obj_handle_t hkey; /* handle to registry key */
1807 VARARG(name,unicode_str); /* value name */
1808 @REPLY
1809 int type; /* value type */
1810 data_size_t total; /* total length needed for data */
1811 VARARG(data,bytes); /* value data */
1812 @END
1815 /* Enumerate a value of a registry key */
1816 @REQ(enum_key_value)
1817 obj_handle_t hkey; /* handle to registry key */
1818 int index; /* value index */
1819 int info_class; /* requested information class */
1820 @REPLY
1821 int type; /* value type */
1822 data_size_t total; /* total length needed for full name and data */
1823 data_size_t namelen; /* length of value name in bytes */
1824 VARARG(name,unicode_str,namelen); /* value name */
1825 VARARG(data,bytes); /* value data */
1826 @END
1829 /* Delete a value of a registry key */
1830 @REQ(delete_key_value)
1831 obj_handle_t hkey; /* handle to registry key */
1832 VARARG(name,unicode_str); /* value name */
1833 @END
1836 /* Load a registry branch from a file */
1837 @REQ(load_registry)
1838 obj_handle_t hkey; /* root key to load to */
1839 obj_handle_t file; /* file to load from */
1840 VARARG(name,unicode_str); /* subkey name */
1841 @END
1844 /* UnLoad a registry branch from a file */
1845 @REQ(unload_registry)
1846 obj_handle_t hkey; /* root key to unload to */
1847 @END
1850 /* Save a registry branch to a file */
1851 @REQ(save_registry)
1852 obj_handle_t hkey; /* key to save */
1853 obj_handle_t file; /* file to save to */
1854 @END
1857 /* Add a registry key change notification */
1858 @REQ(set_registry_notification)
1859 obj_handle_t hkey; /* key to watch for changes */
1860 obj_handle_t event; /* event to set */
1861 int subtree; /* should we watch the whole subtree? */
1862 unsigned int filter; /* things to watch */
1863 @END
1866 /* Create a waitable timer */
1867 @REQ(create_timer)
1868 unsigned int access; /* wanted access rights */
1869 unsigned int attributes; /* object attributes */
1870 obj_handle_t rootdir; /* root directory */
1871 int manual; /* manual reset */
1872 VARARG(name,unicode_str); /* object name */
1873 @REPLY
1874 obj_handle_t handle; /* handle to the timer */
1875 @END
1878 /* Open a waitable timer */
1879 @REQ(open_timer)
1880 unsigned int access; /* wanted access rights */
1881 unsigned int attributes; /* object attributes */
1882 obj_handle_t rootdir; /* root directory */
1883 VARARG(name,unicode_str); /* object name */
1884 @REPLY
1885 obj_handle_t handle; /* handle to the timer */
1886 @END
1888 /* Set a waitable timer */
1889 @REQ(set_timer)
1890 obj_handle_t handle; /* handle to the timer */
1891 timeout_t expire; /* next expiration absolute time */
1892 client_ptr_t callback; /* callback function */
1893 client_ptr_t arg; /* callback argument */
1894 int period; /* timer period in ms */
1895 @REPLY
1896 int signaled; /* was the timer signaled before this call ? */
1897 @END
1899 /* Cancel a waitable timer */
1900 @REQ(cancel_timer)
1901 obj_handle_t handle; /* handle to the timer */
1902 @REPLY
1903 int signaled; /* was the timer signaled before this calltime ? */
1904 @END
1906 /* Get information on a waitable timer */
1907 @REQ(get_timer_info)
1908 obj_handle_t handle; /* handle to the timer */
1909 @REPLY
1910 timeout_t when; /* absolute time when the timer next expires */
1911 int signaled; /* is the timer signaled? */
1912 @END
1915 /* Retrieve the current context of a thread */
1916 @REQ(get_thread_context)
1917 obj_handle_t handle; /* thread handle */
1918 unsigned int flags; /* context flags */
1919 int suspend; /* suspend the thread if needed */
1920 @REPLY
1921 int self; /* was it a handle to the current thread? */
1922 VARARG(context,context); /* thread context */
1923 @END
1926 /* Set the current context of a thread */
1927 @REQ(set_thread_context)
1928 obj_handle_t handle; /* thread handle */
1929 int suspend; /* suspend the thread if needed */
1930 VARARG(context,context); /* thread context */
1931 @REPLY
1932 int self; /* was it a handle to the current thread? */
1933 @END
1936 /* Fetch a selector entry for a thread */
1937 @REQ(get_selector_entry)
1938 obj_handle_t handle; /* thread handle */
1939 int entry; /* LDT entry */
1940 @REPLY
1941 unsigned int base; /* selector base */
1942 unsigned int limit; /* selector limit */
1943 unsigned char flags; /* selector flags */
1944 @END
1947 /* Add an atom */
1948 @REQ(add_atom)
1949 obj_handle_t table; /* which table to add atom to */
1950 VARARG(name,unicode_str); /* atom name */
1951 @REPLY
1952 atom_t atom; /* resulting atom */
1953 @END
1956 /* Delete an atom */
1957 @REQ(delete_atom)
1958 obj_handle_t table; /* which table to delete atom from */
1959 atom_t atom; /* atom handle */
1960 @END
1963 /* Find an atom */
1964 @REQ(find_atom)
1965 obj_handle_t table; /* which table to find atom from */
1966 VARARG(name,unicode_str); /* atom name */
1967 @REPLY
1968 atom_t atom; /* atom handle */
1969 @END
1972 /* Get information about an atom */
1973 @REQ(get_atom_information)
1974 obj_handle_t table; /* which table to find atom from */
1975 atom_t atom; /* atom handle */
1976 @REPLY
1977 int count; /* atom lock count */
1978 int pinned; /* whether the atom has been pinned */
1979 data_size_t total; /* actual length of atom name */
1980 VARARG(name,unicode_str); /* atom name */
1981 @END
1984 /* Set information about an atom */
1985 @REQ(set_atom_information)
1986 obj_handle_t table; /* which table to find atom from */
1987 atom_t atom; /* atom handle */
1988 int pinned; /* whether to bump atom information */
1989 @END
1992 /* Empty an atom table */
1993 @REQ(empty_atom_table)
1994 obj_handle_t table; /* which table to find atom from */
1995 int if_pinned; /* whether to delete pinned atoms */
1996 @END
1999 /* Init an atom table */
2000 @REQ(init_atom_table)
2001 int entries; /* number of entries (only for local) */
2002 @REPLY
2003 obj_handle_t table; /* handle to the atom table */
2004 @END
2007 /* Get the message queue of the current thread */
2008 @REQ(get_msg_queue)
2009 @REPLY
2010 obj_handle_t handle; /* handle to the queue */
2011 @END
2014 /* Set the file descriptor associated to the current thread queue */
2015 @REQ(set_queue_fd)
2016 obj_handle_t handle; /* handle to the file descriptor */
2017 @END
2020 /* Set the current message queue wakeup mask */
2021 @REQ(set_queue_mask)
2022 unsigned int wake_mask; /* wakeup bits mask */
2023 unsigned int changed_mask; /* changed bits mask */
2024 int skip_wait; /* will we skip waiting if signaled? */
2025 @REPLY
2026 unsigned int wake_bits; /* current wake bits */
2027 unsigned int changed_bits; /* current changed bits */
2028 @END
2031 /* Get the current message queue status */
2032 @REQ(get_queue_status)
2033 int clear; /* should we clear the change bits? */
2034 @REPLY
2035 unsigned int wake_bits; /* wake bits */
2036 unsigned int changed_bits; /* changed bits since last time */
2037 @END
2040 /* Retrieve the process idle event */
2041 @REQ(get_process_idle_event)
2042 obj_handle_t handle; /* process handle */
2043 @REPLY
2044 obj_handle_t event; /* handle to idle event */
2045 @END
2048 /* Send a message to a thread queue */
2049 @REQ(send_message)
2050 thread_id_t id; /* thread id */
2051 int type; /* message type (see below) */
2052 int flags; /* message flags (see below) */
2053 user_handle_t win; /* window handle */
2054 unsigned int msg; /* message code */
2055 lparam_t wparam; /* parameters */
2056 lparam_t lparam; /* parameters */
2057 timeout_t timeout; /* timeout for reply */
2058 VARARG(data,message_data); /* message data for sent messages */
2059 @END
2061 @REQ(post_quit_message)
2062 int exit_code; /* exit code to return */
2063 @END
2065 enum message_type
2067 MSG_ASCII, /* Ascii message (from SendMessageA) */
2068 MSG_UNICODE, /* Unicode message (from SendMessageW) */
2069 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
2070 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
2071 MSG_CALLBACK_RESULT,/* result of a callback message */
2072 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
2073 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
2074 MSG_HARDWARE, /* hardware message */
2075 MSG_WINEVENT, /* winevent message */
2076 MSG_HOOK_LL /* low-level hardware hook */
2078 #define SEND_MSG_ABORT_IF_HUNG 0x01
2081 /* Send a hardware message to a thread queue */
2082 @REQ(send_hardware_message)
2083 user_handle_t win; /* window handle */
2084 hw_input_t input; /* input data */
2085 unsigned int flags; /* flags (see below) */
2086 @REPLY
2087 int wait; /* do we need to wait for a reply? */
2088 int prev_x; /* previous cursor position */
2089 int prev_y;
2090 int new_x; /* new cursor position */
2091 int new_y;
2092 VARARG(keystate,bytes); /* global state array for all the keys */
2093 @END
2094 #define SEND_HWMSG_INJECTED 0x01
2097 /* Get a message from the current queue */
2098 @REQ(get_message)
2099 unsigned int flags; /* PM_* flags */
2100 user_handle_t get_win; /* window handle to get */
2101 unsigned int get_first; /* first message code to get */
2102 unsigned int get_last; /* last message code to get */
2103 unsigned int hw_id; /* id of the previous hardware message (or 0) */
2104 unsigned int wake_mask; /* wakeup bits mask */
2105 unsigned int changed_mask; /* changed bits mask */
2106 @REPLY
2107 user_handle_t win; /* window handle */
2108 unsigned int msg; /* message code */
2109 lparam_t wparam; /* parameters */
2110 lparam_t lparam; /* parameters */
2111 int type; /* message type */
2112 unsigned int time; /* message time */
2113 unsigned int active_hooks; /* active hooks bitmap */
2114 data_size_t total; /* total size of extra data */
2115 VARARG(data,message_data); /* message data for sent messages */
2116 @END
2119 /* Reply to a sent message */
2120 @REQ(reply_message)
2121 int remove; /* should we remove the message? */
2122 lparam_t result; /* message result */
2123 VARARG(data,bytes); /* message data for sent messages */
2124 @END
2127 /* Accept the current hardware message */
2128 @REQ(accept_hardware_message)
2129 unsigned int hw_id; /* id of the hardware message */
2130 int remove; /* should we remove the message? */
2131 user_handle_t new_win; /* new destination window for current message */
2132 @END
2135 /* Retrieve the reply for the last message sent */
2136 @REQ(get_message_reply)
2137 int cancel; /* cancel message if not ready? */
2138 @REPLY
2139 lparam_t result; /* message result */
2140 VARARG(data,bytes); /* message data for sent messages */
2141 @END
2144 /* Set a window timer */
2145 @REQ(set_win_timer)
2146 user_handle_t win; /* window handle */
2147 unsigned int msg; /* message to post */
2148 unsigned int rate; /* timer rate in ms */
2149 lparam_t id; /* timer id */
2150 lparam_t lparam; /* message lparam (callback proc) */
2151 @REPLY
2152 lparam_t id; /* timer id */
2153 @END
2156 /* Kill a window timer */
2157 @REQ(kill_win_timer)
2158 user_handle_t win; /* window handle */
2159 lparam_t id; /* timer id */
2160 unsigned int msg; /* message to post */
2161 @END
2164 /* check if the thread owning the window is hung */
2165 @REQ(is_window_hung)
2166 user_handle_t win; /* window handle */
2167 @REPLY
2168 int is_hung;
2169 @END
2172 /* Retrieve info about a serial port */
2173 @REQ(get_serial_info)
2174 obj_handle_t handle; /* handle to comm port */
2175 @REPLY
2176 unsigned int readinterval;
2177 unsigned int readconst;
2178 unsigned int readmult;
2179 unsigned int writeconst;
2180 unsigned int writemult;
2181 unsigned int eventmask;
2182 @END
2185 /* Set info about a serial port */
2186 @REQ(set_serial_info)
2187 obj_handle_t handle; /* handle to comm port */
2188 int flags; /* bitmask to set values (see below) */
2189 unsigned int readinterval;
2190 unsigned int readconst;
2191 unsigned int readmult;
2192 unsigned int writeconst;
2193 unsigned int writemult;
2194 unsigned int eventmask;
2195 @END
2196 #define SERIALINFO_SET_TIMEOUTS 0x01
2197 #define SERIALINFO_SET_MASK 0x02
2200 /* Create an async I/O */
2201 @REQ(register_async)
2202 int type; /* type of queue to look after */
2203 async_data_t async; /* async I/O parameters */
2204 int count; /* count - usually # of bytes to be read/written */
2205 @END
2206 #define ASYNC_TYPE_READ 0x01
2207 #define ASYNC_TYPE_WRITE 0x02
2208 #define ASYNC_TYPE_WAIT 0x03
2211 /* Cancel all async op on a fd */
2212 @REQ(cancel_async)
2213 obj_handle_t handle; /* handle to comm port, socket or file */
2214 client_ptr_t iosb; /* I/O status block (NULL=all) */
2215 int only_thread; /* cancel matching this thread */
2216 @END
2219 /* Perform an ioctl on a file */
2220 @REQ(ioctl)
2221 ioctl_code_t code; /* ioctl code */
2222 async_data_t async; /* async I/O parameters */
2223 int blocking; /* whether it's a blocking ioctl */
2224 VARARG(in_data,bytes); /* ioctl input data */
2225 @REPLY
2226 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2227 unsigned int options; /* device open options */
2228 VARARG(out_data,bytes); /* ioctl output data */
2229 @END
2232 /* Retrieve results of an async ioctl */
2233 @REQ(get_ioctl_result)
2234 obj_handle_t handle; /* handle to the device */
2235 client_ptr_t user_arg; /* user arg used to identify the request */
2236 @REPLY
2237 VARARG(out_data,bytes); /* ioctl output data */
2238 @END
2241 /* Create a named pipe */
2242 @REQ(create_named_pipe)
2243 unsigned int access;
2244 unsigned int attributes; /* object attributes */
2245 obj_handle_t rootdir; /* root directory */
2246 unsigned int options;
2247 unsigned int sharing;
2248 unsigned int maxinstances;
2249 unsigned int outsize;
2250 unsigned int insize;
2251 timeout_t timeout;
2252 unsigned int flags;
2253 VARARG(name,unicode_str); /* pipe name */
2254 @REPLY
2255 obj_handle_t handle; /* handle to the pipe */
2256 @END
2258 /* flags in create_named_pipe and get_named_pipe_info */
2259 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2260 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2261 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2262 #define NAMED_PIPE_SERVER_END 0x8000
2265 @REQ(get_named_pipe_info)
2266 obj_handle_t handle;
2267 @REPLY
2268 unsigned int flags;
2269 unsigned int sharing;
2270 unsigned int maxinstances;
2271 unsigned int instances;
2272 unsigned int outsize;
2273 unsigned int insize;
2274 @END
2277 /* Create a window */
2278 @REQ(create_window)
2279 user_handle_t parent; /* parent window */
2280 user_handle_t owner; /* owner window */
2281 atom_t atom; /* class atom */
2282 mod_handle_t instance; /* module instance */
2283 VARARG(class,unicode_str); /* class name */
2284 @REPLY
2285 user_handle_t handle; /* created window */
2286 user_handle_t parent; /* full handle of parent */
2287 user_handle_t owner; /* full handle of owner */
2288 int extra; /* number of extra bytes */
2289 client_ptr_t class_ptr; /* pointer to class in client address space */
2290 @END
2293 /* Destroy a window */
2294 @REQ(destroy_window)
2295 user_handle_t handle; /* handle to the window */
2296 @END
2299 /* Retrieve the desktop window for the current thread */
2300 @REQ(get_desktop_window)
2301 int force; /* force creation if it doesn't exist */
2302 @REPLY
2303 user_handle_t top_window; /* handle to the desktop window */
2304 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2305 @END
2308 /* Set a window owner */
2309 @REQ(set_window_owner)
2310 user_handle_t handle; /* handle to the window */
2311 user_handle_t owner; /* new owner */
2312 @REPLY
2313 user_handle_t full_owner; /* full handle of new owner */
2314 user_handle_t prev_owner; /* full handle of previous owner */
2315 @END
2318 /* Get information from a window handle */
2319 @REQ(get_window_info)
2320 user_handle_t handle; /* handle to the window */
2321 @REPLY
2322 user_handle_t full_handle; /* full 32-bit handle */
2323 user_handle_t last_active; /* last active popup */
2324 process_id_t pid; /* process owning the window */
2325 thread_id_t tid; /* thread owning the window */
2326 atom_t atom; /* class atom */
2327 int is_unicode; /* ANSI or unicode */
2328 @END
2331 /* Set some information in a window */
2332 @REQ(set_window_info)
2333 unsigned short flags; /* flags for fields to set (see below) */
2334 short int is_unicode; /* ANSI or unicode */
2335 user_handle_t handle; /* handle to the window */
2336 unsigned int style; /* window style */
2337 unsigned int ex_style; /* window extended style */
2338 unsigned int id; /* window id */
2339 mod_handle_t instance; /* creator instance */
2340 lparam_t user_data; /* user-specific data */
2341 int extra_offset; /* offset to set in extra bytes */
2342 data_size_t extra_size; /* size to set in extra bytes */
2343 lparam_t extra_value; /* value to set in extra bytes */
2344 @REPLY
2345 unsigned int old_style; /* old window style */
2346 unsigned int old_ex_style; /* old window extended style */
2347 mod_handle_t old_instance; /* old creator instance */
2348 lparam_t old_user_data; /* old user-specific data */
2349 lparam_t old_extra_value; /* old value in extra bytes */
2350 unsigned int old_id; /* old window id */
2351 @END
2352 #define SET_WIN_STYLE 0x01
2353 #define SET_WIN_EXSTYLE 0x02
2354 #define SET_WIN_ID 0x04
2355 #define SET_WIN_INSTANCE 0x08
2356 #define SET_WIN_USERDATA 0x10
2357 #define SET_WIN_EXTRA 0x20
2358 #define SET_WIN_UNICODE 0x40
2361 /* Set the parent of a window */
2362 @REQ(set_parent)
2363 user_handle_t handle; /* handle to the window */
2364 user_handle_t parent; /* handle to the parent */
2365 @REPLY
2366 user_handle_t old_parent; /* old parent window */
2367 user_handle_t full_parent; /* full handle of new parent */
2368 @END
2371 /* Get a list of the window parents, up to the root of the tree */
2372 @REQ(get_window_parents)
2373 user_handle_t handle; /* handle to the window */
2374 @REPLY
2375 int count; /* total count of parents */
2376 VARARG(parents,user_handles); /* parent handles */
2377 @END
2380 /* Get a list of the window children */
2381 @REQ(get_window_children)
2382 obj_handle_t desktop; /* handle to desktop */
2383 user_handle_t parent; /* parent window */
2384 atom_t atom; /* class atom for the listed children */
2385 thread_id_t tid; /* thread owning the listed children */
2386 VARARG(class,unicode_str); /* class name */
2387 @REPLY
2388 int count; /* total count of children */
2389 VARARG(children,user_handles); /* children handles */
2390 @END
2393 /* Get a list of the window children that contain a given point */
2394 @REQ(get_window_children_from_point)
2395 user_handle_t parent; /* parent window */
2396 int x; /* point in parent coordinates */
2397 int y;
2398 @REPLY
2399 int count; /* total count of children */
2400 VARARG(children,user_handles); /* children handles */
2401 @END
2404 /* Get window tree information from a window handle */
2405 @REQ(get_window_tree)
2406 user_handle_t handle; /* handle to the window */
2407 @REPLY
2408 user_handle_t parent; /* parent window */
2409 user_handle_t owner; /* owner window */
2410 user_handle_t next_sibling; /* next sibling in Z-order */
2411 user_handle_t prev_sibling; /* prev sibling in Z-order */
2412 user_handle_t first_sibling; /* first sibling in Z-order */
2413 user_handle_t last_sibling; /* last sibling in Z-order */
2414 user_handle_t first_child; /* first child */
2415 user_handle_t last_child; /* last child */
2416 @END
2418 /* Set the position and Z order of a window */
2419 @REQ(set_window_pos)
2420 unsigned short swp_flags; /* SWP_* flags */
2421 unsigned short paint_flags; /* paint flags (see below) */
2422 user_handle_t handle; /* handle to the window */
2423 user_handle_t previous; /* previous window in Z order */
2424 rectangle_t window; /* window rectangle (in parent coords) */
2425 rectangle_t client; /* client rectangle (in parent coords) */
2426 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2427 @REPLY
2428 unsigned int new_style; /* new window style */
2429 unsigned int new_ex_style; /* new window extended style */
2430 user_handle_t surface_win; /* window that needs a surface update */
2431 @END
2432 #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */
2433 #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */
2435 /* Get the window and client rectangles of a window */
2436 @REQ(get_window_rectangles)
2437 user_handle_t handle; /* handle to the window */
2438 int relative; /* coords relative to (see below) */
2439 @REPLY
2440 rectangle_t window; /* window rectangle */
2441 rectangle_t visible; /* visible part of the window rectangle */
2442 rectangle_t client; /* client rectangle */
2443 @END
2444 enum coords_relative
2446 COORDS_CLIENT, /* relative to client area */
2447 COORDS_WINDOW, /* relative to whole window area */
2448 COORDS_PARENT, /* relative to parent's client area */
2449 COORDS_SCREEN /* relative to screen origin */
2453 /* Get the window text */
2454 @REQ(get_window_text)
2455 user_handle_t handle; /* handle to the window */
2456 @REPLY
2457 VARARG(text,unicode_str); /* window text */
2458 @END
2461 /* Set the window text */
2462 @REQ(set_window_text)
2463 user_handle_t handle; /* handle to the window */
2464 VARARG(text,unicode_str); /* window text */
2465 @END
2468 /* Get the coordinates offset between two windows */
2469 @REQ(get_windows_offset)
2470 user_handle_t from; /* handle to the first window */
2471 user_handle_t to; /* handle to the second window */
2472 @REPLY
2473 int x; /* x coordinate offset */
2474 int y; /* y coordinate offset */
2475 int mirror; /* whether to mirror the x coordinate */
2476 @END
2479 /* Get the visible region of a window */
2480 @REQ(get_visible_region)
2481 user_handle_t window; /* handle to the window */
2482 unsigned int flags; /* DCX flags */
2483 @REPLY
2484 user_handle_t top_win; /* top window to clip against */
2485 rectangle_t top_rect; /* top window visible rect with screen coords */
2486 rectangle_t win_rect; /* window rect in screen coords */
2487 unsigned int paint_flags; /* paint flags (from SET_WINPOS_* flags) */
2488 data_size_t total_size; /* total size of the resulting region */
2489 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2490 @END
2493 /* Get the visible surface region of a window */
2494 @REQ(get_surface_region)
2495 user_handle_t window; /* handle to the window */
2496 @REPLY
2497 rectangle_t visible_rect; /* window visible rect in screen coords */
2498 data_size_t total_size; /* total size of the resulting region */
2499 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2500 @END
2503 /* Get the window region */
2504 @REQ(get_window_region)
2505 user_handle_t window; /* handle to the window */
2506 @REPLY
2507 data_size_t total_size; /* total size of the resulting region */
2508 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2509 @END
2512 /* Set the window region */
2513 @REQ(set_window_region)
2514 user_handle_t window; /* handle to the window */
2515 int redraw; /* redraw the window? */
2516 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2517 @END
2520 /* Get the window update region */
2521 @REQ(get_update_region)
2522 user_handle_t window; /* handle to the window */
2523 user_handle_t from_child; /* child to start searching from */
2524 unsigned int flags; /* update flags (see below) */
2525 @REPLY
2526 user_handle_t child; /* child to repaint (or window itself) */
2527 unsigned int flags; /* resulting update flags (see below) */
2528 data_size_t total_size; /* total size of the resulting region */
2529 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2530 @END
2531 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2532 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2533 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2534 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2535 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2536 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2537 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2538 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2541 /* Update the z order of a window so that a given rectangle is fully visible */
2542 @REQ(update_window_zorder)
2543 user_handle_t window; /* handle to the window */
2544 rectangle_t rect; /* rectangle that must be visible (in client coords) */
2545 @END
2548 /* Mark parts of a window as needing a redraw */
2549 @REQ(redraw_window)
2550 user_handle_t window; /* handle to the window */
2551 unsigned int flags; /* RDW_* flags */
2552 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2553 @END
2556 /* Set a window property */
2557 @REQ(set_window_property)
2558 user_handle_t window; /* handle to the window */
2559 lparam_t data; /* data to store */
2560 atom_t atom; /* property atom (if no name specified) */
2561 VARARG(name,unicode_str); /* property name */
2562 @END
2565 /* Remove a window property */
2566 @REQ(remove_window_property)
2567 user_handle_t window; /* handle to the window */
2568 atom_t atom; /* property atom (if no name specified) */
2569 VARARG(name,unicode_str); /* property name */
2570 @REPLY
2571 lparam_t data; /* data stored in property */
2572 @END
2575 /* Get a window property */
2576 @REQ(get_window_property)
2577 user_handle_t window; /* handle to the window */
2578 atom_t atom; /* property atom (if no name specified) */
2579 VARARG(name,unicode_str); /* property name */
2580 @REPLY
2581 lparam_t data; /* data stored in property */
2582 @END
2585 /* Get the list of properties of a window */
2586 @REQ(get_window_properties)
2587 user_handle_t window; /* handle to the window */
2588 @REPLY
2589 int total; /* total number of properties */
2590 VARARG(props,properties); /* list of properties */
2591 @END
2594 /* Create a window station */
2595 @REQ(create_winstation)
2596 unsigned int flags; /* window station flags */
2597 unsigned int access; /* wanted access rights */
2598 unsigned int attributes; /* object attributes */
2599 VARARG(name,unicode_str); /* object name */
2600 @REPLY
2601 obj_handle_t handle; /* handle to the window station */
2602 @END
2605 /* Open a handle to a window station */
2606 @REQ(open_winstation)
2607 unsigned int access; /* wanted access rights */
2608 unsigned int attributes; /* object attributes */
2609 VARARG(name,unicode_str); /* object name */
2610 @REPLY
2611 obj_handle_t handle; /* handle to the window station */
2612 @END
2615 /* Close a window station */
2616 @REQ(close_winstation)
2617 obj_handle_t handle; /* handle to the window station */
2618 @END
2621 /* Get the process current window station */
2622 @REQ(get_process_winstation)
2623 @REPLY
2624 obj_handle_t handle; /* handle to the window station */
2625 @END
2628 /* Set the process current window station */
2629 @REQ(set_process_winstation)
2630 obj_handle_t handle; /* handle to the window station */
2631 @END
2634 /* Enumerate window stations */
2635 @REQ(enum_winstation)
2636 unsigned int index; /* current index */
2637 @REPLY
2638 unsigned int next; /* next index */
2639 VARARG(name,unicode_str); /* window station name */
2640 @END
2643 /* Create a desktop */
2644 @REQ(create_desktop)
2645 unsigned int flags; /* desktop flags */
2646 unsigned int access; /* wanted access rights */
2647 unsigned int attributes; /* object attributes */
2648 VARARG(name,unicode_str); /* object name */
2649 @REPLY
2650 obj_handle_t handle; /* handle to the desktop */
2651 @END
2654 /* Open a handle to a desktop */
2655 @REQ(open_desktop)
2656 obj_handle_t winsta; /* window station to open (null allowed) */
2657 unsigned int flags; /* desktop flags */
2658 unsigned int access; /* wanted access rights */
2659 unsigned int attributes; /* object attributes */
2660 VARARG(name,unicode_str); /* object name */
2661 @REPLY
2662 obj_handle_t handle; /* handle to the desktop */
2663 @END
2666 /* Close a desktop */
2667 @REQ(close_desktop)
2668 obj_handle_t handle; /* handle to the desktop */
2669 @END
2672 /* Get the thread current desktop */
2673 @REQ(get_thread_desktop)
2674 thread_id_t tid; /* thread id */
2675 @REPLY
2676 obj_handle_t handle; /* handle to the desktop */
2677 @END
2680 /* Set the thread current desktop */
2681 @REQ(set_thread_desktop)
2682 obj_handle_t handle; /* handle to the desktop */
2683 @END
2686 /* Enumerate desktops */
2687 @REQ(enum_desktop)
2688 obj_handle_t winstation; /* handle to the window station */
2689 unsigned int index; /* current index */
2690 @REPLY
2691 unsigned int next; /* next index */
2692 VARARG(name,unicode_str); /* window station name */
2693 @END
2696 /* Get/set information about a user object (window station or desktop) */
2697 @REQ(set_user_object_info)
2698 obj_handle_t handle; /* handle to the object */
2699 unsigned int flags; /* information to set */
2700 unsigned int obj_flags; /* new object flags */
2701 @REPLY
2702 int is_desktop; /* is object a desktop? */
2703 unsigned int old_obj_flags; /* old object flags */
2704 VARARG(name,unicode_str); /* object name */
2705 @END
2706 #define SET_USER_OBJECT_FLAGS 1
2709 /* Register a hotkey */
2710 @REQ(register_hotkey)
2711 user_handle_t window; /* handle to the window */
2712 int id; /* hotkey identifier */
2713 unsigned int flags; /* modifier keys */
2714 unsigned int vkey; /* virtual key code */
2715 @REPLY
2716 int replaced; /* did we replace an existing hotkey? */
2717 unsigned int flags; /* flags of replaced hotkey */
2718 unsigned int vkey; /* virtual key code of replaced hotkey */
2719 @END
2722 /* Unregister a hotkey */
2723 @REQ(unregister_hotkey)
2724 user_handle_t window; /* handle to the window */
2725 int id; /* hotkey identifier */
2726 @REPLY
2727 unsigned int flags; /* flags of removed hotkey */
2728 unsigned int vkey; /* virtual key code of removed hotkey */
2729 @END
2732 /* Attach (or detach) thread inputs */
2733 @REQ(attach_thread_input)
2734 thread_id_t tid_from; /* thread to be attached */
2735 thread_id_t tid_to; /* thread to which tid_from should be attached */
2736 int attach; /* is it an attach? */
2737 @END
2740 /* Get input data for a given thread */
2741 @REQ(get_thread_input)
2742 thread_id_t tid; /* id of thread */
2743 @REPLY
2744 user_handle_t focus; /* handle to the focus window */
2745 user_handle_t capture; /* handle to the capture window */
2746 user_handle_t active; /* handle to the active window */
2747 user_handle_t foreground; /* handle to the global foreground window */
2748 user_handle_t menu_owner; /* handle to the menu owner */
2749 user_handle_t move_size; /* handle to the moving/resizing window */
2750 user_handle_t caret; /* handle to the caret window */
2751 user_handle_t cursor; /* handle to the cursor */
2752 int show_count; /* cursor show count */
2753 rectangle_t rect; /* caret rectangle */
2754 @END
2757 /* Get the time of the last input event */
2758 @REQ(get_last_input_time)
2759 @REPLY
2760 unsigned int time;
2761 @END
2764 /* Retrieve queue keyboard state for a given thread */
2765 @REQ(get_key_state)
2766 thread_id_t tid; /* id of thread */
2767 int key; /* optional key code or -1 */
2768 @REPLY
2769 unsigned char state; /* state of specified key */
2770 VARARG(keystate,bytes); /* state array for all the keys */
2771 @END
2773 /* Set queue keyboard state for a given thread */
2774 @REQ(set_key_state)
2775 thread_id_t tid; /* id of thread */
2776 int async; /* whether to change the async state too */
2777 VARARG(keystate,bytes); /* state array for all the keys */
2778 @END
2780 /* Set the system foreground window */
2781 @REQ(set_foreground_window)
2782 user_handle_t handle; /* handle to the foreground window */
2783 @REPLY
2784 user_handle_t previous; /* handle to the previous foreground window */
2785 int send_msg_old; /* whether we have to send a msg to the old window */
2786 int send_msg_new; /* whether we have to send a msg to the new window */
2787 @END
2789 /* Set the current thread focus window */
2790 @REQ(set_focus_window)
2791 user_handle_t handle; /* handle to the focus window */
2792 @REPLY
2793 user_handle_t previous; /* handle to the previous focus window */
2794 @END
2796 /* Set the current thread active window */
2797 @REQ(set_active_window)
2798 user_handle_t handle; /* handle to the active window */
2799 @REPLY
2800 user_handle_t previous; /* handle to the previous active window */
2801 @END
2803 /* Set the current thread capture window */
2804 @REQ(set_capture_window)
2805 user_handle_t handle; /* handle to the capture window */
2806 unsigned int flags; /* capture flags (see below) */
2807 @REPLY
2808 user_handle_t previous; /* handle to the previous capture window */
2809 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2810 @END
2811 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2812 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2815 /* Set the current thread caret window */
2816 @REQ(set_caret_window)
2817 user_handle_t handle; /* handle to the caret window */
2818 int width; /* caret width */
2819 int height; /* caret height */
2820 @REPLY
2821 user_handle_t previous; /* handle to the previous caret window */
2822 rectangle_t old_rect; /* previous caret rectangle */
2823 int old_hide; /* previous hide count */
2824 int old_state; /* previous caret state (1=on, 0=off) */
2825 @END
2828 /* Set the current thread caret information */
2829 @REQ(set_caret_info)
2830 unsigned int flags; /* caret flags (see below) */
2831 user_handle_t handle; /* handle to the caret window */
2832 int x; /* caret x position */
2833 int y; /* caret y position */
2834 int hide; /* increment for hide count (can be negative to show it) */
2835 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2836 @REPLY
2837 user_handle_t full_handle; /* handle to the current caret window */
2838 rectangle_t old_rect; /* previous caret rectangle */
2839 int old_hide; /* previous hide count */
2840 int old_state; /* previous caret state (1=on, 0=off) */
2841 @END
2842 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2843 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2844 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2847 /* Set a window hook */
2848 @REQ(set_hook)
2849 int id; /* id of the hook */
2850 process_id_t pid; /* id of process to set the hook into */
2851 thread_id_t tid; /* id of thread to set the hook into */
2852 int event_min;
2853 int event_max;
2854 client_ptr_t proc; /* hook procedure */
2855 int flags;
2856 int unicode; /* is it a unicode hook? */
2857 VARARG(module,unicode_str); /* module name */
2858 @REPLY
2859 user_handle_t handle; /* handle to the hook */
2860 unsigned int active_hooks; /* active hooks bitmap */
2861 @END
2864 /* Remove a window hook */
2865 @REQ(remove_hook)
2866 user_handle_t handle; /* handle to the hook */
2867 client_ptr_t proc; /* hook procedure if handle is 0 */
2868 int id; /* id of the hook if handle is 0 */
2869 @REPLY
2870 unsigned int active_hooks; /* active hooks bitmap */
2871 @END
2874 /* Start calling a hook chain */
2875 @REQ(start_hook_chain)
2876 int id; /* id of the hook */
2877 int event; /* signalled event */
2878 user_handle_t window; /* handle to the event window */
2879 int object_id; /* object id for out of context winevent */
2880 int child_id; /* child id for out of context winevent */
2881 @REPLY
2882 user_handle_t handle; /* handle to the next hook */
2883 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2884 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2885 int unicode; /* is it a unicode hook? */
2886 client_ptr_t proc; /* hook procedure */
2887 unsigned int active_hooks; /* active hooks bitmap */
2888 VARARG(module,unicode_str); /* module name */
2889 @END
2892 /* Finished calling a hook chain */
2893 @REQ(finish_hook_chain)
2894 int id; /* id of the hook */
2895 @END
2898 /* Get the hook information */
2899 @REQ(get_hook_info)
2900 user_handle_t handle; /* handle to the current hook */
2901 int get_next; /* do we want info about current or next hook? */
2902 int event; /* signalled event */
2903 user_handle_t window; /* handle to the event window */
2904 int object_id; /* object id for out of context winevent */
2905 int child_id; /* child id for out of context winevent */
2906 @REPLY
2907 user_handle_t handle; /* handle to the hook */
2908 int id; /* id of the hook */
2909 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2910 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2911 client_ptr_t proc; /* hook procedure */
2912 int unicode; /* is it a unicode hook? */
2913 VARARG(module,unicode_str); /* module name */
2914 @END
2917 /* Create a window class */
2918 @REQ(create_class)
2919 int local; /* is it a local class? */
2920 atom_t atom; /* class atom */
2921 unsigned int style; /* class style */
2922 mod_handle_t instance; /* module instance */
2923 int extra; /* number of extra class bytes */
2924 int win_extra; /* number of window extra bytes */
2925 client_ptr_t client_ptr; /* pointer to class in client address space */
2926 VARARG(name,unicode_str); /* class name */
2927 @REPLY
2928 atom_t atom; /* resulting class atom */
2929 @END
2932 /* Destroy a window class */
2933 @REQ(destroy_class)
2934 atom_t atom; /* class atom */
2935 mod_handle_t instance; /* module instance */
2936 VARARG(name,unicode_str); /* class name */
2937 @REPLY
2938 client_ptr_t client_ptr; /* pointer to class in client address space */
2939 @END
2942 /* Set some information in a class */
2943 @REQ(set_class_info)
2944 user_handle_t window; /* handle to the window */
2945 unsigned int flags; /* flags for info to set (see below) */
2946 atom_t atom; /* class atom */
2947 unsigned int style; /* class style */
2948 int win_extra; /* number of window extra bytes */
2949 mod_handle_t instance; /* module instance */
2950 int extra_offset; /* offset to set in extra bytes */
2951 data_size_t extra_size; /* size to set in extra bytes */
2952 lparam_t extra_value; /* value to set in extra bytes */
2953 @REPLY
2954 atom_t old_atom; /* previous class atom */
2955 unsigned int old_style; /* previous class style */
2956 int old_extra; /* previous number of class extra bytes */
2957 int old_win_extra; /* previous number of window extra bytes */
2958 mod_handle_t old_instance; /* previous module instance */
2959 lparam_t old_extra_value; /* old value in extra bytes */
2960 @END
2961 #define SET_CLASS_ATOM 0x0001
2962 #define SET_CLASS_STYLE 0x0002
2963 #define SET_CLASS_WINEXTRA 0x0004
2964 #define SET_CLASS_INSTANCE 0x0008
2965 #define SET_CLASS_EXTRA 0x0010
2968 /* Set/get clipboard information */
2969 @REQ(set_clipboard_info)
2970 unsigned int flags; /* flags for fields to set (see below) */
2971 user_handle_t clipboard; /* clipboard window */
2972 user_handle_t owner; /* clipboard owner */
2973 user_handle_t viewer; /* first clipboard viewer */
2974 unsigned int seqno; /* change sequence number */
2975 @REPLY
2976 unsigned int flags; /* status flags (see below) */
2977 user_handle_t old_clipboard; /* old clipboard window */
2978 user_handle_t old_owner; /* old clipboard owner */
2979 user_handle_t old_viewer; /* old clipboard viewer */
2980 unsigned int seqno; /* current sequence number */
2981 @END
2983 #define SET_CB_OPEN 0x001
2984 #define SET_CB_OWNER 0x002
2985 #define SET_CB_VIEWER 0x004
2986 #define SET_CB_SEQNO 0x008
2987 #define SET_CB_RELOWNER 0x010
2988 #define SET_CB_CLOSE 0x020
2989 #define CB_OPEN 0x040
2990 #define CB_OWNER 0x080
2991 #define CB_PROCESS 0x100
2994 /* Open a security token */
2995 @REQ(open_token)
2996 obj_handle_t handle; /* handle to the thread or process */
2997 unsigned int access; /* access rights to the new token */
2998 unsigned int attributes;/* object attributes */
2999 unsigned int flags; /* flags (see below) */
3000 @REPLY
3001 obj_handle_t token; /* handle to the token */
3002 @END
3003 #define OPEN_TOKEN_THREAD 1
3004 #define OPEN_TOKEN_AS_SELF 2
3007 /* Set/get the global windows */
3008 @REQ(set_global_windows)
3009 unsigned int flags; /* flags for fields to set (see below) */
3010 user_handle_t shell_window; /* handle to the new shell window */
3011 user_handle_t shell_listview; /* handle to the new shell listview window */
3012 user_handle_t progman_window; /* handle to the new program manager window */
3013 user_handle_t taskman_window; /* handle to the new task manager window */
3014 @REPLY
3015 user_handle_t old_shell_window; /* handle to the shell window */
3016 user_handle_t old_shell_listview; /* handle to the shell listview window */
3017 user_handle_t old_progman_window; /* handle to the new program manager window */
3018 user_handle_t old_taskman_window; /* handle to the new task manager window */
3019 @END
3020 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
3021 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
3022 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
3024 /* Adjust the privileges held by a token */
3025 @REQ(adjust_token_privileges)
3026 obj_handle_t handle; /* handle to the token */
3027 int disable_all; /* disable all privileges? */
3028 int get_modified_state; /* get modified privileges? */
3029 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
3030 @REPLY
3031 unsigned int len; /* total length in bytes required to store token privileges */
3032 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
3033 @END
3035 /* Retrieves the set of privileges held by or available to a token */
3036 @REQ(get_token_privileges)
3037 obj_handle_t handle; /* handle to the token */
3038 @REPLY
3039 unsigned int len; /* total length in bytes required to store token privileges */
3040 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3041 @END
3043 /* Check the token has the required privileges */
3044 @REQ(check_token_privileges)
3045 obj_handle_t handle; /* handle to the token */
3046 int all_required; /* are all the privileges required for the check to succeed? */
3047 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
3048 @REPLY
3049 int has_privileges; /* does the token have the required privileges? */
3050 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
3051 @END
3053 @REQ(duplicate_token)
3054 obj_handle_t handle; /* handle to the token to duplicate */
3055 unsigned int access; /* access rights to the new token */
3056 unsigned int attributes; /* object attributes */
3057 int primary; /* is the new token to be a primary one? */
3058 int impersonation_level; /* impersonation level of the new token */
3059 @REPLY
3060 obj_handle_t new_handle; /* duplicated handle */
3061 @END
3063 @REQ(access_check)
3064 obj_handle_t handle; /* handle to the token */
3065 unsigned int desired_access; /* desired access to the object */
3066 unsigned int mapping_read; /* mapping from generic read to specific rights */
3067 unsigned int mapping_write; /* mapping from generic write to specific rights */
3068 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
3069 unsigned int mapping_all; /* mapping from generic all to specific rights */
3070 VARARG(sd,security_descriptor); /* security descriptor to check */
3071 @REPLY
3072 unsigned int access_granted; /* access rights actually granted */
3073 unsigned int access_status; /* was access granted? */
3074 unsigned int privileges_len; /* length needed to store privileges */
3075 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
3076 @END
3078 @REQ(get_token_sid)
3079 obj_handle_t handle; /* handle to the token */
3080 unsigned int which_sid; /* which SID to retrieve from the token */
3081 @REPLY
3082 data_size_t sid_len; /* length needed to store sid */
3083 VARARG(sid,SID); /* the sid specified by which_sid from the token */
3084 @END
3086 @REQ(get_token_groups)
3087 obj_handle_t handle; /* handle to the token */
3088 @REPLY
3089 data_size_t user_len; /* length needed to store user */
3090 VARARG(user,token_groups); /* groups the token's user belongs to */
3091 @END
3093 @REQ(get_token_default_dacl)
3094 obj_handle_t handle; /* handle to the token */
3095 @REPLY
3096 data_size_t acl_len; /* length needed to store access control list */
3097 VARARG(acl,ACL); /* access control list */
3098 @END
3100 @REQ(set_token_default_dacl)
3101 obj_handle_t handle; /* handle to the token */
3102 VARARG(acl,ACL); /* default dacl to set */
3103 @END
3105 @REQ(set_security_object)
3106 obj_handle_t handle; /* handle to the object */
3107 unsigned int security_info; /* which parts of security descriptor to set */
3108 VARARG(sd,security_descriptor); /* security descriptor to set */
3109 @END
3111 @REQ(get_security_object)
3112 obj_handle_t handle; /* handle to the object */
3113 unsigned int security_info; /* which parts of security descriptor to get */
3114 @REPLY
3115 unsigned int sd_len; /* buffer size needed for sd */
3116 VARARG(sd,security_descriptor); /* retrieved security descriptor */
3117 @END
3119 /* Create a mailslot */
3120 @REQ(create_mailslot)
3121 unsigned int access; /* wanted access rights */
3122 unsigned int attributes; /* object attributes */
3123 obj_handle_t rootdir; /* root directory */
3124 timeout_t read_timeout;
3125 unsigned int max_msgsize;
3126 VARARG(name,unicode_str); /* mailslot name */
3127 @REPLY
3128 obj_handle_t handle; /* handle to the mailslot */
3129 @END
3132 /* Set mailslot information */
3133 @REQ(set_mailslot_info)
3134 obj_handle_t handle; /* handle to the mailslot */
3135 timeout_t read_timeout;
3136 unsigned int flags;
3137 @REPLY
3138 timeout_t read_timeout;
3139 unsigned int max_msgsize;
3140 @END
3141 #define MAILSLOT_SET_READ_TIMEOUT 1
3144 /* Create a directory object */
3145 @REQ(create_directory)
3146 unsigned int access; /* access flags */
3147 unsigned int attributes; /* object attributes */
3148 obj_handle_t rootdir; /* root directory */
3149 VARARG(directory_name,unicode_str); /* Directory name */
3150 @REPLY
3151 obj_handle_t handle; /* handle to the directory */
3152 @END
3155 /* Open a directory object */
3156 @REQ(open_directory)
3157 unsigned int access; /* access flags */
3158 unsigned int attributes; /* object attributes */
3159 obj_handle_t rootdir; /* root directory */
3160 VARARG(directory_name,unicode_str); /* Directory name */
3161 @REPLY
3162 obj_handle_t handle; /* handle to the directory */
3163 @END
3166 /* Get a directory entry by index */
3167 @REQ(get_directory_entry)
3168 obj_handle_t handle; /* handle to the directory */
3169 unsigned int index; /* entry index */
3170 @REPLY
3171 data_size_t name_len; /* length of the entry name in bytes */
3172 VARARG(name,unicode_str,name_len); /* entry name */
3173 VARARG(type,unicode_str); /* entry type */
3174 @END
3177 /* Create a symbolic link object */
3178 @REQ(create_symlink)
3179 unsigned int access; /* access flags */
3180 unsigned int attributes; /* object attributes */
3181 obj_handle_t rootdir; /* root directory */
3182 data_size_t name_len; /* length of the symlink name in bytes */
3183 VARARG(name,unicode_str,name_len); /* symlink name */
3184 VARARG(target_name,unicode_str); /* target name */
3185 @REPLY
3186 obj_handle_t handle; /* handle to the symlink */
3187 @END
3190 /* Open a symbolic link object */
3191 @REQ(open_symlink)
3192 unsigned int access; /* access flags */
3193 unsigned int attributes; /* object attributes */
3194 obj_handle_t rootdir; /* root directory */
3195 VARARG(name,unicode_str); /* symlink name */
3196 @REPLY
3197 obj_handle_t handle; /* handle to the symlink */
3198 @END
3201 /* Query a symbolic link object */
3202 @REQ(query_symlink)
3203 obj_handle_t handle; /* handle to the symlink */
3204 @REPLY
3205 data_size_t total; /* total needed size for name */
3206 VARARG(target_name,unicode_str); /* target name */
3207 @END
3210 /* Query basic object information */
3211 @REQ(get_object_info)
3212 obj_handle_t handle; /* handle to the object */
3213 @REPLY
3214 unsigned int access; /* granted access mask */
3215 unsigned int ref_count; /* object ref count */
3216 data_size_t total; /* total needed size for name */
3217 VARARG(name,unicode_str); /* object name */
3218 @END
3221 /* Unlink a named object */
3222 @REQ(unlink_object)
3223 obj_handle_t handle; /* handle to the object */
3224 @END
3227 /* Query the impersonation level of an impersonation token */
3228 @REQ(get_token_impersonation_level)
3229 obj_handle_t handle; /* handle to the object */
3230 @REPLY
3231 int impersonation_level; /* impersonation level of the impersonation token */
3232 @END
3234 /* Allocate a locally-unique identifier */
3235 @REQ(allocate_locally_unique_id)
3236 @REPLY
3237 luid_t luid;
3238 @END
3241 /* Create a device manager */
3242 @REQ(create_device_manager)
3243 unsigned int access; /* wanted access rights */
3244 unsigned int attributes; /* object attributes */
3245 @REPLY
3246 obj_handle_t handle; /* handle to the device */
3247 @END
3250 /* Create a device */
3251 @REQ(create_device)
3252 unsigned int access; /* wanted access rights */
3253 unsigned int attributes; /* object attributes */
3254 obj_handle_t rootdir; /* root directory */
3255 client_ptr_t user_ptr; /* opaque ptr for use by client */
3256 obj_handle_t manager; /* device manager */
3257 VARARG(name,unicode_str); /* object name */
3258 @REPLY
3259 obj_handle_t handle; /* handle to the device */
3260 @END
3263 /* Delete a device */
3264 @REQ(delete_device)
3265 obj_handle_t handle; /* handle to the device */
3266 @END
3269 /* Retrieve the next pending device ioctl request */
3270 @REQ(get_next_device_request)
3271 obj_handle_t manager; /* handle to the device manager */
3272 obj_handle_t prev; /* handle to the previous ioctl */
3273 unsigned int status; /* status of the previous ioctl */
3274 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3275 @REPLY
3276 obj_handle_t next; /* handle to the next ioctl */
3277 ioctl_code_t code; /* ioctl code */
3278 client_ptr_t user_ptr; /* opaque ptr for the device */
3279 process_id_t client_pid; /* pid of process calling ioctl */
3280 thread_id_t client_tid; /* tid of thread calling ioctl */
3281 data_size_t in_size; /* total needed input size */
3282 data_size_t out_size; /* needed output size */
3283 VARARG(next_data,bytes); /* input data of the next ioctl */
3284 @END
3287 /* Make the current process a system process */
3288 @REQ(make_process_system)
3289 @REPLY
3290 obj_handle_t event; /* event signaled when all user processes have exited */
3291 @END
3294 /* Get detailed fixed-size information about a token */
3295 @REQ(get_token_statistics)
3296 obj_handle_t handle; /* handle to the object */
3297 @REPLY
3298 luid_t token_id; /* locally-unique identifier of the token */
3299 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3300 int primary; /* is the token primary or impersonation? */
3301 int impersonation_level; /* level of impersonation */
3302 int group_count; /* the number of groups the token is a member of */
3303 int privilege_count; /* the number of privileges the token has */
3304 @END
3307 /* Create I/O completion port */
3308 @REQ(create_completion)
3309 unsigned int access; /* desired access to a port */
3310 unsigned int attributes; /* object attributes */
3311 unsigned int concurrent; /* max number of concurrent active threads */
3312 obj_handle_t rootdir; /* root directory */
3313 VARARG(filename,string); /* port name */
3314 @REPLY
3315 obj_handle_t handle; /* port handle */
3316 @END
3319 /* Open I/O completion port */
3320 @REQ(open_completion)
3321 unsigned int access; /* desired access to a port */
3322 unsigned int attributes; /* object attributes */
3323 obj_handle_t rootdir; /* root directory */
3324 VARARG(filename,string); /* port name */
3325 @REPLY
3326 obj_handle_t handle; /* port handle */
3327 @END
3330 /* add completion to completion port */
3331 @REQ(add_completion)
3332 obj_handle_t handle; /* port handle */
3333 apc_param_t ckey; /* completion key */
3334 apc_param_t cvalue; /* completion value */
3335 apc_param_t information; /* IO_STATUS_BLOCK Information */
3336 unsigned int status; /* completion result */
3337 @END
3340 /* get completion from completion port queue */
3341 @REQ(remove_completion)
3342 obj_handle_t handle; /* port handle */
3343 @REPLY
3344 apc_param_t ckey; /* completion key */
3345 apc_param_t cvalue; /* completion value */
3346 apc_param_t information; /* IO_STATUS_BLOCK Information */
3347 unsigned int status; /* completion result */
3348 @END
3351 /* get completion queue depth */
3352 @REQ(query_completion)
3353 obj_handle_t handle; /* port handle */
3354 @REPLY
3355 unsigned int depth; /* completion queue depth */
3356 @END
3359 /* associate object with completion port */
3360 @REQ(set_completion_info)
3361 obj_handle_t handle; /* object handle */
3362 apc_param_t ckey; /* completion key */
3363 obj_handle_t chandle; /* port handle */
3364 @END
3367 /* check for associated completion and push msg */
3368 @REQ(add_fd_completion)
3369 obj_handle_t handle; /* async' object */
3370 apc_param_t cvalue; /* completion value */
3371 apc_param_t information; /* IO_STATUS_BLOCK Information */
3372 unsigned int status; /* completion status */
3373 @END
3376 /* Retrieve layered info for a window */
3377 @REQ(get_window_layered_info)
3378 user_handle_t handle; /* handle to the window */
3379 @REPLY
3380 unsigned int color_key; /* color key */
3381 unsigned int alpha; /* alpha (0..255) */
3382 unsigned int flags; /* LWA_* flags */
3383 @END
3386 /* Set layered info for a window */
3387 @REQ(set_window_layered_info)
3388 user_handle_t handle; /* handle to the window */
3389 unsigned int color_key; /* color key */
3390 unsigned int alpha; /* alpha (0..255) */
3391 unsigned int flags; /* LWA_* flags */
3392 @END
3395 /* Allocate an arbitrary user handle */
3396 @REQ(alloc_user_handle)
3397 @REPLY
3398 user_handle_t handle; /* allocated handle */
3399 @END
3402 /* Free an arbitrary user handle */
3403 @REQ(free_user_handle)
3404 user_handle_t handle; /* handle to free*/
3405 @END
3408 /* Set/get the current cursor */
3409 @REQ(set_cursor)
3410 unsigned int flags; /* flags for fields to set (see below) */
3411 user_handle_t handle; /* handle to the cursor */
3412 int show_count; /* show count increment/decrement */
3413 int x; /* cursor position */
3414 int y;
3415 rectangle_t clip; /* cursor clip rectangle */
3416 unsigned int clip_msg; /* message to post on cursor clip changes */
3417 @REPLY
3418 user_handle_t prev_handle; /* previous handle */
3419 int prev_count; /* previous show count */
3420 int prev_x; /* previous position */
3421 int prev_y;
3422 int new_x; /* new position */
3423 int new_y;
3424 rectangle_t new_clip; /* new clip rectangle */
3425 unsigned int last_change; /* time of last position change */
3426 @END
3427 #define SET_CURSOR_HANDLE 0x01
3428 #define SET_CURSOR_COUNT 0x02
3429 #define SET_CURSOR_POS 0x04
3430 #define SET_CURSOR_CLIP 0x08
3431 #define SET_CURSOR_NOCLIP 0x10
3434 /* Modify the list of registered rawinput devices */
3435 @REQ(update_rawinput_devices)
3436 VARARG(devices,rawinput_devices);
3437 @END
3440 /* Retrieve the suspended context of a thread */
3441 @REQ(get_suspend_context)
3442 @REPLY
3443 VARARG(context,context); /* thread context */
3444 @END
3447 /* Store the suspend context of a thread */
3448 @REQ(set_suspend_context)
3449 VARARG(context,context); /* thread context */
3450 @END