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