gdiplus: Use the given HPALETTE in GdipCreateBitmapFromHBITMAP.
[wine/multimedia.git] / server / protocol.def
blobaaaebc0080a3ad7174550d49a6671e7cd7cf4ad0
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_ALPHA, CPU_POWERPC, CPU_ARM, CPU_SPARC
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 __int64 fir;
163 unsigned int psr, __pad; } alpha_regs;
164 struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc_regs;
165 struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
166 struct { unsigned int psr, pc, npc, y, wim, tbr; } sparc_regs;
167 } ctl; /* selected by SERVER_CTX_CONTROL */
168 union
170 struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
171 struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
172 r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
173 struct { unsigned __int64 v0, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12,
174 s0, s1, s2, s3, s4, s5, s6, a0, a1, a2, a3, a4, a5, at; } alpha_regs;
175 struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
176 struct { unsigned int r[13]; } arm_regs;
177 struct { unsigned int g[8], o[8], l[8], i[8]; } sparc_regs;
178 } integer; /* selected by SERVER_CTX_INTEGER */
179 union
181 struct { unsigned int ds, es, fs, gs; } i386_regs;
182 struct { unsigned int ds, es, fs, gs; } x86_64_regs;
183 } seg; /* selected by SERVER_CTX_SEGMENTS */
184 union
186 struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
187 unsigned char regs[80]; } i386_regs;
188 struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
189 struct { unsigned __int64 f[32], fpcr, softfpcr; } alpha_regs;
190 struct { double fpr[32], fpscr; } powerpc_regs;
191 } fp; /* selected by SERVER_CTX_FLOATING_POINT */
192 union
194 struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
195 struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
196 struct { unsigned int dr[8]; } powerpc_regs;
197 } debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
198 union
200 unsigned char i386_regs[512];
201 } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */
202 } context_t;
204 #define SERVER_CTX_CONTROL 0x01
205 #define SERVER_CTX_INTEGER 0x02
206 #define SERVER_CTX_SEGMENTS 0x04
207 #define SERVER_CTX_FLOATING_POINT 0x08
208 #define SERVER_CTX_DEBUG_REGISTERS 0x10
209 #define SERVER_CTX_EXTENDED_REGISTERS 0x20
211 /* structure used in sending an fd from client to server */
212 struct send_fd
214 thread_id_t tid; /* thread id */
215 int fd; /* file descriptor on client-side */
218 /* structure sent by the server on the wait fifo */
219 struct wake_up_reply
221 client_ptr_t cookie; /* magic cookie that was passed in select_request */
222 int signaled; /* wait result */
223 int __pad;
226 /* NT-style timeout, in 100ns units, negative means relative timeout */
227 typedef __int64 timeout_t;
228 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
230 /* structure for process startup info */
231 typedef struct
233 unsigned int debug_flags;
234 unsigned int console_flags;
235 obj_handle_t console;
236 obj_handle_t hstdin;
237 obj_handle_t hstdout;
238 obj_handle_t hstderr;
239 unsigned int x;
240 unsigned int y;
241 unsigned int xsize;
242 unsigned int ysize;
243 unsigned int xchars;
244 unsigned int ychars;
245 unsigned int attribute;
246 unsigned int flags;
247 unsigned int show;
248 data_size_t curdir_len;
249 data_size_t dllpath_len;
250 data_size_t imagepath_len;
251 data_size_t cmdline_len;
252 data_size_t title_len;
253 data_size_t desktop_len;
254 data_size_t shellinfo_len;
255 data_size_t runtime_len;
256 /* VARARG(curdir,unicode_str,curdir_len); */
257 /* VARARG(dllpath,unicode_str,dllpath_len); */
258 /* VARARG(imagepath,unicode_str,imagepath_len); */
259 /* VARARG(cmdline,unicode_str,cmdline_len); */
260 /* VARARG(title,unicode_str,title_len); */
261 /* VARARG(desktop,unicode_str,desktop_len); */
262 /* VARARG(shellinfo,unicode_str,shellinfo_len); */
263 /* VARARG(runtime,unicode_str,runtime_len); */
264 } startup_info_t;
266 /* structure returned in the list of window properties */
267 typedef struct
269 atom_t atom; /* property atom */
270 int string; /* was atom a string originally? */
271 lparam_t data; /* data stored in property */
272 } property_data_t;
274 /* structure to specify window rectangles */
275 typedef struct
277 int left;
278 int top;
279 int right;
280 int bottom;
281 } rectangle_t;
283 /* structure for parameters of async I/O calls */
284 typedef struct
286 obj_handle_t handle; /* object to perform I/O on */
287 obj_handle_t event; /* event to signal when done */
288 client_ptr_t callback; /* client-side callback to call upon end of async */
289 client_ptr_t iosb; /* I/O status block in client addr space */
290 client_ptr_t arg; /* opaque user data to pass to callback */
291 apc_param_t cvalue; /* completion value to use for completion events */
292 } async_data_t;
294 /* structures for extra message data */
296 struct hardware_msg_data
298 lparam_t info; /* extra info */
299 int x; /* x position */
300 int y; /* y position */
301 unsigned int hw_id; /* unique id */
302 unsigned int flags; /* hook flags */
305 struct callback_msg_data
307 client_ptr_t callback; /* callback function */
308 lparam_t data; /* user data for callback */
309 lparam_t result; /* message result */
312 struct winevent_msg_data
314 user_handle_t hook; /* hook handle */
315 thread_id_t tid; /* thread id */
316 client_ptr_t hook_proc; /* hook proc address */
317 /* followed by module name if any */
320 typedef union
322 int type;
323 struct
325 int type; /* INPUT_KEYBOARD */
326 unsigned short vkey; /* virtual key code */
327 unsigned short scan; /* scan code */
328 unsigned int flags; /* event flags */
329 unsigned int time; /* event time */
330 lparam_t info; /* extra info */
331 } kbd;
332 struct
334 int type; /* INPUT_MOUSE */
335 int x; /* coordinates */
336 int y;
337 unsigned int data; /* mouse data */
338 unsigned int flags; /* event flags */
339 unsigned int time; /* event time */
340 lparam_t info; /* extra info */
341 } mouse;
342 struct
344 int type; /* INPUT_HARDWARE */
345 unsigned int msg; /* message code */
346 lparam_t lparam; /* message param */
347 } hw;
348 } hw_input_t;
350 typedef union
352 unsigned char bytes[1]; /* raw data for sent messages */
353 struct hardware_msg_data hardware;
354 struct callback_msg_data callback;
355 struct winevent_msg_data winevent;
356 } message_data_t;
358 /* structure for console char/attribute info */
359 typedef struct
361 WCHAR ch;
362 unsigned short attr;
363 } char_info_t;
365 /* structure returned in filesystem events */
366 struct filesystem_event
368 int action;
369 data_size_t len;
370 char name[1];
373 typedef struct
375 unsigned int low_part;
376 int high_part;
377 } luid_t;
379 #define MAX_ACL_LEN 65535
381 struct security_descriptor
383 unsigned int control; /* SE_ flags */
384 data_size_t owner_len;
385 data_size_t group_len;
386 data_size_t sacl_len;
387 data_size_t dacl_len;
388 /* VARARG(owner,SID); */
389 /* VARARG(group,SID); */
390 /* VARARG(sacl,ACL); */
391 /* VARARG(dacl,ACL); */
394 struct object_attributes
396 obj_handle_t rootdir; /* root directory */
397 data_size_t sd_len; /* length of security_descriptor data. may be 0 */
398 data_size_t name_len; /* length of the name string. may be 0 */
399 /* VARARG(sd,security_descriptor); */
400 /* VARARG(name,unicode_str); */
403 struct token_groups
405 unsigned int count;
406 /* unsigned int attributes[count]; */
407 /* VARARG(sids,SID); */
410 enum apc_type
412 APC_NONE,
413 APC_USER,
414 APC_TIMER,
415 APC_ASYNC_IO,
416 APC_VIRTUAL_ALLOC,
417 APC_VIRTUAL_FREE,
418 APC_VIRTUAL_QUERY,
419 APC_VIRTUAL_PROTECT,
420 APC_VIRTUAL_FLUSH,
421 APC_VIRTUAL_LOCK,
422 APC_VIRTUAL_UNLOCK,
423 APC_MAP_VIEW,
424 APC_UNMAP_VIEW,
425 APC_CREATE_THREAD
428 typedef union
430 enum apc_type type;
431 struct
433 enum apc_type type; /* APC_USER */
434 int __pad;
435 client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
436 apc_param_t args[3]; /* arguments for user function */
437 } user;
438 struct
440 enum apc_type type; /* APC_TIMER */
441 int __pad;
442 client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
443 timeout_t time; /* absolute time of expiration */
444 client_ptr_t arg; /* user argument */
445 } timer;
446 struct
448 enum apc_type type; /* APC_ASYNC_IO */
449 unsigned int status; /* I/O status */
450 client_ptr_t func; /* unsigned int (*func)(void*, void*, unsigned int, void **); */
451 client_ptr_t user; /* user pointer */
452 client_ptr_t sb; /* status block */
453 } async_io;
454 struct
456 enum apc_type type; /* APC_VIRTUAL_ALLOC */
457 unsigned int op_type; /* type of operation */
458 client_ptr_t addr; /* requested address */
459 mem_size_t size; /* allocation size */
460 unsigned int zero_bits; /* allocation alignment */
461 unsigned int prot; /* memory protection flags */
462 } virtual_alloc;
463 struct
465 enum apc_type type; /* APC_VIRTUAL_FREE */
466 unsigned int op_type; /* type of operation */
467 client_ptr_t addr; /* requested address */
468 mem_size_t size; /* allocation size */
469 } virtual_free;
470 struct
472 enum apc_type type; /* APC_VIRTUAL_QUERY */
473 int __pad;
474 client_ptr_t addr; /* requested address */
475 } virtual_query;
476 struct
478 enum apc_type type; /* APC_VIRTUAL_PROTECT */
479 unsigned int prot; /* new protection flags */
480 client_ptr_t addr; /* requested address */
481 mem_size_t size; /* requested size */
482 } virtual_protect;
483 struct
485 enum apc_type type; /* APC_VIRTUAL_FLUSH */
486 int __pad;
487 client_ptr_t addr; /* requested address */
488 mem_size_t size; /* requested size */
489 } virtual_flush;
490 struct
492 enum apc_type type; /* APC_VIRTUAL_LOCK */
493 int __pad;
494 client_ptr_t addr; /* requested address */
495 mem_size_t size; /* requested size */
496 } virtual_lock;
497 struct
499 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
500 int __pad;
501 client_ptr_t addr; /* requested address */
502 mem_size_t size; /* requested size */
503 } virtual_unlock;
504 struct
506 enum apc_type type; /* APC_MAP_VIEW */
507 obj_handle_t handle; /* mapping handle */
508 client_ptr_t addr; /* requested address */
509 mem_size_t size; /* allocation size */
510 file_pos_t offset; /* file offset */
511 unsigned int alloc_type;/* allocation type */
512 unsigned short zero_bits; /* allocation alignment */
513 unsigned short prot; /* memory protection flags */
514 } map_view;
515 struct
517 enum apc_type type; /* APC_UNMAP_VIEW */
518 int __pad;
519 client_ptr_t addr; /* view address */
520 } unmap_view;
521 struct
523 enum apc_type type; /* APC_CREATE_THREAD */
524 int suspend; /* suspended thread? */
525 client_ptr_t func; /* void (__stdcall *func)(void*); start function */
526 client_ptr_t arg; /* argument for start function */
527 mem_size_t reserve; /* reserve size for thread stack */
528 mem_size_t commit; /* commit size for thread stack */
529 } create_thread;
530 } apc_call_t;
532 typedef union
534 enum apc_type type;
535 struct
537 enum apc_type type; /* APC_ASYNC_IO */
538 unsigned int status; /* new status of async operation */
539 client_ptr_t apc; /* user APC to call */
540 unsigned int total; /* bytes transferred */
541 } async_io;
542 struct
544 enum apc_type type; /* APC_VIRTUAL_ALLOC */
545 unsigned int status; /* status returned by call */
546 client_ptr_t addr; /* resulting address */
547 mem_size_t size; /* resulting size */
548 } virtual_alloc;
549 struct
551 enum apc_type type; /* APC_VIRTUAL_FREE */
552 unsigned int status; /* status returned by call */
553 client_ptr_t addr; /* resulting address */
554 mem_size_t size; /* resulting size */
555 } virtual_free;
556 struct
558 enum apc_type type; /* APC_VIRTUAL_QUERY */
559 unsigned int status; /* status returned by call */
560 client_ptr_t base; /* resulting base address */
561 client_ptr_t alloc_base;/* resulting allocation base */
562 mem_size_t size; /* resulting region size */
563 unsigned short state; /* resulting region state */
564 unsigned short prot; /* resulting region protection */
565 unsigned short alloc_prot;/* resulting allocation protection */
566 unsigned short alloc_type;/* resulting region allocation type */
567 } virtual_query;
568 struct
570 enum apc_type type; /* APC_VIRTUAL_PROTECT */
571 unsigned int status; /* status returned by call */
572 client_ptr_t addr; /* resulting address */
573 mem_size_t size; /* resulting size */
574 unsigned int prot; /* old protection flags */
575 } virtual_protect;
576 struct
578 enum apc_type type; /* APC_VIRTUAL_FLUSH */
579 unsigned int status; /* status returned by call */
580 client_ptr_t addr; /* resulting address */
581 mem_size_t size; /* resulting size */
582 } virtual_flush;
583 struct
585 enum apc_type type; /* APC_VIRTUAL_LOCK */
586 unsigned int status; /* status returned by call */
587 client_ptr_t addr; /* resulting address */
588 mem_size_t size; /* resulting size */
589 } virtual_lock;
590 struct
592 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
593 unsigned int status; /* status returned by call */
594 client_ptr_t addr; /* resulting address */
595 mem_size_t size; /* resulting size */
596 } virtual_unlock;
597 struct
599 enum apc_type type; /* APC_MAP_VIEW */
600 unsigned int status; /* status returned by call */
601 client_ptr_t addr; /* resulting address */
602 mem_size_t size; /* resulting size */
603 } map_view;
604 struct
606 enum apc_type type; /* APC_MAP_VIEW */
607 unsigned int status; /* status returned by call */
608 } unmap_view;
609 struct
611 enum apc_type type; /* APC_CREATE_THREAD */
612 unsigned int status; /* status returned by call */
613 thread_id_t tid; /* thread id */
614 obj_handle_t handle; /* handle to new thread */
615 } create_thread;
616 } apc_result_t;
618 /****************************************************************/
619 /* Request declarations */
621 /* Create a new process from the context of the parent */
622 @REQ(new_process)
623 int inherit_all; /* inherit all handles from parent */
624 unsigned int create_flags; /* creation flags */
625 int socket_fd; /* file descriptor for process socket */
626 obj_handle_t exe_file; /* file handle for main exe */
627 unsigned int process_access; /* access rights for process object */
628 unsigned int process_attr; /* attributes for process object */
629 unsigned int thread_access; /* access rights for thread object */
630 unsigned int thread_attr; /* attributes for thread object */
631 data_size_t info_size; /* size of startup info */
632 VARARG(info,startup_info,info_size); /* startup information */
633 VARARG(env,unicode_str); /* environment for new process */
634 @REPLY
635 obj_handle_t info; /* new process info handle */
636 process_id_t pid; /* process id */
637 obj_handle_t phandle; /* process handle (in the current process) */
638 thread_id_t tid; /* thread id */
639 obj_handle_t thandle; /* thread handle (in the current process) */
640 @END
643 /* Retrieve information about a newly started process */
644 @REQ(get_new_process_info)
645 obj_handle_t info; /* info handle returned from new_process_request */
646 @REPLY
647 int success; /* did the process start successfully? */
648 int exit_code; /* process exit code if failed */
649 @END
652 /* Create a new thread from the context of the parent */
653 @REQ(new_thread)
654 unsigned int access; /* wanted access rights */
655 unsigned int attributes; /* object attributes */
656 int suspend; /* new thread should be suspended on creation */
657 int request_fd; /* fd for request pipe */
658 @REPLY
659 thread_id_t tid; /* thread id */
660 obj_handle_t handle; /* thread handle (in the current process) */
661 @END
664 /* Retrieve the new process startup info */
665 @REQ(get_startup_info)
666 @REPLY
667 obj_handle_t exe_file; /* file handle for main exe */
668 data_size_t info_size; /* size of startup info */
669 VARARG(info,startup_info,info_size); /* startup information */
670 VARARG(env,unicode_str); /* environment */
671 @END
674 /* Signal the end of the process initialization */
675 @REQ(init_process_done)
676 int gui; /* is it a GUI process? */
677 mod_handle_t module; /* main module base address */
678 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
679 client_ptr_t entry; /* process entry point */
680 @END
683 /* Initialize a thread; called from the child after fork()/clone() */
684 @REQ(init_thread)
685 int unix_pid; /* Unix pid of new thread */
686 int unix_tid; /* Unix tid of new thread */
687 int debug_level; /* new debug level */
688 client_ptr_t teb; /* TEB of new thread (in thread address space) */
689 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
690 int reply_fd; /* fd for reply pipe */
691 int wait_fd; /* fd for blocking calls pipe */
692 cpu_type_t cpu; /* CPU that this thread is running on */
693 @REPLY
694 process_id_t pid; /* process id of the new thread's process */
695 thread_id_t tid; /* thread id of the new thread */
696 timeout_t server_start; /* server start time */
697 data_size_t info_size; /* total size of startup info */
698 int version; /* protocol version */
699 unsigned int all_cpus; /* bitset of supported CPUs */
700 @END
703 /* Terminate a process */
704 @REQ(terminate_process)
705 obj_handle_t handle; /* process handle to terminate */
706 int exit_code; /* process exit code */
707 @REPLY
708 int self; /* suicide? */
709 @END
712 /* Terminate a thread */
713 @REQ(terminate_thread)
714 obj_handle_t handle; /* thread handle to terminate */
715 int exit_code; /* thread exit code */
716 @REPLY
717 int self; /* suicide? */
718 int last; /* last thread in this process? */
719 @END
722 /* Retrieve information about a process */
723 @REQ(get_process_info)
724 obj_handle_t handle; /* process handle */
725 @REPLY
726 process_id_t pid; /* server process id */
727 process_id_t ppid; /* server process id of parent */
728 affinity_t affinity; /* process affinity mask */
729 client_ptr_t peb; /* PEB address in process address space */
730 timeout_t start_time; /* process start time */
731 timeout_t end_time; /* process end time */
732 int exit_code; /* process exit code */
733 int priority; /* priority class */
734 cpu_type_t cpu; /* CPU that this process is running on */
735 int debugger_present; /* process is being debugged */
736 @END
739 /* Set a process informations */
740 @REQ(set_process_info)
741 obj_handle_t handle; /* process handle */
742 int mask; /* setting mask (see below) */
743 int priority; /* priority class */
744 affinity_t affinity; /* affinity mask */
745 @END
746 #define SET_PROCESS_INFO_PRIORITY 0x01
747 #define SET_PROCESS_INFO_AFFINITY 0x02
750 /* Retrieve information about a thread */
751 @REQ(get_thread_info)
752 obj_handle_t handle; /* thread handle */
753 thread_id_t tid_in; /* thread id (optional) */
754 @REPLY
755 process_id_t pid; /* server process id */
756 thread_id_t tid; /* server thread id */
757 client_ptr_t teb; /* thread teb pointer */
758 affinity_t affinity; /* thread affinity mask */
759 timeout_t creation_time; /* thread creation time */
760 timeout_t exit_time; /* thread exit time */
761 int exit_code; /* thread exit code */
762 int priority; /* thread priority level */
763 int last; /* last thread in process */
764 @END
767 /* Set a thread informations */
768 @REQ(set_thread_info)
769 obj_handle_t handle; /* thread handle */
770 int mask; /* setting mask (see below) */
771 int priority; /* priority class */
772 affinity_t affinity; /* affinity mask */
773 obj_handle_t token; /* impersonation token */
774 @END
775 #define SET_THREAD_INFO_PRIORITY 0x01
776 #define SET_THREAD_INFO_AFFINITY 0x02
777 #define SET_THREAD_INFO_TOKEN 0x04
780 /* Retrieve information about a module */
781 @REQ(get_dll_info)
782 obj_handle_t handle; /* process handle */
783 mod_handle_t base_address; /* base address of module */
784 @REPLY
785 client_ptr_t entry_point;
786 data_size_t size; /* module size */
787 data_size_t filename_len; /* buffer len in bytes required to store filename */
788 VARARG(filename,unicode_str); /* file name of module */
789 @END
792 /* Suspend a thread */
793 @REQ(suspend_thread)
794 obj_handle_t handle; /* thread handle */
795 @REPLY
796 int count; /* new suspend count */
797 @END
800 /* Resume a thread */
801 @REQ(resume_thread)
802 obj_handle_t handle; /* thread handle */
803 @REPLY
804 int count; /* new suspend count */
805 @END
808 /* Notify the server that a dll has been loaded */
809 @REQ(load_dll)
810 obj_handle_t handle; /* file handle */
811 mod_handle_t base; /* base address */
812 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
813 data_size_t size; /* dll size */
814 int dbg_offset; /* debug info offset */
815 int dbg_size; /* debug info size */
816 VARARG(filename,unicode_str); /* file name of dll */
817 @END
820 /* Notify the server that a dll is being unloaded */
821 @REQ(unload_dll)
822 mod_handle_t base; /* base address */
823 @END
826 /* Queue an APC for a thread or process */
827 @REQ(queue_apc)
828 obj_handle_t handle; /* thread or process handle */
829 apc_call_t call; /* call arguments */
830 @REPLY
831 obj_handle_t handle; /* APC handle */
832 int self; /* run APC in caller itself? */
833 @END
836 /* Get the result of an APC call */
837 @REQ(get_apc_result)
838 obj_handle_t handle; /* handle to the APC */
839 @REPLY
840 apc_result_t result; /* result of the APC */
841 @END
844 /* Close a handle for the current process */
845 @REQ(close_handle)
846 obj_handle_t handle; /* handle to close */
847 @END
850 /* Set a handle information */
851 @REQ(set_handle_info)
852 obj_handle_t handle; /* handle we are interested in */
853 int flags; /* new handle flags */
854 int mask; /* mask for flags to set */
855 @REPLY
856 int old_flags; /* old flag value */
857 @END
860 /* Duplicate a handle */
861 @REQ(dup_handle)
862 obj_handle_t src_process; /* src process handle */
863 obj_handle_t src_handle; /* src handle to duplicate */
864 obj_handle_t dst_process; /* dst process handle */
865 unsigned int access; /* wanted access rights */
866 unsigned int attributes; /* object attributes */
867 unsigned int options; /* duplicate options (see below) */
868 @REPLY
869 obj_handle_t handle; /* duplicated handle in dst process */
870 int self; /* is the source the current process? */
871 int closed; /* whether the source handle has been closed */
872 @END
873 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
874 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
875 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
878 /* Open a handle to a process */
879 @REQ(open_process)
880 process_id_t pid; /* process id to open */
881 unsigned int access; /* wanted access rights */
882 unsigned int attributes; /* object attributes */
883 @REPLY
884 obj_handle_t handle; /* handle to the process */
885 @END
888 /* Open a handle to a thread */
889 @REQ(open_thread)
890 thread_id_t tid; /* thread id to open */
891 unsigned int access; /* wanted access rights */
892 unsigned int attributes; /* object attributes */
893 @REPLY
894 obj_handle_t handle; /* handle to the thread */
895 @END
898 /* Wait for handles */
899 @REQ(select)
900 int flags; /* wait flags (see below) */
901 client_ptr_t cookie; /* magic cookie to return to client */
902 obj_handle_t signal; /* object to signal (0 if none) */
903 obj_handle_t prev_apc; /* handle to previous APC */
904 timeout_t timeout; /* timeout */
905 VARARG(result,apc_result); /* result of previous APC */
906 VARARG(handles,handles); /* handles to select on */
907 @REPLY
908 timeout_t timeout; /* timeout converted to absolute */
909 apc_call_t call; /* APC call arguments */
910 obj_handle_t apc_handle; /* handle to next APC */
911 @END
912 #define SELECT_ALL 1
913 #define SELECT_ALERTABLE 2
914 #define SELECT_INTERRUPTIBLE 4
917 /* Create an event */
918 @REQ(create_event)
919 unsigned int access; /* wanted access rights */
920 unsigned int attributes; /* object attributes */
921 int manual_reset; /* manual reset event */
922 int initial_state; /* initial state of the event */
923 VARARG(objattr,object_attributes); /* object attributes */
924 @REPLY
925 obj_handle_t handle; /* handle to the event */
926 @END
928 /* Event operation */
929 @REQ(event_op)
930 obj_handle_t handle; /* handle to event */
931 int op; /* event operation (see below) */
932 @END
933 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
936 /* Open an event */
937 @REQ(open_event)
938 unsigned int access; /* wanted access rights */
939 unsigned int attributes; /* object attributes */
940 obj_handle_t rootdir; /* root directory */
941 VARARG(name,unicode_str); /* object name */
942 @REPLY
943 obj_handle_t handle; /* handle to the event */
944 @END
947 /* Create a mutex */
948 @REQ(create_mutex)
949 unsigned int access; /* wanted access rights */
950 unsigned int attributes; /* object attributes */
951 int owned; /* initially owned? */
952 VARARG(objattr,object_attributes); /* object attributes */
953 @REPLY
954 obj_handle_t handle; /* handle to the mutex */
955 @END
958 /* Release a mutex */
959 @REQ(release_mutex)
960 obj_handle_t handle; /* handle to the mutex */
961 @REPLY
962 unsigned int prev_count; /* value of internal counter, before release */
963 @END
966 /* Open a mutex */
967 @REQ(open_mutex)
968 unsigned int access; /* wanted access rights */
969 unsigned int attributes; /* object attributes */
970 obj_handle_t rootdir; /* root directory */
971 VARARG(name,unicode_str); /* object name */
972 @REPLY
973 obj_handle_t handle; /* handle to the mutex */
974 @END
977 /* Create a semaphore */
978 @REQ(create_semaphore)
979 unsigned int access; /* wanted access rights */
980 unsigned int attributes; /* object attributes */
981 unsigned int initial; /* initial count */
982 unsigned int max; /* maximum count */
983 VARARG(objattr,object_attributes); /* object attributes */
984 @REPLY
985 obj_handle_t handle; /* handle to the semaphore */
986 @END
989 /* Release a semaphore */
990 @REQ(release_semaphore)
991 obj_handle_t handle; /* handle to the semaphore */
992 unsigned int count; /* count to add to semaphore */
993 @REPLY
994 unsigned int prev_count; /* previous semaphore count */
995 @END
998 /* Open a semaphore */
999 @REQ(open_semaphore)
1000 unsigned int access; /* wanted access rights */
1001 unsigned int attributes; /* object attributes */
1002 obj_handle_t rootdir; /* root directory */
1003 VARARG(name,unicode_str); /* object name */
1004 @REPLY
1005 obj_handle_t handle; /* handle to the semaphore */
1006 @END
1009 /* Create a file */
1010 @REQ(create_file)
1011 unsigned int access; /* wanted access rights */
1012 unsigned int attributes; /* object attributes */
1013 unsigned int sharing; /* sharing flags */
1014 int create; /* file create action */
1015 unsigned int options; /* file options */
1016 unsigned int attrs; /* file attributes for creation */
1017 VARARG(objattr,object_attributes); /* object attributes */
1018 VARARG(filename,string); /* file name */
1019 @REPLY
1020 obj_handle_t handle; /* handle to the file */
1021 @END
1024 /* Open a file object */
1025 @REQ(open_file_object)
1026 unsigned int access; /* wanted access rights */
1027 unsigned int attributes; /* open attributes */
1028 obj_handle_t rootdir; /* root directory */
1029 unsigned int sharing; /* sharing flags */
1030 unsigned int options; /* file options */
1031 VARARG(filename,unicode_str); /* file name */
1032 @REPLY
1033 obj_handle_t handle; /* handle to the file */
1034 @END
1037 /* Allocate a file handle for a Unix fd */
1038 @REQ(alloc_file_handle)
1039 unsigned int access; /* wanted access rights */
1040 unsigned int attributes; /* object attributes */
1041 int fd; /* file descriptor on the client side */
1042 @REPLY
1043 obj_handle_t handle; /* handle to the file */
1044 @END
1047 /* Get the Unix name from a file handle */
1048 @REQ(get_handle_unix_name)
1049 obj_handle_t handle; /* file handle */
1050 @REPLY
1051 data_size_t name_len; /* unix name length */
1052 VARARG(name,string); /* unix name */
1053 @END
1056 /* Get a Unix fd to access a file */
1057 @REQ(get_handle_fd)
1058 obj_handle_t handle; /* handle to the file */
1059 @REPLY
1060 int type; /* file type (see below) */
1061 int cacheable; /* can fd be cached in the client? */
1062 unsigned int access; /* file access rights */
1063 unsigned int options; /* file open options */
1064 @END
1065 enum server_fd_type
1067 FD_TYPE_INVALID, /* invalid file (no associated fd) */
1068 FD_TYPE_FILE, /* regular file */
1069 FD_TYPE_DIR, /* directory */
1070 FD_TYPE_SOCKET, /* socket */
1071 FD_TYPE_SERIAL, /* serial port */
1072 FD_TYPE_PIPE, /* named pipe */
1073 FD_TYPE_MAILSLOT, /* mailslot */
1074 FD_TYPE_CHAR, /* unspecified char device */
1075 FD_TYPE_DEVICE, /* Windows device file */
1076 FD_TYPE_NB_TYPES
1080 /* Flush a file buffers */
1081 @REQ(flush_file)
1082 obj_handle_t handle; /* handle to the file */
1083 @REPLY
1084 obj_handle_t event; /* event set when finished */
1085 @END
1088 /* Lock a region of a file */
1089 @REQ(lock_file)
1090 obj_handle_t handle; /* handle to the file */
1091 file_pos_t offset; /* offset of start of lock */
1092 file_pos_t count; /* count of bytes to lock */
1093 int shared; /* shared or exclusive lock? */
1094 int wait; /* do we want to wait? */
1095 @REPLY
1096 obj_handle_t handle; /* handle to wait on */
1097 int overlapped; /* is it an overlapped I/O handle? */
1098 @END
1101 /* Unlock a region of a file */
1102 @REQ(unlock_file)
1103 obj_handle_t handle; /* handle to the file */
1104 file_pos_t offset; /* offset of start of unlock */
1105 file_pos_t count; /* count of bytes to unlock */
1106 @END
1109 /* Create a socket */
1110 @REQ(create_socket)
1111 unsigned int access; /* wanted access rights */
1112 unsigned int attributes; /* object attributes */
1113 int family; /* family, see socket manpage */
1114 int type; /* type, see socket manpage */
1115 int protocol; /* protocol, see socket manpage */
1116 unsigned int flags; /* socket flags */
1117 @REPLY
1118 obj_handle_t handle; /* handle to the new socket */
1119 @END
1122 /* Accept a socket */
1123 @REQ(accept_socket)
1124 obj_handle_t lhandle; /* handle to the listening socket */
1125 unsigned int access; /* wanted access rights */
1126 unsigned int attributes; /* object attributes */
1127 @REPLY
1128 obj_handle_t handle; /* handle to the new socket */
1129 @END
1132 /* Accept into an initialized socket */
1133 @REQ(accept_into_socket)
1134 obj_handle_t lhandle; /* handle to the listening socket */
1135 obj_handle_t ahandle; /* handle to the accepting socket */
1136 @END
1139 /* Set socket event parameters */
1140 @REQ(set_socket_event)
1141 obj_handle_t handle; /* handle to the socket */
1142 unsigned int mask; /* event mask */
1143 obj_handle_t event; /* event object */
1144 user_handle_t window; /* window to send the message to */
1145 unsigned int msg; /* message to send */
1146 @END
1149 /* Get socket event parameters */
1150 @REQ(get_socket_event)
1151 obj_handle_t handle; /* handle to the socket */
1152 int service; /* clear pending? */
1153 obj_handle_t c_event; /* event to clear */
1154 @REPLY
1155 unsigned int mask; /* event mask */
1156 unsigned int pmask; /* pending events */
1157 unsigned int state; /* status bits */
1158 VARARG(errors,ints); /* event errors */
1159 @END
1162 /* Reenable pending socket events */
1163 @REQ(enable_socket_event)
1164 obj_handle_t handle; /* handle to the socket */
1165 unsigned int mask; /* events to re-enable */
1166 unsigned int sstate; /* status bits to set */
1167 unsigned int cstate; /* status bits to clear */
1168 @END
1170 @REQ(set_socket_deferred)
1171 obj_handle_t handle; /* handle to the socket */
1172 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1173 @END
1175 /* Allocate a console (only used by a console renderer) */
1176 @REQ(alloc_console)
1177 unsigned int access; /* wanted access rights */
1178 unsigned int attributes; /* object attributes */
1179 process_id_t pid; /* pid of process which shall be attached to the console */
1180 int input_fd; /* if pid=-1 (bare console to current process), fd for input */
1181 @REPLY
1182 obj_handle_t handle_in; /* handle to console input */
1183 obj_handle_t event; /* handle to renderer events change notification */
1184 @END
1187 /* Free the console of the current process */
1188 @REQ(free_console)
1189 @END
1192 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1193 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1194 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1195 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1196 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1197 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1198 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1199 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1200 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1201 struct console_renderer_event
1203 short event;
1204 union
1206 struct update
1208 short top;
1209 short bottom;
1210 } update;
1211 struct resize
1213 short width;
1214 short height;
1215 } resize;
1216 struct cursor_pos
1218 short x;
1219 short y;
1220 } cursor_pos;
1221 struct cursor_geom
1223 short visible;
1224 short size;
1225 } cursor_geom;
1226 struct display
1228 short left;
1229 short top;
1230 short width;
1231 short height;
1232 } display;
1233 } u;
1236 /* retrieve console events for the renderer */
1237 @REQ(get_console_renderer_events)
1238 obj_handle_t handle; /* handle to console input events */
1239 @REPLY
1240 VARARG(data,bytes); /* the various console_renderer_events */
1241 @END
1244 /* Open a handle to the process console */
1245 @REQ(open_console)
1246 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1247 /* otherwise console_in handle to get active screen buffer? */
1248 unsigned int access; /* wanted access rights */
1249 unsigned int attributes; /* object attributes */
1250 int share; /* share mask (only for output handles) */
1251 @REPLY
1252 obj_handle_t handle; /* handle to the console */
1253 @END
1256 /* Get the input queue wait event */
1257 @REQ(get_console_wait_event)
1258 @REPLY
1259 obj_handle_t handle;
1260 @END
1262 /* Get a console mode (input or output) */
1263 @REQ(get_console_mode)
1264 obj_handle_t handle; /* handle to the console */
1265 @REPLY
1266 int mode; /* console mode */
1267 @END
1270 /* Set a console mode (input or output) */
1271 @REQ(set_console_mode)
1272 obj_handle_t handle; /* handle to the console */
1273 int mode; /* console mode */
1274 @END
1277 /* Set info about a console (input only) */
1278 @REQ(set_console_input_info)
1279 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1280 int mask; /* setting mask (see below) */
1281 obj_handle_t active_sb; /* active screen buffer */
1282 int history_mode; /* whether we duplicate lines in history */
1283 int history_size; /* number of lines in history */
1284 int edition_mode; /* index to the edition mode flavors */
1285 int input_cp; /* console input codepage */
1286 int output_cp; /* console output codepage */
1287 user_handle_t win; /* console window if backend supports it */
1288 VARARG(title,unicode_str); /* console title */
1289 @END
1290 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1291 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1292 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1293 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1294 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1295 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1296 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1297 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1300 /* Get info about a console (input only) */
1301 @REQ(get_console_input_info)
1302 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1303 @REPLY
1304 int history_mode; /* whether we duplicate lines in history */
1305 int history_size; /* number of lines in history */
1306 int history_index; /* number of used lines in history */
1307 int edition_mode; /* index to the edition mode flavors */
1308 int input_cp; /* console input codepage */
1309 int output_cp; /* console output codepage */
1310 user_handle_t win; /* console window if backend supports it */
1311 VARARG(title,unicode_str); /* console title */
1312 @END
1315 /* appends a string to console's history */
1316 @REQ(append_console_input_history)
1317 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1318 VARARG(line,unicode_str); /* line to add */
1319 @END
1322 /* appends a string to console's history */
1323 @REQ(get_console_input_history)
1324 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1325 int index; /* index to get line from */
1326 @REPLY
1327 int total; /* total length of line in Unicode chars */
1328 VARARG(line,unicode_str); /* line to add */
1329 @END
1332 /* creates a new screen buffer on process' console */
1333 @REQ(create_console_output)
1334 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1335 unsigned int access; /* wanted access rights */
1336 unsigned int attributes; /* object attributes */
1337 unsigned int share; /* sharing credentials */
1338 int fd; /* for bare consoles, fd the screen-buffer is attached to */
1339 @REPLY
1340 obj_handle_t handle_out; /* handle to the screen buffer */
1341 @END
1344 /* Set info about a console (output only) */
1345 @REQ(set_console_output_info)
1346 obj_handle_t handle; /* handle to the console */
1347 int mask; /* setting mask (see below) */
1348 short int cursor_size; /* size of cursor (percentage filled) */
1349 short int cursor_visible;/* cursor visibility flag */
1350 short int cursor_x; /* position of cursor (x, y) */
1351 short int cursor_y;
1352 short int width; /* width of the screen buffer */
1353 short int height; /* height of the screen buffer */
1354 short int attr; /* default attribute */
1355 short int win_left; /* window actually displayed by renderer */
1356 short int win_top; /* the rect area is expressed withing the */
1357 short int win_right; /* boundaries of the screen buffer */
1358 short int win_bottom;
1359 short int max_width; /* maximum size (width x height) for the window */
1360 short int max_height;
1361 @END
1362 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1363 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1364 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1365 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1366 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1367 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1370 /* Get info about a console (output only) */
1371 @REQ(get_console_output_info)
1372 obj_handle_t handle; /* handle to the console */
1373 @REPLY
1374 short int cursor_size; /* size of cursor (percentage filled) */
1375 short int cursor_visible;/* cursor visibility flag */
1376 short int cursor_x; /* position of cursor (x, y) */
1377 short int cursor_y;
1378 short int width; /* width of the screen buffer */
1379 short int height; /* height of the screen buffer */
1380 short int attr; /* default attribute */
1381 short int win_left; /* window actually displayed by renderer */
1382 short int win_top; /* the rect area is expressed withing the */
1383 short int win_right; /* boundaries of the screen buffer */
1384 short int win_bottom;
1385 short int max_width; /* maximum size (width x height) for the window */
1386 short int max_height;
1387 @END
1389 /* Add input records to a console input queue */
1390 @REQ(write_console_input)
1391 obj_handle_t handle; /* handle to the console input */
1392 VARARG(rec,input_records); /* input records */
1393 @REPLY
1394 int written; /* number of records written */
1395 @END
1398 /* Fetch input records from a console input queue */
1399 @REQ(read_console_input)
1400 obj_handle_t handle; /* handle to the console input */
1401 int flush; /* flush the retrieved records from the queue? */
1402 @REPLY
1403 int read; /* number of records read */
1404 VARARG(rec,input_records); /* input records */
1405 @END
1408 /* write data (chars and/or attributes) in a screen buffer */
1409 @REQ(write_console_output)
1410 obj_handle_t handle; /* handle to the console output */
1411 int x; /* position where to start writing */
1412 int y;
1413 int mode; /* char info (see below) */
1414 int wrap; /* wrap around at end of line? */
1415 VARARG(data,bytes); /* info to write */
1416 @REPLY
1417 int written; /* number of char infos actually written */
1418 int width; /* width of screen buffer */
1419 int height; /* height of screen buffer */
1420 @END
1421 enum char_info_mode
1423 CHAR_INFO_MODE_TEXT, /* characters only */
1424 CHAR_INFO_MODE_ATTR, /* attributes only */
1425 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1426 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1430 /* fill a screen buffer with constant data (chars and/or attributes) */
1431 @REQ(fill_console_output)
1432 obj_handle_t handle; /* handle to the console output */
1433 int x; /* position where to start writing */
1434 int y;
1435 int mode; /* char info mode */
1436 int count; /* number to write */
1437 int wrap; /* wrap around at end of line? */
1438 char_info_t data; /* data to write */
1439 @REPLY
1440 int written; /* number of char infos actually written */
1441 @END
1444 /* read data (chars and/or attributes) from a screen buffer */
1445 @REQ(read_console_output)
1446 obj_handle_t handle; /* handle to the console output */
1447 int x; /* position (x,y) where to start reading */
1448 int y;
1449 int mode; /* char info mode */
1450 int wrap; /* wrap around at end of line? */
1451 @REPLY
1452 int width; /* width of screen buffer */
1453 int height; /* height of screen buffer */
1454 VARARG(data,bytes);
1455 @END
1458 /* move a rect (of data) in screen buffer content */
1459 @REQ(move_console_output)
1460 obj_handle_t handle; /* handle to the console output */
1461 short int x_src; /* position (x, y) of rect to start moving from */
1462 short int y_src;
1463 short int x_dst; /* position (x, y) of rect to move to */
1464 short int y_dst;
1465 short int w; /* size of the rect (width, height) to move */
1466 short int h;
1467 @END
1470 /* Sends a signal to a process group */
1471 @REQ(send_console_signal)
1472 int signal; /* the signal to send */
1473 process_id_t group_id; /* the group to send the signal to */
1474 @END
1477 /* enable directory change notifications */
1478 @REQ(read_directory_changes)
1479 unsigned int filter; /* notification filter */
1480 int subtree; /* watch the subtree? */
1481 int want_data; /* flag indicating whether change data should be collected */
1482 async_data_t async; /* async I/O parameters */
1483 @END
1486 @REQ(read_change)
1487 obj_handle_t handle;
1488 @REPLY
1489 VARARG(events,filesystem_event); /* collected filesystem events */
1490 @END
1493 /* Create a file mapping */
1494 @REQ(create_mapping)
1495 unsigned int access; /* wanted access rights */
1496 unsigned int attributes; /* object attributes */
1497 unsigned int protect; /* protection flags (see below) */
1498 mem_size_t size; /* mapping size */
1499 obj_handle_t file_handle; /* file handle */
1500 VARARG(objattr,object_attributes); /* object attributes */
1501 @REPLY
1502 obj_handle_t handle; /* handle to the mapping */
1503 @END
1504 /* per-page protection flags */
1505 #define VPROT_READ 0x01
1506 #define VPROT_WRITE 0x02
1507 #define VPROT_EXEC 0x04
1508 #define VPROT_WRITECOPY 0x08
1509 #define VPROT_GUARD 0x10
1510 #define VPROT_NOCACHE 0x20
1511 #define VPROT_COMMITTED 0x40
1512 #define VPROT_WRITEWATCH 0x80
1513 /* per-mapping protection flags */
1514 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1515 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1516 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1517 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1520 /* Open a mapping */
1521 @REQ(open_mapping)
1522 unsigned int access; /* wanted access rights */
1523 unsigned int attributes; /* object attributes */
1524 obj_handle_t rootdir; /* root directory */
1525 VARARG(name,unicode_str); /* object name */
1526 @REPLY
1527 obj_handle_t handle; /* handle to the mapping */
1528 @END
1531 /* Get information about a file mapping */
1532 @REQ(get_mapping_info)
1533 obj_handle_t handle; /* handle to the mapping */
1534 unsigned int access; /* wanted access rights */
1535 @REPLY
1536 mem_size_t size; /* mapping size */
1537 int protect; /* protection flags */
1538 int header_size; /* header size (for VPROT_IMAGE mapping) */
1539 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1540 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1541 obj_handle_t shared_file; /* shared mapping file handle */
1542 @END
1545 /* Get a range of committed pages in a file mapping */
1546 @REQ(get_mapping_committed_range)
1547 obj_handle_t handle; /* handle to the mapping */
1548 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1549 @REPLY
1550 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1551 int committed; /* whether it is a committed range */
1552 @END
1555 /* Add a range to the committed pages in a file mapping */
1556 @REQ(add_mapping_committed_range)
1557 obj_handle_t handle; /* handle to the mapping */
1558 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1559 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1560 @END
1563 #define SNAP_PROCESS 0x00000001
1564 #define SNAP_THREAD 0x00000002
1565 /* Create a snapshot */
1566 @REQ(create_snapshot)
1567 unsigned int attributes; /* object attributes */
1568 unsigned int flags; /* snapshot flags (SNAP_*) */
1569 @REPLY
1570 obj_handle_t handle; /* handle to the snapshot */
1571 @END
1574 /* Get the next process from a snapshot */
1575 @REQ(next_process)
1576 obj_handle_t handle; /* handle to the snapshot */
1577 int reset; /* reset snapshot position? */
1578 @REPLY
1579 int count; /* process usage count */
1580 process_id_t pid; /* process id */
1581 process_id_t ppid; /* parent process id */
1582 int threads; /* number of threads */
1583 int priority; /* process priority */
1584 int handles; /* number of handles */
1585 VARARG(filename,unicode_str); /* file name of main exe */
1586 @END
1589 /* Get the next thread from a snapshot */
1590 @REQ(next_thread)
1591 obj_handle_t handle; /* handle to the snapshot */
1592 int reset; /* reset snapshot position? */
1593 @REPLY
1594 int count; /* thread usage count */
1595 process_id_t pid; /* process id */
1596 thread_id_t tid; /* thread id */
1597 int base_pri; /* base priority */
1598 int delta_pri; /* delta priority */
1599 @END
1602 /* Wait for a debug event */
1603 @REQ(wait_debug_event)
1604 int get_handle; /* should we alloc a handle for waiting? */
1605 @REPLY
1606 process_id_t pid; /* process id */
1607 thread_id_t tid; /* thread id */
1608 obj_handle_t wait; /* wait handle if no event ready */
1609 VARARG(event,debug_event); /* debug event data */
1610 @END
1613 /* Queue an exception event */
1614 @REQ(queue_exception_event)
1615 int first; /* first chance exception? */
1616 unsigned int code; /* exception code */
1617 unsigned int flags; /* exception flags */
1618 client_ptr_t record; /* exception record */
1619 client_ptr_t address; /* exception address */
1620 data_size_t len; /* size of parameters */
1621 VARARG(params,uints64,len);/* exception parameters */
1622 VARARG(context,context); /* thread context */
1623 @REPLY
1624 obj_handle_t handle; /* handle to the queued event */
1625 @END
1628 /* Retrieve the status of an exception event */
1629 @REQ(get_exception_status)
1630 obj_handle_t handle; /* handle to the queued event */
1631 @REPLY
1632 VARARG(context,context); /* modified thread context */
1633 @END
1636 /* Send an output string to the debugger */
1637 @REQ(output_debug_string)
1638 data_size_t length; /* string length */
1639 client_ptr_t string; /* string to display (in debugged process address space) */
1640 @END
1643 /* Continue a debug event */
1644 @REQ(continue_debug_event)
1645 process_id_t pid; /* process id to continue */
1646 thread_id_t tid; /* thread id to continue */
1647 int status; /* continuation status */
1648 @END
1651 /* Start/stop debugging an existing process */
1652 @REQ(debug_process)
1653 process_id_t pid; /* id of the process to debug */
1654 int attach; /* 1=attaching / 0=detaching from the process */
1655 @END
1658 /* Simulate a breakpoint in a process */
1659 @REQ(debug_break)
1660 obj_handle_t handle; /* process handle */
1661 @REPLY
1662 int self; /* was it the caller itself? */
1663 @END
1666 /* Set debugger kill on exit flag */
1667 @REQ(set_debugger_kill_on_exit)
1668 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1669 @END
1672 /* Read data from a process address space */
1673 @REQ(read_process_memory)
1674 obj_handle_t handle; /* process handle */
1675 client_ptr_t addr; /* addr to read from */
1676 @REPLY
1677 VARARG(data,bytes); /* result data */
1678 @END
1681 /* Write data to a process address space */
1682 @REQ(write_process_memory)
1683 obj_handle_t handle; /* process handle */
1684 client_ptr_t addr; /* addr to write to */
1685 VARARG(data,bytes); /* data to write */
1686 @END
1689 /* Create a registry key */
1690 @REQ(create_key)
1691 obj_handle_t parent; /* handle to the parent key */
1692 unsigned int access; /* desired access rights */
1693 unsigned int attributes; /* object attributes */
1694 unsigned int options; /* creation options */
1695 data_size_t namelen; /* length of key name in bytes */
1696 VARARG(name,unicode_str,namelen); /* key name */
1697 VARARG(class,unicode_str); /* class name */
1698 @REPLY
1699 obj_handle_t hkey; /* handle to the created key */
1700 int created; /* has it been newly created? */
1701 @END
1703 /* Open a registry key */
1704 @REQ(open_key)
1705 obj_handle_t parent; /* handle to the parent key */
1706 unsigned int access; /* desired access rights */
1707 unsigned int attributes; /* object attributes */
1708 VARARG(name,unicode_str); /* key name */
1709 @REPLY
1710 obj_handle_t hkey; /* handle to the open key */
1711 @END
1714 /* Delete a registry key */
1715 @REQ(delete_key)
1716 obj_handle_t hkey; /* handle to the key */
1717 @END
1720 /* Flush a registry key */
1721 @REQ(flush_key)
1722 obj_handle_t hkey; /* handle to the key */
1723 @END
1726 /* Enumerate registry subkeys */
1727 @REQ(enum_key)
1728 obj_handle_t hkey; /* handle to registry key */
1729 int index; /* index of subkey (or -1 for current key) */
1730 int info_class; /* requested information class */
1731 @REPLY
1732 int subkeys; /* number of subkeys */
1733 int max_subkey; /* longest subkey name */
1734 int max_class; /* longest class name */
1735 int values; /* number of values */
1736 int max_value; /* longest value name */
1737 int max_data; /* longest value data */
1738 timeout_t modif; /* last modification time */
1739 data_size_t total; /* total length needed for full name and class */
1740 data_size_t namelen; /* length of key name in bytes */
1741 VARARG(name,unicode_str,namelen); /* key name */
1742 VARARG(class,unicode_str); /* class name */
1743 @END
1746 /* Set a value of a registry key */
1747 @REQ(set_key_value)
1748 obj_handle_t hkey; /* handle to registry key */
1749 int type; /* value type */
1750 data_size_t namelen; /* length of value name in bytes */
1751 VARARG(name,unicode_str,namelen); /* value name */
1752 VARARG(data,bytes); /* value data */
1753 @END
1756 /* Retrieve the value of a registry key */
1757 @REQ(get_key_value)
1758 obj_handle_t hkey; /* handle to registry key */
1759 VARARG(name,unicode_str); /* value name */
1760 @REPLY
1761 int type; /* value type */
1762 data_size_t total; /* total length needed for data */
1763 VARARG(data,bytes); /* value data */
1764 @END
1767 /* Enumerate a value of a registry key */
1768 @REQ(enum_key_value)
1769 obj_handle_t hkey; /* handle to registry key */
1770 int index; /* value index */
1771 int info_class; /* requested information class */
1772 @REPLY
1773 int type; /* value type */
1774 data_size_t total; /* total length needed for full name and data */
1775 data_size_t namelen; /* length of value name in bytes */
1776 VARARG(name,unicode_str,namelen); /* value name */
1777 VARARG(data,bytes); /* value data */
1778 @END
1781 /* Delete a value of a registry key */
1782 @REQ(delete_key_value)
1783 obj_handle_t hkey; /* handle to registry key */
1784 VARARG(name,unicode_str); /* value name */
1785 @END
1788 /* Load a registry branch from a file */
1789 @REQ(load_registry)
1790 obj_handle_t hkey; /* root key to load to */
1791 obj_handle_t file; /* file to load from */
1792 VARARG(name,unicode_str); /* subkey name */
1793 @END
1796 /* UnLoad a registry branch from a file */
1797 @REQ(unload_registry)
1798 obj_handle_t hkey; /* root key to unload to */
1799 @END
1802 /* Save a registry branch to a file */
1803 @REQ(save_registry)
1804 obj_handle_t hkey; /* key to save */
1805 obj_handle_t file; /* file to save to */
1806 @END
1809 /* Add a registry key change notification */
1810 @REQ(set_registry_notification)
1811 obj_handle_t hkey; /* key to watch for changes */
1812 obj_handle_t event; /* event to set */
1813 int subtree; /* should we watch the whole subtree? */
1814 unsigned int filter; /* things to watch */
1815 @END
1818 /* Create a waitable timer */
1819 @REQ(create_timer)
1820 unsigned int access; /* wanted access rights */
1821 unsigned int attributes; /* object attributes */
1822 obj_handle_t rootdir; /* root directory */
1823 int manual; /* manual reset */
1824 VARARG(name,unicode_str); /* object name */
1825 @REPLY
1826 obj_handle_t handle; /* handle to the timer */
1827 @END
1830 /* Open a waitable timer */
1831 @REQ(open_timer)
1832 unsigned int access; /* wanted access rights */
1833 unsigned int attributes; /* object attributes */
1834 obj_handle_t rootdir; /* root directory */
1835 VARARG(name,unicode_str); /* object name */
1836 @REPLY
1837 obj_handle_t handle; /* handle to the timer */
1838 @END
1840 /* Set a waitable timer */
1841 @REQ(set_timer)
1842 obj_handle_t handle; /* handle to the timer */
1843 timeout_t expire; /* next expiration absolute time */
1844 client_ptr_t callback; /* callback function */
1845 client_ptr_t arg; /* callback argument */
1846 int period; /* timer period in ms */
1847 @REPLY
1848 int signaled; /* was the timer signaled before this call ? */
1849 @END
1851 /* Cancel a waitable timer */
1852 @REQ(cancel_timer)
1853 obj_handle_t handle; /* handle to the timer */
1854 @REPLY
1855 int signaled; /* was the timer signaled before this calltime ? */
1856 @END
1858 /* Get information on a waitable timer */
1859 @REQ(get_timer_info)
1860 obj_handle_t handle; /* handle to the timer */
1861 @REPLY
1862 timeout_t when; /* absolute time when the timer next expires */
1863 int signaled; /* is the timer signaled? */
1864 @END
1867 /* Retrieve the current context of a thread */
1868 @REQ(get_thread_context)
1869 obj_handle_t handle; /* thread handle */
1870 unsigned int flags; /* context flags */
1871 int suspend; /* if getting context during suspend */
1872 @REPLY
1873 int self; /* was it a handle to the current thread? */
1874 VARARG(context,context); /* thread context */
1875 @END
1878 /* Set the current context of a thread */
1879 @REQ(set_thread_context)
1880 obj_handle_t handle; /* thread handle */
1881 int suspend; /* if setting context during suspend */
1882 VARARG(context,context); /* thread context */
1883 @REPLY
1884 int self; /* was it a handle to the current thread? */
1885 @END
1888 /* Fetch a selector entry for a thread */
1889 @REQ(get_selector_entry)
1890 obj_handle_t handle; /* thread handle */
1891 int entry; /* LDT entry */
1892 @REPLY
1893 unsigned int base; /* selector base */
1894 unsigned int limit; /* selector limit */
1895 unsigned char flags; /* selector flags */
1896 @END
1899 /* Add an atom */
1900 @REQ(add_atom)
1901 obj_handle_t table; /* which table to add atom to */
1902 VARARG(name,unicode_str); /* atom name */
1903 @REPLY
1904 atom_t atom; /* resulting atom */
1905 @END
1908 /* Delete an atom */
1909 @REQ(delete_atom)
1910 obj_handle_t table; /* which table to delete atom from */
1911 atom_t atom; /* atom handle */
1912 @END
1915 /* Find an atom */
1916 @REQ(find_atom)
1917 obj_handle_t table; /* which table to find atom from */
1918 VARARG(name,unicode_str); /* atom name */
1919 @REPLY
1920 atom_t atom; /* atom handle */
1921 @END
1924 /* Get information about an atom */
1925 @REQ(get_atom_information)
1926 obj_handle_t table; /* which table to find atom from */
1927 atom_t atom; /* atom handle */
1928 @REPLY
1929 int count; /* atom lock count */
1930 int pinned; /* whether the atom has been pinned */
1931 data_size_t total; /* actual length of atom name */
1932 VARARG(name,unicode_str); /* atom name */
1933 @END
1936 /* Set information about an atom */
1937 @REQ(set_atom_information)
1938 obj_handle_t table; /* which table to find atom from */
1939 atom_t atom; /* atom handle */
1940 int pinned; /* whether to bump atom information */
1941 @END
1944 /* Empty an atom table */
1945 @REQ(empty_atom_table)
1946 obj_handle_t table; /* which table to find atom from */
1947 int if_pinned; /* whether to delete pinned atoms */
1948 @END
1951 /* Init an atom table */
1952 @REQ(init_atom_table)
1953 int entries; /* number of entries (only for local) */
1954 @REPLY
1955 obj_handle_t table; /* handle to the atom table */
1956 @END
1959 /* Get the message queue of the current thread */
1960 @REQ(get_msg_queue)
1961 @REPLY
1962 obj_handle_t handle; /* handle to the queue */
1963 @END
1966 /* Set the file descriptor associated to the current thread queue */
1967 @REQ(set_queue_fd)
1968 obj_handle_t handle; /* handle to the file descriptor */
1969 @END
1972 /* Set the current message queue wakeup mask */
1973 @REQ(set_queue_mask)
1974 unsigned int wake_mask; /* wakeup bits mask */
1975 unsigned int changed_mask; /* changed bits mask */
1976 int skip_wait; /* will we skip waiting if signaled? */
1977 @REPLY
1978 unsigned int wake_bits; /* current wake bits */
1979 unsigned int changed_bits; /* current changed bits */
1980 @END
1983 /* Get the current message queue status */
1984 @REQ(get_queue_status)
1985 int clear; /* should we clear the change bits? */
1986 @REPLY
1987 unsigned int wake_bits; /* wake bits */
1988 unsigned int changed_bits; /* changed bits since last time */
1989 @END
1992 /* Retrieve the process idle event */
1993 @REQ(get_process_idle_event)
1994 obj_handle_t handle; /* process handle */
1995 @REPLY
1996 obj_handle_t event; /* handle to idle event */
1997 @END
2000 /* Send a message to a thread queue */
2001 @REQ(send_message)
2002 thread_id_t id; /* thread id */
2003 int type; /* message type (see below) */
2004 int flags; /* message flags (see below) */
2005 user_handle_t win; /* window handle */
2006 unsigned int msg; /* message code */
2007 lparam_t wparam; /* parameters */
2008 lparam_t lparam; /* parameters */
2009 timeout_t timeout; /* timeout for reply */
2010 VARARG(data,message_data); /* message data for sent messages */
2011 @END
2013 @REQ(post_quit_message)
2014 int exit_code; /* exit code to return */
2015 @END
2017 enum message_type
2019 MSG_ASCII, /* Ascii message (from SendMessageA) */
2020 MSG_UNICODE, /* Unicode message (from SendMessageW) */
2021 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
2022 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
2023 MSG_CALLBACK_RESULT,/* result of a callback message */
2024 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
2025 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
2026 MSG_HARDWARE, /* hardware message */
2027 MSG_WINEVENT, /* winevent message */
2028 MSG_HOOK_LL /* low-level hardware hook */
2030 #define SEND_MSG_ABORT_IF_HUNG 0x01
2033 /* Send a hardware message to a thread queue */
2034 @REQ(send_hardware_message)
2035 user_handle_t win; /* window handle */
2036 hw_input_t input; /* input data */
2037 unsigned int flags; /* flags (see below) */
2038 @REPLY
2039 int wait; /* do we need to wait for a reply? */
2040 @END
2041 #define SEND_HWMSG_INJECTED 0x01
2044 /* Get a message from the current queue */
2045 @REQ(get_message)
2046 unsigned int flags; /* PM_* flags */
2047 user_handle_t get_win; /* window handle to get */
2048 unsigned int get_first; /* first message code to get */
2049 unsigned int get_last; /* last message code to get */
2050 unsigned int hw_id; /* id of the previous hardware message (or 0) */
2051 unsigned int wake_mask; /* wakeup bits mask */
2052 unsigned int changed_mask; /* changed bits mask */
2053 @REPLY
2054 user_handle_t win; /* window handle */
2055 unsigned int msg; /* message code */
2056 lparam_t wparam; /* parameters */
2057 lparam_t lparam; /* parameters */
2058 int type; /* message type */
2059 unsigned int time; /* message time */
2060 unsigned int active_hooks; /* active hooks bitmap */
2061 data_size_t total; /* total size of extra data */
2062 VARARG(data,message_data); /* message data for sent messages */
2063 @END
2066 /* Reply to a sent message */
2067 @REQ(reply_message)
2068 int remove; /* should we remove the message? */
2069 lparam_t result; /* message result */
2070 VARARG(data,bytes); /* message data for sent messages */
2071 @END
2074 /* Accept the current hardware message */
2075 @REQ(accept_hardware_message)
2076 unsigned int hw_id; /* id of the hardware message */
2077 int remove; /* should we remove the message? */
2078 user_handle_t new_win; /* new destination window for current message */
2079 @END
2082 /* Retrieve the reply for the last message sent */
2083 @REQ(get_message_reply)
2084 int cancel; /* cancel message if not ready? */
2085 @REPLY
2086 lparam_t result; /* message result */
2087 VARARG(data,bytes); /* message data for sent messages */
2088 @END
2091 /* Set a window timer */
2092 @REQ(set_win_timer)
2093 user_handle_t win; /* window handle */
2094 unsigned int msg; /* message to post */
2095 unsigned int rate; /* timer rate in ms */
2096 lparam_t id; /* timer id */
2097 lparam_t lparam; /* message lparam (callback proc) */
2098 @REPLY
2099 lparam_t id; /* timer id */
2100 @END
2103 /* Kill a window timer */
2104 @REQ(kill_win_timer)
2105 user_handle_t win; /* window handle */
2106 lparam_t id; /* timer id */
2107 unsigned int msg; /* message to post */
2108 @END
2111 /* check if the thread owning the window is hung */
2112 @REQ(is_window_hung)
2113 user_handle_t win; /* window handle */
2114 @REPLY
2115 int is_hung;
2116 @END
2119 /* Retrieve info about a serial port */
2120 @REQ(get_serial_info)
2121 obj_handle_t handle; /* handle to comm port */
2122 @REPLY
2123 unsigned int readinterval;
2124 unsigned int readconst;
2125 unsigned int readmult;
2126 unsigned int writeconst;
2127 unsigned int writemult;
2128 unsigned int eventmask;
2129 @END
2132 /* Set info about a serial port */
2133 @REQ(set_serial_info)
2134 obj_handle_t handle; /* handle to comm port */
2135 int flags; /* bitmask to set values (see below) */
2136 unsigned int readinterval;
2137 unsigned int readconst;
2138 unsigned int readmult;
2139 unsigned int writeconst;
2140 unsigned int writemult;
2141 unsigned int eventmask;
2142 @END
2143 #define SERIALINFO_SET_TIMEOUTS 0x01
2144 #define SERIALINFO_SET_MASK 0x02
2147 /* Create an async I/O */
2148 @REQ(register_async)
2149 int type; /* type of queue to look after */
2150 async_data_t async; /* async I/O parameters */
2151 int count; /* count - usually # of bytes to be read/written */
2152 @END
2153 #define ASYNC_TYPE_READ 0x01
2154 #define ASYNC_TYPE_WRITE 0x02
2155 #define ASYNC_TYPE_WAIT 0x03
2158 /* Cancel all async op on a fd */
2159 @REQ(cancel_async)
2160 obj_handle_t handle; /* handle to comm port, socket or file */
2161 client_ptr_t iosb; /* I/O status block (NULL=all) */
2162 int only_thread; /* cancel matching this thread */
2163 @END
2166 /* Perform an ioctl on a file */
2167 @REQ(ioctl)
2168 ioctl_code_t code; /* ioctl code */
2169 async_data_t async; /* async I/O parameters */
2170 int blocking; /* whether it's a blocking ioctl */
2171 VARARG(in_data,bytes); /* ioctl input data */
2172 @REPLY
2173 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2174 unsigned int options; /* device open options */
2175 VARARG(out_data,bytes); /* ioctl output data */
2176 @END
2179 /* Retrieve results of an async ioctl */
2180 @REQ(get_ioctl_result)
2181 obj_handle_t handle; /* handle to the device */
2182 client_ptr_t user_arg; /* user arg used to identify the request */
2183 @REPLY
2184 VARARG(out_data,bytes); /* ioctl output data */
2185 @END
2188 /* Create a named pipe */
2189 @REQ(create_named_pipe)
2190 unsigned int access;
2191 unsigned int attributes; /* object attributes */
2192 obj_handle_t rootdir; /* root directory */
2193 unsigned int options;
2194 unsigned int maxinstances;
2195 unsigned int outsize;
2196 unsigned int insize;
2197 timeout_t timeout;
2198 unsigned int flags;
2199 VARARG(name,unicode_str); /* pipe name */
2200 @REPLY
2201 obj_handle_t handle; /* handle to the pipe */
2202 @END
2204 /* flags in create_named_pipe and get_named_pipe_info */
2205 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2206 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2207 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2208 #define NAMED_PIPE_SERVER_END 0x8000
2211 @REQ(get_named_pipe_info)
2212 obj_handle_t handle;
2213 @REPLY
2214 unsigned int flags;
2215 unsigned int maxinstances;
2216 unsigned int instances;
2217 unsigned int outsize;
2218 unsigned int insize;
2219 @END
2222 /* Create a window */
2223 @REQ(create_window)
2224 user_handle_t parent; /* parent window */
2225 user_handle_t owner; /* owner window */
2226 atom_t atom; /* class atom */
2227 mod_handle_t instance; /* module instance */
2228 VARARG(class,unicode_str); /* class name */
2229 @REPLY
2230 user_handle_t handle; /* created window */
2231 user_handle_t parent; /* full handle of parent */
2232 user_handle_t owner; /* full handle of owner */
2233 int extra; /* number of extra bytes */
2234 client_ptr_t class_ptr; /* pointer to class in client address space */
2235 @END
2238 /* Destroy a window */
2239 @REQ(destroy_window)
2240 user_handle_t handle; /* handle to the window */
2241 @END
2244 /* Retrieve the desktop window for the current thread */
2245 @REQ(get_desktop_window)
2246 int force; /* force creation if it doesn't exist */
2247 @REPLY
2248 user_handle_t top_window; /* handle to the desktop window */
2249 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2250 @END
2253 /* Set a window owner */
2254 @REQ(set_window_owner)
2255 user_handle_t handle; /* handle to the window */
2256 user_handle_t owner; /* new owner */
2257 @REPLY
2258 user_handle_t full_owner; /* full handle of new owner */
2259 user_handle_t prev_owner; /* full handle of previous owner */
2260 @END
2263 /* Get information from a window handle */
2264 @REQ(get_window_info)
2265 user_handle_t handle; /* handle to the window */
2266 @REPLY
2267 user_handle_t full_handle; /* full 32-bit handle */
2268 user_handle_t last_active; /* last active popup */
2269 process_id_t pid; /* process owning the window */
2270 thread_id_t tid; /* thread owning the window */
2271 atom_t atom; /* class atom */
2272 int is_unicode; /* ANSI or unicode */
2273 @END
2276 /* Set some information in a window */
2277 @REQ(set_window_info)
2278 unsigned short flags; /* flags for fields to set (see below) */
2279 short int is_unicode; /* ANSI or unicode */
2280 user_handle_t handle; /* handle to the window */
2281 unsigned int style; /* window style */
2282 unsigned int ex_style; /* window extended style */
2283 unsigned int id; /* window id */
2284 mod_handle_t instance; /* creator instance */
2285 lparam_t user_data; /* user-specific data */
2286 int extra_offset; /* offset to set in extra bytes */
2287 data_size_t extra_size; /* size to set in extra bytes */
2288 lparam_t extra_value; /* value to set in extra bytes */
2289 @REPLY
2290 unsigned int old_style; /* old window style */
2291 unsigned int old_ex_style; /* old window extended style */
2292 mod_handle_t old_instance; /* old creator instance */
2293 lparam_t old_user_data; /* old user-specific data */
2294 lparam_t old_extra_value; /* old value in extra bytes */
2295 unsigned int old_id; /* old window id */
2296 @END
2297 #define SET_WIN_STYLE 0x01
2298 #define SET_WIN_EXSTYLE 0x02
2299 #define SET_WIN_ID 0x04
2300 #define SET_WIN_INSTANCE 0x08
2301 #define SET_WIN_USERDATA 0x10
2302 #define SET_WIN_EXTRA 0x20
2303 #define SET_WIN_UNICODE 0x40
2306 /* Set the parent of a window */
2307 @REQ(set_parent)
2308 user_handle_t handle; /* handle to the window */
2309 user_handle_t parent; /* handle to the parent */
2310 @REPLY
2311 user_handle_t old_parent; /* old parent window */
2312 user_handle_t full_parent; /* full handle of new parent */
2313 @END
2316 /* Get a list of the window parents, up to the root of the tree */
2317 @REQ(get_window_parents)
2318 user_handle_t handle; /* handle to the window */
2319 @REPLY
2320 int count; /* total count of parents */
2321 VARARG(parents,user_handles); /* parent handles */
2322 @END
2325 /* Get a list of the window children */
2326 @REQ(get_window_children)
2327 obj_handle_t desktop; /* handle to desktop */
2328 user_handle_t parent; /* parent window */
2329 atom_t atom; /* class atom for the listed children */
2330 thread_id_t tid; /* thread owning the listed children */
2331 VARARG(class,unicode_str); /* class name */
2332 @REPLY
2333 int count; /* total count of children */
2334 VARARG(children,user_handles); /* children handles */
2335 @END
2338 /* Get a list of the window children that contain a given point */
2339 @REQ(get_window_children_from_point)
2340 user_handle_t parent; /* parent window */
2341 int x; /* point in parent coordinates */
2342 int y;
2343 @REPLY
2344 int count; /* total count of children */
2345 VARARG(children,user_handles); /* children handles */
2346 @END
2349 /* Get window tree information from a window handle */
2350 @REQ(get_window_tree)
2351 user_handle_t handle; /* handle to the window */
2352 @REPLY
2353 user_handle_t parent; /* parent window */
2354 user_handle_t owner; /* owner window */
2355 user_handle_t next_sibling; /* next sibling in Z-order */
2356 user_handle_t prev_sibling; /* prev sibling in Z-order */
2357 user_handle_t first_sibling; /* first sibling in Z-order */
2358 user_handle_t last_sibling; /* last sibling in Z-order */
2359 user_handle_t first_child; /* first child */
2360 user_handle_t last_child; /* last child */
2361 @END
2363 /* Set the position and Z order of a window */
2364 @REQ(set_window_pos)
2365 unsigned int flags; /* SWP_* flags */
2366 user_handle_t handle; /* handle to the window */
2367 user_handle_t previous; /* previous window in Z order */
2368 rectangle_t window; /* window rectangle (in parent coords) */
2369 rectangle_t client; /* client rectangle (in parent coords) */
2370 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
2371 @REPLY
2372 unsigned int new_style; /* new window style */
2373 unsigned int new_ex_style; /* new window extended style */
2374 @END
2377 /* Get the window and client rectangles of a window */
2378 @REQ(get_window_rectangles)
2379 user_handle_t handle; /* handle to the window */
2380 int relative; /* coords relative to (see below) */
2381 @REPLY
2382 rectangle_t window; /* window rectangle */
2383 rectangle_t visible; /* visible part of the window rectangle */
2384 rectangle_t client; /* client rectangle */
2385 @END
2386 enum coords_relative
2388 COORDS_CLIENT, /* relative to client area */
2389 COORDS_WINDOW, /* relative to whole window area */
2390 COORDS_PARENT, /* relative to parent's client area */
2391 COORDS_SCREEN /* relative to screen origin */
2395 /* Get the window text */
2396 @REQ(get_window_text)
2397 user_handle_t handle; /* handle to the window */
2398 @REPLY
2399 VARARG(text,unicode_str); /* window text */
2400 @END
2403 /* Set the window text */
2404 @REQ(set_window_text)
2405 user_handle_t handle; /* handle to the window */
2406 VARARG(text,unicode_str); /* window text */
2407 @END
2410 /* Get the coordinates offset between two windows */
2411 @REQ(get_windows_offset)
2412 user_handle_t from; /* handle to the first window */
2413 user_handle_t to; /* handle to the second window */
2414 @REPLY
2415 int x; /* x coordinate offset */
2416 int y; /* y coordinate offset */
2417 int mirror; /* whether to mirror the x coordinate */
2418 @END
2421 /* Get the visible region of a window */
2422 @REQ(get_visible_region)
2423 user_handle_t window; /* handle to the window */
2424 unsigned int flags; /* DCX flags */
2425 @REPLY
2426 user_handle_t top_win; /* top window to clip against */
2427 rectangle_t top_rect; /* top window visible rect with screen coords */
2428 rectangle_t win_rect; /* window rect in screen coords */
2429 data_size_t total_size; /* total size of the resulting region */
2430 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2431 @END
2434 /* Get the window region */
2435 @REQ(get_window_region)
2436 user_handle_t window; /* handle to the window */
2437 @REPLY
2438 data_size_t total_size; /* total size of the resulting region */
2439 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2440 @END
2443 /* Set the window region */
2444 @REQ(set_window_region)
2445 user_handle_t window; /* handle to the window */
2446 int redraw; /* redraw the window? */
2447 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2448 @END
2451 /* Get the window update region */
2452 @REQ(get_update_region)
2453 user_handle_t window; /* handle to the window */
2454 user_handle_t from_child; /* child to start searching from */
2455 unsigned int flags; /* update flags (see below) */
2456 @REPLY
2457 user_handle_t child; /* child to repaint (or window itself) */
2458 unsigned int flags; /* resulting update flags (see below) */
2459 data_size_t total_size; /* total size of the resulting region */
2460 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2461 @END
2462 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2463 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2464 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2465 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2466 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2467 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2468 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2469 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2472 /* Update the z order of a window so that a given rectangle is fully visible */
2473 @REQ(update_window_zorder)
2474 user_handle_t window; /* handle to the window */
2475 rectangle_t rect; /* rectangle that must be visible (in client coords) */
2476 @END
2479 /* Mark parts of a window as needing a redraw */
2480 @REQ(redraw_window)
2481 user_handle_t window; /* handle to the window */
2482 unsigned int flags; /* RDW_* flags */
2483 VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
2484 @END
2487 /* Set a window property */
2488 @REQ(set_window_property)
2489 user_handle_t window; /* handle to the window */
2490 lparam_t data; /* data to store */
2491 atom_t atom; /* property atom (if no name specified) */
2492 VARARG(name,unicode_str); /* property name */
2493 @END
2496 /* Remove a window property */
2497 @REQ(remove_window_property)
2498 user_handle_t window; /* handle to the window */
2499 atom_t atom; /* property atom (if no name specified) */
2500 VARARG(name,unicode_str); /* property name */
2501 @REPLY
2502 lparam_t data; /* data stored in property */
2503 @END
2506 /* Get a window property */
2507 @REQ(get_window_property)
2508 user_handle_t window; /* handle to the window */
2509 atom_t atom; /* property atom (if no name specified) */
2510 VARARG(name,unicode_str); /* property name */
2511 @REPLY
2512 lparam_t data; /* data stored in property */
2513 @END
2516 /* Get the list of properties of a window */
2517 @REQ(get_window_properties)
2518 user_handle_t window; /* handle to the window */
2519 @REPLY
2520 int total; /* total number of properties */
2521 VARARG(props,properties); /* list of properties */
2522 @END
2525 /* Create a window station */
2526 @REQ(create_winstation)
2527 unsigned int flags; /* window station flags */
2528 unsigned int access; /* wanted access rights */
2529 unsigned int attributes; /* object attributes */
2530 VARARG(name,unicode_str); /* object name */
2531 @REPLY
2532 obj_handle_t handle; /* handle to the window station */
2533 @END
2536 /* Open a handle to a window station */
2537 @REQ(open_winstation)
2538 unsigned int access; /* wanted access rights */
2539 unsigned int attributes; /* object attributes */
2540 VARARG(name,unicode_str); /* object name */
2541 @REPLY
2542 obj_handle_t handle; /* handle to the window station */
2543 @END
2546 /* Close a window station */
2547 @REQ(close_winstation)
2548 obj_handle_t handle; /* handle to the window station */
2549 @END
2552 /* Get the process current window station */
2553 @REQ(get_process_winstation)
2554 @REPLY
2555 obj_handle_t handle; /* handle to the window station */
2556 @END
2559 /* Set the process current window station */
2560 @REQ(set_process_winstation)
2561 obj_handle_t handle; /* handle to the window station */
2562 @END
2565 /* Enumerate window stations */
2566 @REQ(enum_winstation)
2567 unsigned int index; /* current index */
2568 @REPLY
2569 unsigned int next; /* next index */
2570 VARARG(name,unicode_str); /* window station name */
2571 @END
2574 /* Create a desktop */
2575 @REQ(create_desktop)
2576 unsigned int flags; /* desktop flags */
2577 unsigned int access; /* wanted access rights */
2578 unsigned int attributes; /* object attributes */
2579 VARARG(name,unicode_str); /* object name */
2580 @REPLY
2581 obj_handle_t handle; /* handle to the desktop */
2582 @END
2585 /* Open a handle to a desktop */
2586 @REQ(open_desktop)
2587 obj_handle_t winsta; /* window station to open (null allowed) */
2588 unsigned int flags; /* desktop flags */
2589 unsigned int access; /* wanted access rights */
2590 unsigned int attributes; /* object attributes */
2591 VARARG(name,unicode_str); /* object name */
2592 @REPLY
2593 obj_handle_t handle; /* handle to the desktop */
2594 @END
2597 /* Close a desktop */
2598 @REQ(close_desktop)
2599 obj_handle_t handle; /* handle to the desktop */
2600 @END
2603 /* Get the thread current desktop */
2604 @REQ(get_thread_desktop)
2605 thread_id_t tid; /* thread id */
2606 @REPLY
2607 obj_handle_t handle; /* handle to the desktop */
2608 @END
2611 /* Set the thread current desktop */
2612 @REQ(set_thread_desktop)
2613 obj_handle_t handle; /* handle to the desktop */
2614 @END
2617 /* Enumerate desktops */
2618 @REQ(enum_desktop)
2619 obj_handle_t winstation; /* handle to the window station */
2620 unsigned int index; /* current index */
2621 @REPLY
2622 unsigned int next; /* next index */
2623 VARARG(name,unicode_str); /* window station name */
2624 @END
2627 /* Get/set information about a user object (window station or desktop) */
2628 @REQ(set_user_object_info)
2629 obj_handle_t handle; /* handle to the object */
2630 unsigned int flags; /* information to set */
2631 unsigned int obj_flags; /* new object flags */
2632 @REPLY
2633 int is_desktop; /* is object a desktop? */
2634 unsigned int old_obj_flags; /* old object flags */
2635 VARARG(name,unicode_str); /* object name */
2636 @END
2637 #define SET_USER_OBJECT_FLAGS 1
2640 /* Attach (or detach) thread inputs */
2641 @REQ(attach_thread_input)
2642 thread_id_t tid_from; /* thread to be attached */
2643 thread_id_t tid_to; /* thread to which tid_from should be attached */
2644 int attach; /* is it an attach? */
2645 @END
2648 /* Get input data for a given thread */
2649 @REQ(get_thread_input)
2650 thread_id_t tid; /* id of thread */
2651 @REPLY
2652 user_handle_t focus; /* handle to the focus window */
2653 user_handle_t capture; /* handle to the capture window */
2654 user_handle_t active; /* handle to the active window */
2655 user_handle_t foreground; /* handle to the global foreground window */
2656 user_handle_t menu_owner; /* handle to the menu owner */
2657 user_handle_t move_size; /* handle to the moving/resizing window */
2658 user_handle_t caret; /* handle to the caret window */
2659 user_handle_t cursor; /* handle to the cursor */
2660 int show_count; /* cursor show count */
2661 rectangle_t rect; /* caret rectangle */
2662 @END
2665 /* Get the time of the last input event */
2666 @REQ(get_last_input_time)
2667 @REPLY
2668 unsigned int time;
2669 @END
2672 /* Retrieve queue keyboard state for a given thread */
2673 @REQ(get_key_state)
2674 thread_id_t tid; /* id of thread */
2675 int key; /* optional key code or -1 */
2676 @REPLY
2677 unsigned char state; /* state of specified key */
2678 VARARG(keystate,bytes); /* state array for all the keys */
2679 @END
2681 /* Set queue keyboard state for a given thread */
2682 @REQ(set_key_state)
2683 thread_id_t tid; /* id of thread */
2684 VARARG(keystate,bytes); /* state array for all the keys */
2685 @END
2687 /* Set the system foreground window */
2688 @REQ(set_foreground_window)
2689 user_handle_t handle; /* handle to the foreground window */
2690 @REPLY
2691 user_handle_t previous; /* handle to the previous foreground window */
2692 int send_msg_old; /* whether we have to send a msg to the old window */
2693 int send_msg_new; /* whether we have to send a msg to the new window */
2694 @END
2696 /* Set the current thread focus window */
2697 @REQ(set_focus_window)
2698 user_handle_t handle; /* handle to the focus window */
2699 @REPLY
2700 user_handle_t previous; /* handle to the previous focus window */
2701 @END
2703 /* Set the current thread active window */
2704 @REQ(set_active_window)
2705 user_handle_t handle; /* handle to the active window */
2706 @REPLY
2707 user_handle_t previous; /* handle to the previous active window */
2708 @END
2710 /* Set the current thread capture window */
2711 @REQ(set_capture_window)
2712 user_handle_t handle; /* handle to the capture window */
2713 unsigned int flags; /* capture flags (see below) */
2714 @REPLY
2715 user_handle_t previous; /* handle to the previous capture window */
2716 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2717 @END
2718 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2719 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2722 /* Set the current thread caret window */
2723 @REQ(set_caret_window)
2724 user_handle_t handle; /* handle to the caret window */
2725 int width; /* caret width */
2726 int height; /* caret height */
2727 @REPLY
2728 user_handle_t previous; /* handle to the previous caret window */
2729 rectangle_t old_rect; /* previous caret rectangle */
2730 int old_hide; /* previous hide count */
2731 int old_state; /* previous caret state (1=on, 0=off) */
2732 @END
2735 /* Set the current thread caret information */
2736 @REQ(set_caret_info)
2737 unsigned int flags; /* caret flags (see below) */
2738 user_handle_t handle; /* handle to the caret window */
2739 int x; /* caret x position */
2740 int y; /* caret y position */
2741 int hide; /* increment for hide count (can be negative to show it) */
2742 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2743 @REPLY
2744 user_handle_t full_handle; /* handle to the current caret window */
2745 rectangle_t old_rect; /* previous caret rectangle */
2746 int old_hide; /* previous hide count */
2747 int old_state; /* previous caret state (1=on, 0=off) */
2748 @END
2749 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2750 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2751 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2754 /* Set a window hook */
2755 @REQ(set_hook)
2756 int id; /* id of the hook */
2757 process_id_t pid; /* id of process to set the hook into */
2758 thread_id_t tid; /* id of thread to set the hook into */
2759 int event_min;
2760 int event_max;
2761 client_ptr_t proc; /* hook procedure */
2762 int flags;
2763 int unicode; /* is it a unicode hook? */
2764 VARARG(module,unicode_str); /* module name */
2765 @REPLY
2766 user_handle_t handle; /* handle to the hook */
2767 unsigned int active_hooks; /* active hooks bitmap */
2768 @END
2771 /* Remove a window hook */
2772 @REQ(remove_hook)
2773 user_handle_t handle; /* handle to the hook */
2774 client_ptr_t proc; /* hook procedure if handle is 0 */
2775 int id; /* id of the hook if handle is 0 */
2776 @REPLY
2777 unsigned int active_hooks; /* active hooks bitmap */
2778 @END
2781 /* Start calling a hook chain */
2782 @REQ(start_hook_chain)
2783 int id; /* id of the hook */
2784 int event; /* signalled event */
2785 user_handle_t window; /* handle to the event window */
2786 int object_id; /* object id for out of context winevent */
2787 int child_id; /* child id for out of context winevent */
2788 @REPLY
2789 user_handle_t handle; /* handle to the next hook */
2790 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2791 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2792 int unicode; /* is it a unicode hook? */
2793 client_ptr_t proc; /* hook procedure */
2794 unsigned int active_hooks; /* active hooks bitmap */
2795 VARARG(module,unicode_str); /* module name */
2796 @END
2799 /* Finished calling a hook chain */
2800 @REQ(finish_hook_chain)
2801 int id; /* id of the hook */
2802 @END
2805 /* Get the hook information */
2806 @REQ(get_hook_info)
2807 user_handle_t handle; /* handle to the current hook */
2808 int get_next; /* do we want info about current or next hook? */
2809 int event; /* signalled event */
2810 user_handle_t window; /* handle to the event window */
2811 int object_id; /* object id for out of context winevent */
2812 int child_id; /* child id for out of context winevent */
2813 @REPLY
2814 user_handle_t handle; /* handle to the hook */
2815 int id; /* id of the hook */
2816 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2817 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2818 client_ptr_t proc; /* hook procedure */
2819 int unicode; /* is it a unicode hook? */
2820 VARARG(module,unicode_str); /* module name */
2821 @END
2824 /* Create a window class */
2825 @REQ(create_class)
2826 int local; /* is it a local class? */
2827 atom_t atom; /* class atom */
2828 unsigned int style; /* class style */
2829 mod_handle_t instance; /* module instance */
2830 int extra; /* number of extra class bytes */
2831 int win_extra; /* number of window extra bytes */
2832 client_ptr_t client_ptr; /* pointer to class in client address space */
2833 VARARG(name,unicode_str); /* class name */
2834 @REPLY
2835 atom_t atom; /* resulting class atom */
2836 @END
2839 /* Destroy a window class */
2840 @REQ(destroy_class)
2841 atom_t atom; /* class atom */
2842 mod_handle_t instance; /* module instance */
2843 VARARG(name,unicode_str); /* class name */
2844 @REPLY
2845 client_ptr_t client_ptr; /* pointer to class in client address space */
2846 @END
2849 /* Set some information in a class */
2850 @REQ(set_class_info)
2851 user_handle_t window; /* handle to the window */
2852 unsigned int flags; /* flags for info to set (see below) */
2853 atom_t atom; /* class atom */
2854 unsigned int style; /* class style */
2855 int win_extra; /* number of window extra bytes */
2856 mod_handle_t instance; /* module instance */
2857 int extra_offset; /* offset to set in extra bytes */
2858 data_size_t extra_size; /* size to set in extra bytes */
2859 lparam_t extra_value; /* value to set in extra bytes */
2860 @REPLY
2861 atom_t old_atom; /* previous class atom */
2862 unsigned int old_style; /* previous class style */
2863 int old_extra; /* previous number of class extra bytes */
2864 int old_win_extra; /* previous number of window extra bytes */
2865 mod_handle_t old_instance; /* previous module instance */
2866 lparam_t old_extra_value; /* old value in extra bytes */
2867 @END
2868 #define SET_CLASS_ATOM 0x0001
2869 #define SET_CLASS_STYLE 0x0002
2870 #define SET_CLASS_WINEXTRA 0x0004
2871 #define SET_CLASS_INSTANCE 0x0008
2872 #define SET_CLASS_EXTRA 0x0010
2875 /* Set/get clipboard information */
2876 @REQ(set_clipboard_info)
2877 unsigned int flags; /* flags for fields to set (see below) */
2878 user_handle_t clipboard; /* clipboard window */
2879 user_handle_t owner; /* clipboard owner */
2880 user_handle_t viewer; /* first clipboard viewer */
2881 unsigned int seqno; /* change sequence number */
2882 @REPLY
2883 unsigned int flags; /* status flags (see below) */
2884 user_handle_t old_clipboard; /* old clipboard window */
2885 user_handle_t old_owner; /* old clipboard owner */
2886 user_handle_t old_viewer; /* old clipboard viewer */
2887 unsigned int seqno; /* current sequence number */
2888 @END
2890 #define SET_CB_OPEN 0x001
2891 #define SET_CB_OWNER 0x002
2892 #define SET_CB_VIEWER 0x004
2893 #define SET_CB_SEQNO 0x008
2894 #define SET_CB_RELOWNER 0x010
2895 #define SET_CB_CLOSE 0x020
2896 #define CB_OPEN 0x040
2897 #define CB_OWNER 0x080
2898 #define CB_PROCESS 0x100
2901 /* Open a security token */
2902 @REQ(open_token)
2903 obj_handle_t handle; /* handle to the thread or process */
2904 unsigned int access; /* access rights to the new token */
2905 unsigned int attributes;/* object attributes */
2906 unsigned int flags; /* flags (see below) */
2907 @REPLY
2908 obj_handle_t token; /* handle to the token */
2909 @END
2910 #define OPEN_TOKEN_THREAD 1
2911 #define OPEN_TOKEN_AS_SELF 2
2914 /* Set/get the global windows */
2915 @REQ(set_global_windows)
2916 unsigned int flags; /* flags for fields to set (see below) */
2917 user_handle_t shell_window; /* handle to the new shell window */
2918 user_handle_t shell_listview; /* handle to the new shell listview window */
2919 user_handle_t progman_window; /* handle to the new program manager window */
2920 user_handle_t taskman_window; /* handle to the new task manager window */
2921 @REPLY
2922 user_handle_t old_shell_window; /* handle to the shell window */
2923 user_handle_t old_shell_listview; /* handle to the shell listview window */
2924 user_handle_t old_progman_window; /* handle to the new program manager window */
2925 user_handle_t old_taskman_window; /* handle to the new task manager window */
2926 @END
2927 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2928 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2929 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2931 /* Adjust the privileges held by a token */
2932 @REQ(adjust_token_privileges)
2933 obj_handle_t handle; /* handle to the token */
2934 int disable_all; /* disable all privileges? */
2935 int get_modified_state; /* get modified privileges? */
2936 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2937 @REPLY
2938 unsigned int len; /* total length in bytes required to store token privileges */
2939 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2940 @END
2942 /* Retrieves the set of privileges held by or available to a token */
2943 @REQ(get_token_privileges)
2944 obj_handle_t handle; /* handle to the token */
2945 @REPLY
2946 unsigned int len; /* total length in bytes required to store token privileges */
2947 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2948 @END
2950 /* Check the token has the required privileges */
2951 @REQ(check_token_privileges)
2952 obj_handle_t handle; /* handle to the token */
2953 int all_required; /* are all the privileges required for the check to succeed? */
2954 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2955 @REPLY
2956 int has_privileges; /* does the token have the required privileges? */
2957 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2958 @END
2960 @REQ(duplicate_token)
2961 obj_handle_t handle; /* handle to the token to duplicate */
2962 unsigned int access; /* access rights to the new token */
2963 unsigned int attributes; /* object attributes */
2964 int primary; /* is the new token to be a primary one? */
2965 int impersonation_level; /* impersonation level of the new token */
2966 @REPLY
2967 obj_handle_t new_handle; /* duplicated handle */
2968 @END
2970 @REQ(access_check)
2971 obj_handle_t handle; /* handle to the token */
2972 unsigned int desired_access; /* desired access to the object */
2973 unsigned int mapping_read; /* mapping from generic read to specific rights */
2974 unsigned int mapping_write; /* mapping from generic write to specific rights */
2975 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2976 unsigned int mapping_all; /* mapping from generic all to specific rights */
2977 VARARG(sd,security_descriptor); /* security descriptor to check */
2978 @REPLY
2979 unsigned int access_granted; /* access rights actually granted */
2980 unsigned int access_status; /* was access granted? */
2981 unsigned int privileges_len; /* length needed to store privileges */
2982 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2983 @END
2985 @REQ(get_token_sid)
2986 obj_handle_t handle; /* handle to the token */
2987 unsigned int which_sid; /* which SID to retrieve from the token */
2988 @REPLY
2989 data_size_t sid_len; /* length needed to store sid */
2990 VARARG(sid,SID); /* the sid specified by which_sid from the token */
2991 @END
2993 @REQ(get_token_groups)
2994 obj_handle_t handle; /* handle to the token */
2995 @REPLY
2996 data_size_t user_len; /* length needed to store user */
2997 VARARG(user,token_groups); /* groups the token's user belongs to */
2998 @END
3000 @REQ(get_token_default_dacl)
3001 obj_handle_t handle; /* handle to the token */
3002 @REPLY
3003 data_size_t acl_len; /* length needed to store access control list */
3004 VARARG(acl,ACL); /* access control list */
3005 @END
3007 @REQ(set_token_default_dacl)
3008 obj_handle_t handle; /* handle to the token */
3009 VARARG(acl,ACL); /* default dacl to set */
3010 @END
3012 @REQ(set_security_object)
3013 obj_handle_t handle; /* handle to the object */
3014 unsigned int security_info; /* which parts of security descriptor to set */
3015 VARARG(sd,security_descriptor); /* security descriptor to set */
3016 @END
3018 @REQ(get_security_object)
3019 obj_handle_t handle; /* handle to the object */
3020 unsigned int security_info; /* which parts of security descriptor to get */
3021 @REPLY
3022 unsigned int sd_len; /* buffer size needed for sd */
3023 VARARG(sd,security_descriptor); /* retrieved security descriptor */
3024 @END
3026 /* Create a mailslot */
3027 @REQ(create_mailslot)
3028 unsigned int access; /* wanted access rights */
3029 unsigned int attributes; /* object attributes */
3030 obj_handle_t rootdir; /* root directory */
3031 timeout_t read_timeout;
3032 unsigned int max_msgsize;
3033 VARARG(name,unicode_str); /* mailslot name */
3034 @REPLY
3035 obj_handle_t handle; /* handle to the mailslot */
3036 @END
3039 /* Set mailslot information */
3040 @REQ(set_mailslot_info)
3041 obj_handle_t handle; /* handle to the mailslot */
3042 timeout_t read_timeout;
3043 unsigned int flags;
3044 @REPLY
3045 timeout_t read_timeout;
3046 unsigned int max_msgsize;
3047 @END
3048 #define MAILSLOT_SET_READ_TIMEOUT 1
3051 /* Create a directory object */
3052 @REQ(create_directory)
3053 unsigned int access; /* access flags */
3054 unsigned int attributes; /* object attributes */
3055 obj_handle_t rootdir; /* root directory */
3056 VARARG(directory_name,unicode_str); /* Directory name */
3057 @REPLY
3058 obj_handle_t handle; /* handle to the directory */
3059 @END
3062 /* Open a directory object */
3063 @REQ(open_directory)
3064 unsigned int access; /* access flags */
3065 unsigned int attributes; /* object attributes */
3066 obj_handle_t rootdir; /* root directory */
3067 VARARG(directory_name,unicode_str); /* Directory name */
3068 @REPLY
3069 obj_handle_t handle; /* handle to the directory */
3070 @END
3073 /* Get a directory entry by index */
3074 @REQ(get_directory_entry)
3075 obj_handle_t handle; /* handle to the directory */
3076 unsigned int index; /* entry index */
3077 @REPLY
3078 data_size_t name_len; /* length of the entry name in bytes */
3079 VARARG(name,unicode_str,name_len); /* entry name */
3080 VARARG(type,unicode_str); /* entry type */
3081 @END
3084 /* Create a symbolic link object */
3085 @REQ(create_symlink)
3086 unsigned int access; /* access flags */
3087 unsigned int attributes; /* object attributes */
3088 obj_handle_t rootdir; /* root directory */
3089 data_size_t name_len; /* length of the symlink name in bytes */
3090 VARARG(name,unicode_str,name_len); /* symlink name */
3091 VARARG(target_name,unicode_str); /* target name */
3092 @REPLY
3093 obj_handle_t handle; /* handle to the symlink */
3094 @END
3097 /* Open a symbolic link object */
3098 @REQ(open_symlink)
3099 unsigned int access; /* access flags */
3100 unsigned int attributes; /* object attributes */
3101 obj_handle_t rootdir; /* root directory */
3102 VARARG(name,unicode_str); /* symlink name */
3103 @REPLY
3104 obj_handle_t handle; /* handle to the symlink */
3105 @END
3108 /* Query a symbolic link object */
3109 @REQ(query_symlink)
3110 obj_handle_t handle; /* handle to the symlink */
3111 @REPLY
3112 data_size_t total; /* total needed size for name */
3113 VARARG(target_name,unicode_str); /* target name */
3114 @END
3117 /* Query basic object information */
3118 @REQ(get_object_info)
3119 obj_handle_t handle; /* handle to the object */
3120 @REPLY
3121 unsigned int access; /* granted access mask */
3122 unsigned int ref_count; /* object ref count */
3123 data_size_t total; /* total needed size for name */
3124 VARARG(name,unicode_str); /* object name */
3125 @END
3128 /* Unlink a named object */
3129 @REQ(unlink_object)
3130 obj_handle_t handle; /* handle to the object */
3131 @END
3134 /* Query the impersonation level of an impersonation token */
3135 @REQ(get_token_impersonation_level)
3136 obj_handle_t handle; /* handle to the object */
3137 @REPLY
3138 int impersonation_level; /* impersonation level of the impersonation token */
3139 @END
3141 /* Allocate a locally-unique identifier */
3142 @REQ(allocate_locally_unique_id)
3143 @REPLY
3144 luid_t luid;
3145 @END
3148 /* Create a device manager */
3149 @REQ(create_device_manager)
3150 unsigned int access; /* wanted access rights */
3151 unsigned int attributes; /* object attributes */
3152 @REPLY
3153 obj_handle_t handle; /* handle to the device */
3154 @END
3157 /* Create a device */
3158 @REQ(create_device)
3159 unsigned int access; /* wanted access rights */
3160 unsigned int attributes; /* object attributes */
3161 obj_handle_t rootdir; /* root directory */
3162 client_ptr_t user_ptr; /* opaque ptr for use by client */
3163 obj_handle_t manager; /* device manager */
3164 VARARG(name,unicode_str); /* object name */
3165 @REPLY
3166 obj_handle_t handle; /* handle to the device */
3167 @END
3170 /* Delete a device */
3171 @REQ(delete_device)
3172 obj_handle_t handle; /* handle to the device */
3173 @END
3176 /* Retrieve the next pending device ioctl request */
3177 @REQ(get_next_device_request)
3178 obj_handle_t manager; /* handle to the device manager */
3179 obj_handle_t prev; /* handle to the previous ioctl */
3180 unsigned int status; /* status of the previous ioctl */
3181 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3182 @REPLY
3183 obj_handle_t next; /* handle to the next ioctl */
3184 ioctl_code_t code; /* ioctl code */
3185 client_ptr_t user_ptr; /* opaque ptr for the device */
3186 data_size_t in_size; /* total needed input size */
3187 data_size_t out_size; /* needed output size */
3188 VARARG(next_data,bytes); /* input data of the next ioctl */
3189 @END
3192 /* Make the current process a system process */
3193 @REQ(make_process_system)
3194 @REPLY
3195 obj_handle_t event; /* event signaled when all user processes have exited */
3196 @END
3199 /* Get detailed fixed-size information about a token */
3200 @REQ(get_token_statistics)
3201 obj_handle_t handle; /* handle to the object */
3202 @REPLY
3203 luid_t token_id; /* locally-unique identifier of the token */
3204 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3205 int primary; /* is the token primary or impersonation? */
3206 int impersonation_level; /* level of impersonation */
3207 int group_count; /* the number of groups the token is a member of */
3208 int privilege_count; /* the number of privileges the token has */
3209 @END
3212 /* Create I/O completion port */
3213 @REQ(create_completion)
3214 unsigned int access; /* desired access to a port */
3215 unsigned int attributes; /* object attributes */
3216 unsigned int concurrent; /* max number of concurrent active threads */
3217 obj_handle_t rootdir; /* root directory */
3218 VARARG(filename,string); /* port name */
3219 @REPLY
3220 obj_handle_t handle; /* port handle */
3221 @END
3224 /* Open I/O completion port */
3225 @REQ(open_completion)
3226 unsigned int access; /* desired access to a port */
3227 unsigned int attributes; /* object attributes */
3228 obj_handle_t rootdir; /* root directory */
3229 VARARG(filename,string); /* port name */
3230 @REPLY
3231 obj_handle_t handle; /* port handle */
3232 @END
3235 /* add completion to completion port */
3236 @REQ(add_completion)
3237 obj_handle_t handle; /* port handle */
3238 apc_param_t ckey; /* completion key */
3239 apc_param_t cvalue; /* completion value */
3240 unsigned int information; /* IO_STATUS_BLOCK Information */
3241 unsigned int status; /* completion result */
3242 @END
3245 /* get completion from completion port queue */
3246 @REQ(remove_completion)
3247 obj_handle_t handle; /* port handle */
3248 @REPLY
3249 apc_param_t ckey; /* completion key */
3250 apc_param_t cvalue; /* completion value */
3251 unsigned int information; /* IO_STATUS_BLOCK Information */
3252 unsigned int status; /* completion result */
3253 @END
3256 /* get completion queue depth */
3257 @REQ(query_completion)
3258 obj_handle_t handle; /* port handle */
3259 @REPLY
3260 unsigned int depth; /* completion queue depth */
3261 @END
3264 /* associate object with completion port */
3265 @REQ(set_completion_info)
3266 obj_handle_t handle; /* object handle */
3267 apc_param_t ckey; /* completion key */
3268 obj_handle_t chandle; /* port handle */
3269 @END
3272 /* check for associated completion and push msg */
3273 @REQ(add_fd_completion)
3274 obj_handle_t handle; /* async' object */
3275 apc_param_t cvalue; /* completion value */
3276 unsigned int status; /* completion status */
3277 unsigned int information; /* IO_STATUS_BLOCK Information */
3278 @END
3281 /* Retrieve layered info for a window */
3282 @REQ(get_window_layered_info)
3283 user_handle_t handle; /* handle to the window */
3284 @REPLY
3285 unsigned int color_key; /* color key */
3286 unsigned int alpha; /* alpha (0..255) */
3287 unsigned int flags; /* LWA_* flags */
3288 @END
3291 /* Set layered info for a window */
3292 @REQ(set_window_layered_info)
3293 user_handle_t handle; /* handle to the window */
3294 unsigned int color_key; /* color key */
3295 unsigned int alpha; /* alpha (0..255) */
3296 unsigned int flags; /* LWA_* flags */
3297 @END
3300 /* Allocate an arbitrary user handle */
3301 @REQ(alloc_user_handle)
3302 @REPLY
3303 user_handle_t handle; /* allocated handle */
3304 @END
3307 /* Free an arbitrary user handle */
3308 @REQ(free_user_handle)
3309 user_handle_t handle; /* handle to free*/
3310 @END
3313 /* Set/get the current cursor */
3314 @REQ(set_cursor)
3315 unsigned int flags; /* flags for fields to set (see below) */
3316 user_handle_t handle; /* handle to the cursor */
3317 int show_count; /* show count increment/decrement */
3318 int x; /* cursor position */
3319 int y;
3320 rectangle_t clip; /* cursor clip rectangle */
3321 @REPLY
3322 user_handle_t prev_handle; /* previous handle */
3323 int prev_count; /* previous show count */
3324 int new_x; /* new position */
3325 int new_y;
3326 rectangle_t new_clip; /* new clip rectangle */
3327 @END
3328 #define SET_CURSOR_HANDLE 0x01
3329 #define SET_CURSOR_COUNT 0x02
3330 #define SET_CURSOR_POS 0x04
3331 #define SET_CURSOR_CLIP 0x08