ws2_32: General AcceptEx Implemenetation. - No Data_length support
[wine/hacks.git] / server / protocol.def
blob104a9266487167238157f4bd3f40249863f74886
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[20]; /* 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 int unicode; /* is it Unicode? */
135 client_ptr_t string; /* string to display (in debugged process address space) */
136 data_size_t length; /* string length */
137 } output_string;
138 struct
140 int code; /* RIP_EVENT */
141 int error; /* ??? */
142 int type; /* ??? */
143 } rip_info;
144 } debug_event_t;
146 /* supported CPU types */
147 enum cpu_type
149 CPU_x86, CPU_x86_64, CPU_ALPHA, CPU_POWERPC, CPU_SPARC
151 typedef int cpu_type_t;
153 /* context data */
154 typedef struct
156 cpu_type_t cpu; /* cpu type */
157 unsigned int flags; /* SERVER_CTX_* flags */
158 union
160 struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
161 struct { unsigned __int64 rip, rbp, rsp;
162 unsigned int cs, ss, flags, mxcsr; } x86_64_regs;
163 struct { unsigned __int64 fir;
164 unsigned int psr; } alpha_regs;
165 struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_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 g[8], o[8], l[8], i[8]; } sparc_regs;
177 } integer; /* selected by SERVER_CTX_INTEGER */
178 union
180 struct { unsigned int ds, es, fs, gs; } i386_regs;
181 struct { unsigned int ds, es, fs, gs; } x86_64_regs;
182 } seg; /* selected by SERVER_CTX_SEGMENTS */
183 union
185 struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
186 unsigned char regs[80]; } i386_regs;
187 struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
188 struct { unsigned __int64 f[32], fpcr, softfpcr; } alpha_regs;
189 struct { double fpr[32], fpscr; } powerpc_regs;
190 } fp; /* selected by SERVER_CTX_FLOATING_POINT */
191 union
193 struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
194 struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
195 struct { unsigned int dr[8]; } powerpc_regs;
196 } debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
197 union
199 unsigned char i386_regs[512];
200 } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */
201 } context_t;
203 #define SERVER_CTX_CONTROL 0x01
204 #define SERVER_CTX_INTEGER 0x02
205 #define SERVER_CTX_SEGMENTS 0x04
206 #define SERVER_CTX_FLOATING_POINT 0x08
207 #define SERVER_CTX_DEBUG_REGISTERS 0x10
208 #define SERVER_CTX_EXTENDED_REGISTERS 0x20
210 /* structure used in sending an fd from client to server */
211 struct send_fd
213 thread_id_t tid; /* thread id */
214 int fd; /* file descriptor on client-side */
217 /* structure sent by the server on the wait fifo */
218 struct wake_up_reply
220 client_ptr_t cookie; /* magic cookie that was passed in select_request */
221 int signaled; /* wait result */
222 int __pad;
225 /* NT-style timeout, in 100ns units, negative means relative timeout */
226 typedef __int64 timeout_t;
227 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
229 /* structure returned in the list of window properties */
230 typedef struct
232 atom_t atom; /* property atom */
233 int string; /* was atom a string originally? */
234 lparam_t data; /* data stored in property */
235 } property_data_t;
237 /* structure to specify window rectangles */
238 typedef struct
240 int left;
241 int top;
242 int right;
243 int bottom;
244 } rectangle_t;
246 /* structure for parameters of async I/O calls */
247 typedef struct
249 obj_handle_t handle; /* object to perform I/O on */
250 obj_handle_t event; /* event to signal when done */
251 client_ptr_t callback; /* client-side callback to call upon end of async */
252 client_ptr_t iosb; /* I/O status block in client addr space */
253 client_ptr_t arg; /* opaque user data to pass to callback */
254 apc_param_t cvalue; /* completion value to use for completion events */
255 } async_data_t;
257 /* structures for extra message data */
259 struct hardware_msg_data
261 lparam_t info; /* extra info */
262 int x; /* x position */
263 int y; /* y position */
264 unsigned int hw_id; /* unique id */
265 int __pad;
268 struct callback_msg_data
270 client_ptr_t callback; /* callback function */
271 lparam_t data; /* user data for callback */
272 lparam_t result; /* message result */
275 struct winevent_msg_data
277 user_handle_t hook; /* hook handle */
278 thread_id_t tid; /* thread id */
279 client_ptr_t hook_proc; /* hook proc address */
280 /* followed by module name if any */
283 typedef union
285 unsigned char bytes[1]; /* raw data for sent messages */
286 struct hardware_msg_data hardware;
287 struct callback_msg_data callback;
288 struct winevent_msg_data winevent;
289 } message_data_t;
291 /* structure for console char/attribute info */
292 typedef struct
294 WCHAR ch;
295 unsigned short attr;
296 } char_info_t;
298 typedef struct
300 unsigned int low_part;
301 int high_part;
302 } luid_t;
304 #define MAX_ACL_LEN 65535
306 struct security_descriptor
308 unsigned int control; /* SE_ flags */
309 data_size_t owner_len;
310 data_size_t group_len;
311 data_size_t sacl_len;
312 data_size_t dacl_len;
313 /* VARARG(owner,SID); */
314 /* VARARG(group,SID); */
315 /* VARARG(sacl,ACL); */
316 /* VARARG(dacl,ACL); */
319 struct object_attributes
321 obj_handle_t rootdir; /* root directory */
322 data_size_t sd_len; /* length of security_descriptor data. may be 0 */
323 data_size_t name_len; /* length of the name string. may be 0 */
324 /* VARARG(sd,security_descriptor); */
325 /* VARARG(name,unicode_str); */
328 struct token_groups
330 unsigned int count;
331 /* unsigned int attributes[count]; */
332 /* VARARG(sids,SID); */
335 enum apc_type
337 APC_NONE,
338 APC_USER,
339 APC_TIMER,
340 APC_ASYNC_IO,
341 APC_VIRTUAL_ALLOC,
342 APC_VIRTUAL_FREE,
343 APC_VIRTUAL_QUERY,
344 APC_VIRTUAL_PROTECT,
345 APC_VIRTUAL_FLUSH,
346 APC_VIRTUAL_LOCK,
347 APC_VIRTUAL_UNLOCK,
348 APC_MAP_VIEW,
349 APC_UNMAP_VIEW,
350 APC_CREATE_THREAD
353 typedef union
355 enum apc_type type;
356 struct
358 enum apc_type type; /* APC_USER */
359 int __pad;
360 client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
361 apc_param_t args[3]; /* arguments for user function */
362 } user;
363 struct
365 enum apc_type type; /* APC_TIMER */
366 int __pad;
367 client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
368 timeout_t time; /* absolute time of expiration */
369 client_ptr_t arg; /* user argument */
370 } timer;
371 struct
373 enum apc_type type; /* APC_ASYNC_IO */
374 unsigned int status; /* I/O status */
375 client_ptr_t func; /* unsigned int (*func)(void*, void*, unsigned int, void **); */
376 client_ptr_t user; /* user pointer */
377 client_ptr_t sb; /* status block */
378 } async_io;
379 struct
381 enum apc_type type; /* APC_VIRTUAL_ALLOC */
382 unsigned int op_type; /* type of operation */
383 client_ptr_t addr; /* requested address */
384 mem_size_t size; /* allocation size */
385 unsigned int zero_bits; /* allocation alignment */
386 unsigned int prot; /* memory protection flags */
387 } virtual_alloc;
388 struct
390 enum apc_type type; /* APC_VIRTUAL_FREE */
391 unsigned int op_type; /* type of operation */
392 client_ptr_t addr; /* requested address */
393 mem_size_t size; /* allocation size */
394 } virtual_free;
395 struct
397 enum apc_type type; /* APC_VIRTUAL_QUERY */
398 int __pad;
399 client_ptr_t addr; /* requested address */
400 } virtual_query;
401 struct
403 enum apc_type type; /* APC_VIRTUAL_PROTECT */
404 unsigned int prot; /* new protection flags */
405 client_ptr_t addr; /* requested address */
406 mem_size_t size; /* requested size */
407 } virtual_protect;
408 struct
410 enum apc_type type; /* APC_VIRTUAL_FLUSH */
411 int __pad;
412 client_ptr_t addr; /* requested address */
413 mem_size_t size; /* requested size */
414 } virtual_flush;
415 struct
417 enum apc_type type; /* APC_VIRTUAL_LOCK */
418 int __pad;
419 client_ptr_t addr; /* requested address */
420 mem_size_t size; /* requested size */
421 } virtual_lock;
422 struct
424 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
425 int __pad;
426 client_ptr_t addr; /* requested address */
427 mem_size_t size; /* requested size */
428 } virtual_unlock;
429 struct
431 enum apc_type type; /* APC_MAP_VIEW */
432 obj_handle_t handle; /* mapping handle */
433 client_ptr_t addr; /* requested address */
434 mem_size_t size; /* allocation size */
435 file_pos_t offset; /* file offset */
436 unsigned int alloc_type;/* allocation type */
437 unsigned short zero_bits; /* allocation alignment */
438 unsigned short prot; /* memory protection flags */
439 } map_view;
440 struct
442 enum apc_type type; /* APC_UNMAP_VIEW */
443 int __pad;
444 client_ptr_t addr; /* view address */
445 } unmap_view;
446 struct
448 enum apc_type type; /* APC_CREATE_THREAD */
449 int suspend; /* suspended thread? */
450 client_ptr_t func; /* void (__stdcall *func)(void*); start function */
451 client_ptr_t arg; /* argument for start function */
452 mem_size_t reserve; /* reserve size for thread stack */
453 mem_size_t commit; /* commit size for thread stack */
454 } create_thread;
455 } apc_call_t;
457 typedef union
459 enum apc_type type;
460 struct
462 enum apc_type type; /* APC_ASYNC_IO */
463 unsigned int status; /* new status of async operation */
464 client_ptr_t apc; /* user APC to call */
465 unsigned int total; /* bytes transferred */
466 } async_io;
467 struct
469 enum apc_type type; /* APC_VIRTUAL_ALLOC */
470 unsigned int status; /* status returned by call */
471 client_ptr_t addr; /* resulting address */
472 mem_size_t size; /* resulting size */
473 } virtual_alloc;
474 struct
476 enum apc_type type; /* APC_VIRTUAL_FREE */
477 unsigned int status; /* status returned by call */
478 client_ptr_t addr; /* resulting address */
479 mem_size_t size; /* resulting size */
480 } virtual_free;
481 struct
483 enum apc_type type; /* APC_VIRTUAL_QUERY */
484 unsigned int status; /* status returned by call */
485 client_ptr_t base; /* resulting base address */
486 client_ptr_t alloc_base;/* resulting allocation base */
487 mem_size_t size; /* resulting region size */
488 unsigned short state; /* resulting region state */
489 unsigned short prot; /* resulting region protection */
490 unsigned short alloc_prot;/* resulting allocation protection */
491 unsigned short alloc_type;/* resulting region allocation type */
492 } virtual_query;
493 struct
495 enum apc_type type; /* APC_VIRTUAL_PROTECT */
496 unsigned int status; /* status returned by call */
497 client_ptr_t addr; /* resulting address */
498 mem_size_t size; /* resulting size */
499 unsigned int prot; /* old protection flags */
500 } virtual_protect;
501 struct
503 enum apc_type type; /* APC_VIRTUAL_FLUSH */
504 unsigned int status; /* status returned by call */
505 client_ptr_t addr; /* resulting address */
506 mem_size_t size; /* resulting size */
507 } virtual_flush;
508 struct
510 enum apc_type type; /* APC_VIRTUAL_LOCK */
511 unsigned int status; /* status returned by call */
512 client_ptr_t addr; /* resulting address */
513 mem_size_t size; /* resulting size */
514 } virtual_lock;
515 struct
517 enum apc_type type; /* APC_VIRTUAL_UNLOCK */
518 unsigned int status; /* status returned by call */
519 client_ptr_t addr; /* resulting address */
520 mem_size_t size; /* resulting size */
521 } virtual_unlock;
522 struct
524 enum apc_type type; /* APC_MAP_VIEW */
525 unsigned int status; /* status returned by call */
526 client_ptr_t addr; /* resulting address */
527 mem_size_t size; /* resulting size */
528 } map_view;
529 struct
531 enum apc_type type; /* APC_MAP_VIEW */
532 unsigned int status; /* status returned by call */
533 } unmap_view;
534 struct
536 enum apc_type type; /* APC_CREATE_THREAD */
537 unsigned int status; /* status returned by call */
538 thread_id_t tid; /* thread id */
539 obj_handle_t handle; /* handle to new thread */
540 } create_thread;
541 } apc_result_t;
543 /****************************************************************/
544 /* Request declarations */
546 /* Create a new process from the context of the parent */
547 @REQ(new_process)
548 int inherit_all; /* inherit all handles from parent */
549 unsigned int create_flags; /* creation flags */
550 int socket_fd; /* file descriptor for process socket */
551 obj_handle_t exe_file; /* file handle for main exe */
552 obj_handle_t hstdin; /* handle for stdin */
553 obj_handle_t hstdout; /* handle for stdout */
554 obj_handle_t hstderr; /* handle for stderr */
555 unsigned int process_access; /* access rights for process object */
556 unsigned int process_attr; /* attributes for process object */
557 unsigned int thread_access; /* access rights for thread object */
558 unsigned int thread_attr; /* attributes for thread object */
559 VARARG(info,startup_info); /* startup information */
560 VARARG(env,unicode_str); /* environment for new process */
561 @REPLY
562 obj_handle_t info; /* new process info handle */
563 process_id_t pid; /* process id */
564 obj_handle_t phandle; /* process handle (in the current process) */
565 thread_id_t tid; /* thread id */
566 obj_handle_t thandle; /* thread handle (in the current process) */
567 @END
570 /* Retrieve information about a newly started process */
571 @REQ(get_new_process_info)
572 obj_handle_t info; /* info handle returned from new_process_request */
573 @REPLY
574 int success; /* did the process start successfully? */
575 int exit_code; /* process exit code if failed */
576 @END
579 /* Create a new thread from the context of the parent */
580 @REQ(new_thread)
581 unsigned int access; /* wanted access rights */
582 unsigned int attributes; /* object attributes */
583 int suspend; /* new thread should be suspended on creation */
584 int request_fd; /* fd for request pipe */
585 @REPLY
586 thread_id_t tid; /* thread id */
587 obj_handle_t handle; /* thread handle (in the current process) */
588 @END
591 /* Retrieve the new process startup info */
592 @REQ(get_startup_info)
593 @REPLY
594 obj_handle_t exe_file; /* file handle for main exe */
595 obj_handle_t hstdin; /* handle for stdin */
596 obj_handle_t hstdout; /* handle for stdout */
597 obj_handle_t hstderr; /* handle for stderr */
598 VARARG(info,startup_info); /* startup information */
599 VARARG(env,unicode_str); /* environment */
600 @END
603 /* Signal the end of the process initialization */
604 @REQ(init_process_done)
605 int gui; /* is it a GUI process? */
606 mod_handle_t module; /* main module base address */
607 client_ptr_t ldt_copy; /* address of LDT copy (in thread address space) */
608 client_ptr_t entry; /* process entry point */
609 @END
612 /* Initialize a thread; called from the child after fork()/clone() */
613 @REQ(init_thread)
614 int unix_pid; /* Unix pid of new thread */
615 int unix_tid; /* Unix tid of new thread */
616 int debug_level; /* new debug level */
617 client_ptr_t teb; /* TEB of new thread (in thread address space) */
618 client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
619 int reply_fd; /* fd for reply pipe */
620 int wait_fd; /* fd for blocking calls pipe */
621 cpu_type_t cpu; /* CPU that this thread is running on */
622 @REPLY
623 process_id_t pid; /* process id of the new thread's process */
624 thread_id_t tid; /* thread id of the new thread */
625 timeout_t server_start; /* server start time */
626 data_size_t info_size; /* total size of startup info */
627 int version; /* protocol version */
628 unsigned int all_cpus; /* bitset of supported CPUs */
629 @END
632 /* Terminate a process */
633 @REQ(terminate_process)
634 obj_handle_t handle; /* process handle to terminate */
635 int exit_code; /* process exit code */
636 @REPLY
637 int self; /* suicide? */
638 @END
641 /* Terminate a thread */
642 @REQ(terminate_thread)
643 obj_handle_t handle; /* thread handle to terminate */
644 int exit_code; /* thread exit code */
645 @REPLY
646 int self; /* suicide? */
647 int last; /* last thread in this process? */
648 @END
651 /* Retrieve information about a process */
652 @REQ(get_process_info)
653 obj_handle_t handle; /* process handle */
654 @REPLY
655 process_id_t pid; /* server process id */
656 process_id_t ppid; /* server process id of parent */
657 affinity_t affinity; /* process affinity mask */
658 client_ptr_t peb; /* PEB address in process address space */
659 timeout_t start_time; /* process start time */
660 timeout_t end_time; /* process end time */
661 int exit_code; /* process exit code */
662 int priority; /* priority class */
663 @END
666 /* Set a process informations */
667 @REQ(set_process_info)
668 obj_handle_t handle; /* process handle */
669 int mask; /* setting mask (see below) */
670 int priority; /* priority class */
671 affinity_t affinity; /* affinity mask */
672 @END
673 #define SET_PROCESS_INFO_PRIORITY 0x01
674 #define SET_PROCESS_INFO_AFFINITY 0x02
677 /* Retrieve information about a thread */
678 @REQ(get_thread_info)
679 obj_handle_t handle; /* thread handle */
680 thread_id_t tid_in; /* thread id (optional) */
681 @REPLY
682 process_id_t pid; /* server process id */
683 thread_id_t tid; /* server thread id */
684 client_ptr_t teb; /* thread teb pointer */
685 affinity_t affinity; /* thread affinity mask */
686 timeout_t creation_time; /* thread creation time */
687 timeout_t exit_time; /* thread exit time */
688 int exit_code; /* thread exit code */
689 int priority; /* thread priority level */
690 int last; /* last thread in process */
691 @END
694 /* Set a thread informations */
695 @REQ(set_thread_info)
696 obj_handle_t handle; /* thread handle */
697 int mask; /* setting mask (see below) */
698 int priority; /* priority class */
699 affinity_t affinity; /* affinity mask */
700 obj_handle_t token; /* impersonation token */
701 @END
702 #define SET_THREAD_INFO_PRIORITY 0x01
703 #define SET_THREAD_INFO_AFFINITY 0x02
704 #define SET_THREAD_INFO_TOKEN 0x04
707 /* Retrieve information about a module */
708 @REQ(get_dll_info)
709 obj_handle_t handle; /* process handle */
710 mod_handle_t base_address; /* base address of module */
711 @REPLY
712 client_ptr_t entry_point;
713 data_size_t size; /* module size */
714 data_size_t filename_len; /* buffer len in bytes required to store filename */
715 VARARG(filename,unicode_str); /* file name of module */
716 @END
719 /* Suspend a thread */
720 @REQ(suspend_thread)
721 obj_handle_t handle; /* thread handle */
722 @REPLY
723 int count; /* new suspend count */
724 @END
727 /* Resume a thread */
728 @REQ(resume_thread)
729 obj_handle_t handle; /* thread handle */
730 @REPLY
731 int count; /* new suspend count */
732 @END
735 /* Notify the server that a dll has been loaded */
736 @REQ(load_dll)
737 obj_handle_t handle; /* file handle */
738 mod_handle_t base; /* base address */
739 client_ptr_t name; /* ptr to ptr to name (in process addr space) */
740 data_size_t size; /* dll size */
741 int dbg_offset; /* debug info offset */
742 int dbg_size; /* debug info size */
743 VARARG(filename,unicode_str); /* file name of dll */
744 @END
747 /* Notify the server that a dll is being unloaded */
748 @REQ(unload_dll)
749 mod_handle_t base; /* base address */
750 @END
753 /* Queue an APC for a thread or process */
754 @REQ(queue_apc)
755 obj_handle_t handle; /* thread or process handle */
756 apc_call_t call; /* call arguments */
757 @REPLY
758 obj_handle_t handle; /* APC handle */
759 int self; /* run APC in caller itself? */
760 @END
763 /* Get the result of an APC call */
764 @REQ(get_apc_result)
765 obj_handle_t handle; /* handle to the APC */
766 @REPLY
767 apc_result_t result; /* result of the APC */
768 @END
771 /* Close a handle for the current process */
772 @REQ(close_handle)
773 obj_handle_t handle; /* handle to close */
774 @END
777 /* Set a handle information */
778 @REQ(set_handle_info)
779 obj_handle_t handle; /* handle we are interested in */
780 int flags; /* new handle flags */
781 int mask; /* mask for flags to set */
782 @REPLY
783 int old_flags; /* old flag value */
784 @END
787 /* Duplicate a handle */
788 @REQ(dup_handle)
789 obj_handle_t src_process; /* src process handle */
790 obj_handle_t src_handle; /* src handle to duplicate */
791 obj_handle_t dst_process; /* dst process handle */
792 unsigned int access; /* wanted access rights */
793 unsigned int attributes; /* object attributes */
794 unsigned int options; /* duplicate options (see below) */
795 @REPLY
796 obj_handle_t handle; /* duplicated handle in dst process */
797 int self; /* is the source the current process? */
798 int closed; /* whether the source handle has been closed */
799 @END
800 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
801 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
802 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
805 /* Open a handle to a process */
806 @REQ(open_process)
807 process_id_t pid; /* process id to open */
808 unsigned int access; /* wanted access rights */
809 unsigned int attributes; /* object attributes */
810 @REPLY
811 obj_handle_t handle; /* handle to the process */
812 @END
815 /* Open a handle to a thread */
816 @REQ(open_thread)
817 thread_id_t tid; /* thread id to open */
818 unsigned int access; /* wanted access rights */
819 unsigned int attributes; /* object attributes */
820 @REPLY
821 obj_handle_t handle; /* handle to the thread */
822 @END
825 /* Wait for handles */
826 @REQ(select)
827 int flags; /* wait flags (see below) */
828 client_ptr_t cookie; /* magic cookie to return to client */
829 obj_handle_t signal; /* object to signal (0 if none) */
830 obj_handle_t prev_apc; /* handle to previous APC */
831 timeout_t timeout; /* timeout */
832 VARARG(result,apc_result); /* result of previous APC */
833 VARARG(handles,handles); /* handles to select on */
834 @REPLY
835 timeout_t timeout; /* timeout converted to absolute */
836 apc_call_t call; /* APC call arguments */
837 obj_handle_t apc_handle; /* handle to next APC */
838 @END
839 #define SELECT_ALL 1
840 #define SELECT_ALERTABLE 2
841 #define SELECT_INTERRUPTIBLE 4
844 /* Create an event */
845 @REQ(create_event)
846 unsigned int access; /* wanted access rights */
847 unsigned int attributes; /* object attributes */
848 int manual_reset; /* manual reset event */
849 int initial_state; /* initial state of the event */
850 VARARG(objattr,object_attributes); /* object attributes */
851 @REPLY
852 obj_handle_t handle; /* handle to the event */
853 @END
855 /* Event operation */
856 @REQ(event_op)
857 obj_handle_t handle; /* handle to event */
858 int op; /* event operation (see below) */
859 @END
860 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
863 /* Open an event */
864 @REQ(open_event)
865 unsigned int access; /* wanted access rights */
866 unsigned int attributes; /* object attributes */
867 obj_handle_t rootdir; /* root directory */
868 VARARG(name,unicode_str); /* object name */
869 @REPLY
870 obj_handle_t handle; /* handle to the event */
871 @END
874 /* Create a mutex */
875 @REQ(create_mutex)
876 unsigned int access; /* wanted access rights */
877 unsigned int attributes; /* object attributes */
878 int owned; /* initially owned? */
879 VARARG(objattr,object_attributes); /* object attributes */
880 @REPLY
881 obj_handle_t handle; /* handle to the mutex */
882 @END
885 /* Release a mutex */
886 @REQ(release_mutex)
887 obj_handle_t handle; /* handle to the mutex */
888 @REPLY
889 unsigned int prev_count; /* value of internal counter, before release */
890 @END
893 /* Open a mutex */
894 @REQ(open_mutex)
895 unsigned int access; /* wanted access rights */
896 unsigned int attributes; /* object attributes */
897 obj_handle_t rootdir; /* root directory */
898 VARARG(name,unicode_str); /* object name */
899 @REPLY
900 obj_handle_t handle; /* handle to the mutex */
901 @END
904 /* Create a semaphore */
905 @REQ(create_semaphore)
906 unsigned int access; /* wanted access rights */
907 unsigned int attributes; /* object attributes */
908 unsigned int initial; /* initial count */
909 unsigned int max; /* maximum count */
910 VARARG(objattr,object_attributes); /* object attributes */
911 @REPLY
912 obj_handle_t handle; /* handle to the semaphore */
913 @END
916 /* Release a semaphore */
917 @REQ(release_semaphore)
918 obj_handle_t handle; /* handle to the semaphore */
919 unsigned int count; /* count to add to semaphore */
920 @REPLY
921 unsigned int prev_count; /* previous semaphore count */
922 @END
925 /* Open a semaphore */
926 @REQ(open_semaphore)
927 unsigned int access; /* wanted access rights */
928 unsigned int attributes; /* object attributes */
929 obj_handle_t rootdir; /* root directory */
930 VARARG(name,unicode_str); /* object name */
931 @REPLY
932 obj_handle_t handle; /* handle to the semaphore */
933 @END
936 /* Create a file */
937 @REQ(create_file)
938 unsigned int access; /* wanted access rights */
939 unsigned int attributes; /* object attributes */
940 unsigned int sharing; /* sharing flags */
941 int create; /* file create action */
942 unsigned int options; /* file options */
943 unsigned int attrs; /* file attributes for creation */
944 VARARG(objattr,object_attributes); /* object attributes */
945 VARARG(filename,string); /* file name */
946 @REPLY
947 obj_handle_t handle; /* handle to the file */
948 @END
951 /* Open a file object */
952 @REQ(open_file_object)
953 unsigned int access; /* wanted access rights */
954 unsigned int attributes; /* open attributes */
955 obj_handle_t rootdir; /* root directory */
956 unsigned int sharing; /* sharing flags */
957 unsigned int options; /* file options */
958 VARARG(filename,unicode_str); /* file name */
959 @REPLY
960 obj_handle_t handle; /* handle to the file */
961 @END
964 /* Allocate a file handle for a Unix fd */
965 @REQ(alloc_file_handle)
966 unsigned int access; /* wanted access rights */
967 unsigned int attributes; /* object attributes */
968 int fd; /* file descriptor on the client side */
969 @REPLY
970 obj_handle_t handle; /* handle to the file */
971 @END
974 /* Get a Unix fd to access a file */
975 @REQ(get_handle_fd)
976 obj_handle_t handle; /* handle to the file */
977 @REPLY
978 int type; /* file type (see below) */
979 int removable; /* is file removable? */
980 unsigned int access; /* file access rights */
981 unsigned int options; /* file open options */
982 @END
983 enum server_fd_type
985 FD_TYPE_INVALID, /* invalid file (no associated fd) */
986 FD_TYPE_FILE, /* regular file */
987 FD_TYPE_DIR, /* directory */
988 FD_TYPE_SOCKET, /* socket */
989 FD_TYPE_SERIAL, /* serial port */
990 FD_TYPE_PIPE, /* named pipe */
991 FD_TYPE_MAILSLOT, /* mailslot */
992 FD_TYPE_CHAR, /* unspecified char device */
993 FD_TYPE_DEVICE, /* Windows device file */
994 FD_TYPE_NB_TYPES
998 /* Flush a file buffers */
999 @REQ(flush_file)
1000 obj_handle_t handle; /* handle to the file */
1001 @REPLY
1002 obj_handle_t event; /* event set when finished */
1003 @END
1006 /* Lock a region of a file */
1007 @REQ(lock_file)
1008 obj_handle_t handle; /* handle to the file */
1009 file_pos_t offset; /* offset of start of lock */
1010 file_pos_t count; /* count of bytes to lock */
1011 int shared; /* shared or exclusive lock? */
1012 int wait; /* do we want to wait? */
1013 @REPLY
1014 obj_handle_t handle; /* handle to wait on */
1015 int overlapped; /* is it an overlapped I/O handle? */
1016 @END
1019 /* Unlock a region of a file */
1020 @REQ(unlock_file)
1021 obj_handle_t handle; /* handle to the file */
1022 file_pos_t offset; /* offset of start of unlock */
1023 file_pos_t count; /* count of bytes to unlock */
1024 @END
1027 /* Create a socket */
1028 @REQ(create_socket)
1029 unsigned int access; /* wanted access rights */
1030 unsigned int attributes; /* object attributes */
1031 int family; /* family, see socket manpage */
1032 int type; /* type, see socket manpage */
1033 int protocol; /* protocol, see socket manpage */
1034 unsigned int flags; /* socket flags */
1035 @REPLY
1036 obj_handle_t handle; /* handle to the new socket */
1037 @END
1040 /* Accept a socket */
1041 @REQ(accept_socket)
1042 obj_handle_t lhandle; /* handle to the listening socket */
1043 obj_handle_t ahandle; /* handle to the accepting socket */
1044 unsigned int access; /* wanted access rights */
1045 unsigned int attributes; /* object attributes */
1046 @REPLY
1047 obj_handle_t handle; /* handle to the new socket */
1048 @END
1051 /* Set socket event parameters */
1052 @REQ(set_socket_event)
1053 obj_handle_t handle; /* handle to the socket */
1054 unsigned int mask; /* event mask */
1055 obj_handle_t event; /* event object */
1056 user_handle_t window; /* window to send the message to */
1057 unsigned int msg; /* message to send */
1058 @END
1060 /* Set socket listener */
1061 @REQ(set_socket_listener)
1062 obj_handle_t handle; /* handle to the socket */
1063 obj_handle_t hListen; /* handle to the socket listening for connections */
1064 @END
1066 /* Get socket event parameters */
1067 @REQ(get_socket_event)
1068 obj_handle_t handle; /* handle to the socket */
1069 int service; /* clear pending? */
1070 obj_handle_t c_event; /* event to clear */
1071 @REPLY
1072 unsigned int mask; /* event mask */
1073 unsigned int pmask; /* pending events */
1074 unsigned int state; /* status bits */
1075 VARARG(errors,ints); /* event errors */
1076 @END
1079 /* Reenable pending socket events */
1080 @REQ(enable_socket_event)
1081 obj_handle_t handle; /* handle to the socket */
1082 unsigned int mask; /* events to re-enable */
1083 unsigned int sstate; /* status bits to set */
1084 unsigned int cstate; /* status bits to clear */
1085 @END
1087 @REQ(set_socket_deferred)
1088 obj_handle_t handle; /* handle to the socket */
1089 obj_handle_t deferred; /* handle to the socket for which accept() is deferred */
1090 @END
1092 /* Allocate a console (only used by a console renderer) */
1093 @REQ(alloc_console)
1094 unsigned int access; /* wanted access rights */
1095 unsigned int attributes; /* object attributes */
1096 process_id_t pid; /* pid of process which shall be attached to the console */
1097 @REPLY
1098 obj_handle_t handle_in; /* handle to console input */
1099 obj_handle_t event; /* handle to renderer events change notification */
1100 @END
1103 /* Free the console of the current process */
1104 @REQ(free_console)
1105 @END
1108 #define CONSOLE_RENDERER_NONE_EVENT 0x00
1109 #define CONSOLE_RENDERER_TITLE_EVENT 0x01
1110 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT 0x02
1111 #define CONSOLE_RENDERER_SB_RESIZE_EVENT 0x03
1112 #define CONSOLE_RENDERER_UPDATE_EVENT 0x04
1113 #define CONSOLE_RENDERER_CURSOR_POS_EVENT 0x05
1114 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
1115 #define CONSOLE_RENDERER_DISPLAY_EVENT 0x07
1116 #define CONSOLE_RENDERER_EXIT_EVENT 0x08
1117 struct console_renderer_event
1119 short event;
1120 union
1122 struct update
1124 short top;
1125 short bottom;
1126 } update;
1127 struct resize
1129 short width;
1130 short height;
1131 } resize;
1132 struct cursor_pos
1134 short x;
1135 short y;
1136 } cursor_pos;
1137 struct cursor_geom
1139 short visible;
1140 short size;
1141 } cursor_geom;
1142 struct display
1144 short left;
1145 short top;
1146 short width;
1147 short height;
1148 } display;
1149 } u;
1152 /* retrieve console events for the renderer */
1153 @REQ(get_console_renderer_events)
1154 obj_handle_t handle; /* handle to console input events */
1155 @REPLY
1156 VARARG(data,bytes); /* the various console_renderer_events */
1157 @END
1160 /* Open a handle to the process console */
1161 @REQ(open_console)
1162 obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */
1163 /* otherwise console_in handle to get active screen buffer? */
1164 unsigned int access; /* wanted access rights */
1165 unsigned int attributes; /* object attributes */
1166 int share; /* share mask (only for output handles) */
1167 @REPLY
1168 obj_handle_t handle; /* handle to the console */
1169 @END
1172 /* Get the input queue wait event */
1173 @REQ(get_console_wait_event)
1174 @REPLY
1175 obj_handle_t handle;
1176 @END
1178 /* Get a console mode (input or output) */
1179 @REQ(get_console_mode)
1180 obj_handle_t handle; /* handle to the console */
1181 @REPLY
1182 int mode; /* console mode */
1183 @END
1186 /* Set a console mode (input or output) */
1187 @REQ(set_console_mode)
1188 obj_handle_t handle; /* handle to the console */
1189 int mode; /* console mode */
1190 @END
1193 /* Set info about a console (input only) */
1194 @REQ(set_console_input_info)
1195 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1196 int mask; /* setting mask (see below) */
1197 obj_handle_t active_sb; /* active screen buffer */
1198 int history_mode; /* whether we duplicate lines in history */
1199 int history_size; /* number of lines in history */
1200 int edition_mode; /* index to the edition mode flavors */
1201 int input_cp; /* console input codepage */
1202 int output_cp; /* console output codepage */
1203 user_handle_t win; /* console window if backend supports it */
1204 VARARG(title,unicode_str); /* console title */
1205 @END
1206 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB 0x01
1207 #define SET_CONSOLE_INPUT_INFO_TITLE 0x02
1208 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE 0x04
1209 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE 0x08
1210 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE 0x10
1211 #define SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE 0x20
1212 #define SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE 0x40
1213 #define SET_CONSOLE_INPUT_INFO_WIN 0x80
1216 /* Get info about a console (input only) */
1217 @REQ(get_console_input_info)
1218 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1219 @REPLY
1220 int history_mode; /* whether we duplicate lines in history */
1221 int history_size; /* number of lines in history */
1222 int history_index; /* number of used lines in history */
1223 int edition_mode; /* index to the edition mode flavors */
1224 int input_cp; /* console input codepage */
1225 int output_cp; /* console output codepage */
1226 user_handle_t win; /* console window if backend supports it */
1227 VARARG(title,unicode_str); /* console title */
1228 @END
1231 /* appends a string to console's history */
1232 @REQ(append_console_input_history)
1233 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1234 VARARG(line,unicode_str); /* line to add */
1235 @END
1238 /* appends a string to console's history */
1239 @REQ(get_console_input_history)
1240 obj_handle_t handle; /* handle to console input, or 0 for process' console */
1241 int index; /* index to get line from */
1242 @REPLY
1243 int total; /* total length of line in Unicode chars */
1244 VARARG(line,unicode_str); /* line to add */
1245 @END
1248 /* creates a new screen buffer on process' console */
1249 @REQ(create_console_output)
1250 obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
1251 unsigned int access; /* wanted access rights */
1252 unsigned int attributes; /* object attributes */
1253 unsigned int share; /* sharing credentials */
1254 @REPLY
1255 obj_handle_t handle_out; /* handle to the screen buffer */
1256 @END
1259 /* Set info about a console (output only) */
1260 @REQ(set_console_output_info)
1261 obj_handle_t handle; /* handle to the console */
1262 int mask; /* setting mask (see below) */
1263 short int cursor_size; /* size of cursor (percentage filled) */
1264 short int cursor_visible;/* cursor visibility flag */
1265 short int cursor_x; /* position of cursor (x, y) */
1266 short int cursor_y;
1267 short int width; /* width of the screen buffer */
1268 short int height; /* height of the screen buffer */
1269 short int attr; /* default attribute */
1270 short int win_left; /* window actually displayed by renderer */
1271 short int win_top; /* the rect area is expressed withing the */
1272 short int win_right; /* boundaries of the screen buffer */
1273 short int win_bottom;
1274 short int max_width; /* maximum size (width x height) for the window */
1275 short int max_height;
1276 @END
1277 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
1278 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
1279 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04
1280 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
1281 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
1282 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
1285 /* Get info about a console (output only) */
1286 @REQ(get_console_output_info)
1287 obj_handle_t handle; /* handle to the console */
1288 @REPLY
1289 short int cursor_size; /* size of cursor (percentage filled) */
1290 short int cursor_visible;/* cursor visibility flag */
1291 short int cursor_x; /* position of cursor (x, y) */
1292 short int cursor_y;
1293 short int width; /* width of the screen buffer */
1294 short int height; /* height of the screen buffer */
1295 short int attr; /* default attribute */
1296 short int win_left; /* window actually displayed by renderer */
1297 short int win_top; /* the rect area is expressed withing the */
1298 short int win_right; /* boundaries of the screen buffer */
1299 short int win_bottom;
1300 short int max_width; /* maximum size (width x height) for the window */
1301 short int max_height;
1302 @END
1304 /* Add input records to a console input queue */
1305 @REQ(write_console_input)
1306 obj_handle_t handle; /* handle to the console input */
1307 VARARG(rec,input_records); /* input records */
1308 @REPLY
1309 int written; /* number of records written */
1310 @END
1313 /* Fetch input records from a console input queue */
1314 @REQ(read_console_input)
1315 obj_handle_t handle; /* handle to the console input */
1316 int flush; /* flush the retrieved records from the queue? */
1317 @REPLY
1318 int read; /* number of records read */
1319 VARARG(rec,input_records); /* input records */
1320 @END
1323 /* write data (chars and/or attributes) in a screen buffer */
1324 @REQ(write_console_output)
1325 obj_handle_t handle; /* handle to the console output */
1326 int x; /* position where to start writing */
1327 int y;
1328 int mode; /* char info (see below) */
1329 int wrap; /* wrap around at end of line? */
1330 VARARG(data,bytes); /* info to write */
1331 @REPLY
1332 int written; /* number of char infos actually written */
1333 int width; /* width of screen buffer */
1334 int height; /* height of screen buffer */
1335 @END
1336 enum char_info_mode
1338 CHAR_INFO_MODE_TEXT, /* characters only */
1339 CHAR_INFO_MODE_ATTR, /* attributes only */
1340 CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */
1341 CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */
1345 /* fill a screen buffer with constant data (chars and/or attributes) */
1346 @REQ(fill_console_output)
1347 obj_handle_t handle; /* handle to the console output */
1348 int x; /* position where to start writing */
1349 int y;
1350 int mode; /* char info mode */
1351 int count; /* number to write */
1352 int wrap; /* wrap around at end of line? */
1353 char_info_t data; /* data to write */
1354 @REPLY
1355 int written; /* number of char infos actually written */
1356 @END
1359 /* read data (chars and/or attributes) from a screen buffer */
1360 @REQ(read_console_output)
1361 obj_handle_t handle; /* handle to the console output */
1362 int x; /* position (x,y) where to start reading */
1363 int y;
1364 int mode; /* char info mode */
1365 int wrap; /* wrap around at end of line? */
1366 @REPLY
1367 int width; /* width of screen buffer */
1368 int height; /* height of screen buffer */
1369 VARARG(data,bytes);
1370 @END
1373 /* move a rect (of data) in screen buffer content */
1374 @REQ(move_console_output)
1375 obj_handle_t handle; /* handle to the console output */
1376 short int x_src; /* position (x, y) of rect to start moving from */
1377 short int y_src;
1378 short int x_dst; /* position (x, y) of rect to move to */
1379 short int y_dst;
1380 short int w; /* size of the rect (width, height) to move */
1381 short int h;
1382 @END
1385 /* Sends a signal to a process group */
1386 @REQ(send_console_signal)
1387 int signal; /* the signal to send */
1388 process_id_t group_id; /* the group to send the signal to */
1389 @END
1392 /* enable directory change notifications */
1393 @REQ(read_directory_changes)
1394 unsigned int filter; /* notification filter */
1395 int subtree; /* watch the subtree? */
1396 int want_data; /* flag indicating whether change data should be collected */
1397 async_data_t async; /* async I/O parameters */
1398 @END
1401 @REQ(read_change)
1402 obj_handle_t handle;
1403 @REPLY
1404 int action; /* type of change */
1405 VARARG(name,string); /* name of directory entry that changed */
1406 @END
1409 /* Create a file mapping */
1410 @REQ(create_mapping)
1411 unsigned int access; /* wanted access rights */
1412 unsigned int attributes; /* object attributes */
1413 unsigned int protect; /* protection flags (see below) */
1414 mem_size_t size; /* mapping size */
1415 obj_handle_t file_handle; /* file handle */
1416 VARARG(objattr,object_attributes); /* object attributes */
1417 @REPLY
1418 obj_handle_t handle; /* handle to the mapping */
1419 @END
1420 /* per-page protection flags */
1421 #define VPROT_READ 0x01
1422 #define VPROT_WRITE 0x02
1423 #define VPROT_EXEC 0x04
1424 #define VPROT_WRITECOPY 0x08
1425 #define VPROT_GUARD 0x10
1426 #define VPROT_NOCACHE 0x20
1427 #define VPROT_COMMITTED 0x40
1428 #define VPROT_WRITEWATCH 0x80
1429 /* per-mapping protection flags */
1430 #define VPROT_IMAGE 0x0100 /* mapping for an exe image */
1431 #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
1432 #define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
1433 #define VPROT_NOEXEC 0x0800 /* don't force exec permission */
1436 /* Open a mapping */
1437 @REQ(open_mapping)
1438 unsigned int access; /* wanted access rights */
1439 unsigned int attributes; /* object attributes */
1440 obj_handle_t rootdir; /* root directory */
1441 VARARG(name,unicode_str); /* object name */
1442 @REPLY
1443 obj_handle_t handle; /* handle to the mapping */
1444 @END
1447 /* Get information about a file mapping */
1448 @REQ(get_mapping_info)
1449 obj_handle_t handle; /* handle to the mapping */
1450 unsigned int access; /* wanted access rights */
1451 @REPLY
1452 mem_size_t size; /* mapping size */
1453 int protect; /* protection flags */
1454 int header_size; /* header size (for VPROT_IMAGE mapping) */
1455 client_ptr_t base; /* default base addr (for VPROT_IMAGE mapping) */
1456 obj_handle_t mapping; /* duplicate mapping handle unless removable */
1457 obj_handle_t shared_file; /* shared mapping file handle */
1458 @END
1461 /* Get a range of committed pages in a file mapping */
1462 @REQ(get_mapping_committed_range)
1463 obj_handle_t handle; /* handle to the mapping */
1464 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1465 @REPLY
1466 mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
1467 int committed; /* whether it is a committed range */
1468 @END
1471 /* Add a range to the committed pages in a file mapping */
1472 @REQ(add_mapping_committed_range)
1473 obj_handle_t handle; /* handle to the mapping */
1474 file_pos_t offset; /* starting offset (page-aligned, in bytes) */
1475 mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
1476 @END
1479 #define SNAP_PROCESS 0x00000001
1480 #define SNAP_THREAD 0x00000002
1481 /* Create a snapshot */
1482 @REQ(create_snapshot)
1483 unsigned int attributes; /* object attributes */
1484 unsigned int flags; /* snapshot flags (SNAP_*) */
1485 @REPLY
1486 obj_handle_t handle; /* handle to the snapshot */
1487 @END
1490 /* Get the next process from a snapshot */
1491 @REQ(next_process)
1492 obj_handle_t handle; /* handle to the snapshot */
1493 int reset; /* reset snapshot position? */
1494 @REPLY
1495 int count; /* process usage count */
1496 process_id_t pid; /* process id */
1497 process_id_t ppid; /* parent process id */
1498 int threads; /* number of threads */
1499 int priority; /* process priority */
1500 int handles; /* number of handles */
1501 VARARG(filename,unicode_str); /* file name of main exe */
1502 @END
1505 /* Get the next thread from a snapshot */
1506 @REQ(next_thread)
1507 obj_handle_t handle; /* handle to the snapshot */
1508 int reset; /* reset snapshot position? */
1509 @REPLY
1510 int count; /* thread usage count */
1511 process_id_t pid; /* process id */
1512 thread_id_t tid; /* thread id */
1513 int base_pri; /* base priority */
1514 int delta_pri; /* delta priority */
1515 @END
1518 /* Wait for a debug event */
1519 @REQ(wait_debug_event)
1520 int get_handle; /* should we alloc a handle for waiting? */
1521 @REPLY
1522 process_id_t pid; /* process id */
1523 thread_id_t tid; /* thread id */
1524 obj_handle_t wait; /* wait handle if no event ready */
1525 VARARG(event,debug_event); /* debug event data */
1526 @END
1529 /* Queue an exception event */
1530 @REQ(queue_exception_event)
1531 int first; /* first chance exception? */
1532 unsigned int code; /* exception code */
1533 unsigned int flags; /* exception flags */
1534 client_ptr_t record; /* exception record */
1535 client_ptr_t address; /* exception address */
1536 data_size_t len; /* size of parameters */
1537 VARARG(params,uints64,len);/* exception parameters */
1538 VARARG(context,context); /* thread context */
1539 @REPLY
1540 obj_handle_t handle; /* handle to the queued event */
1541 @END
1544 /* Retrieve the status of an exception event */
1545 @REQ(get_exception_status)
1546 obj_handle_t handle; /* handle to the queued event */
1547 @REPLY
1548 VARARG(context,context); /* modified thread context */
1549 @END
1552 /* Send an output string to the debugger */
1553 @REQ(output_debug_string)
1554 data_size_t length; /* string length */
1555 client_ptr_t string; /* string to display (in debugged process address space) */
1556 int unicode; /* is it Unicode? */
1557 @END
1560 /* Continue a debug event */
1561 @REQ(continue_debug_event)
1562 process_id_t pid; /* process id to continue */
1563 thread_id_t tid; /* thread id to continue */
1564 int status; /* continuation status */
1565 @END
1568 /* Start/stop debugging an existing process */
1569 @REQ(debug_process)
1570 process_id_t pid; /* id of the process to debug */
1571 int attach; /* 1=attaching / 0=detaching from the process */
1572 @END
1575 /* Simulate a breakpoint in a process */
1576 @REQ(debug_break)
1577 obj_handle_t handle; /* process handle */
1578 @REPLY
1579 int self; /* was it the caller itself? */
1580 @END
1583 /* Set debugger kill on exit flag */
1584 @REQ(set_debugger_kill_on_exit)
1585 int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
1586 @END
1589 /* Read data from a process address space */
1590 @REQ(read_process_memory)
1591 obj_handle_t handle; /* process handle */
1592 client_ptr_t addr; /* addr to read from */
1593 @REPLY
1594 VARARG(data,bytes); /* result data */
1595 @END
1598 /* Write data to a process address space */
1599 @REQ(write_process_memory)
1600 obj_handle_t handle; /* process handle */
1601 client_ptr_t addr; /* addr to write to */
1602 VARARG(data,bytes); /* data to write */
1603 @END
1606 /* Create a registry key */
1607 @REQ(create_key)
1608 obj_handle_t parent; /* handle to the parent key */
1609 unsigned int access; /* desired access rights */
1610 unsigned int attributes; /* object attributes */
1611 unsigned int options; /* creation options */
1612 data_size_t namelen; /* length of key name in bytes */
1613 VARARG(name,unicode_str,namelen); /* key name */
1614 VARARG(class,unicode_str); /* class name */
1615 @REPLY
1616 obj_handle_t hkey; /* handle to the created key */
1617 int created; /* has it been newly created? */
1618 @END
1620 /* Open a registry key */
1621 @REQ(open_key)
1622 obj_handle_t parent; /* handle to the parent key */
1623 unsigned int access; /* desired access rights */
1624 unsigned int attributes; /* object attributes */
1625 VARARG(name,unicode_str); /* key name */
1626 @REPLY
1627 obj_handle_t hkey; /* handle to the open key */
1628 @END
1631 /* Delete a registry key */
1632 @REQ(delete_key)
1633 obj_handle_t hkey; /* handle to the key */
1634 @END
1637 /* Flush a registry key */
1638 @REQ(flush_key)
1639 obj_handle_t hkey; /* handle to the key */
1640 @END
1643 /* Enumerate registry subkeys */
1644 @REQ(enum_key)
1645 obj_handle_t hkey; /* handle to registry key */
1646 int index; /* index of subkey (or -1 for current key) */
1647 int info_class; /* requested information class */
1648 @REPLY
1649 int subkeys; /* number of subkeys */
1650 int max_subkey; /* longest subkey name */
1651 int max_class; /* longest class name */
1652 int values; /* number of values */
1653 int max_value; /* longest value name */
1654 int max_data; /* longest value data */
1655 timeout_t modif; /* last modification time */
1656 data_size_t total; /* total length needed for full name and class */
1657 data_size_t namelen; /* length of key name in bytes */
1658 VARARG(name,unicode_str,namelen); /* key name */
1659 VARARG(class,unicode_str); /* class name */
1660 @END
1663 /* Set a value of a registry key */
1664 @REQ(set_key_value)
1665 obj_handle_t hkey; /* handle to registry key */
1666 int type; /* value type */
1667 data_size_t namelen; /* length of value name in bytes */
1668 VARARG(name,unicode_str,namelen); /* value name */
1669 VARARG(data,bytes); /* value data */
1670 @END
1673 /* Retrieve the value of a registry key */
1674 @REQ(get_key_value)
1675 obj_handle_t hkey; /* handle to registry key */
1676 VARARG(name,unicode_str); /* value name */
1677 @REPLY
1678 int type; /* value type */
1679 data_size_t total; /* total length needed for data */
1680 VARARG(data,bytes); /* value data */
1681 @END
1684 /* Enumerate a value of a registry key */
1685 @REQ(enum_key_value)
1686 obj_handle_t hkey; /* handle to registry key */
1687 int index; /* value index */
1688 int info_class; /* requested information class */
1689 @REPLY
1690 int type; /* value type */
1691 data_size_t total; /* total length needed for full name and data */
1692 data_size_t namelen; /* length of value name in bytes */
1693 VARARG(name,unicode_str,namelen); /* value name */
1694 VARARG(data,bytes); /* value data */
1695 @END
1698 /* Delete a value of a registry key */
1699 @REQ(delete_key_value)
1700 obj_handle_t hkey; /* handle to registry key */
1701 VARARG(name,unicode_str); /* value name */
1702 @END
1705 /* Load a registry branch from a file */
1706 @REQ(load_registry)
1707 obj_handle_t hkey; /* root key to load to */
1708 obj_handle_t file; /* file to load from */
1709 VARARG(name,unicode_str); /* subkey name */
1710 @END
1713 /* UnLoad a registry branch from a file */
1714 @REQ(unload_registry)
1715 obj_handle_t hkey; /* root key to unload to */
1716 @END
1719 /* Save a registry branch to a file */
1720 @REQ(save_registry)
1721 obj_handle_t hkey; /* key to save */
1722 obj_handle_t file; /* file to save to */
1723 @END
1726 /* Add a registry key change notification */
1727 @REQ(set_registry_notification)
1728 obj_handle_t hkey; /* key to watch for changes */
1729 obj_handle_t event; /* event to set */
1730 int subtree; /* should we watch the whole subtree? */
1731 unsigned int filter; /* things to watch */
1732 @END
1735 /* Create a waitable timer */
1736 @REQ(create_timer)
1737 unsigned int access; /* wanted access rights */
1738 unsigned int attributes; /* object attributes */
1739 obj_handle_t rootdir; /* root directory */
1740 int manual; /* manual reset */
1741 VARARG(name,unicode_str); /* object name */
1742 @REPLY
1743 obj_handle_t handle; /* handle to the timer */
1744 @END
1747 /* Open a waitable timer */
1748 @REQ(open_timer)
1749 unsigned int access; /* wanted access rights */
1750 unsigned int attributes; /* object attributes */
1751 obj_handle_t rootdir; /* root directory */
1752 VARARG(name,unicode_str); /* object name */
1753 @REPLY
1754 obj_handle_t handle; /* handle to the timer */
1755 @END
1757 /* Set a waitable timer */
1758 @REQ(set_timer)
1759 obj_handle_t handle; /* handle to the timer */
1760 timeout_t expire; /* next expiration absolute time */
1761 client_ptr_t callback; /* callback function */
1762 client_ptr_t arg; /* callback argument */
1763 int period; /* timer period in ms */
1764 @REPLY
1765 int signaled; /* was the timer signaled before this call ? */
1766 @END
1768 /* Cancel a waitable timer */
1769 @REQ(cancel_timer)
1770 obj_handle_t handle; /* handle to the timer */
1771 @REPLY
1772 int signaled; /* was the timer signaled before this calltime ? */
1773 @END
1775 /* Get information on a waitable timer */
1776 @REQ(get_timer_info)
1777 obj_handle_t handle; /* handle to the timer */
1778 @REPLY
1779 timeout_t when; /* absolute time when the timer next expires */
1780 int signaled; /* is the timer signaled? */
1781 @END
1784 /* Retrieve the current context of a thread */
1785 @REQ(get_thread_context)
1786 obj_handle_t handle; /* thread handle */
1787 unsigned int flags; /* context flags */
1788 int suspend; /* if getting context during suspend */
1789 @REPLY
1790 int self; /* was it a handle to the current thread? */
1791 VARARG(context,context); /* thread context */
1792 @END
1795 /* Set the current context of a thread */
1796 @REQ(set_thread_context)
1797 obj_handle_t handle; /* thread handle */
1798 int suspend; /* if setting context during suspend */
1799 VARARG(context,context); /* thread context */
1800 @REPLY
1801 int self; /* was it a handle to the current thread? */
1802 @END
1805 /* Fetch a selector entry for a thread */
1806 @REQ(get_selector_entry)
1807 obj_handle_t handle; /* thread handle */
1808 int entry; /* LDT entry */
1809 @REPLY
1810 unsigned int base; /* selector base */
1811 unsigned int limit; /* selector limit */
1812 unsigned char flags; /* selector flags */
1813 @END
1816 /* Add an atom */
1817 @REQ(add_atom)
1818 obj_handle_t table; /* which table to add atom to */
1819 VARARG(name,unicode_str); /* atom name */
1820 @REPLY
1821 atom_t atom; /* resulting atom */
1822 @END
1825 /* Delete an atom */
1826 @REQ(delete_atom)
1827 obj_handle_t table; /* which table to delete atom from */
1828 atom_t atom; /* atom handle */
1829 @END
1832 /* Find an atom */
1833 @REQ(find_atom)
1834 obj_handle_t table; /* which table to find atom from */
1835 VARARG(name,unicode_str); /* atom name */
1836 @REPLY
1837 atom_t atom; /* atom handle */
1838 @END
1841 /* Get information about an atom */
1842 @REQ(get_atom_information)
1843 obj_handle_t table; /* which table to find atom from */
1844 atom_t atom; /* atom handle */
1845 @REPLY
1846 int count; /* atom lock count */
1847 int pinned; /* whether the atom has been pinned */
1848 data_size_t total; /* actual length of atom name */
1849 VARARG(name,unicode_str); /* atom name */
1850 @END
1853 /* Set information about an atom */
1854 @REQ(set_atom_information)
1855 obj_handle_t table; /* which table to find atom from */
1856 atom_t atom; /* atom handle */
1857 int pinned; /* whether to bump atom information */
1858 @END
1861 /* Empty an atom table */
1862 @REQ(empty_atom_table)
1863 obj_handle_t table; /* which table to find atom from */
1864 int if_pinned; /* whether to delete pinned atoms */
1865 @END
1868 /* Init an atom table */
1869 @REQ(init_atom_table)
1870 int entries; /* number of entries (only for local) */
1871 @REPLY
1872 obj_handle_t table; /* handle to the atom table */
1873 @END
1876 /* Get the message queue of the current thread */
1877 @REQ(get_msg_queue)
1878 @REPLY
1879 obj_handle_t handle; /* handle to the queue */
1880 @END
1883 /* Set the file descriptor associated to the current thread queue */
1884 @REQ(set_queue_fd)
1885 obj_handle_t handle; /* handle to the file descriptor */
1886 @END
1889 /* Set the current message queue wakeup mask */
1890 @REQ(set_queue_mask)
1891 unsigned int wake_mask; /* wakeup bits mask */
1892 unsigned int changed_mask; /* changed bits mask */
1893 int skip_wait; /* will we skip waiting if signaled? */
1894 @REPLY
1895 unsigned int wake_bits; /* current wake bits */
1896 unsigned int changed_bits; /* current changed bits */
1897 @END
1900 /* Get the current message queue status */
1901 @REQ(get_queue_status)
1902 int clear; /* should we clear the change bits? */
1903 @REPLY
1904 unsigned int wake_bits; /* wake bits */
1905 unsigned int changed_bits; /* changed bits since last time */
1906 @END
1909 /* Retrieve the process idle event */
1910 @REQ(get_process_idle_event)
1911 obj_handle_t handle; /* process handle */
1912 @REPLY
1913 obj_handle_t event; /* handle to idle event */
1914 @END
1917 /* Send a message to a thread queue */
1918 @REQ(send_message)
1919 thread_id_t id; /* thread id */
1920 int type; /* message type (see below) */
1921 int flags; /* message flags (see below) */
1922 user_handle_t win; /* window handle */
1923 unsigned int msg; /* message code */
1924 lparam_t wparam; /* parameters */
1925 lparam_t lparam; /* parameters */
1926 timeout_t timeout; /* timeout for reply */
1927 VARARG(data,message_data); /* message data for sent messages */
1928 @END
1930 @REQ(post_quit_message)
1931 int exit_code; /* exit code to return */
1932 @END
1934 enum message_type
1936 MSG_ASCII, /* Ascii message (from SendMessageA) */
1937 MSG_UNICODE, /* Unicode message (from SendMessageW) */
1938 MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
1939 MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
1940 MSG_CALLBACK_RESULT,/* result of a callback message */
1941 MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
1942 MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
1943 MSG_HARDWARE, /* hardware message */
1944 MSG_WINEVENT /* winevent message */
1946 #define SEND_MSG_ABORT_IF_HUNG 0x01
1949 /* Send a hardware message to a thread queue */
1950 @REQ(send_hardware_message)
1951 thread_id_t id; /* thread id */
1952 user_handle_t win; /* window handle */
1953 unsigned int msg; /* message code */
1954 lparam_t wparam; /* parameters */
1955 lparam_t lparam; /* parameters */
1956 lparam_t info; /* extra info */
1957 int x; /* x position */
1958 int y; /* y position */
1959 unsigned int time; /* message time */
1960 @END
1963 /* Get a message from the current queue */
1964 @REQ(get_message)
1965 unsigned int flags; /* PM_* flags */
1966 user_handle_t get_win; /* window handle to get */
1967 unsigned int get_first; /* first message code to get */
1968 unsigned int get_last; /* last message code to get */
1969 unsigned int hw_id; /* id of the previous hardware message (or 0) */
1970 unsigned int wake_mask; /* wakeup bits mask */
1971 unsigned int changed_mask; /* changed bits mask */
1972 @REPLY
1973 user_handle_t win; /* window handle */
1974 unsigned int msg; /* message code */
1975 lparam_t wparam; /* parameters */
1976 lparam_t lparam; /* parameters */
1977 int type; /* message type */
1978 unsigned int time; /* message time */
1979 unsigned int active_hooks; /* active hooks bitmap */
1980 data_size_t total; /* total size of extra data */
1981 VARARG(data,message_data); /* message data for sent messages */
1982 @END
1985 /* Reply to a sent message */
1986 @REQ(reply_message)
1987 int remove; /* should we remove the message? */
1988 lparam_t result; /* message result */
1989 VARARG(data,bytes); /* message data for sent messages */
1990 @END
1993 /* Accept the current hardware message */
1994 @REQ(accept_hardware_message)
1995 unsigned int hw_id; /* id of the hardware message */
1996 int remove; /* should we remove the message? */
1997 user_handle_t new_win; /* new destination window for current message */
1998 @END
2001 /* Retrieve the reply for the last message sent */
2002 @REQ(get_message_reply)
2003 int cancel; /* cancel message if not ready? */
2004 @REPLY
2005 lparam_t result; /* message result */
2006 VARARG(data,bytes); /* message data for sent messages */
2007 @END
2010 /* Set a window timer */
2011 @REQ(set_win_timer)
2012 user_handle_t win; /* window handle */
2013 unsigned int msg; /* message to post */
2014 unsigned int rate; /* timer rate in ms */
2015 lparam_t id; /* timer id */
2016 lparam_t lparam; /* message lparam (callback proc) */
2017 @REPLY
2018 lparam_t id; /* timer id */
2019 @END
2022 /* Kill a window timer */
2023 @REQ(kill_win_timer)
2024 user_handle_t win; /* window handle */
2025 lparam_t id; /* timer id */
2026 unsigned int msg; /* message to post */
2027 @END
2030 /* check if the thread owning the window is hung */
2031 @REQ(is_window_hung)
2032 user_handle_t win; /* window handle */
2033 @REPLY
2034 int is_hung;
2035 @END
2038 /* Retrieve info about a serial port */
2039 @REQ(get_serial_info)
2040 obj_handle_t handle; /* handle to comm port */
2041 @REPLY
2042 unsigned int readinterval;
2043 unsigned int readconst;
2044 unsigned int readmult;
2045 unsigned int writeconst;
2046 unsigned int writemult;
2047 unsigned int eventmask;
2048 @END
2051 /* Set info about a serial port */
2052 @REQ(set_serial_info)
2053 obj_handle_t handle; /* handle to comm port */
2054 int flags; /* bitmask to set values (see below) */
2055 unsigned int readinterval;
2056 unsigned int readconst;
2057 unsigned int readmult;
2058 unsigned int writeconst;
2059 unsigned int writemult;
2060 unsigned int eventmask;
2061 @END
2062 #define SERIALINFO_SET_TIMEOUTS 0x01
2063 #define SERIALINFO_SET_MASK 0x02
2066 /* Create an async I/O */
2067 @REQ(register_async)
2068 int type; /* type of queue to look after */
2069 async_data_t async; /* async I/O parameters */
2070 int count; /* count - usually # of bytes to be read/written */
2071 @END
2072 /* Create a locatable async I/O */
2073 @REQ(register_async_l)
2074 obj_handle_t handle; /* handle to comm port, socket or file */
2075 int type; /* type of queue to look after */
2076 int count; /* count - usually # of bytes to be read/written */
2077 obj_handle_t locator; /* used to locate a specific async request later */
2078 async_data_t async; /* async I/O parameters */
2079 @END
2080 #define ASYNC_TYPE_READ 0x01
2081 #define ASYNC_TYPE_WRITE 0x02
2082 #define ASYNC_TYPE_WAIT 0x03
2085 /* Cancel all async op on a fd */
2086 @REQ(cancel_async)
2087 obj_handle_t handle; /* handle to comm port, socket or file */
2088 @END
2091 /* Perform an ioctl on a file */
2092 @REQ(ioctl)
2093 ioctl_code_t code; /* ioctl code */
2094 async_data_t async; /* async I/O parameters */
2095 int blocking; /* whether it's a blocking ioctl */
2096 VARARG(in_data,bytes); /* ioctl input data */
2097 @REPLY
2098 obj_handle_t wait; /* handle to wait on for blocking ioctl */
2099 unsigned int options; /* device open options */
2100 VARARG(out_data,bytes); /* ioctl output data */
2101 @END
2104 /* Retrieve results of an async ioctl */
2105 @REQ(get_ioctl_result)
2106 obj_handle_t handle; /* handle to the device */
2107 client_ptr_t user_arg; /* user arg used to identify the request */
2108 @REPLY
2109 VARARG(out_data,bytes); /* ioctl output data */
2110 @END
2113 /* Create a named pipe */
2114 @REQ(create_named_pipe)
2115 unsigned int access;
2116 unsigned int attributes; /* object attributes */
2117 obj_handle_t rootdir; /* root directory */
2118 unsigned int options;
2119 unsigned int maxinstances;
2120 unsigned int outsize;
2121 unsigned int insize;
2122 timeout_t timeout;
2123 unsigned int flags;
2124 VARARG(name,unicode_str); /* pipe name */
2125 @REPLY
2126 obj_handle_t handle; /* handle to the pipe */
2127 @END
2129 /* flags in create_named_pipe and get_named_pipe_info */
2130 #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
2131 #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
2132 #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
2133 #define NAMED_PIPE_SERVER_END 0x8000
2136 @REQ(get_named_pipe_info)
2137 obj_handle_t handle;
2138 @REPLY
2139 unsigned int flags;
2140 unsigned int maxinstances;
2141 unsigned int instances;
2142 unsigned int outsize;
2143 unsigned int insize;
2144 @END
2147 /* Create a window */
2148 @REQ(create_window)
2149 user_handle_t parent; /* parent window */
2150 user_handle_t owner; /* owner window */
2151 atom_t atom; /* class atom */
2152 mod_handle_t instance; /* module instance */
2153 VARARG(class,unicode_str); /* class name */
2154 @REPLY
2155 user_handle_t handle; /* created window */
2156 user_handle_t parent; /* full handle of parent */
2157 user_handle_t owner; /* full handle of owner */
2158 int extra; /* number of extra bytes */
2159 client_ptr_t class_ptr; /* pointer to class in client address space */
2160 @END
2163 /* Destroy a window */
2164 @REQ(destroy_window)
2165 user_handle_t handle; /* handle to the window */
2166 @END
2169 /* Retrieve the desktop window for the current thread */
2170 @REQ(get_desktop_window)
2171 int force; /* force creation if it doesn't exist */
2172 @REPLY
2173 user_handle_t top_window; /* handle to the desktop window */
2174 user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
2175 @END
2178 /* Set a window owner */
2179 @REQ(set_window_owner)
2180 user_handle_t handle; /* handle to the window */
2181 user_handle_t owner; /* new owner */
2182 @REPLY
2183 user_handle_t full_owner; /* full handle of new owner */
2184 user_handle_t prev_owner; /* full handle of previous owner */
2185 @END
2188 /* Get information from a window handle */
2189 @REQ(get_window_info)
2190 user_handle_t handle; /* handle to the window */
2191 @REPLY
2192 user_handle_t full_handle; /* full 32-bit handle */
2193 user_handle_t last_active; /* last active popup */
2194 process_id_t pid; /* process owning the window */
2195 thread_id_t tid; /* thread owning the window */
2196 atom_t atom; /* class atom */
2197 int is_unicode; /* ANSI or unicode */
2198 @END
2201 /* Set some information in a window */
2202 @REQ(set_window_info)
2203 unsigned short flags; /* flags for fields to set (see below) */
2204 short int is_unicode; /* ANSI or unicode */
2205 user_handle_t handle; /* handle to the window */
2206 unsigned int style; /* window style */
2207 unsigned int ex_style; /* window extended style */
2208 unsigned int id; /* window id */
2209 mod_handle_t instance; /* creator instance */
2210 lparam_t user_data; /* user-specific data */
2211 int extra_offset; /* offset to set in extra bytes */
2212 data_size_t extra_size; /* size to set in extra bytes */
2213 lparam_t extra_value; /* value to set in extra bytes */
2214 @REPLY
2215 unsigned int old_style; /* old window style */
2216 unsigned int old_ex_style; /* old window extended style */
2217 mod_handle_t old_instance; /* old creator instance */
2218 lparam_t old_user_data; /* old user-specific data */
2219 lparam_t old_extra_value; /* old value in extra bytes */
2220 unsigned int old_id; /* old window id */
2221 @END
2222 #define SET_WIN_STYLE 0x01
2223 #define SET_WIN_EXSTYLE 0x02
2224 #define SET_WIN_ID 0x04
2225 #define SET_WIN_INSTANCE 0x08
2226 #define SET_WIN_USERDATA 0x10
2227 #define SET_WIN_EXTRA 0x20
2228 #define SET_WIN_UNICODE 0x40
2231 /* Set the parent of a window */
2232 @REQ(set_parent)
2233 user_handle_t handle; /* handle to the window */
2234 user_handle_t parent; /* handle to the parent */
2235 @REPLY
2236 user_handle_t old_parent; /* old parent window */
2237 user_handle_t full_parent; /* full handle of new parent */
2238 @END
2241 /* Get a list of the window parents, up to the root of the tree */
2242 @REQ(get_window_parents)
2243 user_handle_t handle; /* handle to the window */
2244 @REPLY
2245 int count; /* total count of parents */
2246 VARARG(parents,user_handles); /* parent handles */
2247 @END
2250 /* Get a list of the window children */
2251 @REQ(get_window_children)
2252 obj_handle_t desktop; /* handle to desktop */
2253 user_handle_t parent; /* parent window */
2254 atom_t atom; /* class atom for the listed children */
2255 thread_id_t tid; /* thread owning the listed children */
2256 VARARG(class,unicode_str); /* class name */
2257 @REPLY
2258 int count; /* total count of children */
2259 VARARG(children,user_handles); /* children handles */
2260 @END
2263 /* Get a list of the window children that contain a given point */
2264 @REQ(get_window_children_from_point)
2265 user_handle_t parent; /* parent window */
2266 int x; /* point in parent coordinates */
2267 int y;
2268 @REPLY
2269 int count; /* total count of children */
2270 VARARG(children,user_handles); /* children handles */
2271 @END
2274 /* Get window tree information from a window handle */
2275 @REQ(get_window_tree)
2276 user_handle_t handle; /* handle to the window */
2277 @REPLY
2278 user_handle_t parent; /* parent window */
2279 user_handle_t owner; /* owner window */
2280 user_handle_t next_sibling; /* next sibling in Z-order */
2281 user_handle_t prev_sibling; /* prev sibling in Z-order */
2282 user_handle_t first_sibling; /* first sibling in Z-order */
2283 user_handle_t last_sibling; /* last sibling in Z-order */
2284 user_handle_t first_child; /* first child */
2285 user_handle_t last_child; /* last child */
2286 @END
2288 /* Set the position and Z order of a window */
2289 @REQ(set_window_pos)
2290 unsigned int flags; /* SWP_* flags */
2291 user_handle_t handle; /* handle to the window */
2292 user_handle_t previous; /* previous window in Z order */
2293 rectangle_t window; /* window rectangle */
2294 rectangle_t client; /* client rectangle */
2295 VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
2296 @REPLY
2297 unsigned int new_style; /* new window style */
2298 unsigned int new_ex_style; /* new window extended style */
2299 @END
2302 /* Get the window and client rectangles of a window */
2303 @REQ(get_window_rectangles)
2304 user_handle_t handle; /* handle to the window */
2305 @REPLY
2306 rectangle_t window; /* window rectangle */
2307 rectangle_t visible; /* visible part of the window rectangle */
2308 rectangle_t client; /* client rectangle */
2309 @END
2312 /* Get the window text */
2313 @REQ(get_window_text)
2314 user_handle_t handle; /* handle to the window */
2315 @REPLY
2316 VARARG(text,unicode_str); /* window text */
2317 @END
2320 /* Set the window text */
2321 @REQ(set_window_text)
2322 user_handle_t handle; /* handle to the window */
2323 VARARG(text,unicode_str); /* window text */
2324 @END
2327 /* Get the coordinates offset between two windows */
2328 @REQ(get_windows_offset)
2329 user_handle_t from; /* handle to the first window */
2330 user_handle_t to; /* handle to the second window */
2331 @REPLY
2332 int x; /* x coordinate offset */
2333 int y; /* y coordinate offset */
2334 @END
2337 /* Get the visible region of a window */
2338 @REQ(get_visible_region)
2339 user_handle_t window; /* handle to the window */
2340 unsigned int flags; /* DCX flags */
2341 @REPLY
2342 user_handle_t top_win; /* top window to clip against */
2343 rectangle_t top_rect; /* top window visible rect with screen coords */
2344 rectangle_t win_rect; /* window rect in screen coords */
2345 data_size_t total_size; /* total size of the resulting region */
2346 VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
2347 @END
2350 /* Get the window region */
2351 @REQ(get_window_region)
2352 user_handle_t window; /* handle to the window */
2353 @REPLY
2354 data_size_t total_size; /* total size of the resulting region */
2355 VARARG(region,rectangles); /* list of rectangles for the region */
2356 @END
2359 /* Set the window region */
2360 @REQ(set_window_region)
2361 user_handle_t window; /* handle to the window */
2362 int redraw; /* redraw the window? */
2363 VARARG(region,rectangles); /* list of rectangles for the region */
2364 @END
2367 /* Get the window update region */
2368 @REQ(get_update_region)
2369 user_handle_t window; /* handle to the window */
2370 user_handle_t from_child; /* child to start searching from */
2371 unsigned int flags; /* update flags (see below) */
2372 @REPLY
2373 user_handle_t child; /* child to repaint (or window itself) */
2374 unsigned int flags; /* resulting update flags (see below) */
2375 data_size_t total_size; /* total size of the resulting region */
2376 VARARG(region,rectangles); /* list of rectangles for the region */
2377 @END
2378 #define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
2379 #define UPDATE_ERASE 0x02 /* get region for erasing client area */
2380 #define UPDATE_PAINT 0x04 /* get region for painting client area */
2381 #define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */
2382 #define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */
2383 #define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */
2384 #define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */
2385 #define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */
2388 /* Update the z order of a window so that a given rectangle is fully visible */
2389 @REQ(update_window_zorder)
2390 user_handle_t window; /* handle to the window */
2391 rectangle_t rect; /* rectangle that must be visible */
2392 @END
2395 /* Mark parts of a window as needing a redraw */
2396 @REQ(redraw_window)
2397 user_handle_t window; /* handle to the window */
2398 unsigned int flags; /* RDW_* flags */
2399 VARARG(region,rectangles); /* list of rectangles for the region */
2400 @END
2403 /* Set a window property */
2404 @REQ(set_window_property)
2405 user_handle_t window; /* handle to the window */
2406 lparam_t data; /* data to store */
2407 atom_t atom; /* property atom (if no name specified) */
2408 VARARG(name,unicode_str); /* property name */
2409 @END
2412 /* Remove a window property */
2413 @REQ(remove_window_property)
2414 user_handle_t window; /* handle to the window */
2415 atom_t atom; /* property atom (if no name specified) */
2416 VARARG(name,unicode_str); /* property name */
2417 @REPLY
2418 lparam_t data; /* data stored in property */
2419 @END
2422 /* Get a window property */
2423 @REQ(get_window_property)
2424 user_handle_t window; /* handle to the window */
2425 atom_t atom; /* property atom (if no name specified) */
2426 VARARG(name,unicode_str); /* property name */
2427 @REPLY
2428 lparam_t data; /* data stored in property */
2429 @END
2432 /* Get the list of properties of a window */
2433 @REQ(get_window_properties)
2434 user_handle_t window; /* handle to the window */
2435 @REPLY
2436 int total; /* total number of properties */
2437 VARARG(props,properties); /* list of properties */
2438 @END
2441 /* Create a window station */
2442 @REQ(create_winstation)
2443 unsigned int flags; /* window station flags */
2444 unsigned int access; /* wanted access rights */
2445 unsigned int attributes; /* object attributes */
2446 VARARG(name,unicode_str); /* object name */
2447 @REPLY
2448 obj_handle_t handle; /* handle to the window station */
2449 @END
2452 /* Open a handle to a window station */
2453 @REQ(open_winstation)
2454 unsigned int access; /* wanted access rights */
2455 unsigned int attributes; /* object attributes */
2456 VARARG(name,unicode_str); /* object name */
2457 @REPLY
2458 obj_handle_t handle; /* handle to the window station */
2459 @END
2462 /* Close a window station */
2463 @REQ(close_winstation)
2464 obj_handle_t handle; /* handle to the window station */
2465 @END
2468 /* Get the process current window station */
2469 @REQ(get_process_winstation)
2470 @REPLY
2471 obj_handle_t handle; /* handle to the window station */
2472 @END
2475 /* Set the process current window station */
2476 @REQ(set_process_winstation)
2477 obj_handle_t handle; /* handle to the window station */
2478 @END
2481 /* Enumerate window stations */
2482 @REQ(enum_winstation)
2483 unsigned int index; /* current index */
2484 @REPLY
2485 unsigned int next; /* next index */
2486 VARARG(name,unicode_str); /* window station name */
2487 @END
2490 /* Create a desktop */
2491 @REQ(create_desktop)
2492 unsigned int flags; /* desktop flags */
2493 unsigned int access; /* wanted access rights */
2494 unsigned int attributes; /* object attributes */
2495 VARARG(name,unicode_str); /* object name */
2496 @REPLY
2497 obj_handle_t handle; /* handle to the desktop */
2498 @END
2501 /* Open a handle to a desktop */
2502 @REQ(open_desktop)
2503 obj_handle_t winsta; /* window station to open (null allowed) */
2504 unsigned int flags; /* desktop flags */
2505 unsigned int access; /* wanted access rights */
2506 unsigned int attributes; /* object attributes */
2507 VARARG(name,unicode_str); /* object name */
2508 @REPLY
2509 obj_handle_t handle; /* handle to the desktop */
2510 @END
2513 /* Close a desktop */
2514 @REQ(close_desktop)
2515 obj_handle_t handle; /* handle to the desktop */
2516 @END
2519 /* Get the thread current desktop */
2520 @REQ(get_thread_desktop)
2521 thread_id_t tid; /* thread id */
2522 @REPLY
2523 obj_handle_t handle; /* handle to the desktop */
2524 @END
2527 /* Set the thread current desktop */
2528 @REQ(set_thread_desktop)
2529 obj_handle_t handle; /* handle to the desktop */
2530 @END
2533 /* Enumerate desktops */
2534 @REQ(enum_desktop)
2535 obj_handle_t winstation; /* handle to the window station */
2536 unsigned int index; /* current index */
2537 @REPLY
2538 unsigned int next; /* next index */
2539 VARARG(name,unicode_str); /* window station name */
2540 @END
2543 /* Get/set information about a user object (window station or desktop) */
2544 @REQ(set_user_object_info)
2545 obj_handle_t handle; /* handle to the object */
2546 unsigned int flags; /* information to set */
2547 unsigned int obj_flags; /* new object flags */
2548 @REPLY
2549 int is_desktop; /* is object a desktop? */
2550 unsigned int old_obj_flags; /* old object flags */
2551 VARARG(name,unicode_str); /* object name */
2552 @END
2553 #define SET_USER_OBJECT_FLAGS 1
2556 /* Attach (or detach) thread inputs */
2557 @REQ(attach_thread_input)
2558 thread_id_t tid_from; /* thread to be attached */
2559 thread_id_t tid_to; /* thread to which tid_from should be attached */
2560 int attach; /* is it an attach? */
2561 @END
2564 /* Get input data for a given thread */
2565 @REQ(get_thread_input)
2566 thread_id_t tid; /* id of thread */
2567 @REPLY
2568 user_handle_t focus; /* handle to the focus window */
2569 user_handle_t capture; /* handle to the capture window */
2570 user_handle_t active; /* handle to the active window */
2571 user_handle_t foreground; /* handle to the global foreground window */
2572 user_handle_t menu_owner; /* handle to the menu owner */
2573 user_handle_t move_size; /* handle to the moving/resizing window */
2574 user_handle_t caret; /* handle to the caret window */
2575 rectangle_t rect; /* caret rectangle */
2576 @END
2579 /* Get the time of the last input event */
2580 @REQ(get_last_input_time)
2581 @REPLY
2582 unsigned int time;
2583 @END
2586 /* Retrieve queue keyboard state for a given thread */
2587 @REQ(get_key_state)
2588 thread_id_t tid; /* id of thread */
2589 int key; /* optional key code or -1 */
2590 @REPLY
2591 unsigned char state; /* state of specified key */
2592 VARARG(keystate,bytes); /* state array for all the keys */
2593 @END
2595 /* Set queue keyboard state for a given thread */
2596 @REQ(set_key_state)
2597 thread_id_t tid; /* id of thread */
2598 VARARG(keystate,bytes); /* state array for all the keys */
2599 @END
2601 /* Set the system foreground window */
2602 @REQ(set_foreground_window)
2603 user_handle_t handle; /* handle to the foreground window */
2604 @REPLY
2605 user_handle_t previous; /* handle to the previous foreground window */
2606 int send_msg_old; /* whether we have to send a msg to the old window */
2607 int send_msg_new; /* whether we have to send a msg to the new window */
2608 @END
2610 /* Set the current thread focus window */
2611 @REQ(set_focus_window)
2612 user_handle_t handle; /* handle to the focus window */
2613 @REPLY
2614 user_handle_t previous; /* handle to the previous focus window */
2615 @END
2617 /* Set the current thread active window */
2618 @REQ(set_active_window)
2619 user_handle_t handle; /* handle to the active window */
2620 @REPLY
2621 user_handle_t previous; /* handle to the previous active window */
2622 @END
2624 /* Set the current thread capture window */
2625 @REQ(set_capture_window)
2626 user_handle_t handle; /* handle to the capture window */
2627 unsigned int flags; /* capture flags (see below) */
2628 @REPLY
2629 user_handle_t previous; /* handle to the previous capture window */
2630 user_handle_t full_handle; /* full 32-bit handle of new capture window */
2631 @END
2632 #define CAPTURE_MENU 0x01 /* capture is for a menu */
2633 #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
2636 /* Set the current thread caret window */
2637 @REQ(set_caret_window)
2638 user_handle_t handle; /* handle to the caret window */
2639 int width; /* caret width */
2640 int height; /* caret height */
2641 @REPLY
2642 user_handle_t previous; /* handle to the previous caret window */
2643 rectangle_t old_rect; /* previous caret rectangle */
2644 int old_hide; /* previous hide count */
2645 int old_state; /* previous caret state (1=on, 0=off) */
2646 @END
2649 /* Set the current thread caret information */
2650 @REQ(set_caret_info)
2651 unsigned int flags; /* caret flags (see below) */
2652 user_handle_t handle; /* handle to the caret window */
2653 int x; /* caret x position */
2654 int y; /* caret y position */
2655 int hide; /* increment for hide count (can be negative to show it) */
2656 int state; /* caret state (1=on, 0=off, -1=toggle current state) */
2657 @REPLY
2658 user_handle_t full_handle; /* handle to the current caret window */
2659 rectangle_t old_rect; /* previous caret rectangle */
2660 int old_hide; /* previous hide count */
2661 int old_state; /* previous caret state (1=on, 0=off) */
2662 @END
2663 #define SET_CARET_POS 0x01 /* set the caret position from x,y */
2664 #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
2665 #define SET_CARET_STATE 0x04 /* set the caret on/off state */
2668 /* Set a window hook */
2669 @REQ(set_hook)
2670 int id; /* id of the hook */
2671 process_id_t pid; /* id of process to set the hook into */
2672 thread_id_t tid; /* id of thread to set the hook into */
2673 int event_min;
2674 int event_max;
2675 client_ptr_t proc; /* hook procedure */
2676 int flags;
2677 int unicode; /* is it a unicode hook? */
2678 VARARG(module,unicode_str); /* module name */
2679 @REPLY
2680 user_handle_t handle; /* handle to the hook */
2681 unsigned int active_hooks; /* active hooks bitmap */
2682 @END
2685 /* Remove a window hook */
2686 @REQ(remove_hook)
2687 user_handle_t handle; /* handle to the hook */
2688 client_ptr_t proc; /* hook procedure if handle is 0 */
2689 int id; /* id of the hook if handle is 0 */
2690 @REPLY
2691 unsigned int active_hooks; /* active hooks bitmap */
2692 @END
2695 /* Start calling a hook chain */
2696 @REQ(start_hook_chain)
2697 int id; /* id of the hook */
2698 int event; /* signalled event */
2699 user_handle_t window; /* handle to the event window */
2700 int object_id; /* object id for out of context winevent */
2701 int child_id; /* child id for out of context winevent */
2702 @REPLY
2703 user_handle_t handle; /* handle to the next hook */
2704 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2705 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2706 int unicode; /* is it a unicode hook? */
2707 client_ptr_t proc; /* hook procedure */
2708 unsigned int active_hooks; /* active hooks bitmap */
2709 VARARG(module,unicode_str); /* module name */
2710 @END
2713 /* Finished calling a hook chain */
2714 @REQ(finish_hook_chain)
2715 int id; /* id of the hook */
2716 @END
2719 /* Get the hook information */
2720 @REQ(get_hook_info)
2721 user_handle_t handle; /* handle to the current hook */
2722 int get_next; /* do we want info about current or next hook? */
2723 int event; /* signalled event */
2724 user_handle_t window; /* handle to the event window */
2725 int object_id; /* object id for out of context winevent */
2726 int child_id; /* child id for out of context winevent */
2727 @REPLY
2728 user_handle_t handle; /* handle to the hook */
2729 int id; /* id of the hook */
2730 process_id_t pid; /* process id for low-level keyboard/mouse hooks */
2731 thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
2732 client_ptr_t proc; /* hook procedure */
2733 int unicode; /* is it a unicode hook? */
2734 VARARG(module,unicode_str); /* module name */
2735 @END
2738 /* Create a window class */
2739 @REQ(create_class)
2740 int local; /* is it a local class? */
2741 atom_t atom; /* class atom */
2742 unsigned int style; /* class style */
2743 mod_handle_t instance; /* module instance */
2744 int extra; /* number of extra class bytes */
2745 int win_extra; /* number of window extra bytes */
2746 client_ptr_t client_ptr; /* pointer to class in client address space */
2747 VARARG(name,unicode_str); /* class name */
2748 @REPLY
2749 atom_t atom; /* resulting class atom */
2750 @END
2753 /* Destroy a window class */
2754 @REQ(destroy_class)
2755 atom_t atom; /* class atom */
2756 mod_handle_t instance; /* module instance */
2757 VARARG(name,unicode_str); /* class name */
2758 @REPLY
2759 client_ptr_t client_ptr; /* pointer to class in client address space */
2760 @END
2763 /* Set some information in a class */
2764 @REQ(set_class_info)
2765 user_handle_t window; /* handle to the window */
2766 unsigned int flags; /* flags for info to set (see below) */
2767 atom_t atom; /* class atom */
2768 unsigned int style; /* class style */
2769 int win_extra; /* number of window extra bytes */
2770 mod_handle_t instance; /* module instance */
2771 int extra_offset; /* offset to set in extra bytes */
2772 data_size_t extra_size; /* size to set in extra bytes */
2773 lparam_t extra_value; /* value to set in extra bytes */
2774 @REPLY
2775 atom_t old_atom; /* previous class atom */
2776 unsigned int old_style; /* previous class style */
2777 int old_extra; /* previous number of class extra bytes */
2778 int old_win_extra; /* previous number of window extra bytes */
2779 mod_handle_t old_instance; /* previous module instance */
2780 lparam_t old_extra_value; /* old value in extra bytes */
2781 @END
2782 #define SET_CLASS_ATOM 0x0001
2783 #define SET_CLASS_STYLE 0x0002
2784 #define SET_CLASS_WINEXTRA 0x0004
2785 #define SET_CLASS_INSTANCE 0x0008
2786 #define SET_CLASS_EXTRA 0x0010
2789 /* Set/get clipboard information */
2790 @REQ(set_clipboard_info)
2791 unsigned int flags; /* flags for fields to set (see below) */
2792 user_handle_t clipboard; /* clipboard window */
2793 user_handle_t owner; /* clipboard owner */
2794 user_handle_t viewer; /* first clipboard viewer */
2795 unsigned int seqno; /* change sequence number */
2796 @REPLY
2797 unsigned int flags; /* status flags (see below) */
2798 user_handle_t old_clipboard; /* old clipboard window */
2799 user_handle_t old_owner; /* old clipboard owner */
2800 user_handle_t old_viewer; /* old clipboard viewer */
2801 unsigned int seqno; /* current sequence number */
2802 @END
2804 #define SET_CB_OPEN 0x001
2805 #define SET_CB_OWNER 0x002
2806 #define SET_CB_VIEWER 0x004
2807 #define SET_CB_SEQNO 0x008
2808 #define SET_CB_RELOWNER 0x010
2809 #define SET_CB_CLOSE 0x020
2810 #define CB_OPEN 0x040
2811 #define CB_OWNER 0x080
2812 #define CB_PROCESS 0x100
2815 /* Open a security token */
2816 @REQ(open_token)
2817 obj_handle_t handle; /* handle to the thread or process */
2818 unsigned int access; /* access rights to the new token */
2819 unsigned int attributes;/* object attributes */
2820 unsigned int flags; /* flags (see below) */
2821 @REPLY
2822 obj_handle_t token; /* handle to the token */
2823 @END
2824 #define OPEN_TOKEN_THREAD 1
2825 #define OPEN_TOKEN_AS_SELF 2
2828 /* Set/get the global windows */
2829 @REQ(set_global_windows)
2830 unsigned int flags; /* flags for fields to set (see below) */
2831 user_handle_t shell_window; /* handle to the new shell window */
2832 user_handle_t shell_listview; /* handle to the new shell listview window */
2833 user_handle_t progman_window; /* handle to the new program manager window */
2834 user_handle_t taskman_window; /* handle to the new task manager window */
2835 @REPLY
2836 user_handle_t old_shell_window; /* handle to the shell window */
2837 user_handle_t old_shell_listview; /* handle to the shell listview window */
2838 user_handle_t old_progman_window; /* handle to the new program manager window */
2839 user_handle_t old_taskman_window; /* handle to the new task manager window */
2840 @END
2841 #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
2842 #define SET_GLOBAL_PROGMAN_WINDOW 0x02
2843 #define SET_GLOBAL_TASKMAN_WINDOW 0x04
2845 /* Adjust the privileges held by a token */
2846 @REQ(adjust_token_privileges)
2847 obj_handle_t handle; /* handle to the token */
2848 int disable_all; /* disable all privileges? */
2849 int get_modified_state; /* get modified privileges? */
2850 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
2851 @REPLY
2852 unsigned int len; /* total length in bytes required to store token privileges */
2853 VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
2854 @END
2856 /* Retrieves the set of privileges held by or available to a token */
2857 @REQ(get_token_privileges)
2858 obj_handle_t handle; /* handle to the token */
2859 @REPLY
2860 unsigned int len; /* total length in bytes required to store token privileges */
2861 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2862 @END
2864 /* Check the token has the required privileges */
2865 @REQ(check_token_privileges)
2866 obj_handle_t handle; /* handle to the token */
2867 int all_required; /* are all the privileges required for the check to succeed? */
2868 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
2869 @REPLY
2870 int has_privileges; /* does the token have the required privileges? */
2871 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
2872 @END
2874 @REQ(duplicate_token)
2875 obj_handle_t handle; /* handle to the token to duplicate */
2876 unsigned int access; /* access rights to the new token */
2877 unsigned int attributes; /* object attributes */
2878 int primary; /* is the new token to be a primary one? */
2879 int impersonation_level; /* impersonation level of the new token */
2880 @REPLY
2881 obj_handle_t new_handle; /* duplicated handle */
2882 @END
2884 @REQ(access_check)
2885 obj_handle_t handle; /* handle to the token */
2886 unsigned int desired_access; /* desired access to the object */
2887 unsigned int mapping_read; /* mapping from generic read to specific rights */
2888 unsigned int mapping_write; /* mapping from generic write to specific rights */
2889 unsigned int mapping_execute; /* mapping from generic execute to specific rights */
2890 unsigned int mapping_all; /* mapping from generic all to specific rights */
2891 VARARG(sd,security_descriptor); /* security descriptor to check */
2892 @REPLY
2893 unsigned int access_granted; /* access rights actually granted */
2894 unsigned int access_status; /* was access granted? */
2895 unsigned int privileges_len; /* length needed to store privileges */
2896 VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
2897 @END
2899 @REQ(get_token_user)
2900 obj_handle_t handle; /* handle to the token */
2901 @REPLY
2902 data_size_t user_len; /* length needed to store user */
2903 VARARG(user,SID); /* sid of the user the token represents */
2904 @END
2906 @REQ(get_token_groups)
2907 obj_handle_t handle; /* handle to the token */
2908 @REPLY
2909 data_size_t user_len; /* length needed to store user */
2910 VARARG(user,token_groups); /* groups the token's user belongs to */
2911 @END
2913 @REQ(get_token_default_dacl)
2914 obj_handle_t handle; /* handle to the token */
2915 @REPLY
2916 data_size_t acl_len; /* length needed to store access control list */
2917 VARARG(acl,ACL); /* access control list */
2918 @END
2920 @REQ(set_token_default_dacl)
2921 obj_handle_t handle; /* handle to the token */
2922 VARARG(acl,ACL); /* default dacl to set */
2923 @END
2925 @REQ(set_security_object)
2926 obj_handle_t handle; /* handle to the object */
2927 unsigned int security_info; /* which parts of security descriptor to set */
2928 VARARG(sd,security_descriptor); /* security descriptor to set */
2929 @END
2931 @REQ(get_security_object)
2932 obj_handle_t handle; /* handle to the object */
2933 unsigned int security_info; /* which parts of security descriptor to get */
2934 @REPLY
2935 unsigned int sd_len; /* buffer size needed for sd */
2936 VARARG(sd,security_descriptor); /* retrieved security descriptor */
2937 @END
2939 /* Create a mailslot */
2940 @REQ(create_mailslot)
2941 unsigned int access; /* wanted access rights */
2942 unsigned int attributes; /* object attributes */
2943 obj_handle_t rootdir; /* root directory */
2944 timeout_t read_timeout;
2945 unsigned int max_msgsize;
2946 VARARG(name,unicode_str); /* mailslot name */
2947 @REPLY
2948 obj_handle_t handle; /* handle to the mailslot */
2949 @END
2952 /* Set mailslot information */
2953 @REQ(set_mailslot_info)
2954 obj_handle_t handle; /* handle to the mailslot */
2955 timeout_t read_timeout;
2956 unsigned int flags;
2957 @REPLY
2958 timeout_t read_timeout;
2959 unsigned int max_msgsize;
2960 @END
2961 #define MAILSLOT_SET_READ_TIMEOUT 1
2964 /* Create a directory object */
2965 @REQ(create_directory)
2966 unsigned int access; /* access flags */
2967 unsigned int attributes; /* object attributes */
2968 obj_handle_t rootdir; /* root directory */
2969 VARARG(directory_name,unicode_str); /* Directory name */
2970 @REPLY
2971 obj_handle_t handle; /* handle to the directory */
2972 @END
2975 /* Open a directory object */
2976 @REQ(open_directory)
2977 unsigned int access; /* access flags */
2978 unsigned int attributes; /* object attributes */
2979 obj_handle_t rootdir; /* root directory */
2980 VARARG(directory_name,unicode_str); /* Directory name */
2981 @REPLY
2982 obj_handle_t handle; /* handle to the directory */
2983 @END
2986 /* Get a directory entry by index */
2987 @REQ(get_directory_entry)
2988 obj_handle_t handle; /* handle to the directory */
2989 unsigned int index; /* entry index */
2990 @REPLY
2991 data_size_t name_len; /* length of the entry name in bytes */
2992 VARARG(name,unicode_str,name_len); /* entry name */
2993 VARARG(type,unicode_str); /* entry type */
2994 @END
2997 /* Create a symbolic link object */
2998 @REQ(create_symlink)
2999 unsigned int access; /* access flags */
3000 unsigned int attributes; /* object attributes */
3001 obj_handle_t rootdir; /* root directory */
3002 data_size_t name_len; /* length of the symlink name in bytes */
3003 VARARG(name,unicode_str,name_len); /* symlink name */
3004 VARARG(target_name,unicode_str); /* target name */
3005 @REPLY
3006 obj_handle_t handle; /* handle to the symlink */
3007 @END
3010 /* Open a symbolic link object */
3011 @REQ(open_symlink)
3012 unsigned int access; /* access flags */
3013 unsigned int attributes; /* object attributes */
3014 obj_handle_t rootdir; /* root directory */
3015 VARARG(name,unicode_str); /* symlink name */
3016 @REPLY
3017 obj_handle_t handle; /* handle to the symlink */
3018 @END
3021 /* Query a symbolic link object */
3022 @REQ(query_symlink)
3023 obj_handle_t handle; /* handle to the symlink */
3024 @REPLY
3025 VARARG(target_name,unicode_str); /* target name */
3026 @END
3029 /* Query basic object information */
3030 @REQ(get_object_info)
3031 obj_handle_t handle; /* handle to the object */
3032 @REPLY
3033 unsigned int access; /* granted access mask */
3034 unsigned int ref_count; /* object ref count */
3035 @END
3038 /* Unlink a named object */
3039 @REQ(unlink_object)
3040 obj_handle_t handle; /* handle to the object */
3041 @END
3044 /* Query the impersonation level of an impersonation token */
3045 @REQ(get_token_impersonation_level)
3046 obj_handle_t handle; /* handle to the object */
3047 @REPLY
3048 int impersonation_level; /* impersonation level of the impersonation token */
3049 @END
3051 /* Allocate a locally-unique identifier */
3052 @REQ(allocate_locally_unique_id)
3053 @REPLY
3054 luid_t luid;
3055 @END
3058 /* Create a device manager */
3059 @REQ(create_device_manager)
3060 unsigned int access; /* wanted access rights */
3061 unsigned int attributes; /* object attributes */
3062 @REPLY
3063 obj_handle_t handle; /* handle to the device */
3064 @END
3067 /* Create a device */
3068 @REQ(create_device)
3069 unsigned int access; /* wanted access rights */
3070 unsigned int attributes; /* object attributes */
3071 obj_handle_t rootdir; /* root directory */
3072 client_ptr_t user_ptr; /* opaque ptr for use by client */
3073 obj_handle_t manager; /* device manager */
3074 VARARG(name,unicode_str); /* object name */
3075 @REPLY
3076 obj_handle_t handle; /* handle to the device */
3077 @END
3080 /* Delete a device */
3081 @REQ(delete_device)
3082 obj_handle_t handle; /* handle to the device */
3083 @END
3086 /* Retrieve the next pending device ioctl request */
3087 @REQ(get_next_device_request)
3088 obj_handle_t manager; /* handle to the device manager */
3089 obj_handle_t prev; /* handle to the previous ioctl */
3090 unsigned int status; /* status of the previous ioctl */
3091 VARARG(prev_data,bytes); /* output data of the previous ioctl */
3092 @REPLY
3093 obj_handle_t next; /* handle to the next ioctl */
3094 ioctl_code_t code; /* ioctl code */
3095 client_ptr_t user_ptr; /* opaque ptr for the device */
3096 data_size_t in_size; /* total needed input size */
3097 data_size_t out_size; /* needed output size */
3098 VARARG(next_data,bytes); /* input data of the next ioctl */
3099 @END
3102 /* Make the current process a system process */
3103 @REQ(make_process_system)
3104 @REPLY
3105 obj_handle_t event; /* event signaled when all user processes have exited */
3106 @END
3109 /* Get detailed fixed-size information about a token */
3110 @REQ(get_token_statistics)
3111 obj_handle_t handle; /* handle to the object */
3112 @REPLY
3113 luid_t token_id; /* locally-unique identifier of the token */
3114 luid_t modified_id; /* locally-unique identifier of the modified version of the token */
3115 int primary; /* is the token primary or impersonation? */
3116 int impersonation_level; /* level of impersonation */
3117 int group_count; /* the number of groups the token is a member of */
3118 int privilege_count; /* the number of privileges the token has */
3119 @END
3122 /* Create I/O completion port */
3123 @REQ(create_completion)
3124 unsigned int access; /* desired access to a port */
3125 unsigned int attributes; /* object attributes */
3126 unsigned int concurrent; /* max number of concurrent active threads */
3127 obj_handle_t rootdir; /* root directory */
3128 VARARG(filename,string); /* port name */
3129 @REPLY
3130 obj_handle_t handle; /* port handle */
3131 @END
3134 /* Open I/O completion port */
3135 @REQ(open_completion)
3136 unsigned int access; /* desired access to a port */
3137 unsigned int attributes; /* object attributes */
3138 obj_handle_t rootdir; /* root directory */
3139 VARARG(filename,string); /* port name */
3140 @REPLY
3141 obj_handle_t handle; /* port handle */
3142 @END
3145 /* add completion to completion port */
3146 @REQ(add_completion)
3147 obj_handle_t handle; /* port handle */
3148 apc_param_t ckey; /* completion key */
3149 apc_param_t cvalue; /* completion value */
3150 unsigned int information; /* IO_STATUS_BLOCK Information */
3151 unsigned int status; /* completion result */
3152 @END
3155 /* get completion from completion port queue */
3156 @REQ(remove_completion)
3157 obj_handle_t handle; /* port handle */
3158 @REPLY
3159 apc_param_t ckey; /* completion key */
3160 apc_param_t cvalue; /* completion value */
3161 unsigned int information; /* IO_STATUS_BLOCK Information */
3162 unsigned int status; /* completion result */
3163 @END
3166 /* get completion queue depth */
3167 @REQ(query_completion)
3168 obj_handle_t handle; /* port handle */
3169 @REPLY
3170 unsigned int depth; /* completion queue depth */
3171 @END
3174 /* associate object with completion port */
3175 @REQ(set_completion_info)
3176 obj_handle_t handle; /* object handle */
3177 apc_param_t ckey; /* completion key */
3178 obj_handle_t chandle; /* port handle */
3179 @END
3182 /* check for associated completion and push msg */
3183 @REQ(add_fd_completion)
3184 obj_handle_t handle; /* async' object */
3185 apc_param_t cvalue; /* completion value */
3186 unsigned int status; /* completion status */
3187 unsigned int information; /* IO_STATUS_BLOCK Information */
3188 @END
3191 /* Retrieve layered info for a window */
3192 @REQ(get_window_layered_info)
3193 user_handle_t handle; /* handle to the window */
3194 @REPLY
3195 unsigned int color_key; /* color key */
3196 unsigned int alpha; /* alpha (0..255) */
3197 unsigned int flags; /* LWA_* flags */
3198 @END
3201 /* Set layered info for a window */
3202 @REQ(set_window_layered_info)
3203 user_handle_t handle; /* handle to the window */
3204 unsigned int color_key; /* color key */
3205 unsigned int alpha; /* alpha (0..255) */
3206 unsigned int flags; /* LWA_* flags */
3207 @END