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