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