Return an error in CoMarshalInterface if the IUnknown pointer is NULL
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 struct request_header
35 {
36     int          req;          /* request code */
37     size_t       request_size; /* request variable part size */
38     size_t       reply_size;   /* reply variable part maximum size */
39 };
40
41 struct reply_header
42 {
43     unsigned int error;        /* error result */
44     size_t       reply_size;   /* reply variable part size */
45 };
46
47 /* placeholder structure for the maximum allowed request size */
48 /* this is used to construct the generic_request union */
49 struct request_max_size
50 {
51     int pad[16]; /* the max request size is 16 ints */
52 };
53
54 typedef void *obj_handle_t;
55 typedef void *user_handle_t;
56 typedef unsigned short atom_t;
57 typedef unsigned int process_id_t;
58 typedef unsigned int thread_id_t;
59
60 #define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
61 #define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */
62
63
64 /* definitions of the event data depending on the event code */
65 struct debug_event_exception
66 {
67     EXCEPTION_RECORD record;   /* exception record */
68     int              first;    /* first chance exception? */
69 };
70 struct debug_event_create_thread
71 {
72     obj_handle_t handle;     /* handle to the new thread */
73     void        *teb;        /* thread teb (in debugged process address space) */
74     void        *start;      /* thread startup routine */
75 };
76 struct debug_event_create_process
77 {
78     obj_handle_t file;       /* handle to the process exe file */
79     obj_handle_t process;    /* handle to the new process */
80     obj_handle_t thread;     /* handle to the new thread */
81     void        *base;       /* base of executable image */
82     int          dbg_offset; /* offset of debug info in file */
83     int          dbg_size;   /* size of debug info */
84     void        *teb;        /* thread teb (in debugged process address space) */
85     void        *start;      /* thread startup routine */
86     void        *name;       /* image name (optional) */
87     int          unicode;    /* is it Unicode? */
88 };
89 struct debug_event_exit
90 {
91     int          exit_code;  /* thread or process exit code */
92 };
93 struct debug_event_load_dll
94 {
95     obj_handle_t handle;     /* file handle for the dll */
96     void        *base;       /* base address of the dll */
97     int          dbg_offset; /* offset of debug info in file */
98     int          dbg_size;   /* size of debug info */
99     void        *name;       /* image name (optional) */
100     int          unicode;    /* is it Unicode? */
101 };
102 struct debug_event_unload_dll
103 {
104     void       *base;       /* base address of the dll */
105 };
106 struct debug_event_output_string
107 {
108     void       *string;     /* string to display (in debugged process address space) */
109     int         unicode;    /* is it Unicode? */
110     int         length;     /* string length */
111 };
112 struct debug_event_rip_info
113 {
114     int         error;      /* ??? */
115     int         type;       /* ??? */
116 };
117 union debug_event_data
118 {
119     struct debug_event_exception      exception;
120     struct debug_event_create_thread  create_thread;
121     struct debug_event_create_process create_process;
122     struct debug_event_exit           exit;
123     struct debug_event_load_dll       load_dll;
124     struct debug_event_unload_dll     unload_dll;
125     struct debug_event_output_string  output_string;
126     struct debug_event_rip_info       rip_info;
127 };
128
129 /* debug event data */
130 typedef struct
131 {
132     int                      code;   /* event code */
133     union debug_event_data   info;   /* event information */
134 } debug_event_t;
135
136 /* structure used in sending an fd from client to server */
137 struct send_fd
138 {
139     thread_id_t tid;  /* thread id */
140     int         fd;   /* file descriptor on client-side */
141 };
142
143 /* structure sent by the server on the wait fifo */
144 struct wake_up_reply
145 {
146     void *cookie;    /* magic cookie that was passed in select_request */
147     int   signaled;  /* wait result */
148 };
149
150 /* structure for absolute timeouts */
151 typedef struct
152 {
153     int            sec;      /* seconds since Unix epoch */
154     int            usec;     /* microseconds */
155 } abs_time_t;
156
157 /* structure returned in the list of window properties */
158 typedef struct
159 {
160     atom_t         atom;     /* property atom */
161     short          string;   /* was atom a string originally? */
162     obj_handle_t   handle;   /* handle stored in property */
163 } property_data_t;
164
165 /* structure to specify window rectangles */
166 typedef struct
167 {
168     int  left;
169     int  top;
170     int  right;
171     int  bottom;
172 } rectangle_t;
173
174 /* structure for console char/attribute info */
175 typedef struct
176 {
177     WCHAR          ch;
178     unsigned short attr;
179 } char_info_t;
180
181 /****************************************************************/
182 /* Request declarations */
183
184 /* Create a new process from the context of the parent */
185 @REQ(new_process)
186     int          inherit_all;  /* inherit all handles from parent */
187     int          create_flags; /* creation flags */
188     int          unix_pid;     /* Unix pid of new process */
189     obj_handle_t exe_file;     /* file handle for main exe */
190     obj_handle_t hstdin;       /* handle for stdin */
191     obj_handle_t hstdout;      /* handle for stdout */
192     obj_handle_t hstderr;      /* handle for stderr */
193     VARARG(info,startup_info); /* startup information */
194 @REPLY
195     obj_handle_t info;         /* new process info handle */
196 @END
197
198
199 /* Retrieve information about a newly started process */
200 @REQ(get_new_process_info)
201     obj_handle_t info;         /* info handle returned from new_process_request */
202     int          pinherit;     /* process handle inherit flag */
203     int          tinherit;     /* thread handle inherit flag */
204 @REPLY
205     process_id_t pid;          /* process id */
206     obj_handle_t phandle;      /* process handle (in the current process) */
207     thread_id_t  tid;          /* thread id */
208     obj_handle_t thandle;      /* thread handle (in the current process) */
209     int          success;      /* did the process start successfully? */
210 @END
211
212
213 /* Create a new thread from the context of the parent */
214 @REQ(new_thread)
215     int          suspend;      /* new thread should be suspended on creation */
216     int          inherit;      /* inherit flag */
217     int          request_fd;   /* fd for request pipe */
218 @REPLY
219     thread_id_t  tid;          /* thread id */
220     obj_handle_t handle;       /* thread handle (in the current process) */
221 @END
222
223
224 /* Signal that we are finished booting on the client side */
225 @REQ(boot_done)
226     int          debug_level;  /* new debug level */
227 @END
228
229
230 /* Initialize a process; called from the new process context */
231 @REQ(init_process)
232     void*        peb;          /* addr of PEB */
233     void*        ldt_copy;     /* addr of LDT copy */
234 @REPLY
235     int          create_flags; /* creation flags */
236     unsigned int server_start; /* server start time (GetTickCount) */
237     size_t       info_size;    /* total size of startup info */
238     obj_handle_t exe_file;     /* file handle for main exe */
239     obj_handle_t hstdin;       /* handle for stdin */
240     obj_handle_t hstdout;      /* handle for stdout */
241     obj_handle_t hstderr;      /* handle for stderr */
242 @END
243
244
245 /* Retrieve the new process startup info */
246 @REQ(get_startup_info)
247 @REPLY
248     VARARG(info,startup_info); /* startup information */
249 @END
250
251
252 /* Signal the end of the process initialization */
253 @REQ(init_process_done)
254     void*        module;       /* main module base address */
255     size_t       module_size;  /* main module size */
256     void*        entry;        /* process entry point */
257     void*        name;         /* ptr to ptr to name (in process addr space) */
258     obj_handle_t exe_file;     /* file handle for main exe */
259     int          gui;          /* is it a GUI process? */
260     VARARG(filename,unicode_str); /* file name of main exe */
261 @END
262
263
264 /* Initialize a thread; called from the child after fork()/clone() */
265 @REQ(init_thread)
266     int          unix_pid;     /* Unix pid of new thread */
267     int          unix_tid;     /* Unix tid of new thread */
268     void*        teb;          /* TEB of new thread (in thread address space) */
269     void*        entry;        /* thread entry point (in thread address space) */
270     int          reply_fd;     /* fd for reply pipe */
271     int          wait_fd;      /* fd for blocking calls pipe */
272 @REPLY
273     process_id_t pid;          /* process id of the new thread's process */
274     thread_id_t  tid;          /* thread id of the new thread */
275     int          boot;         /* is this the boot thread? */
276     int          version;      /* protocol version */
277 @END
278
279
280 /* Terminate a process */
281 @REQ(terminate_process)
282     obj_handle_t handle;       /* process handle to terminate */
283     int          exit_code;    /* process exit code */
284 @REPLY
285     int          self;         /* suicide? */
286 @END
287
288
289 /* Terminate a thread */
290 @REQ(terminate_thread)
291     obj_handle_t handle;       /* thread handle to terminate */
292     int          exit_code;    /* thread exit code */
293 @REPLY
294     int          self;         /* suicide? */
295     int          last;         /* last thread in this process? */
296 @END
297
298
299 /* Retrieve information about a process */
300 @REQ(get_process_info)
301     obj_handle_t handle;           /* process handle */
302 @REPLY
303     process_id_t pid;              /* server process id */
304     process_id_t ppid;             /* server process id of parent */
305     int          exit_code;        /* process exit code */
306     int          priority;         /* priority class */
307     int          process_affinity; /* process affinity mask */
308     int          system_affinity;  /* system affinity mask */
309     void*        peb;              /* PEB address in process address space */
310 @END
311
312
313 /* Set a process informations */
314 @REQ(set_process_info)
315     obj_handle_t handle;       /* process handle */
316     int          mask;         /* setting mask (see below) */
317     int          priority;     /* priority class */
318     int          affinity;     /* affinity mask */
319 @END
320 #define SET_PROCESS_INFO_PRIORITY 0x01
321 #define SET_PROCESS_INFO_AFFINITY 0x02
322
323
324 /* Retrieve information about a thread */
325 @REQ(get_thread_info)
326     obj_handle_t handle;        /* thread handle */
327     thread_id_t  tid_in;        /* thread id (optional) */
328 @REPLY
329     process_id_t pid;           /* server process id */
330     thread_id_t  tid;           /* server thread id */
331     void*        teb;           /* thread teb pointer */
332     int          exit_code;     /* thread exit code */
333     int          priority;      /* thread priority level */
334     int          affinity;      /* thread affinity mask */
335     time_t       creation_time; /* thread creation time */
336     time_t       exit_time;     /* thread exit time */
337 @END
338
339
340 /* Set a thread informations */
341 @REQ(set_thread_info)
342     obj_handle_t handle;       /* thread handle */
343     int          mask;         /* setting mask (see below) */
344     int          priority;     /* priority class */
345     int          affinity;     /* affinity mask */
346 @END
347 #define SET_THREAD_INFO_PRIORITY 0x01
348 #define SET_THREAD_INFO_AFFINITY 0x02
349
350
351 /* Retrieve information about a module */
352 @REQ(get_dll_info)
353     obj_handle_t handle;       /* process handle */
354     void*        base_address; /* base address of module */
355 @REPLY
356     size_t       size;          /* module size */
357     void*        entry_point;
358     VARARG(filename,unicode_str); /* file name of module */
359 @END
360
361
362 /* Suspend a thread */
363 @REQ(suspend_thread)
364     obj_handle_t handle;       /* thread handle */
365 @REPLY
366     int          count;        /* new suspend count */
367 @END
368
369
370 /* Resume a thread */
371 @REQ(resume_thread)
372     obj_handle_t handle;       /* thread handle */
373 @REPLY
374     int          count;        /* new suspend count */
375 @END
376
377
378 /* Notify the server that a dll has been loaded */
379 @REQ(load_dll)
380     obj_handle_t handle;       /* file handle */
381     void*        base;         /* base address */
382     size_t       size;         /* dll size */
383     int          dbg_offset;   /* debug info offset */
384     int          dbg_size;     /* debug info size */
385     void*        name;         /* ptr to ptr to name (in process addr space) */
386     VARARG(filename,unicode_str); /* file name of dll */
387 @END
388
389
390 /* Notify the server that a dll is being unloaded */
391 @REQ(unload_dll)
392     void*        base;         /* base address */
393 @END
394
395
396 /* Queue an APC for a thread */
397 @REQ(queue_apc)
398     obj_handle_t handle;       /* thread handle */
399     int          user;         /* user or system apc? */
400     void*        func;         /* function to call */
401     void*        arg1;         /* params for function to call */
402     void*        arg2;
403     void*        arg3;
404 @END
405
406
407 /* Get next APC to call */
408 @REQ(get_apc)
409     int          alertable;    /* is thread alertable? */
410 @REPLY
411     void*        func;         /* function to call */
412     int          type;         /* function type */
413     void*        arg1;         /* function arguments */
414     void*        arg2;
415     void*        arg3;
416 @END
417 enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO };
418
419
420 /* Close a handle for the current process */
421 @REQ(close_handle)
422     obj_handle_t handle;       /* handle to close */
423 @REPLY
424     int          fd;           /* associated fd to close */
425 @END
426
427
428 /* Set a handle information */
429 @REQ(set_handle_info)
430     obj_handle_t handle;       /* handle we are interested in */
431     int          flags;        /* new handle flags */
432     int          mask;         /* mask for flags to set */
433     int          fd;           /* file descriptor or -1 */
434 @REPLY
435     int          old_flags;    /* old flag value */
436     int          cur_fd;       /* current file descriptor */
437 @END
438
439
440 /* Duplicate a handle */
441 @REQ(dup_handle)
442     obj_handle_t src_process;  /* src process handle */
443     obj_handle_t src_handle;   /* src handle to duplicate */
444     obj_handle_t dst_process;  /* dst process handle */
445     unsigned int access;       /* wanted access rights */
446     int          inherit;      /* inherit flag */
447     int          options;      /* duplicate options (see below) */
448 @REPLY
449     obj_handle_t handle;       /* duplicated handle in dst process */
450     int          fd;           /* associated fd to close */
451 @END
452 #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE
453 #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS
454 #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */
455
456
457 /* Open a handle to a process */
458 @REQ(open_process)
459     process_id_t pid;          /* process id to open */
460     unsigned int access;       /* wanted access rights */
461     int          inherit;      /* inherit flag */
462 @REPLY
463     obj_handle_t handle;       /* handle to the process */
464 @END
465
466
467 /* Open a handle to a thread */
468 @REQ(open_thread)
469     thread_id_t  tid;          /* thread id to open */
470     unsigned int access;       /* wanted access rights */
471     int          inherit;      /* inherit flag */
472 @REPLY
473     obj_handle_t handle;       /* handle to the thread */
474 @END
475
476
477 /* Wait for handles */
478 @REQ(select)
479     int          flags;        /* wait flags (see below) */
480     void*        cookie;       /* magic cookie to return to client */
481     abs_time_t   timeout;      /* absolute timeout */
482     VARARG(handles,handles);   /* handles to select on */
483 @END
484 #define SELECT_ALL           1
485 #define SELECT_ALERTABLE     2
486 #define SELECT_INTERRUPTIBLE 4
487 #define SELECT_TIMEOUT       8
488
489
490 /* Create an event */
491 @REQ(create_event)
492     int          manual_reset;  /* manual reset event */
493     int          initial_state; /* initial state of the event */
494     int          inherit;       /* inherit flag */
495     VARARG(name,unicode_str);   /* object name */
496 @REPLY
497     obj_handle_t handle;        /* handle to the event */
498 @END
499
500 /* Event operation */
501 @REQ(event_op)
502     obj_handle_t  handle;       /* handle to event */
503     int           op;           /* event operation (see below) */
504 @END
505 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
506
507
508 /* Open an event */
509 @REQ(open_event)
510     unsigned int access;        /* wanted access rights */
511     int          inherit;       /* inherit flag */
512     VARARG(name,unicode_str);   /* object name */
513 @REPLY
514     obj_handle_t handle;        /* handle to the event */
515 @END
516
517
518 /* Create a mutex */
519 @REQ(create_mutex)
520     int          owned;         /* initially owned? */
521     int          inherit;       /* inherit flag */
522     VARARG(name,unicode_str);   /* object name */
523 @REPLY
524     obj_handle_t handle;        /* handle to the mutex */
525 @END
526
527
528 /* Release a mutex */
529 @REQ(release_mutex)
530     obj_handle_t handle;        /* handle to the mutex */
531 @END
532
533
534 /* Open a mutex */
535 @REQ(open_mutex)
536     unsigned int access;        /* wanted access rights */
537     int          inherit;       /* inherit flag */
538     VARARG(name,unicode_str);   /* object name */
539 @REPLY
540     obj_handle_t handle;        /* handle to the mutex */
541 @END
542
543
544 /* Create a semaphore */
545 @REQ(create_semaphore)
546     unsigned int initial;       /* initial count */
547     unsigned int max;           /* maximum count */
548     int          inherit;       /* inherit flag */
549     VARARG(name,unicode_str);   /* object name */
550 @REPLY
551     obj_handle_t handle;        /* handle to the semaphore */
552 @END
553
554
555 /* Release a semaphore */
556 @REQ(release_semaphore)
557     obj_handle_t handle;        /* handle to the semaphore */
558     unsigned int count;         /* count to add to semaphore */
559 @REPLY
560     unsigned int prev_count;    /* previous semaphore count */
561 @END
562
563
564 /* Open a semaphore */
565 @REQ(open_semaphore)
566     unsigned int access;        /* wanted access rights */
567     int          inherit;       /* inherit flag */
568     VARARG(name,unicode_str);   /* object name */
569 @REPLY
570     obj_handle_t handle;        /* handle to the semaphore */
571 @END
572
573
574 /* Create a file */
575 @REQ(create_file)
576     unsigned int access;        /* wanted access rights */
577     int          inherit;       /* inherit flag */
578     unsigned int sharing;       /* sharing flags */
579     int          create;        /* file create action */
580     unsigned int options;       /* file options */
581     unsigned int attrs;         /* file attributes for creation */
582     VARARG(filename,string);    /* file name */
583 @REPLY
584     obj_handle_t handle;        /* handle to the file */
585 @END
586
587
588 /* Allocate a file handle for a Unix fd */
589 @REQ(alloc_file_handle)
590     unsigned int access;        /* wanted access rights */
591     int          inherit;       /* inherit flag */
592     int          fd;            /* file descriptor on the client side */
593 @REPLY
594     obj_handle_t handle;        /* handle to the file */
595 @END
596
597
598 /* Get a Unix fd to access a file */
599 @REQ(get_handle_fd)
600     obj_handle_t handle;        /* handle to the file */
601     unsigned int access;        /* wanted access rights */
602 @REPLY
603     int          fd;            /* file descriptor */
604     int          type;          /* the type of file (see below) */
605     int          flags;         /* file read/write flags (see below) */
606 @END
607 enum fd_type
608 {
609     FD_TYPE_INVALID,
610     FD_TYPE_DEFAULT,
611     FD_TYPE_SOCKET
612 };
613 #define FD_FLAG_OVERLAPPED         0x01
614 #define FD_FLAG_TIMEOUT            0x02
615 #define FD_FLAG_RECV_SHUTDOWN      0x04
616 #define FD_FLAG_SEND_SHUTDOWN      0x08
617
618
619 /* Flush a file buffers */
620 @REQ(flush_file)
621     obj_handle_t handle;        /* handle to the file */
622 @REPLY
623     obj_handle_t event;         /* event set when finished */
624 @END
625
626
627 /* Lock a region of a file */
628 @REQ(lock_file)
629     obj_handle_t handle;        /* handle to the file */
630     unsigned int offset_low;    /* offset of start of lock */
631     unsigned int offset_high;   /* offset of start of lock */
632     unsigned int count_low;     /* count of bytes to lock */
633     unsigned int count_high;    /* count of bytes to lock */
634     int          shared;        /* shared or exclusive lock? */
635     int          wait;          /* do we want to wait? */
636 @REPLY
637     obj_handle_t handle;        /* handle to wait on */
638     int          overlapped;    /* is it an overlapped I/O handle? */
639 @END
640
641
642 /* Unlock a region of a file */
643 @REQ(unlock_file)
644     obj_handle_t handle;        /* handle to the file */
645     unsigned int offset_low;    /* offset of start of unlock */
646     unsigned int offset_high;   /* offset of start of unlock */
647     unsigned int count_low;     /* count of bytes to unlock */
648     unsigned int count_high;    /* count of bytes to unlock */
649 @END
650
651
652 /* Create a socket */
653 @REQ(create_socket)
654     unsigned int access;        /* wanted access rights */
655     int          inherit;       /* inherit flag */
656     int          family;        /* family, see socket manpage */
657     int          type;          /* type, see socket manpage */
658     int          protocol;      /* protocol, see socket manpage */
659     unsigned int flags;         /* socket flags */
660 @REPLY
661     obj_handle_t handle;        /* handle to the new socket */
662 @END
663
664
665 /* Accept a socket */
666 @REQ(accept_socket)
667     obj_handle_t lhandle;       /* handle to the listening socket */
668     unsigned int access;        /* wanted access rights */
669     int          inherit;       /* inherit flag */
670 @REPLY
671     obj_handle_t handle;        /* handle to the new socket */
672 @END
673
674
675 /* Set socket event parameters */
676 @REQ(set_socket_event)
677     obj_handle_t  handle;        /* handle to the socket */
678     unsigned int  mask;          /* event mask */
679     obj_handle_t  event;         /* event object */
680     user_handle_t window;        /* window to send the message to */
681     unsigned int  msg;           /* message to send */
682 @END
683
684
685 /* Get socket event parameters */
686 @REQ(get_socket_event)
687     obj_handle_t handle;        /* handle to the socket */
688     int          service;       /* clear pending? */
689     obj_handle_t c_event;       /* event to clear */
690 @REPLY
691     unsigned int mask;          /* event mask */
692     unsigned int pmask;         /* pending events */
693     unsigned int state;         /* status bits */
694     VARARG(errors,ints);        /* event errors */
695 @END
696
697
698 /* Reenable pending socket events */
699 @REQ(enable_socket_event)
700     obj_handle_t handle;        /* handle to the socket */
701     unsigned int mask;          /* events to re-enable */
702     unsigned int sstate;        /* status bits to set */
703     unsigned int cstate;        /* status bits to clear */
704 @END
705
706 @REQ(set_socket_deferred)
707     obj_handle_t handle;        /* handle to the socket */
708     obj_handle_t deferred;      /* handle to the socket for which accept() is deferred */
709 @END
710
711 /* Allocate a console (only used by a console renderer) */
712 @REQ(alloc_console)
713     unsigned int access;        /* wanted access rights */
714     int          inherit;       /* inherit flag */
715     process_id_t pid;           /* pid of process which shall be attached to the console */
716 @REPLY
717     obj_handle_t handle_in;     /* handle to console input */
718     obj_handle_t event;         /* handle to renderer events change notification */
719 @END
720
721
722 /* Free the console of the current process */
723 @REQ(free_console)
724 @END
725
726
727 #define CONSOLE_RENDERER_NONE_EVENT        0x00
728 #define CONSOLE_RENDERER_TITLE_EVENT       0x01
729 #define CONSOLE_RENDERER_ACTIVE_SB_EVENT   0x02
730 #define CONSOLE_RENDERER_SB_RESIZE_EVENT   0x03
731 #define CONSOLE_RENDERER_UPDATE_EVENT      0x04
732 #define CONSOLE_RENDERER_CURSOR_POS_EVENT  0x05
733 #define CONSOLE_RENDERER_CURSOR_GEOM_EVENT 0x06
734 #define CONSOLE_RENDERER_DISPLAY_EVENT     0x07
735 #define CONSOLE_RENDERER_EXIT_EVENT        0x08
736 struct console_renderer_event
737 {
738     short event;
739     union
740     {
741         struct update
742         {
743             short top;
744             short bottom;
745         } update;
746         struct resize
747         {
748             short width;
749             short height;
750         } resize;
751         struct cursor_pos
752         {
753             short x;
754             short y;
755         } cursor_pos;
756         struct cursor_geom
757         {
758             short visible;
759             short size;
760         } cursor_geom;
761         struct display
762         {
763             short left;
764             short top;
765             short width;
766             short height;
767         } display;
768     } u;
769 };
770
771 /* retrieve console events for the renderer */
772 @REQ(get_console_renderer_events)
773     obj_handle_t handle;        /* handle to console input events */
774 @REPLY
775     VARARG(data,bytes);         /* the various console_renderer_events */
776 @END
777
778
779 /* Open a handle to the process console */
780 @REQ(open_console)
781     int          from;          /* 0 (resp 1) input (resp output) of current process console */
782                                 /* otherwise console_in handle to get active screen buffer? */
783     unsigned int access;        /* wanted access rights */
784     int          inherit;       /* inherit flag */
785     int          share;         /* share mask (only for output handles) */
786 @REPLY
787     obj_handle_t handle;        /* handle to the console */
788 @END
789
790
791 /* Get the input queue wait event */
792 @REQ(get_console_wait_event)
793 @REPLY
794     obj_handle_t handle;
795 @END
796
797 /* Get a console mode (input or output) */
798 @REQ(get_console_mode)
799     obj_handle_t handle;        /* handle to the console */
800 @REPLY
801     int          mode;          /* console mode */
802 @END
803
804
805 /* Set a console mode (input or output) */
806 @REQ(set_console_mode)
807     obj_handle_t handle;        /* handle to the console */
808     int          mode;          /* console mode */
809 @END
810
811
812 /* Set info about a console (input only) */
813 @REQ(set_console_input_info)
814     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
815     int          mask;          /* setting mask (see below) */
816     obj_handle_t active_sb;     /* active screen buffer */
817     int          history_mode;  /* whether we duplicate lines in history */
818     int          history_size;  /* number of lines in history */
819     int          edition_mode;  /* index to the edition mode flavors */
820     VARARG(title,unicode_str);  /* console title */
821 @END
822 #define SET_CONSOLE_INPUT_INFO_ACTIVE_SB        0x01
823 #define SET_CONSOLE_INPUT_INFO_TITLE            0x02
824 #define SET_CONSOLE_INPUT_INFO_HISTORY_MODE     0x04
825 #define SET_CONSOLE_INPUT_INFO_HISTORY_SIZE     0x08
826 #define SET_CONSOLE_INPUT_INFO_EDITION_MODE     0x10
827
828
829 /* Get info about a console (input only) */
830 @REQ(get_console_input_info)
831     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
832 @REPLY
833     int          history_mode;  /* whether we duplicate lines in history */
834     int          history_size;  /* number of lines in history */
835     int          history_index; /* number of used lines in history */
836     int          edition_mode;  /* index to the edition mode flavors */
837     VARARG(title,unicode_str);  /* console title */
838 @END
839
840
841 /* appends a string to console's history */
842 @REQ(append_console_input_history)
843     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
844     VARARG(line,unicode_str);   /* line to add */
845 @END
846
847
848 /* appends a string to console's history */
849 @REQ(get_console_input_history)
850     obj_handle_t handle;        /* handle to console input, or 0 for process' console */
851     int          index;         /* index to get line from */
852 @REPLY
853     int          total;         /* total length of line in Unicode chars */
854     VARARG(line,unicode_str);   /* line to add */
855 @END
856
857
858 /* creates a new screen buffer on process' console */
859 @REQ(create_console_output)
860     obj_handle_t handle_in;     /* handle to console input, or 0 for process' console */
861     int          access;        /* wanted access rights */
862     int          share;         /* sharing credentials */
863     int          inherit;       /* inherit flag */
864 @REPLY
865     obj_handle_t handle_out;    /* handle to the screen buffer */
866 @END
867
868
869 /* Set info about a console (output only) */
870 @REQ(set_console_output_info)
871     obj_handle_t handle;        /* handle to the console */
872     int          mask;          /* setting mask (see below) */
873     short int    cursor_size;   /* size of cursor (percentage filled) */
874     short int    cursor_visible;/* cursor visibility flag */
875     short int    cursor_x;      /* position of cursor (x, y) */
876     short int    cursor_y;
877     short int    width;         /* width of the screen buffer */
878     short int    height;        /* height of the screen buffer */
879     short int    attr;          /* default attribute */
880     short int    win_left;      /* window actually displayed by renderer */
881     short int    win_top;       /* the rect area is expressed withing the */
882     short int    win_right;     /* boundaries of the screen buffer */
883     short int    win_bottom;
884     short int    max_width;     /* maximum size (width x height) for the window */
885     short int    max_height;
886 @END
887 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM     0x01
888 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS      0x02
889 #define SET_CONSOLE_OUTPUT_INFO_SIZE            0x04
890 #define SET_CONSOLE_OUTPUT_INFO_ATTR            0x08
891 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW  0x10
892 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
893
894
895 /* Get info about a console (output only) */
896 @REQ(get_console_output_info)
897     obj_handle_t handle;        /* handle to the console */
898 @REPLY
899     short int    cursor_size;   /* size of cursor (percentage filled) */
900     short int    cursor_visible;/* cursor visibility flag */
901     short int    cursor_x;      /* position of cursor (x, y) */
902     short int    cursor_y;
903     short int    width;         /* width of the screen buffer */
904     short int    height;        /* height of the screen buffer */
905     short int    attr;          /* default attribute */
906     short int    win_left;      /* window actually displayed by renderer */
907     short int    win_top;       /* the rect area is expressed withing the */
908     short int    win_right;     /* boundaries of the screen buffer */
909     short int    win_bottom;
910     short int    max_width;     /* maximum size (width x height) for the window */
911     short int    max_height;
912 @END
913
914 /* Add input records to a console input queue */
915 @REQ(write_console_input)
916     obj_handle_t handle;        /* handle to the console input */
917     VARARG(rec,input_records);  /* input records */
918 @REPLY
919     int          written;       /* number of records written */
920 @END
921
922
923 /* Fetch input records from a console input queue */
924 @REQ(read_console_input)
925     obj_handle_t handle;        /* handle to the console input */
926     int          flush;         /* flush the retrieved records from the queue? */
927 @REPLY
928     int          read;          /* number of records read */
929     VARARG(rec,input_records);  /* input records */
930 @END
931
932
933 /* write data (chars and/or attributes) in a screen buffer */
934 @REQ(write_console_output)
935     obj_handle_t handle;        /* handle to the console output */
936     int          x;             /* position where to start writing */
937     int          y;
938     int          mode;          /* char info (see below) */
939     int          wrap;          /* wrap around at end of line? */
940     VARARG(data,bytes);         /* info to write */
941 @REPLY
942     int          written;       /* number of char infos actually written */
943     int          width;         /* width of screen buffer */
944     int          height;        /* height of screen buffer */
945 @END
946 enum char_info_mode
947 {
948     CHAR_INFO_MODE_TEXT,        /* characters only */
949     CHAR_INFO_MODE_ATTR,        /* attributes only */
950     CHAR_INFO_MODE_TEXTATTR,    /* both characters and attributes */
951     CHAR_INFO_MODE_TEXTSTDATTR  /* characters but use standard attributes */
952 };
953
954
955 /* fill a screen buffer with constant data (chars and/or attributes) */
956 @REQ(fill_console_output)
957     obj_handle_t handle;        /* handle to the console output */
958     int          x;             /* position where to start writing */
959     int          y;
960     int          mode;          /* char info mode */
961     int          count;         /* number to write */
962     int          wrap;          /* wrap around at end of line? */
963     char_info_t  data;          /* data to write */
964 @REPLY
965     int          written;       /* number of char infos actually written */
966 @END
967
968
969 /* read data (chars and/or attributes) from a screen buffer */
970 @REQ(read_console_output)
971     obj_handle_t handle;        /* handle to the console output */
972     int          x;             /* position (x,y) where to start reading */
973     int          y;
974     int          mode;          /* char info mode */
975     int          wrap;          /* wrap around at end of line? */
976 @REPLY
977     int          width;         /* width of screen buffer */
978     int          height;        /* height of screen buffer */
979     VARARG(data,bytes);
980 @END
981
982
983 /* move a rect (of data) in screen buffer content */
984 @REQ(move_console_output)
985     obj_handle_t handle;        /* handle to the console output */
986     short int    x_src;         /* position (x, y) of rect to start moving from */
987     short int    y_src;
988     short int    x_dst;         /* position (x, y) of rect to move to */
989     short int    y_dst;
990     short int    w;             /* size of the rect (width, height) to move */
991     short int    h;
992 @END
993
994
995 /* Sends a signal to a process group */
996 @REQ(send_console_signal)
997     int          signal;        /* the signal to send */
998     process_id_t group_id;      /* the group to send the signal to */
999 @END
1000
1001
1002 /* Create a change notification */
1003 @REQ(create_change_notification)
1004     obj_handle_t handle;        /* handle to the directory */
1005     int          subtree;       /* watch all the subtree */
1006     unsigned int filter;        /* notification filter */
1007 @REPLY
1008     obj_handle_t handle;        /* handle to the change notification */
1009 @END
1010
1011
1012 /* Move to the next change notification */
1013 @REQ(next_change_notification)
1014     obj_handle_t handle;        /* handle to the change notification */
1015 @END
1016
1017 /* Create a file mapping */
1018 @REQ(create_mapping)
1019     int          size_high;     /* mapping size */
1020     int          size_low;      /* mapping size */
1021     int          protect;       /* protection flags (see below) */
1022     unsigned int access;        /* wanted access rights */
1023     int          inherit;       /* inherit flag */
1024     obj_handle_t file_handle;   /* file handle */
1025     VARARG(name,unicode_str);   /* object name */
1026 @REPLY
1027     obj_handle_t handle;        /* handle to the mapping */
1028 @END
1029 /* protection flags */
1030 #define VPROT_READ       0x01
1031 #define VPROT_WRITE      0x02
1032 #define VPROT_EXEC       0x04
1033 #define VPROT_WRITECOPY  0x08
1034 #define VPROT_GUARD      0x10
1035 #define VPROT_NOCACHE    0x20
1036 #define VPROT_COMMITTED  0x40
1037 #define VPROT_IMAGE      0x80
1038
1039
1040 /* Open a mapping */
1041 @REQ(open_mapping)
1042     unsigned int access;        /* wanted access rights */
1043     int          inherit;       /* inherit flag */
1044     VARARG(name,unicode_str);   /* object name */
1045 @REPLY
1046     obj_handle_t handle;        /* handle to the mapping */
1047 @END
1048
1049
1050 /* Get information about a file mapping */
1051 @REQ(get_mapping_info)
1052     obj_handle_t handle;        /* handle to the mapping */
1053 @REPLY
1054     int          size_high;     /* mapping size */
1055     int          size_low;      /* mapping size */
1056     int          protect;       /* protection flags */
1057     int          header_size;   /* header size (for VPROT_IMAGE mapping) */
1058     void*        base;          /* default base addr (for VPROT_IMAGE mapping) */
1059     obj_handle_t shared_file;   /* shared mapping file handle */
1060     int          shared_size;   /* shared mapping size */
1061 @END
1062
1063
1064 #define SNAP_HEAPLIST   0x00000001
1065 #define SNAP_PROCESS    0x00000002
1066 #define SNAP_THREAD     0x00000004
1067 #define SNAP_MODULE     0x00000008
1068 /* Create a snapshot */
1069 @REQ(create_snapshot)
1070     int          inherit;       /* inherit flag */
1071     int          flags;         /* snapshot flags (SNAP_*) */
1072     process_id_t pid;           /* process id */
1073 @REPLY
1074     obj_handle_t handle;        /* handle to the snapshot */
1075 @END
1076
1077
1078 /* Get the next process from a snapshot */
1079 @REQ(next_process)
1080     obj_handle_t handle;        /* handle to the snapshot */
1081     int          reset;         /* reset snapshot position? */
1082 @REPLY
1083     int          count;         /* process usage count */
1084     process_id_t pid;           /* process id */
1085     process_id_t ppid;          /* parent process id */
1086     void*        heap;          /* heap base */
1087     void*        module;        /* main module */
1088     int          threads;       /* number of threads */
1089     int          priority;      /* process priority */
1090     int          handles;       /* number of handles */
1091     VARARG(filename,unicode_str); /* file name of main exe */
1092 @END
1093
1094
1095 /* Get the next thread from a snapshot */
1096 @REQ(next_thread)
1097     obj_handle_t handle;        /* handle to the snapshot */
1098     int          reset;         /* reset snapshot position? */
1099 @REPLY
1100     int          count;         /* thread usage count */
1101     process_id_t pid;           /* process id */
1102     thread_id_t  tid;           /* thread id */
1103     int          base_pri;      /* base priority */
1104     int          delta_pri;     /* delta priority */
1105 @END
1106
1107
1108 /* Get the next module from a snapshot */
1109 @REQ(next_module)
1110     obj_handle_t handle;        /* handle to the snapshot */
1111     int          reset;         /* reset snapshot position? */
1112 @REPLY
1113     process_id_t pid;           /* process id */
1114     void*        base;          /* module base address */
1115     size_t       size;          /* module size */
1116     VARARG(filename,unicode_str); /* file name of module */
1117 @END
1118
1119
1120 /* Wait for a debug event */
1121 @REQ(wait_debug_event)
1122     int           get_handle;  /* should we alloc a handle for waiting? */
1123 @REPLY
1124     process_id_t  pid;         /* process id */
1125     thread_id_t   tid;         /* thread id */
1126     obj_handle_t  wait;        /* wait handle if no event ready */
1127     VARARG(event,debug_event); /* debug event data */
1128 @END
1129
1130
1131 /* Queue an exception event */
1132 @REQ(queue_exception_event)
1133     int              first;    /* first chance exception? */
1134     VARARG(record,exc_event);  /* thread context followed by exception record */
1135 @REPLY
1136     obj_handle_t     handle;   /* handle to the queued event */
1137 @END
1138
1139
1140 /* Retrieve the status of an exception event */
1141 @REQ(get_exception_status)
1142     obj_handle_t     handle;   /* handle to the queued event */
1143 @REPLY
1144     int              status;   /* event continuation status */
1145     VARARG(context,context);   /* modified thread context */
1146 @END
1147
1148
1149 /* Send an output string to the debugger */
1150 @REQ(output_debug_string)
1151     void*         string;      /* string to display (in debugged process address space) */
1152     int           unicode;     /* is it Unicode? */
1153     int           length;      /* string length */
1154 @END
1155
1156
1157 /* Continue a debug event */
1158 @REQ(continue_debug_event)
1159     process_id_t pid;          /* process id to continue */
1160     thread_id_t  tid;          /* thread id to continue */
1161     int          status;       /* continuation status */
1162 @END
1163
1164
1165 /* Start/stop debugging an existing process */
1166 @REQ(debug_process)
1167     process_id_t pid;          /* id of the process to debug */
1168     int          attach;       /* 1=attaching / 0=detaching from the process */
1169 @END
1170
1171
1172 /* Simulate a breakpoint in a process */
1173 @REQ(debug_break)
1174     obj_handle_t handle;       /* process handle */
1175 @REPLY
1176     int          self;         /* was it the caller itself? */
1177 @END
1178
1179
1180 /* Set debugger kill on exit flag */
1181 @REQ(set_debugger_kill_on_exit)
1182     int          kill_on_exit;  /* 0=detach/1=kill debuggee when debugger dies */
1183 @END
1184
1185
1186 /* Read data from a process address space */
1187 @REQ(read_process_memory)
1188     obj_handle_t handle;       /* process handle */
1189     void*        addr;         /* addr to read from */
1190 @REPLY
1191     VARARG(data,bytes);        /* result data */
1192 @END
1193
1194
1195 /* Write data to a process address space */
1196 @REQ(write_process_memory)
1197     obj_handle_t handle;       /* process handle */
1198     void*        addr;         /* addr to write to (must be int-aligned) */
1199     unsigned int first_mask;   /* mask for first word */
1200     unsigned int last_mask;    /* mask for last word */
1201     VARARG(data,bytes);        /* data to write */
1202 @END
1203
1204
1205 /* Create a registry key */
1206 @REQ(create_key)
1207     obj_handle_t parent;       /* handle to the parent key */
1208     unsigned int access;       /* desired access rights */
1209     unsigned int options;      /* creation options */
1210     time_t       modif;        /* last modification time */
1211     size_t       namelen;      /* length of key name in bytes */
1212     VARARG(name,unicode_str,namelen);  /* key name */
1213     VARARG(class,unicode_str);         /* class name */
1214 @REPLY
1215     obj_handle_t hkey;         /* handle to the created key */
1216     int          created;      /* has it been newly created? */
1217 @END
1218
1219 /* Open a registry key */
1220 @REQ(open_key)
1221     obj_handle_t parent;       /* handle to the parent key */
1222     unsigned int access;       /* desired access rights */
1223     VARARG(name,unicode_str);  /* key name */
1224 @REPLY
1225     obj_handle_t hkey;         /* handle to the open key */
1226 @END
1227
1228
1229 /* Delete a registry key */
1230 @REQ(delete_key)
1231     obj_handle_t hkey;         /* handle to the key */
1232 @END
1233
1234
1235 /* Flush a registry key */
1236 @REQ(flush_key)
1237     obj_handle_t hkey;         /* handle to the key */
1238 @END
1239
1240
1241 /* Enumerate registry subkeys */
1242 @REQ(enum_key)
1243     obj_handle_t hkey;         /* handle to registry key */
1244     int          index;        /* index of subkey (or -1 for current key) */
1245     int          info_class;   /* requested information class */
1246 @REPLY
1247     int          subkeys;      /* number of subkeys */
1248     int          max_subkey;   /* longest subkey name */
1249     int          max_class;    /* longest class name */
1250     int          values;       /* number of values */
1251     int          max_value;    /* longest value name */
1252     int          max_data;     /* longest value data */
1253     time_t       modif;        /* last modification time */
1254     size_t       total;        /* total length needed for full name and class */
1255     size_t       namelen;      /* length of key name in bytes */
1256     VARARG(name,unicode_str,namelen);  /* key name */
1257     VARARG(class,unicode_str);         /* class name */
1258 @END
1259
1260
1261 /* Set a value of a registry key */
1262 @REQ(set_key_value)
1263     obj_handle_t hkey;         /* handle to registry key */
1264     int          type;         /* value type */
1265     size_t       namelen;      /* length of value name in bytes */
1266     VARARG(name,unicode_str,namelen);  /* value name */
1267     VARARG(data,bytes);                /* value data */
1268 @END
1269
1270
1271 /* Retrieve the value of a registry key */
1272 @REQ(get_key_value)
1273     obj_handle_t hkey;         /* handle to registry key */
1274     VARARG(name,unicode_str);  /* value name */
1275 @REPLY
1276     int          type;         /* value type */
1277     size_t       total;        /* total length needed for data */
1278     VARARG(data,bytes);        /* value data */
1279 @END
1280
1281
1282 /* Enumerate a value of a registry key */
1283 @REQ(enum_key_value)
1284     obj_handle_t hkey;         /* handle to registry key */
1285     int          index;        /* value index */
1286     int          info_class;   /* requested information class */
1287 @REPLY
1288     int          type;         /* value type */
1289     size_t       total;        /* total length needed for full name and data */
1290     size_t       namelen;      /* length of value name in bytes */
1291     VARARG(name,unicode_str,namelen);  /* value name */
1292     VARARG(data,bytes);                /* value data */
1293 @END
1294
1295
1296 /* Delete a value of a registry key */
1297 @REQ(delete_key_value)
1298     obj_handle_t hkey;         /* handle to registry key */
1299     VARARG(name,unicode_str);  /* value name */
1300 @END
1301
1302
1303 /* Load a registry branch from a file */
1304 @REQ(load_registry)
1305     obj_handle_t hkey;         /* root key to load to */
1306     obj_handle_t file;         /* file to load from */
1307     VARARG(name,unicode_str);  /* subkey name */
1308 @END
1309
1310
1311 /* UnLoad a registry branch from a file */
1312 @REQ(unload_registry)
1313     obj_handle_t hkey;         /* root key to unload to */
1314 @END
1315
1316
1317 /* Save a registry branch to a file */
1318 @REQ(save_registry)
1319     obj_handle_t hkey;         /* key to save */
1320     obj_handle_t file;         /* file to save to */
1321 @END
1322
1323
1324 /* Load the user registry files */
1325 @REQ(load_user_registries)
1326     obj_handle_t hkey;         /* key for HKCU */
1327     int          saving;       /* new saving level */
1328     int          period;       /* duration between periodic saves (milliseconds) */
1329 @END
1330
1331
1332 /* Add a registry key change notification */
1333 @REQ(set_registry_notification)
1334     obj_handle_t hkey;         /* key to watch for changes */
1335     obj_handle_t event;        /* event to set */
1336     int          subtree;      /* should we watch the whole subtree? */
1337     unsigned int filter;       /* things to watch */
1338 @END
1339
1340
1341 /* Create a waitable timer */
1342 @REQ(create_timer)
1343     int          inherit;       /* inherit flag */
1344     int          manual;        /* manual reset */
1345     VARARG(name,unicode_str);   /* object name */
1346 @REPLY
1347     obj_handle_t handle;        /* handle to the timer */
1348 @END
1349
1350
1351 /* Open a waitable timer */
1352 @REQ(open_timer)
1353     unsigned int access;        /* wanted access rights */
1354     int          inherit;       /* inherit flag */
1355     VARARG(name,unicode_str);   /* object name */
1356 @REPLY
1357     obj_handle_t handle;        /* handle to the timer */
1358 @END
1359
1360 /* Set a waitable timer */
1361 @REQ(set_timer)
1362     obj_handle_t handle;        /* handle to the timer */
1363     abs_time_t   expire;        /* next expiration absolute time */
1364     int          period;        /* timer period in ms */
1365     void*        callback;      /* callback function */
1366     void*        arg;           /* callback argument */
1367 @REPLY
1368     int          signaled;      /* was the timer signaled before this call ? */
1369 @END
1370
1371 /* Cancel a waitable timer */
1372 @REQ(cancel_timer)
1373     obj_handle_t handle;        /* handle to the timer */
1374 @REPLY
1375      int         signaled;      /* was the timer signaled before this calltime ? */
1376 @END
1377
1378
1379 /* Retrieve the current context of a thread */
1380 @REQ(get_thread_context)
1381     obj_handle_t handle;       /* thread handle */
1382     unsigned int flags;        /* context flags */
1383 @REPLY
1384     VARARG(context,context);   /* thread context */
1385 @END
1386
1387
1388 /* Set the current context of a thread */
1389 @REQ(set_thread_context)
1390     obj_handle_t handle;       /* thread handle */
1391     unsigned int flags;        /* context flags */
1392     VARARG(context,context);   /* thread context */
1393 @END
1394
1395
1396 /* Fetch a selector entry for a thread */
1397 @REQ(get_selector_entry)
1398     obj_handle_t  handle;      /* thread handle */
1399     int           entry;       /* LDT entry */
1400 @REPLY
1401     unsigned int  base;        /* selector base */
1402     unsigned int  limit;       /* selector limit */
1403     unsigned char flags;       /* selector flags */
1404 @END
1405
1406
1407 /* Add an atom */
1408 @REQ(add_atom)
1409     int           local;       /* is atom in local process table? */
1410     VARARG(name,unicode_str);  /* atom name */
1411 @REPLY
1412     atom_t        atom;        /* resulting atom */
1413 @END
1414
1415
1416 /* Delete an atom */
1417 @REQ(delete_atom)
1418     atom_t        atom;        /* atom handle */
1419     int           local;       /* is atom in local process table? */
1420 @END
1421
1422
1423 /* Find an atom */
1424 @REQ(find_atom)
1425     int          local;        /* is atom in local process table? */
1426     VARARG(name,unicode_str);  /* atom name */
1427 @REPLY
1428     atom_t       atom;         /* atom handle */
1429 @END
1430
1431
1432 /* Get an atom name */
1433 @REQ(get_atom_name)
1434     atom_t       atom;         /* atom handle */
1435     int          local;        /* is atom in local process table? */
1436 @REPLY
1437     int          count;        /* atom lock count */
1438     VARARG(name,unicode_str);  /* atom name */
1439 @END
1440
1441
1442 /* Init the process atom table */
1443 @REQ(init_atom_table)
1444     int          entries;      /* number of entries */
1445 @END
1446
1447
1448 /* Get the message queue of the current thread */
1449 @REQ(get_msg_queue)
1450 @REPLY
1451     obj_handle_t handle;       /* handle to the queue */
1452 @END
1453
1454
1455 /* Set the current message queue wakeup mask */
1456 @REQ(set_queue_mask)
1457     unsigned int wake_mask;    /* wakeup bits mask */
1458     unsigned int changed_mask; /* changed bits mask */
1459     int          skip_wait;    /* will we skip waiting if signaled? */
1460 @REPLY
1461     unsigned int wake_bits;    /* current wake bits */
1462     unsigned int changed_bits; /* current changed bits */
1463 @END
1464
1465
1466 /* Get the current message queue status */
1467 @REQ(get_queue_status)
1468     int          clear;        /* should we clear the change bits? */
1469 @REPLY
1470     unsigned int wake_bits;    /* wake bits */
1471     unsigned int changed_bits; /* changed bits since last time */
1472 @END
1473
1474
1475 /* Wait for a process to start waiting on input */
1476 @REQ(wait_input_idle)
1477     obj_handle_t handle;       /* process handle */
1478     int          timeout;      /* timeout */
1479 @REPLY
1480     obj_handle_t event;        /* handle to idle event */
1481 @END
1482
1483
1484 /* Send a message to a thread queue */
1485 @REQ(send_message)
1486     thread_id_t     id;        /* thread id */
1487     int             type;      /* message type (see below) */
1488     int             flags;     /* message flags (see below) */
1489     user_handle_t   win;       /* window handle */
1490     unsigned int    msg;       /* message code */
1491     unsigned int    wparam;    /* parameters */
1492     unsigned int    lparam;    /* parameters */
1493     int             x;         /* x position */
1494     int             y;         /* y position */
1495     unsigned int    time;      /* message time */
1496     unsigned int    info;      /* extra info */
1497     int             timeout;   /* timeout for reply */
1498     void*           callback;  /* callback address */
1499     VARARG(data,bytes);        /* message data for sent messages */
1500 @END
1501
1502 enum message_type
1503 {
1504     MSG_ASCII,          /* Ascii message (from SendMessageA) */
1505     MSG_UNICODE,        /* Unicode message (from SendMessageW) */
1506     MSG_NOTIFY,         /* notify message (from SendNotifyMessageW), always Unicode */
1507     MSG_CALLBACK,       /* callback message (from SendMessageCallbackW), always Unicode */
1508     MSG_CALLBACK_RESULT,/* result of a callback message */
1509     MSG_OTHER_PROCESS,  /* sent from other process, may include vararg data, always Unicode */
1510     MSG_POSTED,         /* posted message (from PostMessageW), always Unicode */
1511     MSG_HARDWARE        /* hardware message */
1512 };
1513 #define SEND_MSG_ABORT_IF_HUNG  0x01
1514
1515
1516 /* Get a message from the current queue */
1517 @REQ(get_message)
1518     int             flags;     /* see below */
1519     user_handle_t   get_win;   /* window handle to get */
1520     unsigned int    get_first; /* first message code to get */
1521     unsigned int    get_last;  /* last message code to get */
1522 @REPLY
1523     int             type;      /* message type */
1524     user_handle_t   win;       /* window handle */
1525     unsigned int    msg;       /* message code */
1526     unsigned int    wparam;    /* parameters (callback function for MSG_CALLBACK_RESULT) */
1527     unsigned int    lparam;    /* parameters (result for MSG_CALLBACK_RESULT) */
1528     int             x;         /* x position */
1529     int             y;         /* y position */
1530     unsigned int    time;      /* message time */
1531     unsigned int    info;      /* extra info (callback argument for MSG_CALLBACK_RESULT) */
1532     size_t          total;     /* total size of extra data */
1533     VARARG(data,bytes);        /* message data for sent messages */
1534 @END
1535 #define GET_MSG_REMOVE      1  /* remove the message */
1536 #define GET_MSG_SENT_ONLY   2  /* only get sent messages */
1537
1538 /* Reply to a sent message */
1539 @REQ(reply_message)
1540     int             type;      /* type of original message */
1541     unsigned int    result;    /* message result */
1542     int             remove;    /* should we remove the message? */
1543     VARARG(data,bytes);        /* message data for sent messages */
1544 @END
1545
1546
1547 /* Retrieve the reply for the last message sent */
1548 @REQ(get_message_reply)
1549     int             cancel;    /* cancel message if not ready? */
1550 @REPLY
1551     unsigned int    result;    /* message result */
1552     VARARG(data,bytes);        /* message data for sent messages */
1553 @END
1554
1555
1556 /* Set a window timer */
1557 @REQ(set_win_timer)
1558     user_handle_t   win;       /* window handle */
1559     unsigned int    msg;       /* message to post */
1560     unsigned int    id;        /* timer id */
1561     unsigned int    rate;      /* timer rate in ms */
1562     unsigned int    lparam;    /* message lparam (callback proc) */
1563 @END
1564
1565
1566 /* Kill a window timer */
1567 @REQ(kill_win_timer)
1568     user_handle_t   win;       /* window handle */
1569     unsigned int    msg;       /* message to post */
1570     unsigned int    id;        /* timer id */
1571 @END
1572
1573
1574 /* Retrieve info about a serial port */
1575 @REQ(get_serial_info)
1576     obj_handle_t handle;       /* handle to comm port */
1577 @REPLY
1578     unsigned int readinterval;
1579     unsigned int readconst;
1580     unsigned int readmult;
1581     unsigned int writeconst;
1582     unsigned int writemult;
1583     unsigned int eventmask;
1584     unsigned int commerror;
1585 @END
1586
1587
1588 /* Set info about a serial port */
1589 @REQ(set_serial_info)
1590     obj_handle_t handle;       /* handle to comm port */
1591     int          flags;        /* bitmask to set values (see below) */
1592     unsigned int readinterval;
1593     unsigned int readconst;
1594     unsigned int readmult;
1595     unsigned int writeconst;
1596     unsigned int writemult;
1597     unsigned int eventmask;
1598     unsigned int commerror;
1599 @END
1600 #define SERIALINFO_SET_TIMEOUTS  0x01
1601 #define SERIALINFO_SET_MASK      0x02
1602 #define SERIALINFO_SET_ERROR     0x04
1603
1604
1605 /* Create / reschedule an async I/O */
1606 @REQ(register_async)
1607     obj_handle_t handle;  /* handle to comm port, socket or file */
1608     int          type;
1609     void*        overlapped;
1610     int          count;
1611     unsigned int status;
1612 @END
1613 #define ASYNC_TYPE_NONE  0x00
1614 #define ASYNC_TYPE_READ  0x01
1615 #define ASYNC_TYPE_WRITE 0x02
1616 #define ASYNC_TYPE_WAIT  0x03
1617
1618
1619 /* Create a named pipe */
1620 @REQ(create_named_pipe)
1621     unsigned int   openmode;
1622     unsigned int   pipemode;
1623     unsigned int   maxinstances;
1624     unsigned int   outsize;
1625     unsigned int   insize;
1626     unsigned int   timeout;
1627     int            inherit;      /* inherit flag */
1628     VARARG(name,unicode_str);    /* pipe name */
1629 @REPLY
1630     obj_handle_t   handle;       /* handle to the pipe */
1631 @END
1632
1633
1634 /* Open an existing named pipe */
1635 @REQ(open_named_pipe)
1636     unsigned int   access;
1637     int            inherit;      /* inherit flag */
1638     VARARG(name,unicode_str);    /* pipe name */
1639 @REPLY
1640     obj_handle_t   handle;       /* handle to the pipe */
1641 @END
1642
1643
1644 /* Connect to a named pipe */
1645 @REQ(connect_named_pipe)
1646     obj_handle_t   handle;
1647     void*          overlapped;
1648     void*          func;
1649 @END
1650
1651
1652 /* Wait for a named pipe */
1653 @REQ(wait_named_pipe)
1654     unsigned int   timeout;
1655     void*          overlapped;
1656     void*          func;
1657     VARARG(name,unicode_str);    /* pipe name */
1658 @END
1659
1660
1661 /* Disconnect a named pipe */
1662 @REQ(disconnect_named_pipe)
1663     obj_handle_t   handle;
1664 @REPLY
1665     int            fd;           /* associated fd to close */
1666 @END
1667
1668
1669 @REQ(get_named_pipe_info)
1670     obj_handle_t   handle;
1671 @REPLY
1672     unsigned int   flags;
1673     unsigned int   maxinstances;
1674     unsigned int   outsize;
1675     unsigned int   insize;
1676 @END
1677
1678
1679 /* Create a window */
1680 @REQ(create_window)
1681     user_handle_t  parent;      /* parent window */
1682     user_handle_t  owner;       /* owner window */
1683     atom_t         atom;        /* class atom */
1684     void*          instance;    /* module instance */
1685 @REPLY
1686     user_handle_t  handle;      /* created window */
1687     int            extra;       /* number of extra bytes */
1688     void*          class_ptr;   /* pointer to class in client address space */
1689 @END
1690
1691
1692 /* Link a window into the tree */
1693 @REQ(link_window)
1694     user_handle_t  handle;      /* handle to the window */
1695     user_handle_t  parent;      /* handle to the parent */
1696     user_handle_t  previous;    /* previous child in Z-order */
1697 @REPLY
1698     user_handle_t  full_parent; /* full handle of new parent */
1699 @END
1700
1701
1702 /* Destroy a window */
1703 @REQ(destroy_window)
1704     user_handle_t  handle;      /* handle to the window */
1705 @END
1706
1707
1708 /* Set a window owner */
1709 @REQ(set_window_owner)
1710     user_handle_t  handle;      /* handle to the window */
1711     user_handle_t  owner;       /* new owner */
1712 @REPLY
1713     user_handle_t  full_owner;  /* full handle of new owner */
1714     user_handle_t  prev_owner;  /* full handle of previous owner */
1715 @END
1716
1717
1718 /* Get information from a window handle */
1719 @REQ(get_window_info)
1720     user_handle_t  handle;      /* handle to the window */
1721 @REPLY
1722     user_handle_t  full_handle; /* full 32-bit handle */
1723     user_handle_t  last_active; /* last active popup */
1724     process_id_t   pid;         /* process owning the window */
1725     thread_id_t    tid;         /* thread owning the window */
1726     atom_t         atom;        /* class atom */
1727 @END
1728
1729
1730 /* Set some information in a window */
1731 @REQ(set_window_info)
1732     user_handle_t  handle;        /* handle to the window */
1733     unsigned int   flags;         /* flags for fields to set (see below) */
1734     unsigned int   style;         /* window style */
1735     unsigned int   ex_style;      /* window extended style */
1736     unsigned int   id;            /* window id */
1737     void*          instance;      /* creator instance */
1738     void*          user_data;     /* user-specific data */
1739     int            extra_offset;  /* offset to set in extra bytes */
1740     size_t         extra_size;    /* size to set in extra bytes */
1741     unsigned int   extra_value;   /* value to set in extra bytes */
1742 @REPLY
1743     unsigned int   old_style;     /* old window style */
1744     unsigned int   old_ex_style;  /* old window extended style */
1745     unsigned int   old_id;        /* old window id */
1746     void*          old_instance;  /* old creator instance */
1747     void*          old_user_data; /* old user-specific data */
1748     unsigned int   old_extra_value; /* old value in extra bytes */
1749 @END
1750 #define SET_WIN_STYLE     0x01
1751 #define SET_WIN_EXSTYLE   0x02
1752 #define SET_WIN_ID        0x04
1753 #define SET_WIN_INSTANCE  0x08
1754 #define SET_WIN_USERDATA  0x10
1755 #define SET_WIN_EXTRA     0x20
1756
1757
1758 /* Get a list of the window parents, up to the root of the tree */
1759 @REQ(get_window_parents)
1760     user_handle_t  handle;        /* handle to the window */
1761 @REPLY
1762     int            count;         /* total count of parents */
1763     VARARG(parents,user_handles); /* parent handles */
1764 @END
1765
1766
1767 /* Get a list of the window children */
1768 @REQ(get_window_children)
1769     user_handle_t  parent;        /* parent window */
1770     atom_t         atom;          /* class atom for the listed children */
1771     thread_id_t    tid;           /* thread owning the listed children */
1772 @REPLY
1773     int            count;         /* total count of children */
1774     VARARG(children,user_handles); /* children handles */
1775 @END
1776
1777
1778 /* Get window tree information from a window handle */
1779 @REQ(get_window_tree)
1780     user_handle_t  handle;        /* handle to the window */
1781 @REPLY
1782     user_handle_t  parent;        /* parent window */
1783     user_handle_t  owner;         /* owner window */
1784     user_handle_t  next_sibling;  /* next sibling in Z-order */
1785     user_handle_t  prev_sibling;  /* prev sibling in Z-order */
1786     user_handle_t  first_sibling; /* first sibling in Z-order */
1787     user_handle_t  last_sibling;  /* last sibling in Z-order */
1788     user_handle_t  first_child;   /* first child */
1789     user_handle_t  last_child;    /* last child */
1790 @END
1791
1792 /* Set the window and client rectangles of a window */
1793 @REQ(set_window_rectangles)
1794     user_handle_t  handle;        /* handle to the window */
1795     rectangle_t    window;        /* window rectangle */
1796     rectangle_t    client;        /* client rectangle */
1797 @END
1798
1799
1800 /* Get the window and client rectangles of a window */
1801 @REQ(get_window_rectangles)
1802     user_handle_t  handle;        /* handle to the window */
1803 @REPLY
1804     rectangle_t    window;        /* window rectangle */
1805     rectangle_t    client;        /* client rectangle */
1806 @END
1807
1808
1809 /* Get the window text */
1810 @REQ(get_window_text)
1811     user_handle_t  handle;        /* handle to the window */
1812 @REPLY
1813     VARARG(text,unicode_str);     /* window text */
1814 @END
1815
1816
1817 /* Set the window text */
1818 @REQ(set_window_text)
1819     user_handle_t  handle;        /* handle to the window */
1820     VARARG(text,unicode_str);     /* window text */
1821 @END
1822
1823
1824 /* Increment the window paint count */
1825 @REQ(inc_window_paint_count)
1826     user_handle_t  handle;        /* handle to the window */
1827     int             incr;         /* increment (can be negative) */
1828 @END
1829
1830
1831 /* Get the coordinates offset between two windows */
1832 @REQ(get_windows_offset)
1833     user_handle_t  from;          /* handle to the first window */
1834     user_handle_t  to;            /* handle to the second window */
1835 @REPLY
1836     int            x;             /* x coordinate offset */
1837     int            y;             /* y coordinate offset */
1838 @END
1839
1840
1841 /* Get the visible region of a window */
1842 @REQ(get_visible_region)
1843     user_handle_t  window;        /* handle to the window */
1844     user_handle_t  top_win;       /* top window to clip against */
1845     unsigned int   flags;         /* DCX flags */
1846 @REPLY
1847     size_t         total_size;    /* total size of the resulting region */
1848     VARARG(region,rectangles);    /* list of rectangles for the region */
1849 @END
1850
1851
1852 /* Get the window region */
1853 @REQ(get_window_region)
1854     user_handle_t  window;        /* handle to the window */
1855 @REPLY
1856     size_t         total_size;    /* total size of the resulting region */
1857     VARARG(region,rectangles);    /* list of rectangles for the region */
1858 @END
1859
1860
1861 /* Set the window region */
1862 @REQ(set_window_region)
1863     user_handle_t  window;        /* handle to the window */
1864     VARARG(region,rectangles);    /* list of rectangles for the region */
1865 @END
1866
1867
1868 /* Set a window property */
1869 @REQ(set_window_property)
1870     user_handle_t  window;        /* handle to the window */
1871     atom_t         atom;          /* property atom (high-word set if it was a string) */
1872     int            string;        /* was atom a string originally? */
1873     obj_handle_t   handle;        /* handle to store */
1874 @END
1875
1876
1877 /* Remove a window property */
1878 @REQ(remove_window_property)
1879     user_handle_t  window;        /* handle to the window */
1880     atom_t         atom;          /* property atom */
1881 @REPLY
1882     obj_handle_t   handle;        /* handle stored in property */
1883 @END
1884
1885
1886 /* Get a window property */
1887 @REQ(get_window_property)
1888     user_handle_t  window;        /* handle to the window */
1889     atom_t         atom;          /* property atom */
1890 @REPLY
1891     obj_handle_t   handle;        /* handle stored in property */
1892 @END
1893
1894
1895 /* Get the list of properties of a window */
1896 @REQ(get_window_properties)
1897     user_handle_t  window;        /* handle to the window */
1898 @REPLY
1899     int            total;         /* total number of properties */
1900     VARARG(props,properties);     /* list of properties */
1901 @END
1902
1903
1904 /* Attach (or detach) thread inputs */
1905 @REQ(attach_thread_input)
1906     thread_id_t    tid_from;       /* thread to be attached */
1907     thread_id_t    tid_to;         /* thread to which tid_from should be attached */
1908     int            attach;         /* is it an attach? */
1909 @END
1910
1911
1912 /* Get input data for a given thread */
1913 @REQ(get_thread_input)
1914     thread_id_t    tid;           /* id of thread */
1915 @REPLY
1916     user_handle_t  focus;         /* handle to the focus window */
1917     user_handle_t  capture;       /* handle to the capture window */
1918     user_handle_t  active;        /* handle to the active window */
1919     user_handle_t  foreground;    /* handle to the global foreground window */
1920     user_handle_t  menu_owner;    /* handle to the menu owner */
1921     user_handle_t  move_size;     /* handle to the moving/resizing window */
1922     user_handle_t  caret;         /* handle to the caret window */
1923     rectangle_t    rect;          /* caret rectangle */
1924 @END
1925
1926 /* Retrieve queue keyboard state for a given thread */
1927 @REQ(get_key_state)
1928     thread_id_t    tid;           /* id of thread */
1929     int            key;           /* optional key code or -1 */
1930 @REPLY
1931     unsigned char  state;         /* state of specified key */
1932     VARARG(keystate,bytes);       /* state array for all the keys */
1933 @END
1934
1935 /* Set queue keyboard state for a given thread */
1936 @REQ(set_key_state)
1937     thread_id_t    tid;           /* id of thread */
1938     VARARG(keystate,bytes);       /* state array for all the keys */
1939 @END
1940
1941 /* Set the system foreground window */
1942 @REQ(set_foreground_window)
1943     user_handle_t  handle;        /* handle to the foreground window */
1944 @REPLY
1945     user_handle_t  previous;      /* handle to the previous foreground window */
1946     int            send_msg_old;  /* whether we have to send a msg to the old window */
1947     int            send_msg_new;  /* whether we have to send a msg to the new window */
1948 @END
1949
1950 /* Set the current thread focus window */
1951 @REQ(set_focus_window)
1952     user_handle_t  handle;        /* handle to the focus window */
1953 @REPLY
1954     user_handle_t  previous;      /* handle to the previous focus window */
1955 @END
1956
1957 /* Set the current thread active window */
1958 @REQ(set_active_window)
1959     user_handle_t  handle;        /* handle to the active window */
1960 @REPLY
1961     user_handle_t  previous;      /* handle to the previous active window */
1962 @END
1963
1964 /* Set the current thread capture window */
1965 @REQ(set_capture_window)
1966     user_handle_t  handle;        /* handle to the capture window */
1967     unsigned int   flags;         /* capture flags (see below) */
1968 @REPLY
1969     user_handle_t  previous;      /* handle to the previous capture window */
1970     user_handle_t  full_handle;   /* full 32-bit handle of new capture window */
1971 @END
1972 #define CAPTURE_MENU     0x01  /* capture is for a menu */
1973 #define CAPTURE_MOVESIZE 0x02  /* capture is for moving/resizing */
1974
1975
1976 /* Set the current thread caret window */
1977 @REQ(set_caret_window)
1978     user_handle_t  handle;        /* handle to the caret window */
1979     int            width;         /* caret width */
1980     int            height;        /* caret height */
1981 @REPLY
1982     user_handle_t  previous;      /* handle to the previous caret window */
1983     rectangle_t    old_rect;      /* previous caret rectangle */
1984     int            old_hide;      /* previous hide count */
1985     int            old_state;     /* previous caret state (1=on, 0=off) */
1986 @END
1987
1988
1989 /* Set the current thread caret information */
1990 @REQ(set_caret_info)
1991     unsigned int   flags;         /* caret flags (see below) */
1992     user_handle_t  handle;        /* handle to the caret window */
1993     int            x;             /* caret x position */
1994     int            y;             /* caret y position */
1995     int            hide;          /* increment for hide count (can be negative to show it) */
1996     int            state;         /* caret state (1=on, 0=off, -1=toggle current state) */
1997 @REPLY
1998     user_handle_t  full_handle;   /* handle to the current caret window */
1999     rectangle_t    old_rect;      /* previous caret rectangle */
2000     int            old_hide;      /* previous hide count */
2001     int            old_state;     /* previous caret state (1=on, 0=off) */
2002 @END
2003 #define SET_CARET_POS        0x01  /* set the caret position from x,y */
2004 #define SET_CARET_HIDE       0x02  /* increment the caret hide count */
2005 #define SET_CARET_STATE      0x04  /* set the caret on/off state */
2006
2007
2008 /* Set a window hook */
2009 @REQ(set_hook)
2010     int            id;             /* id of the hook */
2011     thread_id_t    tid;            /* id of thread to set the hook into */
2012     void*          proc;           /* hook procedure */
2013     int            unicode;        /* is it a unicode hook? */
2014     VARARG(module,unicode_str);    /* module name */
2015 @REPLY
2016     user_handle_t  handle;         /* handle to the hook */
2017 @END
2018
2019
2020 /* Remove a window hook */
2021 @REQ(remove_hook)
2022     user_handle_t  handle;         /* handle to the hook */
2023     int            id;             /* id of the hook if handle is 0 */
2024     void*          proc;           /* hook procedure if handle is 0 */
2025 @END
2026
2027
2028 /* Start calling a hook chain */
2029 @REQ(start_hook_chain)
2030     int            id;             /* id of the hook */
2031 @REPLY
2032     user_handle_t  handle;         /* handle to the next hook */
2033     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2034     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2035     void*          proc;           /* hook procedure */
2036     int            unicode;        /* is it a unicode hook? */
2037     VARARG(module,unicode_str);    /* module name */
2038 @END
2039
2040
2041 /* Finished calling a hook chain */
2042 @REQ(finish_hook_chain)
2043     int            id;             /* id of the hook */
2044 @END
2045
2046
2047 /* Get the next hook to call */
2048 @REQ(get_next_hook)
2049     user_handle_t  handle;         /* handle to the current hook */
2050 @REPLY
2051     user_handle_t  next;           /* handle to the next hook */
2052     int            id;             /* id of the next hook */
2053     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
2054     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
2055     void*          proc;           /* next hook procedure */
2056     int            prev_unicode;   /* was the previous a unicode hook? */
2057     int            next_unicode;   /* is the next a unicode hook? */
2058     VARARG(module,unicode_str);    /* module name */
2059 @END
2060
2061
2062 /* Create a window class */
2063 @REQ(create_class)
2064     int            local;          /* is it a local class? */
2065     atom_t         atom;           /* class atom */
2066     unsigned int   style;          /* class style */
2067     void*          instance;       /* module instance */
2068     int            extra;          /* number of extra class bytes */
2069     int            win_extra;      /* number of window extra bytes */
2070     void*          client_ptr;     /* pointer to class in client address space */
2071 @END
2072
2073
2074 /* Destroy a window class */
2075 @REQ(destroy_class)
2076     atom_t         atom;           /* class atom */
2077     void*          instance;       /* module instance */
2078 @REPLY
2079     void*          client_ptr;     /* pointer to class in client address space */
2080 @END
2081
2082
2083 /* Set some information in a class */
2084 @REQ(set_class_info)
2085     user_handle_t  window;         /* handle to the window */
2086     unsigned int   flags;          /* flags for info to set (see below) */
2087     atom_t         atom;           /* class atom */
2088     unsigned int   style;          /* class style */
2089     int            win_extra;      /* number of window extra bytes */
2090     void*          instance;       /* module instance */
2091     int            extra_offset;   /* offset to set in extra bytes */
2092     size_t         extra_size;     /* size to set in extra bytes */
2093     unsigned int   extra_value;    /* value to set in extra bytes */
2094 @REPLY
2095     atom_t         old_atom;       /* previous class atom */
2096     unsigned int   old_style;      /* previous class style */
2097     int            old_extra;      /* previous number of class extra bytes */
2098     int            old_win_extra;  /* previous number of window extra bytes */
2099     void*          old_instance;   /* previous module instance */
2100     unsigned int   old_extra_value; /* old value in extra bytes */
2101 @END
2102 #define SET_CLASS_ATOM      0x0001
2103 #define SET_CLASS_STYLE     0x0002
2104 #define SET_CLASS_WINEXTRA  0x0004
2105 #define SET_CLASS_INSTANCE  0x0008
2106 #define SET_CLASS_EXTRA     0x0010
2107
2108
2109 /* Set/get clipboard information */
2110 @REQ(set_clipboard_info)
2111     unsigned int   flags;       /* flags for fields to set (see below) */
2112     user_handle_t  clipboard;   /* clipboard window */
2113     user_handle_t  owner;       /* clipboard owner */
2114     user_handle_t  viewer;      /* first clipboard viewer */
2115     unsigned int   seqno;       /* change sequence number */
2116 @REPLY
2117     unsigned int   flags;           /* status flags (see below) */
2118     user_handle_t  old_clipboard;   /* old clipboard window */
2119     user_handle_t  old_owner;       /* old clipboard owner */
2120     user_handle_t  old_viewer;      /* old clipboard viewer */
2121     unsigned int   seqno;           /* current sequence number */
2122 @END
2123
2124 #define SET_CB_OPEN      0x001
2125 #define SET_CB_OWNER     0x002
2126 #define SET_CB_VIEWER    0x004
2127 #define SET_CB_SEQNO     0x008
2128 #define SET_CB_RELOWNER  0x010
2129 #define SET_CB_CLOSE     0x020
2130 #define CB_OPEN          0x040
2131 #define CB_OWNER         0x080
2132
2133
2134 /* Open a security token */
2135 @REQ(open_token)
2136     obj_handle_t   handle;    /* handle to the thread or process */
2137     unsigned int   flags;     /* flags (see below) */
2138 @REPLY
2139     obj_handle_t   token;    /* handle to the token */
2140 @END
2141 #define OPEN_TOKEN_THREAD   1
2142 #define OPEN_TOKEN_AS_SELF  2
2143
2144
2145 /* Set/get the global windows */
2146 @REQ(set_global_windows)
2147     unsigned int   flags;               /* flags for fields to set (see below) */
2148     user_handle_t  shell_window;        /* handle to the new shell window */
2149     user_handle_t  shell_listview;      /* handle to the new shell listview window */
2150     user_handle_t  progman_window;      /* handle to the new program manager window */
2151     user_handle_t  taskman_window;      /* handle to the new task manager window */
2152 @REPLY
2153     user_handle_t  old_shell_window;    /* handle to the shell window */
2154     user_handle_t  old_shell_listview;  /* handle to the shell listview window */
2155     user_handle_t  old_progman_window;  /* handle to the new program manager window */
2156     user_handle_t  old_taskman_window;  /* handle to the new task manager window */
2157 @END
2158 #define SET_GLOBAL_SHELL_WINDOWS   0x01  /* set both main shell and listview windows */
2159 #define SET_GLOBAL_PROGMAN_WINDOW  0x02
2160 #define SET_GLOBAL_TASKMAN_WINDOW  0x04